/* Author: */

$(function(){
		$('#slides').slides({
			preload: true,
			preloadImage: '../css/i/loading.gif',
			play: 6500,
			pause: 1500,
			hoverPause: true
		});
	});


$(function(){
    //  Initialize auto-hint fields
    $('input.auto-hint, textarea.auto-hint').focus(function(){
        if($(this).val() == $(this).attr('title')){ 
            $(this).val('');
            $(this).removeClass('auto-hint');
        }
    });
    
    $('input.auto-hint, textarea.auto-hint').blur(function(){
        if($(this).val() == '' && $(this).attr('title') != ''){ 
            $(this).val($(this).attr('title'));
            $(this).addClass('auto-hint'); 
        }
    });
        
    $('input.auto-hint, textarea.auto-hint').each(function(){
        if($(this).attr('title') == ''){ return; }
        if($(this).val() == ''){ $(this).val($(this).attr('title')); }
        else { $(this).removeClass('auto-hint'); } 
    });
});



jQuery(function() {
  jQuery('.error').hide();
  jQuery(".but").click(function() {
		// validate and process form
		// first hide any error messages
    jQuery('.error').hide();
		
    var email = jQuery("input#email").val();
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	if(!emailReg.test(email)) {
	jQuery("span#email_error2").show();
    jQuery("input#email").focus();
      return false;
	}
	
		
		var dataString = '&email=' + email;
		//alert (dataString);return false;
		
	  jQuery.ajax({
      type: "POST",
      url: "process.php",
      data: dataString,
      success: function() {
        jQuery('#contact_form').html("<div id='message'></div>");
        jQuery('#message').html("<strong>Contact Form Submitted!</strong>")
        .append("<p>We will be in touch soon.</p>")
        .hide()
        .fadeIn(1500, function() {
          jQuery('#message');
        });
      }
     });
    return false;
	});
});

function showBorough(targetElement, duration, from, to, toggle)
{
	Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}











