// Preload images
$(document).ready(function(){
	imgDDGradient = new Image();
	imgDDBorderBottom = new Image();
	imgDDBorderSides = new Image();		
	imgDDDottedLine = new Image();		
	imgDDGradient.src = "../../media/images/bg-drop-down.jpg";	
	imgDDBorderBottom.src = "../../media/graphics/drop-down-border-bottom.gif";
	imgDDBorderSides.src = "../../media/graphics/drop-down-border-sides.gif";		
	imgDDDottedLine.src = "../../media/graphics/left-nav-dot-line.gif";
});

function openNewWindow(fileName,windowName,theWidth,theHeight) {
	if (windowName == "newWindow") 
	{
		//generate random window ID
		 windowName = new String(Math.round(Math.random() * 100000));
	}
	newWin = window.open(fileName,windowName,"toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width="+theWidth+",height="+theHeight);
	newWin.focus();
}

function popup(url, width, height, chrome) {
	var w = width, h = height, docw = width, doch = height;
	if (document.all) {
		docw = document.body.clientWidth;
		doch = document.body.clientHeight;
	}
	else if (document.layers) {
		docw = window.innerWidth;
		doch = window.innerHeight;
	} 
	if (docw <= w) { w = (docw - 40)}
	if (doch <= h) { h = (doch - 40)}
	var leftPos = (screen.width / 2) - (w / 2);
	var topPos = (screen.height / 2) - (h / 2);     
	OpenWin = this.open(url,"ImageWindow","top="+topPos+",screenX="+topPos+", left="+leftPos+", screenY="+leftPos+",width="+w+",height="+h+", toolbar="+chrome+",menubar="+chrome+",location="+chrome+",status="+chrome+",scrollbars=yes,resizable=yes,");
}


