<link rel="stylesheet" href="<?php echo $sitepath ?>styles.css" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300|Open+Sans+Condensed:300&amp;subset=latin,cyrillic-ext,greek-ext,greek,latin-ext,cyrillic' rel='stylesheet' type='text/css'>

<script type="text/javascript" src="<?php echo $sitepath ?>sf/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $sitepath ?>sf/dropdown.js"></script>
<script type="text/javascript" src="<?php echo $sitepath ?>sf/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="<?php echo $sitepath ?>sf/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo $sitepath ?>sf/jquery-ui-1.8.13.custom.min.js"></script>
<link type="text/css" rel="stylesheet" href="<?php echo $sitepath ?>sf/calendar/smoothness/jquery-ui-1.8.13.custom.css">
<link type="text/css" rel="stylesheet" href="<?php echo $sitepath ?>sf/scroll/jquery.jscrollpane.css" media="all">
<script type="text/javascript" src="<?php echo $sitepath ?>sf/scroll/jquery.mousewheel.js"></script>
<script type="text/javascript" src="<?php echo $sitepath ?>sf/scroll/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="<?php echo $sitepath ?>sf/highslide/highslide-with-gallery.js"></script>
<link type="text/css" rel="stylesheet" href="<?php echo $sitepath ?>sf/highslide/highslide.css">
<script type="text/javascript" src="https://cosmores.com/track.js"></script>
<?php if ($page=='location') { ?>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"></script>
<?php } ?>
<script type="text/javascript">
$(document).ready(function(){
	
<?php if ($page=='location') { ?>
<!--MAP -->	
function initialize() {
  var myLatlng = new google.maps.LatLng(<?php echo $x ?>,<?php echo $y ?>);
  var mapOptions = {
    zoom: 15,
    center: myLatlng
  }
  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

  var marker = new google.maps.Marker({
      position: myLatlng,
      map: map,
      title: 'Map'
  });
}

google.maps.event.addDomListener(window, 'load', initialize);
<?php } ?>

<!--CALENDAR -->
	$( "#arrivaldate" ).datepicker({ dateFormat: 'dd-mm-yy' });
	$( "#departuredate" ).datepicker({ dateFormat: 'dd-mm-yy' });
	});

 function onSelectCheckIn(selectedDate){
    var date = jQuery.datepicker.parseDate(
        jQuery(this).data("datepicker").settings.dateFormat ||
            jQuery.datepicker._defaults.dateFormat,
            selectedDate, jQuery(this).data("datepicker").settings
    );
    date = new Date(date.getFullYear(),date.getMonth(),date.getDate()+1);
    //document.title = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
    var maxdate = new Date(date.getFullYear(),date.getMonth(),date.getDate()+30);
    jQuery("#CHECK_OUT_DATE").datepicker("option","minDate",date);
    jQuery("#CHECK_OUT_DATE").datepicker("option","maxDate",maxdate);
    var cyear = date.getFullYear();
    var cmonth = date.getMonth()+1;
    var cday = date.getDate();
    if(cmonth<10){
        cmonth = "0"+cmonth;
    }
    if(cday<10){
        cday = "0"+cday;
    }
    setTimeout(function(){document.getElementById("CHECK_OUT_DATE").value=cday+"-"+cmonth+"-"+cyear;},250);
    //document.title = year+"-"+month+"-"+day;
}

 jQuery(document).ready(function(){
     var d = new Date();
     var curr_year = d.getFullYear();
     var curr_month = d.getMonth();
     var curr_day = d.getDate();
     jQuery("#CHECK_IN_DATE").datepicker({
            onSelect:onSelectCheckIn,
            showOtherMonths: true,
            selectOtherMonths: true,
            numberOfMonths: 1,
            minDate: new Date(curr_year, curr_month, curr_day),
            dateFormat: 'dd-mm-yy'
        });

     jQuery("#CHECK_OUT_DATE").datepicker({
        showOtherMonths: true,
        selectOtherMonths: true,
        numberOfMonths: 1,
        minDate: new Date(curr_year, curr_month, curr_day+1),
        dateFormat: 'dd-mm-yy',
    })
 

<!--DROPDOWN -->   
ddmegamenu.docinit({
  menuid:"navimenu",
  easing:"easeInOutCirc",
  dur: 200 
 })


	
<!--SCROLL -->
$('#pane1').jScrollPane({scrollbarWidth:10, scrollbarMargin:10 , showArrows:true, autoReinitialise: true, autoReinitialiseDelay: 500});



var settings = {
showArrows: true,
autoReinitialise: true
};
var pane = $('.scroll-pane')
pane.jScrollPane(settings);
				
	
<!--OPEN CLOSE -->	
$("#sslide").toggle(function() {
$("#maincontainer").hide("fade", { }, 1000);
$("#showhide").attr({ 
src: "<?php echo $sitepath ?>images/show.png",
title: "show",
alt: "show"
});
},function() {
$("#maincontainer").show("fade", { }, 1000);
$("#showhide").attr({ 
src: "<?php echo $sitepath ?>images/hide.png",
title: "hide",
alt: "hide"
});
});

<!-- EXTRAS
$("#slideextra1").toggle(function() {
$("#containerextra1").animate({right:"-450px"}, 1300);
},function() {
$("#containerextra1").animate({right:"0px"}, 1300);
});

$("#slideextra2").toggle(function() {
$("#containerextra2").show("fade", { }, 1000);
$("#slideextra2").attr({ 
});
},function() {
$("#containerextra2").hide("fade", { }, 1000);
$("#slideextra2").attr({ 
});
});

<!--HIGHSLIDE -->
	hs.graphicsDir = '<?php echo $sitepath ?>sf/highslide/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.wrapperClassName = 'dark borderless floating-caption';
	hs.fadeInOut = true;
	hs.dimmingOpacity = .90;

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

<!--TOGGLE -->
<?php if ($pages=='room.php' or $page=='room.php') { ?>
$(".toggle-container").show();
$("div.trigger").toggle(function(){
		$(this).removeClass("active"); 
		}, function () {
		$(this).addClass("active");
});
$("div.trigger").click(function(){
		$(this).next(".toggle-container").slideToggle("slow,");
});	

});

	<?php } else { ?>
	$(".toggle-container").hide();
$("div.trigger").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
});
$("div.trigger").click(function(){
		$(this).next(".toggle-container").slideToggle("slow,");
});	

});
	
	
<?php } ?>


<!--VALIDATE FORMS -->
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }


</script>

<?php echo $sitescript2 ?>

<!--PANORAMA -->
<script type="text/javascript">

$(document).ready(function() {	

	//select all the a tag with name equal to modal
	$('a[name=modal]').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();
		
		//Get the A tag
		var id = $(this).attr('href');
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(2000); 

	
	});
	
	//if close button is clicked
	$('.window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});			
	
});

</script>

<?php 
if ($pid=='') { 
$pid="1";
}
if ($page=='facilities') { 
$photopath=$sitepath."flash/facilities/";
}
?>
<!--SLIDESHOW -->	
<?php if ($pageurl!='location' AND $pages!='gallery.php') { ?>
<link rel="stylesheet" href="<?php echo $sitepath ?>sf/slideshow/supersized.css" type="text/css" media="screen">
<link rel="stylesheet" href="<?php echo $sitepath ?>sf/slideshow/supersized.shutter.css" type="text/css" media="screen">
<script type="text/javascript" src="<?php echo $sitepath ?>sf/slideshow/jquery.easing.min.js"></script>
<script type="text/javascript" src="<?php echo $sitepath ?>sf/slideshow/supersized.3.2.5.min.js"></script>
<script type="text/javascript" src="<?php echo $sitepath ?>sf/slideshow/supersized.shutter.min.js"></script>
		
		<script type="text/javascript">
			
			jQuery(function($){
				
				$.supersized({
				
					// Functionality
					slideshow               :   1,			// Slideshow on/off
					autoplay				:	1,			// Slideshow starts playing automatically
					start_slide             :   1,			// Start slide (0 is random)
					stop_loop				:	0,			// Pauses slideshow on last slide
					slide_interval          :   3000,		// Length between transitions
					transition              :   1, 			// 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
					transition_speed		:	700,		// Speed of transition
															   
					// Components							
					slide_links				:	'blank',	// Individual links for each slide (Options: false, 'num', 'name', 'blank')
					slides 					:  	[			// Slideshow Images
	
	<?php if ($pages=='index.php' OR $pages=='accommodation.php' OR $page=='facilities') { ?>
												
	{image : '<?php echo $photopath; ?>1.jpg', title : '', url : ''},  
	{image : '<?php echo $photopath; ?>2.jpg', title : '', url : ''},  
	{image : '<?php echo $photopath; ?>3.jpg', title : '', url : ''},
	{image : '<?php echo $photopath; ?>4.jpg', title : '', url : ''},
	{image : '<?php echo $photopath; ?>5.jpg', title : '', url : ''}
	
	<?php }else{?>
	
	{image : '<?php echo $photopath; ?><?php echo $pid; ?>.jpg', title : '', url : ''}
	
	<?php } ?>

              ]
				});
		    });
		    
		</script>
<?php } ?>        

<!--GALLERY -->
<?php if ($pages=='gallery.php') { ?>
		<link rel="stylesheet" href="<?php echo $sitepath ?>sf/slideshow1/supersized.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="<?php echo $sitepath ?>sf/slideshow1/supersized.shutter.css" type="text/css" media="screen" />
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
		<script type="text/javascript" src="<?php echo $sitepath ?>sf/slideshow1/jquery.easing.min.js"></script>
		<script type="text/javascript" src="<?php echo $sitepath ?>sf/slideshow1/supersized.3.2.7.min.js"></script>
		<script type="text/javascript" src="<?php echo $sitepath ?>sf/slideshow1/supersized.shutter.min.js"></script>
		
		<script type="text/javascript">
			
			jQuery(function($){
				
				$.supersized({
				
					// Functionality
					slideshow               :   1,			// Slideshow on/off
					autoplay				:	1,			// Slideshow starts playing automatically
					start_slide             :   1,			// Start slide (0 is random)
					stop_loop				:	0,			// Pauses slideshow on last slide
					random					: 	0,			// Randomize slide order (Ignores start slide)
					slide_interval          :   3000,		// Length between transitions
					transition              :   1, 			// 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
					transition_speed		:	1000,		// Speed of transition
					new_window				:	1,			// Image links open in new window/tab
					pause_hover             :   0,			// Pause slideshow on hover
					keyboard_nav            :   1,			// Keyboard navigation on/off
					performance				:	1,			// 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
					image_protect			:	1,			// Disables image dragging and right click with Javascript
															   
					// Size & Position						   
					min_width		        :   0,			// Min width allowed (in pixels)
					min_height		        :   0,			// Min height allowed (in pixels)
					vertical_center         :   1,			// Vertically center background
					horizontal_center       :   1,			// Horizontally center background
					fit_always				:	0,			// Image will never exceed browser width or height (Ignores min. dimensions)
					fit_portrait         	:   1,			// Portrait images will not exceed browser height
					fit_landscape			:   0,			// Landscape images will not exceed browser width
															   
					// Components							
					slide_links				:	'blank',	// Individual links for each slide (Options: false, 'num', 'name', 'blank')
					thumb_links				:	1,			// Individual thumb links for each slide
					thumbnail_navigation    :   0,			// Thumbnail navigation
					slides 					:  	[				// Slideshow Images
													
			 <?php
			$sql10 = "SELECT * FROM photos WHERE room_id='0' AND info_id='0' ORDER BY priority";
			$result10 = mysql_query($sql10);
			while ($myrow=mysql_fetch_array($result10)) {
			$photoid=$myrow['id'];
			$photo=$myrow['name'];
?> 
			{image : '<?php echo $sitepath ?>photos/<?php echo $photoid ?>.jpg', title : '', url : ''},
			<?php } ?>
				]
					
				});
		    });
		    
		</script>
        <?php } ?>

<?php echo $sitescript ?>