var bVer = parseInt(navigator.appVersion);
if (!((navigator.appVersion.indexOf("MSIE") == -1)&&(navigator.appVersion.substring(0,3)-4.8<0))){
	var sOut="";
	document.write("<SCRIPT LANGUAGE=\"JavaScript1.2\" SRC=\"../jsp/unlayered.js\"><\/SCRIPT>");
	document.write("<style>");
	if (!(navigator.appVersion.indexOf("MSIE") == -1)) {
		document.write("div.leftcol {	width:179px; }");			
		document.write("div.rightcol {	width:581px; }");			
	} else {
		document.write("div.leftcol {	width:161px; }");			
		document.write("div.rightcol {	width:578px; }");			
	}
	document.write("div.ntk {	margin: 0px 0px 18px 0px; }");
	document.write(".menu {background-image:url(../graphics/a_up.gif);background-repeat:no-repeat;background-position:left; }");
	document.write(".menuselected {background-image:url(../graphics/a_ov.gif);background-repeat:no-repeat;background-position:left; }");
	document.write("</style>");
} else {
//netscape <4.8 on PC
	sOut="This site works best with modern browsers. Some features may not work properly with Netscape 4.x. ";			
	document.write("<style>");
	document.write("div.leftcol {	width:161px }");			
	document.write("div.homerightcol {	width:161px }");			
	document.write("</style>");
}

var aMN=null;
function loadNav(iMax) {
	aMN=new Array();
	for (var i=0 ; i<iMax ; i++) {
		aMN[i]=new Object();
		aMN[i].up=new Image(); aMN[i].up.src='../graphics/nav/'+i+'.gif';
		aMN[i].ov=new Image(); aMN[i].ov.src='../graphics/nav/'+i+'o.gif';
	}
}
function mnOv(i) {
	var img=FWFindImage(document,'mn'+i,0);
	if (img!=null) img.src=aMN[i].ov.src;
}
function mnOut(i) {
	var img=FWFindImage(document,'mn'+i,0);
	if (img!=null) img.src=aMN[i].up.src;
}
function btnOv(id,stub) {
	var img=FWFindImage(document,id);
	if (img!=null) img.src='../graphics/'+stub+'o.gif';
}
function btnOut(id,stub) {
	var img=FWFindImage(document,id);
	if (img!=null) img.src='../graphics/'+stub+'.gif';
}

/* Function that swaps images. */
function di20(id, newSrc) {
var theImage = FWFindImage(document, id, 0);
if (theImage) theImage.src = newSrc;
}
/* Functions that track and set toggle group button states. */
function FWFindImage(doc, name, j) {
var theImage = false;
if (doc.images) {
theImage = doc.images[name];
}
if (theImage) {
return theImage;
}
if (doc.layers) {
for (j = 0; j < doc.layers.length; j++) {
theImage = FWFindImage(doc.layers[j].document, name, 0);
if (theImage) {
return (theImage);
}
}
}
return (false);
}

function navigate(opt){
	if (opt.selectedIndex!=0)
	window.open(opt.options[opt.selectedIndex].value, "_top");
	return false;
}
function navigateall(opt){
	window.open(opt.options[opt.selectedIndex].value, "_top");
	return false;
}

function setCookie(sIn) {
    document.cookie = "effc=" + sIn;
}
function makeCookie(Name,Value,Expiry,Path,Domain,Secure) {
//if you want to save the cookie
if (Expiry != null && !isNaN(Expiry)) {
	var datenow = new Date();
	datenow.setTime(datenow.getTime() + Math.round(86400000*Expiry));
	Expiry = datenow.toGMTString();
}
Expiry = (Expiry) ? '; expires='+Expiry : '';
Path = (Path)?'; path='+Path:'';
Domain = (Domain) ? '; domain='+Domain : '';
Secure = (Secure) ? '; secure' : '';

document.cookie = Name + '=' + escape(Value) + Expiry + Path + Domain + Secure;

}

function readCookie(Name) {
	if (Name==undefined) {
		return unescape(document.cookie);	
	}
	else {
		var cookies = ' ' + document.cookie;
		if (cookies.indexOf(' ' + Name + '=') == -1) return null;

		var start = cookies.indexOf(' ' + Name + '=') + (Name.length + 2);
		var finish = cookies.substring(start,cookies.length);
		finish = (finish.indexOf(';') == -1) ? cookies.length : start + finish.indexOf(';');

		return unescape(cookies.substring(start,finish));
	}
}

function addToFaves(sID){
	var sTemp=readCookie("faves");
	if (sTemp==null) sTemp="";
	if (sTemp.indexOf(sID)==-1)
		sTemp=sTemp+","+sID;
	makeCookie("faves",sTemp,365,'','',false);
	window.location.reload();
}

function removeFromFaves(sID){
	var sFind=","+sID+",";
	var sTemp=readCookie("faves")+",";
	var start=sTemp.indexOf(sFind);
	var finish = sTemp.substring(start+1,sTemp.length);
	finish = (finish.indexOf(',') == -1) ? sTemp.length : start + finish.indexOf(',');
	if (start!=-1){
		sTemp=sTemp.substring(0,start)+sTemp.substring(finish+1,sTemp.length-1);
	}
	makeCookie("faves",sTemp,365,'','',false);
	window.location.reload();
}
function setLastItem(iID, iCount){
	var sFind=","+iID+"|";
	var sTemp=readCookie("discussions");
	if (sTemp==null) start=-1;
	else start=sTemp.indexOf(sFind);
	if (start==-1){ //not found, just append
	}
	else { // found, remove
		var finish = sTemp.substring(start+1,sTemp.length);
		var end = (finish.indexOf(',') == -1) ? finish.length : finish.indexOf(',');
		sTemp=sTemp.substring(0,start)+finish.substring(end,finish.length);
	}
	sTemp=sTemp+sFind+iCount;
	// cookie size limit - make sure sTemp isn't too long
	if (sTemp.length>3000){
		sTemp=sTemp.substring(sTemp.length-3000,sTemp.length);
		sTemp=sTemp.substring(sTemp.indexOf(','),sTemp.length);
	}
	makeCookie("discussions",sTemp,365,'','',false);
}

function makenumeric(strIn){
	s="";
	for (i=0;i<strIn.length;i++){
		c=strIn.charAt(i);
		if ((c=="1")||(c=="2")||(c=="3")||(c=="4")||(c=="5")||(c=="6")||(c=="7")||(c=="8")||(c=="9")||(c=="0")||(c==".")) s+=c;
	}
	if (s.length==0)s="0";
	return s;
}
function checknumber(sIn,sError){
	sIn.value=makenumeric(sIn.value);
	if (sIn.value==""){
		alert("Please enter "+sError+" then click 'Next' again.");
		return false;
	}
	else if (isNaN(parseFloat(sIn.value))) {
		alert("Please enter "+sError+" as a number ONLY then click 'Next' again.");
		return false;
	}
	return true;
}

function checklimits(sIn,sError,iMin,iMax){
	if (parseFloat(sIn.value)<iMin){
		alert("The "+sError+" must be higher than "+iMin+".");
		return false;
	}
	else if (parseFloat(sIn.value)>iMax) {
		alert("The "+sError+" must be less than "+iMax+".");
		return false;
	}
	return true;
}

function isempty(sIn,sError){
	if (sIn.value==""){
		alert("Please enter "+sError+" then click 'Next' again.");
		return false;
	}
	return true;
}
function goRegister() {
var w = window.open("","_new","width=300,height=350");
w.location.href="fregister.htm";
w.focus();
}
function popEmail(sIn) {
var w = window.open("","_new","width=400,height=350");
w.location.href="email.jsp?"+sIn;
w.focus();
}
function popJob(iID) {
var w = window.open("","_new","width=413,height=470,scrollbars=1");
w.location.href="popjob.jsp?id="+iID;
w.focus();
}
function popExp(iID) {
var w = window.open("","_new","width=413,height=470,scrollbars=1");
w.location.href="popexp.jsp?id="+iID;
w.focus();
}
function popProfile(iID) {
var w = window.open("","_new","width=413,height=470,scrollbars=1");
w.location.href="popprofile.jsp?id="+iID;
w.focus();
}
function goReminder() {
var w = window.open("","_new","width=300,height=250");
w.location.href="freminder.htm";
w.focus();
}
function goLogin() {
var w = window.open("","_new","width=300,height=250");
w.location.href="flogin.htm";
w.focus();
}
function goLogout() {
	makeCookie('username','',-1,'','',false);
	makeCookie('password','',-1,'','',false);
	window.location.reload();
}
function checkemail(email){
	if(email.length < 7){
		alert("Your Email address does not appear long enough. Please fill it in then click 'Go' again.");
		return false;
	}
	else if(email.indexOf("@") == -1){
		alert("Your Email address does not appear well-formed. Please fill it in then click 'Go' again.");
		return false;
	}
	else if(email.indexOf("@") > email.lastIndexOf(".")){
		alert("Your Email address does not appear well-formed. Please fill it in then click 'Go' again.");
		return false;
	}

	return true;
}
var fVer = 0;	
var bFlashOK = false;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('if (flash5Installed) then \n');	
	document.write('fVer=5 \n');	
	document.write('elseif (flash4Installed) then \n');	
	document.write('fVer=4 \n');	
	document.write('end if \n');	
	document.write('</SCR' + 'IPT\> \n');
}

function detectFlash(){	
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]|| navigator.plugins["Shockwave Flash"]){
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			fVer = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		}
	}
	
	if(navigator.userAgent.indexOf("WebTV") != -1) fVer = 2;	
	if (fVer >= 4) bFlashOK = true;
}

detectFlash();
//bFlashOK = false;

function insertFlash(src,w,h,srcImg) {
	if (bFlashOK) {
		document.write('<object width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0">');
		document.write('<param name="movie" value="'+src+'"><param name="loop" value="false"><param name="menu" value="false"><param name="quality" value="high"><param name="scale" value="exactfit"><param name="bgcolor" value="#ffffff">');
		document.write('<embed src="'+src+'" bgcolor="#ffffff" width="'+w+'" height="'+h+'" loop="false" menu="false" quality="high" scale="exactfit" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
		document.write('</object>');
	}
	else if (srcImg!=null) {
		document.write('<img src="'+srcImg+'" width="'+w+'" height="'+h+'" alt="" border="0">\n');
	}
}

function replaceString(sSrc, sFrom, sTo){
	sReturn=sSrc;
    iFromLen=sFrom.length;
    iToLen=sTo.length;
    iPos=0;
    iEnd=0;
    do {
        iPos=sReturn.indexOf(sFrom,iEnd);
        if (iPos!=-1) {
            sReturn = sReturn.substring(0,iPos)+sTo+sReturn.substring(iPos+iFromLen);
            iEnd=iPos+iToLen;
        }
    } while (iPos!=-1);
	return sReturn;

}

function killSel(oSel,s0) {
    for (i=oSel.length-1 ; i>=0 ; i--) oSel.options[i]=null;
	if (s0!=null) {
		oSel.options[0]=new Option(s0,"");
		oSel.selectedIndex=0;
	}
}
function goZoom(sIn){
var w = window.open("","zoomwindow","height=550,width=535,scrollbars");
w.location.href="zoom.jsp?target="+sIn;
w.focus();
}
