
// Toggle the display of specified elements
function toggleMenu(objID) {
	if (!document.getElementById) return;
	var ob = document.getElementById(objID).style;
	ob.display = (ob.display == 'block')?'none': 'block';
}


// Opens an Image preview window
// Preloads the image
function openImageWindow(picURL) {
	var myImg = new Image();
		
	newWindow=window.open("imgprevwindowcontents.html",null,'directories=0,status=0,toolbar=0,menubar=0,scrollbars=0,resizable=1,menubar=0,location=0,width=400,height=300');

	myImg.onload = function() { 
		//newWindow.document.body.appendChild(myImg);
		newWindow.document.body.setAttribute("background", myImg.src);
		pic = newWindow.document.getElementById("pic");
		pic.style.display  = 'none';
		pic.style.visibility = 'Hidden';
		newWindow.resizeTo( myImg.width,myImg.height + 85);
		newWindow.focus()	
	}	
	myImg.onerror = function() { 
		pic = newWindow.document.getElementById("pic"); 
		pic.style.color = "#FF0000";
		pic.style.width = "65%"
		pic.innerHTML = "The image could not be loaded.<BR />Click to close this window."
		newWindow.focus()
	}
	myImg.src = picURL;
	
}
