//Site wide javascript
function setPointer(theRow, thePointerColor, theNormalBgColor) {
    var theCells = theRow.getElementsByTagName('td');	
    var rowCellsCnt  = theCells.length;
    var currentColor = theCells[0].style.backgroundColor;
    var newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
           	 	theCells[c].style.backgroundColor = newColor;
   		}
	return true;
}
/* toggles blocks (divs) on and off - eg:
<div id="bubba">Something</div>
onclick="toggle('bubba');return false;"
*/
function toggle( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	}
}

function doNothing() {}
function validateEmail(email)
{
	var result = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/.test(email);
	var newsletterError = document.getElementById('newsletter-error');
	if (!result) 
	{
		newsletterError.style.display = '';
	}
	else
	{
		newsletterError.style.display = 'none';
	}
	return result;
}