
function enlarge (thumb, src, width, height, caption)
{

    if (document.getElementById) {

        var imageitem = document.getElementById('imageitem');

        if (imageitem.src != src)
        {
            $("#imageframe").fadeOut('fast',
                function() {
                    $("#imageitem").remove();
                    $("#imagecaption").remove();
                    $("#imageframe").append('<img id="imageitem" src="' + src +'" width="'+ width +'" height="'+ height +'" alt="'+ caption +'" />');
                    $("#imageframe").append('<p id="imagecaption">'+ caption +'</p>');
                    $("#imageframe").fadeIn('fast');
                }
            );
        }
//        thumb.parentNode.focus();
    }

    return false;
}


$(document).ready(function() {

    $("a.active").click(function() {
        var image_src = $(this).find('img').attr('src').substr(10);
        var image_title = $(this).find('img').attr('title');
        //alert('clicked ' + image_src);
        //alert( $("img#key_image").attr('src'));

        $("img#key_image").attr('src', '/images/'+image_src);
        $("img#key_image").attr('alt', image_title);
        return false;
    });


    //preload hover image
    $("<img />").attr("src", "http://fox-hat.com/_themes/public/img/foxhat-logo-over.gif");

    //add hover effects to fox-hat logo
    $("#foxhat-logo").hover(
        function(){$(this).children("img").attr({ src: "http://fox-hat.com/_themes/public/img/foxhat-logo-over.gif"});},
        function(){$(this).children("img").attr({ src: "http://fox-hat.com/_themes/public/img/foxhat-logo.gif"});}
    );

});


jQuery.preloadImages = function()
{
    for(var i = 0; i<arguments.length; i++)
    {
        jQuery("<img>").attr("src", arguments[i]);
    }
    //alert(arguments.length + ' images loaded');
}
