/* Common JS library  */

function ShowDiv(id)  {
	var e = 'div#' + id;	
    Spry.$$(e).setStyle("visibility: visible;");	
}

function HideDiv(id) {
	var e = 'div#' + id;	
    Spry.$$(e).setStyle("visibility: hidden;");
}

function init(){
  ShowDiv('maincontainer');
  ShowDiv('sandlerfooter');


}

function sitesearch(){
    //alert('Our site search is currently offline.');
	//return false;
}

function imagemenu_linkhandler(e){
   window.location = e;
}

function validateEmail(e) {

  var isvalid = checkemail(e);
   if(isvalid){
     return true;
   }else{
     return false;
   }
}

function validateEmailRemoval(e) {

  var isvalid = checkemail(e);
   if(isvalid){
   
      if(confirm("You have entered " + e.value + " to be removed from our mailing list. \n\nPress OK to continue"))
	    { return true;}
		 else {return false;}
   }else{
     return false;
   }
}

function checkemail(e){
var str=e.value;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (filter.test(str))
   testresults=true;
else{
   alert("Your email address: " + e.value + " \ndoes not appear to be valid. \n\nPlease check your spelling and try again.");
   testresults=false;
}
return (testresults);
}