
//function for navigating to the search page
navToNormalSearch = function(strSearch){
document.location = 'http://search.benefitbar.com/benefitbar/search/www.php?tid=1510&sch='+strSearch;
}

//function for validating contact form
validateEmailFrom = function(el){


while(el.nodeName != 'FORM'){
	el = el.parentNode;
}

var tbEl = el.getElementsByTagName('input')[0];
var emailEl = el.getElementsByTagName('input')[1];

var emailReg = new RegExp('^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$');
var wspaceReg = new RegExp('\s', 'g');

if(tbEl.value.replace(wspaceReg, '').length == 0){
	alert('Please enter your name');
	try{ tbEl.focus(); } catch(e){}
	return false;
}

if(emailEl.value.replace(wspaceReg, '').length == 0){
	alert('Please enter your email address');
	try{ emailEl.focus(); } catch(e){}
	return false;
}

if(!emailEl.value.match(emailReg)){
	alert('Please make sure your email address is properly formatted');
	try{ emailEl.focus(); } catch(e){}
	return false;
}
alert ('Thank you for contacting us. We will get back to you as soon as possible.');
return true;
}


