var CurrentMemu=0;
function loadmemu(n)
{
	var me=document.getElementById('memu');   
	var url='http://www.ledarea.com/';
    if(me)
    {         
        var lis=me.getElementsByTagName("li");
       	
        for(var i=0;i<lis.length;i++)
        {           
			lis[i].id='memu'+i;
			lis[i].onmouseover=function (){
				if(this.className.indexOf('2')!=-1)
				{
					this.className=this.className.replace('2','1');
				}
			};     
			lis[i].onmouseout=function (){
				if(this.className.indexOf('1')!=-1)
				{
					this.className=this.className.replace('1','2');
					SetCurrentMemu(CurrentMemu);
				}
			};    
			lis[i].onclick=function (){
				switch(this.id)
				{
						case 'memu0':
						window.location.href=url+'index'+n+'.asp';
						break;
						case 'memu1':
						window.location.href=url+'about'+n+'.asp';
						break;
						case 'memu2':
						window.location.href=url+'product'+n+'.asp';
						break;
						case 'memu3':
						window.location.href=url+'Customer'+n+'.asp';
						break;
						case 'memu4':
						window.location.href='mngproduct'+n+'.aspx';
						break;
						case 'memu5':
						window.location.href=url+'Contact'+n+'.asp';
						break;
				}
										
				
			};     
        }
    }
}
function SetCurrentMemu(j)
{
	CurrentMemu=j;
	var me=document.getElementById('memu');   
    if(me)
    {         
        var lis=me.getElementsByTagName("li");
       	
        for(var i=0;i<lis.length;i++)
        {       
			if(i==j)
			{
				lis[i].className=lis[i].className.replace('2','1');
				break;
			}			
        }
    }
}
function $(id){if(document.getElementById(id)){return document.getElementById(id);}else{alert("Ã»ÓÐÕÒµ½!")}}
function $tag(id,tagName){return $(id).getElementsByTagName(tagName)}

function LoginUser(userid,pwd)
{
	if(userid.length<=0)
	{
		alert('MemberId can not be empty');
		return false;
	}
	if(pwd.length<=0)
	{
		alert('Password  can not be empty');
		return false;
	}
		var Script1_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  		Script1_xmlhttp.Open("POST", "mdpassword.asp?HasPwd=" +pwd, false);
  		Script1_xmlhttp.Send();
  		var refreshStr= Script1_xmlhttp.responseText;
		document.login.hiddenpwd.value=refreshStr		
		var Script1_xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
		Script1_xmlhttp1.Open("POST", "mdpassword1.asp?HasPwd=" +pwd, false);
  		Script1_xmlhttp1.Send();  		
		document.login.hiddenpwd1.value=Script1_xmlhttp1.responseText;	
		
		//document.login.submit()
}
function UpdateUserPwd(oldpwd,newpwd1,newpwd2)
{	
	if(oldpwd.length<=0)
	{
		alert('Old Password can not be empty');
		return false;
	}
	if(newpwd1.length<=0 || newpwd2.lenght<=0)
	{
		alert('Password  can not be empty');
		return false;
	}
	if(newpwd1 !=newpwd2)
	{
		alert('Not the same password twice');
		return false;
	}
		document.modifypwd.hfnewpwd2.value=newpwd1;
		document.modifypwd.hfoldpwd2.value=oldpwd;
		var Script1_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  		Script1_xmlhttp.Open("POST", "HashPassword.aspx?HasPwd=" +newpwd1, false);
  		Script1_xmlhttp.Send();
  		var newStr= Script1_xmlhttp.responseText;		
		
		document.modifypwd.hfnewpwd.value=newStr;	
		var Script1_xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
		Script1_xmlhttp1.Open("POST", "HashPassword.aspx?HasPwd=" +oldpwd, false);
  		Script1_xmlhttp1.Send();
  		var oldStr= Script1_xmlhttp1.responseText;	
		document.modifypwd.hfoldpwd.value=oldStr;
		
		//alert(document.modifypwd.hfnewpwd.value)
		//alert(document.modifypwd.hfoldpwd.value)
		document.modifypwd.submit()
}

