//=============================================
// Hover Image PopUp
//=============================================
$(document).ready(function() {
    //Make Background Column Color Change
    ////    $("td.ComboFirstCell").hover(function() {
    ////        $(this).addClass("hover");
    ////    }, function() {
    ////        $(this).removeClass("hover").stop();
    ////    });

    ////    $("td.ComboMiddleCell").hover(function() {
    ////        $(this).addClass("hover");

    ////    }, function() {
    ////        $(this).removeClass("hover").stop();
    ////    });

    ////    $("td.ComboLastCell").hover(function() {
    ////        $(this).addClass("hover");

    ////    }, function() {
    ////        $(this).removeClass("hover").stop();
    ////    });

    //Make Background Column Color Transparent
    ////    $("td.ComboFirstCell").fadeTo("slow", 0.6);
    ////    $("td.ComboFirstCell").hover(function() {
    ////        $(this).fadeTo("slow", 1.0);
    ////    },

    ////    function() {
    ////        $(this).fadeTo("slow", 0.6);
    ////    });

    ////    $("td.ComboMiddleCell").fadeTo("slow", 0.6);
    ////    $("td.ComboMiddleCell").hover(function() {
    ////        $(this).fadeTo("slow", 1.0);
    ////    },

    ////    function() {
    ////        $(this).fadeTo("slow", 0.6);
    ////    });

    ////    $("td.ComboLastCell").fadeTo("slow", 0.6);
    ////    $("td.ComboLastCell").hover(function() {
    ////        $(this).fadeTo("slow", 1.0);
    ////    },

    ////    function() {
    ////        $(this).fadeTo("slow", 0.6);
    ////    });


    //Larger thumbnail preview non transparent
    ////    $("ul.thumb li").fadeTo("slow", 0.6);
    ////    $("ul.thumb li").hover(function() {
    ////        $(this).fadeTo("slow", 1.0);
    ////    },

    ////    function() {
    ////        $(this).fadeTo("slow", 0.6);
    ////    });


    //Larger Image Preview 
    //    $("ul.thumb li").hover(function() {
    //        $(this).css({ 'z-index': '10' });
    //        $(this).find('img').addClass("hover").stop()
    //		.animate({
    //		    marginTop: '-140px',
    //		    marginLeft: '-100px',
    //		    marginRight: '-120px',
    //		    top: '58%',
    //		    left: '50%',
    //		    right: '50%',
    //		    width: '170px',
    //		    height: '214px',
    //		    padding: '5px'
    //		}, 200);

    //    }, function() {
    //        $(this).css({ 'z-index': '0' });
    //        $(this).find('img').removeClass("hover").stop()
    //		.animate({
    //		    marginTop: '0',
    //		    marginLeft: '0',
    //		    top: '-10', //original 50
    //		    left: '13',
    //		    width: '170px',
    //		    height: '214px',
    //		    padding: '0px'
    //		}, 400);
    //    });

    //Click Image Shadow
    $("a.imgHover").click(function() {
        var hoverID = $(this).attr('name');

        if ($('input[name=' + hoverID + ']').is(':checked')) {
            $('input[name=' + hoverID + ']').attr('checked', false);
            $('td[id=' + hoverID + ']').css({ backgroundColor: '' });
            $('td[id=' + hoverID + ']').fadeTo("slow", 1.0);
            $('ul.thumb li[id=' + hoverID + ']').fadeTo("slow", 1.0);

        }
        else {
            $('input[name=' + hoverID + ']').attr('checked', true);
            $('td[id=' + hoverID + ']').css({ backgroundColor: '#D9D9D9' });
            $('td[id=' + hoverID + ']').fadeTo("slow", 0.6);
            $('ul.thumb li[id=' + hoverID + ']').fadeTo("slow", 0.6);

        }
        return false;
    });

    //Click Checkbox Shadow
    $('input:checkbox[class=inputHover]').click(function() {
        var hoverInputID = $(this).attr('name');
        if ($(this).attr("checked") == true) {
            $('td[id=' + hoverInputID + ']').css({ backgroundColor: '#D9D9D9' });
            $('td[id=' + hoverInputID + ']').fadeTo("slow", 0.6);
            $('ul.thumb li[id=' + hoverInputID + ']').fadeTo("slow", 0.6);
        }
        else {
            $('td[id=' + hoverInputID + ']').css({ backgroundColor: '' });
            $('td[id=' + hoverInputID + ']').fadeTo("slow", 1.0);
            $('ul.thumb li[id=' + hoverInputID + ']').fadeTo("slow", 1.0);
        }
    }
     );


    //PDF Download Link
    $("a.contentlinkWhiteNoUnderline").click(function() {
        var target = $(this).attr('id');
        $('#downloadPDF123').attr('href', '../weballey/PDFDownload.aspx?doc=' + target + '.pdf');
    });
});