function getObj(iName,iFrame) {
	if (!iFrame) iFrame = document;
	if (iFrame[iName]) return iFrame[iName];
	if (document.getElementById) return iFrame.getElementById(iName);
	if (document.all) return iFrame.all[iName];
	if (document.layers) return iFrame.layers[iName];
}

function showObj(iName)
{
	var w = new getObj(iName);
	if(w) {
		w.style.visibility="visible";
		w.style.display="";
	}
}

function sizeMe () {
	var mrg = 40; // margin x 2
	var w = 800, h = 600;
	if (window.innerWidth) w = window.innerWidth; else w = this.document.body.clientWidth;
	if (window.innerHeight) h = window.innerHeight; else h = this.document.body.clientHeight;
	var w = w - mrg;
	var h = h - mrg;
	if ( w>1400 ) w=1400;
	if ( h>1200 ) h=1200;
	var wc = Math.round(w/2);
	var hc = Math.round(h/2); 
	if ( window.location.href.indexOf("?") == -1 ) window.location=window.location.href + "?imgxy=" + wc + "+" + hc +  "&iMapWidth=" + w + "&iMapHeight=" + h;
	else window.location=window.location.href + "&imgxy=" + wc + "+" + hc +  "&iMapWidth=" + w + "&iMapHeight=" + h;
	document.body.innerHTML="<center style='font-family: Geneva, Arial, Helvetica, san-serif;'><img src='images/loading.gif' id='waitImg'></center>";
	setTimeout("showObj('waitImg');getObj('waitImg').src='images/loading.gif';",200);
}

