
	   /* hs.graphicsDir = '../highslide/graphics/'; */
    hs.outlineType = null;
    hs.wrapperClassName = 'colored-border';
    hs.align = 'center';
    hs.transitions = ['expand', 'crossfade'];
    //hs.outlineType = 'rounded-white';
    hs.fadeInOut = true;
    hs.dimmingOpacity = 0.75;

    // Add the controlbar
    hs.addSlideshow({
    	//slideshowGroup: 'group1',
    	interval: 5000,
    	repeat: false,
    	useControls: true,
    	fixedControls: 'fit',
    	overlayOptions: {
    		opacity: 0.75,
    		position: 'bottom center',
    		hideOnMouseOut: true
    	}
    });



    var timeouts = [4.8,4.5,4.9,4.4,4.5,4.3,4.2,4.3,4.5,4.2,4.4,4.3];
    
    function calculateTimeout(currElement, nextElement, opts, isForward) {
    	//var index = opts.currSlide;
    	return 5 * 1000;
    }        
    
    $(document).ready(function() {

    	
        $('.slideshow').cycle({
            fy: 'fade',
        	speed:  'fast',
        	timeoutFn: calculateTimeout
    	});
    	
    	
    	$('.tabs').tabs();
    	
    	$("#unitSelect").change(function() {
        	if($(this).attr("value") != 0) {
	    		$.ajax({
	    			  url: $(this).attr("value"),
	    			  beforeSend: function() {
	  			  			$("#loading").show();
	  			  			
	    			  },
	    			  success: function(data){
	    			    $("#unit").html(data);
	    			    $("#loading").hide();
	    			    
	    			    
	    			  },
	    			  statusCode: {
	    					404: function() {
	    			    	alert('page not found');
	    			  		}
	    			  }    			  
	    		});
        	} else {
        		$("#unit").html("");
        	}
	        		
    	});	

    	  $('img.scale').imgscale({ 
    		    parent : '.image-container', 
    		    fade : 1000,
    		    scale: "fill"
    		  }); 

    	/*
  		var dates = $( "#from, #to, #departure").datepicker({
  	  		dateFormat: "dd.mm.yy",
			defaultDate: "+1w",
			changeMonth: true,
			numberOfMonths: 2,
			onSelect: function( selectedDate ) {
				var option = this.id == "from" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" ),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
			}
		});
		*/
    	  
    	  
  		var dates = $( "#validfrom, #validto").datepicker({
  	  		dateFormat: "dd.mm.yy",
			defaultDate: "+1w",
			changeMonth: true,
			numberOfMonths: 2,
			onSelect: function( selectedDate ) {
				var option = this.id == "validfrom" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" ),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
			}
		});


		$( ".date" ).datepicker({
			dateFormat: "dd.mm.yy",
			changeMonth: true,
			changeYear: true,
			yearRange: '1910:2015'
		})	


		$( "#from, #departure" ).datepicker({
			dateFormat: "dd.mm.yy",
			changeMonth: true,
			changeYear: true
		})		

		$("#same-address").change(function() {

			if($(this).attr('checked')) {
				$(".hide").fadeIn("fast");	
			} else {
				$(".hide").fadeOut("fast");
			}
						
			
		});	


	$("#c-insurance").change(function() {
		
		if($(this).val() == 1) {
			$(".hiddenCheck").fadeIn("fast");
		} else if($(this).val() == 0) {
			$(".hiddenCheck").fadeOut("fast");
		}
	});	



		$(".banners-container").fadeIn("slow");

		$( "#accordion" ).accordion({
			autoHeight: false,
			navigation: true
		});
});    


