<!--
// Sidemenu show
function show(no){
var Obj=document.getElementById("menusub" + no);
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("请输入姓名!");
		document.myformfeedback.username.focus();
		return false;
	}
/*
	if(document.myformfeedback.tel.value=="")
	{
		alert("请输入电话");
		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("Email格式有错");
      document.myformfeedback.email.focus();
      return false;
      }
   }
 else
  {
   alert("请输入Email");
   document.myformfeedback.email.focus();
   return false;
   }*/
	if(document.myformfeedback.title.value=="")
	{
		alert("请输入标题");
		document.myformfeedback.title.focus();
		return false;
	}
	if(document.myformfeedback.content.value=="")
	{
		alert("请输入内容");
		document.myformfeedback.content.focus();
		return false;
	}
}


//Reg
function checkreginfo()
{
  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格式错误!");
      document.userinfo.email.focus();
      return false;
      }
   }
 else
  {
   alert("请输入Email!");
   document.userinfo.email.focus();
   return false;
   }
  
  if(checkspace(document.userinfo.username.value) || document.userinfo.username.value.length< 4 )
  {
   alert("请输入账号!");
   document.userinfo.username.focus();
   return false;
   }
  
    if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6) {
	document.userinfo.userpassword.focus();
    alert("请输入密码!");
	return false;
  }
    if(document.userinfo.userpassword.value != document.userinfo.userpassword1.value) {
	document.userinfo.userpassword1.focus();
	document.userinfo.userpassword1.value = '';
    alert("请确认两次输入的密码是否一致!");
	return false;
  }
    if(document.userinfo.question.value.length=="")
  {
   alert("请输入提示问题!");
   document.userinfo.question.focus();
   return false;
   }
    if(document.userinfo.answer.value.length=="")
  {
   alert("请输入提示问题答案!");
   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.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格式错误!");
      document.userinfo.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("请输入Email!");
   document.userinfo.useremail.focus();
   return false;
   }
   return true;
}

function check0()
{
   if(checkspace(document.shop0.email.value)) {
	document.shop0.email.focus();
    alert("请输入Email");
	return false;
  }
  }
  function check1()
{
   if(checkspace(document.shop1.UserAnswer.value)) {
	document.shop1.UserAnswer.focus();
    alert("请输入答案!");
	return false;
  }
  }
   function check2()
{
   if(checkspace(document.shop2.UserPassword1.value)) {
	document.shop2.UserPassword1.focus();
    alert("请输入新密码!");
	return false;
  }
  if(checkspace(document.shop2.UserPassword2.value)) {
	document.shop2.UserPassword2.focus();
    alert("请输入确认密码!");
	return false;
  }
  if(document.shop2.UserPassword1.value != document.shop2.UserPassword2.value) {
	document.shop2.UserPassword1.focus();
	document.shop2.UserPassword1.value = '';
	document.shop2.UserPassword2.value = '';
    alert("请确认两次输入的密码是否一致!");
	return false;
  }
  return true;
}


function checkrepass()
{
   if(checkspace(document.userpass.UserPassword.value)) {
	document.userpass.UserPassword.focus();
    alert("请输入旧密码!");
	return false;
  }
     if(checkspace(document.userpass.UserPassword1.value)) {
	document.userpass.UserPassword1.focus();
    alert("请输入新密码!");
	return false;
  }
     if(checkspace(document.userpass.UserPassword2.value)) {
	document.userpass.UserPassword2.focus();
    alert("请输入确认密码!");
	return false;
  }
   if(document.userpass.UserPassword1.value != document.userpass.UserPassword2.value) {
	document.userpass.UserPassword1.focus();
	document.userpass.UserPassword1.value = '';
	document.userpass.UserPassword2.value = '';
    alert("请确认两次输入的密码是否一致!");
	return false;
  }
  return true;
}

  function checkuu()
{
    if(checkspace(document.loginfo.username.value)) {
	document.loginfo.username.focus();
    alert("请输入帐号!");
	return false;
  }
    if(checkspace(document.loginfo.UserPassword.value)) {
	document.loginfo.UserPassword.focus();
    alert("请输入密码");
	return false;
  }
	if(checkspace(document.loginfo.passcode.value)) {
	document.loginfo.passcode.focus();
    alert("请确认验证码!");
	return false;
  }
  return true;
  }
  
  
 //order 
 function OrderCheckForm()
{

	if(document.order_myform.firstname.value=="")
	{
		alert("请输入姓名!");
		document.order_myform.firstname.focus();
		return false;
	}
	/*
	if(document.order_myform.lastname.value=="")
	{
		alert("请输入姓氏!");
		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("Email格式错误!");
      document.order_myform.email.focus();
      return false;
      }
   }
 else
  {
   alert("请输入Email");
   document.order_myform.email.focus();
   return false;
   }
	if(document.order_myform.tel.value=="")
	{
		alert("请输入电话!");
		document.order_myform.tel.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.company.value=="")
	{
		alert("Must be Filled￡Address?");
		document.order_myform.company.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("请选择配送方式!");
	return false;
  }
      if(document.order_myform.paymethod.value=="") {
	document.order_myform.paymethod.focus();
    alert("请选择支付方式!");
	return false;
  }
  return true;
}

function init() 
{
   if(window.ActiveXObject)
   {
      return new ActiveXObject("Microsoft.XMLHttp");
   }
   else if(window.XMLHttpRequest)
   {
      return new XMLHttpRequest();
   }
}
//-->