// JavaScript Document


function checkMail(mail) {
   var emailFilter=/^.+@.+\..{2,3}$/;
   var err = null;
   if (!(emailFilter.test(mail))) {
      return false;
   }
   var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
   if (mail.match(illegalChars)) {
      return false;
   }
   return true;
}

function checkPhone(phone) {
   var filter=/^[0-9]{8}$/;
   if (!(filter.test(phone))) {
      return false;
   }
   return true;
}






$(document).ready(function(){
	$(".topbtn li").hover(
		function(){ $("ul", this).fadeIn(200); /*$(this).animate({"backgroundColor":"#afafaf"},200);*/ }, 
		function() { $("ul", this).fadeOut(200); /*$(this).animate({"backgroundColor":"#ebebeb"},200);*/	}
	);
	if (document.all) {
		$(".topbtn li").hoverClass ("sfHover");
	}
});

$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};


function rollIn(e) {
	$(e).animate({"backgroundColor":"#afafaf"},100);
}

function rollOut(e) {
	$(e).animate({"backgroundColor":"#ebebeb"},100);
}