/* Version: 4.2010.9.1.1 */
$(function(){if($.browser.msie&&$.browser.version<7){$(".smoothForm input:text, .smoothForm select, .smoothForm textarea").bind("blur",function(){$(this).validate()})}else{$(".smoothForm input:text, .smoothForm select, .smoothForm textarea").bind("focus",function(){$(this).closest("li").addClass("focus").end().one("blur",function(){$(this).closest("li").removeClass("focus").end().validate()})})}$.fn.validate=function(){return this.each(function(){var d=$(this);var e=d.dataset("validationType");var a=d.dataset("errorMessage");var c=d.closest("li");if(!e||e==""){return}if(e=="notEmpty"){if(!d.val()||!d.val.length){c.addClass("error");c.attr("title",a||"Please enter a value.")}else{c.removeClass("error");c.attr("title","Value was entered correctly.")}}else{if(e=="email"){var b=/^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,4}$/;if(b.test($.trim(d.val()))==false){c.addClass("error");c.attr("title",a||"Please enter a valid email address.")}else{c.removeClass("error");c.attr("title","Email address was entered correctly.")}}else{if(e=="phone"){var f=/^([0-9.)(-]+)$/;if(f.test($.trim(d.val()))==false){c.addClass("error");c.attr("title",a||"Please enter a valid phone number.")}else{c.removeClass("error");c.attr("title","Phone number was entered correctly.")}}else{log("validation error: unknown validation type")}}}})}});
