// JavaScript Document
function AutoScroll(obj){
        $(obj).find("ul:first").animate({
                marginTop:"-20px"
        },500,function(){
                $(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
        });
}
$(document).ready(function(){
setInterval('AutoScroll("#tnotice")',3000)
});
function stmenu(a,c,act){
	
	var n;
	var m;
	var tm;
	var navlist;
	for(var i=1;i<=9;i++){
	   tm ="tjmenu"+i;
	   n = document.getElementById(tm);
	   tmlist="tjsite"+i;
	   m=document.getElementById(tmlist);
	   if(tm != a){	   	 
		 n.className="tjma";
		 m.style.display = "none";
	   }else{		
		n.className="tjmhover";
		m.style.display = "block";
	   }
	 }
	 var xmlHttp = createXMLHttpRequest();
	 var url="ajax.php?st="+act;
	 url=encodeURI(encodeURI(url));
	 xmlHttp.open("GET",url,true);
	 xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	 xmlHttp.onreadystatechange = function(){
	    if (xmlHttp.readyState<4){
		   document.getElementById(c).innerHTML ="<div id='loading'>数据载入中......</div>";
		}
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
			document.getElementById(c).innerHTML =unescape(xmlHttp.responseText);
		}
	}
	xmlHttp.send(null);
}
function closetop(){
	document.getElementById("htop").style.display='none';
	document.getElementById("banner").style.marginTop='6px';
}
function Comparetime(temper){
 var str;
 var nowtime=new Date(nowdatetime.replace(/-/,"/")); 
 var ctime = new Date(temper.replace(/-/,"/"));
   if(nowtime>ctime){
	   return false;
   }else{
	   return true;
   }
}
function createXMLHttpRequest(){
var ret = null;
try {ret = new ActiveXObject('Msxml2.XMLHTTP')}
catch (e) {
try {ret = new ActiveXObject('Microsoft.XMLHTTP')}
        catch (ee) {ret = null}
}
if (!ret&&typeof XMLHttpRequest !='undefined') ret = new XMLHttpRequest();
return ret;
}
function showlayer(a){
	 var n;
	 var f;
	 var timeid;
	 var urlclass;
	 for(var i=1;i<=2;i++){
	   timeid ="kaitime"+i;
	   n = document.getElementById(timeid);
	   urlclass="urlclass"+i;
	   f=document.getElementById(urlclass);
	   if(timeid != a){
	   	 n.style.display = "none";
		 f.className="icptw";
	   }else{
		n.style.display = "block";
		f.className="icptw icphv";
	   }
	 }
}
function postDigg(ftype,aid){
	 var xmlHttp = createXMLHttpRequest();
	 var url="digg_ajax.php?action="+ftype+"&id="+aid+'&time='+Date.parse(new Date());
	 xmlHttp.open("GET",url,true);
	 xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	 xmlHttp.onreadystatechange = function(){
	  if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
			if(xmlHttp.responseText=="1"){
			   alert("您已经投过票了！");	
			}else{		   
				document.getElementById("newdigg").innerHTML =unescape(xmlHttp.responseText);
			}
	  }
	}
	xmlHttp.send(null);
}
function copyToClipBoard() {
    var clipBoardContent = "";
    clipBoardContent += this.location.href;
    window.clipboardData.setData("Text", clipBoardContent);
    alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友！");
}
function shownav(a,d,c){
	var tm,tn;
	var m,n;
	for(var i=0;i<=c;i++){	   	
	   tn ="nav"+i;
	   n = document.getElementById(tn);
	   tm="menu"+i;
	   m = document.getElementById(tm);
	   if(tn != a){	 
		 n.style.display = "none";
		 m.className='';
	   }else{	
		 n.style.display = "block";
		 m.className='cur';
	   }
	 }
}
function showls(a){
	 var m,n;
	 var mmenu,nlist;
	 for(var i=1;i<=2;i++){
	   mmenu ="lsmenu"+i;
	   m = document.getElementById(mmenu);
	   nlist="ilslist"+i;
	   n=document.getElementById(nlist);
	   if(mmenu != a){
	   	 n.style.display = "none";
		 m.className="";
	   }else{
		 n.style.display = "block";
		 m.className="lshover";
	   }
	 }
}
