
var W=window, D=document, F, E, EvSrc, Op, Gec, Ns, Saf, IE7, Nav, B, 
	oPage, oPageSt, oTopH1St, bFixTopMenu=false, oHtml, oMenu, oImgDiv, HeightProp;
//------------------------------------------------------------------------

function getbyid(id){return D.getElementById(id);}

function getat(o, at){
var val=o.getAttribute(at); if (Op && val=='') val=null; return val;
}

function setat(o, at, val){
if (Op && val==null) val=''; o.setAttribute(at, val);
}
//------------------------------------------------------------------------

function Contains(o, Ch){
while(Ch && Ch!==o && Ch!==D) Ch=Ch.parentNode;
return (Ch===o);
}

function EventInit(e){
E=(!Gec ? event : e); EvSrc=E[Gec ? 'target' : 'srcElement'];
if (Ns && EvSrc.nodeType==3) EvSrc=EvSrc.parentNode;
}

function LeftBtn(){ //Op: since 9
return E.button==(!Gec && !Op ? 1 : 0);
}

function AbsPos(O, Parent){
var X=0, Y=0, Next;

Next=O; if (Parent==null) Parent=D;
while (Next!=null && Next!==Parent){
	Y+=Next.offsetTop; X+=Next.offsetLeft; Next=Next.offsetParent;
	}
return [X, Y];
}

function InitUA(){
var Pos, sid;

Nav=W.navigator.userAgent; IE7=false; 
Gec=(Nav.indexOf('Gecko')!=-1); Op=(Nav.indexOf('Opera')!=-1);
Ns=(Gec && Nav.indexOf('Netscape')!=-1);
Saf=(Gec && Nav.indexOf('Safari/')!=-1);

if (!Gec && !Op){
	Nav.match(/ MSIE (\d+)/);
	if (RegExp.$1>=7) IE7=true;
	}
oHtml=D.childNodes[D.childNodes.length-1];
}

function GetPosRoot(){
return (D.getElementsByTagName((D.compatMode=='BackCompat' && !Saf) || Op ? 'BODY' : 'HTML')[0]);
}

//---

InitUA();
