$(document).ready(function(){ 

    $(document).pngFix(); 
    $("a").pngFix(); 
    
//fancybox    
    $("a.gallery").fancybox();
    
    $("a.gallery_oglasi").fancybox({
  		ajax : {
  		    type	: "POST"
  		}
	  })

//menu
  /*$('#menu').accordion({ 
      autoheight: false,
      active: '#active', 
      selectedClass: 'active' 
  });*/
  
//accordion
  var icons = {
			header: "ui-icon-circle-arrow-e",
			headerSelected: "ui-icon-circle-arrow-s"
	};
  $(".accordion").accordion({
			icons: icons,
			active: false,
      collapsible: true ,
      autoHeight: false 
	});
	
//fade
  $('#box1').innerfade({
  	speed: 1000,
  	timeout: 4000,
  	type: 'sequence',
  	containerheight: '300px'
	});


//preloader
    jQuery().ajaxStart(function() {
        jQuery("#preloader").addClass('loading');
    });

    jQuery().ajaxStop(function() {
        jQuery("#preloader").removeClass('loading');
    });

//tabs
	$('#faq_box > ul').tabs({ 
		 fx: { height: 'toggle', opacity: 'toggle' }
	});
	
	$('#paket_info > ul').tabs({ 
		 fx: { height: 'toggle', opacity: 'toggle' }
	});
 
//validacija e-nasova za newsletter
    $("#newsletter_prijava").validate({       
    	 rules: {
  				enaslov: {
  					required: true,
  					email: true
  				}
    		},
    		messages: {
    			enaslov: null
    		} 
    });
	   
/*
  $(".vsebina a.show_obvestilo").click(function () {
      $.get("/include/ajax/ajax.obvestilo.php", { id: $(this).attr("href")},
        function(data){
          $("#obvestila").html(data);
      });
  });*/
  
  
//http://stackoverflow.com/questions/185235/jquery-tabs-getting-newly-selected-index

  
  
  <!--

function setFocus()
{
    if (document.imp_login.imapuser.value == "") {
        document.imp_login.imapuser.focus();
    } else {
        document.imp_login.pass.focus();
    }
}


function submit_login(e)
{
    if (typeof e != 'undefined' && !enter_key_trap(e)) {
        return;
    }

    if (document.imp_login.imapuser.value == "") {
        alert('Prosim vpišite svoje uporabniško ime.');
        document.imp_login.imapuser.focus();
        return false;
    } else if (document.imp_login.pass.value == "") {
        alert('Prosim vpišite svoje geslo.');
        document.imp_login.pass.focus();
        return false;
    } else {
        document.imp_login.loginButton.disabled = true;
        document.imp_login.submit();
        return true;
    }
}
//-->
      
});
