var whichOpen='';
 function getObject(objectId) {
	if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId);
	} else if (document.all && document.all(objectId)) {
	return document.all(objectId);
	} else if (document.layers && document.layers[objectId]) {
	return document.layers[objectId];
	} else {
	return false;
	}
}
function displayList(obj,maxh){    
		var h = getObject(obj).offsetHeight; 
		  var anim = function(){			
					h += 15; 
					if(h >= maxh){ 
					getObject(obj).style.height = "auto"; 
					if(tt){window.clearInterval(tt);} 
					}
					else{
				getObject(obj).style.display="block"; 
				getObject(obj).style.height = h + "px"; 
					}
			}
			  var tt = window.setInterval(anim,1);  
}
function hiddenList(obj){
		   var h = getObject(obj).offsetHeight; 
		   var anim = function(){
				 h -= 15; 
				 if(h <= 3){
				 getObject(obj).style.display="none"; 
				   if(tt){window.clearInterval(tt);}
			   }
			   else{
				   getObject(obj).style.height = h + "px"; 
			   }
		   }
		   var tt = window.setInterval(anim,1); 
}
function menuChange(obj,maxh)
{
  if(getObject(obj).style.display == "block")
  {
	hiddenList(obj);
	whichOpen='';
  }
  else{
	if(whichOpen){
	  hiddenList(whichOpen)}
	  displayList(obj,maxh);
	  whichOpen=obj;
	}
}
function shon(s){
	var a_1=document.getElementById("a_1");
	var a_2=document.getElementById("a_2");
	var a_3=document.getElementById("a_3");
	var shon_1=document.getElementById("shon_1");
	var shon_2=document.getElementById("shon_2");
	var shon_3=document.getElementById("shon_3");
	
	if (s==6){
		shon_1.style.display="block"
		shon_2.style.display="none"
		shon_3.style.display="none"
		a_1.className="a_hover1"
		a_2.className="a_none"
		a_3.className="a_none"
	}
	if (s==7){
		shon_1.style.display="none"
		shon_2.style.display="block"
		shon_3.style.display="none"
		a_1.className="a_none"
		a_2.className="a_hover1"
		a_3.className="a_none"
	}
	if (s==8){
		shon_1.style.display="none"
		shon_2.style.display="none"
		shon_3.style.display="block"
		a_1.className="a_none"
		a_2.className="a_none"
		a_3.className="a_hover1"
	}
}
function addBookmark() {
	var sURL = 'http://www.3722.com';
	var sTitle = '3722-中国领先的网页互动娱乐发行平台';
 if (document.all) {
  try{
   window.external.addFavorite(sURL, sTitle);
  }catch (e1){
   try{
    window.external.addToFavoritesBar(sURL, sTitle);
   }catch (e2){
    alert('加入收藏失败，请Ctrl+D手动添加。');
   }
  }
 } else if (window.external) {
  window.sidebar.addPanel(sTitle, sURL,"");
 } else {
  alert('加入收藏失败，请Ctrl+D手动添加。');
 }
}

