function checkPhoneNumber(phoneNo) {var phone1 = /^\d\d\d-\d\d\d-\d\d\d\d$/; var phone2 = /^\(\d\d\d\) \d\d\d-\d\d\d\d$/; var phone3 = /^\d\d\d\d\d\d\d\d\d\d$/; var phone4 = /^\d\d\d\.\d\d\d\.\d\d\d\d$/; var phone5 = /^\(\d\d\d\)\d\d\d-\d\d\d\d$/; var phone6 = /^\(\d\d\d\)\d\d\d\d\d\d\d$/; if (phoneNo.match(phone1) || phoneNo.match(phone2) || phoneNo.match(phone3)|| phoneNo.match(phone4) || phoneNo.match(phone5) || phoneNo.match(phone6)) { return (true);} else {return (false); }}
function checkEmail(eMail) {var emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(com|net|org|info|me|mobi|co|ws|us|biz|tv|uk|gov|edu|mil|travel)$/;if (eMail.match(emailRe)) {return (true);} else {return (false);}}

function Form1_Validator(theForm){
	var d_height = 250; //height of dialob box
	var d_width = 525; //width of dialog box
	var d_show = 'slide'; //string value either 'slide' or 'blind'
	var d_closeOnEscape = true;var d_draggable = false;var d_resizable = false;var d_autoOpen = true;var d_modal = true;
if (theForm.name.value == ""){$('#d_name').dialog({autoOpen: d_autoOpen, width: d_width, close: function(event, ui) {theForm.name.focus();}, show: d_show, height: d_height, closeOnEscape: d_closeOnEscape, draggable: d_draggable, resizable: d_resizable, modal: d_modal});return (false);}
if (checkPhoneNumber(theForm.phone.value) != true){$('#d_phone').dialog({autoOpen: d_autoOpen, width: d_width, close: function(event, ui) {theForm.phone.focus();},show: d_show, height: d_height, closeOnEscape: d_closeOnEscape, draggable: d_draggable, resizable: d_resizable, modal: d_modal});return (false);}
if (checkEmail(theForm.email.value) != true){$('#d_email').dialog({autoOpen: d_autoOpen, width: d_width, close: function(event, ui) {theForm.email.focus();}, show: d_show, height: d_height, closeOnEscape: d_closeOnEscape, draggable: d_draggable, resizable: d_resizable, modal: d_modal});return (false);}
if (theForm.email.value == ""){$('#d_email_empty').dialog({autoOpen: d_autoOpen, width: d_width, close: function(event, ui) {theForm.email.focus();}, show: d_show, height: d_height, closeOnEscape: d_closeOnEscape, draggable: d_draggable, resizable: d_resizable, modal: d_modal});return (false);}
if (theForm.email.value != theForm.confirm.value){$('#d_confirm').dialog({autoOpen: d_autoOpen, width: d_width, close: function(event, ui) {theForm.confirm.focus();}, show: d_show, height: d_height, closeOnEscape: d_closeOnEscape, draggable: d_draggable, resizable: d_resizable, modal: d_modal});return (false);}
if(theForm.newsletter.value != "Yes"){
	if (theForm.inquiry.value == ""){$('#d_message').dialog({autoOpen: d_autoOpen, width: d_width, close: function(event, ui) {theForm.inquiry.focus();}, show: d_show, height: d_height, closeOnEscape: d_closeOnEscape, draggable: d_draggable, resizable: d_resizable, modal: d_modal});return (false);}
}
return validate_user_text(theForm); //Checks wordfilter.js for blocked words
}

function limitText(limitField, limitCount, limitNum) {if (limitField.value.length > limitNum) {limitField.value = limitField.value.substring(0, limitNum);}else {limitCount.value = limitNum - limitField.value.length;}}

$(function() {$("#datepicker").datepicker({ showAnim: 'slide', numberOfMonths: 2, showButtonPanel: true, minDate: '-0D', maxDate: '+12M +0D'});$('#datepicker').datepicker('option', {dateFormat: "DD, MM d, yy"});});

$(function() {
$('#slideshow').hover(function() { 
	$('#controls').fadeIn(); }, function() { $('#controls').fadeOut();});     
	$('#pause').click(function() { $('#slides').cycle('pause'); return false; });
	$('#play').click(function() { $('#slides').cycle('resume'); return false; });  
	$('#slides').cycle({fx: 'fade', speed: 750, timeout: 5000, next: '#next', prev: '#prev'});
});

$(function() {$('.gallery a').lightBox();});




