// image flip script (on):
function imgAct(imgName) {
    if (document.images) {
		document[imgName].src = eval(imgName + "_on.src");
    }
}

// image flip script (off):
function imgInact(imgName) {
    if (document.images) {
		document[imgName].src = eval(imgName + "_off.src");
    }
}
// generic window opener variables:
// mypage: url to page
// w: width
// h: height
// s: scrollbars? (yes/no)
// n: window name
function PopWin ( mypage, w, h, s, n ) {
	var winl = ( screen.width - w ) / 2;
	var wint = ( screen.height - h - 50 ) / 2;
	winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',scrollbars='+s+',resize=no'
	win = window.open ( mypage, n, winprops )
	if ( parseInt(navigator.appVersion) >= 4 ) { win.window.focus(); }
}

// use for anti-spam countermeasures:
function Email ( sUser, sDomain, sSubject ) {
	var sString;
	sString = "mailto:" + sUser + "@" + sDomain;
	if ( sSubject.length > 0 )
	{
		sString += "?subject=" + sSubject;
	}
	window.location = sString;
}

function navLoad () {

	var dirPrefix = "wp-content/themes/sfr/images/nav/"

	// image flips
	if (document.images) { 
		about_on = new Image(); about_on.src = dirPrefix + "about_on.gif";
		about_off = new Image(); about_off.src = dirPrefix + "about_off.gif";
		contacts_on = new Image(); contacts_on.src = dirPrefix + "contacts_on.gif";
		contacts_off = new Image(); contacts_off.src = dirPrefix + "contacts_off.gif";
		events_on = new Image(); events_on.src = dirPrefix + "events_on.gif";
		events_off = new Image(); events_off.src = dirPrefix + "events_off.gif";
		forum_on = new Image(); forum_on.src = dirPrefix + "forum_on.gif";
		forum_off = new Image(); forum_off.src = dirPrefix + "forum_off.gif";
		login_on = new Image(); login_on.src = dirPrefix + "login_on.gif";
		login_off = new Image(); login_off.src = dirPrefix + "login_off.gif";
		newsroom_on = new Image(); newsroom_on.src = dirPrefix + "newsroom_on.gif";
		newsroom_off = new Image(); newsroom_off.src = dirPrefix + "newsroom_off.gif";
		staff_on = new Image(); staff_on.src = dirPrefix + "staff_on.gif";
		staff_off = new Image(); staff_off.src = dirPrefix + "staff_off.gif";
	}
}

