function ShowHideObject(id, status)
{
    var obj = document.getElementById(id);
    if(obj!=null)
    {
        if (obj.style) { obj=obj.style; status=(status=='show')?'visible':(status=='hide')?'hidden':status; }
        obj.visibility=status;
    }
}

var preImages = new Array()
var loaded = new Array()
var currCount = 0
var preloadFlag = false

function changeImages() {
    if (document.images && (preloadFlag == true)) {
        for (var i=0; i<changeImages.arguments.length; i+=2) {
			    if (document.getElementById(changeImages.arguments[i])) document.getElementById(changeImages.arguments[i]).src = changeImages.arguments[i+1];
	    }
    }
}

function checkLoad() {
if (currCount == preImages.length) { 
	window.status='Done.'
	preloadFlag = true;
	return
}

for (var i in preImages) {
	if (loaded[i] == false && preImages[i].complete) {
		loaded[i] = true
		currCount++
		window.status='Preloading images '+currCount+' of '+preImages.length
	}
}
setTimeout("checkLoad()",10)
}

function preloadImages() {
for (var i = 0; i < preloadImages.arguments.length; i++) {
	preImages[i] = new Image()
	preImages[i].src = preloadImages.arguments[i]
}
window.status='Preloading images '+currCount+' of '+preImages.length
for (var i in preImages) loaded[i] = false
checkLoad()
}

function showStatus(msg){
	self.setTimeout('setStatus("'+msg+'")', 1) 
return true;
}
function setStatus(msg){
	self.status = msg;
}


//---------------------------------------------------------------------

function resizeContent()
{
	var lastchar = top.location.href.substring(top.location.href.length-1);
	if (!(lastchar == "/" || lastchar == "m"))// not root
	{
		if (top.location.href.indexOf("index") < 0)
		{
			document.getElementById("mainTable").height = "100%";
		}
	}
}

function openWindow(url, width, height)
{
    var screenWidth,screenHeight;
	var popupWidth,popupHeight;
	
	popupWidth = width;
	popupHeight = height;
	
	if (document.all)
	{
		screenWidth = top.window.screen.availWidth;
		screenHeight = top.window.screen.availHeight - 60;
	}
	else
	{
		screenWidth = top.innerWidth - 16;
		screenHeight = top.innerHeight - 16;
	}

	windowWnd = window.open(url,null,"width=" + popupWidth + ",height=" + popupHeight + ",left=" + ((screenWidth / 2) - (popupWidth / 2)) + ",top=" + ((screenHeight / 2) - (popupHeight / 2) + 40),"scrollbars=no,statusbar=no,resizable=no");
	return false;
}

function openGallery(galleryID,lang)
{
    return openWindow("gallery.aspx?id=" + galleryID + "&lang=" + lang + "&index=1", 500, 420);
}

objects = document.getElementsByTagName("object");
for (var i = 0; i < objects.length; i++)
{
    objects[i].outerHTML = objects[i].outerHTML;
}
