/*
//redirector routine to replace 'https:' with 'http:'
if ((location.href.indexOf("https:") > -1)&&(location.href.toUpperCase().indexOf("/BLIFE/SVC20_LEAD.ASP") == -1)) {
	newlocation = location.href.replace(/https:/, "http:");
	location.replace(newlocation);
}
*/

// Ultimate client-side JavaScript client sniff. 
// (C) Netscape Communications 1999.  Permission granted to reuse and distribute. 
// Revised 17 May 99 to add is.nav5up and is.ie5up (see below). 
// Everything you always wanted to know about your JavaScript client 
// but were afraid to ask ... "Is" is the constructor function for "is" object, 
// which has properties indicating: 
// (1) browser vendor: 
//     is.nav, is.ie, is.opera 
// (2) browser version number: 
//     is.major (integer indicating major version number: 2, 3, 4 ...) 
//     is.minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...) 
// (3) browser vendor AND major version number 
//     is.nav2, is.nav3, is.nav4, is.nav4up, is.ie3, is.ie4, is.ie4up, is.ie5, is.ie5up 
// (4) JavaScript version number: 
//     is.js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...) 
// (5) OS platform and version: 
//     is.win, is.win16, is.win32, is.win31, is.win95, is.winnt, is.win98 
//     is.os2 
//     is.mac, is.mac68k, is.macppc 
//     is.unix 
//        is.sun, is.sun4, is.sun5, is.suni86 
//        is.irix, is.irix5, is.irix6 
//        is.hpux, is.hpux9, is.hpux10 
//        is.aix, is.aix1, is.aix2, is.aix3, is.aix4 
//        is.linux, is.sco, is.unixware, is.mpras, is.reliant 
//        is.dec, is.sinix, is.freebsd, is.bsd 
//     is.vms 
// 
// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and 
// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html 
// for detailed lists of userAgent strings. 
// 
// Note: you don't want your Nav4 or IE4 code to "turn off" or 
// stop working when Nav5 and IE5 (or later) are released, so 
// in conditional code forks, use is.nav4up ("Nav4 or greater") 
// and is.ie4up ("IE4 or greater") instead of is.nav4 or is.ie4 
// to check version in code which you want to work on future 
// versions. 
  


function Is () 
{   // convert all characters to lowercase to simplify testing 
    var agt=navigator.userAgent.toLowerCase(); 

    // *** BROWSER VERSION *** 
    // Note: On IE5, these return 4, so use is.ie5up to detect IE5. 
    this.major = parseInt(navigator.appVersion); 
    this.minor = parseFloat(navigator.appVersion); 

    this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
                && (agt.indexOf('webtv')==-1)); 
    this.nav2 = (this.nav && (this.major == 2)); 
    this.nav3 = (this.nav && (this.major == 3)); 
    this.nav4 = (this.nav && (this.major == 4)); 
    this.nav4up = (this.nav && (this.major >= 4)); 
    this.navonly      = (this.nav && ((agt.indexOf(";nav") != -1) || 
                          (agt.indexOf("; nav") != -1)) ); 
    this.nav5 = (this.nav && (this.major == 5)); 
    this.nav5up = (this.nav && (this.major >= 5)); 

    this.ie   = (agt.indexOf("msie") != -1); 
    this.ie3  = (this.ie && (this.major < 4)); 
    this.ie4  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
    this.ie4up  = (this.ie  && (this.major >= 4)); 
    this.ie5  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 
    this.ie5up  = (this.ie  && !this.ie3 && !this.ie4); 

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser 
    // or if this is the first browser window opened.  Thus the 
    // properties is.aol, is.aol3, and is.aol4 aren't 100% reliable. 
    this.aol   = (agt.indexOf("aol") != -1); 
    this.aol3  = (this.aol && this.ie3); 
    this.aol4  = (this.aol && this.ie4); 

    this.opera = (agt.indexOf("opera") != -1); 
    this.webtv = (agt.indexOf("webtv") != -1); 

    // *** JAVASCRIPT VERSION CHECK *** 
    if (this.nav2 || this.ie3) this.js = 1.0 
    else if (this.nav3 || this.opera) this.js = 1.1 
    else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2 
    else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3 
    else if (this.nav5) this.js = 1.4 
    // NOTE: In the future, update this code when newer versions of JS 
    // are released. For now, we try to provide some upward compatibility 
    // so that future versions of Nav and IE will show they are at 
    // *least* JS 1.x capable. Always check for JS version compatibility 
    // with > or >=. 
    else if (this.nav && (this.major > 5)) this.js = 1.4 
    else if (this.ie && (this.major > 5)) this.js = 1.3 
    // HACK: no idea for other browsers; always check for JS version with > or >= 
    else this.js = 0.0; 

    // *** PLATFORM *** 
    this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) ); 
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all 
    //        Win32, so you can't distinguish between Win95 and WinNT. 
    this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1)); 

    // is this a 16 bit compiled version? 
    this.win16 = ((agt.indexOf("win16")!=-1) || 
                  (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
                  (agt.indexOf("windows 16-bit")!=-1) ); 

    this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) || 
                  (agt.indexOf("windows 16-bit")!=-1)); 

    // NOTE: Reliable detection of Win98 may not be possible. It appears that: 
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent. 
    //       - On Mercury client, the 32-bit version will return "Win98", but 
    //         the 16-bit version running on Win98 will still return "Win95". 
    this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1)); 
    this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1)); 
    this.win32 = ( this.win95 || this.winnt || this.win98 || 
                   ((this.major >= 4) && (navigator.platform == "Win32")) || 
                   (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1) ); 

    this.os2   = ((agt.indexOf("os/2")!=-1) || 
                  (navigator.appVersion.indexOf("OS/2")!=-1) || 
                  (agt.indexOf("ibm-webexplorer")!=-1)); 

    this.mac    = (agt.indexOf("mac")!=-1); 
    this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) || 
                               (agt.indexOf("68000")!=-1))); 
    this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) || 
                               (agt.indexOf("powerpc")!=-1))); 

    this.sun   = (agt.indexOf("sunos")!=-1); 
    this.sun4  = (agt.indexOf("sunos 4")!=-1); 
    this.sun5  = (agt.indexOf("sunos 5")!=-1); 
    this.suni86= (this.sun && (agt.indexOf("i86")!=-1)); 
    this.irix  = (agt.indexOf("irix") !=-1);    // SGI 
    this.irix5 = (agt.indexOf("irix 5") !=-1); 
    this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1)); 
    this.hpux  = (agt.indexOf("hp-ux")!=-1); 
    this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1)); 
    this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1)); 
    this.aix   = (agt.indexOf("aix") !=-1);      // IBM 
    this.aix1  = (agt.indexOf("aix 1") !=-1); 
    this.aix2  = (agt.indexOf("aix 2") !=-1); 
    this.aix3  = (agt.indexOf("aix 3") !=-1); 
    this.aix4  = (agt.indexOf("aix 4") !=-1); 
    this.linux = (agt.indexOf("inux")!=-1); 
    this.sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1); 
    this.unixware = (agt.indexOf("unix_system_v")!=-1); 
    this.mpras    = (agt.indexOf("ncr")!=-1); 
    this.reliant  = (agt.indexOf("reliantunix")!=-1); 
    this.dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
         (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
         (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    this.sinix = (agt.indexOf("sinix")!=-1); 
    this.freebsd = (agt.indexOf("freebsd")!=-1); 
    this.bsd = (agt.indexOf("bsd")!=-1); 
    this.unix  = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux || 
                 this.sco ||this.unixware || this.mpras || this.reliant || 
                 this.dec || this.sinix || this.aix || this.linux || this.bsd || 
                 this.freebsd); 

    this.vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1)); 
} 


var is; 
/*
var isIE3Mac = false; 
// this section is designed specifically for IE3 for the Mac 

if ((navigator.appVersion.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1) && (parseInt(navigator.appVersion)==3)) 
       isIE3Mac = true; 
else   is = new Is();  
//*******************************************************************
// ***Begin library code better placed in an external API***
// Set global variables for browser detection and reference building
var isNav=false;
var isIE=false; 
var layerRef = "";
var subVer = 0;
var styleObj = "";
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
	    subVer=navigator.appVersion
		isNav = true
		styleObj = ""
		layerRef = "document.layers"
	} else {
		isIE = true
		styleObj = ".style"
		layerRef = "document.all"
	}
}
*/	
//alert("subVer is " + subVer);



// date display variables
// Jim Pankiewicz merged this with a routine from Tim Comber 
// Jim added the Y2K compliance and converted the days to ordinals.
// To use, add a document.write( dateparts ) to your html 
/*
var day="";
var month="";
var myweekday="";
var weekday="";
var year="";
mydate = new Date();

myweekday = mydate.getDay();
mymonth = mydate.getMonth();
myday= mydate.getDate();
weekday= myweekday;
myyear= mydate.getFullYear();

year=myyear;	
if(myweekday == 0)
weekday = " Sunday, "      
else if(myweekday == 1)
weekday = " Monday, "
else if(myweekday == 2)
weekday = " Tuesday, "   
else if(myweekday == 3)
weekday = " Wednesday, "   
else if(myweekday == 4)
weekday = " Thursday, "
else if(myweekday == 5)
weekday = " Friday, "
else if(myweekday == 6)
weekday = " Saturday, "
if(mymonth == 0) {
month = "January "}
else if(mymonth ==1)
month = "February "
else if(mymonth ==2)
month = "March "
else if(mymonth ==3)
month = "April "
else if(mymonth ==4)
month = "May "
else if(mymonth ==5)
month = "June "
else if(mymonth ==6)
month = "July "
else if(mymonth ==7)
month = "August "
else if(mymonth ==8)
month = "September "
else if(mymonth ==9)
month = "October "
else if(mymonth ==10)
month = "November "
else if(mymonth ==11)
month = "December "

if((myday == 1)||(myday == 21)||(myday == 31))  
day = myday + "st, "
else if((myday == 2)||(myday == 22))
day = myday + "nd, "
else if((myday ==3)||(myday == 23))
day = myday + "rd, "
else 
day = myday + "th, "
*/
// put a line like the following in your HTML to implement
//<SCRIPT LANGUAGE="JavaScript"> document.write( weekday + month + day + year);</SCRIPT>

// end of date routine


// start function definitions

function diagnostics() {

alert("isNav is " + isNav + "isIE is " + isIE +"ie4up - " + is.ie4up + " nav4up - " + is.nav4up + " major version - " + is.major + " minor version - " + is.minor );

}


//*********  LIVE CODE 
var bannerCount=1;
var bannerTime;

function flipBanner() {

	clearTimeout(bannerTime);
	if	(bannerCount > 3){
       bannerCount=1;
       }
	if	(bannerCount == 1){
       showSubmenu("banner1");
	   hideSubmenu("banner2");
	   hideSubmenu("banner3");

	   }
	if	(bannerCount == 2){
       hideSubmenu("banner1");
	   showSubmenu("banner2");
	   hideSubmenu("banner3");
	   
	   }
	if	(bannerCount == 3){
       hideSubmenu("banner1");
	   hideSubmenu("banner2");
	   showSubmenu("banner3");
	   
	   }
	
bannerCount=bannerCount+1;
bannerTime = setTimeout("flipBanner()",20000); // 86400
}
// used in Optimizer tool to show five "hints" in rotation
function flipHint() {
//alert("HelpfulHint2 visibility " + isVisible("HelpfulHint2"));
	if (isVisible("HelpfulHint1")){
		showSubmenu("HelpfulHint2") 
		hideSubmenu("HelpfulHint1") 
		hideSubmenu("HelpfulHint3") 
		hideSubmenu("HelpfulHint4") 
		hideSubmenu("HelpfulHint5") 
	} else if (isVisible("HelpfulHint2")) {
		showSubmenu("HelpfulHint3") 
		hideSubmenu("HelpfulHint1") 
		hideSubmenu("HelpfulHint2") 
		hideSubmenu("HelpfulHint4") 
		hideSubmenu("HelpfulHint5") 
	} else if (isVisible("HelpfulHint3")) {
		showSubmenu("HelpfulHint4") 
		hideSubmenu("HelpfulHint1") 
		hideSubmenu("HelpfulHint2") 
		hideSubmenu("HelpfulHint3") 
		hideSubmenu("HelpfulHint5") 
	} else if (isVisible("HelpfulHint4")) {
		showSubmenu("HelpfulHint5") 
		hideSubmenu("HelpfulHint1") 
		hideSubmenu("HelpfulHint2") 
		hideSubmenu("HelpfulHint3") 
		hideSubmenu("HelpfulHint4") 
	} else {
		showSubmenu("HelpfulHint1") 
		hideSubmenu("HelpfulHint2") 
		hideSubmenu("HelpfulHint3") 
		hideSubmenu("HelpfulHint4") 
		hideSubmenu("HelpfulHint5") 
	}
}
// utility function to show an object - accepts object name
function showSubmenu(objName)  {
tempObj=makeObj(objName)
show(tempObj)
}

// utility function to hide an object - accepts object name
function hideSubmenu(objName)  {
tempObj=makeObj(objName)
hide(tempObj)	
}

// Utility function to test the visibility property of an object - returns boolean
function isVisible(objName) {
//alert("object will be " + objName)
	tempObj=makeObj(objName)
	if (tempObj.visibility == "visible" || tempObj.visibility == "show") {
		return true
	} else if (tempObj.visibility == "hidden" || tempObj.visibility == "hide") {	
		return false
	}
alert("error in isVisible(). Visibility property of " + objName + " is " + tempObj.visibility )
return false
}

// Utility function to test the display property of an object - returns boolean
// *** WARNING display is NOT a Navigator 4 property!
function isDisplay(objName) {
alert("in isDisplay called with objName - " + objName)
	tempObj=makeObj(objName)
	if (tempObj.display == "") {
		return true
	} else if (tempObj.display == "none") {	
		return false
	}
	alert("error in isDisplay(). Display property of " + objName + " is null")
	return false
}

// Utility function sets the display of an object to empty (show it)
// *** WARNING display is NOT a Navigator 4 property!
function Display(obj) {
obj.display = ""
}

// Utility function sets the display of an object to none (hide it)
// *** WARNING display is NOT a Navigator 4 property!
function noDisplay(obj) {
obj.display = "none"
}

// Utility function sets the display of an object to empty (show it). Accepts object name as a string
// *** WARNING display is NOT a Navigator 4 property!
function DisplayStr(objName) {
	obj=makeObj(objName)
	obj.display = ""
}

// Utility function sets the display of an object to none (hide it). Accepts object name as a string
// *** WARNING display is NOT a Navigator 4 property!
function noDisplayStr(objName) {
	obj=makeObj(objName)
	obj.display = "none"
}

// Utility function to create browser neutral object (with a style level in IE)
function makeObj(objName) {
tempObj = eval(layerRef + "['" + objName + "']" + styleObj)
return tempObj
}

// Utility function to create browser neutral object (without a style level in IE)
function makeObjPlain(objName) {
tempObj = eval(layerRef + "['" + objName + "']")
return tempObj
}

// Utility function sets the visibility of an object to visible
function show(obj) {
	if (isNav) {
	obj.visibility = "show"
	} else {
	obj.visibility = "visible"
	}
}

// Utility function sets the visibility of an object to hidden
function hide(obj) {
	if (isNav) {
	obj.visibility = "hide"
	} else {
	obj.visibility = "hidden"
	}
}

// utility function to get the width of a page
function getPageWidth_name(objName) {
	obj=makeObj(objName)
	if (isNav) {
		return obj.clip.width
	} else {
		return eval("document.all."+objName+".offsetWidth")
	}
}

// Utility function sets height of object in pixels
function setObjHeight(obj) {
	if (isNav) {
		return obj.clip.height
	} else {
		return obj.pixelHeight
	}
}


//Function to open a browser window
function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

//Function opens the co-branded frameset and accepts url for bottom frame
function createCobrandWindow(bottomSite, winTitle) {
	var xpos = parseInt(((screen.width)/2) - 350);
	//var ypos = parseInt(((screen.height)/2) - 240);
	var ypos = 50;
	winFeatures = "toolbar=yes,location=yes,scrollbars=yes,personalbar=yes,statusbar=yes,resizable=yes,menubar=yes,width=700,height=480,left="+xpos+",top="+ypos
	newWindow = window.open('', 'newWin', winFeatures)
	newWindow.document.writeln("<html><head><title>"+winTitle+"</title></head>");
	newWindow.document.writeln("<frameset rows='45,*' cols='*' framespacing='0' frameborder='0'>");
	newWindow.document.writeln("<frame name='upper_fame' scrolling='NO' framespacing='0' frameborder='0' marginwidth='0' marginheight='0' noresize src='../Common_Files/cobrand_top.html'>");
	newWindow.document.writeln("<frame name='lower_frame' framespacing='0' frameborder='0' marginheight='0' src="+bottomSite+">");
	newWindow.document.writeln("</frameset>");
	newWindow.document.write("</html>")
	newWindow.document.close()

	//var bottomframe = "<html><head></head><body bgcolor='#99CCFF'><form><table width='100%'><tr><td align='center'><input type='button' value='Close Window' onClick='top.close();'></td></tr></table></form></body></html>"
	//newWindow.parent.frames[1].document.open();
	//newWindow.parent.frames[1].document.write(bottomframe);
	//newWindow.parent.frames[1].document.close();
	newWindow.focus()
}




// Jim Pankiewicz merged this with a routine from Tim Comber 
// Jim made this a function, added the Y2K compliance and converted the days to ordinals.
// variables are defined earlier as globals.
/*
function showDate() {
// Y2K Compliance!
if(myyear < 50)
	year= "20" + myyear
else
	year= "19" + myyear
	
if(myweekday == 0)
weekday = " Sunday, "      
else if(myweekday == 1)
weekday = " Monday, "
else if(myweekday == 2)
weekday = " Tuesday, "   
else if(myweekday == 3)
weekday = " Wednesday, "   
else if(myweekday == 4)
weekday = " Thursday, "
else if(myweekday == 5)
weekday = " Friday, "
else if(myweekday == 6)
weekday = " Saturday, "
if(mymonth == 0) {
month = "January "}
else if(mymonth ==1)
month = "February "
else if(mymonth ==2)
month = "March "
else if(mymonth ==3)
month = "April "
else if(mymonth ==4)
month = "May "
else if(mymonth ==5)
month = "June "
else if(mymonth ==6)
month = "July "
else if(mymonth ==7)
month = "August "
else if(mymonth ==8)
month = "September "
else if(mymonth ==9)
month = "October "
else if(mymonth ==10)
month = "November "
else if(mymonth ==11)
month = "December "
if((myday == 1)||(myday == 21)||(myday == 31))  
day = myday + "st, "
else if((myday == 2)||(myday == 22))
day = myday + "nd, "
else if((myday ==3)||(myday == 23))
day = myday + "rd, "
else 
day = myday + "th, "

document.write( weekday + month + day + year);
}

*/
//This function writes the advertising banner to the top of the screen
function writeAdBanner(AdBannerArray, isHome) {
	x = (0);
	y = ((AdBannerArray.length) - 1);
	var range = (y) - (x) + 1;
	randomString = (Math.floor(Math.random() * range) + (x));
	AdProperties = AdBannerArray[randomString].split("|");
	
	if (isHome == "yes") {
		// home page ads <div id="bannerhome"></div>
		return '<a href="'+ AdProperties[1] +'" target="'+ AdProperties[2] +'"><img src="'+ AdProperties[0] +'" width="240" height="45" border="0" alt="go"></a>';
	} else {
		return '<div id="banner1"><a href="'+ AdProperties[1] +'" target="'+ AdProperties[2] +'"><img src="'+ AdProperties[0] +'" width="600" height="35" border="0" alt="go"></a></div>';
	}
}
	

//*********************************************************************
//This set of functions handle email calls in pages like Feedback
//*********************************************************************
/*
function formSweep1(formObj) {
cleanChars(formObj);
var thisElement=""
var allElements=""
var ElementNum=0
        for (i=0; i<formObj.elements.length; i++) {
                thisElement="";

                //LOOK THROUGH TEXT FIELDS AND TEXT AREAS
                if (((formObj.elements[i].type == "text")||(formObj.elements[i].type == "textarea"))&&(formObj.elements[i].value != "")) {
                        thisElement = formObj.elements[i].name+": "+formObj.elements[i].value;
                }
                //LOOK THROUGH SELECT OBJECTS
                if (formObj.elements[i].type == "select-one") {
                        for (j=0; j<formObj.elements[i].options.length; j++) {
                                if (formObj.elements[i].options[j].selected == true) thisElement = formObj.elements[i].name+": "+formObj.elements[i].options[j].value;
                        }
                }
                //LOOK THROUGH CHECK BOXES
                if (formObj.elements[i].type == "checkbox") {
                        var checkName = formObj.elements[i].name;
                        for (j=i; formObj.elements[j].name==checkName; j++) {
                                if (formObj.elements[j].checked == true) thisElement = thisElement+", "+formObj.elements[j].value;
                        }
                if (thisElement.charAt(0) == ",") {
                        thisElement = thisElement.substring(1,thisElement.length);
                }
                if (thisElement !="") thisElement = checkName+": "+thisElement
                i=(j-1);
                }
                //LOOK THROUGH RADIO BUTTONS
                if (formObj.elements[i].type == "radio") {
                        var radioName = formObj.elements[i].name;
                        for (j=i; formObj.elements[j].name==radioName; j++) {
                                if (formObj.elements[j].checked == true) thisElement = formObj.elements[j].name+": "+formObj.elements[j].value;
                        }
                i=(j-1);
                }
                thisElement=escape(thisElement);
                if (allElements.indexOf(thisElement) == -1) {
                        allElements=allElements+"%0D%0A"+thisElement;
                }

                ElementNum++
        }

        while (allElements.substring(0, 6) == "%0D%0A") {
                if (allElements.substring(0, 6) == "%0D%0A") {
                        allElements = allElements.substring(6,allElements.length);
                }
        }
		//allElements=allElements+"<br>This is a test"
        sendMailto("mailto:"+formObj.receiver1.value+"?Subject="+formObj.SubjectLine.value+"&Body="+allElements);
}

function sendMailto(loc) {

    var doc = loc;

    // IF MAILTO URL IS EMBEDDED IN AN ANCHOR TAG
    if (doc.indexOf("HREF=") != -1) {
        // EXTRACT THE MAILTO URL FROM THE ANCHOR TAG
        var doc = doc.substring(doc.indexOf("HREF=")+6, doc.indexOf(">")-1);
    }

    // ASSIGN THE MAILTO URL TO THE DOCUMENT (THIS WILL POP UP A MAIL WINDOW)
    window.location = doc;
}

*/
function cleanChars(formObj) {
        var NastyList = new Array("%|", "<|", ">|", ";|", ":|", "\"|", "\'|", "\\|", "\/|", "  | ")
        for (i=0; i<formObj.elements.length; i++) {
                if ((formObj.elements[i].type == "text")||(formObj.elements[i].type == "textarea")) {
                        
                        //Start with first item in NastyList, replace and loop.
                        for (j=0; j<NastyList.length; j++) {
                                divide=NastyList[j].split("|")
                                while (formObj.elements[i].value.indexOf(divide[0]) >= 0) {
                                        formObj.elements[i].value = formObj.elements[i].value.replace(divide[0], divide[1]);
                                }

                        }
                        
                }
        }

}

//*********************************************************************
//End email routines
//*********************************************************************


// This array is used to build 'Seminars' state-dropdown
//*********************************************************************
/*
SeminarStateArray = new Array();
SeminarStateArray[SeminarStateArray.length] = "Alabama|Alabama"
SeminarStateArray[SeminarStateArray.length] = "Alaska|Alaska"
SeminarStateArray[SeminarStateArray.length] = "Arizona|Arizona"
SeminarStateArray[SeminarStateArray.length] = "Arkansas|Arkansas"
SeminarStateArray[SeminarStateArray.length] = "California|California"
SeminarStateArray[SeminarStateArray.length] = "Colorado|Colorado"
SeminarStateArray[SeminarStateArray.length] = "Connecticut|Connecticut"
SeminarStateArray[SeminarStateArray.length] = "Delaware|Delaware"
SeminarStateArray[SeminarStateArray.length] = "D.C.|D.C."
SeminarStateArray[SeminarStateArray.length] = "Florida|Florida"
SeminarStateArray[SeminarStateArray.length] = "Georgia|Georgia"
SeminarStateArray[SeminarStateArray.length] = "Guam|Guam"
SeminarStateArray[SeminarStateArray.length] = "Hawaii|Hawaii"
SeminarStateArray[SeminarStateArray.length] = "Idaho|Idaho"
SeminarStateArray[SeminarStateArray.length] = "Illinois|Illinois"
SeminarStateArray[SeminarStateArray.length] = "Indiana|Indiana"
SeminarStateArray[SeminarStateArray.length] = "Iowa|Iowa"
SeminarStateArray[SeminarStateArray.length] = "Kansas|Kansas"
SeminarStateArray[SeminarStateArray.length] = "Kentucky|Kentucky"
SeminarStateArray[SeminarStateArray.length] = "Louisiana|Louisiana"
SeminarStateArray[SeminarStateArray.length] = "Maine|Maine"
SeminarStateArray[SeminarStateArray.length] = "Maryland|Maryland"
SeminarStateArray[SeminarStateArray.length] = "Massachusetts|Massachusetts"
SeminarStateArray[SeminarStateArray.length] = "Michigan|Michigan"
SeminarStateArray[SeminarStateArray.length] = "Minnesota|Minnesota"
SeminarStateArray[SeminarStateArray.length] = "Mississippi|Mississippi"
SeminarStateArray[SeminarStateArray.length] = "Missouri|Missouri"
SeminarStateArray[SeminarStateArray.length] = "Montana|Montana"
SeminarStateArray[SeminarStateArray.length] = "Nebraska|Nebraska"
SeminarStateArray[SeminarStateArray.length] = "Nevada|Nevada"
SeminarStateArray[SeminarStateArray.length] = "New Hampshire|New%20Hampshire"
SeminarStateArray[SeminarStateArray.length] = "New Jersey|New%20Jersey"
SeminarStateArray[SeminarStateArray.length] = "New Mexico|New%20Mexico"
SeminarStateArray[SeminarStateArray.length] = "New York|New%20York"
SeminarStateArray[SeminarStateArray.length] = "North Carolina|North%20Carolina"
SeminarStateArray[SeminarStateArray.length] = "North Dakota|North%20Dakota"
SeminarStateArray[SeminarStateArray.length] = "Ohio|Ohio"
SeminarStateArray[SeminarStateArray.length] = "Oklahoma|Oklahoma"
SeminarStateArray[SeminarStateArray.length] = "Oregon|Oregon"
SeminarStateArray[SeminarStateArray.length] = "Pennsylvania|Pennsylvania"
SeminarStateArray[SeminarStateArray.length] = "Rhode Island|Rhode%20Island"
SeminarStateArray[SeminarStateArray.length] = "South Carolina|South%20Carolina"
SeminarStateArray[SeminarStateArray.length] = "South Dakota|South%20Dakota"
SeminarStateArray[SeminarStateArray.length] = "Tennessee|Tennessee"
SeminarStateArray[SeminarStateArray.length] = "Texas|Texas"
SeminarStateArray[SeminarStateArray.length] = "Utah|Utah"
SeminarStateArray[SeminarStateArray.length] = "Vermont|Vermont"
SeminarStateArray[SeminarStateArray.length] = "Virgin Islands|Virgin%20Islands"
SeminarStateArray[SeminarStateArray.length] = "Virginia|Virginia"
SeminarStateArray[SeminarStateArray.length] = "Washington|Washington"
SeminarStateArray[SeminarStateArray.length] = "West Virginia|West%20Virginia"
SeminarStateArray[SeminarStateArray.length] = "Wisconsin|Wisconsin"
SeminarStateArray[SeminarStateArray.length] = "Wyoming|Wyoming"
*/
//****************************************************
// This array is used for Branch Office Search State menu
//****************************************************
 BOStateArray = new Array();
 BOStateArray[BOStateArray.length] = "Alabama|AL"
 BOStateArray[BOStateArray.length] = "Alaska|AK"
 BOStateArray[BOStateArray.length] = "Arizona|AZ"
 BOStateArray[BOStateArray.length] = "Arkansas|AR"
 BOStateArray[BOStateArray.length] = "California|CA"
 BOStateArray[BOStateArray.length] = "Colorado|CO"
 BOStateArray[BOStateArray.length] = "Connecticut|CT"
 BOStateArray[BOStateArray.length] = "Delaware|DE"
 BOStateArray[BOStateArray.length] = "D.C.|DC"
 BOStateArray[BOStateArray.length] = "Florida|FL"
 BOStateArray[BOStateArray.length] = "Georgia|GA"
 BOStateArray[BOStateArray.length] = "Guam|GU"
 BOStateArray[BOStateArray.length] = "Hawaii|HI"
 BOStateArray[BOStateArray.length] = "Idaho|ID"
 BOStateArray[BOStateArray.length] = "Illinois|IL"
 BOStateArray[BOStateArray.length] = "Indiana|IN"
 BOStateArray[BOStateArray.length] = "Iowa|IA"
 BOStateArray[BOStateArray.length] = "Kansas|KS"
 BOStateArray[BOStateArray.length] = "Kentucky|KY"
 BOStateArray[BOStateArray.length] = "Louisiana|LA"
 BOStateArray[BOStateArray.length] = "Maine|ME"
 BOStateArray[BOStateArray.length] = "Maryland|MD"
 BOStateArray[BOStateArray.length] = "Massachusetts|MA"
 BOStateArray[BOStateArray.length] = "Michigan|MI"
 BOStateArray[BOStateArray.length] = "Minnesota|MN"
 BOStateArray[BOStateArray.length] = "Mississippi|MS"
 BOStateArray[BOStateArray.length] = "Missouri|MO"
 BOStateArray[BOStateArray.length] = "Montana|MT"
 BOStateArray[BOStateArray.length] = "Nebraska|NE"
 BOStateArray[BOStateArray.length] = "Nevada|NV"
 BOStateArray[BOStateArray.length] = "New Hampshire|NH"
 BOStateArray[BOStateArray.length] = "New Jersey|NJ"
 BOStateArray[BOStateArray.length] = "New Mexico|NM"
 BOStateArray[BOStateArray.length] = "New York|NY"
 BOStateArray[BOStateArray.length] = "North Carolina|NC"
 BOStateArray[BOStateArray.length] = "North Dakota|ND"
 BOStateArray[BOStateArray.length] = "Ohio|OH"
 BOStateArray[BOStateArray.length] = "Oklahoma|OK"
 BOStateArray[BOStateArray.length] = "Oregon|OR"
 BOStateArray[BOStateArray.length] = "Pennsylvania|PA"
 BOStateArray[BOStateArray.length] = "Puerto Rico|PR"
 BOStateArray[BOStateArray.length] = "Rhode Island|RI"
 BOStateArray[BOStateArray.length] = "South Carolina|SC"
 BOStateArray[BOStateArray.length] = "South Dakota|SD"
 BOStateArray[BOStateArray.length] = "Tennessee|TN"
 BOStateArray[BOStateArray.length] = "Texas|TX"
 BOStateArray[BOStateArray.length] = "Utah|UT"
 BOStateArray[BOStateArray.length] = "Vermont|VT"
 BOStateArray[BOStateArray.length] = "Virgin Islands|VI"
 BOStateArray[BOStateArray.length] = "Virginia|VA"
 BOStateArray[BOStateArray.length] = "Washington|WA"
 BOStateArray[BOStateArray.length] = "West Virginia|WV"
 BOStateArray[BOStateArray.length] = "Wisconsin|WI"
 BOStateArray[BOStateArray.length] = "Wyoming|WY"


//*******************************************************
//*******************************************************
// BEGIN BUSINESS LIFE ARTICLE FUNCTIONS
//*******************************************************
//*******************************************************
// This array is a list of all Business Life categories
// It is 'split' into two parts: Section codename|Actual Section name
// Functions in Articles Library, articleMaster.asp, and BC Home Page use this array!!
/*
var SectionNameArray = new Array();
SectionNameArray[SectionNameArray.length] = "Cash Management|svc01"
SectionNameArray[SectionNameArray.length] = "Business Financing|svc02"
SectionNameArray[SectionNameArray.length] = "Selling Your Business|svc06"
SectionNameArray[SectionNameArray.length] = "Retirement &amp; Benefits|svc03"
SectionNameArray[SectionNameArray.length] = "Business Owner Success Stories|svc05"
SectionNameArray[SectionNameArray.length] = "Business Tips and Strategies|svc04"
SectionNameArray[SectionNameArray.length] = "Women Business Owners|svc08"

*/
//returns the name of a service
function writeSectionName(section) {
	retStr = "";
	for (x=0; x<SectionNameArray.length; x++) {
		divide = SectionNameArray[x].split("|");
		if (divide[1] == section) {
			retStr = divide[0];
			break;
		}
	}
	return retStr;
}


// Call this function from document body to create generic dropdown menu
function generateMenu(menuArray, formObjname, onChangeStr, firstMenuLine) {

	//Add first line to menu options array
	MenuOptionsArray1 = new Array(firstMenuLine+"|0")
	MenuOptionsArray2 = eval(menuArray)
	MenuOptionsArray3 = MenuOptionsArray1.concat(MenuOptionsArray2)
	arrObj = new Array();
	optStr = "";
	
	for (i=0; i<MenuOptionsArray3.length; i++) {
			divide = MenuOptionsArray3[i].split("|");
			dash = (i == 0)? "":"&nbsp;-&nbsp;"
			arrObj[arrObj.length] = new Array(divide[1], dash+divide[0]); 			
	} 

	for (var i = 0; i < arrObj.length; i++) {
		optStr += "<option value=\"" + arrObj[i][0] + "\">" + arrObj[i][1] + "</option>";
	}
	return "<select name=\""+ formObjname +"\" class=\"BLALdropdown\" onChange=\"" + onChangeStr + ";\">" + optStr + "</select>";
}


//This function is called from onChange in BLife Articles dropdown menu
//It determines destination page and anchor
function goArticlesPage(formObj) {
	thisAnchor = "";
	for (i=0; i<formObj.elements['ArticleMenu'].options.length; i++) {
		if ((formObj.elements['ArticleMenu'].options[i].selected == true)&&(formObj.elements['ArticleMenu'].options[i].value != "0")) {
			thisAnchor = formObj.elements['ArticleMenu'].options[i].value;
			break;
		}
	}
	if ((thisAnchor != 0)&&(thisAnchor != "")) document.location.href="../Article_general/article_Library.asp#"+thisAnchor;
}

// ***********************************************************************
// This function reads and returns strings from the browser's Address bar
// ***********************************************************************
function getHrefVal(Val) {
	//Get user input from href and clean up
	var readThis = document.location.href;
	var startAt = Val+"="
	var startPosition = readThis.indexOf(startAt)
	var filteredEntry = ""
	if (startPosition > -1) {
		fullEntry = (readThis.substring(startPosition + startAt.length))
	
		//Look for ++(clean up multiple spaces)
		var PlusSigns = "\+\+"
		for (i=0; fullEntry.indexOf(PlusSigns) >= 0; i++) {
			fullEntry=fullEntry.replace(/\+\+/, "\+")
			}
	
		//Isolate search term(s) and convert "+" to spaces
		for (i=0; i<fullEntry.length; i++) {
			if ((fullEntry.charAt(i) == "&")||(fullEntry.charAt(i) == "#")) {
				break
			}
			if (fullEntry.charAt(i) == "+") {
				filteredEntry = (filteredEntry+" ")
			}else {
				filteredEntry = (filteredEntry+(fullEntry.charAt(i)))
			}
		}

		filteredEntry = unescape(filteredEntry)
		if (filteredEntry == "undefined") filteredEntry = "";
	}
		//alert(filteredEntry);
		return(filteredEntry);
}

//Capitalize first letter of each word
function doCapThing(input) {
	input = input.toLowerCase();
	output = "";
	splitArray = input.split(" ");
	for (cnt=0; cnt<splitArray.length; cnt++) {
		fixedWord = splitArray[cnt].substring(1, splitArray[cnt].length)
		output += splitArray[cnt].charAt(0).toUpperCase() + fixedWord + " "
	}
	return output;
}

function getRegPath(){
	//establish urls to the registration folder
	var thisServer = new String(location.host);
	var thisProtocol = location.protocol;

	//cut port out
	var thisServerUC = (thisServer.indexOf(":") > -1)? thisServer.substring(0, thisServer.indexOf(":")):(thisServer);
	thisServerUC = thisServerUC.toUpperCase();

	switch (thisServerUC) {

	case("BFSTDEV14.HEW.US.ML.COM"):
		//we are in dev
		thisProtocol = location.protocol;
	break;

	case("USBDEVS040.HEW.US.ML.COM"):
		//we are in win2k
		thisProtocol = location.protocol;
	break;

	case("USBDEVS009.HEW.US.ML.COM"):
		//we are in staging
		thisProtocol = location.protocol;
	break;

	case("WWW.ALPHABUSINESSCENTER.ML.COM"):
	case("WWW.BETABUSINESSCENTER.ML.COM"):
	case("WWW.ALPHAARCHADVANTAGE.ML.COM"):
		//we are in OTR
		thisProtocol = "https:";
	break;
	
	default:
		//default to production
		thisProtocol = "https:";
	break;

	}

	return thisProtocol + "//" + location.host + "/registration/";

}

//****************************************
// begin cookie functions
//****************************************
var today = new Date();
var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) { endstr = document.cookie.length; }
	return unescape(document.cookie.substring(offset, endstr));
	}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
			return getCookieVal (j);
			}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
		}
	return null;
	}

function DeleteCookie (name,path,domain) {
	if (GetCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
	}
//****************************************
//end cookie functions
//****************************************


//*******************************************************
// END BUSINESS LIFE ARTICLE FUNCTIONS
//*******************************************************



// ***Taken verbatim from Rubicon home.html 
// (looks like these came from Dynamic HTML by Danny Goodman - O'Reilly publishing) ***
// Utility function returns height of object in pixels
function getObjHeight(obj,x) {
	if (isNav) {
		obj.clip.height=x
	} else {
		obj.pixelHeight=x
	}
}
// Utility function to handle resizing error in Netscape
function handleResize(){
	if (isNav) {
//		location.reload(true)
	    return false
	}
}	

// Utility function returns width of object in pixels
function getObjWidth(obj) {
	if (isNav) {
		return obj.clip.width
	} else {
		return obj.pixelWidth
	}
}
// Utility function returns the x coordinate of a positionable object
// relative to the container !!!!
function getObjLeft(obj)  {
	if (isNav) {
		return obj.left
	} else {
		return obj.pixelLeft
	}
}
// Utility function returns the y coordinate of a positionable object
// relative to the container !!!!
function getObjTop(obj)  {
	if (isNav) {
		return obj.top
	} else {
		return obj.pixelTop
	}
}
// Utility function returns the available content width space in browser window
function getInsideWindowWidth() {
	if (isNav) {
		return window.innerWidth
	} else {
		return document.body.clientWidth
	}
}
// Utility function returns the available content height space in browser window
function getInsideWindowHeight() {
	if (isNav) {
		return window.innerHeight
	} else {
		return document.body.clientHeight
	}
}

// utility function returns the x cooridnate of a positionable object 
// relative to the page
function getPageLeft(obj) {
	if (isNav) {
		return obj.pageX
	} else {
		return obj.offsetLeft
	}
}

// utility function returns the y cooridnate of a positionable object 
// relative to the page
function getPageTop(obj) {
	if (isNav) {
		return obj.pageY
	} else {
		return obj.offsetTop
	}
}


// Utility function to position an element at a specific x,y location
function shiftTo(obj, x, y) {
	if (isNav) {
		obj.moveTo(x,y)
	} else {
		obj.pixelLeft = x
		obj.pixelTop = y
	}
}
// Utility function to move an object by x and/or y pixels
function shiftBy(obj, deltaX, deltaY) {
	if (isNav) {
		obj.moveBy(deltaX, deltaY)
	} else {
		obj.style.pixelLeft = deltaX + getPageLeft(obj)
		obj.style.pixelTop = deltaY + getPageTop(obj)
	}
}

// ***End library code***


// called when you pick a new menu option
function changeMenu(objPrefix)  {
	allOff()
	if (objPrefix == "prodserv") { 
		if (! isVisible("prodservOn")) {
			shiftBy(makeObjPlain("fintoolOff"),0,sizeof_prodservOn)
			shiftBy(makeObjPlain("restofmenu"),0,sizeof_fintoolOn)
			hideSubmenu("prodservOff")
			showSubmenu("prodservOn")
		} 
	} else if (objPrefix == "fintool"){
		if (! isVisible("fintoolOn")) {
			shiftBy(makeObjPlain("restofmenu"),0,sizeof_fintoolOn)
			hideSubmenu("fintoolOff")
			showSubmenu("fintoolOn")
		} 
    } 
 }


//writes the "for more info" blurb on bottom of pages
function Write4moreInfo(sect) {
	returnStr = "";
	returnStr += "For more information, view:<ul>";
	if (sect=="blx") {
		returnStr += "<li><a href=\"../Product_svc02/svc02_BLX_1.asp\" class=\"BodyLinks\">Business Loan Express</a></li>";
		returnStr += "<li><a href=\"../Product_svc02/svc02_BLX_2.asp\" class=\"BodyLinks\">SBA Loan Programs</a></li>";
		returnStr += "<li><a href=\"../Product_svc02/svc02_BLX_3.asp\" class=\"BodyLinks\">Business Loan Express Loan Criteria</a></li>";
	} else {
		returnStr += "<li><a href=\"../brochures_applications/brochures_apps.asp?section=" + sect + "&lit=brochures\" class=\"BodyLinks\">Get a Brochure</a></li>";
		returnStr += "<li><a href=\"../Contact_Us/ContactUs_lead.asp\" class=\"BodyLinks\">Contact Us</a></li>";
	}
	returnStr += "</ul>"
	return returnStr;
}


//**********************************************
// function for validating branch office search
//**********************************************
//this function is called by clicking the "Go" button
function submitBranch(formObj) {
	if (valBranch(formObj)) formObj.submit();
}


function valBranch(formObj) {
	cleanChars(formObj);
	return basicValidate(formObj, "zip", "please enter a zip code")
}


// this assumes the field is required, the reqlen is for the exact required length and is optional
function basicValidate(formObj, fieldName, errorMessage, reqlen){

	var args=basicValidate.arguments;
	if (args.length==3) {	
		if (trim(formObj[fieldName].value)=="" ) {
			alert(errorMessage);
			formObj[fieldName].focus();
			if (formObj[fieldName].type != "select-one") {
				formObj[fieldName].select();
			}
			return false;
		}
	}
	
	if (args.length == 4){
		if (isNum(args[3])) {
			if (formObj[fieldName].value=="" || formObj[fieldName].value.length != reqlen) {
				alert(errorMessage);
				formObj[fieldName].focus();
				if (formObj[fieldName].type != "select-one") {
					formObj[fieldName].select();
				}
				return false;
			}
		}else{
			if (!(eval(args[3]))) {
				alert(errorMessage);
				formObj[fieldName].focus();
				if (formObj[fieldName].type != "select-one") {
					formObj[fieldName].select();
				}
				return false;
			}
		}	
	}
return true;		
}

function emailValidate(formObj, fieldName) {

	//remove spaces from email address
	//RegExp = / /g;
	EmailVal = formObj[fieldName].value;
	//EmailVal = EmailVal.replace(RegExp, "");
	//formObj[fieldName].value = EmailVal;
	//check for "@" and "."
	if (EmailVal == "" || EmailVal.indexOf("@") < 0 || EmailVal.indexOf(".") < 0 || EmailVal.indexOf(" ")>0) {
		alert("Please enter a valid email address.");
		formObj[fieldName].focus();
		//formObj[fieldName].select();
		return false;
	} 
	else
	{
		return true;
	}

}

function checkPhoneLength(formObj,fieldName)
{
	var iCtr=0;
    var txtPhone = new String();
    txtPhone=formObj[fieldName].value;
                        
    for(i=0;i<txtPhone.length;i++)
    {
		if(isDigit(txtPhone.charAt(i))==true)
			iCtr++;
        else
        {
			formObj[fieldName].focus();
			return false;
		}	
    }
    if(iCtr < 10)
    {
		formObj[fieldName].focus();
		return false;
	}	
    else
		return true;
}
		            
function isDigit(num) 
{
	if (num.length>1){return false;}
    var str1 ="~!#$%^&*()_+}{|':;.,><?/`";
    if (str1.indexOf(num)==-1){return true;}
    return false;
}           



	
//****************************************
// BEGIN SEARCH FIELD VALIDATION FUNCTIONS
//****************************************

//this function is called by clicking the "Go" button
function submitSearch(formObj) {
	if (valSearch1(formObj)) formObj.submit();
}

//This valSearch1 function is called from the search form to validate the search field
function valSearch1(formObj) {
	formField = formObj.elements["searchField"].value;
	if (!valSearch2(formField)) {
		return false;
	} else {
		return true;
	}
}

//The valSearch1 function calls this valSearch2() function
function valSearch2(entry) {
		
	//Look for malicious SCRIPT brackets and delete them
	var lBracket = "\<"
	for (i=0; entry.indexOf(lBracket) >= 0; i++) {
		entry=entry.replace(/\</, "")
		document.searchForm.searchField.value = entry;
		}
	var rBracket = "\>"
	for (i=0; entry.indexOf(rBracket) >= 0; i++) {
		entry=entry.replace(/\>/, "")
		document.searchForm.searchField.value = entry;
		}
		
	//Clean up blank spaces at end of entry
	for (i=0; entry.charAt((entry.length)-1) == " "; i++) {
		entry = entry.substring(0,entry.length - 1);
		document.searchForm.searchField.value = entry;
		}
		
	//Make sure entry is at least 3 characters long
	if (entry.length < 3) {
		alert("Please type a word larger than two characters.");
		document.searchForm.searchField.focus();
		return false;
	}

	return true;
}
//****************************************
// END SEARCH FIELD VALIDATION FUNCTIONS
//****************************************

//This function is called for displaying popup help
function createPopupWindow(topSite, winTitle) {
	var xpos = parseInt(((screen.width)/2) - 225);
	var ypos = parseInt(((screen.height)/2) - 150);
	winFeatures = "toolbar=no,location=no,scrollbars=yes,resizable=no,menubar=yes,width=450,height=300,left="+xpos+",top="+ypos
	newWindow = window.open('', 'newWin', winFeatures)
	newWindow.document.writeln("<html><head><title>"+winTitle+"</title></head>");
	newWindow.document.writeln("<frameset rows='*,37' cols='*' frameborder='NO'>");
	newWindow.document.writeln("<frame name='upper_frame' src="+topSite+">");
	newWindow.document.writeln("<frame name='lower_fame' scrolling='NO' marginwidth='0' marginheight='0' noresize src='html/closebutton.html'>");
	newWindow.document.writeln("</frameset>");
	newWindow.document.write("</html>")
	newWindow.document.close()
	newWindow.focus()
}
function trim(str)
{
	var result = "";
	if (str)
	{
		// error if str is undefined
		result = str.replace(/^\s*|\s*$/g,"")
	}
	
	return result;
}
function isZip(s) 
{
    // Check for correct zip code
    /*
    var reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
    //reZip = new RegExp(/(^\d{5} \d{4}$)/);
    if (!reZip.test(s)) {
		alert("Please enter correct Zip Code format as 11111 or 11111-4444.");
        return false;
    }
    */
    return true;
}
