
$(document).ready( function(){
	
	 Shadowbox.init();
	
	if ( $("#slider").length > 0 ) {
		$("#slider").easySlider({
				prevText:'<',
				nextText:'>',
				orientation:'vertical'
			});
	}		

		
	 $(".apt_block").mouseover(function(){
		 $(this).css({'backgroundColor' : '#333'});
	 });
	 
	 $(".apt_block").mouseout(function(){

		 $(this).css({'backgroundColor' : 'transparent'});
	 });

	 
	 
	 if ( $("#mycarousel").length > 0 ) {
		 jQuery('#mycarousel').jcarousel({
				vertical: true,
				scroll: 2
		});
	 }
	 
	 if ( $(".panorama").length > 0 ) {
		 
		$("img.panorama").hide();
		$("img.panorama").panorama();
	}

	$('.fade').innerfade({ 
	 speed: 'slow', 
	 timeout: 7000, 
	 type: 'sequence', 
	 containerheight: '1.5em' });
	
	if ( $("#startDate").length > 0 ) {
		
			$('.date-pick').datePicker()
				$('#startDate').bind(
					'dpClosed',
					function(e, selectedDates)
					{
						var d = selectedDates[0];
						if (d) {
							d = new Date(d);
							$('#endDate').dpSetStartDate(d.addDays(1).asString());
						}
					}
				);
				$('#endDate').bind(
					'dpClosed',
					function(e, selectedDates)
					{
						var d = selectedDates[0];
						if (d) {
							d = new Date(d);
							$('#startDate').dpSetEndDate(d.addDays(-1).asString());
						}
					}
				);
	}

	if ( $("#country").length > 0 ) 
		$("#country").autocomplete(countries);

	$("#btnchechavail").hide();
	$("#agreeterms").click(function(){
		if ( $("#agreeterms:checked").length )
			$("#btnchechavail").show();
		else 
			$("#btnchechavail").hide();
	 });

  } ); 
  
  
  
  
var remote;
function launchWin(helpURL, size)
{
 // size string should have the format of 'width=#,height=#'
 // this avoids having to change all the function calls to launchHelp()
 var firstEqual = size.indexOf("=")+1;
 var comma = size.indexOf(",")+1;
 var secondEqual = size.lastIndexOf("=")+1;
 var sizeLen = size.length;

 var w = parseInt(size.substring(firstEqual, comma));
 var h = parseInt(size.substring(secondEqual, sizeLen));

 var xPos = (screen.height-h)/2;
 var yPos = (screen.width-w)/2;
 //alert(size);
 remote = window.open(helpURL, null, size+",scrollbars=0,resizable=1,left="+yPos+",top="+xPos+"", true);
 remote.focus();
}
