// Javascript originally by Patrick Griffiths and Dan Webb.
// http://htmldog.com/articles/suckerfish/dropdowns/
//sfHover = function() {
//	var sfEls = document.getElementById("foo").getElementsByTagName("li");
//	for (var i=0; i<sfEls.length; i++) {
//		sfEls[i].onmouseover=function() {
//			this.className+=" hover";
//		}
//		sfEls[i].onmouseout=function() {
//			this.className=this.className.replace(new RegExp(" hover\\b"), "");
//		}
//	}
//}
//if (window.attachEvent) window.attachEvent("onload", sfHover);


// Basic RollOver

/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;



/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

function popup() {
var NewWind = window.open( '','remote', 'width=400,height=480,scroll=yes' );
  if (NewWind.opener == null) {
    NewWind.opener = window;
  }
}
function vrPopUp() {
var NewWind = window.open( '','remote', 'width=400,height=480,scroll=yes' );
  if (NewWind.opener == null) {
    NewWind.opener = window;
  }
}



// Clear textfield

function clearField(thefield) {
		if (thefield.defaultValue==thefield.value)
		thefield.value = ""
	} 
	
	
// Zipcode Validate

function checkStateAll(formObj)
{
if (emptyField(formObj.tZip)) {
alert("Please enter a Zip Code.");
formObj.tZip.focus(); }
else return true;

return false;
}

function emptyField(textObj)
{
if(textObj.value.length == 0) return true;
}
