﻿function updateClock() {
    var currentTime = new Date();

    var currentDay = currentTime.getDate();
    var currentMonth = currentTime.getMonth() + 1;
    var currentYear = currentTime.getFullYear();
    var currentHours = currentTime.getHours();
    var currentMinutes = currentTime.getMinutes();

    // Pad the minutes and seconds with leading zeros, if required
    currentMinutes = (currentMinutes < 10 ? "0" : "") + currentMinutes;

    // Compose the string for display
    var currentTimeString = currentHours + ":" + currentMinutes + " " + currentDay + "/" + currentMonth + "/" + currentYear;

    // Update the time display
    document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}

$(document).ready(function() {
//ps_wrapper

if ($('.ps_wrapper').length) {

    $('html').addClass('publisiteEditor');

} else {

    $('html').addClass('frontEnd');

};


if ($('.content_pane_c .subSmartList').length) { // implies *not* zero
        $('.subSmartList li:last').addClass('last');
    }
    if ($('.breadcrumb a').length) { // implies *not* zero
        $('.breadcrumb a:last').addClass('active');
    }
    if ($('.subNav ul ul').length) { // implies *not* zero
        $('.subNav ul li.active').removeClass().addClass('activeChildren');
        $('.subNav ul li.active_ancestor_1').removeClass().addClass('activeChildren');
    }
});

$(window).load(function() {
    if ($('.slideshow').length) {
        $('.frontEnd .slideshow').cycle({
            timeout: 5000
        });
    }
}); 
