/** * hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+ * * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @author Brian Cherne brian(at)cherne(dot)net */ (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))Hey, what is you name!?'); return false; } var email_test = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/; var email = $('input#email').val(); if (email == "" || email == " ") { $('input#email').focus().before('
Psst. You missed one.
'); return false; } else if (!email_test.test(email)) { $('input#email').select().before('
I think your email is wrong...
'); return false; } var message = $('#message').val(); if (message == "" || message == " " || message == "Message") { $('#message').focus().before('
Oops! You forgot to type a message!
'); return false; } var data_string = $('#mgmenu_form').serialize(); $.ajax({ type: "POST", url: "email.php", data: data_string, success: function() { $('#mgmenu_form').find('.error').hide(0); $('#mgmenu_form').before('
'); $('.success').html('Your email has been sent successfully !'); }//end success function }) //end ajax call return false; }) //end click function }