$(document).ready(function() {
  
	$('.accordion').accordion({ active: false, header: 'h2', clearStyle: true, fillSpace: true, navigation: true, collapsible: true });
	//tabs start 
 	var tabContainers = $('div.tabs > div');
    
    	$('div.tabs ul.tabNavigation a').click(function () {
        	tabContainers.hide().filter(this.hash).show();
        
        $('div.tabs ul.tabNavigation a').removeClass('selected');
        $(this).addClass('selected');
        
        return false;
    	}).filter(':first').click();
	//tabs end

	// search box click
	var searchBoxField = $('.search-box .pfo-text');
	var searchBoxFieldDefault = "Pretraži";	
	searchBoxField.focus(function(){
		if($(this).attr("value") == searchBoxFieldDefault) $(this).attr("value", "");
		$(this).addClass("active");
	});
	searchBoxField.blur(function(e){ 
		if($(this).attr("value") == "") $(this).attr("value", searchBoxFieldDefault);
		$(this).removeClass("active");
	});

	// newsletter box click
	var newsletterBoxField = $('.newsletter .n-text');
	var newsletterBoxFieldDefault = "Unesite svoju email adresu";	
	newsletterBoxField.focus(function(){
		if($(this).attr("value") == newsletterBoxFieldDefault) $(this).attr("value", "");
		$(this).addClass("active");
	});
	newsletterBoxField.blur(function(e){ 
		if($(this).attr("value") == "") $(this).attr("value", newsletterBoxFieldDefault);
		$(this).removeClass("active");
	});

    // disable form submit on enter key press
    //$("form").keypress(function(e) { if (e.keyCode == 13) return false; });

    //Add pointer class to .photo .item
    $(".photo .item").addClass("pointer");

    //Hover over photo fade in hidden span
    $(".photo .item").hover(
        function() {
            $(this).find("span").fadeIn();
        },
        function() {
            $(this).find("span").fadeOut();
        }
    );  
    
    $('.login').hover(function(){
        //mouse over
            $(this).stop().animate({"top" :"-47px"});
        }, function(){
        //mouse out
            $(this).stop().animate({"top" :"-121px"});
    }); 
    
     var isIE = (navigator.appName=="Microsoft Internet Explorer");
     if (isIE) { 
        $('.login').hover(function(){
        //mouse over
            $(this).stop().animate({"top" :"-7px"});
        }, function(){
        //mouse out
            $(this).stop().animate({"top" :"-79px"});
    }); 
     }
     
   
});


