<!--

// Sidemenu show
function show(no){
var Obj=eval("menusub" + no);
//var ImgObj=eval("menuimg"+ no);
var tempColl = document.getElementsByTagName("li");
 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';
 }
}

//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 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("Must be Filled?name?");
		document.myformfeedback.username.focus();
		return false;
	}
	
	if(document.myformfeedback.tel.value=="")
	{
		alert("Must be Filled?tel?");
		document.myformfeedback.tel.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 spelling error?");
      document.myformfeedback.email.focus();
      return false;
      }
   }
 else
  {
   alert("Must be Filled?E-mail?");
   document.myformfeedback.email.focus();
   return false;
   }
	if(document.myformfeedback.title.value=="")
	{
		alert("Must be Filled?subject?");
		document.myformfeedback.title.focus();
		return false;
	}
	if(document.myformfeedback.content.value=="")
	{
		alert("Must be Filled?content?");
		document.myformfeedback.content.focus();
		return false;
	}
}


//Reg
function checkreginfo()
{
  
  if(checkspace(document.userinfo.username.value) || document.userinfo.username.value.length< 4 )
  {
   alert("Must be Filled?username?");
   document.userinfo.username.focus();
   return false;
   }
  
    if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6) {
	document.userinfo.userpassword.focus();
    alert("Must be Filled?userpassword?");
	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(checkspace(document.userinfo.firstname.value))
  {
   alert("Must be Filled?firstname?");
   document.userinfo.firstname.focus();
   return false;
   }
    if(checkspace(document.userinfo.lastname.value))
  {
   alert("Must be Filled?lastname?");
   document.userinfo.lastname.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("Must be Filled?email?");
      document.userinfo.email.focus();
      return false;
      }
   }
 else
  {
   alert("Must be Filled?email?");
   document.userinfo.email.focus();
   return false;
   }
   
    if(checkspace(document.userinfo.tel.value))
  {
   alert("Must be Filled?tel?");
   document.userinfo.tel.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("Must be Filled?msn?");
      document.userinfo.msn.focus();
      return false;
      }
   }
 else
  {
   alert("Must be Filled?msn?");
   document.userinfo.msn.focus();
   return false;
   }
    if(checkspace(document.userinfo.street.value))
  {
   alert("Must be Filled?street?");
   document.userinfo.street.focus();
   return false;
   }
    if(checkspace(document.userinfo.city.value))
  {
   alert("Must be Filled?city?");
   document.userinfo.city.focus();
   return false;
   }
    if(checkspace(document.userinfo.province.value))
  {
   alert("Must be Filled?province?");
   document.userinfo.province.focus();
   return false;
   }
    if(checkspace(document.userinfo.fax.value))
  {
   alert("Must be Filled?Zip?");
   document.userinfo.fax.focus();
   return false;
   }
    if(checkspace(document.userinfo.country.value))
  {
   alert("Must be Filled?country?");
   document.userinfo.country.focus();
   return false;
   }  
}

//vip 
function checkuserinfo()
{
 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("Email error?");
      document.userinfo.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("Must be Fill?Email");
   document.userinfo.useremail.focus();
   return false;
   }
}

function check0()
{
   if(checkspace(document.shop0.username.value)) {
	document.shop0.username.focus();
    alert("Must be Fill?Member ID");
	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.focus();
    alert("Must be Fill?new password");
	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.username.value)) {
	document.loginfo.username.focus();
    alert("Must be Fill?User ID");
	return false;
  }
    if(checkspace(document.loginfo.UserPassword.value)) {
	document.loginfo.UserPassword.focus();
    alert("Must be Fill?Password");
	return false;
  }
    if(checkspace(document.loginfo.Validate.value)){
	document.loginfo.Validate.focus();
	alert("Must be Fill?Validate");
	return false;
	}
	
  }
  
  
 //order 
function OrderCheckForm()
{
	
	if(document.order_myform.firstname.value=="")
	{
		alert("Must be Filled First Name?");
		document.order_myform.firstname.focus();
		return false;
	}
	if(document.order_myform.lastname.value=="")
	{
		alert("Must be Filled Last Name?");
		document.order_myform.lastname.focus();
		return false;
	}
	
	if(document.order_myform.company.value=="")
	{
		alert("Must be Filled Company?");
		document.order_myform.company.focus();
		return false;
	}
	
	
	if(document.order_myform.msn.value=="")
	{
		alert("Must be Filled Address?");
		document.order_myform.msn.focus();
		return false;
	}
    
	if(document.order_myform.city.value=="")
	{
		alert("Must be Filled City?");
		document.order_myform.city.focus();
		return false;
	}
	if(document.order_myform.province.value=="")
	{
		alert("Must be Filled State / Province?");
		document.order_myform.province.focus();
		return false;
	}
		
	
	if(document.order_myform.country.value=="")
	{
		alert("Must be Filled Country?");
		document.order_myform.country.focus();
		return false;
	}
	if(document.order_myform.tel.value=="")
	{
		alert("Must be Filled Phone?");
		document.order_myform.tel.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("Email error?");
      document.order_myform.email.focus();
      return false;
      }
   }
 else
  {
   alert("Must be Fill Email");
   document.order_myform.email.focus();
   return false;
   }
}

//product comment
function CheckCommentForm()
{
    if(document.myformcomment.Title.value=="")
	{
		alert("Please input the Title!");
		document.myformcomment.Title.focus();
		return false;
	}
	
	if(document.myformcomment.Name.value=="")
	{
		alert("Please input your Name!");
		document.myformcomment.Name.focus();
		return false;
	}
	
	if(document.myformcomment.Email.value.length!=0)
	{
		if (document.myformcomment.Email.value.charAt(0)=="." ||        
			 document.myformcomment.Email.value.charAt(0)=="@"||       
			 document.myformcomment.Email.value.indexOf('@', 0) == -1 || 
			 document.myformcomment.Email.value.indexOf('.', 0) == -1 || 
			 document.myformcomment.Email.value.lastIndexOf("@")==document.myformcomment.Email.value.length-1 || 
			 document.myformcomment.Email.value.lastIndexOf(".")==document.myformcomment.Email.value.length-1)
		 {
		  alert("E-mail spelling error?");
		  document.myformcomment.Email.focus();
		  return false;
		  }
	}
	else
	{
	   alert("Please input your E-mail!");
	   document.myformcomment.Email.focus();
	   return false;
    }
	
	if(document.myformcomment.Address.value=="")
	{
		alert("Please input your Address!");
		document.myformcomment.Address.focus();
		return false;
	}   
	
	if(document.myformcomment.Telephone.value=="")
	{
		alert("Please input your Telephone!");
		document.myformcomment.Telephone.focus();
		return false;
	}
	
	if(document.myformcomment.Message.value=="")
	{
		alert("Please input the Message!");
		document.myformcomment.Message.focus();
		return false;
	}
}

window.onload=function(){
	document.getElementById("set_hp").onclick=function(){
		if(document.all){
			this.style.behavior='url(#default#homepage)';
			this.setHomePage(this.href);
			return false;
		}
	}
	document.getElementById("book").onclick=function(){
		if(document.all){
			window.external.AddFavorite(this.href,'Googleusb')
		}
	}
}

function kkform()
{
  if(document.smyform.stype.value=="0")
  {
	  document.smyform.action="productinfo.html";	  
  }
  else
  {
	  document.smyform.action="product.html";	  
   }
}

function kkform2()
{
  if(document.smyform2.stype.value=="0")
  {
	  document.smyform2.action="productinfo.html";	  
  }
  else
  {
	  document.smyform2.action="product.html";	  
   }
}

//-->
