


function imagehome() {
	var homeimage;
	var x = Math.random()
	if (x >= .5) {
	homeimage = "images/home_1.jpg";
	}
	else {
	homeimage = "images/home_2.jpg";
	}
	window.document.images.introimage.src = homeimage;
	}

//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");
}
	
//menu rollover script
function menuOn(menu) {
	document.getElementById(menu).style.backgroundColor = "#076eca"; // bgcolor10
}

function menuOff(menu) {
	document.getElementById(menu).style.backgroundColor = "#013a67"; // bgcolor16
}

//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 megaWin(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=yes,scrollbars=yes,resizable=yes,toolbar=yes,location=yes")
}

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 			= "MazdaUSA";
	var popUpWin 			= window.open(url, popUpName, popUpFeatures);

}	
