// preload rollovers
if (document.images) {
	menu_news1 = new Image();
	menu_news1.src = "/img/template/menu_news.gif";
	menu_news2 = new Image();
	menu_news2.src = "/img/template/menu_news_sel.gif";
	menu_enshin1 = new Image();
	menu_enshin1.src = "/img/template/menu_enshin.gif";
	menu_enshin2 = new Image();
	menu_enshin2.src = "/img/template/menu_enshin_sel.gif";
	menu_services1 = new Image();
	menu_services1.src = "/img/template/menu_services.gif";
	menu_services2 = new Image();
	menu_services2.src = "/img/template/menu_services_sel.gif";
	menu_about1 = new Image();
	menu_about1.src = "/img/template/menu_about.gif";
	menu_about2 = new Image();
	menu_about2.src = "/img/template/menu_about_sel.gif";
	menu_forums1 = new Image();
	menu_forums1.src = "/img/template/menu_forums.gif";
	menu_forums2 = new Image();
	menu_forums2.src = "/img/template/menu_forums_sel.gif";
	menu_media1 = new Image();
	menu_media1.src = "/img/template/menu_media.gif";
	menu_media2 = new Image();
	menu_media2.src = "/img/template/menu_media_sel.gif";
	menu_contact1 = new Image();
	menu_contact1.src = "/img/template/menu_contact.gif";
	menu_contact2 = new Image();
	menu_contact2.src = "/img/template/menu_contact_sel.gif";
	menu_schools1 = new Image();
	menu_schools1.src = "/img/template/menu_schools.gif";
	menu_schools2 = new Image();
	menu_schools2.src = "/img/template/menu_schools_sel.gif";
	menu_faq1 = new Image();
	menu_faq1.src = "/img/template/menu_faq.gif";
	menu_faq2 = new Image();
	menu_faq2.src = "/img/template/menu_faq_sel.gif";
}

function mOver(obj) {
	document[obj].src = eval(obj + "2.src");
}

function mOut(obj) {
	document[obj].src = eval(obj + "1.src");
}

function go(url) {
	window.location = url;
}

function ws(status) {
	window.status = status;
}

// i hate javascript, it's lame, just as lame as all those new browsers being developed
// each day forcing us poor bastards to extend our code to work with them all.
//
// this 'function' doesn't function 100% correctly, it uses the same window to open the images
// in mozilla but opens them in a new one each time on ie. write the code for ie and stupid
// ass mozilla stops working.
function popImage(url, w, h) {

	var winHeight;
	winHeight = h + 20; // each control bar (for closing popup window) takes up 20px height
	x = (screen.width / 2) - (w / 2);
	y = (screen.height / 2) - ((h + 20) / 2);
	opt = "width=" + w + ", height=" + winHeight + ", screenX=" + x + ", screenY=" + y + ", resizable=no, toolbar=no, menubar=no"; // window options
	url = "/inc/showimage.php?f=" + url + "&w=" + w + "&h=" + h;

	if (typeof(imagePane) != "object") {
		imagePane = window.open(url, 'imageWindow', opt);
	}
	else {
		if (!imagePane.closed) {
			imagePane.location = url;
		}
		else {
			imagePane = window.open(url, 'imageWindow', opt);
		}
	}
}

// same as popImage() except allows file description
function popImage2(url, w, h, desc) {

	var winHeight;
	winHeight = h + 20; // each control bar (for closing popup window) takes up 20px height
	x = (screen.width / 2) - (w / 2);
	y = (screen.height / 2) - ((h + 20) / 2);
	opt = "width=" + w + ", height=" + winHeight + ", screenX=" + x + ", screenY=" + y + ", resizable=no, toolbar=no, menubar=no"; // window options
	url = "/inc/showimage.php?f=" + url + "&w=" + w + "&h=" + h + "&desc=" + desc;

	if (typeof(imagePane) != "object") {
		imagePane = window.open(url, 'imageWindow', opt);
	}
	else {
		if (!imagePane.closed) {
			imagePane.location = url;
		}
		else {
			imagePane = window.open(url, 'imageWindow', opt);
		}
	}
}

function reloadEmailPage() {
	document.location = "/email.php";
}

function readyToMoveOn(inputObj, maxLen) {
	if (inputObj.value.length == maxLen) {
		return true;
	}
	else {
		return false;
	}
}