// VIRTUAL WALK VIEWER
$('html').addClass('js');
$(document).ready(function() {
    if ($(".home-vwalk .scroll li").length<=5){ $(".home-vwalk .arrow").hide(); }
    $(".home-vwalk .scroll a").click(function(){
          var link = $(this).attr("rel");
          var imgLink = $(this).children().attr('src').replace('preview','image');
          $(this).addClass("on").siblings().removeClass("on");
          $(".home-vwalk h3 span").text($(this).attr("title"));
          $(".home-vwalk .view").html('<a rel="'+link+'" title=""><img src="'+imgLink+'" alt="" /></a>'); 
    });
    
    $('.home-vwalk .view a').live('click',function(){
      var objectLink = $(this).attr("rel");
      $(this).parent().html('<embed type="video/quicktime" name="walk" src="'+objectLink+'" scale="tofit" pluginspage="http://www.apple.com/quicktime" autoplay="false" controller="true" bgcolor="ffffff"  height="300" width="435">')
    });
});


// HOME PAGE SHORT INFO
$(document).ready(function() {
    $("#home-short-info .box").not(":first").hide();
    $("#home-short-info .box h3").hide();
    $("#home-short-info h2:first").after('<ul class="supl-nav"></ul>');
    $("#home-short-info .box").each(function(i){
        var varClass = "";
        if(i==0){ varClass="on"; }
        else if (i==2){ varClass="last"; }
        $("#home-short-info .supl-nav").append('<li class="'+varClass+'"><a><span>'+$(this).find("h3:first").text()+'</span></a></li>');
    });
    $("#home-short-info .supl-nav li").click(function(){
        $(this).addClass("on").siblings().removeClass("on");
        $("#home-short-info .box:eq("+$(this).prevAll("li").length+")").show().siblings(".box").hide();
    });
});

// CUFON
Cufon.replace('h1, .home-box:not(:first-child) h2, #calendarBox .title a');

// SEARCH FORM
$(function(){
	$('#frmSearch input[type="text"]').focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
});

// FLOATING BANNER
$(function(){
  /*if ( $('body').hasClass('.lang_hr') && $('#contentBox').hasClass('.home') ) {
    $('#floating-banner').css({'display':'block'});
    $('#floating-banner .close').click(function(){
      $(this).parent().remove();
      return false;
    });
  }*/
});
