


//=============================================================================
// Mouseover Image Functions
//
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];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		programs_over = newImage("../images/programs_over.gif");
		resources_over = newImage("../images/resources_over.gif");
		calendar_over = newImage("../images/calendar_over.gif");
		aboutus_over = newImage("../images/aboutus_over.gif");
		contactus_over = newImage("../images/contactus_over.gif");
		home_over = newImage("../images/home_over.gif");
		preloadFlag = true;
	}
}

//=============================================================================
// resize code from gary smith menu code available @
// developer.netscape.com, to force nn4 to reload js/css 
// positioned content -- ie5 seems to ignore altogether
//
window.onresize = resize;
window.saveInnerWidth = window.innerWidth;
window.saveInnerHeight = window.innerHeight;

function resize() {
    if (saveInnerWidth < window.innerWidth || 
        saveInnerWidth > window.innerWidth || 
        saveInnerHeight > window.innerHeight || 
        saveInnerHeight < window.innerHeight ) 
    {
        window.location.reload();
    }
}

//=============================================================================
// openWindow(url,name,width,height)
// open URL in popup window
//
function openWindow(url,name,width,height){
	params = "width="+width+",height="+height+",toolbar=no,scrollbar=no,directories=no,menu=no,location=no";
	popup = window.open(url,name,params);
	top.name = "opener";
}

//=============================================================================
// checkSimpleSearch()
// prompts the user with a message if 'Other Acedemic Programs' is selected.
//
function checkSimpleSearch(mThis) {
	var status = true;
	var msg = "Please be advised that 'Other Acedemic Programs' are those which do noth appear to support the school arts curriculum.  These programs can be requested through Arts in Education but, unless your Program Request clearly describes HOW this service will support your music, art, dance, theatre and/or literature curriculum and one or more of the Arts Standards, it will not be eligible to receive BOCES aid."
	if (mThis.kword.value == "enter keyword")
		mThis.kword.value="";
	if (mThis.cboCategory.options[mThis.cboCategory.options.selectedIndex].text == "Other Acedemic Programs")
		status = confirm(msg);
	if (status) mThis.submit();
}

//=============================================================================
// email()
// used to avoid mailto: on web page
//
function sendEmail(mAddress) {
	document.location.href="ma"+"il"+"to:"+mAddress;
}
function showEmail(mUser,mServer) {
	document.write("<a href=\"#\" onClick=\"sendEmail('" + mUser + "@" + mServer + "')\">" + mUser + "@" + mServer + "</a>");
}
