
function preloadImg(image) {
        var img = new Image();
        img.src = image;
}
preloadImg('/nyro/img/ajaxLoader.gif');
preloadImg('/nyro/img/prev.gif');
preloadImg('/nyro/img/next.gif');

jQuery.noConflict();
jQuery(document).ready(function($){
//$(document).ready(function() {
//--------------------------
    $(".sections").hide();
    setInterval("checkAnchor()", 300);

    $(".pages").hide();
    //$("#page-0-1").show();
    $(".pager span").click(function(event) {
        event.preventDefault();
        $(".pager span").removeClass("on");
        $(this).addClass("on");
        $(".pages").hide();
        var page = "#page-"+$(this).attr("title");
        $(page).show();
        $(page+" th:first").css("-moz-border-radius","10px 0 0 0");
        $(page+" th:last").css("-moz-border-radius","0 10px 0 0");
    });

    //___________________________________________

    /*
    $('a.zoom').fancyZoom({
        directory: '/resources/images/interface/fancyzoom'
    });
    */
    
    $.fn.nyroModal.settings.minWidth=50;
    $.fn.nyroModal.settings.minHeight=50;
/*
    $.fn.nyroModal.settings.css = {
                bg: {
                        zIndex: 100,
                        position: 'fixed',
                        top: 0,
                        left: 0,
                        height: '100%',
                        width: '100%'
                },
                wrapper: {
                        zIndex: 101,
                        position: 'fixed',
                        top: '50%',
                        left: '50%',
                        paddingBottom: '15px'
                },
                wrapper2: {
                },
                content: {
                        overflow: 'hidden',
                        paddingBottom: '0px'
                },
                loading: {
                        zIndex: 102,
                        position: 'fixed',
                        top: '50%',
                        left: '50%',
                        marginTop: '-50px',
                        marginLeft: '-50px'
                }
    }

    $.fn.nyroModal.settings.showBackground = function(elts, settings, callback) {
        elts.bg.css({opacity:0}).fadeTo(500, 0.3, callback);
    };
*/
    $.fn.nyroModal.settings.hideContent = function(elts, settings, callback) {
        elts.contentWrapper
            .animate({
                opacity: 0

            }, {duration: 350, complete: function() {
                elts.contentWrapper.hide();
                callback();
            }});

    }
    

    //_________________________________________

//--------------------------
});

var currentAnchor = null;
function checkAnchor(){
    var hash = document.location.hash;
    if(currentAnchor != hash){
        currentAnchor = hash;
        jQuery(".sections").hide();
        jQuery(".pages").hide();
        jQuery("#leftcol li, #leftcol a").removeClass("on");
        jQuery(".pager span").removeClass("on");
        if(!currentAnchor) {
            //jQuery("#default").show();
            //show first div
                        //no default section so highlight first links
            jQuery("#leftcol li a:first").addClass("on");
            jQuery("#leftcol li:first").addClass("on");
                        jQuery(".sections:first").show();
            //jQuery("#page-0-1").show();
            jQuery(".sections:first .pages:first").show();
            jQuery(".sections:first .pager span:first").addClass("on");
        } else {
            jQuery(currentAnchor+' .pages:first').show();
            jQuery(currentAnchor+' .pager span:first').addClass("on");
            jQuery(currentAnchor).fadeIn();
            jQuery("#leftcol a[href='"+currentAnchor+"']").addClass("on");
            var parent = jQuery("#leftcol a[href='"+currentAnchor+"']").parent();
            jQuery(parent).addClass("on");
            //curved corners to table
            jQuery(currentAnchor+" .pages:first th:first").css("-moz-border-radius","10px 0 0 0");
            jQuery(currentAnchor+" .pages:first th:last").css("-moz-border-radius","0 10px 0 0");
        }
    }
}










