﻿$(function() {
    if ($("#homebanner").length > 0) $('#homebanner').newsSlider();
});
$(document).ready(function() {
    if ($("#cert").length > 0) $("#cert a[rel^='pp']").prettyPhoto({ theme: 'facebook' });
});
/*var totimg = 4;
var curimg = 1;
$(document).ready(function() {
    if ($("#dnn_ContentBottomRight img").length > 0) setTimeout(function() { changewords(); }, 4000);
});
function changewords() {
    curimg = curimg + 1;
    if (curimg > totimg) curimg = 1;
    $("#dnn_ContentBottomRight img").attr('src', '/portals/0/izreke/izreke' + curimg + '.jpg');
    setTimeout(function() { changewords(); }, 4000);
}*/
$(document).ready(function() {
    $("#newsin .foot a.fav").click(function(event) {
        event.preventDefault(); // prevent the anchor tag from sending the user off to the link
        var url = this.href;
        var title = this.title;
        location.href, document.title
        if (window.sidebar) { // Mozilla Firefox Bookmark
            window.sidebar.addPanel(title, location.href, "");
        } else if (window.external) { // IE Favorite
            window.external.AddFavorite(location.href, title);
        } else if (window.opera) { // Opera 7+
            return false; // do nothing - the rel="sidebar" should do the trick
        } else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)
            alert('Unfortunately, this browser does not support the requested action,'
                         + ' please bookmark this page manually.');
        }
    });

    $("#fcbk a.fcbk img").mouseover(function(event) {
        $(this).attr("src", "/skin/fcbkov.gif");
    });
    $("#fcbk a.fcbk img").mouseout(function(event) {
        $(this).attr("src", "/skin/fcbk.gif");
    });
    $("#fcbk a.twit img").mouseover(function(event) {
        $(this).attr("src", "/skin/twitov.gif");
    });
    $("#fcbk a.twit img").mouseout(function(event) {
        $(this).attr("src", "/skin/twit.gif");
    });
    $("#fcbk a.rss img").mouseover(function(event) {
        $(this).attr("src", "/skin/rssov.gif");
    });
    $("#fcbk a.rss img").mouseout(function(event) {
        $(this).attr("src", "/skin/rss.gif");
    });

    $("#newsin .foot a.mail").mouseover(function(event) {
        $(this).css("background-image", "url('/skin/icomailov.jpg')");
    });
    $("#newsin .foot a.mail").mouseout(function(event) {
        $(this).css("background-image", "url('/skin/icomail.jpg')");
    });
    $("#newsin .foot a.fav").mouseover(function(event) {
        $(this).css("background-image", "url('/skin/icofavov.jpg')");
    });
    $("#newsin .foot a.fav").mouseout(function(event) {
        $(this).css("background-image", "url('/skin/icofav.jpg')");
    });
    $("#newsin .foot a.print").mouseover(function(event) {
        $(this).css("background-image", "url('/skin/icoprintov.jpg')");
    });
    $("#newsin .foot a.print").mouseout(function(event) {
        $(this).css("background-image", "url('/skin/icoprint.jpg')");
    });
    $("#search input").val("Upišite pojam");
    $("#search input").click(function() {
        if ($(this).val() == "Upišite pojam") {
            $(this).val("");
            $(this).addClass("active");
        }
    });
    $("#search input").blur(function() {

        if ($(this).val() == "") {
            $(this).val("Upišite pojam");
            $(this).removeClass("active");
        }

    });
    $("#search a").click(function() {
        if ($("#search input").val() == "Upišite pojam" || $("#search input").val() == "") {
            return false;
        }
        return true;
    });
});

