		function checkEnterKey(toCtrl)
		{
			if(window.event.keyCode == 13)
			{
				if(toCtrl != null){
					toCtrl.focus();
					//toCtrl.click();
					}
				else
					ok();
			}
		}
		function SetFocus(toCtrl) {
			var tb = document.getElementById(toCtrl);
			if ((tb != null) && (!tb.disabled))
			tb.focus(); 
		}

//Scripts below are used for the members-only logon
		document.oncontextmenu = new Function("return false");
		var passwd = "";
		
		// This function is called when the image cannot be
		// successfully loaded
		function errorHandler (evt) {
		alert("You have entered an invalid password.");
		}

		function loadHandler (evt) {
		//do this if you want a landing page after user logs in:  top.location.href = passwd + ".html";
		top.location.href = passwordpath + passwd + ".html"
		passwordValidated();
		document.getElementById('GVSubmit').value = ' Logout ';
		}
		
		function logon(passw) {
		if (isCookiesEnabled() == 0) {
			if (getCookie("passwordisvalid") != "yes") {
				//try to login
				passwd = passw.value;
				var img = new Image();
				img.onload = loadHandler;
				img.onerror = errorHandler;
				img.src = passwordpath + passwd + ".gif";
				passw.value = "";
			}
			else {
				//logout
				passwordInvalidated();
				loginText = document.getElementById("GVSubmit").value
				//alert('Value = ' + loginText);
				document.getElementById('GVSubmit').value = ' Login ';
			}
			} else {
				alert('You must first enable Cookies in your browser to logon');
			}
		return false;
		}
	
		// Set a cookie
		function setCookie(name, value, expires, path, domain, secure) {
		// set time, it's in milliseconds
		var today = new Date();
		today.setTime(today.getTime());
		
		if (expires) {
		expires = expires * 1000 * 60;
		}
		var expires_date = new Date(today.getTime() + (expires));
		document.cookie = name + "=" + escape(value) +
		((expires) ? ";expires=" + expires_date.toGMTString() : "") +
		((path) ? ";path=" + path : "") +
		((domain) ? ";domain=" + domain : "") +
		((secure) ? ";secure" : "");
		}
		
		// Get the specified cookie
		function getCookie(name) {
		
		var dc = document.cookie;
		var start = dc.indexOf(name + "=");
		var len = start + name.length + 1;
		
		if ((!start) &&
		(name != dc.substring(0, name.length))) {
		return null;
		}
		
		if (start == -1) return null;
		var end = dc.indexOf( ";", len );
		if (end == -1) end = dc.length;
		return unescape(dc.substring(len, end));
		}
		
		// Indicate that user visited the logon page.
		function newSession() {
		setCookie("visitedloginscreen", "yes", "", "/", "", "");
		}
		
		// Indicate that the password entered is valid.
		function passwordValidated() {
		setCookie("passwordisvalid", "yes", "", "/", "", "");
		//alert('Member Login Validated!');
		}

		function passwordInvalidated() {
		setCookie("passwordisvalid", "no", "", "/", "", "");
		alert('Member has logged out.');
		}
		
		// Check whether user visited logon page.
		function checkSession() {
		if (getCookie("visitedloginscreen") != "yes") {
			alert('This page for members only - please visit the login page first.');
			//used to redirect to access denied page
			top.location.href= passwordpath + "index.asp";
		}
		}
		
		// Check whether user entered valid password.
		function checkValidation() {
		if (getCookie("passwordisvalid") != "yes") {
			alert('This page for members only');
			top.location.href= passwordpath + "index.asp";
		}
		}
		
		// Check if cookies are enabled on client browser.
		function isCookiesEnabled() {
		setCookie("cookiesenabled", "yes", "", "/", "", "");
		if (getCookie("cookiesenabled") != "yes") {
		return -1;
		} else {
		return 0;
		}
		}

// MM picture scripts...
		function MM_reloadPage(init) {  //reloads the window if Nav4 resized
		  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
		  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
		}
		MM_reloadPage(true);
		
		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_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_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_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 KW_expertPopup(sc,iw,ih,mg,wd,hg,sb,fs,bg,tl,nr,ms,cs,cb){
		 pw=(wd!=0)?wd:(iw+mg*2);ph=(hg!=0)?hg:(ih+mg*2);psw=parseInt(screen.width/2-pw/2);
		 psh=parseInt(screen.height/2-ph/2);
		 if (fs) {pw=screen.width;ph=screen.height;psh=0;psw=0;mg=0}
		 look="width="+pw+",height="+ph+",screenX="+psw+",screenY="+psh+",left="+psw+",top="+psh
		 if (sb==1) look+=",scrollbars=yes"
		 pStr="<ht"+""+"ml><he"+""+"ad><ti"+""+"tle>"+tl+"<\/ti"+""+"tle><META HTTP-EQUIV=\"imagetoolbar\" CONTENT=\"no\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><\/he"+""+"ad><st"+""+"yle type=\"text/css\"> <!-- BODY {  margin : "+mg+"px; } --> <\/style><bo"+""+"dy bgcolor="+bg+"  marginwidth=\"0\" marginheight=\"0\""
		 if (cs!=0) pStr+="onLoad=\"setTimeout('window.close()',"+cs+")\" "
		 if (cb!=0) pStr+="onBlur=\"window.close()\""
		 pStr+=">"
		 if (nr!=0) pStr+="<scr"+""+"ipt>  var msg='"+ms+"';function disableIE() {if (document.all) {alert(msg);return false;}} function disableNS(e){ if (document.layers||(document.getElementById&&!document.all)) {  if (e.which==2||e.which==3) {alert(msg);return false;} }} if (document.layers) {  document.captureEvents(Event.MOUSEDOWN);document.onmousedown=disableNS;} else {  document.onmouseup=disableNS;document.oncontextmenu=disableIE;} document.oncontextmenu=new Function('alert(msg);return false')<\/sc"+""+"ript>"
		 if (fs)
		 pStr+="<table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td ><div align=\"center\"><"+""+"a hr"+""+"ef='javasc"+""+"ript:self.close();'><img src='"+sc+"' border=0 alt=\"Click Image to Close\"><\/"+""+"a><\/div><\/td><\/tr><\/table><\/bo"+""+"dy><\/ht"+""+"ml>" 
		 else
		 pStr+="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td ><"+""+"a hr"+""+"ef='javasc"+""+"ript:self.close();'><img src='"+sc+"' border=0 alt=\"Click Image to Close\"><\/"+""+"a><\/td><\/tr><\/table><\/bo"+""+"dy><\/ht"+""+"ml>"
		 popwin=window.open('','',look);
		 popwin.document.open();
		 popwin.document.write(pStr);
		 popwin.document.close();
		}
		
		function MM_openBrWindow(theURL,winName,features) {
		  window.open(theURL,winName,features);
		}
