$(document).ready(function(){
var id=$("#pagelistid").val();
$("#topdiv"+" a[id="+id+"]").attr("class","nowcolum");
})
function TitleDisplay(tid,nid,lengthid){
	for(var i = 1;i<=lengthid;i++)
	{
		var CPage = document.getElementById("ShowTitle"+tid+"_"+i);
		var CPageNav = document.getElementById("ShowContent"+tid+"_"+i);
		if(i==nid)
		{
			CPage.style.display="none";
			CPageNav.style.display="block";
		}
		else
		{
			CPage.style.display="block";
			CPageNav.style.display="none";
		}
	}
}
//写Cookies
function SetCookie(objName,objValue,objHours)
{
    var str = objName + "=" + escape(objValue);
 //alert(str);
    if(objHours > 0){//为0时不设定过期时间，浏览器关闭时cookie自动消失
     var date = new Date();
  //document.write(date);Sun Jul 26 13:42:13 UTC+0800 2009
     var ms = objHours*3600*1000;
  //document.write(ms);
 // document.write(date.getTime());1248587064078,date.getTime()用来返回实际的毫秒数。
     date.setTime(date.getTime() + ms);
  //document.write(date);Sun Jul 26 23:50:26 UTC+0800 2009
     str += "; expires=" + date.toGMTString();
  //document.write(str);test=testvalue; expires=Sun, 26 Jul 2009 15:51:15 UTC
    }
    document.cookie = str;
}
//读Cookies
function GetCookie(Name)
{
   var search = Name + "=";
   var returnvalue = "";
   if (document.cookie.length > 0) 
   {
      offset = document.cookie.indexOf(search);
   if (offset != -1)
   { 
   offset += search.length;
         end = document.cookie.indexOf(";", offset); 
   if (end == -1)
            end = document.cookie.length;
         returnvalue=unescape(document.cookie.substring(offset,end));
       }
    }
    return returnvalue;
} 

