 function showLocSelect(k)
  {
	var locvalue=k;
	var locdiv=getElement("cValue").value;
	if(locdiv==null || locdiv=="" || locvalue=="" || locvalue==null){
		getElement("cValue").value=Tab01Con1;		
	}
	getElement("cValue").value="Tab01Con"+k;	
}
function hideLocSelect()
{	
	getElement("locListDiv").style.display="none";
}
function getElement(aID)
{
  return (document.getElementById) ? document.getElementById(aID)
                                   : document.all[aID];
}


function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
  endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0; 
  while (i < clen) {
    var j = i + alen;	
    if (document.cookie.substring(i, j) == arg)		 
      return getCookieVal (j);	  
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0)
       break;
  }
  return "";
}
function SetCookie(cookieName,nDays,cityname) {
 var cookieValue=getElement("cValue").value;
 if (cookieValue==null || cookieValue==""){cookieValue="Tab01Con1";}
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays); 
 document.cookie = cookieName+"="+escape(cookieValue) + ";path=/;domain=.it168.com;expires="+expire.toGMTString();
 setLocNews(cityname); 
 setTab01Syn(cookieValue.substring(8,10));
 alert('定制成功，谢谢');
// hideLocSelect();
}
 function setLocNews(locstr){
	var l=getElement("locbar");	
	l.innerHTML=locstr+"";
}
 function setTab01Syn(k)
	{
	
		var wtInterval;
	
	var MouseDelayTime=150;//鼠标感应延迟300毫秒
					//alert("aa");
					var idstr="tab"+k;	
					getElement(idstr).onmouseout=function(aEvent)
					{	 
						//alert();
					      //alert(idstr);
						  clearTimeout(wtInterval);
						  //alert(wtInterval);
				    }
			    	clearTimeout(wtInterval);
					
					var str="setTab01Syn1("+k+")";
					//alert(str);					
					wtInterval=setTimeout(str,MouseDelayTime);
	}

 function setTab01Syn1(k)
	{
		var csname;
		csname=" l"		
		var n;
		for (var i=1;i<15;i++)			 
		  {			 
			 getElement("Tab01Con"+i).style.display="none";		
			 if (i%2==0){getElement("tab"+i).className="a_"+i+" r";}
			 if (i%2==1){getElement("tab"+i).className="a_"+i+" l";}
			
		  }		 
			getElement("Tab01Con"+k).style.display="block";	
			if (k%2==0){csname=" r"}	
			getElement("tab"+k).className="a_0"+k+csname;
			
			setLocNews(getCity(k));
			showLocSelect(k);
	  }
		  
  function getCity(k)
   {
	   
	 var city = new Array("<a href='http://bj.it168.com'>北京</a>","上海","广州","成都","武汉","西安","沈阳","南京","郑州","济南","长沙","深圳","昆明","杭州");
	 if (k<=14){	  
	       //alert(city[k-1]);
			return city[k-1];
		 }
		 return "北京";
	 }
	 //新的公用
	function setTabSyn(t,name,p,cs)
	{
		
	
		var wtInterval;
		
	   var MouseDelayTime=150;//鼠标感应延迟300毫秒
					//alert("aa");
					var idstr=t+name+p;	
					getElement(idstr).onmouseout=function(aEvent)
					{	 
						  
						  clearTimeout(wtInterval);
						  //alert(wtInterval);
				    }
						
			    	clearTimeout(wtInterval);
				
					var str="setWutian("+t+",'"+name+"',"+p+",'"+cs+"')";
										
					wtInterval=setTimeout(str,MouseDelayTime);
					
	}
 function setWutian(t,name,p,cs)
	{
		
		for (var i=1;i<=t;i++)
			 
		  {
			 getElement("Tab"+name+i).style.display="none";			 
			 getElement(t+name+i).className=cs+i;
			
		  }
			getElement("Tab"+name+p).style.display="block";	
			
			getElement(t+name+p).className=cs+"0"+p;			
	  }
		  
window.onerror=function(){return true}
