ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;







  ///////////////////
 //  Show + Hide  //
///////////////////

function showObject(id) {
	if (ns4) document.layers[id].visibility = "show";
	//else if (ie4) document.all[id].style.visibility = "visible";
	else document.getElementById(id).style.visibility = "visible";
}
function hideObject(id) {
	if (ns4) document.layers[id].visibility = "hide";
	//else if (ie4) document.all[id].style.visibility = "hidden";
	else document.getElementById(id).style.visibility = "hidden";
}








  ////////////////////
 //  PopUp Window  //
////////////////////

function popWindow(urlpass, imageWidth, imageHeight) {  
	// make PHP discover image dimensions, size the window accordingly
	var posX = screen.width - (imageWidth+80);
	var posY = (screen.height * 0.1);
	var windowNumber = 1;
	if (urlpass == "main.php") windowNumber = 2;
	var scrollyn = "no";
	if (urlpass == "main.php") scrollyn = "yes";
	newWindow = window.open(urlpass, windowNumber, "width=" + imageWidth+ ",height=" +imageHeight+ ", scrollbars="+ scrollyn +", resizable="+ scrollyn +", left=" +posX+ ", top=" +posY);
	newWindow.focus();
}



function windowExpand() {

	//if (self != top) top.location.href = document.location.href;
	//if(self.parent.frames.length!=0) self.parent.location.replace(document.location.href);
	newWidth = 760;
	newHeight = 600;

	if (screen.availWidth) newWidth = screen.availWidth;
	if (screen.availHeight) newHeight = screen.availHeight;
	self.moveTo(0,0); 
	self.resizeTo(newWidth, newHeight); 
}




