

function str_len(str){
	return str.replace(/[^\x00-\xff]/g,"**").length;
}



function submitorderss(){

	if(document.getElementById("fname").value==""){
			alert('Fill your firstname');
			document.getElementById("fname").focus();
			return false;
	}

	if(document.getElementById("lname").value==""){
			alert('Fill your lastname');
			document.getElementById("lname").focus();
			return false;
	}	
	
	if(document.getElementById("tel1").value==""){
			alert('Fill your Tel');
			document.getElementById("tel1").focus();
			return false;
	}	
	
	if(document.getElementById("address").value==""){
			alert('Fill your Full address');
			document.getElementById("address").focus();
			return false;
	}	
	if(document.getElementById("email").value==""){
			alert('Fill your Full email');
			document.getElementById("email").focus();
			return false;
	}			
		document.getElementById("ggdfd").submit();
}


function checkpass()
{	


	if(str_len(document.getElementById("oldpass").value.replace(/(^\s*)|(\s*$)/g, ""))<6 || str_len(document.getElementById("oldpass").value.replace(/(^\s*)|(\s*$)/g, ""))>14){
		alert("Old Password length error!(6-14)");
		document.getElementById("oldpass").select();
		return false;
	}
	

	
	if(str_len(document.getElementById("newpass1").value.replace(/(^\s*)|(\s*$)/g, ""))<6 || str_len(document.getElementById("newpass1").value.replace(/(^\s*)|(\s*$)/g, ""))>14){
			alert("New Password1 length error!(6-14)");
		document.getElementById("newpass1").select();
		return false;
	}	
	if(document.getElementById("newpass1").value!=document.getElementById("newpass2").value)
	{
		alert("New Password2 error!");
		document.getElementById("newpass2").select();
		return false;
	}
}









function Addme(){ 
		url = "http://www.Lj-fashion.com/"; 
		title = "Lj-fashion"; 
		window.external.AddFavorite(url,title); 
}



function defaul_home(){
	this.home.style.behavior='url(#default#homepage)';
	this.home.setHomePage('http://www.Lj-fashion.com/');
}




function checklogin(){
		if(document.getElementById('userem').value==""){
			alert("Logname Cannot Be Empty!");
			document.getElementById('userem').focus();
			return false;
		}
		
		if(document.getElementById('userpwd').value==""){
			alert("Password Cannot Be Empty!");
			document.getElementById('userpwd').focus();
			return false;
		}	
		
		//form1.submit();
}







function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function checkuserinfo()
{

   if(checkspace(document.userinfo.username.value)) {
	document.userinfo.username.focus();
    alert("Sorry, please fill in user！");
	return false;
  }
    if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6 || document.userinfo.userpassword.value.length >20) {
	document.userinfo.userpassword.focus();
    alert("The password length has no alternative but to be able this to bespatial, in 6 to 20 between, please reinputs！");
	return false;
  }
    if(document.userinfo.userpassword.value != document.userinfo.userpassword1.value) {
	document.userinfo.userpassword.focus();
	document.userinfo.userpassword.value = '';
	document.userinfo.userpassword1.value = '';
    alert("Two time inputs the password is different, please reinputs ！");
	return false;
  }

 if(document.userinfo.useremail.value.length!=0)
  {
    if (document.userinfo.useremail.value.charAt(0)=="." ||        
         document.userinfo.useremail.value.charAt(0)=="@"||       
         document.userinfo.useremail.value.indexOf('@', 0) == -1 || 
         document.userinfo.useremail.value.indexOf('.', 0) == -1 || 
         document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 || 
         document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
     {
      alert("The Email address pattern is not correct ！");
      document.userinfo.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("Email cannot be spatial ！");
   document.userinfo.useremail.focus();
   return false;
   }
   if(checkspace(document.userinfo.userzhenshiname.value)) {
	document.userinfo.userzhenshiname.focus();
    alert("Sorry, please fill in the real name ！");
	return false;
  }
  if(checkspace(document.userinfo.shouhuodizhi.value)) {
	document.userinfo.shouhuodizhi.focus();
    alert("Sorry, please fill in the consignee in detail to receive goods theaddress ！");
	return false;
  }
  if(checkspace(document.userinfo.youbian.value)) {
	document.userinfo.youbian.focus();
    alert("Sorry, please fill in the zip code ！");
	return false;
  }

    if(checkspace(document.userinfo.phone.value)) {
	document.userinfo.phone.focus();
    alert("Sorry, please leave behind your telephone！");
	return false;
  }

}



function checkuserinfo_mod()
{


 if(document.userinfo.useremail.value.length!=0)
  {
    if (document.userinfo.useremail.value.charAt(0)=="." ||        
         document.userinfo.useremail.value.charAt(0)=="@"||       
         document.userinfo.useremail.value.indexOf('@', 0) == -1 || 
         document.userinfo.useremail.value.indexOf('.', 0) == -1 || 
         document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 || 
         document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
     {
      alert("The Email address pattern is not correct ！");
      document.userinfo.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("Email cannot be spatial ！");
   document.userinfo.useremail.focus();
   return false;
   }
   if(checkspace(document.userinfo.userzhenshiname.value)) {
	document.userinfo.userzhenshiname.focus();
    alert("Sorry, please fill in the real name ！");
	return false;
  }
  if(checkspace(document.userinfo.shouhuodizhi.value)) {
	document.userinfo.shouhuodizhi.focus();
    alert("Sorry, please fill in the consignee in detail to receive goods theaddress ！");
	return false;
  }
  if(checkspace(document.userinfo.youbian.value)) {
	document.userinfo.youbian.focus();
    alert("Sorry, please fill in the zip code ！");
	return false;
  }

    if(checkspace(document.userinfo.phone.value)) {
	document.userinfo.phone.focus();
    alert("Sorry, please leave behind your telephone！");
	return false;
  }

}






function checkcommnet()
{
  if(checkspace(document.pinglunform.pinglunname.value)) {
	document.pinglunform.pinglunname.focus();
    alert("Please fill in your name");
	return false;
  }
  if(checkspace(document.pinglunform.pingluntitle.value)) {
	document.pinglunform.pingluntitle.focus();
    alert("Please fill out comment Title");
	return false;
  }
  if(checkspace(document.pinglunform.email.value)) {
	document.pinglunform.email.focus();
    alert("Please fill out email ");
	return false;
  }  
  
  if(checkspace(document.pinglunform.textarea.value)) {
	document.pinglunform.textarea.focus();
    alert("Please fill out comment on the text");
	return false;
  }
 }


function checkcommnet2()
{
  if(checkspace(document.pinglunform.pinglunname.value)) {
	document.pinglunform.pinglunname.focus();
    alert("Please fill in your name");
	return false;
  }
  if(checkspace(document.pinglunform.pingluntitle.value)) {
	document.pinglunform.pingluntitle.focus();
    alert("Please fill out guestbook Title");
	return false;
  }
  if(checkspace(document.pinglunform.email.value)) {
	document.pinglunform.email.focus();
    alert("Please fill out email ");
	return false;
  }  
  
  if(checkspace(document.pinglunform.textarea.value)) {
	document.pinglunform.textarea.focus();
    alert("Please fill out guestbook on the text");
	return false;
  }
  if(document.getElementById("sysnom").value.length<4){
			alert("code error");
			document.getElementById("sysnom").focus();
			return false;
	}
  
}


var jsID = "";
function showhiden(cssid){	
 var obj = document.getElementById(cssid); 
 obj.className = (obj.className.toLowerCase() == "expanded"?"k1":"expanded");
 if((jsID!="")&&(cssid!=jsID)) 
 {
  document.getElementById(jsID).className = "k1";
 }
 jsID = cssid;

}


function GetQueryString(name) {   
  
   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");   
  
   var r = window.location.search.substr(1).match(reg);   
  
   if (r!=null) return unescape(r[2]); return null;   
  
}   


