function $(id){return document.getElementById(id);}
function show(o){document.getElementById(o).style.display="block";}
function hide(o){document.getElementById(o).style.display="none";}
function geturl(url,id){
var http=false;
$(id).innerHTML='<span class="loading">&nbsp;&nbsp;</span>';
if(window.XMLHttpRequest){http=new XMLHttpRequest();if(http.overrideMimeType){http.overrideMimeType('text/plain');}}else if(window.ActiveXObject){try{http=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http){alert('Cannot send an XMLHTTP request');return false;}
http.onreadystatechange=function(){if(http.readyState==4){$(id).innerHTML=http.responseText;}}
http.open("get", url, true);
http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
http.send(null);
}
function size(id,width,height,nwin){
	if(!width) width=680;
	if(!height) height=800;
	if(nwin){nwin=true;}else{nwin=false;}
	if(id.width>width || id.height>height){
		if(id.width/id.height>width/height){
			id.width=width;  
		}else{
			id.height=height;
		}
		if(nwin){
		  id.outerHTML='<a href="'+id.src+'" rel="lightbox">'+id.outerHTML+'</a>'
		}
	}
}
//Array0,0是设置的时间 
var bby = 0;
var adl = new Array(2, 2);
var timer = setInterval("run()", adl[bby] * 1000);
function run() {
  for (j = 0; j < adl.length; j++) {
    var x = document.getElementById("srhc" + j);
    if (j == bby) x.style.display = "block";
    else x.style.display = "none";
  }
  clearInterval(timer);
  timer = setInterval("run()", adl[bby] * 1000);
  bby = (bby < adl.length - 1) ? ++bby: 0;
}
function setTab(name, cursel, n) {
  for (i = 1; i <= n; i++) {
    var menu = document.getElementById(name + i);
    var con = document.getElementById("con_" + name + "_" + i);
    menu.className = i == cursel ? "hover": "";
    con.style.display = i == cursel ? "block": "none";
  }
}
document.oncontextmenu=new Function('event.returnValue=false;');
document.onselectstart=new Function('event.returnValue=false;');
