/* Modernizr 2.0.6 (Custom Build) | MIT & BSD
 * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-canvas-canvastext-audio-video-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
 */
;window.Modernizr=function(a,b,c){function E(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return D(d,b)}function D(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function C(a,b){return!!~(""+a).indexOf(b)}function B(a,b){return typeof a===b}function A(a,b){return z(o.join(a+";")+(b||""))}function z(a){k.cssText=a}var d="2.0.6",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l,m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={},r={},s={},t=[],u=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["&shy;","<style>",a,"</style>"].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},v=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=B(e[d],"function"),B(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),w,x={}.hasOwnProperty,y;!B(x,c)&&!B(x.call,c)?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],c)};var F=function(a,c){var d=a.join(""),f=c.length;u(d,function(a,c){var d=b.styleSheets[b.styleSheets.length-1],g=d.cssRules&&d.cssRules[0]?d.cssRules[0].cssText:d.cssText||"",h=a.childNodes,i={};while(f--)i[h[f].id]=h[f];e.csstransforms3d=i.csstransforms3d.offsetLeft===9,e.generatedcontent=i.generatedcontent.offsetHeight>=1,e.fontface=/src/i.test(g)&&g.indexOf(c.split(" ")[0])===0},f,c)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",o.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join(""),['#generatedcontent:after{content:"',m,'";visibility:hidden}'].join("")],["fontface","csstransforms3d","generatedcontent"]);q.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},q.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},q.canvastext=function(){return!!e.canvas&&!!B(b.createElement("canvas").getContext("2d").fillText,"function")},q.rgba=function(){z("background-color:rgba(150,255,150,.5)");return C(k.backgroundColor,"rgba")},q.hsla=function(){z("background-color:hsla(120,40%,100%,.5)");return C(k.backgroundColor,"rgba")||C(k.backgroundColor,"hsla")},q.multiplebgs=function(){z("background:url(https://),url(https://),red url(https://)");return/(url\s*\(.*?){3}/.test(k.background)},q.backgroundsize=function(){return E("backgroundSize")},q.borderimage=function(){return E("borderImage")},q.borderradius=function(){return E("borderRadius")},q.boxshadow=function(){return E("boxShadow")},q.textshadow=function(){return b.createElement("div").style.textShadow===""},q.opacity=function(){A("opacity:.55");return/^0.55$/.test(k.opacity)},q.cssanimations=function(){return E("animationName")},q.csscolumns=function(){return E("columnCount")},q.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";z((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return C(k.backgroundImage,"gradient")},q.cssreflections=function(){return E("boxReflect")},q.csstransforms=function(){return!!D(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},q.csstransforms3d=function(){var a=!!D(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d);return a},q.csstransitions=function(){return E("transitionProperty")},q.fontface=function(){return e.fontface},q.generatedcontent=function(){return e.generatedcontent},q.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}}catch(e){}return c},q.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}catch(d){}return c};for(var G in q)y(q,G)&&(w=G.toLowerCase(),e[w]=q[G](),t.push((e[w]?"":"no-")+w));z(""),j=l=null,e._version=d,e._prefixes=o,e._domPrefixes=p,e.hasEvent=v,e.testProp=function(a){return D([a])},e.testAllProps=E,e.testStyles=u,g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+t.join(" "):"");return e}(this,this.document),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css";if(!a.e&&(w||r)){var e=function(a){m(function(){if(!d)try{a.sheet.cssRules.length?(d=1,j()):e(a)}catch(b){b.code==1e3||b.message=="security"||b.message=="denied"?(d=1,m(function(){j()},0)):e(a)}},0)};e(c)}else c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload();m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return Object(a)===a},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function e(a,b,e,g,h){var i=f(a),j=i.autoCallback;if(!i.bypass){b&&(b=D(b)?b:b[a]||b[g]||b[a.split("/").pop().split("?")[0]]);if(i.instead)return i.instead(a,b,e,g,h);e.load(i.url,i.forceCSS||!i.forceJS&&/css$/.test(i.url)?"c":c,i.noexec),(D(b)||D(j))&&e.load(function(){d(),b&&b(i.origUrl,h,g),j&&j(i.origUrl,h,g)})}}function b(a,b){function c(a){if(C(a))e(a,h,b,0,d);else if(B(a))for(i in a)a.hasOwnProperty(i)&&e(a[i],h,b,i,d)}var d=!!a.test,f=d?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var g,h,i=this.yepnope.loader;if(C(a))e(a,0,i,0);else if(A(a))for(g=0;g<a.length;g++)h=a[g],C(h)?e(h,0,i,0):A(h)?H(h):B(h)&&b(h,i);else B(a)&&b(a,i)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=d()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};;
(function ($) {
  Drupal.sn_weather = {};
  Drupal.sn_weather.updateCityTitle = function updateCityTitle(text) {
    if(!text) {
      currentCityName = $('#edit-field-weather-city-tid :selected').text();
      $('.city-list b').text(currentCityName);
    } else {
      $('.city-list b').text(text);
    }
  };

  Drupal.behaviors.weatherSelectCity = { 
    attach: function(context, settings) {
      $('form#views-exposed-form-weather-block').once('sn_weather_city_name', function() {
        Drupal.sn_weather.updateCityTitle();
      });

      var cities = [];

      if ($('#weather-city-list ul li').length == 0){
        $('#edit-field-weather-city-tid option').each(function(i, selected){
          city = $(selected).text();
          val = $(selected).val();
          cities[i] = $(selected).text();
          $('#weather-city-list ul').append('<li selectid="'+ val +'">' + city + '</li>');
        });
      }

      /**
       * Reacts on click event on big city name. This will open dropdown
       * of all possible cities.
       */
      $('.city-list b').unbind('click');
      $('.city-list b').click(function() {

      	// If dropdown shown, hide it and then turn active city to red.
      	if ($('.city-list').hasClass('active')) {

      	  // We have to inform other bindings that dropdown is already in process of hiding.
      	  $('.city-list').addClass('hiding');

      	  // Hide dropdown.
      	  $('.city-list #weather-city-list').slideToggle(
            'fast',
            function() {
              $('.city-list').toggleClass('active');
              $('.city-list').removeClass('hiding'); 	
            }
          );
      	}
  
      	// If dropdown is hidden first turn active city to white and then show dropdown.
      	else {
          $('.city-list').toggleClass('active');
      	  $('.city-list #weather-city-list').slideToggle();
      	}

      }); // $('.city-list b').click()

      /**
       * Hides dropdown if mouse leaves it.
       */
      $('.city-list').unbind('mouseleave');
      $('.city-list').mouseleave(function() {

        // Hide dropdown only if not already hiding.
        if ($('.city-list').hasClass('active') && !$('.city-list').hasClass('hiding')) {

          $('.city-list #weather-city-list').slideToggle(
            'fast',
            function() {
              $('.city-list').toggleClass('active');    
            }
          );    

        }

      }); // $('.city-list').mouseleave()

      /**
       * Show selected city and trigger ajax request for new weather data.
       */
      $('#weather-city-list ul li').unbind('click');
      $('#weather-city-list ul li').click(function() {
        
        // Make this city active and move previously active city to dropdown.
        $('#weather-city-list ul li').removeClass("active");
        $(this).addClass("active");
        $('#edit-field-weather-city-tid').val($(this).attr('selectid'));

        // Update the city name
        Drupal.sn_weather.updateCityTitle($(this).text());

        // Hide popup menu
        $('.city-list').addClass('hiding');
        $('.city-list #weather-city-list').slideToggle(
	        'fast',
	        function() {
	          $('.city-list').toggleClass('active');
	          $('.city-list').removeClass('hiding');  	
          }
        );

        // Trigger ajax request.
        var timeoutID;
        if ((timeoutID)) {
          clearTimeout(timeoutID);
        }
        timeoutID = setTimeout(function() { $('form#views-exposed-form-weather-block').find('.ctools-auto-submit-click').click(); }, 300);
      }); //  $('#weather-city-list ul li').click()
    }
  };
}(jQuery));;
/*
* Slides, A Slideshow Plugin for jQuery
* Intructions: http://slidesjs.com
* By: Nathan Searles, http://nathansearles.com
* Version: 1.1.9
* Updated: September 5th, 2011
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(a){a.fn.slides=function(b){return b=a.extend({},a.fn.slides.option,b),this.each(function(){function w(g,h,i){if(!p&&o){p=!0,b.animationStart(n+1);switch(g){case"next":l=n,k=n+1,k=e===k?0:k,r=f*2,g=-f*2,n=k;break;case"prev":l=n,k=n-1,k=k===-1?e-1:k,r=0,g=0,n=k;break;case"pagination":k=parseInt(i,10),l=a("."+b.paginationClass+" li."+b.currentClass+" a",c).attr("href").match("[^#/]+$"),k>l?(r=f*2,g=-f*2):(r=0,g=0),n=k}h==="fade"?b.crossfade?d.children(":eq("+k+")",c).css({zIndex:10}).fadeIn(b.fadeSpeed,b.fadeEasing,function(){b.autoHeight?d.animate({height:d.children(":eq("+k+")",c).outerHeight()},b.autoHeightSpeed,function(){d.children(":eq("+l+")",c).css({display:"none",zIndex:0}),d.children(":eq("+k+")",c).css({zIndex:0}),b.animationComplete(k+1),p=!1}):(d.children(":eq("+l+")",c).css({display:"none",zIndex:0}),d.children(":eq("+k+")",c).css({zIndex:0}),b.animationComplete(k+1),p=!1)}):d.children(":eq("+l+")",c).fadeOut(b.fadeSpeed,b.fadeEasing,function(){b.autoHeight?d.animate({height:d.children(":eq("+k+")",c).outerHeight()},b.autoHeightSpeed,function(){d.children(":eq("+k+")",c).fadeIn(b.fadeSpeed,b.fadeEasing)}):d.children(":eq("+k+")",c).fadeIn(b.fadeSpeed,b.fadeEasing,function(){a.browser.msie&&a(this).get(0).style.removeAttribute("filter")}),b.animationComplete(k+1),p=!1}):(d.children(":eq("+k+")").css({left:r,display:"block"}),b.autoHeight?d.animate({left:g,height:d.children(":eq("+k+")").outerHeight()},b.slideSpeed,b.slideEasing,function(){d.css({left:-f}),d.children(":eq("+k+")").css({left:f,zIndex:5}),d.children(":eq("+l+")").css({left:f,display:"none",zIndex:0}),b.animationComplete(k+1),p=!1}):d.animate({left:g},b.slideSpeed,b.slideEasing,function(){d.css({left:-f}),d.children(":eq("+k+")").css({left:f,zIndex:5}),d.children(":eq("+l+")").css({left:f,display:"none",zIndex:0}),b.animationComplete(k+1),p=!1})),b.pagination&&(a("."+b.paginationClass+" li."+b.currentClass,c).removeClass(b.currentClass),a("."+b.paginationClass+" li:eq("+k+")",c).addClass(b.currentClass))}}function x(){clearInterval(c.data("interval"))}function y(){b.pause?(clearTimeout(c.data("pause")),clearInterval(c.data("interval")),u=setTimeout(function(){clearTimeout(c.data("pause")),v=setInterval(function(){w("next",i)},b.play),c.data("interval",v)},b.pause),c.data("pause",u)):x()}a("."+b.container,a(this)).children().wrapAll('<div class="slides_control"/>');var c=a(this),d=a(".slides_control",c),e=d.children().size(),f=d.children().outerWidth(),g=d.children().outerHeight(),h=b.start-1,i=b.effect.indexOf(",")<0?b.effect:b.effect.replace(" ","").split(",")[0],j=b.effect.indexOf(",")<0?i:b.effect.replace(" ","").split(",")[1],k=0,l=0,m=0,n=0,o,p,q,r,s,t,u,v;if(e<2)return a("."+b.container,a(this)).fadeIn(b.fadeSpeed,b.fadeEasing,function(){o=!0,b.slidesLoaded()}),a("."+b.next+", ."+b.prev).fadeOut(0),!1;if(e<2)return;h<0&&(h=0),h>e&&(h=e-1),b.start&&(n=h),b.randomize&&d.randomize(),a("."+b.container,c).css({overflow:"hidden",position:"relative"}),d.children().css({position:"absolute",top:0,left:d.children().outerWidth(),zIndex:0,display:"none"}),d.css({position:"relative",width:f*3,height:g,left:-f}),a("."+b.container,c).css({display:"block"}),b.autoHeight&&(d.children().css({height:"auto"}),d.animate({height:d.children(":eq("+h+")").outerHeight()},b.autoHeightSpeed));if(b.preload&&d.find("img:eq("+h+")").length){a("."+b.container,c).css({background:"url("+b.preloadImage+") no-repeat 50% 50%"});var z=d.find("img:eq("+h+")").attr("src")+"?"+(new Date).getTime();a("img",c).parent().attr("class")!="slides_control"?t=d.children(":eq(0)")[0].tagName.toLowerCase():t=d.find("img:eq("+h+")"),d.find("img:eq("+h+")").attr("src",z).load(function(){d.find(t+":eq("+h+")").fadeIn(b.fadeSpeed,b.fadeEasing,function(){a(this).css({zIndex:5}),a("."+b.container,c).css({background:""}),o=!0,b.slidesLoaded()})})}else d.children(":eq("+h+")").fadeIn(b.fadeSpeed,b.fadeEasing,function(){o=!0,b.slidesLoaded()});b.bigTarget&&(d.children().css({cursor:"pointer"}),d.children().click(function(){return w("next",i),!1})),b.hoverPause&&b.play&&(d.bind("mouseover",function(){x()}),d.bind("mouseleave",function(){y()})),b.generateNextPrev&&(a("."+b.container,c).after('<a href="#" class="'+b.prev+'">Prev</a>'),a("."+b.prev,c).after('<a href="#" class="'+b.next+'">Next</a>')),a("."+b.next,c).click(function(a){a.preventDefault(),b.play&&y(),w("next",i)}),a("."+b.prev,c).click(function(a){a.preventDefault(),b.play&&y(),w("prev",i)}),b.generatePagination?(b.prependPagination?c.prepend("<ul class="+b.paginationClass+"></ul>"):c.append("<ul class="+b.paginationClass+"></ul>"),d.children().each(function(){a("."+b.paginationClass,c).append('<li><a href="#'+m+'">'+(m+1)+"</a></li>"),m++})):a("."+b.paginationClass+" li a",c).each(function(){a(this).attr("href","#"+m),m++}),a("."+b.paginationClass+" li:eq("+h+")",c).addClass(b.currentClass),a("."+b.paginationClass+" li a",c).click(function(){return b.play&&y(),q=a(this).attr("href").match("[^#/]+$"),n!=q&&w("pagination",j,q),!1}),a("a.link",c).click(function(){return b.play&&y(),q=a(this).attr("href").match("[^#/]+$")-1,n!=q&&w("pagination",j,q),!1}),b.play&&(v=setInterval(function(){w("next",i)},b.play),c.data("interval",v))})},a.fn.slides.option={preload:!1,preloadImage:"/img/loading.gif",container:"slides_container",generateNextPrev:!1,next:"next",prev:"prev",pagination:!0,generatePagination:!0,prependPagination:!1,paginationClass:"pagination",currentClass:"current",fadeSpeed:350,fadeEasing:"",slideSpeed:350,slideEasing:"",start:1,effect:"slide",crossfade:!1,randomize:!1,play:0,pause:0,hoverPause:!1,autoHeight:!1,autoHeightSpeed:350,bigTarget:!1,animationStart:function(){},animationComplete:function(){},slidesLoaded:function(){}},a.fn.randomize=function(b){function c(){return Math.round(Math.random())-.5}return a(this).each(function(){var d=a(this),e=d.children(),f=e.length;if(f>1){e.hide();var g=[];for(i=0;i<f;i++)g[g.length]=i;g=g.sort(c),a.each(g,function(a,c){var f=e.eq(c),g=f.clone(!0);g.show().appendTo(d),b!==undefined&&b(f,g),f.remove()})}})}})(jQuery);
// Hides messages in poll when updated via AJAX.
function hidepollmess() {
  jQuery('.poll .messages').fadeOut();
}

(function ($) {



  Drupal.behaviors.slovenskenovice = {
    attach: function(context, settings) {

      $("body").once("slovenskenovice", function(){

        // on hover hide all images and only show hovered
        $('.infocus-images li').fadeOut().css('z-index','0');
        $('.infocus-images li.first').css('z-index','3').fadeIn().addClass("active");
        $('.infocus-links li.first a').addClass("active");

        $('.infocus-slider .infocus-links a').mouseover(function(){
          if(!$(this).hasClass("active")) {
            var nodeID = $(this).attr("data-nid");

            $(this).parents('.infocus-slider').find('.infocus-links li a.active').removeClass("active");
            $(this).addClass("active");

            $(this).parents('.infocus-slider').find('.infocus-images li.active').stop(false, true).css('z-index','0').fadeOut();
            $(this).parents('.infocus-slider').find('.infocus-images li').removeClass("active");
            $(this).parents('.infocus-slider').find('.infocus-images li[data-nid='+nodeID+']').stop(false, true).css('z-index','3').fadeIn().addClass("active");
          }
        });
        
        // We add a class to the poll radio button wrapper, because IE7 doesn't understand
        // the :after pseudo. We do it with JS, because Drupal is pretty stupid when outputing
        // the choices
        if ($.browser.msie == true && $.browser.version < 8) {
          $("#sidebar .poll .form-type-radio").addClass("clearfix");
        }

        //add alttext to horoscope
        $(".view-sn-horoscope-sign .views-field-name .field-content a").each(function() {
          $(this).attr("title", $(this).html());
          $(this).attr("alt", $(this).html());

          var wrapper =  $(this).parents("td").find('.views-field-field-horoscope-sign-picture');
          $(wrapper).find('img').attr("title", $(this).html());
          $(wrapper).find('img').attr("alt", $(this).html());

          $(wrapper).find('a').attr("title", $(this).html());
          $(wrapper).find('a').attr("alt", $(this).html());
        });

        /* HOT TOPICS */
        /* Initiate the slides jquery plugin */
        $('.hot-topics-wrapper').slides({
          container: 'view-content',
          paginationClass: 'hot-topics-buttons',
          currentClass: 'active',
          effect: 'fade',
          play: 3000,
          hoverPause: true,
          fadeSpeed: 300,
          slideSpeed: 0,
          crossfade: false,
          autoHeightSpeed: 0
        });

        /**
         * remove space in empty divs on empty panels regions
         */
        $('.logged-in .panels-ipe-sort-container div').each(function() {
          if(!$(this).attr('class') &&  $(this).html() == "&nbsp;") {
            $(this).html('');
          }
        });

        /**
         * UGC mosaic hover effect.
         */
        $(".view-id-kategorija_mosaic article .article-header a").animate({"opacity": "0"}, "0")
        $(".view-id-kategorija_mosaic article .article-header a").hover(
          function () {
            $(this).stop().animate({"opacity": "1"}, "fast");
          }, 
          function () {
            $(this).stop().animate({"opacity": "0"}, "fast");
          }
        );

        /**
         * set BG position
         */
        // ?!? Je ta koda ?!?
        /*if($("body.kapitalno-dark-background").length > 0) {
          
          // Contextual links are relatively positioned and
          // mess up upit possition()
          if ($("#block-system-main .contextual-links-region:first").length > 0) {
            var kapitalnoYposition = $("#block-system-main").position();
          }
          else {
            var kapitalnoYposition = $("#front-news-grid").position();
          }
          
          var kapitalnoHeight = $("#front-news-grid").height();
          var backgroundWrapperYposition = $("#background-wrapper").position();
          var bgYposition = 800 - (kapitalnoYposition.top - backgroundWrapperYposition.top + kapitalnoHeight + 25);

          $('#background-wrapper').css("background-position","0px -"+bgYposition+"px");
        }*/

        Drupal.behaviors.slovenskenovice.equalheights('.view-display-id-cat_subcat_news_4 .attachment-before');
        Drupal.behaviors.slovenskenovice.equalheights('.view-sn-front-cat-blocks .views-row-1');
        Drupal.behaviors.slovenskenovice.equalheights('.view-display-id-cat_subcat_news_5 .attachment-before');

        /*$(".more-weather").hide();

        $(".region-weather .view-id-weather").hover(
          function () {
            $(".more-weather").slideDown(200);
          }, 
          function () {
            $(".more-weather").slideUp(100);
          }
        );*/

      });
      
      // Hide messages on poll when updated via AJAX.
      setTimeout("hidepollmess()", 4000);
    },
    
    // reload page if needed
    page_reload: function(selector) {
      if (Drupal.settings.slovenskenovice.allow_refresh == 1) {
        location.href = location.href;
      }
    },
    
    // disables auto refresh
    page_reload_disable: function(selector) {
      Drupal.settings.slovenskenovice.allow_refresh = 0;
    },
      
    // enables auto refresh
    page_reload_enable: function(selector) {
      Drupal.settings.slovenskenovice.allow_refresh = 1;
    },

    equalheights: function(selector) {
      $('.content-cols').each(function(){
        var heightLeft = $(this).find('.content-col-left ' + selector).height();
        var heightRight = $(this).find('.content-col-right ' + selector).height();

        if(heightLeft > heightRight) {
          $(this).find('.content-col-right ' + selector).css('height', heightLeft + "px");
        } else {
          $(this).find('.content-col-left ' + selector).css('height', heightRight + "px");
        }

        //define min height for small article (secondary aticle)
        var smallArticleHeight = 0;

        $(this).find('.small-article').each(function(){
          if($(this).height() > smallArticleHeight) {
            smallArticleHeight = $(this).height();
          }
        });

        $(this).find('.small-article').css('height',smallArticleHeight + "px");
      });
    }
  }; // End of Drupal.behaviours
  
  
  $(document).ready(function() {
    var sn_reload_timeout = setInterval("Drupal.behaviors.slovenskenovice.page_reload(1);", 5*60*1000);
  });
  
  
  /**
   * Fancybox
   */
  
  // A general selector for fancybox iframe 
  $(document).ready(function() {
    $(".fancybox-iframe").fancybox({
      'type' : 'iframe', 
      'overlayColor'  : '#000', 
      'overlayOpacity' : '0.85' , 
      'onStart' : Drupal.sn_fancybox.fancyboxOnStart, 
      'onClosed' : Drupal.sn_fancybox.fancyboxOnClosed 
    });
  });

})(jQuery);;
(function ($) {

Drupal.behaviors.initColorboxDefaultStyle = {
  attach: function (context, settings) {
    $(document).bind('cbox_complete', function () {
      // Hide the title if empty.
      if ($('#cboxTitle:empty', context).length == true) {
        $('#cboxTitle', context).hide();
      }
    });
  }
};

})(jQuery);
;

