var anav=null;
var _mnavtim=null;
function mov(elm){
	onnav=1;
	var n = $(elm);
	var snum="sn"+elm.id.substr(1);
	if(anav!=null && anav.id!="sn"+snum){
		//alert("anav: "+anav)
		var a = $(anav)
		a.setStyle({display:"none"})
	}
	var s = $(snum);
	if(s!=null){
		var x,y
		x=n.positionedOffset(s)[0]-10;
		y=n.positionedOffset(s)[1]+20;		
		//alert(y)
		s.setStyle({display:"block",left:x+"px",top:y+"px"})
		anav=s;
	}
	/**/
}
function mot(elm){
	clearTimeout(_mnavtim);
	_mnavtim = setTimeout(closeNav,500);
	onnav=0;
}
function closeNav(){
	if(anav!=0 && !onnav){
		var sn = anav;
		sn.setStyle({display:"none"})
	}
}
function smov(elm){
	onnav=1;
}
function smot(elm){
	clearTimeout(_mnavtim);
	_mnavtim = setTimeout(closeNav,500);
	onnav=0;	
}
function bwcheck(){ 
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera5=this.agent.indexOf("Opera 5")>-1;
	this.opera6=this.agent.indexOf("Opera 6")>-1;
	this.opera7=this.agent.indexOf("Opera 7")>-1;
	this.opera8=this.agent.indexOf("Opera 8")>-1;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom && !this.opera5)?1:0;
	this.ie=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6||this.ie7||this.ie8;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.nsplus=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie8||this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.nsplus||this.opera8||this.opera7||this.opera6);
	return this;
}
bw=new bwcheck();
function testObj(o){
	var w="";
	for(var i in o){
		w+= i + " : " + o[i] +"\r\n"
	}
	alert(w);
}
var _pop,_poptim;
function wopen(url,w,h,c,win,op,aot,tim){
	var sw=screen.width;
	var sh=screen.height;
	var _W=w?w:800;
	var _H=h?h:600;
	var _l=(sw-_W)/2;
	var _t=(sh-_H)/2;
	var _n=win||"nwin";
	var _o="location=0,directory=0,status=0,titlebar=0,menubar=0,resizable=1,copyhistory=0";
	var _p=",width="+_W+",height="+_H+",";
	if(c) _p+="left="+_l+",top="+_t+",screenX="+_l+",screenY="+_t;
	if(_pop&&!_pop.closed) { _pop.close(); _pop=null; clearTimeout(_poptim);}
	if(!op||op==null||op=='') _pop=window.open('about:blank',_n,_o+_p);
	else _pop=window.open('about:blank',_n,op+_p);	
	_pop.location.href=url;
	if(_pop.focus()) _pop.focus();
	if(aot && !tim) _poptim=setTimeout('focPop()',1000);
	else if(tim) _poptim=setTimeout('_pop.close()',tim);
}
function focPop(){
	if(_pop&&!_pop.closed){
		_pop.focus();
		_poptim=setTimeout('focPop()',1500);
	}
}