function $(objID){return document.getElementById(objID);}
function nav_on(num){if(curtype=$("nav_"+num)){curtype.className='nav_on';}}
function ChkForm(oForm)
{
	switch (oForm.name)
	{
	case "bystation":
		if (oForm.stationname.value=="")
		{
			oForm.stationname.focus();
			alert("车站名不能为空啊");
			return false;
		}
		break;
    case "yupiao":
		if (oForm.startStation_ticketLeft.value=="")
		{
			oForm.startStation_ticketLeft.focus();
			alert("发站名不能为空啊");
			return false;
		}
        if (oForm.arriveStation_ticketLeft.value=="")
		{
			oForm.arriveStation_ticketLeft.focus();
			alert("到站名不能为空啊");
			return false;
		}
		break;
	case "bytrain":
		if (oForm.trainname.value=="")
		{
			oForm.trainname.focus();
			alert("车次名不能为空啊");
			return false;
		}
		break;
	case "byroute":
		if (oForm.from.value=="")
		{
			oForm.from.focus();
			alert("始发站名不能为空啊");
			return false;
		}
		if (oForm.to.value=="")
		{
			oForm.to.focus();
			alert("终点站名不能为空啊");
			return false;
		}
		if (oForm.to.value==oForm.from.value)
		{
			oForm.to.focus();
			alert("站名不能相同啊");
			return false;
		}
		break;
	}
	//alert("暂未开放！");
	//return false;
}

function th_color(s){
  var s = $(s);  
  var hx = s.getElementsByTagName("th");
  var totalno = hx.length;
  for(i=1;i<totalno;i++){
      hx[i].onmouseover=function(){this.style.backgroundColor='#E6F2E7';}
      hx[i].onmouseout=function(){this.style.backgroundColor='';}
  }
}
function tr_color(s){
  var s = $(s);  
  var hx = s.getElementsByTagName("tr");
  var totalno = hx.length;
  for(i=0;i<totalno;i++){
    hx[i].onmouseover=function(){this.className='dlover';}
    if(i % 2 == 0){
        hx[i].className = 'f4f7f7';
        hx[i].onmouseout=function(){this.className='f4f7f7';}
    }else{        
        hx[i].onmouseout=function(){this.className='';}
    }      
  }
}

function chk_no(t,v) {
     var t1=t2=t3=t4='';
      var checkarr=$('contions').getElementsByTagName('input');
      for(var i=0;i<checkarr.length;i++){
         if(checkarr[i].checked){
             if(checkarr[i].name=='t_1') t1 = t1 + checkarr[i].value+';'
             if(checkarr[i].name=='t_2') t2+=checkarr[i].value+';'
             if(checkarr[i].name=='t_3') t3+=checkarr[i].value+';'
             if(checkarr[i].name=='t_4') t4+=checkarr[i].value+';'
         }
      }
        var obj_tr = $('data').getElementsByTagName('tr');
        for(var i=1,len=obj_tr.length;i<len;i++) {
            obj_id = obj_tr[i].getAttribute('id');
            //console.log(obj_id);
            $(obj_id).style.display = '';
            if(t1 != "") {
                 if (t1.indexOf(obj_id.substr(3,2)+";")==-1) {
                    $(obj_id).style.display = 'none';
                }
            }
             if(t2 != ""){
                if (t2.indexOf(obj_id.substr(6,1)+";")==-1) {
                    $(obj_id).style.display = 'none';
                }
            }
            if(t3 != ""){
                if (t3.indexOf(obj_id.substr(8,1)+";")==-1) {
                    $(obj_id).style.display = 'none';
                }
            }
            if(t4 != ""){
                if (t4.indexOf(obj_id.substr(10,1)+";")==-1) {
                    $(obj_id).style.display = 'none';
                }
            }
        }
}



