﻿
$(document).ready(function () {
    $("img.rollover").hover(
function () {
    this.src = this.src.replace("_off", "_on");
},
function () {
    this.src = this.src.replace("_on", "_off");
});



    $('.rcHomeGallery').innerfade({
        speed: 'slow',
        timeout: 5000,
        type: 'sequence',
        containerheight: '408px'
    });

    $(".image_thumb table tr td").click(function () {

        var imgAlt = $(this).find('img').attr("alt");
        var imgTitle = $(this).find('a').attr("href");
        var Copy = $(this).find('img').attr("title");
        var Title = $(this).find('img').attr("alt");
        var Highlight = $(this).find('img').attr("src").replace("_off", "_on");

        //alert(Highlight.replace("_on", "_off"));
      // alert($(".image_thumb table tr td ").find('img').attr('src'));
       //$(".image_thumb table tr td ").find('img').attr('src').replace('_on', '_off');
       
        //alert(Copy);
        //alert(imgTitle);

        // var imgDesc = $(this).find('.block').html();  //Get HTML of the "block" container
        //var imgDescHeight = $(".main_image").find('.block').height(); //Find the height of the "block"

        $(".rcGallery").find("img").attr({ src: imgTitle, alt: imgAlt }); //Switch the main image (URL + alt tag)
        $(".leftcontentgallery").html('<p>'+Copy);
        $(".PinkHeader").html(Title);
        //        $("img.rollover").attr("src", $("img.rollover").attr("src").replace("_on", "_off"));

        //var HighlightOff = $(".image_thumb table tr td").each().find('img').attr("src").replace("_on", "_off");
                $(".image_thumb table tr td").each(function (index) {

                    if (index > 0) {
                        //alert(index);
                        // $(this).find('img').attr('src').replace('_on', '_off');

                        $(this).find('img').attr('src', $(this).find('img').attr('src').replace('_on', '_off'));
                        

                        //  alert($(this).find('img').attr("src").toString());
                    }
                });

        $(this).find('img').attr({ src: Highlight });
        // });
        return false;

    });


});

    
    
