$(document).ready(function(){
		$('.logo').pngFix( );
		
		$("hr").replaceWith("<div class='hr'><hr></div>");
		
	$("#galleryNav").jFlow({
		slides: "#galleryPages",
		controller: ".controlNav", 
		slideWrapper : "#GallerySlide",
		selectedWrapper: "pageSelected",  
		width: "900px",
		height: "520px", // Remove to set height automatic
		duration: 500,
		prev: ".galleryPrev", 
		next: ".galleryNext"
	});
	
	$("a[rel^='gallery']").prettyPhoto();


});

//contact script

$(function() {
    // These first three lines of code compensate for Javascript being turned on and off. 
    // It simply changes the submit input field from a type of "submit" to a type of "button".


    var paraTag = $('input#submit').parent('p');
    $(paraTag).children('input').remove();
    $(paraTag).append('<input type="button" name="submit" id="submit" value="Email Us Now!" />');


    $('#main input#submit').click(function() {
        $('#main').append('<img src="mailer/images/ajax-loader.gif" class="loaderIcon" alt="Loading..." />');

        var name = $('input#name').val();
        var email = $('input#email').val();
        var zipcode = $('input#zipcode').val();
        var comments = $('textarea#comments').val();
        var actionfigure = $('input#actionfigure').val();

        $.ajax({
            type: 'post',
            url: 'mailer/sendEmail.php',
            data: 'name=' + name + '&email=' + email + '&zipcode=' + zipcode + '&comments=' + comments,

            success: function(results) {
                $('#main img.loaderIcon').fadeOut(1000);
                $('ul#response').html(results);
            }
        }); // end ajax
    });
});
		