/*Std 29-Nov-11 Copyright 2000-11 NelsonCroom */
var Line0 = '', Line1 = '', Line2 = '', bp = '', pop = '', sQS = '', sItmDsp = '';
var iTimerSecs = 30
var winFixed = 'scrollbars=0,resizable=0,toolbar=0,location=0,menubar=0,directory=0,status=0,alwaysRaised=1'
var winMid = 'scrollbars=1,resizable=1,toolbar=0,location=1,menubar=0,directory=0,status=0,alwaysRaised=1'
var winSparse = 'scrollbars=1,resizable=1,toolbar=0,location=0,menubar=0,directory=0,status=0,alwaysRaised=1'
var winPrn = 'scrollbars=1,resizable=1,toolbar=1,menubar=1,alwaysRaised=1'
sHeadTail = "<link rel='stylesheet' type='text/css' href='/library/StyleStd2.css'><link rel='stylesheet' type='text/css' href='/library/StyleStd0.css'></head>"
var ns4 = document.layers;
ie4 = document.all;
nn6 = document.getElementById && !document.all;

if (navigator.cookieEnabled == 0){
  alert("You need to enable session cookies for this site to maintain your connection.");
}

function jsVer(){document.write("jsStdNC07 30-Oct-10 b");}
function closeMe(Loc){
	if(document.getElementById('butBar')) {document.getElementById('butBar').style.display='none'}
	if(window.opener) {window.close();return false;}
	$(document).ready(function() {
		parent.$.fancybox.close();		//not iframe: $.fancybox.close();
		})
	return false;
	}
function newSize(){	// glossary pop-ups
	if (screen.availWidth > 550) {wWidth=550;} else {wWidth=520;};
	if (screen.availHeight > 450) {wHeight=450;} else {wHeight=420;};
	window.resizeTo(wWidth,wHeight);
	}
function newWin(Loc,ti){
	if (ti == 'Excel') {winSparse = 'scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,directory=1,alwaysRaised=1';}
	wn = window.open(Loc,ti,winSparse+winSizing('1'));
	wn.focus();
	}
function openerGo(opLoc){
	window.opener.location=opLoc;
	window.close();
	}
function openit(X) {document.location.href = X;
	}
function openBB(Loc){
	pwn = window.open('BB.asp?'+sQS,'Forum',winSparse+winSizing('1'));
	pwn.focus();
	}
function openBBadm(Loc){
	pwn = window.open('admBB.asp?','Forum',winSparse+winSizing('1'));
	pwn.focus();
	}
function openC(){
	window.open('profile.asp?M=Cert&Dsp=17&CID='+sCID,'Cert',winPrn+winSizing('H'));
	}
function openFB(QS){
	if (sQS.length > 1)  {
		if((sQS.indexOf('&',sQS.length - 1))>0) {
			QS = sQS+QS;}
		else if (QS.length>0){
			QS = sQS+'&'+QS;}
		else {QS = sQS;}
		}
	if (sItmDsp.length > 0){QS = QS+'&ItmDsp='+sItmDsp;}
	if(QS.indexOf('Dsp=')<1) {QS=QS+'&Dsp=P'}
	window.open('feedback.asp?'+QS,'FB',winSparse+winSizing('F'));
	}
function openFBadm(QS){
	if (sQS.length > 1) {QS = sQS+'&'+ QS;}
	if(QS.indexOf('Dsp=')<1) {QS=QS+'&Dsp=P'}
	window.open('feedbackAdm.asp?'+QS,'FB',winSparse+winSizing('F'));
	}
function openGlos(gID){
	var Loc = 'view.asp?M=G&Dsp=13&ID=' + gID;
	Glo=window.open(Loc,'Glos',winSparse+winSizing('G')); 
	Glo.focus();
	}
function openGlosG(gID){
	var Loc = 'page.asp?M=GRCGlos&ID=' + gID ;
	Glo=window.open(Loc,'Glos',winSparse+winSizing('G')); 
	Glo.focus();
	}
function openHlp(gID){
	var e=document.getElementById(gID);
	if(!e) return true;
	e.style.position='absolute';
	e.style.top=25;
	e.style.posLeft=-10;
	e.style.zIndex=4000;
	unHide(gID);
	}
function openInf(srcID){		// phase out - ATS!!!
	var re = new RegExp("panx","g")
	document.getElementById("panInfHdTxt").innerHTML=document.getElementById(srcID+'Hd').innerHTML
	document.getElementById("panInf").innerHTML=document.getElementById(srcID).innerHTML.replace(re,"panx1")
	unHide('panInfWrap');
	window.scrollTo(0,0);
	}
function panInf(srcID){
		var re = new RegExp('panx','g');
		$('#panInfHdTxt').html($('#'+srcID+'Hd').html());
		$('#panInf').html($('#'+srcID).html().replace(re,'panx1'));
		$('#panInfWrap').slideToggle('slow');
	}
function panClose(){$('#panInfWrap').slideToggle('slow');}
function openRC(Loc){
	RCw = window.open(Loc,'RC','scrollbars=1,location=1,directory=1,resizable=1,left=1,top=1'); 
	RCw.focus(); 
	}
function openRCmin(sID,sSty){
	var sLoc = ''+sID
	if (sLoc == '') {sLoc = 'Main';}
	sLoc = 'view.asp?M='+sSty+'&Dsp='+sSty+'&ID='+sLoc;
	RCw = window.open(sLoc,'_Blank',winMid+winSizing('1'));
	RCw.focus();
	}
function openRCpop(sID,sSty){
	var sSz = 'H';
	var sLoc = ''+sID;
	var sMod = '';
	sMod = sSty;
	if (sSty=='U') {sSty = '9';}
	if (sLoc == '') {sLoc='Main';};
	if (sSty == '10') {sSz='R';};
	if (sSty == '11') {sSz='R';};
	if (sSty == '12') {sSz='S';};
	if (sSty == '13') {sSz='G';};
	if (sSty == '14') {sSz='P';};
	if (sSty == '1') {sSz='1';}
	sLoc = 'view.asp?M=' + sMod + '&Dsp=' + sSty + '&ID=' + sLoc+'&CID='+sCID;
	RCw = window.open(sLoc,'RCP',winSparse+winSizing(sSz));
	RCw.focus();
	}
function openAdmRCpop(sID,sDsp){
	var sSz = 'H';
	var sLoc = '' + sID;
	if (sLoc == '') {sLoc = 'Main';};
	if (sDsp == '11') {sSz = 'R';};
	sLoc = 'admView.asp?M=GRC&Dsp=' + sDsp + '&ID=' + sLoc;
	RCw = window.open(sLoc,'RCP',winSparse+winSizing(sSz));
	RCw.focus();
	}
function openAdmRCmin(sID,sMode){
	var sLoc = ''+sID
	if (sLoc == '') {sLoc = 'Main';}
	sLoc = 'admView.asp?M=' + sMode + '&Dsp=M&ID=' + sLoc;
	RCw = window.open(sLoc,'_Blank',winMid+winSizing('1'));
	RCw.focus();
}
function openRep(Loc){
	document.getElementById("panInf").innerHTML= ("<div class='c'><iframe class='frameRep' name='Report' src='" + Loc + "' scrolling='yes' style='width:98%;height:400px'></iframe></div>");
	}
function openSys(QS){
	if (QS.length < 3)  {QS = sQS ;}
	window.open('/helpSystemInfo.asp?' + QS,'SI',winSparse+winSizing('1'));
	}
function openTutor(sMsg){
	if (sQS.length > 1){
		if((sQS.indexOf('&',sQS.length - 1))>0){
			QS=sQS+sMsg;}
		else {QS=sQS+'&'+sMsg;}
		}
	window.open('feedback.asp?FM=TUA&'+QS,'FB',winSparse+winSizing('F'));
	}
function popAlert(zHead){
	var sizeW = 320
	var sizeH = 470
	var iLeft = winCentW(sizeW);
	var iTop = winCentH(sizeH);
	var sPopTxt = document.getElementById("navStatus").innerHTML
	if (zHead.length < 1) {zHead = "Help Notes";}
	nPop = window.open('','nPop','toolbar=0,location=0,alwaysRaised=1,scrollbars=0,resizable=1,width=320,height=470,left='+iLeft+',top='+iTop)
	nPop.document.write("<html><head><title>Information</title>"+sHeadTail)
	nPop.document.write("<body onload='window.focus()' onblur='window.close()' style='background-color:#5D8197;text-align:center'>")
	nPop.document.write("<div id='notepad' style='height:405px;'><div class='spiral'>&nbsp;</div>")
	nPop.document.write("<div class='sheet'><div class='head'><span style='float:left'>" + zHead)
	nPop.document.write("</span><input type='reset' onclick='window.close()' value='Close' style='float:right;font-size:xx-small'></div>")
	nPop.document.write("<div class='padText' style='min-height:250px'>" + sPopTxt + "</div>")
	nPop.document.write("<div style='background:url(/imstd/pix/pen.gif) bottom right no-repeat;text-align:left;padding:20px'><img src='imstd/signatureTony.gif' height='60'></div>")
	nPop.document.write("</div></div></body></html>")
	nPop.document.close();
	}
function popDialog(Loc){
	Loc = winDsp(Loc,'P');
	pop = window.open(Loc,'pop',winSparse+winSizing('D'))
	if (pop && !pop.closed) {pop.focus();};
	}
function popEd(Loc,ti){
	var winSize = '1'
	//var re = new RegExp("\.","g")
	var re = /\./g
	ti = ti + ''
	if (ti.length > 1) {
		if (ti.indexOf("FB") >= 0) {
			winSize = '2';
			};
		ti = ti.replace(re,'')
		var re = /-/g
	}
	ti = 'Ed'+ti.replace(re,'')
	Loc = winDsp(Loc,'P')
	bp = window.open(Loc,ti,winSparse+winSizing(winSize));
	bp.focus();
	}
function popImg(sLoc,sSty){
	sLoc = sLoc+''
	if (sLoc.indexOf('http')<0) {
		if (sLoc.indexOf('lbr/')<0) {
			if (sLoc.indexOf('/images')<0) {
				sLoc = '/' + sLoc;
				}
			sLoc = '/lbr' + sFldImg + sLoc;
		}
	}
	Iw = window.open(sLoc,'image',winSparse+winSizing(1));
	Iw.focus();
	}
function popKW(Loc){
	bp = window.open(Loc+'&Dsp=P','Ed',winSparse+winSizing('H'))
	bp.focus();
	}
function popLC(Loc,Sty){
	var sSz = 'H';
	var sLoc = ''+Loc;
	var sSep = '';
	if (sLoc == '') {sLoc='Home.asp';}
	if (!Sty.length>1) {Sty='1'};
	if (Sty == '10') {sSz='R'};
	if (Sty == '11') {sSz='R'};
	if (Sty == '13') {sSz='G'};
	if (Sty == '14') {sSz='P'};
	if (Sty == '1') {sSz='1'}
	if(sLoc.indexOf('Dsp=')<1) {
		if (sLoc.indexOf('?')<2) {sSep='?'}
			else {sSep='&'}
		sLoc = sLoc+sSep+'Dsp='+Sty;
		}
	wn = window.open(sLoc,'Imago',winSparse+winSizing(sSz));
	wn.focus();
	}
function popModel(Loc){
	Loc = winDsp(Loc,'M');
	pop = window.open(Loc,'pop',winSparse+winSizing('D'))
	if (pop && !pop.closed) {pop.focus();};
	}
function popPicker(Loc,sWin){
	if (pop && !pop.closed) {pop.close() ;}
	pop = window.open(Loc,'pop',winSparse+winSizing('D'))
	if (pop && !pop.closed) {pop.focus();};
	}
function popReport(Loc,sWin){
	var sizeW = 500
	var sizeH = 480
	var iLeft = winCentW(sizeW);
	var iTop = winCentH(sizeH);
	var WinLab = "Rp" + sWin
	gLoc = winDsp(Loc,'I')	
	bp = window.open('',WinLab,'toolbar=0,location=0,menubar=0,directory=0,width='+sizeW+',height='+sizeH+',top='+iTop+',left='+iLeft);
	bp.document.write("<html><head><title>Information  </title>"+sHeadTail);
	bp.document.write("<body onload='window.focus()' style='background-color:#5D8197;background-image:none;text-align:center;'>");
	bp.document.write("<iframe name='Report' src='" + gLoc + "' scrolling='yes' style='width:98%;height:400px;background-color:#CCCCCC;margin:8px 1px 10px 1px;'></iframe><br />&nbsp;<div><a href='javascript:window.close()'><img src='imstd/butDFclosethiswindow.gif'></a></div>");
	bp.document.write("</body></html>");
	bp.document.close();
	bp.focus();
	}
function popHelp(Loc,ti){
	if(Loc.indexOf('Dsp=')<1) {
		if (Loc.indexOf('?')<2) {sSep='?'}
			else {sSep='&'}
		Loc = Loc+sSep+'Dsp=P';
		}
	Loc = winDsp(Loc,'P');
	nw = window.open(Loc,'Help',winSparse+winSizing('1'));
	nw.focus();
	}
function popHelp1(Loc){
	nw = window.open('help.asp?M='+Loc+'&Dsp=17&CID='+sCID,'Help',winSparse+winSizing('1'));
	nw.focus();
	}
function popHide(IDtohide){
	if (ns4) {document.IDtohide.visibility = "hide";}
	else if (ie4) {document.all[IDtohide].style.visibility = "hidden";}
	else if (nn6) {document.getElementById(IDtohide).style.visibility = "hidden";}
	}
function popMin(Loc,ti){
	wn = window.open(Loc,ti,winSparse+winSizing('M'));
	wn.focus();
	}
function popShow(e,IDtoshow){
	var sCore = document.all[IDtoshow].innerHTML;
	Hlp = window.showModelessDialog('/imstd/blank.gif',window,"dialogWidth:400px;dialogHeight:480px;edge:Raised;center:Yes;help:No;resizable:No;status:No;scroll:Yes");
	Hlp.document.write("<html><head><title>Help</title>"+sHeadTail)
	Hlp.document.write("<body style='background-color:#FFCC00;margin:0;'>")
	Hlp.document.write(sCore)
	Hlp.document.write("</body></html>")
	Hlp.document.close();
	}
function popShowHelp(e,IDtoshow) {
	var sStart = "<div class='popWrap'><div class='popHd'>&nbsp;</div><div style='padding:4px;'>";
	var sEnd = "</div><div style='height:25px;text-align:center;margin-top:7px;'><a href=\"javascript:popHide('"+IDtoshow+"')\"><img src='imstd/butDFCloseThisWindow.gif' vspace='3'></a></div></div>";
   if (ns4) {
		var sCore = document.IDtoshow.innerHTML;
		if((sCore.indexOf("popHide"))<1) {sCore = sStart+sCore+sEnd}
		document.IDtoshow.visibility = "show";
   }
   else if (ie4) {
		var aw = screen.availWidth - 320 ;
		var sCore = document.all[IDtoshow].innerHTML;
		if((sCore.indexOf("popHide"))<1) {sCore = sStart+sCore+sEnd}
		document.all[IDtoshow].innerHTML = sCore;
		document.all[IDtoshow].style.position = "absolute";
		document.all[IDtoshow].zIndex = 3000;
		document.all[IDtoshow].style.left = aw;
		document.all[IDtoshow].style.visibility = "visible";
		document.all[IDtoshow].style.display = "";
   }
   else if (nn6) {
		var sCore = document.getElementById(IDtoshow).innerHTML;
		if((sCore.indexOf("popHide"))<1) {sCore = sStart+sCore+sEnd}
		document.getElementById(IDtoshow).innerHTML = sCore;
		document.getElementById(IDtoshow).style.visibility = "visible";
   }
}
function searchInit(){
	if (!document.getElementById('SearchBox1')) {return;}
	document.getElementById('SearchBox1').focus();
	}
function winCentH(winH){
	var ih = (screen.availHeight - winH) / 2;
	if (ih < 5) {ih = 5;}
	return ih
	}
function winCentW(winW){
	var iw = (screen.availWidth - winW) / 2;
	if (iw < 5) {iw = 5;}
	return iw
	}
function winClose(){window.close();}
function winDir(Loc){w = window.open(Loc,'Dir','location=1,scrollbars=1,resizable=1,toolbar=0,menubar=0,status=1'+winSizing('1'));}
function winDsp(sQStr,Sty) {
	if((sQStr.indexOf("Dsp="))<1) {
		if (!Sty.length>1) {Sty='P';};
		if (sQStr.indexOf("?")<2) {sSep='?'}
			else {sSep='&'};
		sQStr = sQStr+sSep+'Dsp='+Sty;
		}
	return sQStr;
	}
function winExt(Loc,ti){
	wp = window.open(Loc,ti,winSparse+winSizing('1'));
	wp.focus();}
function winFull(Loc,ti){
	wn = window.open(Loc,ti,'fullscreen')
	wn.focus();}
function winPlain(Loc,ti){
	Loc = winDsp(Loc,'P')
	wp = window.open(Loc,ti,winSparse+winSizing('1'));
	wp.focus();}
function winStd(Loc,ti){
	ws = window.open(Loc,ti,'location=1,scrollbars=1,resizable=1,toolbar=1,menubar=1,status=1'+winSizing('1'));
	ws.focus();}
function winSizing(winSz){
	// 1=Full 2=FullHi H=Half R=RC F=FBk G=Gloss M=Min P=Profile
	var extraSz = 0
	if (winSz == '2') {
		extraSz = 10; 
		winSz = '1';
	}
	var sizeW = winSizeW(winSz)
	var sizeH = winSizeH(winSz)
	var iLeft = winCentW(sizeW) - extraSz;
	var iTop = winCentH(sizeH) - extraSz;
	return (',height='+sizeH+',width='+sizeW+',left='+iLeft+',top='+iTop)
	}
function winSizeH(wH){		/* 1=Full H=Half F=FBk G=Gloss */
	if (wH == '1') {
		iH = screen.availHeight * 0.9;
	} else if (wH == 'F') {
		if (screen.availHeight > 600) {iH=550;} else {iH=440;};
	} else if (wH == 'R') {
		iH=500;
	} else if (wH == 'S') {
		iH=500;
	} else if (wH == 'P') {
		iH=500;
	} else if (wH == 'G') {
		iH=450;
	} else if (wH == 'D') {
		if (screen.availHeight > 600) {iH=550;} else {iH=420;};
	} else if (wH == 'M') {
		iH=150;
	} else {
		iH = screen.availHeight * 0.5;
		if (iH < 380) {iH=380;};
	}
	return iH
	}
function winSizeW(wW){
	if (wW == '1') {
		iW = screen.availWidth * 0.9;
	} else if (wW == 'F') {
		if (screen.availWidth > 900) {iW=880;} else {iW=620;};
	} else if (wW == 'R') {
		iW=630;
	} else if (wW == 'S') {
		iW=730;
	} else if (wW == 'G') {
		iW=550;
	} else if (wW == 'P') {
		iW=630;
	} else if (wW == 'D') {
		if (screen.availWidth > 799) {iW=650;} else {iW=620;};
	} else if (wW == 'M') {
		iW=200;
	} else {
		iW = screen.availWidth * 0.6;
		if (iW < 400) {iW=400};
	}
	return iW
	}

function boxHiddnShw(iRef){
	if (iRef == 0||iRef == '') {
		document.getElementById('boxShw').innerHTML = '';
		}
	else {
		document.getElementById('boxShw').innerHTML = document.getElementById('boxHiddn' + iRef).innerHTML;
		}
	}
function ansHide(sRec){
	$(function(){
		sLoc = "/admSiteTools.asp?M=AJ&Act=AH&ID=" + sRec
		$("#ansSamp" + sRec).load(sLoc, 
				function(response,status,xhr) {
					var msg = "Hidden: " + xhr.status;
				})
	})
}
function commDel(sRec){
	$(function(){
		sLoc = "/admSiteTools.asp?M=AJ&Act=CD&ID=" + sRec
		sRec = "#comm" + sRec;
			$(sRec).load(sLoc, 
				function(response,status,xhr) {
					var msg = "Deleted: " + xhr.status;
				})
	})
}
function commT(sAct,sRec){
	$(function(){
		var date = new Date();
		sLoc = "/admSiteTools.asp?M=AJ&Act=" + sAct + "&ID=" + sRec + "&T=" + date.getTime()
		$("#comm" + sRec + " .commMsg" + sAct).load(sLoc);
		if (sAct=='CN')
			{sIco=" .icoThumbsDown";}
		else
			{sIco=" .icoThumbsUp";}
		$("#comm" + sRec + sIco).fadeTo('fast',0.3);
		$("#comm" + sRec + " .commA" + sAct).attr('href','javascript:;');
		$("#comm" + sRec + " .commA" + sAct + " img").attr('title','You have already voted');
	})
}
function Go(Loc){go(Loc);}
function go(Loc){
	if (Loc=='home') {Loc = 'home.asp';}
	else if (Loc=='progress') {Loc = 'tools.asp?M=WhatDone';}
	else if (Loc=='toolkit') {Loc = 'tools.asp?M=Toolkit';}
	window.location.href = Loc;
	}
function goGateway(Loc){
	if (!Loc.length > 5)  {Loc = 'admChoice.asp';}
	if (!opener) {window.location.href=Loc;}
	else {opener.window.focus(); window.close();}
	}
function goLogOut(){document.location='welcome.asp?M=INR';}
function Jbk(){
	//alert('Window name: ' + opener)
	if (!opener) {window.location='home.asp';}
	else if (window.name=='LC') {window.location='home.asp';}
	else {
	window.open('','_parent','');
	opener.window.focus(); window.close();}
	}
function hilight(it){
  if (it.className.substring(0,3) == "sel")
    {;}
  else
    {
		clsNameNow = it.className;
		var els = getElementsByClassName(document,"*",'sel' + clsNameNow);
		for (var e = 0; e < els.length; e++){
			els[e].className= clsNameNow;
			}
		it.className = "sel" + it.className;
	}
}
function JbkLC(Loc){
	if (!opener) {window.location=Loc;}
	else if (window.name=='LC') {
		if (!Loc.length > 4) {Loc='home.asp'};
		window.location=Loc;}
	else {
		if (Loc.length > 4) {opener.window.location=Loc; opener.window.focus(); window.close();} 
		else	{opener.window.focus(); window.close();}
		}
	}
function newJbkLC(Loc){
	if (!opener.window.location) {window.location=Loc;}
	else if (opener) {
		if (opener.window.name=='LC'){alert('LC Parent name='+opener.window.name);opener.window.location=Loc; opener.window.focus(); window.close();} 
		else	{alert('Parent name='+opener.window.name);opener.window.location=Loc; opener.window.focus(); window.close();}
		}
	}
function nvClose(){
	document.getElementById('nvNotice').style.display='none';
	setTimeout("document.getElementById('nvBack').style.display='none';",500);
	}
function putTxt(sID,sTxt){document.getElementById(sID).innerHTML = sTxt;}

function setPic(Xvar,oElem,Xval,target){
	var pic=document.getElementById(Xvar)
	pic.value = Xval;
	if (Xval.indexOf('bb') >= 0) {
		document.getElementById(target).src = '/imstd/bb/' + Xval;
		}
	else {
		document.getElementById(target).src = '/imstd/people/' + Xval + '.jpg';
	}
}

function bordOff(elem)	{elem.style.borderColor='';}
function bordOn(elem)	{elem.style.borderColor='#000000';}
function menuTabs(tabid){
	if (document.getElementById('CUSTOMSUBMENU')) {document.getElementById('CUSTOMSUBMENU').innerHTML=document.getElementById('MAINSUBNAV').innerHTML}
	if (document.getElementById(tabid)) {document.getElementById(tabid).className='menuTabOn'}
}
function overM(mnu) 	{mnu.style.backgroundColor='black' ; mnu.style.color='white';}
function outM(mnu) 		{mnu.style.backgroundColor='orange'; mnu.style.color='black'; window.status='';}
function downMnu(mnu)   {if(event.srcElement.tagName=='TD') mnu.children.tags('a')[0].click();}
function outMnu(mn) 	{mn.style.backgroundColor=''; mn.style.color=''; window.status='';}
function overMn(mn,col) {mn.style.backgroundColor=col; window.status='Click to select';}
function overMnG(mn)	{mn.style.backgroundColor='#DDDDDD'; mn.style.color='#000';}
function overMnu(mn)	{mn.style.backgroundColor='#6666FF'; mn.style.color='#FFF';}

function OverM(mnu) 	{mnu.style.backgroundColor='black' ; mnu.style.color='white';}
function OutM(mnu) 		{mnu.style.backgroundColor='orange' ; mnu.style.color='black' ; window.status='';}
function OutMnu(mn) 	{mn.style.backgroundColor=''; mn.style.color=''; window.status='';}
function OverMn(mn,col) {mn.style.backgroundColor=col; window.status='Click to select';}
function OverMnG(mn)	{mn.style.backgroundColor='#DDDDDD'; mn.style.color='#000';}
function OverMnu(mn)	{mn.style.backgroundColor='#6666FF'; mn.style.color='#FFF';}

/*Manager*/
function mnuOut(mn)		{var oldClass=mn.className;
						var re = new RegExp("grpMnuOn","g")
						oldClass= oldClass.replace(re,'grpMnuOff')
						mn.className=oldClass; window.status='';}
function mnuOver(mn)	{var oldClass=mn.className;
						var re=new RegExp("grpMnuOff","g");
						oldClass=oldClass.replace(re,'grpMnuOn');
						mn.className=oldClass; window.status='Click to select';}
function outBut(mn)		{var oldClass=mn.className;
						var re = new RegExp("Plus","g")
						oldClass= oldClass.replace(re,'')
						mn.className=oldClass; window.status='';}
function overBut(mn)	{var oldClass=mn.className;
						mn.className=oldClass+' grpPalePlus'; window.status='Click to select';}
function outButB(mn)	{mn.className='butABBr grpPale';}
function overButB(mn)	{mn.className='butABBr grpPalePlus';}

function overToolTop(mn){mn.style.border='solid 1px #666666';mn.style.borderLeft='solid 1px #FFFFFF';mn.style.borderTop='solid 1px #FFFFFF';}
function overToolTopI(mn){mn.style.border='solid 1px #666666';mn.style.borderLeft='solid 1px #FFFFFF';mn.style.borderTop='solid 1px #FFFFFF';}
function outToolTop(mn)	{mn.style.border='solid 1px #BBBBBB';window.status='';}
function outToolTopI(mn){mn.style.border='solid 1px transparent';}

function overToolBut(mn) {mn.style.backgroundColor='#CCCCFF'; mn.style.color='#000000'; window.status='Click to select';}
function overIco(mn) 	{mn.style.backgroundColor='#9999FF'; window.status='Click icon to select';}
function OverToolBut(mn) {mn.style.backgroundColor='#CCCCFF'; mn.style.color='#000000'; window.status='Click to select';}
function OverIco(mn) 	{mn.style.backgroundColor='#9999FF'; window.status='Click icon to select';}

function printFriend(){
	var oPF = document.getElementById('printFriendly');
	var PFtitl = oPF.title;
	if (PFtitl !== 'Display standard version')
		{
		document.getElementById('icoPrintFriendly').style.backgroundImage = 'url(/imstd/iconPrinterFriendlyOff.gif)'
		oPF.title = 'Display standard version'
		hideMe('navPanel');
		window.print();
		}
	else
		{
		document.getElementById('icoPrintFriendly').style.backgroundImage = 'url(/imstd/iconPrinterFriendlyOn.gif)'
		oPF.title = 'Printer friendly version'
		unHide('navPanel');
		}
	}
function classChange(xClass,elemnt,val){
	 var rules;
	 if (document.all) {
	  rules = 'rules';
	 }
	 else if (document.getElementById) {
	  rules = 'cssRules';
	 }
	 for (var S = 0; S < document.styleSheets.length; S++){
	  for (var R = 0; R < document.styleSheets[S][rules].length; R++) {
	   if (document.styleSheets[S][rules][R].selectorText == xClass) {
	    document.styleSheets[S][rules][R].style[elemnt] = val;
	   }
	  }
	 }	
	}
function CrsNav()	{;}
function logNav()	{;}
function detailOff() {classChange('.detail','display','none');}
function detailOn() {classChange('.detail','display','block');}
function statBar(txt){window.status = txt;}

function hideMe(IDtohide){
	//if (ns4) {document.IDtohide.display="none";}
	if (document.getElementById(IDtohide)) {document.getElementById(IDtohide).style.display="none";}
	else if (ie4) {document.all[IDtohide].style.display="none";}
	else if (nn6) {document.getElementById(IDtohide).style.display="none";}
}
function hideMeJQ(sLoc){
	$(function(){
		$('#'+sLoc).toggle('slow');
	})
}
function hideMeJQclass(sLoc){
	$(function(){
		$('table .'+sLoc).hide();
	})
}
function showMeJQ(sLoc){
	$(function(){
		$('#'+sLoc).toggle('slow');
	})
}
function showMenu(sLoc){
	$(function(){
		$('.mainChoiceSub').hide('fast');
		$('#'+sLoc).toggle('slow');
	})
}
function showMnu(sLoc){
	$(function(){
		sLoc=sLoc.substring(0,1);
		$('.subOpts').hide();
		$('.subOptsLst').hide();
		$('.menuMod').hide();
		$('#butM'+sLoc).show();
		$('#mod'+sLoc).show('slow');
		$('.subOpts'+sLoc).show('slow');
		$('#mButH,#mButA,#mButC,#mButP,#mButG,#mButS,#mButM').removeClass('on');
		$('#mBut'+sLoc).addClass('on');
	})
}
function unHide(w){
	var e=document.getElementById(w);
	if(!e) return true;
	e.style.display='block';
}
function toggler(IDx){
	var e=document.getElementById(IDx);
	if(!e) return true;
	if(e.style.display=="none"||e.style.display==""){
		e.style.display = "block"
	} else {
		e.style.display = "none"
	}
	return true;
}
function togglerBut(but){
	if(!but) return true;
	var oldClass = but.className;
	var re = new RegExp("icoPlus","g")
	if((oldClass.indexOf('icoPlus'))>=0) {
		but.className = oldClass.replace(re,'icoMinus');
		}
	re = RegExp("icoMinus","g")
	if((oldClass.indexOf('icoMinus'))>=0) {
		but.className = oldClass.replace(re,'icoPlus');
		}
	return true;
}
function confirmAct(sLab,sURL){
	var sLabel = sLab
	if (confirm(sLabel) == true)
		{ 
			if((sURL.indexOf("Dsp=n"))>1)
				{newWin(sURL,'Answers');}
			else
				{window.navigate(sURL);}
		}
	}
function confirmDel(sLab,sURL){
	var sLabel = "Are you sure you wish to delete this?\n" + sLab
	if (confirm(sLabel) == true)
		{window.navigate(sURL)}
	}
function confirmGo(sLab,sURL){
	var sLabel = "Are you sure you wish to proceed?\n" + sLab
	if (confirm(sLabel) == true)
		{window.navigate(sURL)}
	}
function getDateNow(){
	var today = new Date()
	var day = today.getDate()
	var mnth = today.getMonth()
	var year = today.getYear()
	var months = new Array(12)
	months[0] = "January"
	months[1] = "February"
	months[2] = "March"
	months[3] = "April"
	months[4] = "May"
	months[5] = "June"
	months[6] = "July"
	months[7] = "August"
	months[8] = "September"
	months[9] = "October"
	months[10] = "November"
	months[11] = "December"
	var date = day + " " + months[mnth] + " " + year
	document.write(date)
	}
function getDateTime(sStuffIn,sFormat){
	//if(navigator.appName == "Netscape") {	document.write('<layer id="clock"></layer><br>'); }
	//if (navigator.appVersion.indexOf("MSIE") != -1){	document.write('<span id="clock"></span>'); }
	Days = new Array()
	  Days[0]="Sunday"
	  Days[1]="Monday"
	  Days[2]="Tuesday"
	  Days[3]="Wednesday"
	  Days[4]="Thursday"
	  Days[5]="Friday"
	  Days[6]="Saturday"
	Months = new Array()
	  Months[0]="January"
	  Months[1]="February"
	  Months[2]="March"
	  Months[3]="April"
	  Months[4]="May"
	  Months[5]="June"
	  Months[6]="July"
	  Months[7]="August"
	  Months[8]="September"
	  Months[9]="October"
	  Months[10]="November"
	  Months[11]="December"
	var dte = new Date();
	var hrs = dte.getHours();
	var min = dte.getMinutes();
	var sec = dte.getSeconds();
	var day = Days[dte.getDay()]
	var date = dte.getDate()
	var mnth = Months[dte.getMonth()]
	var year = dte.getFullYear()
	var col = ":";
	var spc = " ";
	var apm;

	if (12 < hrs) {
		apm="pm";	//hrs-=12;
	}
	else {
		apm="am";
	}

	if (hrs == 0) hrs=12;
	if (hrs<=9) hrs="0"+hrs;
	if (min<=9) min="0"+min;
	if (sec<=9) sec="0"+sec;
	var Lab = date+spc+mnth+spc+year+spc+hrs+col+min+col+sec;
	if (sFormat == 'D') {Lab = day+spc+date+spc+mnth+spc+year+spc+hrs+col+min+col+sec;}
	//if(navigator.appName == "Netscape") {
	//document.clock.document.write(hrs+col+min+col+sec+spc+day+spc+date+spc+month+spc+year);
	//document.clock.document.close();}
	//if (navigator.appVersion.indexOf("MSIE") != -1){
	if (document.getElementById) {
	document.getElementById(sStuffIn).innerHTML = Lab;
	}
	setTimeout("getDateTime('"+sStuffIn+"','"+sFormat+"')",1000);
}
function getWho(sStuffIn){
	if (sWho) {
	document.getElementById(sStuffIn).innerHTML=sWho;
	}
}
function getElementsByClassName(oElm,strTagName,strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}
function getRes(frm){
	if(document.getElementById('res_box')){
	document.getElementById('res_box').value=window.screen.width+" x "+window.screen.height;
	}
}
function goBrowser(frm){
	getRes(frm);
	}
function ghostAll(elems){
	for (var e = 0; e < elems.length; e++){
		elems[e].style.color='#BBBBBB';
		}
	}
function hideAdmin(){
	hideAll(getElementsByClassName(document,"*","noSee"));
	}
function hideAll(elems){
	for (var e = 0; e < elems.length; e++){
		elems[e].style.display='none';
		}
	}
function invalidate(){
	alert('Coverage is currently insufficient to allow a Certificate to be issued');
	if (document.rubric) {document.rubric.style.display='hidden'};
	}
function maximizeWin(){
	if (window.screen) { var aw = screen.availWidth;
		var ah = screen.availHeight;
		window.moveTo(0, 0);
		window.resizeTo(aw, ah);} 
	} 
function padZero(n){
	return ((n >= 0)&&(n < 10))?"0"+n:n+"";
	}
function tabOff(tabID){document.getElementById(tabID).style.color='#CCCCCC';document.getElementById(tabID).style.fontWeight='normal'; }
function tabOn(tabID){document.getElementById(tabID).style.color='#FFFFFF';document.getElementById(tabID).style.fontWeight='bold'; }
function tabSwitch(sCards,sTabs,sTabOn){
	hideAll(getElementsByClassName(document.getElementById(sCards),'*','tabcard'));
	ghostAll(getElementsByClassName(document.getElementById(sTabs),'*','tabButtAoff'));
	ghostAll(getElementsByClassName(document.getElementById(sTabs),'*','tabButtA'));
	tabOn('tb'+sTabOn);
	unHide(sTabOn);
	}
function Tick(){	//Refresh = 30000 (Do not set too high as Jscript has a maximum for this of under 60secs)
	var dte = new Date();
	var hrs = dte.getHours();
	var min = dte.getMinutes();
	var sec = dte.getSeconds();
	if (hrs<=9) hrs="0"+hrs;
	if (min<=9) min="0"+min;
	if (sec<=9) sec="0"+sec;
	document.getElementById('refresher').src='/reconnect.asp?' + sQS + '&t=' + hrs + '.' + min + '.' + sec;
	setTimeout("Tick();",30000);
	return true;
	}
function TickI(form){Tick();return true;}
function waitHide(w){
	if (document.getElementById(w)) {
	sElm = document.getElementById(w)
	sElm.innerHTML = "&nbsp;";sElm.style.fontSize='xx-small';sElm.style.display='none';
	}
}
function MM_findObj(n,d){ //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
function MM_findObjOld(n,d){ //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
	}
function MM_preloadImages(){ //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
function MM_swapImage(){ //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
function MM_swapImgRestore(){ //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
function MM_swapURL(){ //v3.0
	var i,j=0,x,a=MM_swapURL.arguments; document.MM_ur=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_ur[j++]=x; x.href=a[i+2];}
	}
function getCountdown(sContainerID,initVal,sMsg){
	countdownCon = document.getElementById(sContainerID);
	if (!countdownCon) { return; }
	getCountdownText(initVal);
	window.setTimeout("getCountdownTick()",1000);
}
function getCountdownText(seconds){
	countdownSecs = seconds;
	var minutes=parseInt(seconds/60);
	seconds = (seconds%60);
	var hours=parseInt(minutes/60);
	minutes = (minutes%60);
	var sText = padZero(hours) + ":" + padZero(minutes) + ":" + padZero(seconds);
	countdownCon.innerHTML = sText;
}
function getCountdownTick(sMsg){
	if (countdownSecs <= 0) {
		var sAlertMsg = '' + sMsg
		if (sMsg && sAlertMsg.length > 0) {
			alert(sMsg);
			}
		return;
	}
	getCountdownText(countdownSecs-1);
	window.setTimeout("getCountdownTick()",1000);
}
function getSession(sContainerID,initVal){
	sessionCon = document.getElementById(sContainerID);
	if (!sessionCon) { return; }
	getSessionText(initVal);
	window.setTimeout("getSessionTick()", 1000);
}
function getSessionText(secs){
	sessionSecs = secs;
	var mins=parseInt(secs/60);
	var hours=parseInt(mins/60);
	secs = (secs%60);
	mins = (mins%60);
	var sText = padZero(hours) + ":" + padZero(mins) + ":" + padZero(secs);
	sessionCon.innerHTML = sText;
}
function getSessionTick(){
	getSessionText(sessionSecs+1);
	window.setTimeout("getSessionTick()",1000);
}
function getStopwatch(sContainerID,initVal){
	stopwatchCon = document.getElementById(sContainerID);
	if (!stopwatchCon) { return;}
	getStopwatchText(initVal);
	window.setTimeout("getStopwatchTick()", 1000);
}
function getStopwatchText(secs){
	stopwatchSecs = secs;
	var mins=parseInt(secs/60);
	var hours=parseInt(mins/60);
	secs = (secs%60);
	mins = (mins%60);
	var sText = padZero(hours) + ":" + padZero(mins) + ":" + padZero(secs);
	stopwatchCon.innerHTML = sText;
}
function getStopwatchTick(){
	getStopwatchText(stopwatchSecs+1);
	window.setTimeout("getStopwatchTick()",1000);
}
function getStopWStart(){
	document.getElementById('stopwatch').innerHTML=min+":"+sec+":"+msec
	go=setTimeout("getStopWStart()",1)
	msec++
	if(msec==100)
	{
		msec=0;
		sec++;
	}
	if(sec==60)
	{
		sec=0;
		min++;
	}
}
function getStopWStop(){clearTimeout(go);}

function registerMeAdm(){
	document.location.href='admLogin.asp?M=Reg';
	}
function registerMe(){
	document.location.href='register.asp?M=NF';
	}
function submitAsk(){
	var oFrm = document.getElementById('Ask')
	if (!oFrm) {
		return;
	}
	else oFrm.submit();
}
function submitAskHide(sForm){
	var oFrm = document.getElementById('Ask')
	if (!oFrm) {
		return;
	}
	else {
		oFrm.action=sForm;
		oFrm.submit();
		hideMe('butnBarAct');
	}
}
function submitFormMode(){
	var oFrm = document.getElementById('FormMode')
	if (!oFrm) {
		return;
	}
	else oFrm.submit();
}
function ajaxHelp(sRec,sRes){
	$(function(){
		sLoc = "/admSiteTools.asp?M=AJ&Act=HP&ID=" + sRec
		if (sRes) {sLoc = sLoc + '&RID=' + sRes;}
		$("#panInf").load(sLoc);
	})
}
function ajaxLoader(url,id){
	if (document.getElementById) {
		var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
	}
	if (x) {
		x.onreadystatechange = function() {
		if (x.readyState == 4 && x.status == 200) {
			el = document.getElementById(id);
			el.innerHTML = x.responseText;
		}
	}
	x.open("GET", url, true);
	x.send(null);
  }
}
function audioPanel(Elem){
	oPan = document.getElementById(Elem);
	if (!oPan) {
		return;
	}
	var sFile = oPan.title
	oPan.innerHTML = '<object id="audioPlayer" type="application/x-shockwave-flash" data="/player_mp3_audio.swf" width="200" height="20">'
		+ '<param name="movie" value="/player_mp3_audio.swf" />'
		+ '<param name="FlashVars" value="mp3=' + sFile + '&showstop=1&showvolume=1&bgcolor1=97B3D6&bgcolor2=085c68&volume=100&width=200&height=20" />'
		+ '</object>'
	}
function audioPanelWMP(Elem){
	oPan = document.getElementById(Elem);
	if (!oPan) {
		return;
	}
	if (!ie4) {
//		audioPanelQT(Elem);
//		return;
		}
	var sFile = oPan.title
	if (sFile.indexOf('docs/')<0 & sFile.indexOf('/docgrp/')<0) {sFile = "/docs/" + sFile;};
	//alert('File=' + sFile + ';Width=' + sWi + ';Height=' + sHi + ';Elem=' + Elem)
	oPan.innerHTML = '<object codebase="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" height="100" width="500" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6">'
			+ '<param name="URL" value="' + sFile + '" />'
			+ '<param name="rate" value="1" />'
			+ '<param name="balance" value="0" />'
			+ '<param name="currentPosition" value="0" />'
			+ '<param name="defaultFrame" value="" />'
			+ '<param name="playCount" value="32767" />'
			+ '<param name="autoStart" value="0" />'
			+ '<param name="currentMarker" value="0" />'
 			+ '<param name="invokeURLs" value="-1" />'
			+ '<param name="baseURL" value="" />'
			+ '<param name="volume" value="50" />'
			+ '<param name="mute" value="0" />'
			+ '<param name="uiMode" value="full" />'
			+ '<param name="stretchToFit" value="0" />'
			+ '<param name="windowlessVideo" value="0" />'
			+ '<param name="enabled" value="-1" />'
			+ '<param name="enableContextMenu" value="-1" />'
			+ '<param name="fullScreen" value="0" />'
			+ '<param name="SAMIStyle" value="" />'
			+ '<param name="SAMILang" value="" />'
			+ '<param name="SAMIFilename" value="" />'
			+ '<param name="captioningID" value="" />'
 			+ '<param name="enableErrorDialogs" value="0" />'
 			+ '<param name="_cx" value="13229" />'
			+ '<param name="_cy" value="2646" />'
			+ "<embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/' width='500' height='100' src='" + sFile + "' filename='" + sFile + "' autostart='0' showcontrols='1' showstatusbar='0' showdisplay='0' autorewind='1'>"
			+ "</embed>"
			+ "</object>";
}
function audioPanelQT(Elem){
	oPan = document.getElementById(Elem);
	if (!oPan) {
		return;
	}
	var sFile = oPan.title
	if (sFile.indexOf('docs/')<0 & sFile.indexOf('/docgrp/')<0) {sFile = "/docs/" + sFile;};
	oPan.innerHTML = '<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" WIDTH="160" HEIGHT="16">'
		+ '<param name="SRC" VALUE="' + sFile + '">'
		+ '<param name="AUTOPLAY" VALUE="false">'
		+ '<param name="CONTROLLER" VALUE="true">'
		+ '<embed SRC="' + sFile + '" WIDTH="160" HEIGHT="16" AUTOPLAY="false" CONTROLLER="true" PLUGINSPAGE="http://www.apple.com/quicktime/download/">'
		+ '</embed>'
		+ '</object>';
}
function videoPanel(Elem){
	var sWi = 320, sHi = 240;
	var re = new RegExp("px","g")
	oPan = document.getElementById(Elem);
	if (!oPan) {
		alert('Video holder not found! ' + Elem);
		return false;
	}
	var vidFile = oPan.title;
	var sTitl = oPan.innerText;
	if (oPan.width>1) {sWi = oPan.width;};
	if (oPan.height>1) {sHi = oPan.height;};
	if (oPan.style.width.length > 1) {sWi=parseFloat(oPan.style.width);} else {sWi=320;};
	if (oPan.style.height.length > 1) {sHi=parseFloat(oPan.style.height);} else {sHi=240;};
	if (!sWi.length > 1) {sWi=320;};
	if (!sHi.length > 1) {sHi=240;};
	var dt = new Date();
	var msec = '' + dt.getMinutes() + dt.getSeconds();
	if (vidFile.indexOf('docs/')<0 & vidFile.indexOf('/docgrp/')<0) {vidFile = "/docs/" + vidFile;};
	oPan.innerHTML = '<object id="vid' + Elem + msec + '" type="application/x-shockwave-flash" data="/imstd/player_flv_maxi.swf?1=1' + msec + '" width="' + sWi + '" height="' + sHi + '" style="width:' + sWi + 'px;height:' + sHi + 'px;background-color:#CCCCCF">'
			+ "<param name='movie' value='/imstd/player_flv_maxi.swf?1=1" + msec + "'>"
			+ "<param name='allowFullScreen' value='true'>"
			+ "<param name='allowScriptAccess' value='always'>"
			+ '<param name="autoplay" value="true">'
			+ '<param name="autoload" value="false">'
            + '<param name="scale" value="noscale">'
			+ '<param name="FlashVars" value="&showiconplay=1&iconplaybgcolor=666688&showfullscreen=1&showvolume=1&flv=' + vidFile + '">'
			+ "</object>";
}
function cookieCreate(name,value,days){
	if (days){
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function cookieErase(name){
	cookieCreate(name,"",-1);
}
function cookieRead(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function addLoadEvent(func) {   
	var oldonload = window.onload;   
	if (typeof window.onload != 'function') {   
		window.onload = func;   
	} else {   
		window.onload = function() {   
			if (oldonload) {   
			oldonload();   
		}   
			func();   
		}   
	}   
}   
function toolbarHigh(state){
	$(document).ready(function() {
		$('#NCNotes').css('display','none');
		cTopMargin=$('body').css('marginTop');
		iTopMargin=24+parseInt(cTopMargin);
		$('body').css('marginTop',iTopMargin+'px');
		$('#NCNotesCont').css('display','block');
	})
}
function toolbarHighOff(state){
	hideMe('NCNotesCont');
	$(document).ready(function() {
		cTopMargin = $('body').css('marginTop');
		iTopMargin=parseInt(cTopMargin)-24;
		$('body').css('marginTop',iTopMargin+'px');
		})
}
// Browser Slideshow script. With image cross fade effect for browsers that support it.
// Script copyright (C) 2004-2011 www.cryer.co.uk.
// Script is free to use provided this copyright header is included.
function setOpacity(obj,opacityPct){
  obj.style.filter = 'alpha(opacity=' + opacityPct + ')';
  obj.style.MozOpacity = opacityPct/100;
  obj.style.opacity = opacityPct/100;
}
function changeOpacity(id,msDuration,msStart,fromO,toO){
  var element=document.getElementById(id);
  var msNow = (new Date()).getTime();
  var opacity = fromO + (toO - fromO) * (msNow - msStart) / msDuration;
  if (opacity>=100)
	  {
		setOpacity(element,100);
		element.timer = undefined;
	  }
  else if (opacity<=0)
	  {
		setOpacity(element,0);
		element.timer = undefined;
	  }
  else 
	  {
		setOpacity(element,opacity);
		element.timer = window.setTimeout("changeOpacity('" + id + "'," + msDuration + "," + msStart + "," + fromO + "," + toO + ")",10);
	  }
}
function fadeInImage(foregroundID,newImage,backgroundID){
	var FadeDurationMS=1000;
  var foreground=document.getElementById(foregroundID);
  if (foreground.timer) window.clearTimeout(foreground.timer);
  if (backgroundID)
  {
    var background=document.getElementById(backgroundID);
    if (background)
    {
      if (background.src)
      {
        foreground.src = background.src; 
        setOpacity(foreground,100);
      }
      background.src = newImage;
      background.style.backgroundImage = 'url(' + newImage + ')';
      background.style.backgroundRepeat = 'no-repeat';
      var startMS = (new Date()).getTime();
      foreground.timer = window.setTimeout("changeOpacity('" + foregroundID + "'," + FadeDurationMS + "," + startMS + ",100,0)",10);
    }
  } else {
    foreground.src = newImage;
  }
}
var slideCache = new Array();
function runSlideShow(pictID,backgroundID,imageFiles,displaySecs){
  var imageSeparator = imageFiles.indexOf(";");
  var nextImage = imageFiles.substring(0,imageSeparator);
  if (slideCache[nextImage] && slideCache[nextImage].loaded)
  {
    fadeInImage(pictID,nextImage,backgroundID);
    var futureImages = imageFiles.substring(imageSeparator+1,imageFiles.length)
      + ';' + nextImage;
    setTimeout("runSlideShow('"+pictID+"','"+backgroundID+"','"+futureImages+"',"+displaySecs+")",displaySecs*1000);
    // Identify the next image to cache.
    imageSeparator = futureImages.indexOf(";");
    nextImage = futureImages.substring(0,imageSeparator);
  } else {
    setTimeout("runSlideShow('"+pictID+"','"+backgroundID+"','"+imageFiles+"',"+displaySecs+")",250);
  }
  // Cache the next image
  if (slideCache[nextImage] == null)
  {
    slideCache[nextImage] = new Image;
    slideCache[nextImage].loaded = false;
    slideCache[nextImage].onload = function(){this.loaded=true};
    slideCache[nextImage].src = nextImage;
  }
}

