ie4 = (document.all) ? true : false;
ns4 = (document.layers) ? true : false;
isOp=window.opera?1:0;

my_showmenu_timer = Array();



banner_aken_exists = 0;


function tee_popup_banner() {

	arvutabodysuurus();
	
	if (0 || (getCookieF("popup_banner") != "loaded"))
	{
		
			
		show_banner_aken("popup_banner_aken");	
		
		setCookieF_noEscape("popup_banner", "loaded");
	}
}

function arvutabodysuurus() {
	
	
	
	
	
	if (!ns4 && document.body)
		document.body.onclick = hide_banner_aken;
	
}


function show_banner_aken(myid) {

	if (!banner_aken_exists)
		return;
		
	hide_banner_aken();		
	
	
		
	if (typeof(myid) == "undefined")	
	{
		myid = "banner_aken";
		
		banner_x = (getbodywidth() - ba_w) / 2;
		banner_y = (getbodyheight() - ba_h) / 2;
	}
	else
	{
		if (!popup_banner_aken_exists)
			return;
	
		myid = "popup_banner_aken";
		
		banner_x = (getbodywidth() - popup_ba_w) / 2;
		banner_y = (getbodyheight() - popup_ba_h) / 2;
	}

	
		
		
		
		
	x = banner_x;
	if (screen.width > 800)
		y = 155; 
	else
		y = 127;
		
	obj = getobj(myid);
	
	
	
	setxy(obj, x, y);
	setvis(1, myid);
	
	
	
	
}

function hide_banner_aken() {

	hide_banner_aken2("banner_aken");
	hide_banner_aken2("popup_banner_aken");
	
}

function hide_banner_aken2(id) {

	if (typeof(id) == "undefined")	
	{
		id = "banner_aken";
	}
	
	if (ns4)
		setvis(0, id);
	else
	{
		setvis(0, id);
		obj = getobj(id);
		setxy(obj, -1000, -1000);
	}
	
}

shown_menu_names = Array();

function my_showmenu(level, linkobj, name, esileht, anchor_obj_id)
{
	mouse_over_menyy(level, name);	
	hideallothermenus(level, name);
	
	
	if (!anchor_obj_id)
	{
	
	}
	else
	{
		
		linkobj = getobj(anchor_obj_id);
		
	}
	
	
	
	found = false;
	for (i = 0; i < shown_menu_names.length; i++)
	{
		if (shown_menu_names[i] == (level + "_" + name))
		{
			found = true;
			break;
		}
	}
	
	if (!found)
		shown_menu_names[shown_menu_names.length] = level + "_" + name;
	
	
	

	obj = getobj("rippmenyy_" + name);

	x = findPosX(linkobj);
	y = findPosY(linkobj);
	
	if (level == 1)
	{
		if (!esileht)
			setxy(obj, x - 2, y + 24);
		else
		{
			if (!ie4)
				setxy(obj, x - 7, y + 19);
			else
				setxy(obj, x - 4, y + 19);
		}
		
		last_l1_obj = obj;
	}
	else
	{
		if (esileht)
			y = y + 7;
			
		x = last_l1_obj.offsetWidth - 5;	
		
		realx = findPosX(last_l1_obj) + x + obj.offsetWidth - 10;
		
		
		
		if ((typeof(maxx) != "undefined") && (maxx > 0))
		{
			if (realx > maxx)
			{
				diff = realx - maxx;
				
				x2 = x - diff;		
				x = x2;			
				
				if (x < 30)
					x = 30;
			}
		}
	
		setxy(obj, x, y - 165);
	}
	
	

	my_showmenu_timer[level + "_" + name] = setTimeout('setvis(1, "rippmenyy_' + name + '"); mouse_over_menyy(' + level + ', "rippmenyy_' + name + '") ', 100);	
	
	
	
	
	
}

function mouse_over_menyy(level, name) 
{

	
	

	

	if (hideallmenus_timer)
	{	
		clearTimeout(hideallmenus_timer);
		hideallmenus_timer = null;
	}
	
	
}

function hideallothermenus(level_in, except) {

	

	var name = "";
	
	names = shown_menu_names;
	
	for (i = 0; i < shown_menu_names.length; i++)
	{
		name1 = names[i];		
		parts = name1.split("_");
		
		level = parts[0];
		name = parts[1];
		
		
		
		
		if (level < level_in)		
			continue;
		
		
		
		for (j = 2; ; j++)
		{
			if (parts[j])
				name = name + "_" + parts[j];
			else
				break;
		}
		
		
		
		
		if (name == except)
			continue;
		
		setvis(0, "rippmenyy_" + name);
		if (my_showmenu_timer[level + "_" + name])
		{
			clearTimeout(my_showmenu_timer[level + "_" + name]);
			my_showmenu_timer[level + "_" + name] = null;
		}
	}
	
	
}

hideallmenus_timer = null;


my_hidemenu_timer = Array();

function my_hidemenu(level, name)
{
	
	
	
	
	
	hideallmenus_timer = setTimeout('hideallothermenus(' + level + ', "");', 2500);

	
}	

function my_hidemenu2(name)
{
	return;


}	









function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	
	return curtop;
}


function getObj2(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
 
 	
}

function setxy(obj, x, y) {

	if (!obj)
		return;

	if (ns4)
	{
		obj.left = x;
		obj.top = y;
	}
	else
	{
		obj.style.left = x;
		obj.style.top = y;
	}

}

function getobj(objname) {

	return getmyobj(objname);
}

function getmyobj(objname) {

	if (ie4)
		return document.all[objname];
	else if (ns4)
		return document[objname];
	else
		return document.getElementById(objname);

}

function setvis(val, objname) {

	if (val == 1)
		val = "visible";
	else
		val = "hidden";

		
	obj = getobj(objname);
		
	if (!obj)
		return;
		
	if (ie4)
	{
		if (obj && obj.style)
			obj.style.visibility = val;
	}
	else if (ns4)
	{
		if (obj)
			obj.visibility = val;
	}
	else
	{
		if (obj && obj.style)
			obj.style.visibility = val;
	}

}
		


TipObj_extension_loaded = 0;

ns4 = (document.layers) ? true : false;
ie4 = (document.all) ? true : false;



var isDOM=document.getElementById?1:0;
var isIE=document.all?1:0;
var isNS4=navigator.appName=='Netscape'&&!isDOM?1:0;
var isIE4=isIE&&!isDOM?1:0;
var isOp=window.opera?1:0;
var isDyn=isDOM||isIE||isNS4;
var isWin=navigator.platform.indexOf('Win')!=-1?1:0;



MSIE55p = 0;
if (ie4)
{
	browser = navigator.userAgent;
	
	pos = browser.indexOf("MSIE");
	if (pos != -1)
	{
		ver = browser.substr(pos + 4);
		
		
		pos_end = ver.indexOf(";");
		ver = ver.substr(0, pos_end);
		
		
		
		if (ver.valueOf() >= 5.5)
		{
			MSIE55p = 1;
			
		}
	}
}
















if (!window.gusEvts) var gusEvts=new Array();

function addEvent(obj, eName, fn, cap)
{
 var g=gusEvts, n=g.length, old=obj[eName], i=old?old.toString().indexOf('gEvtId'):-1;
 if (!old||i==-1){obj[eName]=new Function('e','var gEvtId='+n+'; return runEvent(e,gEvtId,'+
  !obj.navigator+')'); g[n]=[obj]; if (old) g[n][1]=old}
 else n=parseInt(old.toString().substring(i+7));
 g[n][g[n].length]=fn;
 if (isNS4&&cap) obj.captureEvents(Event[eName.substring(2).toUpperCase()]);
}

function runEvent(e, num, rval)
{
 var ret=1, fns=gusEvts[num], e=e?e:window.event;
 for (var i=1;i<fns.length;i++)
  ret=((typeof(fns[i])=='string' ? new Function('e',fns[i]) : fns[i])(e)!=false)&&ret;
 if (rval) return (ret ? (isNS4?fns[0].routeEvent(e):true) : false);
}





	


function getRef(id, par)
{
 par = !par ? document : (par.navigator?par.document:par);
 return (isIE ? par.all[id] :
  (isDOM ? (par.getElementById?par:par.ownerDocument).getElementById(id) :
  par.layers[id]));
}

function getSty(id, par)
{
 return (isNS4 ? getRef(id, par) : getRef(id, par).style)
}

if (!window.LayerObj) var LayerObj = new Function('id', 'par',
 'this.ref=getRef(id, par); this.sty=getSty(id, par); return this');
function getLyr(id, par) { return new LayerObj(id, par) }

function LyrFn(fn, fc)
{
	
	
	LayerObj.prototype[fn] = new Function('var a=arguments,p=a[0]; with (this) { '+fc+' }');
}
LyrFn('x','if (!isNaN(p)) sty.left=p; else return parseInt(sty.left)');
LyrFn('y','if (!isNaN(p)) sty.top=p; else return parseInt(sty.top)');
LyrFn('vis','sty.visibility=p');
LyrFn('bgColor','if (isNS4) sty.bgColor=(p?p:null); ' +
 'else sty.background=p?p:"transparent"');
LyrFn('bgImage','if (isNS4) sty.background.src=(p?p:null); ' + 
 'else sty.background=(p?"url("+p+")":"") ');
LyrFn('clip','if (isNS4) with(sty.clip) { left=a[0]; top=a[1]; right=a[2]; bottom=a[3] } ' +
 'else sty.clip="rect("+a[1]+"px "+a[2]+"px "+a[3]+"px "+a[0]+"px)" ');
LyrFn('write','if (isNS4) with (ref.document) {write(p);close()} else ref.innerHTML=p');
LyrFn('alpha','var f=ref.filters; if (f) {' +
 'if (sty.filter.indexOf("alpha")==-1) sty.filter+="alpha()"; ' +
 'if (f.length&&f.alpha) f.alpha.opacity=p } else if (isDOM) sty.MozOpacity=(p/100)');


function setLyr(lVis, docW, par)
{
 if (!setLyr.seq) setLyr.seq=0;
 if (!docW) docW=0;
 var obj = (!par ? (isNS4 ? window : document.body) :
  (!isNS4 && par.navigator ? par.document.body : par));
 var newID='_js_layer_'+setLyr.seq++;

 if (isIE&&!window.opera) obj.insertAdjacentHTML('beforeEnd', '<div id="'+newID+
  '" style="position:absolute"></div>');
 else if (isDOM)
 {
  var newL=document.createElement('div');
  obj.appendChild(newL);
  newL.id=newID; newL.style.position='absolute';
 }
 else if (isNS4)
 {
  var newL=new Layer(docW, obj);
  newID=newL.id;
 }

 var lObj=getLyr(newID, par);
 with (lObj.sty) { visibility=lVis; left=0; top=0; width=docW }
 return lObj;
}





 
 
 
 









var CSSmode=document.compatMode;
CSSmode=(CSSmode&&CSSmode.indexOf('CSS')!=-1)||isDOM&&!isIE||isOp?1:0;

 

if (!window.page) var page = { win: window, minW: 0, minH: 0, MS: isIE&&!isOp,
 db: CSSmode?'documentElement':'body' }


 

page.winW=function()
 { with (this) return Math.max(minW, MS?win.document[db].clientWidth:win.innerWidth) }
page.winH=function()
 { with (this) return Math.max(minH, MS?win.document[db].clientHeight:win.innerHeight) }


page.scrollX=function()
 { with (this) return MS?win.document[db].scrollLeft:win.pageXOffset }
page.scrollY=function()
 { with (this) return MS?win.document[db].scrollTop:win.pageYOffset }


page.docW=function()
 { with (this) return Math.max(minW, isNS4?win.document.width:win.document.offsetWidth) }
page.docH=function()
 { with (this) return Math.max(minH, isNS4?win.document.height:win.document.offsetHeight) }
 
 
 
 
	
	
	













function getbodysize() {

	if (ns4) pw = window.innerWidth - 20;
	else pw = page.winW() - 15;
	
	
	
	
	
	return pw;
}





function getbodywidth() {

	return getbodysize();
}
	




function getbodyheight() {

	if (ns4) ph = window.innerHeight - 20;
	else ph = page.winH() - 20;
	
	
	
	
	
	
	
	return ph;
}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

