	$(document).ready(function(){
		$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
		
	});

	$(function() {

		$("#datepicker").datepicker();

	});
	
	$(function() {

		$("#datepickerTo").datepicker();

	});

	function closeWindow()
	{
		$.prettyPhoto.close();
	}

	function hidePage()
	{
		$('.pp_nav').hide();
	}

 
	function lookup(inputString) {
 
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			
			$.post("http://www.potovalka.si/ajax/iskanjeLetalskihKart.php", {queryString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup

	 function getBaseURL() {
		 

         return document.location.hostname + "/";
     }
     
	function fill(thisValue) {
		$('#inputString').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	
	function lookupDo(inputString) {
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			
			$.post("http://www.potovalka.si/ajax/iskanjeLetalskihKart.php?do=do&", {queryString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestionsDo').show();
					$('#autoSuggestionsListDo').html(data);
				}
			});
		}
	} // lookup
	
	function fillDo(thisValue) {
		$('#inputStringDo').val(thisValue);
		setTimeout("$('#suggestionsDo').hide();", 200);
	}
	
	function radioChange(thisValue) {

		if(thisValue.value == 'O')
		{
			document.getElementById('letNa').style.display='none'; 
		}
		else
			document.getElementById('letNa').style.display = 'block';
	}
	
	function focus(thisValue)
	{
		if(thisValue==1)
			document.getElementById('datepicker').focus();
		else
			document.getElementById('datepickerTo').focus();
		
	}
