pdDOM = (document.getElementById) ? true : false;
pdNS4 = (document.layers) ? true : false;
pdIE = (document.all) ? true : false;
pdIE4 = pdIE && !pdDOM;
pdMac = (navigator.appVersion.indexOf("Mac") != -1);
pdIE4M = pdIE4 && pdMac;
isMenu = (pdDOM || pdNS4 || (pdIE4 && !pdIE4M));

browserString = pdNS4 ? "NS4" : pdDOM ? "DOM" : "IE4";
isIE5M = false;
isIE5W = false;
isNS6 = false;

if (browserString == "DOM")
{
	isIE5M = pdIE && pdMac;
	isIE5W = pdIE && !pdMac;
	isNS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
}
var Browser = window.navigator.userAgent;
var OffsetMSIE = Browser.indexOf("MSIE ");




// check if the browser is Navigator 3 or higher:
agent = navigator.userAgent;
browserVer = 2;
if (agent.substring(0,7) == "Mozilla")
{
    if (parseInt(agent.substring(8,9)) >= 3) {browserVer = 1;}
}

// preload universal images:
if (browserVer == 1)
{
	register = new Image(20,20);
	register.src = "/img/butts/register.gif";
	sregister = new Image(20,20);
	sregister.src = "/img/butts/sregister.gif";
	
	profile = new Image(20,20);
	profile.src = "/img/butts/profile.gif";
	sprofile = new Image(20,20);
	sprofile.src = "/img/butts/sprofile.gif";

	login = new Image(20,20);
	login.src = "/img/butts/login.gif";
	slogin = new Image(20,20);
	slogin.src = "/img/butts/slogin.gif";

	home = new Image(20,20);
	home.src = "/img/butts/home.gif";
	shome = new Image(20,20);
	shome.src = "/img/butts/shome.gif";

	portletinfo = new Image(20,20);
	portletinfo.src = "/img/butts/portletinfo.gif";
	sportletinfo = new Image(20,20);
	sportletinfo.src = "/img/butts/sportletinfo.gif";

	mailus = new Image(20,20);
	mailus.src = "/img/butts/mailus.gif";
	smailus = new Image(20,20);
	smailus.src = "/img/butts/smailus.gif";

	search = new Image(20,20);
	search.src = "/img/butts/search.gif";
	ssearch = new Image(20,20);
	ssearch.src = "/img/butts/ssearch.gif";
	
}

function hiLite(imgDocID, imgObjName) 
{
	if (browserVer == 1) 
	{
		document.images[imgDocID].src = eval(imgObjName + ".src")
	}
}


var s1n = new CreateArray("Seznam", "Atlas", "Centrum", "Quick",
    "RedBox", "Google", "Altavista", "Yahoo" );

var s2n1 = new CreateArray("Katalog", "Fulltext", "Firma", "Praha", "Lidi"); /* Seznam */
var s2u1 = new CreateArray("cat", "full", "comp", "map", "peop");
var s2n2 = new CreateArray("Katalog", "Fulltext", "Mapa");	/* Atlas */
var s2u2 = new CreateArray("cat", "full", "map");
var s2n3 = new CreateArray("Katalog", "Fulltext", "Firma", "Obchody");	/* Centrum */
var s2u3 = new CreateArray("cat", "full", "comp", "shop");
var s2n4 = new CreateArray("Katalog", "Fulltext");	/* Quick */
var s2u4 = new CreateArray("cat", "full");
var s2n5 = new CreateArray("Katalog", "Fulltext", "Zprávy", "TV");	/* RedBox */
var s2u5 = new CreateArray("cat", "full", "news", "tv");
var s2n6 = new CreateArray("Fulltext");	/* Google */
var s2u6 = new CreateArray("full");
var s2n7 = new CreateArray("Fulltext");	/* Altavista */
var s2u7 = new CreateArray("full");
var s2n8 = new CreateArray("Fulltext");	/* Yahoo */
var s2u8 = new CreateArray("full");

function CreateArray()
{
    this.length = CreateArray.arguments.length
    for (var i = 0; i < this.length; i++)
    this[i + 1] = CreateArray.arguments[i]
} 


var maxLength = 10;
var trueLength = s2n1.length;
var lst = s2n1.length;

function changeMenu()
{
    menuNum = document.searchBox.w.selectedIndex;
    if (menuNum == null) return;

    var tempArray1;
    var tempArray2;

    if (menuNum == 0) { tempArray1 = s2n1; tempArray2 = s2u1; }
    if (menuNum == 1) { tempArray1 = s2n2; tempArray2 = s2u2; }
    if (menuNum == 2) { tempArray1 = s2n3; tempArray2 = s2u3; }
    if (menuNum == 3) { tempArray1 = s2n4; tempArray2 = s2u4; }
    if (menuNum == 4) { tempArray1 = s2n5; tempArray2 = s2u5; }
    if (menuNum == 5) { tempArray1 = s2n6; tempArray2 = s2u6; }
    if (menuNum == 6) { tempArray1 = s2n7; tempArray2 = s2u7; }
    if (menuNum == 7) { tempArray1 = s2n8; tempArray2 = s2u8; }

    for (i = lst; i > 0; i--) document.searchBox.h.options[i] = null;

    /*document.menu.h.options[0] = new Option( "-- Vyberte --" );
    document.menu.h.options[0].value = "javascript:void()"; */

    for (i = 1; i <= tempArray1.length; i++) { 
        document.searchBox.h.options[i-1] = new Option( tempArray1[i] );
        document.searchBox.h.options[i-1].value = tempArray2[i]; 
    }

    document.searchBox.h.options[0].selected = true;
    lst = tempArray1.length;
} 
