jQuery.noConflict(); 
jQuery(document).ready(function(){	
	jQuery(".domov").click(function(e) {
		// alert("domov");
		window.location = "/"
	});
	// jQuery("#gumb-isci").click(function(e) {
		// var key = jQuery("#key").val();
		// if (key != "") {
			// jQuery("#fleha").fadeIn();
			// getData("skripte/proces.php?id=iskanje&k=" + key , "prikaz-iskanje");
		// }
	// });
	
	// jQuery('body, html').keydown(function(e) {
		// if ((e.keyCode == 13) && (jQuery("#fleha").css("display") == "none")) {
			// if (jQuery("#iskalno-polje").val() != "Enter search here")
				// var key = jQuery("#key").val();
				// if (key != "") {
					// jQuery("#fleha").fadeIn();
					// getData("skripte/proces.php?id=iskanje&k=" + key , "prikaz-iskanje");
				// }
		// }
	// });	
	function mycarousel_initCallback(carousel)
	{
		// Disable autoscrolling if the user clicks the prev or next button.
		carousel.buttonNext.bind('click', function() {
			carousel.startAuto(0);
		});
	 
		carousel.buttonPrev.bind('click', function() {
			carousel.startAuto(0);
		});
	 
		// Pause autoscrolling if the user moves with the cursor over the clip.
		carousel.clip.hover(function() {
			carousel.stopAuto();
		}, function() {
			carousel.startAuto();
		});
	};
	 
	jQuery('#mycarousel').jcarousel({
		auto: 3,
		wrap: 'last',
		scroll: 1,
		initCallback: mycarousel_initCallback
	});
});

/* ######################################################## KODA KI SE NE SPREMINJA ##################################################################### */
/* DETECTIING IE6 - PRIKAZ OPOZORILA */
function getInternetExplorerVersion()
{
  var rv = -1; 
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion()
{
  var msg = "You're not using Internet Explorer.";
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver <= 6.0 ) {
		jQuery("#opozorilo").show();
		jQuery("#brskalniki").show();
		}	
	}
}

/* OPOZORILO ZA IE 6 */
var stanje = 0;
jQuery(document).ready(function() { 
	checkVersion()
	jQuery("#opozorilo").click(function() {
		switch(stanje) {
			case 0:
				jQuery("#brskalniki").animate({marginTop:0},"slow");
				jQuery("#opozorilo").animate({marginTop:150},"slow");	
				stanje = 1;
				break;
			case 1:
				jQuery("#brskalniki").animate({marginTop:-150},"slow");
				jQuery("#opozorilo").animate({marginTop:0},"slow");	
				stanje = 0;
				break;
		} 
	});	
}); 

/* VIŠINA STRANI */
function visinaStrani() {
    if (window.innerHeight && window.scrollMaxY) {// Firefox
        yWithScroll = window.innerHeight + window.scrollMaxY;
        xWithScroll = window.innerWidth + window.scrollMaxX;
    } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
        yWithScroll = document.body.scrollHeight;
        xWithScroll = document.body.scrollWidth;
    } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
        yWithScroll = document.body.offsetHeight;
        xWithScroll = document.body.offsetWidth;
      }
}

/* COOKIES */

function spremeniPrikaznoSliko(slika) {
	jQuery("#prikazna-slika").attr("src", "slike/galerija/" + slika)
}
 
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 ;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return ""
}

function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
}

