function a() {
if (document.getElementById("checkin").value=="Pick Date") {alert("Please pick a 'Check In' date!");return false;}
//else if (document.getElementById("checkout").value=="Pick Date") {alert("Please pick a 'Check Out' date!");return false;}
}

function ff(a,b,c,d,e) {
msgbox = document.getElementById("f1");
var scrolledX, scrolledY;
if( self.pageYOffset ) {scrolledX = self.pageXOffset;scrolledY = self.pageYOffset;}
else if( document.documentElement && document.documentElement.scrollTop ) {scrolledX = document.documentElement.scrollLeft;scrolledY = document.documentElement.scrollTop;}
else if( document.body ) {scrolledX = document.body.scrollLeft;scrolledY = document.body.scrollTop;}

var centerX, centerY;
if( self.innerHeight ) {centerX = self.innerWidth;centerY = self.innerHeight;}
else if( document.documentElement && document.documentElement.clientHeight ) {centerX = document.documentElement.clientWidth;centerY = document.documentElement.clientHeight;}
else if( document.body ) {centerX = document.body.clientWidth;centerY = document.body.clientHeight;}

var leftOffset = scrolledX + (centerX - document.getElementById("f1").style.width.substr(0,3)) / 2;
var topOffset = scrolledY + (centerY - document.getElementById("f1").style.height.substr(0,3)) / 2;
var o=document.getElementById("f1");
var r=o.style;
r.top = topOffset + 'px';
r.left = leftOffset + 'px';
r.display = "block"; 

document.getElementById("url").value=a;
document.getElementById("title").value=b;
document.getElementById("desc").value=c;
document.getElementById("blink").value=d;
document.getElementById("id").value=e;
}

function dis() {
document.getElementById("checkin").disabled="disabled";
document.getElementById("adults").disabled="disabled";
document.getElementById("child").disabled="disabled";
document.getElementById("rooms").disabled="disabled";
document.getElementById("room").disabled="disabled";
document.getElementById("nyts").disabled="disabled";
document.getElementById("fname").disabled="disabled";
document.getElementById("lname").disabled="disabled";
document.getElementById("pone").disabled="disabled";
document.getElementById("email").disabled="disabled";
document.getElementById("country").disabled="disabled";
document.getElementById("guests").disabled="disabled";
document.getElementById("transfer").disabled="disabled";
document.getElementById("airport").disabled="disabled";
document.getElementById("hour").disabled="disabled";
document.getElementById("min").disabled="disabled";
document.getElementById("flight").disabled="disabled";
document.getElementById("special").disabled="disabled";
}

function en() {
document.getElementById("checkin").disabled="";
document.getElementById("adults").disabled="";
document.getElementById("child").disabled="";
document.getElementById("rooms").disabled="";
document.getElementById("room").disabled="";
document.getElementById("nyts").disabled="";
document.getElementById("fname").disabled="";
document.getElementById("lname").disabled="";
document.getElementById("pone").disabled="";
document.getElementById("email").disabled="";
document.getElementById("country").disabled="";
document.getElementById("guests").disabled="";
document.getElementById("transfer").disabled="";
document.getElementById("airport").disabled="";
document.getElementById("hour").disabled="";
document.getElementById("min").disabled="";
document.getElementById("flight").disabled="";
document.getElementById("special").disabled="";
document.getElementById("fname").focus();
document.getElementById("fname").select();
}

function dtt() {
var m = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec");
DaysToAdd=document.getElementById("nyts").value;
var now=new Date(document.getElementById("checkin").value);
var newdate=new Date(document.getElementById("checkin").value);
var newtimems=newdate.getTime()+(DaysToAdd*24*60*60*1000);
newdate.setTime(newtimems);
document.getElementById("here").innerHTML=newdate.toLocaleString();
document.getElementById("here").innerHTML="(Check Out: " + newdate.getUTCDate() + " " + m[newdate.getMonth()] + " " + newdate.getFullYear() + ")";
}

function lod(list){
i=0;
imageObj=new Image();
image=new Array();
pool=new Array();
inside=new Array();
outside=new Array();
room=new Array();
villa1=new Array();
villa2=new Array();
photos=new Array();
photos[0]='http://www.mountainviewcyprus.com/img/articles/inside-mountain-view-hotel.jpg';
photos[1]='http://www.mountainviewcyprus.com/img/articles/mountain-view-hotel-swimming-pool.jpg';
photos[2]='http://www.mountainviewcyprus.com/img/articles/one-bedroom-villa.jpg';
photos[3]='http://www.mountainviewcyprus.com/img/articles/outside-mountain-view-hotel.jpg';
photos[4]='http://www.mountainviewcyprus.com/img/articles/standard-hotel-room.jpg';
photos[5]='http://www.mountainviewcyprus.com/img/articles/two-bedroom-villa.jpg';

pool[0]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool6.jpg';
pool[1]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool1.jpg';
pool[2]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool4.png';
pool[3]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool3.png';
pool[4]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool0.jpg';
pool[5]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool7.jpg';
pool[6]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool2.png';
pool[7]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool5.png';
pool[8]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool6.png';
pool[9]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool1.png';
pool[10]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool4.jpg';
pool[11]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool3.jpg';
pool[12]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool0.png';
pool[13]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool7.png';
pool[14]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/moun41.jpg';
pool[15]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool2.jpg';
pool[16]='http://www.mountainviewcyprus.com/img/gallery-photos/pool/pool5.jpg';

inside[0]='http://www.mountainviewcyprus.com/img/gallery-photos/inside/restaurant2.jpg';
inside[1]='http://www.mountainviewcyprus.com/img/gallery-photos/inside/bar2.jpg';
inside[2]='http://www.mountainviewcyprus.com/img/gallery-photos/inside/lobby2.jpg';
inside[3]='http://www.mountainviewcyprus.com/img/gallery-photos/inside/lobby1.jpg';
inside[4]='http://www.mountainviewcyprus.com/img/gallery-photos/inside/restaurant.jpg';
inside[5]='http://www.mountainviewcyprus.com/img/gallery-photos/inside/bar1.jpg';
inside[6]='http://www.mountainviewcyprus.com/img/gallery-photos/inside/reception.jpg';
inside[7]='http://www.mountainviewcyprus.com/img/gallery-photos/inside/restaurant1.jpg';

outside[0]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside8.jpg';
outside[1]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside1.jpg';
outside[2]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside6.jpg';
outside[3]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside7.jpg';
outside[4]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside0.jpg';
outside[5]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside9.jpg';
outside[6]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside3.jpg';
outside[7]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside4.jpg';
outside[8]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside11.jpg';
outside[9]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside10.jpg';
outside[10]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside5.jpg';
outside[11]='http://www.mountainviewcyprus.com/img/gallery-photos/outside/outside2.jpg';

room[0]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/room/standard-hotel-room-6.jpg';
room[1]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/room/standard-hotel-room-1.jpg';
room[2]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/room/standard-hotel-room-0.jpg';
room[3]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/room/standard-hotel-room-7.jpg';
room[4]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/room/standard-hotel-room-4.jpg';
room[5]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/room/standard-hotel-room-3.jpg';
room[6]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/room/standard-hotel-room-2.jpg';
room[7]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/room/standard-hotel-room-5.jpg';

villa1[0]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa1/one-bedroom-villa-1.jpg';
villa1[1]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa1/one-bedroom-villa-0.jpg';
villa1[2]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa1/one-bedroom-villa-4.jpg';
villa1[3]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa1/one-bedroom-villa-3.jpg';
villa1[4]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa1/one-bedroom-villa-2.jpg';
villa1[5]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa1/one-bedroom-villa-5.jpg';

villa2[0]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa2/two-bedroom-villa-2.jpg';
villa2[1]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa2/two-bedroom-villa-5.jpg';
villa2[2]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa2/two-bedroom-villa-4.jpg';
villa2[3]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa2/two-bedroom-villa-3.jpg';
villa2[4]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa2/two-bedroom-villa-0.jpg';
villa2[5]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa2/two-bedroom-villa-7.jpg';
villa2[6]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa2/two-bedroom-villa-6.jpg';
villa2[7]='http://www.mountainviewcyprus.com/img/gallery-photos/rooms/villa2/two-bedroom-villa-1.jpg';

if (list=="pool") {images=pool;}
else if (list=="photos") {images=photos;}
else if (list=="room") {images=room;}
else if (list=="villa1") {images=villa1;}
else if (list=="villa2") {images=villa2;}
else if (list=="inside") {images=inside;}
else if (list=="outside") {images=outside;}

for(i=0; i<=(images.length - 1); i++) {imageObj=new Image();imageObj=images[i];}
}




function JSONscriptRequest(fullUrl) {
this.fullUrl = fullUrl;
this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
this.headLoc = document.getElementsByTagName("head").item(0);
this.scriptId = 'YJscriptId' + JSONscriptRequest.scriptCounter++;
}

JSONscriptRequest.scriptCounter = 1;
JSONscriptRequest.prototype.buildScriptTag = function () {
this.scriptObj = document.createElement("script");    
this.scriptObj.setAttribute("type", "text/javascript");
this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
this.scriptObj.setAttribute("id", this.scriptId);
}

JSONscriptRequest.prototype.removeScriptTag = function () {this.headLoc.removeChild(this.scriptObj);}

JSONscriptRequest.prototype.addScriptTag = function () {this.headLoc.appendChild(this.scriptObj);}

function getExchangeRates(xvalue,xfrom,xto,xround) {
if (xvalue > 0) {
var xxdiv = Math.floor(Math.random()*99999999);
document.write("<span id='xxresult_"+xxdiv+"'></span>");
document.getElementById('xxresult_'+xxdiv).innerHTML = "<span style='color: #cccccc;'>Calculating ... please wait</span>";
request = 'http://currencyconverter.55uk.net/currencyxml.json.php?xfrom='+xfrom+'&xto='+xto+'&xvalue='+xvalue+'&xround='+xround+'&callback=getMyRate&mydiv='+xxdiv;
aObj = new JSONscriptRequest(request);
aObj.buildScriptTag();
aObj.addScriptTag();		
}
}

function getExchangeRatesDiv(xxxdiv,xvalue,xfrom,xto,xround) {
if (xvalue > 0) {
document.getElementById(xxxdiv).innerHTML = "<span style='color: #cccccc;'>Calculating ... please wait</span>";
request = 'http://currencyconverter.55uk.net/currencyxml.json.php?do=cform&xfrom='+xfrom+'&xto='+xto+'&xvalue='+xvalue+'&xround='+xround+'&callback=getMyRates&mydiv='+xxxdiv;
aObj = new JSONscriptRequest(request);
aObj.buildScriptTag();
aObj.addScriptTag();		
}
}

function getMyRates(jData) {
if (jData == null) {alert("There was a problem parsing search results.");return;}
var myval = jData.ResultSet;
var mydiv = jData.xxMyDiv;
document.getElementById(mydiv).innerHTML =  myval;
}

function myPrivateConverterOne(xd,xv,xbase){
var xxxt = document.getElementById('xxxto').value;
if (xv > 0) {getExchangeRatesDiv(xd,xv,xbase,xxxt,'true');}
}

function s(price) {
var scrolledX, scrolledY;
if( self.pageYOffset ) {scrolledX = self.pageXOffset;scrolledY = self.pageYOffset;}
else if( document.documentElement && document.documentElement.scrolltop ) {scrolledX = document.documentElement.scrollLeft;scrolledY = document.documentElement.scrolltop;}
else if( document.body ) {scrolledX = document.body.scrollLeft;scrolledY = document.body.scrolltop;}

// Next, determine the coordinates of the center of browser's window

var centerX, centerY;
if( self.innerHeight ) {centerX = self.innerWidth;centerY = self.innerHeight;}
else if( document.documentElement && document.documentElement.clientHeight ) {centerX = document.documentElement.clientWidth;centerY = document.documentElement.clientHeight;}
else if( document.body ) {centerX = document.body.clientWidth;centerY = document.body.clientHeight;}

var Xwidth=document.getElementById("conv").style.width.substr(0,3)
var Yheight=document.getElementById("conv").style.height.substr(0,2)

// Xwidth is the width of the div, Yheight is the height of the
// div passed as arguments to the function:
var leftoffset = scrolledX + (centerX - Xwidth) / 2;
var topOffset = scrolledY + (centerY - Yheight) / 3;
// The initial width and height of the div can be set in the
// style sheet with display:none; divid is passed as an argument to // the function

document.getElementById("conv").style.position='absolute';
document.getElementById("conv").style.top = topOffset + 'px';
document.getElementById("conv").style.left = leftoffset + 'px';
document.getElementById("conv").style.display = "block";
document.getElementById("price").innerHTML="&pound;"+price+".00 GBP";
document.getElementById("xxxto").name=price+".00";
}


