jQuery(document).ready(function($) { 'use strict'; // Sticky navigation if(jQuery( "body" ).hasClass( "admin-bar" )) { jQuery("body.admin-bar .sticky-menu").fixTo('body', {top: 32}); } else { jQuery(".primary-menu.sticky-menu").fixTo('body'); } }); //form validation function validateName(fld) { var error = ""; if (fld.value === '' || fld.value === 'Nickname' || fld.value === 'First Name') { error = "You didn't enter Your First Name.\n"; } else if ((fld.value.length < 2) || (fld.value.length > 50)) { error = "First Name is the wrong length.\n"; } return error; } function validateEmail(fld) { var error=""; var illegalChars = /^[^@]+@[^@.]+\.[^@]*\w\w$/; if (fld.value === "") { error = "You didn't enter an email address.\n"; } else if ( fld.value.match(illegalChars) === null) { error = "The email address contains illegal characters.\n"; } return error; } function validateMessage(fld) { var error = ""; if (fld.value === '' || fld.value === 'Message') { error = "You didn't enter Your message.\n"; } else if (fld.value.length < 3) { error = "The message is to short.\n"; } return error; } function validateLastname(fld) { var error = ""; if (fld.value === '' || fld.value === 'Nickname' || fld.value === 'Enter Your Name..' || fld.value === 'Your Name..') { error = "You didn't enter Your last name.\n"; } else if ((fld.value.length < 2) || (fld.value.length > 50)) { error = "Last Name is the wrong length.\n"; } return error; } function validatePhone(fld) { var error = ""; var illegalChars = /^\+?s*\d+\s*$/; if (fld.value === '') { error = "You didn't enter Your phone number.\n"; } else if ( fld.value.match(illegalChars) === null) { error = "Please enter a valid phone number.\n"; } return error; } (function($) { 'use strict'; })(jQuery);