//THIS BLOCK OF JAVASCRIPT IS FOR STYLING PURPOSES ONLY...
bName = navigator.appName; 

if (navigator.userAgent.indexOf('Mac')!= -1 && navigator.userAgent.indexOf('MSIE 5.0') == -1) { 
 	document.write("<link href='../../../css/netscapeMac.css' rel='STYLESHEET' type='text/css'>"); 
}  else if (bName=="Netscape") { 
 	document.write("<link href='../../../css/netscape.css' rel='STYLESHEET' type='text/css'>"); 
} else { 
 		document.write("<link href='../../../css/IE.css' rel='STYLESHEET' type='text/css'>"); 
}

// THIS BLOCK OF JAVASCRIPT IS FOR FLASH TEST
bVer = parseInt(navigator.appVersion);

// ASSIGN BASE VARIABLES
flash = "no" 
flashver = "1.0" 
action = "ns_exec"

// DETECT FLASH PLUGIN FOR NETSCAPE FLASH 3 VERSION
if (bName=="Netscape") {
if (navigator.plugins["Shockwave Flash 2.0"]) {flashver = "2.0"}
else if(navigator.plugins["Shockwave Flash"]) {flashver = "3.0"}
if (flashver == "3.0") {flash = "yes";}
} 
else if (bName =="Microsoft Internet Explorer") { action = "ie_exec" }

//THIS BLOCK OF JAVASCRIPT IS FOR JUMP MENU ON INDEX PAGE...
function jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function findObj(n, d) { 
  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=findObj(n,d.layers[i].document); return x;
}

function jumpMenuGo(selName,targ,restore){ 
  var selObj = findObj(selName); if (selObj) jumpMenu(targ,selObj,restore);
}

function makeArray() {
     for (i = 0; i<makeArray.arguments.length; i++)
          this[i + 1] = makeArray.arguments[i];
}

function openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function getcookievalue() {
	//this function could be rewritten to take
	//cookiename as an argument
	var cookieName = "FBLOGGEDIN";

	//this next line actually looks at all the cookies
	//as one long string, so we want to find where in that
	//string our cookie is
	var ourCookie = document.cookie.indexOf(cookieName+"=");

	//ourCookie now contains the location in the document.cookie
	//string of our cookie, -1 means it was not present
	if (ourCookie != -1) {
	   	//our cookie is here
		//we want to check it's value,
		//which, since the cookie string looks
		//like "FBLOGGEDIN=value;" we want to advance
		//our pointer (ourcookie) to the location
		//after the = sign (cookiename.length + 1 for the =)

		var ourCookieStartIndex = ourCookie + cookieName.length + 1;

		//now we want to find the first ";" after ourcookiestartindex
		var ourCookieEndIndex = document.cookie.indexOf(";", ourCookieStartIndex);

		//if there was no ";" found, just set the end to the end of the string
		if (ourCookieEndIndex == -1) {
			ourCookieEndIndex = document.cookie.length;
		}

		//so now that we have the start and end points of our cookie
		//we can extract it...
		ourCookieValue = document.cookie.substring(ourCookieStartIndex, ourCookieEndIndex);
		//so is our cookie set to "Y"?
		if (ourCookieValue == "Y") {
			//write the logout button
			document.write("<A href='../../../servlet/srvLogOut' onFocus='if(this.blur)this.blur()'><IMG SRC='../../../gfx/logOff.gif' WIDTH='178' HEIGHT='37' ALT='Log Off' BORDER='0'></A>");	
		} else {
			//cookie was not set to "y", write the login button
			document.write("<A href='../../../Templates/tmpRegistration.html' onFocus='if(this.blur)this.blur()'><IMG SRC='../../../gfx/signUpIn.gif' WIDTH='95' HEIGHT='37' ALT='Click Here to Sign Up' BORDER='0'></A><A href='../../../servlet/srvPreLogIn' onFocus='if(this.blur)this.blur()'><IMG SRC='../../../gfx/logInIn.gif' WIDTH='83' HEIGHT='37' ALT='Click Here to Log In' BORDER='0'></A>");		
		}
	} else {
		//our cookie is not here, write the login button
		document.write("<A href='../../../Templates/tmpRegistration.html' onFocus='if(this.blur)this.blur()'><IMG SRC='../../../gfx/signUpIn.gif' WIDTH='95' HEIGHT='37' ALT='Click Here to Sign Up' BORDER='0'></A><A href='../../../servlet/srvPreLogIn' onFocus='if(this.blur)this.blur()'><IMG SRC='../../../gfx/logInIn.gif' WIDTH='83' HEIGHT='37' ALT='Click Here to Log In' BORDER='0'></A>");
	}
}