$(document).ready (function () {
		
	/* 	Carousel Gallery
	*/	
    jQuery('#mycarousel').jcarousel({
		scroll: 2
    });
	$("div.jcarousel-skin-tango").addClass("hidden2");
		
	/* 	Lightbox - Galerija
	*/
	$('li.jcarousel-item a').lightBox();
	
	/* 	Tabs
	*/
	var tabClick = function () {
		$("ul#tabs li.active").removeClass("active");
		$(this).addClass("active");
		if ($(this).attr("id") == "tab2" || $(this).attr("id") == "tab3") { 
			$("div.jcarousel-skin-tango").removeClass("hidden2"); 
		}
		else { 
			$("div.jcarousel-skin-tango").addClass("hidden2"); 
		}
	}
	$("li.tab").bind ("click", tabClick);
	
	/*	Lightbox - Uvjeti korištenja
	*	-	iznimka za tekst riješen u jquery.lightbox-0.5.js
	*/
	$('a#uko').lightBox();
	
	/* Text input behaviour  */
  var textInputs = $('input.text');
  textInputs
    // Store default values
    .each (function () {
      $(this).data ('default', {value: $(this).val()});
    })
    // Clear element on focus if default value
    .focus (function () {
      if ($(this).val () === $(this).data ('default').value) {
        $(this).val ('');
      }
    })
    // Restore element on blur if empty
    .blur (function () {
      if ($(this).val () === '') {
        $(this).val ($(this).data ('default').value);
      }
    });
	
});
