﻿
function OKN_Zav(o, i)
{
	var main = o;
	while(main!=null)
	{
		main = main.offsetParent;
		if (main.id.substring(0, 4) == 'okno') {
			EffectsDo(main, true, 0);
			/* main.style.display = 'none'; */
			var Oid = main.id.substr(4, 3) * 1;
			var ac2 = fncCookieRead("ac2");
			ac2 = ac2 & (0xffffff ^ parseInt(Math.pow(2, Oid)))
			if (Oid > 2) fncCookieWrite("ac2", ac2);
			fncCookieWrite("ac2", ac2);
			break;
		}
	}
}

Tload[TCounts] = "fBanners";
TCounts ++;
Tload[TCounts] = "fBanners2";
TCounts ++;

function fBanners2()
{

	if (IE)
	{
		var ad300x250main = document.getElementById('ad300x250main');
	 	var ad300x250Alt = document.getElementById('ad300x250Alt');

		if (ad300x250main == null) return;

	 	ad300x250main.style.display = 'none';
	 	ad300x250Alt.style.display = 'block';

	}


}

function fBanners()
{
	if (IE)
	{
		var dieta_banner = document.getElementById('dieta_banner');
		if (dieta_banner == null) return;

		var adsmain = document.getElementById('adsmain');
	 	var adsex   = document.getElementById('adsex');
	 	adsmain.style.display = 'none';
	 	adsex.style.display = 'block';
	}
}


function OpenWindow(_URL,WName,SouX,SouY,WWidth,WHeight,Status, strScroll, strMenu)
{
	eval('window.open("'+_URL+'","'+WName+'","Width='+WWidth+',Top='+SouY+', Left='+SouX+', Height='+WHeight+',MenuBar='+ strMenu +', Status='+Status+', ScrollBars='+strScroll+'");');
}


function OKN_Min(o)
{
	var s = o.src;
	var r = 0;
	if (s.indexOf('rozbalit') != -1) r = 1;

	if (r == 0) s = s.replace('zabalit', 'rozbalit') 
	if (r == 1) s = s.replace('rozbalit', 'zabalit') 
	o.src = s;

	var main = o;
	var id = null;
	while(main!=null)
	{
		main = main.offsetParent;
		if (main.id.substring(0, 4) == 'okno') {
			id = main.id; 
			break;
		}
	}

	var okno = null;
	for (var i=0; i<main.childNodes.length; i++)
	{
		if (main.childNodes[i].id == id + 'o') 
		{
			okno = main.childNodes[i];
			break;
		}
	}

	var Oid = main.id.substr(4, 3) * 1;
	var ac2 = fncCookieRead("ac2");

	if (r == 0)
	{
		ac2 = ac2 & (0xffffff ^ parseInt(Math.pow(2, Oid)))
		okno.style.display = 'none';
	}
	else
	{
		ac2 = ac2 | parseInt(Math.pow(2, Oid))
		okno.style.display = 'block';
	}

	if (Oid > 2) fncCookieWrite("ac2", ac2);

//	alert(main.childNodes.length);
//	alert(main.childNodes[3].length);
}


var ReceptyPool = new Array(100, 153, 100, 100, 153, 100);
var ReceptyIdx = 0;

function scrollF(w)
{
	var iw = document.getElementById('scrollpwin');
	// iw.scrollTop++;

	if (w == 0)
	{
		if (ReceptyIdx == ReceptyPool.length) {}
		else
		{
			iw.scrollLeft += ReceptyPool[ReceptyIdx];
			ReceptyIdx ++;
		}
	}

	if (w == 1)
	{
		if (ReceptyIdx == 0) {}
		else
		{
			ReceptyIdx --;
			iw.scrollLeft -= ReceptyPool[ReceptyIdx];
		}
	}
}




