<!-- Preload imageswaps

// 

document.open(FrameScripting());

var Pic = new Array
Pic[0] = '../../images/nav/home_off.gif'
Pic[1] = '../../images/nav/home_over.gif'
Pic[2] = '../../images/nav/home2_over.gif'
Pic[3] = '../../images/nav/faq_off.gif'
Pic[4] = '../../images/nav/faq_over.gif'
Pic[5] = '../../images/nav/contact_off.gif'
Pic[6] = '../../images/nav/contact_over.gif'
Pic[7] = '../../images/nav/global/myacct_off.gif'
Pic[8] = '../../images/nav/global/myacct_over.gif'
Pic[9] = '../../images/nav/global/signup_off.gif'
Pic[10] = '../../images/nav/global/signup_over.gif'
Pic[11] = '../../images/nav/global/about_off.gif'
Pic[12] = '../../images/nav/global/about_over.gif'
Pic[13] = '../../images/nav/global/bridge_off.gif'
Pic[14] = '../../images/nav/global/bridge_over.gif'
Pic[15] = '../../images/nav/global/violation_off.gif'
Pic[16] = '../../images/nav/global/violation_over.gif'
Pic[17] = '../../images/nav/global/forms_off.gif'
Pic[18] = '../../images/nav/global/forms_over.gif'
Pic[19] = '../../images/nav/global/related_off.gif'
Pic[20] = '../../images/nav/global/related_over.gif'

var p = Pic.length
var preLoad = new Array()
var i = 0;
for (i = 0; i < p; i++){
     preLoad[i] = new Image()
     preLoad[i].src = Pic[i]
}

function switchImage(whichImage,imageNumber,state){
   if (state){
      document.images[whichImage].src = preLoad[imageNumber].src
   }
}

function IsBlank(iField) {
	// Returns true if field value is
	// null, 0 length, or only whitespace

	var tWhitespace = " \t\n\r";

	tIsBlank = true;

	if ((iField.value == null) || (iField.value.length == 0)) {
		tIsBlank = true;
	}
	else {
		var tCounter;
		for (tCounter = 0; (tCounter < iField.value.length)
				&& (tIsBlank == true); tCounter++) {
			var tCurrentChar = iField.value.charAt(tCounter);

			if (tWhitespace.indexOf(tCurrentChar) == -1) {
				tIsBlank = false;
			} //end if
		} //end for
	} //end else

	return tIsBlank;

} //end IsBlank()


function IsNonNumeric(iField) {
	tIsNonNumeric = false;
	if ((iField.value == null) || (iField.value.length == 0)) {
		tIsNonNumeric = false;
	}
	else {
		var tCounter;
		for (tCounter = 0; (tCounter < iField.value.length)
				&& (tIsNonNumeric == false); tCounter++) {
			var tCurrentCharCode = iField.value.charCodeAt(tCounter);
			if ( (tCurrentCharCode < 48) || (tCurrentCharCode > 57) ){
				tIsNonNumeric = true;
			} 
		} 
	} 
	return tIsNonNumeric;
} 


function listCCExpirationYear() {
	var curYear = (new Date()).getYear();
	if (navigator.appName == 'Netscape') curYear = 1900 + curYear;

	for (i = curYear; i < curYear + 10; i++) {
              document.write("<option value=\"" + i + "\"");
	      document.write(">" + i + "</option>");
	}
}
function listCCExpirationMonth() {
	for (i = 1; i <= 12; i++) {
 	      if (i < 10 )
              	document.write("<option value=\"0" + i + "\"");
	      else
              	document.write("<option value=\"" + i + "\"");
	      if (i < 10 )
	      	document.write("> 0" + i + "</option>");
	      else
		document.write(">" + i + "</option>");
	}
}

function ValidateCreditCard(iCreditCardPayTypeValue, iCreditCardPayType, iCreditCardNumber)
{

	if (typeof iCreditCardPayTypeValue == 'object') {
            var tPayType = iCreditCardPayTypeValue.value;
      } else {
           var tPayType = iCreditCardPayTypeValue;
      }

	var tCreditCardFirstDigit = iCreditCardNumber.value.substring(0, 1);
	var tCardNoLength = iCreditCardNumber.value.length;
	var tValid = false;

	if (tPayType == "0") {
		var tPayTypeIndex = iCreditCardPayType.selectedIndex;
		tPayType = iCreditCardPayType[tPayTypeIndex].value;
	}

	if (tCreditCardFirstDigit == "*") { // masked
			tValid = true;
	} else if (tPayType == "4") {	// for VISA
		if ((tCreditCardFirstDigit == "4") && ((tCardNoLength == 13) || (tCardNoLength == 16))) {
			tValid = true;
		}
	} else if (tPayType == "2")	{ // for MC
		if ((tCreditCardFirstDigit == "5") && (tCardNoLength == 16)) {
			tValid = true;
		}
	} else if (tPayType == "7")	{ // for AMEX
		if ((tCreditCardFirstDigit == "3") && (tCardNoLength == 15)) {
			tValid = true;
		}
	} else if (tPayType == "8")	{ // for Discover
		if ((tCreditCardFirstDigit == "6") && (tCardNoLength == 16)) {
			tValid = true;
		}
	}

	if (tValid == false) {
		alert ('Invalid Credit Card Number');
		iCreditCardNumber.focus();
	}

	return tValid;
}

function ValidateCreditCardNumber(iCreditCardPayTypeValue, iCreditCardPayType, iCreditCardNumber)
{
	var tPayType = iCreditCardPayTypeValue;
	var tCreditCardFirstDigit = iCreditCardNumber.value.substring(0, 1);
	var tCardNoLength = iCreditCardNumber.value.length;
	var tValid = false;

	if (tPayType == "0") {
		var tPayTypeIndex = iCreditCardPayType.selectedIndex;
		tPayType = iCreditCardPayType[tPayTypeIndex].value;
	}

	if (tCreditCardFirstDigit == "*") { // masked
			tValid = true;
	} else if (tPayType == "4") {	// for VISA
		if ((tCreditCardFirstDigit == "4") && ((tCardNoLength == 13) || (tCardNoLength == 16))) {
			tValid = true;
		}
	} else if (tPayType == "2")	{ // for MC
		if ((tCreditCardFirstDigit == "5") && (tCardNoLength == 16)) {
			tValid = true;
		}
	} else if (tPayType == "7")	{ // for AMEX
		if ((tCreditCardFirstDigit == "3") && (tCardNoLength == 15)) {
			tValid = true;
		}
	} else if (tPayType == "8")	{ // for Discover
		if ((tCreditCardFirstDigit == "6") && (tCardNoLength == 16)) {
			tValid = true;
		}
	}

	if (tValid == false) {
		alert ('Invalid Credit Card Number');
		iCreditCardNumber.focus();
	}

	return tValid;
}

function ToNumberFromString(iString) {
	// There would be a better way to handle string to number conversion in
	// later versions of JavaScript, however parseInt is implemented in 1.0
	// Check if values are empty, parseInt will only convert numeric characters.
	if (iString == '') {
		return 0.00;
	}
	else {
		aResult = parseFloat(iString);
		if (isNaN(aResult)) {
			return 0.00;
		}
		else {
			return aResult;
		}
	}
}

function dollars(n) {
    var l = Math.floor(n);
    var r = Math.round((100*n)%100);
    if (r<10) return "$"+l+".0"+r;
    if (r==100) return "$"+(l+1)+".00";
    return "$  "+l+"."+r;
}


function ValidateEmail(iEmail) {
	if ( IsBlank(iEmail) ) {
		return true;
	} else {
		if (iEmail.value.indexOf('@',0) == -1 || iEmail.value.indexOf ('.',0) == -1) {
			alert("\nThe E-MAIL field requires a \"@\" and a \".\" be used. \n\nPlease re-enter your e-mail address.")
			iEmail.focus();
			return false;
		} else {


	        if ( ContainsSpecialCharacters(iEmail) ) {
				alert("\nThe E-MAIL field contains an illegal character. \n\nPlease re-enter your e-mail address.")
				iEmail.focus();
				return false;
			}
		}
	}
	return true;
}

function ContainsSpecialCharacters(iField) {
	if (IsBlank(iField)) {
		return false;
	} else {
		if ((iField.value.indexOf('\t',0) != -1 || iField.value.indexOf ('\n',0) != -1) ||
			(iField.value.indexOf('//',0) != -1 || iField.value.indexOf ('\r',0) != -1) ) {
			return true;
		}
	}
	return false;
}

// Remove characters in filter from string input, return filtered string

function StringFilter(input, filter) {
s = input;
f = filter;
var i;
var returnString = "";
for (i = 0; i < s.length; i++) {
var c = s.charAt(i);
if (filter.indexOf(c) == -1) returnString += c;
}
return returnString;
}

//Added by Durga for fixing Cross Scripting Vulnerabilty on 9/14/2007


function FrameScripting()
{
	if(frames)
	{
		//alert('FRAMESCRIPTING TESTING');
		if(top.frames.length>0)
		{
			//alert('CROSS FRAME SCRIPTING STARTS');
			top.location.href= self.location;
			//alert('CROSS FRAME SCRIPTING ENDS');

		}
	}
}
//Addition ends here


// End script-->
