﻿function preloadImage(path) {
    loadImage = new Image();
    loadImage.src = path;
}


function goLite(FRM, BTN) {

	window.document.forms[FRM].elements[BTN].style.backgroundColor = "#CC3333";

}



function goDim(FRM, BTN) {

	window.document.forms[FRM].elements[BTN].style.backgroundColor = "#B71313";

}

/*  following section is dedicated to functions required by the different jQuery plugins i am using */

/*  for the album carousel */
$(document).ready(function () {
    if ($("#maintheatre").length > 0) {
        $("#maintheatre").theatre({ effect: "3d", speed: 1000, still: 3000, selector: "img" });
        

    }

    Shadowbox.init({ slideshowDelay: 4 });
    $('#album_carousel').theatre({ effect: 'vertical', still: 3000 });

});


function addphotos(arguments) {

    for (var i = 0; i < arguments.length; i++) {

        $('#davidc').append('<p>' + arguments[i] + ' </p>');
    }


}

/* to replace jCarousel maybe */
$(document).ready(function () {
    /*	CarouFredSel: an infinite, circular jQuery carousel.
    Configuration created by the "Configuration Robot"
    at caroufredsel.frebsite.nl
    */
    $("#foo2").carouFredSel({
        circular: false,
        infinite: false,
        auto: false,
        items: 4,
        prev: {
            button: "#foo2_prev",
            key: "left"
        },
        next: {
            button: "#foo2_next",
            key: "right"
        },
        pagination: "#foo2_pag"
    });
});


/* jCarousel  - will be eventually removed */ 
jQuery(document).ready(function () {
    jQuery('#mycarousel').jcarousel();
});


$(document).ready(function () {


    $("ul.sponsor_thumbs li").hover(function () {

        $(this).css({ 'z-index': '10' });

        $(this).find('img').addClass("hover").stop()

                    .animate({

                        marginTop: '-110px',

                        marginLeft: '-110px',

                        top: '50%',

                        left: '50%',

                        width: '250px',

                        height: '250px'



                    }, 200);



    }, function () {

        $(this).css({ 'z-index': '0' });

        $(this).find('img').removeClass("hover").stop()

                    .animate({

                        marginTop: '0',

                        marginLeft: '0',

                        top: '0',

                        left: '0',

                        width: '140px',

                        height: '140px'



                    }, 400);

    });
            });

            /* for the left menu */
            startList = function () {
                if (document.all && document.getElementById) {
                    navRoot = document.getElementById("nav");
                    for (i = 0; i < navRoot.childNodes.length; i++) {
                        node = navRoot.childNodes[i];
                        if (node.nodeName == "LI") {
                            node.onmouseover = function () {
                                this.className += " over";
                            }
                            node.onmouseout = function () {
                                this.className = this.className.replace(" over", "");
                            }
                        }
                    }
                }
            }
            window.onload = startList;


            /* For the theatre carousel */
//            $(document).ready(function () {
//                $("#maintheatre").theatre({ effect: "3d", speed: 1000, still: 3000, selector: "img" })
            //            });

//            $(window).load(function () {
//                if ($("#maintheatre").length > 0) {
//                    $("#maintheatre").theatre({ effect: "3d", speed: 1000, still: 3000, selector: "img" })
//                }
//            });

            function scrollwindowbeforeshadowbox() {
                
                    $.scrollTo( '+=665px', 800 );

            }
