// JavaScript Document


var d,f,g,j,k,m,o,p,t,u,v,ba,bb,bc,bd,be,bj,bk,bl,bm,bn,bo,bp,bq,br,Global,sfHover;d=document;f=d.documentElement;g=d.forms;j=d.all;k=d.URL;m=d.location;o=d.images;p=d.anchors;t=d.links;u=d.embeds;v=false;ba=window;bb=true;bc=parseInt;bd=location;be=bd.pathname;bj=Array;bk=Object;bl=eval;bm=navigator;bn=bm.plugins;bo=bm.userAgent;bp=undefined;bq=unescape;br=parseFloat;Global=new bk();Global.HTML=new bk();Global.HTML.anchors=d.getElementsByTagName('a');Global.HTML.label=d.getElementsByTagName('label');Global.Status=new bk();Global.Status.windowStatus="";Global.Browser=new Browser();function GetEventSource(e){if(e&&e.target){var event=e&&e.target;while(event&&event.nodeType==3)event=event.parentNode;return(event);}if(ba&&ba.event&&ba.event.srcElement)return(ba&&ba.event&&ba.event.srcElement);return v}function GetElementById(idname){var handle;if(d.getElementById){handle=d.getElementById(idname);if(handle)return handle}if(d.getElementByName){handle=d.getElementByName(idname)[0];if(handle)return handle}handle=document[idname];if(handle)return handle;if(d.all){handle=d.all[idname];if(handle)return handle}if(d.anchors){handle=d.anchors[idname];if(handle)return handle}if(d.links){handle=d.links[idname];if(handle)return handle}if(d.images){handle=d.images[idname];if(handle)return handle}if(d.embeds){handle=d.embeds[idname];if(handle)return handle}return handle}function GetIdByElement(element){if(!(element))return bp;if(element.id)return element.id;if(element.name)return element.name;return bp}function ChangePageTitle(pageTitle){if(d.title.readOnly==bb)d.title=pageTitle}function GetCurrentFileName(){var URL=bq(bd.pathname);var start=URL.lastIndexOf("/")+1;var end=(URL.indexOf("?")>0)?URL.indexOf("?"):URL.length;return(URL.substring(start,end));}function GetCurrentFilePath(){var URL=bq(bd.pathname);var start=URL.lastIndexOf("/");return(URL.substring(0,start));}function GetCurrentDirectory(){var filePath=GetCurrentFilePath();var directories=filePath.split("/");return directories.length&&directories[directories.length-1]!=""?directories[directories.length-1]:""}function IsRootDirectory(directory){return directory.toLowerCase()==GetRootDirectory().toLowerCase()?bb:v}function IsDefaultFile(){var fileName=typeof(IsDefaultFile.arguments[0])!='undefined'?IsDefaultFile.arguments[0]:GetCurrentFileName();if(fileName=="")return bb;var fileNameList=GetDefaultFile();if(bl('typeof(fileNameList)')=='object'){for(var fileNameListIndex=0;fileNameListIndex<fileNameList.length;fileNameListIndex++)if((fileName==fileNameList[fileNameListIndex]))return bb}return v}function GetDefaultFile(){if(typeof(defaultFileList)=='undefined')return"";else return defaultFileList.split(",");}function OnMouseOverHandler(e){e=(e)?e:((ba.event)?ba.event:"");if(e){var eventsource=GetEventSource(e);if(bl('typeof(MenuTriggers)')!='undefined'){typeOfEventSource=typeof(MenuTriggers[eventsource.id]);if(typeOfEventSource!='undefined')MenuPopUp(e);}else if(bl('typeof(Global.Rollover.triggers)')!='undefined'){typeOfEventSource=typeof(Global.Rollover.triggers[eventsource.id]);if(typeOfEventSource!='undefined')RORollover(e);}SetWindowStatus();}return bb}function OnMouseOutHandler(e){e=(e)?e:((ba.event)?ba.event:"");if(e){var eventsource=GetEventSource(e);if(bl('typeof(MenuTriggers)')!='undefined'){typeOfEventSource=typeof(MenuTriggers[eventsource.id]);if(typeOfEventSource!='undefined')MenuPopDown(e);}else if(bl('typeof(Global.Rollover.triggers)')){typeOfEventSource=typeof(Global.Rollover.triggers[eventsource.id]);if(typeOfEventSource!='undefined')RORollout(e);}}return bb}function SetWindowStatus(){if(SetWindowStatus.arguments.length==0){if(typeof(Global.Status.windowStatus)!='undefined'&&Global.Status.windowStatus!=""){ba.status=Global.Status.windowStatus;Global.Status.windowStatus=""}}else ba.status=SetWindowStatus.arguments[0];return bb}function GetRootDirectory(){if(typeof(rootDirectory)=='undefined')return"";else return rootDirectory}function getElementsByClass(name){var all=d.all?d.all:d.getElementsByTagName('*');var elements=new bj();for(var e=0;e<all.length;e++){if((name!='')&&(all[e].className.indexOf(name)>=0))elements[elements.length]=all[e]}return elements}function getURLParam(name,defaultVal){var paramVal=defaultVal;var regex=new RegExp("\&"+name+"\=([^$\&]+)","i");if(d.URL.indexOf('?')!=-1){var qString='&'+d.URL.substring((d.URL.indexOf('?')+1),d.URL.length);var urlMatches=qString.match(regex);if((urlMatches!=null)&&(urlMatches.length==2))paramVal=urlMatches[1]}return paramVal}Global.OnChange=new bk;Global.OnChange.linkType=new bj();function OnChangeHandler(e){var formElement;e=(e)?e:((ba.event)?ba.event:"");if(e){var eventsource=GetEventSource(e);for(formIndex=0;formIndex<d.forms.length;formIndex++){formElement=d.forms[formIndex];for(elementIndex=0;elementIndex<formElement.elements.length;elementIndex++){if(eventsource.name==formElement.elements[elementIndex].name){if(Global.OnChange.linkType[eventsource.id]=="anchor"&&formElement.elements[elementIndex].value!="")bd=formElement.action+"#"+formElement.elements[elementIndex].value;else if(Global.OnChange.linkType[eventsource.id]=="page"&&formElement.elements[elementIndex].value!="")bd=formElement.elements[elementIndex].value}}}}return bb}function OnChangeInit(){if(OnChangeInit.arguments.length!=2)return v;if(d.getElementById){var trigger=d.getElementById(OnChangeInit.arguments[0]);if(trigger){Global.OnChange.linkType[trigger.id]=OnChangeInit.arguments[1];trigger.onchange=OnChangeHandler}}return bb}var rot13map;function rot13init(){var map=new bj();var s="abcdefghijklmnopqrstuvwxyz";for(i=0;i<s.length;i++)map[s.charAt(i)]=s.charAt((i+13)%26);for(i=0;i<s.length;i++)map[s.charAt(i).toUpperCase()]=s.charAt((i+13)%26).toUpperCase();return map}function rot13(a){if(!rot13map)rot13map=rot13init();var s="";for(i=0;i<a.length;i++){var b=a.charAt(i);s+=(b>='A'&&b<='Z'||b>='a'&&b<='z'?rot13map[b]:b);}return s}function print_e(user,domain){var e=rot13(user)+"@"+rot13(domain);var out='<a href="mailto:'+e+'">';out+=e;out+='</a>';d.write(out);}function getQueryParamValue(param){var q=m.search;var detectIndex=q.indexOf(param);if(q.length>1&&detectIndex!=-1){return q.substring(q.indexOf("=",detectIndex)+1,q.indexOf("&",detectIndex));}else{return bb}}function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,bb);return bb}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r}else{return v}}function Browser(){var ua,s,i;this.isIE=v;this.isNS=v;this.version=null;ua=bm.userAgent;s="MSIE";if((i=ua.indexOf(s))>=0){this.isIE=bb;this.version=br(ua.substr(i+s.length));return}s="Netscape6/";if((i=ua.indexOf(s))>=0){this.isNS=bb;this.version=br(ua.substr(i+s.length));return}s="Gecko";if((i=ua.indexOf(s))>=0){this.isNS=bb;this.version=6.1;return}}function BrowserDetection(file){if(arguments.length!=1)return v;var browserUpgradeFile=file;var currentFileName=GetCurrentFileName();if(!d.getElementById&&(browserUpgradeFile.indexOf(currentFileName)=="-1"||currentFileName==""))bd.replace(GetRootDirectory()+'/'+browserUpgradeFile);var a=navigator.userAgent.indexOf("Netscape6");if (a != -1)location.replace(GetRootDirectory()+'/'+browserUpgradeFile);}function popupWindow(){if(popupWindow.arguments.length<1)return v;var popupWin=null;popupWin=ba.open(popupWindow.arguments[0],popupWindow.arguments[1],popupWindow.arguments[2]);}function GetWindowSize(style){var size=400;if(style=="width"){if(typeof(ba.innerWidth)=='number')size=ba.innerWidth;else if(d.documentElement&&(d.documentElement.clientWidth||d.documentElement.clientHeight))size=d.documentElement.clientWidth;else if(d.body&&d.body.clientWidth)size=d.body.clientWidth}else if(style=="height"){if(typeof(ba.innerWidth)=='number')size=ba.innerHeight;else if(d.documentElement&&(d.documentElement.clientWidth||d.documentElement.clientHeight))size=d.documentElement.clientHeight;else if(d.body&&d.body.clientHeight)size=d.body.clientHeight}return size}function AnchorPopupWindows(){if(!d.getElementsByTagName)return;var anchors=Global.HTML.anchors;var currentAnchor;for(var anchorIndex=0;anchorIndex<anchors.length;anchorIndex++){var targetLink,relArray,relInformation,windowAttributes,javascriptTargetLink,windowName;var bd,menubar,resizable,scrollbars,status,toolbar;var width,height,windowType,windowName;currentAnchor=anchors[anchorIndex];targetLink=currentAnchor.getAttribute("href");relInformation=currentAnchor.getAttribute("rel");if(relInformation&&targetLink){relArray=relInformation.split("|");if(relArray[0]=="popup"&&relArray.length>=4){if(relArray[1]!="null")width=bc(relArray[1])?bc(relArray[1]):400;else width=GetWindowSize("width");if(relArray[2]!="null")height=bc(relArray[2])?bc(relArray[2]):400;else height=GetWindowSize("height");windowType=relArray[3];windowAttributes="width="+width+",height="+height;if(windowType=="custom"){if(relArray.length<10)return v;bd=bc(relArray[4])?bc(relArray[4]):0;menubar=bc(relArray[5])?bc(relArray[5]):0;resizable=bc(relArray[6])?bc(relArray[6]):0;scrollbars=bc(relArray[7])?bc(relArray[7]):0;status=bc(relArray[8])?bc(relArray[8]):0;toolbar=bc(relArray[9])?bc(relArray[9]):0;if(relArray.length==11)windowName=relArray[10];else windowName="popupWindow";windowAttributes+=",location="+bd+",menubar="+menubar+",resizable="+resizable+",scrollbars="+scrollbars+",status="+status+",toolbar="+toolbar}else{if(relArray.length==5)windowName=relArray[4];else windowName="popupWindow";if(windowType=="standard")windowAttributes+=",location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0";else if(windowType=="resize")windowAttributes+=",location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0";else if(windowType=="scrollbar")windowAttributes+=",location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0";else if(windowType=="blank")windowAttributes="";else return v}javascriptTargetLink="javascript:popupWindow('"+targetLink+"','"+windowName+"','"+windowAttributes+"');";currentAnchor.setAttribute("href",javascriptTargetLink);}}}}

function cleartext()
{
	if(document.estimator.amount.value == 'Enter Amount'){
		document.estimator.amount.value = '';
	}
	else if(document.estimator.amount.value == ''){
		document.estimator.amount.value = 'Enter Amount';
	}
}

function Timer(){
    this.obj = (arguments.length)?arguments[0]:window;
    return this;
}

// The set functions should be called with:
// - The name of the object method (as a string) (required)
// - The millisecond delay (required)
// - Any number of extra arguments, which will all be
//   passed to the method when it is evaluated.

Timer.prototype.setInterval = function(func, msec){
    var i = Timer.getNew();
    var t = Timer.buildCall(this.obj, i, arguments);
    Timer.set[i].timer = window.setInterval(t,msec);
    return i;
}
Timer.prototype.setTimeout = function(func, msec){
    var i = Timer.getNew();
    Timer.buildCall(this.obj, i, arguments);
    Timer.set[i].timer = window.setTimeout("Timer.callOnce("+i+");",msec);
    return i;
}

// The clear functions should be called with
// the return value from the equivalent set function.

Timer.prototype.clearInterval = function(i){
    if(!Timer.set[i]) return;
    window.clearInterval(Timer.set[i].timer);
    Timer.set[i] = null;
}
Timer.prototype.clearTimeout = function(i){
    if(!Timer.set[i]) return;
    window.clearTimeout(Timer.set[i].timer);
    Timer.set[i] = null;
}

// Private data

Timer.set = new Array();
Timer.buildCall = function(obj, i, args){
    var t = "";
    Timer.set[i] = new Array();
    if(obj != window){
        Timer.set[i].obj = obj;
        t = "Timer.set["+i+"].obj.";
    }
    t += args[0]+"(";
    if(args.length > 2){
        Timer.set[i][0] = args[2];
        t += "Timer.set["+i+"][0]";
        for(var j=1; (j+2)<args.length; j++){
            Timer.set[i][j] = args[j+2];
            t += ", Timer.set["+i+"]["+j+"]";
    }}
    t += ");";
    Timer.set[i].call = t;
    return t;
}
Timer.callOnce = function(i){
    if(!Timer.set[i]) return;
    eval(Timer.set[i].call);
    Timer.set[i] = null;
}
Timer.getNew = function(){
    var i = 0;
    while(Timer.set[i]) i++;
    return i;
}

sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.timer = new Timer(this);
			this.timer.setTimeout("out",500);
		}
		sfEls[i].out=function() {
			this.className=this.className.replace(new RegExp("\\bsfhover\\b"), "");
		}
	}
}
if (window.addEventListener) window.addEventListener( "load", sfHover, false );
if (window.attachEvent) window.attachEvent("onload", sfHover);

/*******************************************************************
* JavaScript/CSS Font Size Changer (Persistent Between Pages)
* (c) DB Design, All rights are reserved
* http://phpscriptindex.com, phpsales@gmail.com
********************************************************************
* Script will allow user to visually change font size. Font size 
* will persist thru page change using a cookie.
********************************************************************
* Directions: Change fontElementId var to the element id you wish to
* allow users to change font sizes. 
********************************************************************
* Tip: Next span element inside normal div to inherit parent style
* but enable use to change font size.
*******************************************************************
* FireFox 2.0.0.3 Tested
* MS IE 7 Tested
* Netscape 8.1.2 Tested
* Opera 9.1 Tested
******************************************************************/

var fontElementId = "subpage"; //CHANGE ME TO YOUR ELEMENT ID

//DO NOT MODIFY BELOW

/* Module Change Font (string) */
function changeFont(fontClass){
	var element = document.getElementById(fontElementId);
	element.className = fontClass;
	setCookie("fontSize", fontClass, 5);
}		

/* Module Set Default Font Size (void) */
function setDefaultFontSize(){
	var fontSize = getCookie("fontSize")
	if(fontSize){
		var element = document.getElementById(fontElementId);
		element.className = fontSize;
	}
}

function killCookie(){
	if(getCookie("fontSize")){
		document.cookie="fontSize=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
	}
}

/* Module Set Cookie (string, string, int) -- http://www.w3schools.com/js/js_cookies.asp */
function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
/* Module Get Cookie (string) -- http://www.w3schools.com/js/js_cookies.asp */
function getCookie(c_name){
	if(document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){ 
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return false;
}

// Browser Slide-Show script.
// With image cross fade effect for those browsers that support it.
// Script copyright (c) 2004-2006 www.cryer.co.uk.
// Script is free to use provided this copyright header is included.
var slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,displaySecs)
{
 var imageSeparator = imageFiles.indexOf(";");
 var nextImage = imageFiles.substring(0,imageSeparator);
 if (document.all)
 {
  document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
  document.getElementById(pictureName).filters.blendTrans.Apply();
 }
 document.getElementById(pictureName).src = nextImage;
 if (document.all)
 {
  document.getElementById(pictureName).filters.blendTrans.Play();
 }
 var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
  + ';' + nextImage;
 setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
  displaySecs*1000);
 // Cache the next image to improve performance.
 imageSeparator = futureImages.indexOf(";");
 nextImage = futureImages.substring(0,imageSeparator);
 if (slideCache[nextImage] == null) {
  slideCache[nextImage] = new Image;
  slideCache[nextImage].src = nextImage;
 }
}

/*******************************************************************
* Directions: call pollResultsWindow(x, y) on page where 
* x = window width &
* y = window height
******************************************************************/
function pollResultsWindow(width, height)
{
	var winWidth = width;
	var winHeight = height;
	for(var i=0; i<document.pollform.answer.length; i++)
	{
		if(document.pollform.answer[i].checked)
		{
			window.open('','pollwindow','width='+winWidth+',height='+winHeight+',left=0,top=0')
			return true;
		}
	}
	alert("Please select an answer");
	return false;
}

/*******************************************************************
* Used for headers with js rollovers in sponsored content sections -- not worth adding them to main site style sheet.
* This script free from The JavaScript Source!! http://javascript.internet.com
******************************************************************/
function movepic(img_name,img_src) {
document[img_name].src=img_src;
}

/*******************************************************************
* Directions: call openNewwindow(val, x, y) on page where 
* val = url to open in new window
* x = window width &
* y = window height
******************************************************************/
function openNewwindow(val, width, height)
{
	var winWidth = width;
	var winHeight = height;
	var winFeatures = 'width='+winWidth+',height='+winHeight+',scrollbars=no,menubar=no,toolbar=no,addressbar=no,resizable=yes';
 	win = open(val,'SIDE'+winWidth+'x'+winHeight+'Newwindow',winFeatures);
 	if (parseInt(navigator.appVersion) == 2 && (navigator.appVersion.indexOf('Mac') != -1)){
		win = open(val,'SIDE'+winWidth+'x'+winHeight+'Newwindow',winFeatures)
	}
	if (!(self.opener)){
		win.opener = top.self;
	}
}

/*******************************************************************
* Class creation for ColorBox links
******************************************************************

	$(document).ready(function(){
		$(".videoPage").colorbox({innerWidth:"818", innerHeight:"509", iframe:true});
		$(".mailPage").colorbox({innerWidth:"450", innerHeight:"471", scrolling: false, iframe:true});
		$(".clDiscomfort").colorbox({innerWidth:"750", innerHeight:"450", iframe:true});		
		$('a.colorbox').colorbox();
	});/
	

/***************************************************************
*** FORM CHECKER FOR CARECREDIT GUIDE ORDER FORM
***************************************************************/

function lead_gen_widget_post() {
	var fn = document.getElementById('FIRST_NAME');
	var ln = document.getElementById('LAST_NAME');
	var ea = document.getElementById('EMAIL_ADDRESS');
	var zc = document.getElementById('ZIP_CODE');

	if (!fn.value || fn.value == "First Name") {
		fn.focus();
		alert('Please enter a first name.');
		return false;
	}
	if (!ln.value || ln.value == "Last Name") {
		ln.focus();
		alert('Please enter a last name.');
		return false;
	}
	if (!ea.value || ea.value == "Email Address") {
		ea.focus();
		alert('Please enter an email address.');
		return false;
	}
	if (!zc.value || zc.value == "Zip") {
		zc.focus();
		alert('Please enter a zipcode.');
		return false;
	}
	return true;
}
