_d=document;
_n=navigator;
_L=location;
_nv=$tL(_n.appVersion);
_nu=$tL(_n.userAgent);
_ps=parseInt(_n.productSub);
_f=false;
_t=true;
_n=null;
_W=window;
_wp=_W.createPopup;
ie=(_d.all)?_t:_f;
ie4=(!_d.getElementById&&ie)?_t:_f;
ie5=(!ie4&&ie&&!_wp)?_t:_f;
ie55=(!ie4&&ie&&_wp)?_t:_f;
ns6=(_nu.indexOf("gecko")!=-1)?_t:_f;
konq=(_nu.indexOf("konqueror")!=-1)?_t:_f;
sfri=(_nu.indexOf("safari")!=-1)?_t:_f;
if(konq||sfri){_ps=0;ns6=0}
ns4=(_d.layers)?_t:_f;
ns61=(_ps>=20010726)?_t:_f;
ns7=(_ps>=20020823)?_t:_f;
op=(_W.opera)?_t:_f;
if(op||konq)ie=0;
op5=(_nu.indexOf("opera 5")!=-1)?_t:_f;
op6=(_nu.indexOf("opera 6")!=-1||_nu.indexOf("opera/6")!=-1)?_t:_f;
op7=(_nu.indexOf("opera 7")!=-1||_nu.indexOf("opera/7")!=-1)?_t:_f;
mac=(_nv.indexOf("mac")!=-1)?_t:_f;
if(ns6||ns4||op||sfri)mac=_f;
ns60=_f;
if(ns6&&!ns61)ns60=_t;
if(op7)op=_f;IEDtD=0;
licenseNumber=1000; licenseURL="Unlicensed";
if(!op&&(_d.all&&_d.compatMode=="CSS1Compat")||(mac&&_d.doctype&&_d.doctype.name.indexOf(".dtd")!=-1))IEDtD=1;
if(op)ie55=_f;

function testpos(menuul){
	  ul_parent=menuul.parentNode.parentNode;
      ul=menuul.parentNode.getElementsByTagName('ul')[0];
	  ul.style.top="";
	  gpos(ul);
	  _getDims();
	  //alert(_gpa[0]+_gpa[2]+24+"\n"+(_bH+_sT+24));
	  if((_gpa[0]+_gpa[2]+24)>(_bH+_sT+24)){
	  t=_gpa[0];
	  h=_gpa[2];
	  gpos(ul_parent);
	  ul.style.top=(t-_gpa[0]+24+_sT)-((t+h)-(_bH))+"px";
     }
	 }

/*function spos(_gm,_t,_l,_h,_w){
	_px="px";
	if(op){
		_px="";
		_gs=_gm.style;
		if(_w!=_n)_gs.pixelWidth=_w;
		if(_h!=_n)_gs.pixelHeight=_h
	} else {
		_gs=_gm.style;
		if(_w!=_n)_gs.width=_w+_px;
		if(_h!=_n)_gs.height=_h+_px;
	}
	if(_t!=_n)_gs.top=_t+_px;
	if(_l!=_n)_gs.left=_l+_px
}*/
  
function gpos(_gm){
	_dBT=_d.body.offsetTop;
	_dBL=_d.body.offsetLeft;
	if(!_gm)return;
	_h=_gm.offsetHeight;
	_w=_gm.offsetWidth;
	if(op5){
		_h=_gm.style.pixelHeight;
		_w=_gm.style.pixelWidth
	}
	_l=0;_t=0;
	do {
			_l += _gm.offsetLeft;
			_t += _gm.offsetTop;
		} while (_gm = _gm.offsetParent);
	if(sfri){
		_l-=_dBL;
		_t-=_dBT
	}
	if(mac){
		_macffs=_d.body.currentStyle.marginTop;
		if(_macffs){
			_t=_t+parseInt(_macffs)
		}
		_macffs=_d.body.currentStyle.marginLeft;
		if(_macffs){
			_l=_l+parseInt(_macffs)
		}
	}
	_gpa=new Array(_t,_l,_h,_w);
	return(_gpa)
}

function _getDims(){
	if(!op&&_d.all){
		_mc=_d.body;
		if(IEDtD&&!mac&&!op7)_mc=_d.documentElement;
		if(!_mc)return;
		_bH=_mc.clientHeight;
		_bW=_mc.clientWidth;
		_sT=_mc.scrollTop;
		_sL=_mc.scrollLeft
	} else {
		_bH=_W.innerHeight;
		_bW=_W.innerWidth;
		if(ns6&&_d.documentElement.offsetWidth!=_bW)_bW=_bW-16;
		_sT=self.scrollY;
		_sL=self.scrollX;
		if(op){
			_sT=_d.body.scrollTop;
			_sL=_d.body.scrollleft
		}
	}
}

function $tL($){
	if($)return $.toLowerCase()
}
