<!--
// Sidemenu show
function show(no){
var Obj=document.getElementById("menusub" + no);
//var ImgObj=eval("menuimg"+ no);
var tempColl = document.getElementsByTagName("ul");
 for(i=0; i<tempColl.length; i++)
 {
  if ((tempColl[i].id != Obj.id) && ((tempColl[i].className == "menusub"))){  
   tempColl[i].style.display = "none";
   }
   
 }
if(Obj.style.display=='none')
 {
   Obj.style.display='';
  // ImgObj.src='bbs_image/forum_parent_1.gif';
 }
else
 {
   Obj.style.display='none';
   //ImgObj.src='bbs_image/forum_parent_0.gif';
 }
}

function showta(no){
var Obj=eval("mm" + no);
var tempColl = document.getElementsByTagName("table");
 for(i=0; i<tempColl.length; i++)
 {
  if ((tempColl[i].id != Obj.id) && ((tempColl[i].className == "mm"))){  
   tempColl[i].style.display = "none";   
   }
   
 }	
 if(Obj.style.display=='none')
 {
   Obj.style.display='';
 }
}


function rates(no,state){
   var stars = document.getElementsByName("star");    
   document.rate.rep.value=no;
   for(i=0; i<no; i++)
   {
	   stars[i].src="Images/star2.gif";
   }
   for(j=no; j<5; j++)
   {
	   stars[j].src="Images/star1.gif";
   }
   
}

//other

function initMenu(obj,list) {
var cobj=document.getElementById(list);
if(cobj != null){
cobj.style.display=(cobj.style.display=="none") ? "" : "none";
}
}

function Winopen(Url)
{
	window.open(Url,"facility","left=0,top=0,width=700,height=600,toolbar=1,status=1,scrollbars=1");
}
function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
	
function showLargePic (pic) { 	
	if (document.getElementById) { 		
	document.getElementById('LargePic').src = pic.href;
	return false; 	
	} 
	  else { return true; } 
}
	
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

// feedback
function CheckForm()
{
	
	if(document.myformfeedback.username.value=="")
	{
		alert("Please Enter You Name");
		document.myformfeedback.username.focus();
		return false;
	}
	
	
		
 if(document.myformfeedback.email.value.length!=0)
  {
    if (document.myformfeedback.email.value.charAt(0)=="." ||        
         document.myformfeedback.email.value.charAt(0)=="@"||       
         document.myformfeedback.email.value.indexOf('@', 0) == -1 || 
         document.myformfeedback.email.value.indexOf('.', 0) == -1 || 
         document.myformfeedback.email.value.lastIndexOf("@")==document.myformfeedback.email.value.length-1 || 
         document.myformfeedback.email.value.lastIndexOf(".")==document.myformfeedback.email.value.length-1)
     {
      alert("E-mail format Error?");
      document.myformfeedback.email.focus();
      return false;
      }
   }
 else
  {
   alert("Please Enter You E-mail?");
   document.myformfeedback.email.focus();
   return false;
   }
	
	
	
	if(document.myformfeedback.tel.value=="")
	{
		alert("Please Enter You Tel");
		document.myformfeedback.tel.focus();
		return false;
	}
//	if(document.myformfeedback.content.value=="")
//	{
//		alert("Please Enter The content");
//		document.myformfeedback.content.focus();
//		return false;
//	}
	
}


//Reg
//function checkreginfo()
//{
//   
//   
//if(checkspace(document.userinfo.username.value) || document.userinfo.username.value.length< 4 )
//  {
//   alert("userid lenght must be over 4?");
//   document.userinfo.username.focus();
//   return false;
//   }
//  
//      if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6) 
// {
//	document.userinfo.userpassword.focus();
//    alert("userpassword lenght must be over 6?");
//	return false;
//  }
//  
//    if(document.userinfo.userpassword.value != document.userinfo.userpassword1.value) 
// {
//	document.userinfo.userpassword1.focus();
//	document.userinfo.userpassword1.value = '';
//    alert("Must be Filled the two password is the same?");
//	return false;
//  }
//    if(document.userinfo.question.value.length=="")
//  {
//   alert("Must be Filled Question?");
//   document.userinfo.question.focus();
//   return false;
//   }
//    if(document.userinfo.answer.value.length=="")
//  {
//   alert("Must be Filled Answer?");
//   document.userinfo.answer.focus();
//   return false;
//   }
//   
//  if(document.userinfo.firstname.value.length=="")
//  {
//   alert("Must be Filled firstname?");
//   document.userinfo.firstname.focus();            
//   return false;
//   }
//   if(document.userinfo.lastname.value.length=="")
//  {
//   alert("Must be Filled lastname?");
//   document.userinfo.lastname.focus();            
//   return false;
//   }
//     if(document.userinfo.address.value.length=="")
//  {
//   alert("Must be Filled Address?");
//   document.userinfo.address.focus();
//   return false;
//   }
//   if(document.userinfo.email.value.length!=0)
//  {
//    if (document.userinfo.email.value.charAt(0)=="." ||        
//         document.userinfo.email.value.charAt(0)=="@"||       
//         document.userinfo.email.value.indexOf('@', 0) == -1 || 
//         document.userinfo.email.value.indexOf('.', 0) == -1 || 
//         document.userinfo.email.value.lastIndexOf("@")==document.userinfo.email.value.length-1 || 
//         document.userinfo.email.value.lastIndexOf(".")==document.userinfo.email.value.length-1)
//      {
//      alert("email format is error?");
//      document.userinfo.email.focus();
//      return false;
//      }
//   }
// else
//  {
//   alert("Must be Filled email?");
//   document.userinfo.email.focus();
//   return false;
//   }
//   if(document.userinfo.city.value.length=="")
//  {
//   alert("Must be Filled city?");
//   document.userinfo.city.focus();            
//   return false;
//   }
//   if(document.userinfo.province.value.length=="")
//  {
//   alert("Must be Filled province?");
//   document.userinfo.province.focus();            
//   return false;
//   }
//     if(document.userinfo.fax.value.length=="")
//  {
//   alert("Must be Filled Zip/Postal code?");
//   document.userinfo.fax.focus();            
//   return false;
//   }
//   if(document.userinfo.country.value.length=="")
//  {
//   alert("Must be Filled Country?");
//   document.userinfo.country.focus();
//   return false;
//   }
//    if(document.userinfo.tel.value.length=="")
//  {
//   alert("Must be Filled tel?");
//   document.userinfo.tel.focus();            
//   return false;
//   }
//   if(document.userinfo.msn.value.length=="")
//  {
//   alert("Must be Filled MSN?");
//   document.userinfo.msn.focus();            
//   return false;
//   }
//     
//   
//}


//vip     
function checkuserinfo()
{  
               
  if(document.userinfo.firstname.value.length=="" )
  {
   alert("Must be Filled First Name?");
   document.userinfo.firstname.focus();
   return false;
   }
   
  if(document.userinfo.lastname.value.length=="" )
  {
   alert("Must be Filled Last Name? ");
   document.userinfo.lastname.focus();
   return false;
   }
   
  if(document.userinfo.street.value.length=="" )
  {
   alert("Must be Filled Street Address? ");
   document.userinfo.street.focus();
   return false;
   }
      
   if(document.userinfo.city.value.length=="" )
  {
   alert("Must be Filled City? ");
   document.userinfo.city.focus();
   return false;
   }
   
   if(document.userinfo.province.value.length=="" )
  {
   alert("Must be Filled Province? ");
   document.userinfo.province.focus();
   return false;
   }
   
   if(document.userinfo.postcode.value.length=="")
  {
   alert("Must be Filled Post Code? ");
   document.userinfo.postcode.focus();
   return false;
   }
   
   if(document.userinfo.country.value.length=="")
  {
   alert("Must be Select the Country? ");
   document.userinfo.country.focus();
   return false;
   }
   
    if(document.userinfo.email.value.length!=0)
  {
    if (document.userinfo.email.value.charAt(0)=="." ||        
         document.userinfo.email.value.charAt(0)=="@"||       
         document.userinfo.email.value.indexOf('@', 0) == -1 || 
         document.userinfo.email.value.indexOf('.', 0) == -1 || 
         document.userinfo.email.value.lastIndexOf("@")==document.userinfo.email.value.length-1 || 
         document.userinfo.email.value.lastIndexOf(".")==document.userinfo.email.value.length-1)
     {
      alert("E-mail format error?");
      document.userinfo.email.focus();
      return false;
      }
   }
  else
  {
   alert("Must be Filled Email?");
   document.userinfo.email.focus();
   return false;
   }
   
   if(document.userinfo.msn.value.length!=0)
  {
    if (document.userinfo.msn.value.charAt(0)=="." ||        
         document.userinfo.msn.value.charAt(0)=="@"||       
         document.userinfo.msn.value.indexOf('@', 0) == -1 || 
         document.userinfo.msn.value.indexOf('.', 0) == -1 || 
         document.userinfo.msn.value.lastIndexOf("@")==document.userinfo.msn.value.length-1 || 
         document.userinfo.msn.value.lastIndexOf(".")==document.userinfo.msn.value.length-1)
     {
      alert("Msn format error?");
      document.userinfo.msn.focus();
      return false;
      }
   }
  else
  {
   alert("Must be Filled MSN?");
   document.userinfo.msn.focus();
   return false;
   }
   
   if(document.userinfo.tel.value.length=="" )
  {
   alert("Must be Filled Telephone? ");
   document.userinfo.tel.focus();
   return false;
   }
   
      
   if(document.userinfo.birth.value.length=="")
  {s
   alert("Must be Filled Birthday?");
   document.userinfo.birth.focus();
   return false;
   }   
           
}


function changeinfo()
{  
  
  if(document.userinfo.username.value.length=="" )
  {
   alert("Must be Filled username? ");
   document.userinfo.username.focus();
   return false;
   }
   
  if(document.userinfo.street.value.length=="" )
  {
   alert("Must be Filled street? ");
   document.userinfo.street.focus();
   return false;
   }
   
  if(document.userinfo.city.value.length=="")
  {
   alert("Must be Filled city?");
   document.userinfo.city.focus();
   return false;
   }
      
   if(document.userinfo.province.value.length=="" )
  {
   alert("Must be Filled province? ");
   document.userinfo.province.focus();
   return false;
   }
   
   if(document.userinfo.country.value.length=="" )
  {
   alert("Must be Filled country? ");
   document.userinfo.country.focus();
   return false;
   }
   
   if(document.userinfo.postcode.value.length=="" )
  {
   alert("Must be Filled Post Code?");
   document.userinfo.postcode.focus();
   return false;
   }
   
   if(document.userinfo.tel.value.length=="")
  {
   alert("Must be Select the tel? ");
   document.userinfo.tel.focus();
   return false;
   }
   
   if(document.userinfo.email.value.length!=0)
  {
    if (document.userinfo.email.value.charAt(0)=="." ||        
         document.userinfo.email.value.charAt(0)=="@"||       
         document.userinfo.email.value.indexOf('@', 0) == -1 || 
         document.userinfo.email.value.indexOf('.', 0) == -1 || 
         document.userinfo.email.value.lastIndexOf("@")==document.userinfo.email.value.length-1 || 
         document.userinfo.email.value.lastIndexOf(".")==document.userinfo.email.value.length-1)
     {
      alert("Please input a correct e-mail");
      document.userinfo.email.focus();
      return false;
      }
   }
   else
  {
	   alert("Please input the e-mail");
	   document.userinfo.email.focus();
	   return false;
   }   
           
}


function check0()
{
   if(checkspace(document.shop0.email.value)) {
	document.shop0.email.focus();
    alert("Must be Fill You email?");
	return false;
  }
  }
function check1()
{
   if(checkspace(document.shop1.UserAnswer.value)) {
	document.shop1.UserAnswer.focus();
    alert("Must be Fill answer");
	return false;
  }
  }
   function check2()
{
   if(checkspace(document.shop2.UserPassword1.value)) {
	document.shop2.UserPassword1.focus();
    alert("Must be Fill new password");
	return false;
  }
  if(checkspace(document.shop2.UserPassword2.value)) {
	document.shop2.UserPassword2.focus();
    alert("Must be Fill confirm password");
	return false;
  }
  if(document.shop2.UserPassword1.value != document.shop2.UserPassword2.value) {
	document.shop2.UserPassword1.focus();
	document.shop2.UserPassword1.value = '';
	document.shop2.UserPassword2.value = '';
    alert("the two password is the same?");
	return false;
  }
}

function checkrepass()
{
   if(checkspace(document.userpass.UserPassword.value)) {
	document.userpass.UserPassword.focus();
    alert("Must be Fill old password");
	return false;
  }
     if(checkspace(document.userpass.UserPassword1.value)|| document.userpass.UserPassword1.value.length< 6) {
	document.userpass.UserPassword1.focus();
    alert("error:The new password must be more than 6 characters in length");
	return false;
  }
     if(checkspace(document.userpass.UserPassword2.value)) {
	document.userpass.UserPassword2.focus();
    alert("Must be Fill confirm password");
	return false;
  }
   if(document.userpass.UserPassword1.value != document.userpass.UserPassword2.value) {
	document.userpass.UserPassword1.focus();
	document.userpass.UserPassword1.value = '';
	document.userpass.UserPassword2.value = '';
    alert("the two password is the same?");
	return false; 
  }
}

  function checkuu()
{
    if(checkspace(document.loginfo.email.value)) {
	document.loginfo.email.focus();
    alert("Must be Fill Account");
	return false;
  }
    if(checkspace(document.loginfo.UserPassword.value)) {
	document.loginfo.UserPassword.focus();
    alert("Must be Fill password");
	return false;
  }   
	
  }
  
  
 //order 
 function OrderCheckForm()
{
	
	if(document.order_myform.firstname.value=="")
	{
		alert("Please enter your firstname");
		document.order_myform.firstname.focus();
		return false;
	}
	if(document.order_myform.lastname.value=="")
	{
		alert("Please enter your lastname");
		document.order_myform.lastname.focus();
		return false;
	}
	if(document.order_myform.email.value.length!=0)
  {
    if (document.order_myform.email.value.charAt(0)=="." ||        
         document.order_myform.email.value.charAt(0)=="@"||       
         document.order_myform.email.value.indexOf('@', 0) == -1 || 
         document.order_myform.email.value.indexOf('.', 0) == -1 || 
         document.order_myform.email.value.lastIndexOf("@")==document.order_myform.email.value.length-1 || 
         document.order_myform.email.value.lastIndexOf(".")==document.order_myform.email.value.length-1)
     {
      alert("E-mail Malformed");
      document.order_myform.email.focus();
      return false;
      }
   }
 else
  {
   alert("E-mail Can not be empty");
   document.order_myform.email.focus();
   return false;
   }
   if(document.order_myform.address.value=="")
	{
		alert("Please enter your address ");
		document.order_myform.address.focus();
		return false;
	}
	if(document.order_myform.city.value=="")
	{
		alert("Please enter your city");
		document.order_myform.city.focus();
		return false;
	}
	if(document.order_myform.province.value=="")
	{
		alert("Please enter your province");
		document.order_myform.province.focus();
		return false;
	}
   if(document.order_myform.country.value=="")
	{
		alert("Please enter your country name");
		document.order_myform.country.focus();
		return false;
	}

	if(document.order_myform.zip.value=="")
	{
		alert("Please enter your ZIP code");
		document.order_myform.zip.focus();
		return false;
	}	
   
	
	
	
	
	if(document.order_myform.paymethod.value=="")
	{
		alert("Please Select paymethod");
		document.order_myform.paymethod.focus();
		return false;
	}
	
}



function chkemail()
{
  if(document.sendmail.email.value.length!=0)
  {
    if (document.sendmail.email.value.charAt(0)=="." ||        
         document.sendmail.email.value.charAt(0)=="@"||       
         document.sendmail.email.value.indexOf('@', 0) == -1 || 
         document.sendmail.email.value.indexOf('.', 0) == -1 || 
         document.sendmail.email.value.lastIndexOf("@")==document.sendmail.email.value.length-1 || 
         document.sendmail.email.value.lastIndexOf(".")==document.sendmail.email.value.length-1)
     {
      alert("Please input a correct e-mail");
      document.sendmail.email.focus();
      return false;
      }
   }
   else
  {
	   alert("Please input the e-mail");
	   document.sendmail.email.focus();
	   return false;
   }
}

function kkform()
{
  if(document.stform.classid.value=="0")
  {
	  document.stform.action="productinfo.asp";
  }
  else
  {
	  document.stform.action="product.asp";
  }
}

function selshipf()
{
  if(document.selship.ship.value.length==0)
  {
	  alert("Please select the payment method");
	  return false;
  }
  else
    return true;
}
//-->



 function CheckUlogin()
{
    if(checkspace(document.Ulogin.Uname.value)) {
	document.Ulogin.Uname.focus();
    alert("Please enter your account number");
	return false;
  }
    if(checkspace(document.Ulogin.Upassword.value)) {
	document.Ulogin.Upassword.focus();
    alert("Please enter your password");
	return false;
  }   
	
  }
  
  function checkreg()
{  
  
  if(document.userinfo.firstname.value.length=="" )
  {
   alert("Please enter your firstname?");
   document.userinfo.firstname.focus();
   return false;
   }
   
  if(document.userinfo.lastname.value.length=="")
  {
   alert("Please enter your lastname?");
   document.userinfo.lastname.focus();
   return false;
   }
   
   if(document.userinfo.country.value.length=="")
  {
   alert("Please enter your country? ");
   document.userinfo.country.focus();
   return false;
   }
   
    if(document.userinfo.province.value.length=="")
  {
   alert("Please enter your province?");
   document.userinfo.province.focus();
   return false;
   }
   
   if(document.userinfo.city.value.length=="")
  {
   alert("Please enter your city?");
   document.userinfo.city.focus();
   return false;
   }
   
  if(document.userinfo.address.value.length=="")
  {
   alert("Please enter your street in detail?");
   document.userinfo.address.focus();
   return false;
   }
      
   
   if(document.userinfo.postcode.value.length=="")
  {
   alert("Please enter your zip code area?");
   document.userinfo.postcode.focus();
   return false;
   }
   
  
   
    if(document.userinfo.email.value.length!=0)
  {
    if (document.userinfo.email.value.charAt(0)=="." ||        
         document.userinfo.email.value.charAt(0)=="@"||       
         document.userinfo.email.value.indexOf('@', 0) == -1 || 
         document.userinfo.email.value.indexOf('.', 0) == -1 || 
         document.userinfo.email.value.lastIndexOf("@")==document.userinfo.email.value.length-1 || 
         document.userinfo.email.value.lastIndexOf(".")==document.userinfo.email.value.length-1)
     {
      alert("E-mail Format error?");
      document.userinfo.email.focus();
      return false;
      }
   }
  else
  {
   alert("Please fill in your Email?");
   document.userinfo.email.focus();
   return false;
   }
   
      
 if(document.userinfo.username.value.length=="" || document.userinfo.username.value.length < 4)
  {
   alert("Account the length of the short?");
   document.userinfo.username.focus();
   return false;
   }
   
   if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6) {
	document.userinfo.userpassword.focus();
    alert("Password length is too short ?");
	return false;
   }
    if(document.userinfo.userpassword.value != document.userinfo.userpassword1.value) {
	document.userinfo.userpassword1.focus();
	document.userinfo.userpassword1.value = '';
    alert("Two password the importation is inconsistent?");
	return false;
   }
   
    if(document.userinfo.question.value.length=="")
  {
   alert("Problem can not be empty?");
   document.userinfo.question.focus();
   return false;
   }
   
     if(document.userinfo.answer.value.length=="")
  {
   alert("The answer can not be empty?");
   document.userinfo.answer.focus();
   return false;
   }
   
  
}

function cheackxj()
{
	
	if(document.pinlun.name.value=="")
	{
		alert("Please enter you name!");
		document.pinlun.name.focus();
		return false;
	}
	
	  if(document.pinlun.Email.value.length!=0)
  {
    if (document.pinlun.Email.value.charAt(0)=="." ||        
         document.pinlun.Email.value.charAt(0)=="@"||       
         document.pinlun.Email.value.indexOf('@', 0) == -1 || 
         document.pinlun.Email.value.indexOf('.', 0) == -1 || 
         document.pinlun.Email.value.lastIndexOf("@")==document.pinlun.Email.value.length-1 || 
         document.pinlun.Email.value.lastIndexOf(".")==document.pinlun.Email.value.length-1)
     {
      alert("E-mail Format error?");
      document.pinlun.Email.focus();
      return false;
      }
   }
  else
  {
   alert("Please fill in your Email?");
   document.pinlun.Email.focus();
   return false;
   }

	//	if(document.pinlun.xj.value=="0")
//	{
//		alert("Please select star!");
//		document.pinlun.xj.focus();
//		return false;
//	}
	
	
		if(document.pinlun.content.value=="")
	{
		alert("Please enter the words you want to say?!");
		document.pinlun.content.focus();
		return false;
	}
	
	
}



 function checkcus()
{  
  
  if(document.Uuserinfo.firstname.value.length=="" )
  {
   alert("Please enter your firstname?");
   document.Uuserinfo.firstname.focus();
   return false;
   }
   
  if(document.Uuserinfo.lastname.value.length=="")
  {
   alert("Please enter your last name?");
   document.Uuserinfo.lastname.focus();
   return false;
   }
   
   if(document.Uuserinfo.country.value.length=="")
  {
   alert("Please enter your country? ");
   document.Uuserinfo.country.focus();
   return false;
   }
   
    if(document.Uuserinfo.province.value.length=="")
  {
   alert("Please enter your province?");
   document.Uuserinfo.province.focus();
   return false;
   }
   
   if(document.Uuserinfo.city.value.length=="")
  {
   alert("Please enter your city?");
   document.Uuserinfo.city.focus();
   return false;
   }
   
  if(document.Uuserinfo.address.value.length=="")
  {
   alert("Please enter your street in detail?");
   document.Uuserinfo.address.focus();
   return false;
   }
      
   
   if(document.Uuserinfo.postcode.value.length=="")
  {
   alert("Please enter your zip code area?");
   document.Uuserinfo.postcode.focus();
   return false;
   }
   
  
   
    if(document.Uuserinfo.email.value.length!=0)
  {
    if (document.Uuserinfo.email.value.charAt(0)=="." ||        
         document.Uuserinfo.email.value.charAt(0)=="@"||       
         document.Uuserinfo.email.value.indexOf('@', 0) == -1 || 
         document.Uuserinfo.email.value.indexOf('.', 0) == -1 || 
         document.Uuserinfo.email.value.lastIndexOf("@")==document.Uuserinfo.email.value.length-1 || 
         document.Uuserinfo.email.value.lastIndexOf(".")==document.Uuserinfo.email.value.length-1)
     {
      alert("E-mail Format error?");
      document.Uuserinfo.email.focus();
      return false;
      }
   }
  else
  {
   alert("Please fill in your Email?");
   document.Uuserinfo.email.focus();
   return false;
   }
   
   
    if(document.Uuserinfo.question.value.length=="")
  {
   alert("Problem can not be empty?");
   document.Uuserinfo.question.focus();
   return false;
   }
   
   
   
  
}
