    errorChars = false;
	errorEmpty = false;
	function checkChars(text,id) {
		var goodChars = /^[\s\w]+$/;
		if ((text != '') && (!goodChars.test(text))) {
			document.getElementById(id).style.color = 'red';
			document.getElementById("warning_char").style.display = 'block';
			errorChars = true;
		}
	}
	function checkEmpty(text,id) {
		if (text == '') {
		//	document.getElementById(id).style.color = 'red';
		//	document.getElementById("warning_req").style.display = 'block';
			errorEmpty = true;
		}
	}
	function checkForm() {
		// Set input text variables
		var zipText = document.getElementById("residential_zip").value;
		// Check required fields
		checkEmpty(zipText,'zip');
		if (errorEmpty == true) {
			errorEmpty = false;
			return false;
		}
		// Check for illegal characters
		checkChars(zipText,'zip');
		if (errorChars == true) {
			errorChars = false;
			return false;
		}
		window.location=("http://www.chooseenergy.com/direct-b-r.aspx?zipCode="+zipText);
	}
	
function invisiblateAll(targetClass) {
	var allElements = $A(document.getElementsByClassName(targetClass));
	allElements.each(function(singleElement){
		Element.hide(singleElement);
	});
}
var newwindow;
function popWindowSize(url,height,width)
{
	newwindow=window.open(url,'name','height=' + height +',width=' + width +',left=100,top=100,resizable=yes,scrollbars=no,toolbar=no,status=no,menubar=no');
	if (window.focus) {newwindow.focus()}
}
function popTermsWindow(url)
{
    newwindow = window.open(url,'name','height=600,width=700,left=100,top=100,scrollbars=no,toolbar=no,status=no,menubar=no');
    if (window.focus) {
        newwindow.focus()
    }
}
function popWindow(url)
{
    newwindow = window.open(url,'name','height=500,width=400,left=100,top=100,resizable=no,scrollbars=no,toolbar=no,status=no,menubar=no');
    if (window.focus) {
        newwindow.focus()
    }
}
function popCustomWindow(url, settings)
{
    newwindow = window.open(url, 'name', settings);
    if (window.focus) {
        newwindow.focus()
    }
}
function invisiblateDetails() {
	invisiblateAll('offer-details');
}

function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function offerDetail(target,source) {
	var x = findPosX(source);
	var y = findPosY(source);
	var targetBox = document.getElementById(target);
	var w = '200';
	targetBox.style.width = w + 'px';
	targetBox.style.left = x - w - 200 + 'px';
	targetBox.style.top = y - 100 + 'px';
	if (targetBox.style.display == 'none') {
		targetBox.style.display = 'block';
	}
	else {
		targetBox.style.display = 'none';
	}
}

function activateLegend(source) {
	var startChop = (source.src.lastIndexOf('/') + 1);
	var endChop = source.src.lastIndexOf('.');
	var targetId = source.src.substring(startChop,endChop);
	var targetItem = document.getElementById(targetId);
	targetItem.className = 'active';
}

function deactivateLegend(source) {
	var startChop = (source.src.lastIndexOf('/') + 1);
	var endChop = source.src.lastIndexOf('.');
	var targetId = source.src.substring(startChop,endChop);
	var targetItem = document.getElementById(targetId);
	targetItem.className = '';
}

function VAM_FieldChanged(obj)
{
	// just to get js to not crash -- not sure what this ever was used for.
}








	




