  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-16192227-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
function validate()
{	
	missinginfo="";
	if(document.ClientQueryForm.Name.value=="")
	{
		missinginfo += "\n     -  Name missing ";
	}
	if(document.ClientQueryForm.Address.value=="")
	{
		missinginfo += "\n     -  Address missing ";
	}
	if(document.ClientQueryForm.Country.value=="")
	{
		missinginfo += "\n     -  Country Is missing ";
	}
	if(document.ClientQueryForm.Email.value=="")
	{
		missinginfo += "\n     -  Email Address Is missing ";
	}
	if(document.ClientQueryForm.mobile.value=="")
	{
		missinginfo += "\n     -  mobile/Telephone Number Is missing ";
	}
	
	if(document.ClientQueryForm.room.value=="")
	{
		missinginfo += "\n     -  Choose Room Category ";
	}
	
	
		if(document.ClientQueryForm.noroom2.value=="")
	{
		missinginfo += "\n     -  No. of People ";
	}
	if(document.ClientQueryForm.demo1.value=="")
	{
		missinginfo += "\n     -  Checkin Date Is missing ";
	}
		if(document.ClientQueryForm.demo2.value=="")
	{
		missinginfo += "\n     -  Checkout Date Is missing ";
	}
	

	
			if((document.ClientQueryForm.pickup[0].checked==false)&& (document.ClientQueryForm.pickup[1].checked==false)&& (document.ClientQueryForm.pickup[2].checked==false)&& (document.ClientQueryForm.pickup[3].checked==false))
	{
		missinginfo += "\n     -  Pickup ";
	}
		if(document.ClientQueryForm.Questions.value=="")
	{
		missinginfo += "\n     -  Time of Arival ";
	}

	
	if (missinginfo != "") {
	missinginfo ="_____________________________\n" +
	"Please fill in the following fields :\n" +
	missinginfo + "\n_____________________________" ;
	alert(missinginfo);
	return false;
	}
	else
	{
		document.ClientQueryForm.action="formmail.php";
		document.ClientQueryForm.submit();
	}
}

$(function() {
		$('#dp1').datepicker({
			numberOfMonths: 2,
			showButtonPanel: true,
			dateFormat:"dd/mm/yy",
			minDate: -0,
		    onSelect: function(dateText, inst) {
			var dt1=$('#dp1').datepicker("getDate");
			var dt2="";
			dt2+=dt1.getMonth()+1+'/';
			dt2+=dt1.getDate()+1+'/';
			dt2+=dt1.getFullYear();
			document.getElementById('dp2').value;
			//document.getElementById('dp2').value=dt2;
			$("#dp2").datepicker( "option", "minDate", $('#dp1').datepicker("getDate"));

			}

		});
		$('#dp2').datepicker({
			numberOfMonths: 2,
			showButtonPanel: true,
			dateFormat:"dd/mm/yy",
			minDate: -0
			
		});
		

	});




var picture= [

{
src : "images/banner4.jpg", // The URL (path) of picture
mes : "<strong>Room</strong>", // The message (comment), in this sample with embedded HTML-tag
url : "#"
}, // Comma required

{
src : "images/banner3.jpg",
mes : "<strong>Room</strong>",
url : "#"
}, // Comma required

{
src : "images/banner7.jpg",
mes : "<strong>Lobby</strong>",
url : "#"
}, // Comma required

{
src : "images/banner6.jpg",
mes : "<strong>Lobby</strong>",
}, // Comma required

{
src : "images/banner.jpg",
mes : "<strong>Lobby</strong>",
url : "#"
}, // Comma required

{
src : "images/banner5.jpg",
mes : "<strong>Outdoor</strong>",
url : "#"
}, // Comma required

{
src : "images/banner2.jpg",
mes : "<strong>Bathroom</strong>",
url : "#"
}, // Comma required
{
src : "images/banner8.jpg",
mes : "<strong>Bathroom</strong>",
url : "#"
} // ATTENTION: the last bracket requires no comma!!!

]

// target of the picture-links ("_blank", "_top", "_self", "_parent" or "nameOfYourFrame")
var target_url="_blank"
	
// number of lamellas.
var x_slices=8

// width of slideshow (pixels)
var slideshow_width=541

// height of slideshow (pixels)
var slideshow_height=381

// pause beween the pictures (seconds)
var pause=2

var imgpreload=new Array()
for (iii=0;iii<=picture.length-1;iii++) {
	imgpreload[iii]=new Image()
	imgpreload[iii].src=picture[iii].src
}

var picturewidth
var pictureheight
var i_loop=0
var i_picture=0
var width_slice
var cliptop=0
var clipbottom
var i_clipright=1
var contentimg=""
var contentmes=""
pause=pause*1000


function initiate() {
	getcontent()
	for (i=0;i<=x_slices;i++) {
     	var thisinnersimg=eval("document.getElementById('s"+i+"')")
		var thisinnersmes=eval("document.getElementById('t"+i+"')")
		thisinnersimg.innerHTML=contentimg
		thisinnersmes.innerHTML=contentmes
		var thissimg=eval("document.getElementById('s"+i+"').style")
		thissimg.left=0+"px"
		thissimg.top=0+"px"
		var thissmes=eval("document.getElementById('t"+i+"').style")
		thissmes.left=0+"px"
		thissmes.top=0+"px"
  	}
	var thisspan=eval("document.getElementById('s0')")
	width_slice=Math.ceil(slideshow_width/x_slices)
	clipbottom=slideshow_height
	document.getElementById("whole").style.left=0+"px"
	document.getElementById("whole").style.top=0+"px"
	i_picture++
	openlamellar()
}

function openlamellar() {
	clipleft=-width_slice
	clipright=0
    if (i_clipright<=width_slice) {
        for (i=0;i<=x_slices;i++) {
            var thissimg=eval("document.getElementById('s"+i+"').style")
			var thissmes=eval("document.getElementById('t"+i+"').style")
            thissimg.clip ="rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)"
			thissmes.clip ="rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)"
            clipleft+=width_slice
            clipright=clipleft+i_clipright
		}
    i_clipright++
    var timer=setTimeout("openlamellar()",20)
   	}
   	else {
		clearTimeout(timer)
		document.getElementById("whole").innerHTML="<span style='position:absolute;top:0px;left:0px'>"+contentimg+"</span><span style='position:absolute;top:0px;left:0px'>"+contentmes+"</span>"
		var timer=setTimeout("changepicture()",pause)
	}
}

function getcontent() {
	contentimg="<table cellpadding=0 cellspacing=0 border=0 width="+slideshow_width+" height="+slideshow_height+"><tr><td width="+slideshow_width+" height="+slideshow_height+"'><img src="+picture[i_picture].src+" border=0 width="+slideshow_width+" height="+slideshow_height+"></td></tr></table>"
	contentmes="<table cellpadding=0 cellspacing=0 border=0 width="+slideshow_width+" height="+slideshow_height+"><tr valign=top><td class='messagealignstyle'><div class='messageboxstyle' style='width:"+slideshow_width+"px;'><a class='messagefontstyle' href='"+picture[i_picture].url+"' target='"+target_url+"'>"+picture[i_picture].mes+"</a></div></td></tr></table>"
}

function changepicture() {
	i_clipright=0
	clipleft=0
	clipright=0
	for (i=0;i<=x_slices;i++) {
       	var thiss=eval("document.getElementById('s"+i+"').style")
    	thiss.clip ="rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)"
	}
	if (i_picture>picture.length-1) {i_picture=0}
	getcontent()

	for (i=0;i<=x_slices;i++) {
        var thisinnersimg=eval("document.getElementById('s"+i+"')") 
		var thisinnersmes=eval("document.getElementById('t"+i+"')")
        thisinnersimg.innerHTML=contentimg
		thisinnersmes.innerHTML=contentmes
    }
	i_picture++
	openlamellar()
}

document.write("<div class='borderandshadowstyle' style='position:relative;width:"+slideshow_width+"px;height:"+slideshow_height+"px;overflow:hidden'>")
document.write("<span id='whole' style='position:absolute;top:0px;left:0px;width:"+slideshow_width+"px;height:"+slideshow_height+"px;'></span>")
for (i=0;i<=x_slices;i++) {
 	document.write("<span id='s"+i+"' style='position:absolute;top:0px;left:0px;width:"+slideshow_width+"px;height:"+slideshow_height+"px;'></span>")
document.write("<span id='t"+i+"' style='position:absolute;top:0px;left:0px;width:"+slideshow_width+"px;height:"+slideshow_height+"px;'></span>")
}
document.write("</div>")
document.close()
window.onload=initiate
