//Image Rollovers
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
//End Image Rollovers

//Open a New Window
function openNewWindow(url) {
window.open(url,"",'width=700,height=500,scrollbars=yes,scrolling=yes,resizable=no,status=yes,toobar=no');
}

//Open a New Small Window
function openNewSMWindow(url) {
window.open(url,"",'width=455,height=370,scrollbars=no,scrolling=no,resizable=no,status=yes,toobar=no');
}


//Open a New Window with ..
function openWindow(url) {
window.open(url,"",'width=700,height=350,scrollbars=yes,scrolling=yes,resizable=yes,status=yes,toolbar=yes,location=yes,menubar=yes');
}

//Print Body Contents
function pp() {
	var oContent;

	pp_date = new Date();
	pp_window = window.open('','ppwin' + pp_date.getTime(), 'width=700,height=500,scrollbars=yes,scrolling=yes,toolbar=yes,resizable=yes');
	pp_window.document.write("<html><head>\n<title>\n" + document.title + "\n</title>\n<link rel=stylesheet href=/system/internet.css type=text/css>\n</head>\n");
	pp_window.document.write('<body onload="window.print();">');
	pp_window.document.write("<p align='right'><input type='button' value='Print' onClick='window.print();' class='inputButtonSearch'>&nbsp;<input type='button' value='Close' onClick='window.close();' class='inputButtonSearch'></p>");
	oContent = document.getElementById( "content" );
	pp_window.document.write( oContent.innerHTML );	
	pp_window.document.write("</body></html>");
	void(pp_window.document.close());
}

//Preload Images
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		hp_main_commercial_lo_over = newImage("images/hp_main_commercial_lo-over.gif");
		hp_main_education_lo_over = newImage("images/hp_main_education_lo-over.gif");
		hp_main_public_lo_over = newImage("images/hp_main_public_lo-over.gif");
		hp_main_about_lo_over = newImage("images/hp_main_about_lo-over.gif");
		hp_window_more_over = newImage("images/hp_window_more-over.gif");
		hp_window_media_over = newImage("images/hp_window_media-over.gif");
		hp_window_additions_over = newImage("images/hp_window_additions-over.gif");
		hp_window_calendar_over = newImage("images/hp_window_calendar-over.gif");
		hp_window_shipping_over = newImage("images/hp_window_shipping-over.gif");
		hp_business_over = newImage("images/hp_business-over.gif");
		hp_shipping_over = newImage("images/hp_shipping-over.gif");
		sub_home_link_top_over = newImage("sub_home_link_top-over.gif");
		preloadFlag = true;
	}
}

// Search function to check the text box.
function CheckSearchString(passform){

		if (passform.SearchString.value == "") {
			alert("A search term must be enter into the" + " '" + "Search For:"+"' "+ "field.");
			passform.SearchString.focus()
			passform.SearchString.select()
			return false
		}
		return true

	}
//Clear text box for search
function ClearText() {
	document.SearchForm.SearchString.value = "";
	document.SearchForm.SearchString.focus()

}

// Download a file
function DownloadFile( aFileName, sRedirectPage ){
	window.location.href= sRedirectPage + "?DownloadFile=" + aFileName;
}

// Open an application within a window that is 1024x768 in size.
function openFullScreenApplication( page ) {
	var options, resultWin;

	// Set the page options.
	options = 'top=0,left=0,height=692,width=1015,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes';

	// Open the Application window.
	resultWin = window.open( page, "_blank", options );
}
