﻿// perform JavaScript after the document is scriptable.
$(document).ready(function() {
    //default search field text
    var active_color = '#000'; // Colour of user provided text
    var inactive_color = '#858585'; // Colour of default text
    $("input.ow_sbox").css("color", inactive_color);
    var default_values = new Array();
    $("input.ow_sbox").focus(function() { if (!default_values[this.id]) { default_values[this.id] = this.value; } if (this.value == default_values[this.id]) { this.value = ''; this.style.color = active_color; } $(this).blur(function() { if (this.value == '') { this.style.color = inactive_color; this.value = default_values[this.id]; } }); });
    $("a[rel='lightbox']").colorbox();
    //check if logged in to OW
    if (typeof OneWeb.Admin === "undefined") {
        //if NOT logged in
        $('.slideshow').cycle({
            fx: 'fade',
            speed: 'slow',
            timeout: 6000,
            next: '#slideshow_next',
            after: onAfter
        });
    } else {
        //if logged in
        $("#slideshow").css({ "height": "auto", "overflow": "inherit", "margin-top": "10px" });
        $(".hl_slideshow_navigation").css({ "display": "none" });
    }

    function onAfter(curr, next, opts) {
        $("#slideshow_current").text(opts.currSlide + 1);
        $("#slideshow_total").text(opts.slideCount);
    }

});

