var NN4=document.layers?true:false;
var NN6=(navigator.appName == "Netscape")&&!NN4;
var layerRef=NN4?"document":NN6?"":"document.all";
var styleRef=NN4?"":".style";
var suff=NN4?"nn4":"";
var Hist=new Array();
var Width1=0;
var Width2=0;
var Width3=0;

function getElementById(anId){
	if (anId)
		if (NN4){
			var objRes=eval("window.document."+anId);
			if (objRes)
				return objRes;
			objRes=eval(document.anchors[anId]);
			if (objRes)
				return objRes;
			for(var i=0;i<document.layers.length;i++)
				if (!objRes){
					objRes=eval(document.layers[i].document.anchors[anId]);
					if (objRes)
						objRes.parent=eval(document.layers[i]);
				}
			return objRes;
		}
		else
			return window.document.getElementById(anId);
	else
		return null;
}

function getCoordsById(anId){
	var obj=getElementById(anId);
	return getCoords(obj)
}
function getCoordsByIdNN4(anId){
	var obj=getElementById(anId);
	return getCoordsNN4(obj)
}
function getCoords(anObj){
	var objRes=new Object();
	objRes.left=objRes.top=objRes.width=objRes.height=0;
	with(objRes){
		width+=anObj.offsetWidth;
		height+=anObj.offsetHeight;
		for(var i=anObj;i!=null;i=i.offsetParent){
			left+=i.offsetLeft;
			top+=i.offsetTop;
		}
	}
	return objRes;
}

function getCoordsNN4(anObj, anEndObj){
	var objRes=new Object();
	objRes.left=objRes.top=objRes.width=objRes.height=0;
	with(objRes){
		left=anObj.x;
		top=anObj.y;
		width=anEndObj.x-left;
		height=anEndObj.y-top;
		if (height==0) height=14;
		if (anObj.parent){
			left+=anObj.parent.x;
			top+=anObj.parent.y;
		}
	}
	return objRes;
}
function getPadCoordsNN4(anObj){
	var objRes=new Object();
	objRes.left=objRes.top=objRes.width=objRes.height=0;
	with(objRes){
		left=anObj.left;
		top=anObj.top;
		width=anObj.clip.width;
		height=anObj.clip.height;
	}
	return objRes;
}


function showMenu(strMenuId,fl){
	//var objItem=getElementById(strMenuId+"item");
	var objTop=getElementById(strMenuId+"top");
	var objImg=getElementById(strMenuId+"i");
	//var objTb=getElementById(strMenuId+"tb");
	var objPad=getElementById(strMenuId);
	//var objCoords=NN4?getCoordsNN4(objItem,objEnd):getCoords(objItem);
	var objPadCoords=NN4?getPadCoordsNN4(objPad):getCoords(objPad);
	var objTopCoords=NN4?getPadCoordsNN4(objTop):getCoords(objTop);
			//alert (eval("objPad"+styleRef+".posWidth"));
		eval("objPad"+styleRef+".left="+objTopCoords.left+"-objPad"+styleRef+".posWidth");

		eval("objPad"+styleRef+".top="+(objTopCoords.top));
		objImg.src="files/images/arrow2.gif";
		//eval("objPad"+styleRef+".posWidth="+(325-(0)));
			//eval("objPad"+styleRef+".posWidth="+(325-(objCoords.width+0)));
		//Width1=objCoords.width;



	eval("objPad"+styleRef+".display=''");
			eval("objPad"+styleRef+".visibility='visible'");

	

}

function hideMenu(strMenuId){
	var objPad=getElementById(strMenuId);
	var objImg=getElementById(strMenuId+"i");
eval("objPad"+styleRef+".visibility='hidden'");
objImg.src="files/images/arrow.gif";
}

var gnDelayIn=0, gnDelayOut=1000;
var gnActTimerID=0, gtActTimeStart=0, gnActDelay=0, gcActProcStr="";
function clearActTimer(){
	if (gnActTimerID){
		clearTimeout(gnActTimerID);
		gnActTimerID=0;
		gtActTimeStart=0;
		gcActProcStr="";
	}
}

function setActTimer(lcCommand, lnDelay){
	clearActTimer();
	lcCommand+="; clearActTimer();";
	gtActTimeStart=new Date();
	gnActDelay=lnDelay;
	gcActProcStr=lcCommand;
	return setTimeout(lcCommand, lnDelay);
}

function OverItem(strCurr,strDesc){
//  HideHist();
//  CutHist(strCurr);
//  AddToHist(strDesc);
//  ShowHist();
//  gDesc=strDesc;
showMenu(strDesc,strCurr);
//
}

function OutItem(strDesc){
	hideMenu(strDesc);
//	gnActTimerID=setActTimer("hideMenu('"+strDesc+"')", gnDelayOut);
//	gDesc="";
}


function showPage(href)
{
var newWin
newWin =  window.open(href, 'news', 'status=no, toolbar=no, menubar=no, directories=no, scrollbars=yes, resizable=yes, width=300 height=400');
newWin.focus();

}
function showPage3(href)
{
var newWin
newWin =  window.open(href, 'news', 'status=no, toolbar=no, menubar=no, directories=no, scrollbars=yes, resizable=yes, width=500 height=400');
newWin.focus();

}

function showPage2(href)
{
var newWin
newWin =  window.open(href, 'news', 'status=no, toolbar=no, menubar=no, directories=no, scrollbars=yes, resizable=yes, width=592 height=608');
newWin.focus();

}

function hideBrand(strMenuId){
	var objPad=getElementById(strMenuId);
	var objPada=getElementById(strMenuId+"a");
	eval("objPad"+styleRef+".visibility='hidden'");
	eval("objPada"+styleRef+".color='#003366'");
}

function showBrand(strMenuId){
	var objPad=getElementById(strMenuId);
	var objPada=getElementById(strMenuId+"a");
	var objPadCoords=NN4?getPadCoordsNN4(objPad):getCoords(objPad);
	var objPadCoordsa=NN4?getPadCoordsNN4(objPada):getCoords(objPada);
	eval("objPad"+styleRef+".top=objPadCoordsa.top+17");
	eval("objPad"+styleRef+".display=''");
	eval("objPad"+styleRef+".visibility='visible'");
	var colour='#CC0000';
	switch (strMenuId) {
	case "brand1":  { colour='#CC0000';break;}
	case "brand2": { colour='#00009f';break;}
	case "brand4": { colour='#ff9310';break;}
	case "brand5": { colour='#ff061e';break;}
	case "brand6": { colour='#2414c7';break;}
	case "brand3": { colour='#000066';break;}
	case "brand7": { colour='#29508B';break;}
	}
	eval("objPada"+styleRef+".color='"+colour+"'");
}
function hideBrandS(strMenuId) {
    if (typeof (event) != 'undefined') {
        event.cancelBubble = true;
    }
	var objPad=getElementById(strMenuId+"a");
	eval("objPad"+styleRef+".visibility='hidden'");
}


function showBrandS(strMenuId){
    if (typeof (event) != 'undefined') {
        event.cancelBubble = true;
    }
	var objPad=getElementById(strMenuId+"a");
	var objPada=getElementById('brandmenu');
	var objPadCoords=NN4?getPadCoordsNN4(objPad):getCoords(objPad);
	var objPadCoordsa=NN4?getPadCoordsNN4(objPada):getCoords(objPada);
	eval("objPad"+styleRef+".top=23");
	eval("objPad"+styleRef+".display=''");
	eval("objPad"+styleRef+".visibility='visible'");

}

function mOver(iname) {
	var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	var m = InternetExplorer ? document.getElementById('intro') : document.embeds[0];
	m.TGotoLabel('_level0',iname);
	m.Play();
	var colour='#CC0000';
	switch (iname) {
	case "salag":  { colour='#CC0000';break;}
	case "cezar": { colour='#00009f';break;}
	case "bolta": { colour='#ff9310';break;}
	case "vox": { colour='#ff061e';break;}
	case "darek": { colour='#2414c7';break;}
	case "marley": { colour='#000066';break;}
	case "artprofil": { colour='#29508B';break;}
	}
	eval("document.getElementById(iname)"+styleRef+".color='"+colour+"'");
}
function mOut(iname) {
	var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
    var m = InternetExplorer ? document.getElementById('intro') : document.embeds[0];
	m.GotoFrame(1);
	eval("document.getElementById(iname)"+styleRef+".color='#FFFFFF'");
}

function mOut2(strMenuId) {
gnActTimerID=setActTimer("mOut1('"+strMenuId+"')", gnDelayOut);
}
function mOver2(strMenuId) {
gnActTimerID=setActTimer("mOver1('"+strMenuId+"')", gnDelayIn);
}