window.shq={};
shq.isIE=window.ActiveXObject ? true : false;
shq.isFirefox=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
shq.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
//getElementById
shq.$=function(o){return typeof(o)=="string"?document.getElementById(o):o}
//getElementByTagNames 
//params (obj,tagNames)
shq.$$=function(){
	var es=[],e;
	for(var i=1,ags=arguments.length-1,o,oo;i<=ags;i++)
	{   o=arguments[0];
		e=arguments[i];
		if(typeof e=='string'){
		  oo=o.getElementsByTagName(e);
		  for(var j=0;j<oo.length;j++)
		    es.push(oo[j])
		  //es[es.length]=oo[j];
		}
	}
	return es;
}
//getElementByTagClass 
//params (tagName,classname)
shq.$$$=function(tagname,classname){
    var es=[];
    var objs=document.body.getElementsByTagName(tagname);
	 for(var i=0;i<objs.length;i++)
	  {
		 if(objs[i].className==classname)
		  {
			 es.push(objs[i])
			// es[es.length]=objs[i];
		  }
	  }
	return es;
}

shq.getxy=function(obj)
{
	 var   abs={left:0,top:0}   
  while(obj!=document.body){   
  abs.left+=obj.offsetLeft;   
  abs.top+=obj.offsetTop;   
  obj=obj.offsetParent;   
  }
  return   abs;
}

window.onload=window_onload;
function window_onload()
{
DropMenus(); //window onload run fans
}
function DropMenus()
{

 var objs=shq.$$(document.body,'div','p','span','a','strong','b','li','td','img')

 var dropmenus=shq.$$$('div','DropMenus')
  for(var i=0,tmp,drops=[],dropparams=[];i<objs.length;i++)
	{
	 tmp=objs[i].getAttribute('dropmenu');	
      if(tmp!=null&&tmp!='')
		{
          drops[drops.length]=objs[i];
		 
		  dropparams.push(tmp);		  
		}	
	}
	for(var i=0,tmp;i<drops.length;i++)
	{ 
		drops[i].setAttribute("menu",i);
		drops[i].onmouseover=function(){
          for(var j=0;j<dropmenus.length;j++)
			{
              dropmenus[j].style.left='-9999px';dropmenus[j].style.top='0';
			}
		  if(shq.oldmenu!=null){shq.oldmenu.style.left='-9999px';shq.oldmenu.style.top='0';}
		  var xy=shq.getxy(this)
		  var tmps=dropparams[this.getAttribute('menu')].split(",");
		  if(tmps[0]!=''){
			  tmp=shq.$(tmps[0]);tmp.style.left=((xy.left-0)+(tmps[1]-0))+'px';tmp.style.top=((xy.top-0)+(tmps[2]-0))+'px';
		  tmp.onmouseover=function(){
             
             this.style.left=((xy.left-0)+(tmps[1]-0))+'px';this.style.top=((xy.top-0)+(tmps[2]-0))+'px';
		   }
		  tmp.onmouseout=function()
			  {
			    this.style.left='-9999px';this.style.top='0px';
			  }
		  }else{
            var drop=dropmenus[this.getAttribute('menu')];
			
			drop.style.left=((xy.left-0)+(tmps[1]-0))+'px';drop.style.top=((xy.top-0)+(tmps[2]-0))+'px';
			
            drop.onmouseover=function(){
			 
             drop.style.left=((xy.left-0)+(tmps[1]-0))+'px';drop.style.top=((xy.top-0)+(tmps[2]-0))+'px';
			 
		   }
		    drop.onmouseout=function()
			  {
				
			    this.style.left='-9999px';this.style.top='0px';
			  }
		  }			
		}
	
		drops[i].onmouseout=function(){
			//shq.oldmenu=dropmenus[this.getAttribute('menu')];
			//dropmenus[this.getAttribute('menu')].style.left='-9999px';dropmenus[this.getAttribute('menu')].style.top='0px';
			
		  }			
	
		
	}

}





function swap_tab(n){
	for(var i=1;i<=5;i++){
		var curC=document.getElementById("tab_"+i);
		var curB=document.getElementById("tab_t"+i);
		if(n==i){
			curC.style.display="block";
			curB.className="active"
		}else{
			curC.style.display="none";
			curB.className="normal"
		}
	}
} 
function swap_tab2(n){
	for(var i=1;i<=2;i++){
		var curC=document.getElementById("tab2_"+i);
		var curB=document.getElementById("tab2_t"+i);
		if(n==i){
			curC.style.display="block";
			curB.className="active"
		}else{
			curC.style.display="none";
			curB.className="normal"
		}
	}
} 
