﻿// JScript File

MidX=screen.availWidth/2
MidY=screen.availHeight/2

function popup(url,w,h)
 {
    var nWin = window.open(url,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,top='+MidX/2+',resizable=yes,width='+w+',height='+h);
    nWin.focus();
 }

function showDiv(val)
{
    if(document.getElementById(val).style.display == 'none')
    {
        document.getElementById(val).style.display = 'block';
    }
}

function hideDiv(val)
{
   if(document.getElementById(val).style.display == 'block')
    {
        document.getElementById(val).style.display = 'none';
    }
}

function showContent(section)
{
    ActiveLink(section);
    
    document.getElementById('children').style.display = 'none';
    document.getElementById('dining').style.display = 'none';
    document.getElementById('leisure').style.display = 'none';
    document.getElementById('services').style.display = 'none';
    document.getElementById('conferences').style.display = 'none';
                
    document.getElementById(section).style.display = '';
}
    
function closeMe()
{
    document.getElementById('moreDetailsDiv').style.display = 'none';
}

function ShowSelectedMenu(id,count)
{

    for(var i =1; i<=count;i++)
    {

        document.getElementById('link_'+i).className = 'gray';
    }
    document.getElementById(id).className = 'grayOver';
}

function ShowSelectedHeading(id,count)
{
    for(var i =1; i<=count;i++)
    {

        document.getElementById('headerLink_'+i).className = 'gray';
    }
    document.getElementById(id).className = 'grayOver';
}
function BannerImage(imgName)
{
    clearTimeout(t);
    clearTimeout(t1);
    clearTimeout(t2);
    clearTimeout(t3);
    clearTimeout(t4);
    clearTimeout(t5);
    clearTimeout(t6);
    j=0;
    j1=0;
    j2=0;
    j3=0;
    j4=0;
    j5=0;
    j6=0;
    
    if(imgName == '')
    {
        imgName = 'gallery';
    }
    document.getElementById('SlideShow').src = "}images/Banners/"+ imgName + ".jpg";
}

function closeRecomendDiv(id)
{
    document.getElementById(id).style.display = 'none';
}

function showRecomendDiv(id)
{
    strHTML = document.getElementById(id).innerHTML;
    while ((strHTML.substring(0, 1) == ' ') || (strHTML.substring(0, 1) == '\n') || (strHTML.substring(0, 1) == '\r'))
        strHTML = strHTML.substring(1, strHTML.length - 1);
    if (strHTML.substring(0, 7) == '<!--###')
    {
        strHTML = strHTML.substring(7, strHTML.length - 6);
        document.getElementById(id).innerHTML = strHTML;
    }
    document.getElementById(id).style.display = 'block';
}

function closeBirdView()
{
    document.getElementById('birdViewDiv').style.display = 'none';
}

function rates(id)
{
    document.getElementById('tarifs').style.display = 'none';
    document.getElementById('flyin').style.display = 'none';
    
    document.getElementById(id).style.display = '';
}
 
function VisualTours(page)
{
    document.getElementById('visualTourFrame').src = 'VisualTours/'+ page +'/high/'+ page +'.html'
    
    document.getElementById('RiverPathway').className = 'gray';
    document.getElementById('Bungalows').className = 'gray';
    document.getElementById('BungalowsInterior').className = 'gray';
    document.getElementById('LoungeArea').className = 'gray';
    document.getElementById('Spa1').className = 'gray';
    //document.getElementById('Gym').className = 'gray';
    
    if(page != "Spa")
    {
        document.getElementById(page).className = 'grayOver';
    }
    else
    {
        document.getElementById(page+'1').className = 'grayOver';
    }
}    

function showVisualTour(page,vtName)
{
    document.getElementById('birdViewVisualTour').src = 'VisualTours/'+ page +'/low/'+ page +'.html';
    document.getElementById('BirdViewPicDiv').style.display = 'none';
    document.getElementById('vtName').innerHTML = vtName;
}

function showPicture(pic)
{
    document.getElementById('birdViewImg').src = '}images/pics/BirdView/'+pic+'.jpg';
    document.getElementById('BirdViewVisualDiv').style.display = 'none';
}

function selectedImage(id)
{
    document.getElementById(id).style.backgroundColor = '#d6e0de';
    document.getElementById(id).style.border = 'solid 1px #8fafa7';
    
    document.getElementById(id).onmouseover = null;
    document.getElementById(id).onmouseout = null;
}

function selectImage(id)
{
    document.getElementById(id).style.backgroundColor = '#d6e0de';
    document.getElementById(id).style.border = 'solid 1px #8fafa7';
}

function unselectedImage(id)
{
    document.getElementById(id).style.backgroundColor = 'transparent';
    document.getElementById(id).style.border = 'solid 1px transparent';
}

function NavOver(val, ImageName)
{
    document.getElementById(val).src = ImageName;
}

function NavOut(val, ImageName)
{
    document.getElementById(val).src = ImageName;
}



function emptyData(val,val2)
{
   if(document.getElementById(val).value == val2)
   {
        document.getElementById(val).value = '';
   }
}

function fillData(val,val2)
{
   if(document.getElementById(val).value == '')
   {
        document.getElementById(val).value = val2;
   }
}

 function ConfirmPrint() {
	var answer = confirm("Are you sure you want to print this page?")
	if (answer){
		window.print();
		document.getElementById('mapDiv').style.display = 'none';
	}
	else
	    document.getElementById('mapDiv').style.display = 'none';
}

function BrowserChecker()
{
    var agt=navigator.userAgent.toLowerCase();
	var is_mac = (agt.indexOf("mac")!=-1);
	var MidX=screen.availWidth/2;
	
	if(is_mac)
	{
	    if(agt.indexOf("safari/419.3") != -1)
        {
            document.getElementById('iconsDiv');
        }
		else if(agt.indexOf("mozilla/5.0") != -1)
		{
		   
        }
       
        else if(agt.indexOf("opera/9.10") != -1)
        {
            
        }
		else
		{
            
        }
	}
	else
	{
		if(agt.indexOf("mozilla/5.0") != -1)
		{
            alert(document.getElementById('iconsDiv'));
		} 
		else if(agt.indexOf("opera/9.10") != -1)
        {
            alert(document.getElementById('iconsDiv'));
        }
		else
		{
            alert(document.getElementById('iconsDiv'));
		}
	}	
		
}

function ActiveLink(link)
{
    var obj = document.getElementById('img_'+link);
    
    document.getElementById('img_children').src = '}images/subNavs/children.gif';
    document.getElementById('img_dining').src = '}images/subNavs/dining.gif';
    document.getElementById('img_leisure').src = '}images/subNavs/leisure.gif';
    document.getElementById('img_services').src = '}images/subNavs/services.gif';
    document.getElementById('img_conferences').src = '}images/subNavs/conferences.gif';
    
    obj.src = '}images/subNavs/'+ link +'_o.gif';;
}

function showSelected(val,len)
{
    for(k = 1; k<len; k++)
    {
        document.getElementById("cont_"+k).className = 'gray';
    }
    document.getElementById(val).className = 'grayOver';
}

var slideShowSpeed = 20;
    
var crossFadeDuration = 10
var Pic = new Array()
var pgName = "";

for(var k = 0; k < 3; k++)
{
    Pic[k] = '}images/banners/activities/'+ eval(k+1) +'.jpg';
}

var t
var j = 0
var p = Pic.length

var preLoad = new Array()

for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   
   preLoad[i].src = Pic[i]
 }

var count = 0;
var slideSpeed = 10000;


function runactivitiesSlideShow()
{
clearTimeout(t1);
clearTimeout(t2);
clearTimeout(t3);
clearTimeout(t4);
clearTimeout(t5);
clearTimeout(t6);
j1=0;
j2=0;
j3=0;
j4=0;
j5=0;
j6=0;

if (document.all){
    document.images.SlideShow.style.filter="blendTrans(duration=2)"
    document.images.SlideShow.style.filter="blendTrans(duration=3)"
    document.images.SlideShow.filters.blendTrans.Apply()   
    document.images.SlideShow.style.display = 'block';
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all){
    document.images.SlideShow.filters.blendTrans.Play();
}

j = j + 1
if (j > (p-1)) j=0 
   
   t = setTimeout('runactivitiesSlideShow()', slideSpeed);
   
}
//dinings    
var Pic1 = new Array()
var pgName1 = "";

for(var k = 0; k < 3; k++)
{
    Pic1[k] = '}images/banners/dinings/'+ eval(k+1) +'.jpg';
}

var t1
var j1 = 0
var p = Pic1.length

var preLoad1 = new Array()

for (i = 0; i < p; i++){
   preLoad1[i] = new Image()
   
   preLoad1[i].src = Pic1[i]
 }

var count1 = 0;
var slideSpeed1 = 10000;


function rundiningSlideShow()
{
    clearTimeout(t);
    clearTimeout(t2);
    clearTimeout(t3);
    clearTimeout(t4);
    clearTimeout(t5);
    clearTimeout(t6);
    j=0;
    j2=0;
    j3=0;
    j4=0;
    j5=0;
    j6=0;

    if (document.all){
        document.images.SlideShow.style.filter="blendTrans(duration=2)"
        document.images.SlideShow.style.filter="blendTrans(duration=3)"
        document.images.SlideShow.filters.blendTrans.Apply()   
        document.images.SlideShow.style.display = 'block';
    }
    document.images.SlideShow.src = preLoad1[j1].src;
    if (document.all){
    document.images.SlideShow.filters.blendTrans.Play();
}

j1 = j1 + 1
if (j1 > (p-1)) j1=0 
   
   t1 = setTimeout('rundiningSlideShow()', slideSpeed);
   
}


//facilities
var Pic2 = new Array()
var pgName2 = "";

for(var k = 0; k < 3; k++)
{
    Pic2[k] = '}images/banners/facilities/'+ eval(k+1) +'.jpg';
}

var t2
var j2 = 0
var p = Pic2.length

var preLoad2 = new Array()

for (i = 0; i < p; i++){
   preLoad2[i] = new Image()
   
   preLoad2[i].src = Pic2[i]
 }

var count2 = 0;
var slideSpeed2 = 10000;


function runfacilitiesSlideShow()
{
clearTimeout(t);
clearTimeout(t1);
clearTimeout(t3);
clearTimeout(t4);
clearTimeout(t5);
clearTimeout(t6);
j=0;
j1=0;
j3=0;
j4=0;
j5=0;
j6=0;

if (document.all){
    document.images.SlideShow.style.filter="blendTrans(duration=2)"
    document.images.SlideShow.style.filter="blendTrans(duration=3)"
    document.images.SlideShow.filters.blendTrans.Apply()   
    document.images.SlideShow.style.display = 'block';
}
document.images.SlideShow.src = preLoad2[j2].src;
if (document.all){
    document.images.SlideShow.filters.blendTrans.Play();
}

j2 = j2 + 1
if (j2 > (p-1)) j2=0 
   
   t2 = setTimeout('runfacilitiesSlideShow()', slideSpeed);
   
}

//spa
var Pic3 = new Array()
var pgName3 = "";

for(var k = 0; k < 3; k++)
{
    Pic3[k] = '}images/banners/spa/'+ eval(k+1) +'.jpg';
}

var t3
var j3 = 0
var p = Pic3.length

var preLoad3 = new Array()

for (i = 0; i < p; i++){
   preLoad3[i] = new Image()
   
   preLoad3[i].src = Pic3[i]
 }

var count3 = 0;
var slideSpeed3 = 10000;


function runspaSlideShow()
{
clearTimeout(t);
clearTimeout(t1);
clearTimeout(t2);
clearTimeout(t4);
clearTimeout(t5);
clearTimeout(t6);
j=0;
j1=0;
j2=0;
j4=0;
j5=0;
j6=0;

if (document.all){
    document.images.SlideShow.style.filter="blendTrans(duration=2)"
    document.images.SlideShow.style.filter="blendTrans(duration=3)"
    document.images.SlideShow.filters.blendTrans.Apply()   
    document.images.SlideShow.style.display = 'block';
}
document.images.SlideShow.src = preLoad3[j3].src;
if (document.all){
    document.images.SlideShow.filters.blendTrans.Play();
}

j3 = j3 + 1
if (j3 > (p-1)) j3=0 
   
   t3 = setTimeout('runspaSlideShow()', slideSpeed);
   
}
      
//accommodation
var Pic4 = new Array()
var pgName4 = "";

for(var k = 0; k < 3; k++)
{
    Pic4[k] = '}images/banners/accommodation/'+ eval(k+1) +'.jpg';
}

var t4
var j4 = 0
var p = Pic4.length

var preLoad4 = new Array()

for (i = 0; i < p; i++){
   preLoad4[i] = new Image()
   
   preLoad4[i].src = Pic4[i]
 }

var count4 = 0;
var slideSpeed4 = 10000;

function runaccommodationSlideShow()
{
clearTimeout(t);
clearTimeout(t1);
clearTimeout(t2);
clearTimeout(t3);
clearTimeout(t5);
clearTimeout(t6);
j=0;
j1=0;
j2=0;
j3=0;
j5=0;
j6=0;

if (document.all){
    document.images.SlideShow.style.filter="blendTrans(duration=2)"
    document.images.SlideShow.style.filter="blendTrans(duration=3)"
    document.images.SlideShow.filters.blendTrans.Apply()   
    document.images.SlideShow.style.display = 'block';
}
document.images.SlideShow.src = preLoad4[j4].src;
if (document.all){
    document.images.SlideShow.filters.blendTrans.Play();
}

j4 = j4 + 1
if (j4 > (p-1)) j4=0 
   
   t4 = setTimeout('runaccommodationSlideShow()', slideSpeed);
   
}
   

//honeymoon
var Pic5 = new Array()
var pgName5 = "";

for(var k = 0; k < 3; k++)
{
    Pic5[k] = '}images/banners/honeymoon/'+ eval(k+1) +'.jpg';
}

var t5
var j5 = 0
var p = Pic5.length

var preLoad5 = new Array()

for (i = 0; i < p; i++){
   preLoad5[i] = new Image()
   
   preLoad5[i].src = Pic5[i]
 }

var count5 = 0;
var slideSpeed5 = 10000;


function runhoneymoonSlideShow()
{
clearTimeout(t);
clearTimeout(t1);
clearTimeout(t2);
clearTimeout(t3);
clearTimeout(t4);
clearTimeout(t6);
j=0;
j1=0;
j2=0;
j3=0;
j4=0;
j6=0;

if (document.all){
    document.images.SlideShow.style.filter="blendTrans(duration=2)"
    document.images.SlideShow.style.filter="blendTrans(duration=3)"
    document.images.SlideShow.filters.blendTrans.Apply()   
    document.images.SlideShow.style.display = 'block';
}
document.images.SlideShow.src = preLoad5[j5].src;
if (document.all){
    document.images.SlideShow.filters.blendTrans.Play();
}

j5 = j5 + 1
if (j5 > (p-1)) j5=0 
   
   t5 = setTimeout('runhoneymoonSlideShow()', slideSpeed);
   
}


//home
var Pic6 = new Array()
var pgName6 = "";

for(var k = 0; k < 3; k++)
{
    Pic6[k] = '}images/banners/home/'+ eval(k+1) +'.jpg';
}

var t6
var j6 = 0
var p = Pic6.length

var preLoad6 = new Array()

for (i = 0; i < p; i++){
   preLoad6[i] = new Image()
   
   preLoad6[i].src = Pic6[i]
 }

var count6= 0;
var slideSpeed6 = 10000;


function runhomeSlideShow()
{
clearTimeout(t);
clearTimeout(t1);
clearTimeout(t2);
clearTimeout(t3);
clearTimeout(t4);
clearTimeout(t5);
j=0;
j1=0;
j2=0;
j3=0;
j4=0;
j5=0;

if (document.all){
    document.images.SlideShow.style.filter="blendTrans(duration=2)"
    document.images.SlideShow.style.filter="blendTrans(duration=3)"
    document.images.SlideShow.filters.blendTrans.Apply()   
    document.images.SlideShow.style.display = 'block';
}
document.images.SlideShow.src = preLoad6[j6].src;
if (document.all){
    document.images.SlideShow.filters.blendTrans.Play();
}

j6 = j6 + 1
if (j6 > (p-1)) j6=0 
   
   t6 = setTimeout('runhomeSlideShow()', slideSpeed);

}

function sendRequest(url, callback, postData)
{
    var req = createXMLHTTPObject();
    if (!req) return;
    var method = (postData) ? "POST" : "GET";
    req.open(method, url, true);
    req.setRequestHeader('User-Agent', 'XMLHTTP/1.0');
    if (postData)
        req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
    req.onreadystatechange = function()
    {
        if (req.readyState != 4) return;
        if (req.status != 200 && req.status != 304)
        {
            //			alert('HTTP error ' + req.status);
            return;
        }
    }
    if (req.readyState == 4) return;
    req.send(postData);
}

var XMLHttpFactories = [
	function() { return new XMLHttpRequest() },
	function() { return new ActiveXObject("Msxml2.XMLHTTP") },
	function() { return new ActiveXObject("Msxml3.XMLHTTP") },
	function() { return new ActiveXObject("Microsoft.XMLHTTP") }
];

function createXMLHTTPObject()
{
    var xmlhttp = false;
    for (var i = 0; i < XMLHttpFactories.length; i++)
    {
        try
        {
            xmlhttp = XMLHttpFactories[i]();
        }
        catch (e)
        {
            continue;
        }
        break;
    }
    return xmlhttp;
}

function trackPagePerformance()
{
    try
    {
        sendRequest('Default.aspx?command=' + perfID, '', '');
    }
    catch (err)
    {
    }
}

