function validateSignUpForAlertsForm(form) {
		if ( (form.email.value == '') || (form.email.value == 'Email Address') ) { alert('Please enter your email address.'); form.email.className='highlight'; form.email.focus(); return; }
		if (isEmail(form.email.value) == false) { alert('You have entered an invalid e-mail address.\n\nPlease enter a valid e-mail address.'); form.email.className='highlight'; form.email.focus(); return; }
		if ( (form.zip.value.length < 5) || (form.zip.value == 'ZIP Code') ) { alert('Please enter your 5-digit ZIP Code.'); form.zip.className='highlight'; form.zip.focus(); return; }
		submitForm('sign_up_for_alerts','sign_up_for_alerts_action.cfm?email='+encodeURIComponent(document.frm_alerts.email.value)+'&zip='+encodeURIComponent(document.frm_alerts.zip.value)); return;
	}

function confirmBox(txt, url) {
	if (confirm(txt)) {
		window.location.href=url;
	} 
}

function cycleDisplay(name) {
	if (name.length > 0) {
		document.getElementById(name).style.display = (document.getElementById(name).style.display == "block" ) ? "none" : "block";
	}
}

function hideDisplay(name) {
	if (name.length > 0) {
		document.getElementById(name).style.display = "none";
	}
}

function isEmail(string) {
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
		return true;
	} else {
		return false;
	}
}

/* start banner fade in area */

document.write("<style type='text/css'>#bannerfadeinarea {background: transparent; visibility:hidden;}</style>");

function initImage() {
	imageId = 'bannerfadeinarea';
	if (image = document.getElementById(imageId)) {
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
	}
}

function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 7;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50); 
		} else {
			setOpacity(obj, 100);
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50); 
		}
	}
}
function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}

window.onload = function() {
	initImage();
}

/* end banner fade in area */

/* start scrollwin area */
var ScrollWin = {
	w3c : document.getElementById,
	iex : document.all,
	scrollLoop : false, 
	scrollInterval : null, // setInterval id
	currentBlock : null,   // object reference
	getWindowHeight : function(){
		if(this.iex) return (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
		else return window.innerHeight;
	},
	getScrollLeft : function(){
		if(this.iex) return (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		else return window.pageXOffset;
	},
	getScrollTop : function(){
		if(this.iex) return (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		else return window.pageYOffset;
	},
	getElementYpos : function(el){
		var y = 0;
		while(el.offsetParent){
			y += el.offsetTop
			el = el.offsetParent;
		}
		return y;
	},
	scroll : function(num){
		if(!this.w3c){
			location.href = "#"+this.anchorName+num;
			return;
		}
		if(this.scrollLoop){
			clearInterval(this.scrollInterval);
			this.scrollLoop = false;
			this.scrollInterval = null;
		}
		if(this.currentBlock != null) this.currentBlock.className = this.offClassName;
		this.currentBlock = document.getElementById(this.blockName+num);
		this.currentBlock.className = this.onClassName;
		var doc = document.getElementById(this.containerName);
		var documentHeight = this.getElementYpos(doc) + doc.offsetHeight;
		var windowHeight = this.getWindowHeight();
		var ypos = this.getElementYpos(this.currentBlock);
		if(ypos > documentHeight - windowHeight) ypos = documentHeight - windowHeight;
		this.scrollTo(0,ypos);
	},
	scrollTo : function(x,y){
		if(this.scrollLoop){
			var left = this.getScrollLeft();
			var top = this.getScrollTop();
			if(Math.abs(left-x) <= 1 && Math.abs(top-y) <= 1){
				window.scrollTo(x,y);
				clearInterval(this.scrollInterval);
				this.scrollLoop = false;
				this.scrollInterval = null;
			}else{
				window.scrollTo(left+(x-left)/2, top+(y-top)/2);
			}
		}else{
			this.scrollInterval = setInterval("ScrollWin.scrollTo("+x+","+y+")",100);
			this.scrollLoop = true;
		}
	}
};
ScrollWin.containerName = "container"; // The id name of the div containing the content
ScrollWin.anchorName    = "anchor";    // The alpha portion of the anchor names
ScrollWin.blockName     = "block";     // The alpha portion of the content blocks
ScrollWin.onClassName   = "active";    // The CSS class name for the 'on' state
ScrollWin.offClassName  = "visited";   // The CSS class name for the 'off' state

/* end scrollwin area */

function spawnWindow(wurl, wname, width, height,tmpvalue,tmpdate) {
	if (tmpvalue != null)
		thewindow = window.open(wurl+'?lsec='+tmpvalue+'&ldate='+tmpdate,wname,'width='+width+',height='+height+',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizeable=no');
	else
		thewindow = window.open(wurl,wname,'width='+width+',height='+height+',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizeable=no');			
	thewindow.focus();
}  

function spawnWindowNoFrame(wurl, wname, width, height) {
	thewindow = window.open(wurl,wname,'width='+width+',height='+height+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no');
	thewindow.focus();
}

/* Toggles an elements visibility between hidden and visible */
function toggleVis(currElem) {
	dom = eval('document.all.' + currElem + '.style');
	state = dom.visibility;
	if (state == "visible" || state == "show") {
		dom.visibility = "hidden";
	} else {
		dom.visibility = "visible";
	}
}