﻿
//JQUERY Settings
jQuery(document).ready(function() {

    //SLIDE SHOW
    $(".bannerTop").cycle({
        fx: 'fade',
        speed: 3000,
        pause: 1
    });

    $("#banner254").cycle({
        fx: 'fade',
        speed: 3000,
        pause: 1
    });

    $("#banner252").cycle({
        fx: 'fade',
        speed: 3000,
        pause: 1
    });

    //    jQuery("ul.gallery").prettyGallery({
    //        itemsPerPage: 2,
    //        of_label: ' / ' /* The content in the page "1 of 2" */
    //    });

    $("a[rel^='prettyPhoto']").prettyPhoto({
        animationSpeed: 'normal', /* fast/slow/normal */
        padding: 40, /* padding for each side of the picture */
        opacity: 0.35, /* Value betwee 0 and 1 */
        showTitle: true, /* true/false */
        allowresize: true, /* true/false */
        counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
        theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
        callback: function() { }
    });

    //IZDVOJENE VJESTI
    var vrijednostVijesti;
    jQuery('#tabIzdvojeneNovosti1').css({ display: 'block' }); //set default open tab
    jQuery("ul#izdvojenocontainer li:first").addClass("current");
    jQuery("ul#izdvojenocontainer li").click(function() {
        jQuery("ul#izdvojenocontainer li").removeClass("current");
        jQuery(this).addClass("current");
        //jQuery(this).addClass("current");
        vrijednostVijesti = jQuery(this).find("a").attr('rel');
        jQuery('.sadrzajinfoContainer').css({ display: 'none' });
        jQuery("#" + vrijednostVijesti).css({ display: 'block' });
    });


    //VIDEO HOME
    var vrijednostTabaVideo;
    jQuery('#tabVideo1').css({ display: 'block' }); //set default open tab
    jQuery("ul#videomenu li:first").addClass("current");
    jQuery("ul#videomenu li").click(function() {
        jQuery("ul#videomenu li").removeClass("current");
        jQuery(this).addClass("current");
        vrijednostTabaVideo = jQuery(this).find("a").attr('rel');
        jQuery('.videodetalji').css({ display: 'none' });
        jQuery("#" + vrijednostTabaVideo).css({ display: 'block' });
    });

    //SMJESTAJ - GOOGLE MAP
    var vrijednostSmjestaj;
    jQuery('#tabSmjestaj1').css({ display: 'block' }); //set default open tab
    jQuery("ul#content-headmenu li:first").addClass("current");
    jQuery("ul#content-headmenu li").click(function() {
        jQuery("ul#content-headmenu li").removeClass("current");
        jQuery(this).addClass("current");
        vrijednostSmjestaj = jQuery(this).find("a").attr('rel');
        jQuery('.putovanja').css({ display: 'none' });
        jQuery("#" + vrijednostSmjestaj).css({ display: 'block' });
    });

    //KAKO DO NAS 
    var vrijednostKaKoDoNas;
    jQuery('#tabKakoDoNas0').css({ display: 'block' }); //set default open tab
    jQuery("ul#content-headmenumanji li a").click(function() {
        jQuery(this).removeClass("curentNull");
        jQuery(this).toggleClass("curent");
        vrijednostKaKoDoNas = jQuery(this).attr('rel');
        jQuery('.tabKako').css({ display: 'none' });
        jQuery("#" + vrijednostKaKoDoNas).css({ display: 'block' });
    });

    //KLIKABL MENI
    jQuery("li.menu_item_click a").click(function() {
        jQuery('li.menu_item_click').css({ display: 'none' });
    });

    $("a.mapFinderBattunClickOn").click(function() {
        $("#mapFinderDiv").slideToggle("slow");
        //ReloadIframe('iframe_mapfinder');
        document.getElementById("iframe_mapfinder").src = "googleMap.aspx?t=";
        return false;
    });

    $("a.mapFinderBattunClickOff").click(function() {
        $("#mapFinderDiv").slideToggle("slow");
        document.getElementById('iframe_mapfinder').src = "googleMap.aspx?t=";
        return false;
    });

});

