function checkform_add_news()
{


if (form2.title.value.replace(/\s/g,"")=="")
{
alert ("Please enter subject!")
    form2.title.focus();
return false;
}

if (form2.content.value.replace(/\s/g,"")=="")
{
alert ("Please enter Content!")
    form2.content.focus();
return false;
}

if (form2.comname.value.replace(/\s/g,"")=="")
{
alert ("Please enter Your Company!")
    form2.comname.focus();
return false;
}

if (form2.name.value.replace(/\s/g,"")=="")
{
alert ("Please enter Your Name!")
    form2.name.focus();
return false;
}

if (form2.email.value.replace(/\s/g,"")=="")
{
alert ("Please enter E-mail!")
    form2.email.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);   
                  }   
              }   
          }   
      }   
  }   
 