<!-- Begin
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
var isIE = (navigator.userAgent.indexOf("MSIE")!=-1);
var isOpera = (navigator.appName.indexOf("Opera")!=-1);
var isSafari = (navigator.userAgent.indexOf("Safari")!=-1);
var isFireFox = (navigator.userAgent.indexOf("Firefox")!=-1);

function browser(){
var tbrowser = "";
   if (isNN==true) {tbrowser="Netscape";}
   if (isIE==true) {tbrowser="IE";}
   if (isOpera==true) {tbrowser="Opera";}
   if (isSafari==true) {tbrowser="Safari";}
   if (isFireFox==true) {tbrowser="FireFox";}

//=navigator.appName;
//tbrowser=navigator.userAgent;
return tbrowser;
}

function uT(){
// this function used to create  string to append on to URLs for unique URLs to prevent page caching
var now    = new Date();
var hour   = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
   if (hour   > 12) { hour = hour - 12;      }
   if (hour   == 0) { hour = 12;             }
   if (hour   < 10) { hour   = "0" + hour;   }
   if (minute < 10) { minute = "0" + minute; }
   if (second < 10) { second = "0" + second; }
var monthnumber = now.getMonth();
   if (monthnumber < 10) { monthnumber = "0" + monthnumber; }
var monthday    = now.getDate();
var year        = now.getYear();
if(year < 2000) { year = year + 1900; }
var timeString = hour + minute +"."+ second;
//var dateString = monthnumber +  '/' +  monthday +  '/' +  year;
var dateString = year;
var uT="&"+dateString+timeString;
return uT;
}

function uTNo(){
// this function used to create  string to append on to URLs for unique URLs to prevent page caching
var now    = new Date();
var hour   = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
   if (hour   > 12) { hour = hour - 12;      }
   if (hour   == 0) { hour = 12;             }
   if (hour   < 10) { hour   = "0" + hour;   }
   if (minute < 10) { minute = "0" + minute; }
   if (second < 10) { second = "0" + second; }
var monthnumber = now.getMonth();
   if (monthnumber < 10) { monthnumber = "0" + monthnumber; }
var monthday    = now.getDate();
var year        = now.getYear();
if(year < 2000) { year = year + 1900; }
var timeString = hour + minute +"."+ second;
//var dateString = monthnumber +  '/' +  monthday +  '/' +  year;
var dateString = year;
var uT=dateString+timeString;
return uT;
}

function goStaff(){
//window.location="../html/RA_Console.asp"
tLoc="../html/RA_Console.asp";
tLoc=tLoc+tLine;
window.location=tLoc
}

function LogOff(){
clearMenu();
window.location="../Index.asp";
}

function SecLogOff() {
var ThisLoc = "../html/SecLogOff.asp";
var tSec=document.getElementById("qSec").value;
var tLoc = ThisLoc+"?qs="+tSec;
window.location=tLoc;
}

function doClear(dfield){
dfield.value="";
dfield.focus();
}

//....................................................................................................
function LoginButton_Go() {
var xLen=window.document.Form.userid.value.length;
var yLen=window.document.Form.password.value.length;
if  (xLen <1)
   {alert("The User ID Cannot Be Blank....");
   window.document.Form.userid.focus();
	return false;}
	if  (yLen <1)
       {alert("The Password Cannot Be Blank....");
	   window.document.Form.password.focus();
		return false;}
else
	var AField = window.document.Form.userid.value;
	var PField = window.document.Form.password.value;
    var This_Cookie = "zuser=";
	var a_Cookie = "zuserid="+escape(AField);
	var p_Cookie = "zpassword="+escape(PField);
	document.cookie = This_Cookie+a_Cookie+"&"+p_Cookie;
	document.forms[0].submit();
	return true;
}

//....................................................................................................
// CursorTrim forces the cursor to the End of the entered text. 
// used as:  onMouseUp="CursorTrim(this)"
function CursorTrim(txt){
	txt.value=trim(txt.value);
	var range = txt.createRange();
}

function Mid(str, start, len){
                if (start < 0 || len < 0) return "";

                var iEnd, iLen = String(str).length;
                if (start + len > iLen)
                        iEnd = iLen;
                else
                        iEnd = start + len;
                return String(str).substring(start,iEnd);}

function mid(str, start, len){
                if (start < 0 || len < 0) return "";

                var iEnd, iLen = String(str).length;
                if (start + len > iLen)
                        iEnd = iLen;
                else
                        iEnd = start + len;
                return String(str).substring(start,iEnd);}

function Len(str){  return String(str).length;  }
function len(str){  return String(str).length;  }

function InStr(strSearch, charSearchFor){
	for (i=0; i < Len(strSearch); i++)
	{
	    if (charSearchFor == Mid(strSearch, i, 1))
	    {
			return i;
	    }
	}
	return -1;}

function right(str, n){
                if (n <= 0)     // Invalid bound, return blank string
                   return "";
                else if (n > String(str).length)   // Invalid bound, return
                   return str;                     // entire string
                else { // Valid bound, return appropriate substring
                   var iLen = String(str).length;
                   return String(str).substring(iLen, iLen - n);}}

function left(str, n){
                if (n <= 0)     // Invalid bound, return blank string
                        return "";
                else if (n > String(str).length)   // Invalid bound, return
                        return str;                // entire string
                else // Valid bound, return appropriate substring
                        return String(str).substring(0,n);}

function Right(str, n){
                if (n <= 0)     // Invalid bound, return blank string
                   return "";
                else if (n > String(str).length)   // Invalid bound, return
                   return str;                     // entire string
                else { // Valid bound, return appropriate substring
                   var iLen = String(str).length;
                   return String(str).substring(iLen, iLen - n);}}

function Left(str, n){
                if (n <= 0)     // Invalid bound, return blank string
                        return "";
                else if (n > String(str).length)   // Invalid bound, return
                        return str;                // entire string
                else // Valid bound, return appropriate substring
                        return String(str).substring(0,n);}

function ShowTimeoutWarning()
{
var NowDateTime=LocalDateTime();
window.alert( "YOUR TIME ON THIS PAGE IS ABOUT TO EXPIRE!\n\nClick 'OK' to Save your work and continue working.\n\nTime: "
			 +NowDateTime);
SetCookie("GoOrStay","Stay");
document.forms[0].submit();
}

function onDateIntervalSelect2() {
document.all.BeginDate2.value = document.all.MyCalendar2.intervalstart
document.all.EndDate2.value = document.all.MyCalendar2.intervalfinish
}

function onDateSelect1() {
document.all.Date1.value = document.all.MyCalendar1.intervalstart
document.all.mydiv1.style.visibility = 'hidden'
}
function ShowCalendar1() {
  var e = window.event.srcElement
  document.all.mydiv1.style.left = e.offsetLeft + e.offsetWidth - document.all.mydiv1.offsetWidth + 21
  document.all.mydiv1.style.top = e.offsetTop + e.offsetHeight + 70
  document.all.mydiv1.style.visibility = 'visible'
  return false;
}

function onDateSelect2() {
document.all.Date2.value = document.all.MyCalendar2.intervalstart
document.all.mydiv2.style.visibility = 'hidden'
}
function ShowCalendar2() {
  var e = window.event.srcElement
  document.all.mydiv2.style.left = e.offsetLeft + e.offsetWidth - document.all.mydiv2.offsetWidth + 21
  document.all.mydiv2.style.top = e.offsetTop + e.offsetHeight + 70
  document.all.mydiv2.style.visibility = 'visible'
  return false;
}

   
function stopError() {
  return true;
}
window.onerror = stopError;

//window.onerror = ErrorHandler;
//function ErrorHandler(msg, url, lno) {alert(msg + " : " + lno);}


var expdate = new Date();
expdate.setTime (expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 

//----------------------------------------------------------------------------------------
// Limit the size of a textarea.  Allows only the number of characters designated
// in the <input   tag.  Example:
// <textarea name=message wrap=physical cols=28 rows=4 onKeyDown="sizecheck(this.form.message,125);" onKeyUp="sizecheck(this.form.message125);"></textarea>
<!-- Begin
//---------------------------------------------------------------------
function caretpos(text){
var tval = text.value;
text.value = trim(tval);
}

function carettrim(text){
var tval = text.value;
text.value = trim(tval);
}

//---------------------------------------------------------------------
function PagePrint(){
text=document;
print(text);
}
//----------------------------------------------------------------------------------------
function notYet(){
alert("This Option Is Not Currently Available");
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
function tempDisable(){
alert("This Option Is Currently Disabled And Not Available\n\nIt Will Be Available Soon. Please Check Back.");
}
//----------------------------------------------------------------------------------------
function RushInfo()
{
window.open('html/RushInfo.asp','','scrollbars=0,width=602,height=790,resizable=0,status=0')
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------

/*
function SchedCheck(useridVar,TypeVar){
 var objdc = Server.CreateObject("ADODB.Connection")
 //objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source =  d:\\access\\newres.mdb")
 objdc.Open("PROVIDER = VFPOLEDB.1; DATA SOURCE = f:\\rush\\interview\\data")
 var sql="select * from schedule where userid = "+useridVar+" and type = "+TypeVar;
 var rs=Server.CreateObject("ADODB.Recordset")
 rs.Open(sql, objdc, 3, 3)
 rec=rs.recordcount
alert(rec);
}
*/
function IntIDcheck(field){
var xVal = field.value;
var xLength = field.value.length;
var minlimit=6
if (xLength == 0)
{return true;}
else
{
if (xLength < minlimit)
		 	{field.value=xVal;
		    field.focus();	
			return false;}
else
	{return true;}
}
}

function idcheck(field,minlimit){
var xVal = field.value;
var xLength = field.value.length;
if (xLength == 0)
{return true;}
else
{
if (xLength < minlimit)
	{
		if (xVal == "007")
      	 {return true;}
		 else
		 	{field.value=xVal;
		    field.focus();	
			return false;}
 	}
else
	{return true;}
}
}
function sizecheck(field,maxlimit,minlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
}

//alert("You have reached the maximum number of letters/words allowed for this input box.\n\nPlease consolidate your answer.\n\nThe maximum number allowed is"+maxlimit+" characters");
// otherwise, update 'characters left' counter
// End -->
//----------------------------------------------------------------------------------------
// This version can use a text box to show the remaining available characters.  It uses a slightly different 
//  < textarea call:
// <textarea name=message wrap=physical cols=28 rows=4 onKeyDown="textCounter(this.form.message,this.form.remLen,125);" onKeyUp="textCounter(this.form.message,this.form.remLen,125);"></textarea>
// Here's the display text box showing remaing available characters. Place in convenient location on page.
// <input readonly type=text name=remLen size=3 maxlength=3 value="125"> 
//----------------------------------------------------------------------------------------
<!-- Begin
/*
Displays the Date in 05/01/2004 format
*/

function isNull(val){
return(val==null);
}

function isBlank(val){if(val==null){return true;}for(var i=0;i<val.length;i++){if((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}}return true;}

function goEnter(e){
var kcode = e.keyCode;
if (kcode==13)
		{GenSeek();return true;}
		else
		{return true;}
}

function goEnterCOA(e){
var kcode = e.keyCode;
if (kcode==13)
		{COASeek();return true;}
		else
		{return true;}
}

function DateSay(){
var myDate = new Date();
var Tday = myDate.getMonth()+1 + "/" + myDate.getDay()+1 + "/" + myDate.getYear()
return Tday
}
// End -->
//----------------------------------------------------------------------------------------

function AdminPwdCheck(pVal){
var pVar=pVal;
if (pVar=="" || pVar==" ")
			{alert("The Password Field Cannot Be Empty.  \n\n     Please Enter A Value.");return false;}
if (pVar=="rhino")
   {return true;}
   else
   {alert("The Password You Entered Is Incorrect");return false;}
}

function StaffPwdCheck(pVal){
var pVar=pVal;
if (pVar=="" || pVar==" ")
			{alert("The Password Field Cannot Be Empty.  \n\n     Please Enter A Value.");return false;}
if (pVar=="full408")
   {return true;}
   else
   {alert("The Password You Entered Is Incorrect");return false;}
}

//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
function ClickCheck1(field,e){
var kcode = e.keyCode;
//alert(kcode);
var xField = document.getElementById("password").value;
if (kcode == 13 || kcode == 9)
	{
		if (xField=="")
			{alert("The Password Field Cannot Be Empty.  \n\n    Please Enter A Value.");return false;}
        else
		    {goLoginButton();return true;}
    }
}
//----------------------------------------------------------------------------------------


function numbersonly(e){
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
if (unicode<48||unicode>57) //if not a number
return false //disable key press
}
}

 
// Force password to be min of 6 characters
<!-- Begin
function keycheck(field,e){
//var kcode = e.keyCode;
var kcode = (isNN ? e.charCode : e.keyCode); 
var minlimit = 6;
var myblank = "";
var fLen=field.length;

//  This section prevents STRANGE CHARACTERS, ie, shfited number keys, etc. from being used.
//alert(kcode);
if (kcode == 13 || kcode == 9 || kcode == 0)
   {LoginButton_Go();return true;}
   else
{var str =  "126,96,33,64,35,36,37,94,38,42,40,41,45,95,61,43,91,93,123,125,58,59,39,34,44,46,47,60,62,63";
var patt1 =kcode;
var result = str.search(patt1);
var sVal=String.fromCharCode(kcode)
if (result>0)
   {alert("Please Do NOT use any Strange Sharacters in your Password, like: "+"'"+sVal+"'");field.length = fLen-1;return false;}
}
// End of STRANGE CHARACTERS..........................................................

var xField = document.getElementById("userid").value;
var yField = document.getElementById("password").value;
if (xField =="8002007" || xField =="408" || xField =="128" || xField == "399"  || xField == "77777777" )
	{
		if (kcode==13)
				{LoginButton_Go();return true;}
				else
				{	return true;}
	}
if (kcode == 13 || kcode == 9)
	{
			if (field.value.length < minlimit)
				{
									alert("Please use a Minimum of 6 characters for your Password   \n\n Hitting the ESC key will Clear the field   \n\n You can Mouse-Click to go to the userid field   ");
									field.focus();
									return false;
				}
			else
				{
				LoginButton_Go();
				return true;
//  The following would simply move focus to the next field.....not used in Rush Login page.
//  document.forms[0].elements[1].focus();
				}
	}
else
	{
	if (kcode == 27) // escape key pressed
	   {
		field.value = "";
		return true;
		}
	}
}
//alert("You have reached the maximum number of letters/words allowed for this input box.\n\nPlease consolidate your answer.\n\nThe maximum number allowed is"+maxlimit+" characters");
// otherwise, update 'characters left' counter
// End -->
//----------------------------------------------------------------------------------------
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
else 
countfield.value = maxlimit - field.value.length;
}
// End -->
<!-- Begin
//function textCounter(field, countfield, maxlimit) {
//alert(field);
//if (field.value.length > maxlimit) // if too long...trim it! and tell the user.
//field.value = field.value.substring(0, maxlimit);
//alert("You have reached the maximum number of letters/words allowed for this input box.\n\nPlease consolidate your answer.\n\nThe maximum number allowed is"+maxlimit+" characters");
// otherwise, update 'characters left' counter
//else 
//countfield.value = maxlimit - field.value.length;
//}
//----------------------------------------------------------------------------------------
<!-- Begin
function mask(fld,fmt){
var str = fld.value
var textbox = fld
if (fmt == "ssno")
{
var loc = '3,6'
var delim = '-'
var maxlen = 11
}
if (fmt =="phone")
{
var loc = '3,7'
var delim = '-'
var maxlen = 12
}
if (fmt == "date")
{
var loc = '2,5'
var delim = '/'
var maxlen = 10
}
//this.value,this,'3,6','-'
var input = fld
var locs = loc.split(',');
for (var i = 0; i <= locs.length; i++){
	for (var k = 0; k <= str.length; k++){
	 if (k == locs[i]){
	  if (str.substring(k, k+1) != delim){
	    str = str.substring(0,k) + delim + str.substring(k,str.length);
	  }
	 }
	}
	}
str = str.substring(0,maxlen);
textbox.value = str;
//if (input.value.length >= maxlen) 
}
// End -->
//----------------------------------------------------------------------------------------

// End -->
//----------------------------------------------------------------------------------------
<!-- Begin
function ssnofmt(fld){
//this.value,this,'3,6','-'
var str = fld.value
alert("str = "+str);
var textbox = fld
alert("textbox = "+textbox);
var loc = '3,6'
var delim = '-'
var maxlen = 11
var locs = loc.split(',');

alert("locs = "+locs);


for (var i = 0; i <= locs.length; i++){
	for (var k = 0; k <= str.length; k++){
	 if (k == locs[i]){
	  if (str.substring(k, k+1) != delim){
	    str = str.substring(0,k) + delim + str.substring(k,str.length)
	  }
	 }
	}
 }
str = str.substring(0,maxlen);
alert("str = "+str);
fld.value = str
}
// End -->
//----------------------------------------------------------------------------------------
<!-- Begin
// End -->

//----------------------------------------------------------------------------------------
// Example:  <INPUT name="userid" type="text"  onKeyPress="javascript:return dFilter(event, this, '########');" onKeyUp="return autoTab(this, 8, event);">
//--Begin AutoTab
function autoTab(input,len,e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
// AutoTab Related Function.......................................................
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
// AutoTab Related Function.......................................................
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}
//----------------------------------------------------------------------------------------
// Begin SetFocus
function SetFocus(fInst, eInst) {
fInst=fInst-1;
eInst=eInst-1;
  if (document.forms.length > 0) 
  {
   document.forms[fInst].elements[eInst].focus();
  }
 }
//----------------------------------------------------------------------------------------

/*function SetCookie(name, value, expires, path, domain, secure) {
var now = new Date();
now.setTime(now.getTime() + 31536000000);
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + now.toGMTString() : "") +
      ((path) ? "; path=/;" : "") +
      ((domain) ? "; domain="+domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
*/

function SetCookie(name, value, expires, path, domain, secure) {
var tDomain="rush.infostatz.com";
var now = new Date();
now.setTime(now.getTime() + 31536000000);
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + now.toGMTString() : "") +
      ((path) ? "; path=/" : "") +
      ((domain) ? "; domain="+tDomain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function GetCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function DeleteCookie(name, path, domain) {
var tDomain="rush.infostatz.com";
  if (GetCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=/" : "") +
    ((domain) ? "; domain=" + tDomain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function FixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

//...............................................................................................................
//...............................................................................................................
function CookieSetup(){
var sID = document.getElementById("Session").value;
var CurID = GetDCookie("user;id");
if (CurID=="" || CurID==null || CurID=="undefined")
	/*If it's a blank user id, force-clean the "user" cookie and assign the Session Id to the user id.*/
	{DeleteCookie("user;");
	  SetDCookie("user;id",sID);}
}

var expdate = new Date();
    expdate.setTime (expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 


//----------------------------------------------------------------------------------------
/* Cookie Dictionary Array Handler */
        function GetDCookie(name) {
          var cookies = document.cookie;            // cookies for site
          var ix1;                                  // loop index
          var n1 = name;                            // main cookie name
          var n2;                                   // crumb name
          var out;                                  // returned value
          ix1 = n1.indexOf(";");                    // cookie/crumb break
          if (ix1 != -1) {
            n2 = n1.substring(ix1 + 1);             // crumb name
            n1 = n1.substring(0, ix1);              // main cookie name
          }
          out = GetDCookieCrumb(cookies, n1);
          if (n2 && out) { out = GetDCookieCrumb(out, n2); }
          cookie = rest;
          return out;
        }

        function SetDCookie(name, value) {
		/*modified 10/01/05 drk to handle just name and value being passed...defaults to one day expire...added path*/
		  var expr = "";
		  var dayz = "";
		  var cookies = document.cookie;            // cookies for site
          var ix1;                                  // index
          var n1 = name;                            // main cookie name
          var n2 = "";                              // crumb name
          var out;                                  // returned value
          var p2 = value;                           // new value
          var p3;                         // param work area
          var p4;
          var msd = 1000 * 60 * 60 * 24;            // millisecs per day
          var path = "/";                              // path
          if (!p3) {                                // no expiration
            if (!p4) { p4 = 1; }                    // no days: use 1
            p3 = new Date();
            p3.setTime(p3.getTime() + msd * p4);
          }
          ix1 = n1.indexOf(";");                    // cookie/crumb break
          if (ix1 != -1) {
            n2 = n1.substring(ix1 + 1);             // crumb name
            n1 = n1.substring(0, ix1);              // main cookie name
          }
          out = GetDCookieCrumb(cookies, n1);
          if (n2) {
            if (out) { out = GetDCookieCrumb(out, n2); }
            else { rest = ""; }
            if (rest) { p2 = rest + ";" + n2 + "=" + p2; }
            else      { p2 =              n2 + "=" + p2; }
          }
          document.cookie=n1+"="+escape(p2)+"; expires="+p3.toGMTString()+";path="+path;
          return true;
        }

        function GetDCookieCrumb(instring, seeking) {
          var c1;                                   // cookies work area
          var c2;                                   // cookie work area
          var c3;                                   // cookie name
          var c4;                                   // cookie value
          var ix1; var ix2; var ix3; var ix4;       // indexes
          var out;                                  // return value
          rest = "";          
          c1 = instring;
          c1 = c1.replace(/\n/g, "");               // drop nl chars
          c1 = c1.replace(/\r/g, "");               // drop cr chars
          c1 = c1 + ";";                            // for final cookie
          ix1 = 0;                                  // from beginning
          if (seeking.substring(0, 1) == "#") {
            if (seeking == "#0" && !instring) { return 0; }
            ix4 = seeking.substring(1);             // which item wanten
            ix3 = 0;                                // none so far
            while (c1.indexOf(";", ix1) != -1) {
              ix2 = c1.indexOf(";", ix1);
              cookie = c1.substring(ix1, ix2);
              ix3 += 1;
              if (ix3 == ix4) { return cookie; }
              ix1 = ix2 + 1;
            }
            if (ix4 == 0) { return ix3; }           // count of items
            return "";
          }
          while (c1.indexOf(";", ix1) != -1) {
            ix2 = c1.indexOf(";", ix1);             // next cookie break
            if (ix2 == -1) { ix2 = c1.length; }
            cookie = c1.substring(ix1, ix2);        // a single cookie
            c2 = cookie;                            // cookie work area
            ix1 = ix2 + 1;
            ix3 = c2.indexOf("=", 0);               // name=value break
            if (ix3 == -1) { ix3 = c2.length; }
            c3 = c2.substring(0, ix3);              // get the name
            c4 = c2.substring(ix3 + 1);             // get the value
            c3 = c3.replace(/ /g, "");              // drop all space
            if (c3 == seeking) {
              out = unescape(c4);
            } else {
              if (rest) { rest = rest + ";" + cookie; }
              else      { rest = cookie; }
            }
          }
          return out;
        }
		
function DeleteDCookie(ThisCookie){
//alert("Cookie To Delete = "+ThisCookie);
SetDCookie(ThisCookie,"");
}
		
// End of Cookie Dictionary Array handler -----------------------------------------------

//----------------------------------------------------------------------------------------
// [dFilter] - A Numerical Input Mask for JavaScript
// Written By Dwayne Forehand - March 27th, 2003
// Please reuse & redistribute while keeping this notice.
//----------------------------------------------------------------------------------
// Modified By David R. Katz - October 20, 2003
// to be Netscape aware and allow 2 'types' of input: only numeric, or both alpha and numeric.
// Using the '#' for the Mask results in a Numeric-Only formatted string.
// Using the 'X' for the Mask results in an Upper,Lower,Numeric formatted string.
// Replaced the onKeyDown with onKeyPress because onKeyDown causes 
// numeric keypad problems in IE  and  wierd alpha characters in Netscape.
//----------------------------------------------------------------------------------
// Example 1: Allows Combined Alpha and Numeric input
// <input type="text" name="text1" onKeyPress="javascript:return dFilter(event, this, 'XXXXX-XXXX');" >
// Example 2: Allows only Numeric input
// <input type="text" name="text1" onKeyPress="javascript:return dFilter(event, this, '###-##-####');" >
//----------------------------------------------------------------------------------
//==================================================================================
// Function dFilter - a field format function
// var isNN = (navigator.appName.indexOf("Netscape")!=-1);
var dFilterSymbol;
var dLowVal;
var dHighVal;
var dFilterStep;
//----------------------------------------------------------------------------------
function dFilterStrip (dFilterTemp, dFilterMask)
{
   dFilterMask = replace(dFilterMask,dFilterSymbol,'');
   for (dFilterStep = 0; dFilterStep < dFilterMask.length++; dFilterStep++)
         {
             dFilterTemp = replace(dFilterTemp,dFilterMask.substring(dFilterStep,dFilterStep+1),'');
         }
         return dFilterTemp;
}
//----------------------------------------------------------------------------------
function dFilterMax (dFilterMask)
{
          dFilterTemp = dFilterMask;
   for (dFilterStep = 0; dFilterStep < (dFilterMask.length+1); dFilterStep++)
         {
                    if (dFilterMask.charAt(dFilterStep)!=dFilterSymbol)
                   {
                 dFilterTemp = replace(dFilterTemp,dFilterMask.charAt(dFilterStep),'');
                   }
         }
         return dFilterTemp.length;
}
//----------------------------------------------------------------------------------
// Main Program Code Function
function dFilter (key, textbox, dFilterMask)
{
	var tBox=textbox;
//alert("Text box NAME = "+tBox.name);
//alert("Text Box Value = "+tBox.value);
//alert("Key = "+key.keyCode);
//alert("dFilter Mast = "+dFilterMask);

         var keycode = (isNN) ? key.which : key.keyCode; 
//alert("KeyCode = "+keycode);
         var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
//alert("filter = "+filter);
         var isSick = containsElement(filter,keycode);
//alert("isSick = "+isSick);



//alert("Again....dFilter Mask = "+dFilterMask);

var dFilterSymbol = dFilterMask.substring(0,1);

//alert("dFilterSymbol = "+dFilterSymbol );

xField=textbox.value
//alert("xField = "+xField);

if (xField =="8002007" || xField =="408" || xField =="128" || xField == "399")
{return true;}

if (dFilterSymbol=='#')  // if they want only numeric input they pass the '#'
{
dLowVal = 47;
dHighVal = 58;
}
else   //  They want both Numeric and Alpha input if they pass the 'X'
{
dLowVal = 47;
dHighVal = 123;
}
//alert("KeyCode = "+keycode+"\n"+"dLowVal = "+dLowVal+"\n"+"dHighVal = "+dHighVal);
//alert("isSick = "+isSick);

         dFilterNum = dFilterStrip(textbox.value, dFilterMask);

         if (isSick)
         {
             return true;
         }
         else if (keycode==8&&dFilterNum.length!=0)
         {
                     dFilterNum = dFilterNum.substring(0,dFilterNum.length-1);
         }
       else if ( (keycode>dLowVal&&keycode<dHighVal) && dFilterNum.length<dFilterMax(dFilterMask) )
         {
       dFilterNum=dFilterNum+String.fromCharCode(keycode);
         }
         var dFilterFinal='';
   for (dFilterStep = 0; dFilterStep < dFilterMask.length; dFilterStep++)
         {
       if (dFilterMask.charAt(dFilterStep)==dFilterSymbol)
                   {
                        if (dFilterNum.length!=0)
												  {
                           dFilterFinal = dFilterFinal + dFilterNum.substring(0,1);
                           dFilterNum = dFilterNum.substring(1,dFilterNum.length);
                          }
                       else
                       {
                           dFilterFinal = dFilterFinal + "";
                       }
                   }
         else if (dFilterMask.charAt(dFilterStep)!=dFilterSymbol)
                   {
                       dFilterFinal = dFilterFinal + dFilterMask.charAt(dFilterStep);                
                   }
         }
         textbox.value = dFilterFinal;
   return false;
}
//----------------------------------------------------------------------------------
function replace(fullString,text,by) {
// Replaces text with by in string
   var strLength = fullString.length, txtLength = text.length;
   if ((strLength == 0) || (txtLength == 0)) return fullString;
   var i = fullString.indexOf(text);
   if ((!i) && (text != fullString.substring(0,txtLength))) return fullString;
   if (i == -1) return fullString;
   var newstr = fullString.substring(0,i) + by;
   if (i+txtLength < strLength)
       newstr += replace(fullString.substring(i+txtLength,strLength),text,by);
   return newstr;
}
//----------------------------------------------------------------------------------
//-- Function to deal with IE/Netscape keycode differences
function containsElement(arr, ele) 
{
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
//--End Netscape discovery handler
//----------------------------------------------------------------------------------------
// Begin InstructionWinddow
function instwin()
{
window.open('../html/GeneralInstructions.asp','','scrollbars=yes,width=608,height=829,resizable=no,status=no')
}

function instwin1()
{
window.open('html/GeneralInstructions.asp','','scrollbars=yes,width=608,height=800,resizable=no,status=no')
}

function InstructPrint() {
window.open('../html/InstPrint.asp','','scrollbars=yes,width=608,height=810,resizable=no,status=no')
}

function AppProcess() {
window.open('../html/AppProcess.asp','','scrollbars=yes,width=608,height=800,resizable=no,status=no')
}
function AppProcess1() {
window.open('html/AppProcess.asp','','scrollbars=yes,width=608,height=800,resizable=no,status=no')
}

function AMCASWin()
{
window.open('https://services.aamc.org/AMCAS2_school/','','scrollbars=yes,width=608,height=559,resizable=yes,status=yes')
}

//function InstructPrint() {
//var ThisRpt = "../html/InstPrint.asp";
//biggerhelpwin(ThisRpt) ;
//}

// Begin HelpWin
function alertwin(ThisAlert)
{
alert("We Made It To The AlertWin Proc....."+ThisAlert);
var ThisCookie="AlertMsg";
SetCookie("AlertMsg",ThisAlert);
var AlertPage = "../html/AlertMesssage.asp";
winpops=window.open(AlertPage,"","width=700,height=325,help=no")
}
//----------------------------------------------------------------------------------------
// Begin HelpWin
function cchelpwin(ThisHelp)
{
//alert("We Made It To The HelpWin Proc---"+ThisHelp);
SetCookie("HelpMsg" ,ThisHelp);
var HelpPage = "../ccard/ccHelp1.asp";
winpops=window.open(HelpPage,'','scrollbars=no,width=545,height=330,resizable=no,status=no,help=no');
}

function helpwin(ThisHelp)
{
//alert("We Made It To The HelpWin Proc---"+ThisHelp);
SetCookie("HelpMsg" ,ThisHelp);
var HelpPage = "../html/RushHelp.asp";
winpops=window.open(HelpPage,'','scrollbars=no,width=480,height=600,resizable=no,status=no,help=no');
}
//----------------------------------------------------------------------------------------
function biggerhelpwin(ThisHelp)
{
//alert("We Made It To The HelpWin Proc---"+ThisHelp);
SetCookie("HelpMsg",ThisHelp);
var HelpPage = "../html/RushShow.asp";
winpops=window.open(HelpPage,'','scrollbars=yes,width=820,height=810,resizable=yes,status=yes,help=no');
}
//----------------------------------------------------------------------------------------
// End Instruction Page
//----------------------------------------------------------------------------------------
//function InstructionWindow(ThisInst)
//{
//winpops=window.open(ThisInst,"","width=600")
//}
// End Instruction Page
//----------------------------------------------------------------------------------------
// Begin Trim Function
//function Trim(s) {
 //s.replace(/^[ ]*(.*?)[ ]*$/,"$1");
// return s
//}
// End Trim Function 
//----------------------------------------------------------------------------------------
// Begin Trim Function
function FTRIM(tbox) {
  var sval = tbox.value;
  tbox.value = sval.replace(/^[ ]*(.*?)[ ]*$/,"$1");
	tbox.focus();
  return 
}
// End Trim Function 
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// Begin Trim Function
//function ALLTRIM(x) {
// x.replace(/^[ ]*(.*?)[ ]*$/ ,"");
//var yx
//yx = x.replace(/^\s*(.*)\s*$/\1/,"");
 //return yx
//}
// End Trim Function 
//----------------------------------------------------------------------------------------
// Begin MsgPopUp Function
<!-- Begin
//  End -->
// End MsgPopUp Function 
//----------------------------------------------------------------------------------------
// Begin Trim Function
function ltrim(argvalue) {
  while (1) {
    if (argvalue.substring(0, 1) != " ")
      break;
    argvalue = argvalue.substring(1, argvalue.length);
  }
  return argvalue;
}
//  End lTrim Function-->
//----------------------------------------------------------------------------------------
// Begin rTrim Function
function rtrim(argvalue) {
  while (1) {
    if (argvalue.substring(argvalue.length - 1, argvalue.length) != " ")
      break;
    argvalue = argvalue.substring(0, argvalue.length - 1);
  }
  return argvalue;
}
//  End rTrim Function-->
//----------------------------------------------------------------------------------------
// Begin Trim Function
function trim(argvalue) {
  var tmpstr = ltrim(argvalue);
  return rtrim(tmpstr);
}
//  End Trim Function-->
//----------------------------------------------------------------------------------------

function isNumeric(val){
return(parseFloat(val,10)==(val*1));
}

<!-- Begin the Email Function
//function EmailCheck (emailStr) {

function EmailCheck (fieldname) {
var fldname = fieldname;
var emailStr = fieldname.value;
if (trim(emailStr)=="")
		{return true;}
var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
alert("Email address seems incorrect (check @ and .'s)");
fldname.focus();
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
fldname.focus();
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
fldname.focus();
return false;
   }
}
if (user.match(userPat)==null) {
// user is not valid
alert("The username doesn't seem to be valid.");
fldname.focus();
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
fldname.focus();
return false;
   }
}
return true;
}
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
return true;
   }
}
if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
fldname.focus();
return false;
}
if (len<2) {
alert("This address is missing a hostname!");
fldname.focus();
return false;
}
return true;
}
//  End of EmailCheck-->
//.........................................................................................................................
function ECheck (vname) {
var fldname = vname;

var emailStr = trim(document.getElementById(fldname).value);

if (emailStr=="")
		{alert("The Email Address is Empty. Please Enter Your Email Address.");
		document.getElementById(fldname).focus();return false;}
//alert("ECheck emailStr  = "+emailStr);
var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|gov|mob|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);

//alert("userPat = "+userPat);
//alert("atom = "+atom);
//alert("word = "+word);
//alert("matchArray = "+matchArray);


if (matchArray==null) {
alert("Email address seems incorrect (check @ and .'s)");
document.getElementById(fldname).focus();
return false;
}

var user=matchArray[1];
var domain=matchArray[2];
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
document.getElementById(fldname).focus();
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
document.getElementById(fldname).focus();
return false;
   }
}
if (user.match(userPat)==null) {
// user is not valid
alert("The username doesn't seem to be valid.");
document.getElementById(fldname).focus();
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
document.getElementById(fldname).focus();
return false;
   }
}
return true;
}
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
return true;
   }
}
if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
document.getElementById(fldname).focus();
return false;
}
if (len<2) {
alert("This address is missing a hostname!");
document.getElementById(fldname).focus();
return false;
}
return true;
}
//  End of ECheck-->
//.........................................................................................................................
// Date and Time Functions
<!-- Copyright 2002 Bontrager Connection, LLC

function getCalendarDate()
{
   var months = new Array(13);
   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 now         = new Date();
   var monthnumber = now.getMonth();
   var monthname   = months[monthnumber];
   var monthday    = now.getDate();
   var year        = now.getYear();
   if(year < 2000) { year = year + 1900; }
   var dateString = monthname + 
                    ' ' + 
                    monthday + 
                    ', ' + 
                    year;
   return dateString;
} // function getCalendarDate()

function getClockTime()
{
   var now    = new Date();
   var hour   = now.getHours();
   var minute = now.getMinutes();
   var second = now.getSeconds();
   var ap = "AM";
   if (hour   > 11) { ap = "PM";             }
   if (hour   > 12) { hour = hour - 12;      }
   if (hour   == 0) { hour = 12;             }
   if (hour   < 10) { hour   = "0" + hour;   }
   if (minute < 10) { minute = "0" + minute; }
   if (second < 10) { second = "0" + second; }
   var timeString = hour + 
                    ':' + 
                    minute + 
                    ':' + 
                    second + 
                    " " + 
                    ap;
   return timeString;
} // function getClockTime()

//-->
//...........................................................................................

/***********************************************
* IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
function RushNewsScroller(){
//specify path to your external page:
var iframesrc="RushNews.asp"
//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="620px" height="200px" marginwidth="1" marginheight="1" hspace="1" vspace="0" frameborder="0" scrolling="no"></iframe>')
}

function DeadlineMessage(){
//specify path to your external page:
var iframesrc="html/DeadlineMessage.html"
//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="bulletinmsg" src="'+iframesrc+'" width="622px" height="110px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')
}

var mnAutoSaveMilliSeconds=0;
  var mnAutoSaveMilliSecondsExp=0;
  var mnAutoSaveInterval=30000;

  function AutoSaveInit(nMilliSeconds)
  {
     try
     {
       var nMinutes=0;
       AutoSaveClearTimeOuts();
       nMinutes = ((nMilliSeconds / 1000) / 60); 
       mnAutoSaveMilliSeconds = nMilliSeconds; 
       mnAutoSaveMilliSecondsExp=0;
       oTimeOut = window.setTimeout("AutoSaveSubmit()",nMilliSeconds);
       oInterval = window.setInterval("AutoSaveCountDown()",mnAutoSaveInterval);
       document.getElementById("divAutoSave").innerHTML = "<b>Auto Save In " + nMinutes + " Minutes</b>";
      }
      catch (exception) 
      { 
        if (exception.description == null) { alert("AutoSaveInit Error: " + exception.message); }  
        else {  alert("AutoSaveInit Error: " + exception.description); }
      }
  }

  function AutoSaveCountDown()
  {
    var nMinutesLeft=0;
    var nMilliSecondsLeft=0;
    mnAutoSaveMilliSecondsExp =  mnAutoSaveMilliSecondsExp + mnAutoSaveInterval;
    if ( mnAutoSaveMilliSeconds > mnAutoSaveMilliSecondsExp)
    {
      nMilliSecondsLeft = mnAutoSaveMilliSeconds - mnAutoSaveMilliSecondsExp;
      nMinutes= AutoSaveRoundNumber(((nMilliSecondsLeft / 1000) / 60),2); 
      document.getElementById("divAutoSave").innerHTML = "<b>Auto Save In " + nMinutes + " Minutes</b>";
    }
  }

  function AutoSaveBeforeSubmit()
  {
     document.getElementById("divAutoSave").innerHTML = '<b>Saving data...Please wait.</b>';
     return true;
  }

  function AutoSaveClearTimeOuts()
  {
    try
    {
      window.clearInterval(oInterval);
      window.clearTimeout(oTimeOut);
    }
    catch (exception) { }
  }

  function AutoSaveSubmit()
  {
    try
    {
      AutoSaveClearTimeOuts();
      AutoSaveBeforeSubmit();
      /*
         Call the form submittal code in your main page.
      */
      SubmitFormToBeSaved();
    
     }
    catch (exception) {}
  }

   function AutoSaveRoundNumber(number,X)
  {
    var number2;
    var TmpNum;
     X=(!X ? 1:X);
     number2 = Math.round(number*Math.pow(10,X))/Math.pow(10,X);
     TmpNum = "" + number2;
     var TmpArray = TmpNum.split(".");
     if (TmpArray.length <2) { number2 = number2 + ".0"; }
     return number2;
  }

function browserversion()
{
txt="Your Browser is unknown"
browser=navigator.appVersion
if (browser.indexOf("FireFox")>-1)
{
txt="Mozilla FireFox"
}

if (browser.indexOf("2.")>-1)
{
txt="Your Browser is from the stone-age"
}
if (navigator.appVersion.indexOf("Firefox")>-1)
{
txt="Mozilla FireFox"
}
if (browser.indexOf("3.")>-1)
{
txt=navigator.appName+" Version 3+" 
}
if (browser.indexOf("4.")>-1)
{
txt=navigator.appName+" Version 4+" 
}
if (browser.indexOf("5.")>-1)
{
txt=navigator.appName+" Version 5+" 
}
if (browser.indexOf("6.")>-1)
{
txt=navigator.appName+" Version 6+" 
}
if (browser.indexOf("7.")>-1)
{
txt=navigator.appName+" Version 7+" 
}
if (browser.indexOf("8.")>-1)
{
txt=navigator.appName+" Version 8+" 
}
if (navigator.userAgent.indexOf("Firefox")!=-1)
{
var verstr = (navigator.userAgent);
var ver = verstr.substr(verstr.length-5,5);
txt="FireFox"+" Version "+ver;
}
if (navigator.userAgent.indexOf("MSIE")!=-1)
{
var verstr = (navigator.userAgent);
var verpos = verstr.indexOf("MSIE");
var verhit = verstr.substr(verpos,8);
txt="Internet Explorer"+" Version "+verhit;
//txt=verstr;
}

//var txt=navigator.appVersion
return txt
}


//.....Begin Menu Tracking Cookie Code..................................................................................................................................................
//  Function goNext(x) is called from any page...x is the page we want to go to.  The various procs create and maintain
// a cookie array of all pages navigated to with the goNext() function. The page Return button onClick calls the prevPage
// function and passes the number of pages to move back to. The prevPage proc defaults to one page if nothing is passed.
// the prevPage function removes the specified number of entries from the array, keeping it current.
// New Cookie Array procs to handle xlevel menu system. added 04/17/05
var timeToKeep = 31536000000/365; // one year
var expires = new Date();
expires.setTime(expires.getTime() + timeToKeep);
var dbug = 0; function d_a(ary) {var beg = next_entry(ary) - 1; for (var i = beg ; i > -1; i--) {ary[i] = null;}} function init_array() {if (dbug) alert('init_cookie');  var ary = new Array(null); return ary;} function set_cookie(name,value,expires) {if (dbug) alert('set_cookie'); if (!expires) expires = new Date();
document.cookie = name + '=' + escape(value) + '; expires=' + expires.toGMTString() + '; path=/';} function get_cookie(name) {if (dbug) alert('get_cookie'); var dcookie = document.cookie; var cname = name + "="; var clen = dcookie.length; var cbegin = 0; while (cbegin < clen) {var vbegin = cbegin + cname.length;
if (dcookie.substring(cbegin, vbegin) == cname) {var vend = dcookie.indexOf (";", vbegin); if (vend == -1) vend = clen; return unescape(dcookie.substring(vbegin, vend));} cbegin = dcookie.indexOf(" ", cbegin) + 1; if (cbegin == 0) break;} return null;} function del_cookie(name) {if (dbug) alert('del_cookie');
document.cookie = name + '=' + '; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';} function get_array(name, ary) {if (dbug) alert('get_array'); d_a(ary); var ent = get_cookie(name); if (ent) {i = 1; while (ent.indexOf('^') != '-1') {ary[i] = ent.substring(0,ent.indexOf('^')); i++;
ent = ent.substring(ent.indexOf('^')+1, ent.length);}}} function set_array(name, ary, expires) {if (dbug) alert('set_array'); var value = ''; for (var i = 1; ary[i]; i++) {value += ary[i] + '^';} set_cookie(name, value, expires);} function del_entry(name, ary, pos, expires) {if (dbug) alert('del_entry');
var value = ''; get_array(name, ary); for (var i = 1; i < pos; i++) {value += ary[i] + '^';} for (var j = pos + 1; ary[j]; j++) {value += ary[j] + '^';} set_cookie(name, value, expires);} function next_entry(ary) {if (dbug) alert('next_entry'); var j = 0; for (var i = 1; ary[i]; i++) {j = i} return j + 1;}
function debug_on() {dbug = 1;} function debug_off() {dbug = 0;} function dump_cookies() {if (document.cookie == '') document.write('No Cookies Found'); else {thisCookie = document.cookie.split('; '); for (i=0; i<thisCookie.length; i++) {document.write(thisCookie[i] + '<br \/>');}}}


function goNext(newPage) {
//alert("Hit the goNext Function....OK");
var cookieName = 'myMenu'; // if it isn't already defined
var myarray = init_array(); // if it isn't already defined
get_array(cookieName, myarray);
var num = next_entry(myarray);  // get the next available, blank array slot.
myarray[num] = location.pathname; // add the current page to the end of the cookie array.
//myarray[num] = window.location; // add the current page to the end of the cookie array.
set_array(cookieName, myarray, expires); // write the array to the cookie, replacing previous version.
var cookieName = 'myMenu'; // if it isn't already defined
var myarray = init_array(); // if it isn't already defined
get_array(cookieName, myarray);
window.location = newPage; // go to the requested next page.
//document.write(myarray[1],myarray[2]);
}

function prevPage(xBackTrack) 
{
//var zBackTrack = xBackTrack
if (typeof xBackTrack == "undefined")
//if (!xBackTrack > 0 || xBackTrack == null || xBackTrack == "" || xBackTrack == "undefined") 
//alert("xBackTrack = "+xBackTrack);
   {xBackTrack = 1;}
var cookieName = 'myMenu'; // if it isn't already defined
var myarray = init_array(); // if it isn't already defined
get_array(cookieName, myarray);
var size = next_entry(myarray)-1; // -1 because the function returns the next AVAILABLE array slot...not the current last array slot.
if (xBackTrack == 1)
   {del_entry(cookieName, myarray, size, expires);} // trim off the last array entry (the last stored page)
else   
   {
      for (var i = 1; i <= xBackTrack; i++) // trim off the last 'x' number of array entries, as specified in the xBackTrack variable.
         {del_entry(cookieName, myarray, size, expires);
    		 size = size-1;}
             size = size + 1; // make up for the overshoot.
   }
var hitPage = myarray[size];  // capture the last page listed in the array...that's our new 'go to' page.
//alert("hitPage = "+hitPage);
if (hitPage == null)
   {window.location = "../index.asp";}
   else
    {window.location = hitPage;}
}

/*function to adjust the size of the menu to accomodate out-of-sequence page navigation.
   Usually called from within another function*/
function menuAdjust(xCullQty){
if (!xCullQty > 0)
   {xCullQty = 1;}
var cookieName = 'myMenu'; // if it isn't already defined
var myarray = init_array(); // if it isn't already defined
get_array(cookieName, myarray);
var size = next_entry(myarray)-1; // -1 because the function returns the next AVAILABLE array slot...not the current last array slot.
if (xCullQty == 1)
   {del_entry(cookieName, myarray, size, expires);} // trim off the last array entry (the last stored page)
else   
   {
      for (var i = 1; i <= xCullQty; i++) // trim off the last 'x' number of array entries, as specified in the xBackTrack variable.
         {del_entry(cookieName, myarray, size, expires);
    		 size = size-1;}
             size = size + 1; // make up for the overshoot.
   }
var hitPage = myarray[size];  // capture the last page listed in the array...that's our new 'go to' page.
//alert(hitPage);
}

function clearMenu(){
var cookieName = 'myMenu'; // if it isn't already defined
var myarray = init_array(); // if it isn't already defined
var xCullQty=myarray.length;
if (!xCullQty > 0)
   {xCullQty = 1;}
get_array(cookieName, myarray);
var size = next_entry(myarray)-1; // -1 because the function returns the next AVAILABLE array slot...not the current last array slot.
      for (var i = 1; i <= xCullQty; i++) // trim off the last 'x' number of array entries, as specified in the xBackTrack variable.
         {del_entry(cookieName, myarray, size, expires);
    		 size = size-1;}
             size = size + 1; // make up for the overshoot.
}

function RushSetup(){
clearMenu();
DeleteCookie("zuser");
}
//}
//....End of Menu Tracking Cookie Code...................................
//------------------------------------------------------------------
//.....Begin Credit Card Validation Code...................................
<!--
/*
There are three functions in this set for credit card validation.
The main function is:
validateCard(cardNumber,cardType,cardMonth,cardYear)
	parameters:
		all paramaters are string values.
		Month & Year come from the select input fields in the form, so they are defined.
		cardType can be:
			'a' for American Express
			'd' for Discover
			'm' for MasterCard
			'v' for Visa
	description:
		this function will check string length, valid characters, specific credit card prefixes and test
		the Mod 10 (LUHN Formula) for validating possible credit card numbers. this function can only
		authorize that the given card data is potentially valid. You would still need to run actual
		card validation routines to verify the actual account.
	returns:
		this function returns true if the card number could be valid for the card type and expiration date.
		false otherwise.	
supporting functions:
mod10( cardNumber )
	parameters:
		this function takes the text string card number and runs the Mod 10 formula on its respective digits.
	description:
		Mod 10 is the check digit formula for the supported cards these functions attempt to validate.
	returns:
		this function returns true if the number passes the check digit test.
		false otherwise.
expired( cardMonth, cardYear )
	parameters:
		this function takes the text string values given by the html form.
	description:
		this function basically will check to make sure todays date is less than the expiration date the user inputs.
		this function is not locked into using 2 digit dates.
	returns:
		this fucntion returns true if the card is expired.
		false otherwise.
*/
function mod10( cardNumber ) { // LUHN Formula for validation of credit card numbers.
	var ar = new Array( cardNumber.length );
	var i = 0,sum = 0;
    	for( i = 0; i < cardNumber.length; ++i ) {
    		ar[i] = parseInt(cardNumber.charAt(i));
    	}
    	for( i = ar.length -2; i >= 0; i-=2 ) { // you have to start from the right, and work back.
    		ar[i] *= 2;							 // every second digit starting with the right most (check digit)
    		if( ar[i] > 9 ) ar[i]-=9;			 // will be doubled, and summed with the skipped digits.
    	}										 // if the double digit is > 9, ADD those individual digits together 
        	for( i = 0; i < ar.length; ++i ) {
        		sum += ar[i];						 // if the sum is divisible by 10 mod10 succeeds
        	}
        	return (((sum%10)==0)?true:false);	 	
    }

        function expired( month, year ) {
        	var now = new Date();							// this function is designed to be Y2K compliant.
        	var expiresIn = new Date(year,month,0,0,0);		// create an expired on date object with valid thru expiration date
        	expiresIn.setMonth(expiresIn.getMonth()+1);		// adjust the month, to first day, hour, minute & second of expired month
        	if( now.getTime() < expiresIn.getTime() ) return false;
        	return true;									// then we get the miliseconds, and do a long integer comparison
    }

        function validateCard(cardNumber,cardType,cardMonth,cardYear,CheckDate) {
        	if( cardNumber.length == 0 ) {						//most of these checks are self explanitory
        		alert("Please enter a valid card number.");
        		return false;				
        	}
        	for( var i = 0; i < cardNumber.length; ++i ) {		// make sure the number is all digits.. (by design)
        		var c = cardNumber.charAt(i);


            		if( c < '0' || c > '9' ) {
            			alert("Please enter a valid card number. Use only digits. do not use spaces or hyphens.");
            			return false;
            		}
            	}
            	var length = cardNumber.length;			//perform card specific length and prefix tests
                	switch( cardType ) {
                		case 'a':
                    			if( length != 15 ) {
                    				alert("Please enter a valid American Express Card number.");
                    				return;
                    			}
                    			var prefix = parseInt( cardNumber.substring(0,2));
                        			if( prefix != 34 && prefix != 37 ) {
                        				alert("Please enter a valid American Express Card number.");
                        				return;
                        			}
                        			break;

                        		case 'd':
                            			if( length != 16 ) {
                            				alert("Please enter a valid Discover Card number.");
                            				return;
                            			}
                            			var prefix = parseInt( cardNumber.substring(0,4));
                                			if( prefix != 6011 ) {
                                				alert("Please enter a valid Discover Card number.");
                                				return;
                                			}
                                			break;

                                		case 'm':
                                    			if( length != 16 ) {
                                    				alert("Please enter a valid MasterCard number.");
                                    				return;
                                    			}
                                    			var prefix = parseInt( cardNumber.substring(0,2));
                                        			if( prefix < 51 || prefix > 55) {
                                        				alert("Please enter a valid MasterCard Card number.");
                                        				return;
                                        			}
                                        			break;

                                        		case 'v':
                                            			if( length != 16 && length != 13 ) {
                                            				alert("Please enter a valid Visa Card number.");
                                            				return;
                                            			}
                                            			var prefix = parseInt( cardNumber.substring(0,1));
                                                			if( prefix != 4 ) {
                                                				alert("Please enter a valid Visa Card number.");
                                                				return;
                                                			}
                                                			break;
                                                	}
                                                	if( !mod10( cardNumber ) ) { 		// run the check digit algorithm
                                                		alert("Sorry! this is not a valid credit card number.");
                                                		return false;
                                                	}
                                                	if (CheckDate==true){
																										if( expired( cardMonth, cardYear ) ) {							// check if entered date is already expired.
  	                                              		alert("Sorry! The expiration date you have entered would make this card invalid.");
    	                                            		return false;
      	                                          	}
																									}
                                                	return true; // at this point card has not been proven to be invalid
                                            }
                                            //-->
//....End of Credit Card Validation Code...................................................................................................................................................


function tZone(){

var cDT = new Date();
var tZDiff = cDT.getTimezoneOffset()/60;
var tZSay = "";

var Month = cDT.getMonth();
var Day = cDT.getDay();
var Year = cDT.getYear();

	if (Month>=3 && Month<=10){
		if (tZDiff==4)
			{tZSay="Eastern Daylight Time";}
		if (tZDiff==5)
			{tZSay="Central Daylight Time";}
		if (tZDiff==6)
			{tZSay="Mountain Daylight Time";}
		if (tZDiff==7)
			{tZSay="Pacific Daylight Time";}}
	if (Month<=2 || Month>=11){
		if (tZDiff==4)
			{tZSay="Eastern Standard Time";}
		if (tZDiff==5)
			{tZSay="Central Standard Time";}
		if (tZDiff==6)
			{tZSay="Mountain Standard Time";}
		if (tZDiff==7)
			{tZSay="Pacific Standard Time";}}

return tZSay;

}


//---------------------------------------------------------------------------------------------------------------------
//----------------------------------------Number Formatter by On3Galleries.com----------------------------------------
//----------------------------------------  You are free to use this in your   ----------------------------------------
//----------------------------------------  scripts, but you must leave this   ----------------------------------------
//----------------------------------------   Copyright notice intact. Enjoy!   ----------------------------------------
//---------------------------------------------------------------------------------------------------------------------
//---------------------------------------- You can call this function with only----------------------------------------
//----------------------------------------   the 'num' object (reference your  ----------------------------------------
//----------------------------------------   field you want to format). If no  ----------------------------------------
//----------------------------------------formats are sent, it will use default----------------------------------------
//----------------------------------------             formats.                ----------------------------------------
//---------------------------------------------------------------------------------------------------------------------
function FormatNumber(num, format)
{
var shortformat="";
if(format==null)
	{
			// Choose the default format you prefer for the <b style="color:black;background-color:#a0ffff">number</b>. 
		//format = "#-(###) ###-#### ";		// Telephone w/ LD Prefix and Area Code
		format = "(###) ###-#### ";			// Telephone w/ Area Code
		//format = "###-###-####";			// Telephone w/ Area Code (dash seperated)
		//format = "###-##-####";			//Social Security <b style="color:black;background-color:#a0ffff">Number</b>
	}					
//---------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------
	if(shortformat==null)
	{
		// Choose the short format (without area code) you prefer. 
		//If you do not want multiple formats, leave it as "".

		//var shortformat = "###-#### ";
		var shortformat = "";
	}
	
//---------------------------------------------------------------------------------------------------------------------
//----------------------------------------This code can be used to format any <b style="color:black;background-color:#a0ffff">number</b>. ---------------------------------
//----------------------------------------Simply change the format to a <b style="color:black;background-color:#a0ffff">number</b> format ---------------------------------
//---------------------------------------- you prefer. It will ignore all characters  ---------------------------------
//----------------------------------------  except the #, where it will replace with  ---------------------------------
//----------------------------------------               user input.                  ---------------------------------
//---------------------------------------------------------------------------------------------------------------------

	var validchars = "0123456789";
	var tempstring = "";
	var returnstring = "";
	var extension = "";
	var tempstringpointer = 0;
	var returnstringpointer = 0;
	count = 0;

	// Get the length so we can go through and remove all non-numeric characters
	var length = num.value.length;
		

	// We are only concerned with the format of the phone <b style="color:black;background-color:#a0ffff">number</b> - extensions can be left alone.
	if (length > format.length)
	{
		length = format.length;
	};
	
	// scroll through what the user has typed
	for (var x=0; x<length; x++)
	{
		if (validchars.indexOf(num.value.charAt(x))!=-1)
		{
		tempstring = tempstring + num.value.charAt(x);
		};
	};
	// We should now have just the #'s - extract the extension if needed
	if (num.value.length > format.length)
	{
		length = format.length;
		extension = num.value.substr(format.length, (num.value.length-format.length));
	};
	
	// if we have fewer characters than our short format, we'll default to the short version.
	for (x=0; x<shortformat.length;x++)
	{
		if (shortformat.substr(x, 1)=="#")
		{
			count++;
		};
	}
	if (tempstring.length <= count)
	{
		format = shortformat;
	};

	
	//Loop through the format string and insert the numbers where we find a # sign
	for (x=0; x<format.length;x++)
	{
		if (tempstringpointer <= tempstring.length)
		{
			if (format.substr(x, 1)=="#")
			{
				returnstring = returnstring + tempstring.substr(tempstringpointer, 1);
				tempstringpointer++;
			}else{
				returnstring = returnstring + format.substr(x, 1);
			}
		}
		
	}

	// We have gone through the entire format, let's add the extension back on.
		returnstring = returnstring + extension;
	
	//we're done - let's return our value to the field.
	num.value = returnstring;
}	
// End -->

