

function checkform_add_news()
{


if (form3.username.value.replace(/\s/g,"")=="")
{
alert ("请输入您的用户名!")
    form3.username.focus();
return false;
}

if (form3.password1.value.replace(/\s/g,"")=="")
{
alert ("密码不能为空!")
    form3.password1.focus();
return false;
}



if (form3.email.value.replace(/\s/g,"")=="")
{
alert ("邮箱地址不能为空!")
    form3.email.focus();
return false;
}

if (form3turename.value.replace(/\s/g,"")=="")
{
alert ("请填写您的真实姓名!")
    form2.turename.focus();
return false;
}

if (form2.phonel.value.replace(/\s/g,"")=="")
{
alert ("请填写您的联系电话!")
    form2.phone.focus();
return false;
}

if (form2.tel.value.replace(/\s/g,"")=="")
{
alert ("Please enter Telephone Number!")
    form2.tel.focus();
return false;
}

if (form2.fax.value.replace(/\s/g,"")=="")
{
alert ("Please enter Fax Number!")
    form2.fax.focus();
return false;
}


}

//Switch Tab Effect
function switchTab(tabpage,tabid){
        var oItem = document.getElementById(tabpage);
	for(var i=0;i<oItem.children.length;i++){
		var x = oItem.children(i);
		x.className = "";
		var y = x.getElementsByTagName('a');
		y[0].style.color="#333333";
	}
	document.getElementById(tabid).className = "Selected";
	var dvs=document.getElementById("cnt").getElementsByTagName("div");
	for (var i=0;i<dvs.length;i++){
	  if (dvs[i].id==('d'+tabid))
	    dvs[i].style.display='block';
	  else
  	  dvs[i].style.display='none';
	}
}


  function   changeg(guo,fx)
  {
      document.all.item('SX'+fx+'G').value=guo;
      document.all.item('SX'+fx+'S').value='';
      document.all.item('SX'+fx+'I').value='';
      document.all.item('SX'+fx+'X').value='';
      document.all.item('xSX'+fx+'S').value='';
      changes('',fx);
  }
  function   changes(sheng,fx)
  {
      var   pos,sh,s,i,op;
      document.all.item('xSX'+fx+'I').options.length=0;
      document.all.item('xSX'+fx+'X').options.length=0;
      if(sheng!='')
      {
          sh=document.all.shi.value;
          pos=sh.indexOf('|'+sheng+'|');
          if(pos>=0)
          {
              pos=pos+('|'+sheng+'|').length;
              sh=sh.substring(pos,sh.indexOf('|',pos));
              //将数据导入下拉框中
              s=sh.split(' ');
              for(i=0;i<s.length;i++)
              {
                  op=document.createElement('option');
                  op.text=s[i];
                  op.value=s[i];
                  document.all.item('xSX'+fx+'I').add(op);
              }
          }
      }
  }
  function   changei(sheng,shi,fx)
  {
      var   pos,po,sh,s,i,op;
      document.all.item('xSX'+fx+'X').options.length=0;
      if(sheng!='')
      {
          sh=document.all.xian.value;
          pos=sh.indexOf("|"+sheng+"|");
          if(pos>=0)
          {
              pos=pos+("|"+sheng+"|").length;
              po=sh.indexOf("|"+shi+"!",pos);
              if(po>=pos)
              {
                  po=po+("|"+shi+"!").length;
                  sh=sh.substring(po,sh.indexOf("|",po))
                  //将数据导入下拉框中
                  s=sh.split(" ");
                  for(i=0;i<s.length;i++)
                  {
                      op=document.createElement("option");
                      op.text=s[i];
                      op.value=s[i];
                      document.all.item('xSX'+fx+'X').add(op);
                  }
              }
          }
      }

  }
  function   changex(xian,fx)
  {

  }
  function   showydxx(djsx,dllb)
  {
      if(dllb=='备份电路')
      {
          ydxx.style.display='';
          document.all.item('SAYDDBH').style.backgroundColor=document.all.item('SAYDDH').style.backgroundColor=document.all.item('SAYDLDH').style.backgroundColor=document.all.item('SAYJKSL').style.backgroundColor=document.all.item('SAYJZXH').style.backgroundColor=document.all.item('SAYYZXH').style.backgroundColor=document.all.item('SAYDLLY').style.backgroundColor='';
          document.all.item('SAYDDBH').disabled=document.all.item('SAYDDH').disabled=document.all.item('SAYDLDH').disabled=document.all.item('SAYJKSL').disabled=document.all.item('SAYJZXH').disabled=document.all.item('SAYYZXH').disabled=document.all.item('SAYDLLY').disabled=false;
      }
      else   if(djsx!='新装')
      {
          ydxx.style.display='';
          document.all.item('SAYDDBH').style.backgroundColor=document.all.item('SAYDDH').style.backgroundColor=document.all.item('SAYDLDH').style.backgroundColor=document.all.item('SAYJKSL').style.backgroundColor=document.all.item('SAYJZXH').style.backgroundColor=document.all.item('SAYYZXH').style.backgroundColor=document.all.item('SAYDLLY').style.backgroundColor='';
          document.all.item('SAYDDBH').disabled=document.all.item('SAYDDH').disabled=document.all.item('SAYDLDH').disabled=document.all.item('SAYJKSL').disabled=document.all.item('SAYJZXH').disabled=document.all.item('SAYYZXH').disabled=document.all.item('SAYDLLY').disabled=false;
      }
      else
      {
          ydxx.style.display='none';
          document.all.item('SAYDDBH').style.backgroundColor=document.all.item('SAYDDH').style.backgroundColor=document.all.item('SAYDLDH').style.backgroundColor=document.all.item('SAYJKSL').style.backgroundColor=document.all.item('SAYJZXH').style.backgroundColor=document.all.item('SAYYZXH').style.backgroundColor=document.all.item('SAYDLLY').style.backgroundColor='#90E0FF';
          document.all.item('SAYDDBH').disabled=document.all.item('SAYDDH').disabled=document.all.item('SAYDLDH').disabled=document.all.item('SAYJKSL').disabled=document.all.item('SAYJZXH').disabled=document.all.item('SAYYZXH').disabled=document.all.item('SAYDLLY').disabled=true;
      }
  }
  function   changeJS(sheng,fx)
  {
      var   pos,sh,s,i,op;
      document.all.item('SAZ'+fx+'JI').options.length=0;
      document.all.item('SAZ'+fx+'JX').options.length=0;
      if(sheng!='')
      {
          sh=document.all.shi.value;
          pos=sh.indexOf('|'+sheng+'|');
          if(pos>=0)
          {
              pos=pos+('|'+sheng+'|').length;
              sh=sh.substring(pos,sh.indexOf('|',pos));
              //将数据导入下拉框中
              s=sh.split(' ');
              for(i=0;i<s.length;i++)
              {
                  op=document.createElement('option');
                  op.text=s[i];
                  op.value=s[i];
                  document.all.item('SAZ'+fx+'JI').add(op);
              }
          }
      }
  }
  function   changeJI(sheng,shi,fx)
  {
      var   pos,po,sh,s,i,op;
      document.all.item('SAZ'+fx+'JX').options.length=0;
      if(sheng!='')
      {
          sh=document.all.xian.value;
          pos=sh.indexOf("|"+sheng+"|");
          if(pos>=0)
          {
              pos=pos+("|"+sheng+"|").length;
              po=sh.indexOf("|"+shi+"!",pos);
              if(po>=pos)
              {
                  po=po+("|"+shi+"!").length;
                  sh=sh.substring(po,sh.indexOf("|",po))
                  //将数据导入下拉框中
                  s=sh.split(" ");
                  for(i=0;i<s.length;i++)
                  {
                      op=document.createElement("option");
                      op.text=s[i];
                      op.value=s[i];
                      document.all.item('SAZ'+fx+'JX').add(op);
                  }
              }
          }
      }
  }
