jQuery(window).load(function() {
    jQuery('#slider').nivoSlider({
        effect:'fade',
        animSpeed:1000,
        pauseTime:3000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:false, //Next & Prev
        directionNavHide:false, //Only show on hover
        controlNav:false, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:false, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:0.8, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){} //Triggers after all slides have been shown
    });
});


function PopUp(URL) {
    var winw = 750;
    var winh = 520;
    var winl = (screen.width - winw) / 2;
    var wint = (screen.height - winh) / 2;
    var addprops = ", width=" + winw + ",height=" + winh + ",left=" + winl + ",top=" + wint;
    //alert(addprops);
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1" + addprops + "');");
}


function highlightParent(hideshow, id) {
    if(hideshow == 'show') {
        document.getElementById(id).style.backgroundColor = '#909eb1';
        document.getElementById(id).style.color = '#FFF';
    }
    else if (hideshow == 'hide'){
        document.getElementById(id).style.backgroundColor = '#efebda';
        document.getElementById(id).style.color = '#324465';
    }
}


function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
            if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


//Calls a link from an <option value="url"> value of a <select>
function GoToURL(select) {
    var value = select.options[select.options.selectedIndex].value;
    if (value == "") {
        select.form.reset();
        return;
    }
    else {
        window.location.href = value;
        select.form.reset();
    }
}

Shadowbox.init();
