<!--
// 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';
 }
}


// Scroll Img
function ScrollImgLeft(){
var speed=16
var scroll_begin = document.getElementById("scroll_begin_Left");
var scroll_end = document.getElementById("scroll_end_Left");
var scroll_div = document.getElementById("scroll_box_Left");
scroll_end.innerHTML=scroll_begin.innerHTML
  function Marquee(){
    if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
      scroll_div.scrollLeft-=scroll_begin.offsetWidth
    else
      scroll_div.scrollLeft++
  }
var MyMar=setInterval(Marquee,speed)
  scroll_div.onmouseover=function() {clearInterval(MyMar)}
  scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
}


function secBoard(n)
{
 for(i=0;i<secTable.cells.length;i++)
  secTable.cells[i].className="sec1";
 secTable.cells[n].className="sec2";
 for(i=0;i<mainTable.tBodies.length;i++)
  mainTable.tBodies[i].style.display="none";
 mainTable.tBodies[n].style.display="block";
}

//other
// 文本框得到与失去焦点 操作
function clearTxt(id,txt) {
  if (document.getElementById(id).value == txt)
    document.getElementById(id).value="" ;
  return ;
}
function fillTxt(id,txt) {
  if ( document.getElementById(id).value == "" )
    document.getElementById(id).value=txt;
  return ;
}
//


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("Must be Filled?name?");
		document.myformfeedback.username.focus();
		return false;
	}
	// if(document.myformfeedback.address.value=="")
//	{
//		alert("Must be Filled?address?");
//		document.myformfeedback.address.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;
	}
}

// feedbackorder
function CheckFormorder()
{
	if(document.myformfeedback.pname.value=="")
	{
		alert("Must be Filled?Product name?");
		document.myformfeedback.pname.focus();
		return false;
	}
	if(document.myformfeedback.username.value=="")
	{
		alert("Must be Filled?your name?");
		document.myformfeedback.username.focus();
		return false;
	}
	 if(document.myformfeedback.address.value=="")
	{
		alert("Must be Filled?address?");
		document.myformfeedback.address.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(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.country.value))
  {
   alert("Must be Filled?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("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(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/Postal code?");
   document.userinfo.fax.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;
//   }
   
}


//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?name");
	return false;
  }
    if(checkspace(document.loginfo.UserPassword.value)) {
	document.loginfo.UserPassword.focus();
    alert("Must be Fill?password");
	return false;
  }
    if(checkspace(document.loginfo.passcode.value)){
	document.loginfo.passcode.focus();
	alert("Must be Fill?passcode");
	return false;
	}
	
  }
  
  
 //order 
 function OrderCheckForm()
{
	if(document.order_myform.username.value=="")
	{
		alert("Must be Filled￡Member ID?");
		document.order_myform.username.focus();
		return false;
	}
	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.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 spelling error?");
      document.order_myform.email.focus();
      return false;
      }
   }
 else
  {
   alert("Must be Filled?E-mail?");
   document.order_myform.email.focus();
   return false;
   }
   if(document.order_myform.address.value=="")
	{
		alert("Must be Filled￡Address?");
		document.order_myform.address.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.country.value=="")
	{
		alert("Must be Filled￡Country?");
		document.order_myform.country.focus();
		return false;
	}
	if(document.order_myform.postcode.value=="")
	{
		alert("Must be Filled￡postcode?");
		document.order_myform.postcode.focus();
		return false;
	}
	
	if(document.order_myform.tel.value=="")
	{
		alert("Must be Filled￡tel?");
		document.order_myform.tel.focus();
		return false;
	}
	
//if(document.order_myform.msn.value.length!=0)
//  {
//    if (document.order_myform.msn.value.charAt(0)=="." ||        
//         document.order_myform.msn.value.charAt(0)=="@"||       
//         document.order_myform.msn.value.indexOf('@', 0) == -1 || 
//         document.order_myform.msn.value.indexOf('.', 0) == -1 || 
//         document.order_myform.msn.value.lastIndexOf("@")==document.order_myform.msn.value.length-1 || 
//         document.order_myform.msn.value.lastIndexOf(".")==document.order_myform.msn.value.length-1)
//     {
//      alert("Msn spelling error?");
//      document.order_myform.msn.focus();
//      return false;
//      }
//   }
// else
//  {
//   alert("Must be Filled?Msn?");
//   document.order_myform.msn.focus();
//   return false;
//   }
      if(document.order_myform.deliverymethod.value=="") {
	document.order_myform.deliverymethod.focus();
    alert("Must be Filled? Deliver Way?");
	return false;
  }
      if(document.order_myform.paymethod.value=="") {
	document.order_myform.paymethod.focus();
    alert("Must be Filled? Pay Way?");
	return false;
  }
}
//-->