function ieFix(topLevel) 
{
var ua = navigator.userAgent;
var isMSIE = (navigator.appName == "Microsoft Internet Explorer");
var isMSIE5_5 = isMSIE && (ua.indexOf('MSIE 5.5') != -1);
var isMSIE6 = isMSIE && (ua.indexOf('MSIE 6.0') != -1);

	if (isMSIE5_5 || isMSIE6) 
	{
	document.getElementById(topLevel).innerHTML = document.getElementById(topLevel).innerHTML.replace (/<ul/gi,"<table><tr><td><ul").replace (/<\/ul>/gi,"</ul></td></tr></table></a>");
	for (i=0;i<document.getElementsByTagName("li").length; i++) 
		{
		if (document.getElementsByTagName("li").item(i).className == "sub")
			{
			document.getElementsByTagName("li").item(i).innerHTML = document.getElementsByTagName("li").item(i).innerHTML.replace(/<\/a>/i,"");
			}
		}
	}
}

function getPageSize()
{

	var xScroll, yScroll;

	if (document.body.scrollHeight > document.body.offsetHeight)
	{
		xScroll=document.body.scrollWidth;
		yScroll=document.body.scrollHeight;
	}
	else
	{
		xScroll=document.body.offsetWidth;
		yScroll=document.body.offsetHeight;
	}

	var windowWidth, windowHeight;

	if (self.innerHeight)
	{
		windowWidth=self.innerWidth;
		windowHeight=self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
		windowWidth=document.documentElement.clientWidth;
		windowHeight=document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		windowWidth=document.body.clientWidth;
		windowHeight=document.body.clientHeight;
	}

	if (yScroll < windowHeight) pageHeight=windowHeight;
	else pageHeight=yScroll;

	if (xScroll < windowWidth) pageWidth=windowWidth;
	else pageWidth=xScroll;

	arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)

	return arrayPageSize;
}

function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

function videowin(videourl,picurl,autowidth,mode,imgnum)
{
	var arrayPageSize=getPageSize();
	var arrayPageScroll=getPageScroll();

	$("avatarbox").style.top = "30px";
	$("avatarbox").style.left=(((arrayPageSize[0]-40-570)/2)+"px");
	$("avatarbox").style.zIndex=101;
	$("avatarbox").innerHTML="";

    var genpicture = "<table border='0' style='background-color:#ffffff;width:550px;height:550px;' align='center'>";
    genpicture += "<tr>";
	genpicture += "<td width='25' align='center'><img src='http://onyx.mellesleg.hu/static/images/balnyil_be.gif' onclick='onclickmoveleft();' style='cursor:pointer;'></td>";
	genpicture += "<td><a style='color:#ffffff;font-weight: bold;' href='javascript:videowinclose();'><img src="+images[imgnum]+" border='0'></a></td>";
	genpicture += "<td width='25' align='center'><img src='http://onyx.mellesleg.hu/static/images/jobbnyil_be.gif' onclick='onclickmoveright();' style='cursor:pointer;'></td>";
	genpicture += "</tr><tr>";
	genpicture += "<td colspan='3' align='center' style='font-weight:bold;'>"+title[imgnum]+"</td>";
    genpicture += "</tr></table>";
    
    $("avatarbox").innerHTML=genpicture;
	$("avatarbox").style.display="";

	$("avataroverlay").style.height=(arrayPageSize[1]+"px");
	$("avataroverlay").style.zIndex=100;
	$("avataroverlay").style.display="";
}

function videowinclose()
{
	$("avataroverlay").style.display="none";
	$("avatarbox").style.display="none";
}