myWidth = 0, myHeight = 0;
myTop = 0, myLeft = 0;

function checkSizes()
{
	if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		myTop = window.pageYOffset;
		myLeft = window.pageXOffset;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		myTop = document.documentElement.scrollTop;
		myLeft = document.documentElement.scrollLeft;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		myTop = document.body.scrollTop;
		myLeft = document.body.scrollLeft;
	}
}

function doLiteOn(obj)
{
obj.style.backgroundImage = "url(i/ka.gif)";
}
function doLiteOff(obj)
{
obj.style.backgroundImage = "none";
}

function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function showPopup(id)
{
	var pops = document.getElementsByTagName("TABLE");
	for (var x = 0; x < pops.length; x++) if (pops[x].id && pops[x].id.substr(0,4) == "pop_")
	{
		if (pops[x].id == id)
		{
			pops[x].style.display = "";

			checkSizes();
			pops[x].style.left = (myLeft + (myWidth - (pops[x].offsetWidth ? pops[x].offsetWidth : parseInt(pops[x].getAttribute("pr_width")))) / 2) + "px";
			pops[x].style.top = (myTop + (myHeight - (pops[x].offsetHeight ? pops[x].offsetHeight : parseInt(pops[x].getAttribute("pr_height")))) / 2) + "px"

			var tmp = document.getElementById("bg_" + pops[x].id);
			if (tmp)
			{
				tmp.style.width = pops[x].offsetWidth;
				tmp.style.height = pops[x].offsetHeight;
				tmp.style.left = pops[x].style.left;
				tmp.style.top = pops[x].style.top;
				tmp.style.display = "";
			}
		}
		else
		{
			pops[x].style.display = "none";
			var tmp = document.getElementById("bg_" + pops[x].id);
			if (tmp) tmp.style.display = "none";
		}
	}

	return false;
}
function closePopup(id)
{
	var x = document.getElementById(id);
	if (x) x.style.display = "none";
	x = document.getElementById("bg_" + id);
	if (x) x.style.display = "none";

	return false;
}

