function getNames(obj,name,tij)
	{	
		var p = document.getElementById(obj);
		var plist = p.getElementsByTagName(tij);
		var rlist = new Array();
		for(i=0;i<plist.length;i++)
		{
			if(plist[i].getAttribute("name") == name)
			{
				rlist[rlist.length] = plist[i];
			}
		}
		return rlist;
	}

	function fod(obj,tag,name,showCss1,showCss2,unShowCss1,unShowCss2)
	{
		var p = getNames(tag,"t","div");
		var p1 = getNames(name,"f","div"); // document.getElementById(name).getElementsByTagName("div");
		for(i=0;i<p1.length;i++)
		{
			if(obj==p[i])
			{
				p[i].className = showCss1;
				p1[i].className = showCss2;
			}
			else
			{
				p[i].className = unShowCss1;
				p1[i].className = unShowCss2;
			}
		}
	}

function scrollDoor(){
}
scrollDoor.prototype = {
	sd : function(menus,divs,openClass,closeClass){
		var _this = this;
		if(menus.length != divs.length)
		{
			alert("菜单层数量和内容层数量不一样!");
			return false;
		}				
		for(var i = 0 ; i < menus.length ; i++)
		{	
			_this.$(menus[i]).value = i;				
			_this.$(menus[i]).onmouseover = function(){
					
				for(var j = 0 ; j < menus.length ; j++)
				{						
					_this.$(menus[j]).className = closeClass;
					_this.$(divs[j]).style.display = "none";
				}
				_this.$(menus[this.value]).className = openClass;	
				_this.$(divs[this.value]).style.display = "block";				
			}
		}
		},
	$ : function(oid){
		if(typeof(oid) == "string")
		return document.getElementById(oid);
		return oid;
	}
}
window.onload = function(){
	var SDmodel = new scrollDoor();
	//SDmodel.sd(["m01","m02"],["c01","c02"],"sd01","sd02");
	SDmodel.sd(["m03","m04"],["c03","c04"],"sd03","sd04");
		document.getElementById('winpop').style.height='0px';
		setTimeout("tips_pop()",800);
}

function tips_pop(){
  var MsgPop=document.getElementById("winpop");
  var popH=parseInt(MsgPop.style.height);
   if (popH==0){
   MsgPop.style.display="block";
  show=setInterval("changeH('up')",1);
   }
  else {
   hide=setInterval("changeH('down')",1);
  }
}
function tipsx_pop(){
  var MsgPop=document.getElementById("winpop");
   hide=setInterval("changeH('down')",1);
}
function changeH(str) {
 var MsgPop=document.getElementById("winpop");
 var popH=parseInt(MsgPop.style.height);
 if(str=="up"){
  if (popH<=220){
  MsgPop.style.height=(popH+3).toString()+"px";
  }
  else{  
  clearInterval(show);
  }
 }
 if(str=="down"){ 
  if (popH>=3){
  MsgPop.style.height=(popH-3).toString()+"px";
  }
  else{
  clearInterval(hide);
  MsgPop.style.display="none";  
  }
 }
}

function initfunction(){
setTimeout("tipsx_pop()",8500)
}
if (window.addEventListener)
window.addEventListener("load",initfunction,false)
else if (window.attachEvent)
window.attachEvent("onload",initfunction)
else if (document.getElementById)
window.onload=initfunction;
