
//rollover script

function imgOn(img) {
	window.document.images[img].src = eval(img + "on.src");
}

function imgOff(img) {
	window.document.images[img].src = eval(img + "off.src");
}

//open window

function popup(url,winName,w,h) {
		newWin = window.open(url,winName,"width=" + w + ",height=" + h + ",menubar=no,scrollbars=yes,resizable=yes,toolbar=yes")
	}
	
//pop up that takes different parameters
// this will center the window within the browser and bring the window to focus
var legendWin;
function createWin(url,width,height) {
	
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	if(legendWin == null || legendWin.closed) {
		var props = "titlebar,toolbar,resizable,scrollbars=no,left=" + left + ",top=" + top + ",width=" + width + ",height=" + height;
		legendWin = window.open(url, "legend", props);
		legendWin.focus();
	} else {	
		legendWin.close();
		var props = "titlebar,toolbar,resizable,scrollbars=no,left=" + left + ",top=" + top + ",width=" + width + ",height=" + height;
		legendWin = window.open(url, "legend", props);
		legendWin.focus();
	}	
}

function cleanWin(url,width,height) {
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	newWin = window.open(url,"popup","left=" + left + ",top=" + top + ",width=" + width + ",height=" + height + ",menubar=no,scrollbars=no,resizable=no,toolbar=no")
}

function submitForm(n) {
	document.forms[n].submit();
	}
	
	
//open windows for exit package pdf
function popUpExit(url, pdfAction) {

	var pdfFeatures 		= ",width=1,height=1,menubar=no,scrollbars=no,resizable=no,toolbar=no";
	var pdfName 			= "Printing";
	this.pdfWin 			= window.open(pdfAction, pdfName, pdfFeatures);
	pdfWin.blur();
	
	var popUpFeatures 		= ",width=600,height=600,menubar=no,scrollbars=no,resizable=no,toolbar=no";
	var popUpName 			= "PPD";
	var popUpWin 			= window.open(url, popUpName, popUpFeatures);

}	
