//requires jquery and windows_js loaded // string utility functions String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } String.prototype.ltrim = function() { return this.replace(/^\s+/,""); } String.prototype.rtrim = function() { return this.replace(/\s+$/,""); } function validate_index_form() { var ret = true; var requiredFields = jQuery('#form1 .form_required') //jQuery('.required_field_arrow').css('display','inline'); if (jQuery('#FirstConTitle')[0].selectedIndex == 0) { ret = false; jQuery('#FirstConTitle').parent().prev().css('color','#FF0000'); } else { jQuery('#FirstConTitle').parent().prev().css('color','#000000'); } if (jQuery('#ContactFirst').val().trim() == '') { ret = false; jQuery('#ContactFirst').parent().prev().css('color','#FF0000'); } else { jQuery('#ContactFirst').parent().prev().css('color','#000000'); } if (jQuery('#ContactLast').val().trim() == '') { ret = false; jQuery('#ContactLast').parent().prev().css('color','#FF0000'); } else { jQuery('#ContactLast').parent().prev().css('color','#000000'); } if (jQuery('#PrimAdd').val().trim() == '') { ret = false; jQuery('#PrimAdd').parent().prev().css('color','#FF0000'); } else { jQuery('#PrimAdd').parent().prev().css('color','#000000'); } if (jQuery('#PrimCity').val().trim() == '') { ret = false; jQuery('#PrimCity').parent().prev().css('color','#FF0000'); } else { jQuery('#PrimCity').parent().prev().css('color','#000000'); } if (jQuery('#State')[0].selectedIndex == 0) { ret = false; jQuery('#State').parent().prev().css('color','#FF0000'); } else { jQuery('#State').parent().prev().css('color','#000000'); } if (jQuery('#ZipCode').val().trim() == '') { ret = false; jQuery('#ZipCode').parent().prev().css('color','#FF0000'); } else { jQuery('#ZipCode').parent().prev().css('color','#000000'); } //country cannot be left blank. selectedIndex 0 is the USA //jQuery('#Country').addClass('form_required'); //ret = true; if (!ret) { //display the error message // var DialogString = '

While our website provides a wealth of information our FREE DVD is still the best way to see how our swimming machines perform.

'; // DialogString += '
'; // DialogString += '' // //DialogString += ''; // DialogString += ''; // DialogString += '' // //DialogString += ''; // DialogString += '
'; var DialogString = '

Oops! In order to send you our FREE DVD we require a few important pieces of information. We\'ve hightlighted the missing pieces in red.

'; DialogString += '
'; DialogString += ''; DialogString += '
'; //DialogString += ''; //DialogString += ''; //DialogString += '' //DialogString += ''; //DialogString += ''; //Dialog.info(DialogString, { windowParameters: {resizable: false, effectOptions: {duration:0.25}, showEffect: Effect.Grow, hideEffect: Effect.Puff, width: 375, height:200, className:"alphacube"}}); Dialog.info(DialogString, { windowParameters: {resizable: false, width: 375, height:200, className:"alphacube"}}); } else { jQuery('#form1').submit(); } return ret; }