function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function KW_autoClear(obj,def){
	if (obj.value==def) obj.value=""
}

function subscribe_form(id) {
var el = document.getElementById(id).style; 
if(el.display == "none") {
el.display = "";
document.getElementById("mprofocus").focus();
}
}
function killsubscriptionbox(id){
var elk = document.getElementById(id).style; 
if(elk.display == "") { 
elk.display = "none";
}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/*
ShadowValidation
----------------

Generic Form Validation.
To activate this validation, add attributes to your form elements.
Attribute "validate" defines what type of validation you want.
Possible values for "validate" attribute:
	"not_empty" - element can't be empty.
	"integer" - element must have integer value.
	"number" - element must have numeric value.
	"email" - element value must be valid email address.
	"alphabet" - element value must consist only of given alphabet list in allow_only attribute.
			you can give ranges using ".." in the allow_only attribute.
	[function name] - vaidate using your own function. see below for more details.
You can join more than one validation type by using the "|" character.
For example:
	<input type="text" name="myinput" validate="not_empty|number" />
	will force not empty and numeric value.
Example for alphabet validation:
	<input type="text" name="myinput" validate="not_empty|alphabet" allow_only="a..zA..Z0..9" />
	will force not empty value that contains only english letters or digits.
Attribute "msg" defines the message to display when validation fails.
For example:
	<input type="text" name="myinput" validate="not_empty|number" msg="please enter value|invalid value" />
	will show "please enter value" if value is empty and "invalid value" if not numeric.
By default, the message will appear next to the form element.
You can have the message appear as alert dialog by adding show_alert attribute to the form.
For example:
	<form show_alert="1" onsubmit="return Validate(this);">
	will show the messages as alerts.
Attribute "error_container" defines where the message will appear in case of invalid input.
You must have corresponding <span> or <div> tag with that exact ID in the page. If this
attribute is missing, the message will appear after the input element.
For example:
	<input type="radio" name="gender" value="M" validate="not_empty" msg="please select gender" error_container="GenderErrorContainer" />
	and then have such code after the radio buttons:
	<span id="GenderErrorContainer"></span>
Advanced:
	You can use your own function to validate the data.
	For this, write the function name as the value of "validate" attribute.
	For example:
		<input type="text" name="myinput" validate="MyValidate" />
	The function must get the form element as its parameter and return true if valid or false otherwise.


Written by:
	© Shadow Wizard, 2006

*/

function Validate(objForm) {
	var arrValidated=new Array();
	
	for (var i=0; i<objForm.elements.length; i++) {
		var element=objForm.elements[i];
		var elName=element.name;
		if ((!elName)||(elName.length == 0)||(arrValidated[elName]))
			continue;
		arrValidated[elName] = true;
		var validationType = element.getAttribute("validate");
		if ((!validationType)||(validationType.length == 0))
			continue;
		var strMessages=element.getAttribute("msg");
		if (!strMessages)
			strMessages = "";
		var arrMessages = strMessages.split("|");
		var arrValidationTypes = validationType.split("|");		
		for (var j=0; j<arrValidationTypes.length; j++) {
			var curValidationType = arrValidationTypes[j];
			var blnValid=true;
			switch (curValidationType) {
				case "not_empty":
					blnValid = ValidateNotEmpty(element);
					break;
				case "integer":
					blnValid = ValidateInteger(element);
					break;
				case "number":
					blnValid = ValidateNumber(element);
					break;
				case "email":
					blnValid = ValidateEmail(element);
					break;
				case "alphabet":
					blnValid = ValidateAlphaBet(element);
					break;
				default:
					try {
						blnValid = eval(curValidationType+"(element)");
					}
					catch (ex) {
						blnValid = true;
					}
			}
			if (blnValid == false) {
				var message="invalid value for "+element.name;
				if ((j < arrMessages.length)&&(arrMessages[j].length > 0))
					message = arrMessages[j];
				InsertError(element, message);
				if ((typeof element.focus == "function")||(element.focus)) {
					element.focus();
				}
				return false;
			}
			else
				ClearError(element);
		}
		
	}
	
	return true;
}

function ValidateNotEmpty(objElement) {
	var strValue = GetElementValue(objElement);
	return (strValue.length > 0);
}

function ValidateInteger(objElement) {
	var strValue = GetElementValue(objElement);
	return (!isNaN(parseInt(strValue)));
}

function ValidateNumber(objElement) {
	var strValue = GetElementValue(objElement);
	return (!isNaN(parseFloat(strValue)));
}

function ValidateEmail(objElement) {
	var strValue = GetElementValue(objElement);
	if (strValue.length < 5)
		return false;
	var arrTemp=strValue.split("@");
	if (arrTemp.length != 2)
		return false;
	var strLeftPart = arrTemp[0];
	var strRightPart = arrTemp[1];
	if ((strLeftPart.length == 0)||(strRightPart.length == 0))
		return false;
	arrTemp = strRightPart.split(".");
	if (arrTemp.length < 2)
		return false;
	for (var i=0; i<arrTemp.length; i++) {
		if (arrTemp[i].length == 0)
			return false;
	}
	return true;
}

function ValidateAlphaBet(objElement) {
	var strValue = GetElementValue(objElement);
	
	if (strValue.length == 0)
		return true;
	
	var strAllowOnly = objElement.getAttribute("allow_only");
	if (!strAllowOnly)
		strAllowOnly = "";
	
	if (strAllowOnly.length == 0)
		return true;
	
	var i=0;
	var arrAllowedChars=new Array();
	while (i < strAllowOnly.length) {
		if ((i < (strAllowOnly.length-2)) && (strAllowOnly.substr(i+1, 2) == "..")) {
			for (var j=strAllowOnly.charCodeAt(i); j<=strAllowOnly.charCodeAt(i+3); j++) {
				arrAllowedChars[arrAllowedChars.length] = String.fromCharCode(j);
			}
			i += (2*2);
			continue;
		}
		arrAllowedChars[arrAllowedChars.length] = strAllowOnly.charAt(i)+"";
		i++;
	}
	
	for (var i=0; i<strValue.length; i++)
		if (InArray(arrAllowedChars, strValue.substr(i, 1)) < 0)
			return false;
	
	return true;
}

function GetElementValue(objElement) {
	var result="";
	switch (objElement.type) {
		case "text":
		case "hidden":
		case "textarea":
		case "password":
			result = objElement.value;
			break;
		case "select-one":
		case "select":
			if (objElement.selectedIndex >= 0)
				result = objElement.options[objElement.selectedIndex].value;
			break;
		case "radio":
		case "checkbox":
			for (var i=0; i<objElement.form.elements.length; i++) {
				if (objElement.form.elements[i].name == objElement.name) {
					if (objElement.form.elements[i].checked)
						result += objElement.form.elements[i].value+",";
				}
			}
			break;
	}
	return result;
}

function InsertError(element, strMessage) {
	if ((element.form.getAttribute("show_alert")) && (element.form.getAttribute("show_alert") != "0")) {
		alert(strMessage);
		return;
	}
	
	var strSpanID = GetErrorContainerID(element);
	var objSpan = document.getElementById(strSpanID);
	if (!objSpan) {
		if ((element.type == "radio")||(element.type == "checkbox")) {
			for (var i=0; i<element.form.elements.length; i++) {
				if (element.form.elements[i].name == element.name) {
					element = element.form.elements[i];
				}
			}
		}
		objSpan = document.createElement("span");
		objSpan.id = strSpanID;
		var nodeAfter=0;
		var nodeParent = element.parentNode;
		for (var i=0; i<nodeParent.childNodes.length; i++) {
			if (nodeParent.childNodes[i] == element) {
				if (i < (nodeParent.childNodes.length-1))
					nodeAfter = nodeParent.childNodes[i+1];
				break;
			}
		}
		if ((!nodeAfter)&&(nodeParent.parentNode)) {
			nodeParent = nodeParent.parentNode;
			for (var i=0; i<nodeParent.childNodes.length; i++) {
				if (nodeParent.childNodes[i] == element.parentNode) {
					if (i < (nodeParent.childNodes.length-1))
						nodeAfter = nodeParent.childNodes[i+1];
					break;
				}
			}
		}
		if (nodeAfter)
			nodeParent.insertBefore(objSpan, nodeAfter);
		else
			document.body.appendChild(objSpan);
	}
	if (objSpan.className.length == 0)
		objSpan.className = "validation_error";
	objSpan.innerHTML = strMessage;
}

function ClearError(element) {
	var strSpanID = GetErrorContainerID(element);
	var objSpan = document.getElementById(strSpanID);
	if (objSpan) {
		objSpan.innerHTML = "";
	}
}

function GetErrorContainerID(element) {
	var strSpanID = element.getAttribute("error_container");
	if (!strSpanID || strSpanID.length == 0) {
		strSpanID = element.name+"_val_error";
	}
	return strSpanID;
}

function InArray(arr, key) {
	for (var i=0; i<arr.length; i++) {
		if (arr[i] == key) {
			return i;
		}
	}
	return -1;
}

var dtCh= "/";
var now = new Date;
var maxYear=now.getYear();
var minYear=maxYear-15;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function validateForm(bdayfield){
	if (isDate(bdayfield.value)==false){
		bdayfield.focus();
		return false;
	}
    	return true
}

function submitDate(){
	{
		document.frmAge.RunningCount.value=1;
		document.frmAge.submit();
	}
}

/***********************************************
* Cool DHTML tooltip script II- © 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
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip


function toggleMe(obj, a){
  var e=document.getElementById(a);
  if(!e)return true;
    e.style.display="block"
  return true;
}

function toggleMe2(obj, a){
  var e=document.getElementById(a);
  if(!e)return true;
    e.style.display="none"
  return true;
}

<!-- Copyright 2003 Bontrager Connection, LLC  WIGET COUNTER
function CurrencyFormatted(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = '0.00'; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
if(isNaN(i)) { return '0.00'; }
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
s = minus + s;
return s;
} // function CurrencyFormatted()

function CommaFormatted(n)
{
var amount = new String(n);
var delimiter = ",";
var a = new Array(2);
if(amount.indexOf('.') > -0) { a = amount.split('.',2); }
else { a[0] = amount; a[1] = ''; }
var d = a[1];
var i = parseInt(a[0]);
if(isNaN(i)) { return ''; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
var n = new String(i);
var a = [];
while(n.length > 3)
{
	var nn = n.substr(n.length-3);
	a.unshift(nn);
	n = n.substr(0,n.length-3);
}
if(n.length > 0) { a.unshift(n); }
n = a.join(delimiter);
if(d.length < 1) { amount = n; }
else { amount = n + '.' + d; }
amount = minus + amount;
return amount;
} // function CommaFormatted()

function FormatNumber(n) {
n = CurrencyFormatted(n);
if(n >= 1000) { n = CommaFormatted(n); }
return n;
} // function FormatNumber()

function NumberOfWidgetsCheckboxesChecked() {
var numberChecked = 0;
for (var i=0; i<document.register.campdates.length; i++) {
	if(document.register.campdates[i].checked) {
		numberChecked++;
		}
	}
return numberChecked;
} // function NumberOfWidgetsCheckboxesChecked()

function CalcProductTotal(n)
{
if(n <= 0) { return 0; }

var multiplier = document.register.PriceEach.value;
if(n <= 7)
return multiplier * n ;
if(n <= 15)
return (multiplier-4) * n ;
if(n >= 16)
return (multiplier-8) * n ;
} // function CalcProductTotal()

function CalcTotalOrder()
{
var number   = NumberOfWidgetsCheckboxesChecked();
var product  = CalcProductTotal(number);
if(number >= 1000) { number = CommaFormatted(number); }
product  = FormatNumber(product);
document.register.HowManyWidgets.value = number;
document.register.ProductTotal.value   = product;
} // function CalcTotalOrder()
//-->
