$(function () {
    $('.gallery-container:first').show();
    $(".lightbox").fancybox();

    $('.fp-holder a.preview').click(function () {
    	$('.fireplace').hide();
        $('#fireplace-' + this.rel).show();
        return false;
    });
    
    $('.switch-img').click(function () {
        $('.gallery-container').hide();
        $('div.'+$(this).attr('data-material')).show();
        return false;
    });

    // window.myfunction_ajax = function(){
    //     var data = $(this).serializeArray();
    //     var url = $(this).attr('action');
    //     var self = this;
    //     // $('.form-message').html("Loading ... Please wait").slideDown();
    //     $.ajax({
    //         url: url,
    //         data: data,
    //         type: 'POST',
    //         success: function (response) {
    //             $('.form-message').html(response);
    //             // $('.form-message').html('<h3>Your message has been sent.<h3>');
    //             $('div.request-form > form').hide('slow');
    //         },
    //         error: function (err) {
    //             alert("Sorry, your message couldn't be sent at this time. Please try again later. ");
    //         }
    //     });
    //     return false;
    // };
    
    $( "#contact .gform_wrapper label .gfield_required" ).each(function(){
        $(this).html('<span> (Required):</span>');
    });

    $( ".special-offers .gform_wrapper ul li" ).each(function(){
        $(this).append('<div class="cl">&nbsp;</div>');
    });

    $('.special-offers .gform_wrapper .product-field input').val($('.special-offers .leftimg a.lightbox').attr('alt'));
    $('.special-offers .gform_wrapper .product-field input').attr('readonly','readonly');
    


});
