
function changeColor(id,t1,t2,t3) {
    var arrayli = document.getElementById(id).getElementsByTagName('dl');
        var bool = false; //奇数行为true
        var oldStyle; //保存原有样式
        for(var i = 0;i<arrayli.length;i++){
            //各行变色
            if(bool === true){
                arrayli[i].className = t1;
                bool = false;
            }
            else {
                arrayli[i].className = t2;
                bool = true;    
            }
            //划过变色
            arrayli[i].onmouseover = function() {
                oldStyle = this.className;
                this.className = t3;
            } 
            arrayli[i].onmouseout = function() {
                this.className = oldStyle;
            } 
        }
}
function nTabs(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
  if (i == Num)
  {
   thisObj.className = "active"; 
      document.getElementById(tabObj+"_Content"+i).style.display = "block";
  }else{
   tabList[i].className = "normal"; 
   document.getElementById(tabObj+"_Content"+i).style.display = "none";
  }
} 
}

 function loginTop(){
  if(document.top_Form.hyzcm.value == "会员注册名"){
     alert("请输入用户名！");
     return false ;
   }
   if(document.top_Form.hyzcm.value == ""){
     alert("用户名不能为空！");
     return false;
   }
   if(document.top_Form.mm.value == ""){
     alert("登录密码不能为空！");
     return false;
   }
   	   return true;
  }
  function toLogin(){
   if(document.toOrder.hyid.value == ""){
     alert("请注意，您的登录账号不能为空，请填写！");
     return false;
   }
   if(document.toOrder.mm.value == ""){
     alert("请注意，您的登录密码不能为空，请填写！");
     return false;
   }
    document.toOrder.action="/acc/accmember/memberLoginCheck.shtml?item=veIndex&ctx=${ctx}";
    return true;
  }
//积分部分	
function toSave(){							
  if(parseFloat(document.b_member_djsq_form.sqqjf.value) < parseFloat(document.b_member_djsq_form.sq_djjf.value)){
     alert("注意：可用积分不足，不能兑现奖品！");
     return false;
  }	
  if(parseFloat(document.b_member_djsq_form.danqian.value) < parseFloat(document.b_member_djsq_form.sq_djjf.value)){
     alert("注意：可用积分不足，不能兑现奖品！");
     return false;
  }	  
  if(parseFloat(document.b_member_djsq_form.sumsl.value) < parseFloat(document.b_member_djsq_form.jpsl.value)){
     alert("注意：可兑换奖品数量不足，请减少兑换奖品数量或兑换其它奖品！");
     return false;
  }	
  if(document.b_member_djsq_form.jpsl.value == "" || document.b_member_djsq_form.jpsl.value <= 0){
     alert("你选择的数量不能空，而且要大于0！");
     return false;
  }	
  if(document.b_member_djsq_form.ps_lx.value == ""){
     alert("请选择配送信息，以方便为您服务！");
     return false;
  } 
  document.b_member_djsq_form.submit();
}
 
 function setSum(){
  if(document.b_member_djsq_form.jpsl.value > 0){
      document.b_member_djsq_form.sq_djjf.value = parseFloat(document.b_member_djsq_form.sq_djjf_help.value) * parseFloat(document.b_member_djsq_form.jpsl.value);	  
  }
 }

 function changezt(){
        if(document.b_member_djsq_form.ps_lx.value == "0"){
           document.b_member_djsq_form.ps_pszt.value = 1;
        }
        if(document.b_member_djsq_form.ps_lx.value == "1"){
           document.b_member_djsq_form.ps_pszt.value = 0;
        }
        if(document.b_member_djsq_form.ps_lx.value == "4"){
           document.b_member_djsq_form.ps_pszt.value = 6;
        }
    } 
	
 function setJP(id,mc,sl,djjf){  
    document.b_member_djsq_form.jpbh.value = id;
    document.b_member_djsq_form.jpbhxm.value = mc;	 
    document.b_member_djsq_form.sq_djjf.value = djjf;
    document.b_member_djsq_form.sq_djjf_help.value = djjf;
    document.b_member_djsq_form.sumsl.value = sl;
    document.b_member_djsq_form.jpsl.value = 1;   
 }	
 
 

