﻿var allIframes = "ifrmDestination,destination1,ifrmActivities,ifrmInfo,ifrmActivities_A";
addEvent(window, 'load', keepMenuTextBold);

function getmyurl(strUrl, isPopUp) {
  window.open(strUrl, '_parent');
}

function collapseOtherMenus(currentMenu) {
  var arrIframes = allIframes.split(',');

  var isSubMenu = false;
  var obj;
  for (var ctr = 0; ctr <= arrIframes.length - 1; ctr++) {
    if (currentMenu != arrIframes[ctr]) {
      if (!isSubMenu) {
        obj = document.getElementById(arrIframes[ctr]);
      }
    }
    else {
      obj = document.getElementById(arrIframes[ctr]);
      isSubMenu = true;
      if (typeof menuInt != "undefined")
        clearTimeout(menuInt);
      clearTimeout(menuIntCentre);
    }
  }
  if (isSubMenu) {
    obj.style.display = '';
    obj.style.visibility = "visible";
  }
  else {
    obj.style.display = 'none';
    obj.style.visibility = "hidden";
  }
}

var menuInt;
var menuIntCentre;
var ifrmCentres;
var divMain;
var divMainAnchor;
var divMaintext;
var parentTD;
var parentTD1;
var divArrow1;
var divArrow2;
var link;

function HideCentreDivNow() {
  var obj;
  obj = document.getElementById("ifrmCentres");
  obj.style.display = "none";
  obj.style.visibility = "hidden";
}

function HideCentreDiv() {
  clearTimeout(menuIntCentre);
  if (parentTD != null) {
//    parentTD.style.backgroundColor = gSTR_MENUBACKGROUND_COLOR;
//    parentTD1.style.backgroundColor = gSTR_MENUBACKGROUND_COLOR;
    if (divArrow1 != null) {
      DisplayImage('true', divArrow1, divArrow2);
    }
  }
  menuIntCentre = setTimeout('hideSubMenu()', 750);
}

function HighLightParentTD(pTD) {
  var parentTD = pTD;

  if (parentTD != null) {
//    parentTD.style.backgroundColor = gSTR_TDMENUROLLOVER_COLOR;
//    parentTD1.style.backgroundColor = gSTR_TDMENUROLLOVER_COLOR;
    if (divArrow1 != null) {
      DisplayImage('false', divArrow1, divArrow2);
    }
  }
}
function KeepShowingCentreDiv() {
  clearTimeout(menuIntCentre);
  clearTimeout(menuInt);
  ifrmCentres.style.display = '';
  ifrmCentres.style.visibility = "visible";
  HighLightParentTD();

  if (divMain != null) {
    showRollover(divMain, divMainAnchor, divMaintext);
  }
}
function showCentreDiv(subMenu, anchorName, linkName, calledFrom) {
  try {
    if (isASP == '1') {

      ifrmCentres = document.getElementById("ifrmCentres");
    }
    else {

      ifrmCentres = parent.document.getElementById("ifrmCentres");
    }
  }
  catch (e) {

    ifrmCentres = parent.document.getElementById("ifrmCentres");
  }

  ifrmCentres.style.display = "none";
  ifrmCentres.style.visibility = "hidden";
  clearTimeout(menuIntCentre);
  if (isCentre == 'True') {
    return;
  }

  var objSubMenuPos;
  if (calledFrom != '') {
    objSubMenuPos = getAnchorPositionOfFrameControl(anchorName, calledFrom);
  }
  else {
    objSubMenuPos = getAnchorPosition(anchorName);
  }
  var subMenuXPos;
  subMenuXPos = objSubMenuPos.x;

  try {
    if (isASP != '1') {
      var oIframe3 = document.getElementById("ifrmDestination");
    }
  }
  catch (e) {
    var oIframe3 = document.getElementById("ifrmDestination");
  }

  link = null;
  divMain = null;
  divMainAnchor = null;
  divMaintext = null;
  divArrow1 = null;
  divArrow2 = null;

  switch (linkName) {
    case "aFreeAcHp":
      try {
        if (isASP == '1') {
        }
      }
      catch (e) {
        oIframe3.style.display = 'none';
        oIframe3.style.visibility = "hidden";
      }

      ifrmCentres.style.top = '500px';
      ifrmCentres.style.left = '769px';
      link = 'code_net/villas/villalists.aspx?ph=1';
      break;

    case "aPrices2009":
      oIframe3.style.display = 'none';
      oIframe3.style.visibility = "hidden";

      ifrmCentres.style.top = parseInt(objSubMenuPos.y) + 'px';
      ifrmCentres.style.left = (subMenuXPos + 10 + 135) + 'px';
      link = 'code/villas/searchVilla.asp?foryear=2009';
      break;

    case "achrFAQ":
      oIframe3.style.display = 'none';
      oIframe3.style.visibility = "hidden";

//      ifrmCentres.style.top = '32px';
//      ifrmCentres.style.left =  '660px';
      ifrmCentres.style.top = (objSubMenuPos.y + 35) +'px';     
      ifrmCentres.style.left = (subMenuXPos + 10)+ 'px';
      link = 'code/info/faq.asp';
      window.parent.applyUnderLineToText('achrFAQ');
      break;

    case "aMCarHire":
      var framedivInfo = parent.document.getElementById("ifrmInfo");
      var FrameHeight = framedivInfo.style.top.replace("px", "");
      var FrameLeft = framedivInfo.style.left;
      FrameHeight = parseInt(FrameHeight) + parseInt(objSubMenuPos.y) - 5 + 'px';
      FrameLeft = parseInt(FrameLeft) + parseInt(subMenuXPos) + 198 + 'px';
      ifrmCentres.style.top = parseInt(FrameHeight) + 2 + 'px';
      ifrmCentres.style.left = parseInt(FrameLeft) + 'px';

      link = 'code_net/info/carList.aspx';
      divMain = 'ifrmInfo';
      divMainAnchor = 'tdInf';
      divMaintext = 'achrInfo';
      parentTD = document.getElementById('tdMCarHire');
      parentTD1 = document.getElementById('td6');
      divArrow1 = 'Div7';
      divArrow2 = 'Div8';
      break;

    case "aMFlights":
      var framedivInfo = parent.document.getElementById("ifrmInfo");
      var FrameHeight = framedivInfo.style.top.replace("px", "");
      var FrameLeft = framedivInfo.style.left;
      FrameHeight = parseInt(FrameHeight) + parseInt(objSubMenuPos.y) - 5;
      FrameLeft = parseInt(FrameLeft) + parseInt(subMenuXPos) + 198;
      ifrmCentres.style.top = parseInt(FrameHeight) + 'px';
      ifrmCentres.style.left = parseInt(FrameLeft) + 'px';
      link = 'code/info/flights.asp';
      divMain = 'ifrmInfo';
      divMainAnchor = 'tdInf';
      divMaintext = 'achrInfo';
      parentTD = document.getElementById('tdFlights');
      parentTD1 = document.getElementById('td5');
      divArrow1 = 'Div9';
      divArrow2 = 'Div10';
      break;

    case "aMInsurance":
      ifrmCentres.style.top = parseInt(objSubMenuPos.y - 3) + 'px';
      ifrmCentres.style.left = (subMenuXPos + 147) + 'px';
      link = 'code/info/insurance.asp';
      divMain = 'ifrmInfo';
      divMainAnchor = 'tdInf';
      divMaintext = 'achrInfo';
      parentTD = document.getElementById('tdMInsurance');
      parentTD1 = document.getElementById('td7');
      divArrow1 = 'Div11';
      divArrow2 = 'Div12';
      break;

    case "aMHealth":
      ifrmCentres.style.top = parseInt(objSubMenuPos.y - 3) + 'px';
      ifrmCentres.style.left = (subMenuXPos + 147) + 'px';
      link = 'code/info/health_safety.asp';
      divMain = 'ifrmInfo';
      divMainAnchor = 'tdInf';
      divMaintext = 'achrInfo';
      parentTD = document.getElementById('tdMHealth');
      parentTD1 = document.getElementById('td8');
      divArrow1 = 'Div13';
      divArrow2 = 'Div14';
      break;

    case "aMTransfers":
      var framedivInfo = parent.document.getElementById("ifrmInfo");
      var FrameHeight = framedivInfo.style.top.replace("px", "");
      var FrameLeft = framedivInfo.style.left;
      FrameHeight = parseInt(FrameHeight) + parseInt(objSubMenuPos.y) - 5;
      FrameLeft = parseInt(FrameLeft) + parseInt(subMenuXPos) + 198;
      ifrmCentres.style.top = parseInt(FrameHeight) + 'px';
      ifrmCentres.style.left = parseInt(FrameLeft) + 'px';
      link = 'code/info/transfers.asp';
      divMain = 'ifrmInfo';
      divMainAnchor = 'tdInf';
      divMaintext = 'achrInfo';
      parentTD = document.getElementById('tdMTransfers');
      parentTD1 = document.getElementById('td9');
      divArrow1 = 'Div15';
      divArrow2 = 'Div16';
      break;

    case "aMUseFulInfo":
      ifrmCentres.style.top = parseInt(objSubMenuPos.y - 3) + 'px';
      ifrmCentres.style.left = (subMenuXPos + 147) + 'px';
      link = 'code/info/usefulinfo.asp';
      divMain = 'ifrmInfo';
      divMainAnchor = 'tdInf';
      divMaintext = 'achrInfo';
      parentTD = document.getElementById('tdMUseFulInfo');
      parentTD1 = document.getElementById('td11');
      divArrow1 = 'Div19';
      divArrow2 = 'Div20';
      break;

    case "aMUseFulLinks":
      var framedivInfo = parent.document.getElementById("ifrmInfo");
      var FrameHeight = framedivInfo.style.top.replace("px", "");
      var FrameLeft = framedivInfo.style.left;
      FrameHeight = parseInt(FrameHeight) + parseInt(objSubMenuPos.y) - 5;
      FrameLeft = parseInt(FrameLeft) + parseInt(subMenuXPos) + 198;
      ifrmCentres.style.top = parseInt(FrameHeight) + 'px';
      ifrmCentres.style.left = parseInt(FrameLeft) + 'px';
      link = 'code/info/usefullinks.asp';
      divMain = 'ifrmInfo';
      divMainAnchor = 'tdInf';
      divMaintext = 'achrInfo';
      parentTD = document.getElementById('tdMUseFulLinks');
      parentTD1 = document.getElementById('td12');
      divArrow1 = 'Div21';
      divArrow2 = 'Div22';
      break;

    case "aMBooking":
      ifrmCentres.style.top = parseInt(objSubMenuPos.y + 25) + 'px';
      ifrmCentres.style.left = (subMenuXPos + 35) + 'px';
      link = 'code/tobook/bookvilla.asp';
      break;

      clearTimeout(menuIntCentre);
  }

  try {
    if (isASP == '1') {
      var doc = document.getElementById("ifrmCentres").contentWindow.document;
      var objIframe = parent.document.getElementById("ifrmSearch");
      objIframe.style.width = 800 + "px";
    }
    else {
      var doc = parent.document.getElementById("ifrmCentres").contentWindow.document;
    }
  }
  catch (e) {
    var doc = parent.document.getElementById("ifrmCentres").contentWindow.document;
  }
  ifrmCentres.style.height = 243 + 'px';
  ifrmCentres.style.width = 100 + 'px';
  ifrmCentres.style.display = '';
  ifrmCentres.style.visibility = "visible";
  if (linkName == "aPrices2009") {
    window.scrollBy(0, 2000);
  }

  try {
    doc.getElementById('aAlgarve').href = 'http://' + serverName + '/algarve/' + link;
    doc.getElementById('aCorfu').href = 'http://' + serverName + '/corfu/' + link;
    doc.getElementById('aKefalonia').href = 'http://' + serverName + '/kefalonia/' + link;
    doc.getElementById('aCyprus').href = 'http://' + serverName + '/cyprus/' + link;
    doc.getElementById('aCostadelSOl').href = 'http://' + serverName + '/costadelsol/' + link;
    doc.getElementById('aCostaBlanca').href = 'http://' + serverName + '/costablanca/' + link;
    doc.getElementById('aMenorca').href = 'http://' + serverName + '/menorca/' + link;
    doc.getElementById('aMallorca').href = 'http://' + serverName + '/mallorca/' + link;
    doc.getElementById('aLanzarote').href = 'http://' + serverName + '/lanzarote/' + link;
    doc.getElementById('aFuerteventura').href = 'http://' + serverName + '/fuerteventura/' + link;
    doc.getElementById('aTenerife').href = 'http://' + serverName + '/tenerife/' + link;
    doc.getElementById('aCrete').href = 'http://' + serverName + '/crete/' + link;
    doc.getElementById('aRhodes').href = 'http://' + serverName + '/rhodes/' + link;
//    ifrmCentres.style.color = gSTR_MENUBACKGROUND_COLOR;
  }
  catch (ex)
	    { }
}

function LinkFromCentreDiv(centre) {
  getmyurl('http://' + serverName + '/' + centre.toLowerCase() + '/' + link, false);
}
var browser = navigator.appName;
function showRollover(subMenu, anchorName) {
  subMenuName = subMenu;
  var objSubMenuPos = getAnchorPosition(anchorName);
  var subMenuXPos;
  subMenuXPos = objSubMenuPos.x;
  switch (subMenu) {
    case "ifrmDestination":
      var oIframe3 = document.getElementById("ifrmDestination");
      oIframe3.style.display = '';
      oIframe3.style.visibility = "visible";
      oIframe3.style.top = (objSubMenuPos.y + 35) +'px';     
      oIframe3.style.left = (subMenuXPos + 10)+ 'px';      
      oIframe3.style.height = 248 + 'px';
      oIframe3.style.width = 120 + 'px';

      var oIframe2 = document.getElementById("ifrmInfo");
      oIframe2.style.display = 'none';
      oIframe2.style.visibility = "hidden";

      var oIframe4 = document.getElementById("ifrmActivities");
      oIframe4.style.display = 'none';
      oIframe4.style.visibility = "hidden";

      var oIframe5 = document.getElementById("ifrmActivities_A");
      oIframe5.style.display = 'none';
      oIframe5.style.visibility = "hidden";

//      revertMenuColor('tdHowBook', 'textHowBook');
//      revertMenuColor('tdVilla', 'achrFindAVilla');
//      revertMenuColor('tdInf', 'achrInfo');
//      revertMenuColor('tdBooking', 'bookVilla');
//      revertMenuColor('tdBrochure', 'achrBrochure');
//      revertMenuColor('tdActivity', 'achrActivity');
      break;

    case "ifrmActivities":
      var oIframe4 = document.getElementById("ifrmActivities");
//      oIframe4.style.top = '32px';
//      oIframe4.style.left = subMenuXPos/3 -69 + 'px';
      oIframe4.style.top = (objSubMenuPos.y + 35) +'px';     
      oIframe4.style.left = (subMenuXPos + 10)+ 'px';
      oIframe4.style.height = 117 + 'px';
      oIframe4.style.width = 218 + 'px';
      oIframe4.style.display = '';
      oIframe4.style.visibility = "visible";

      var oIframe2 = document.getElementById("ifrmInfo");
      oIframe2.style.display = 'none';
      oIframe2.style.visibility = "hidden";

      var oIframe3 = document.getElementById("ifrmDestination");
      oIframe3.style.display = 'none';
      oIframe3.style.visibility = "hidden";

      var oIframe5 = document.getElementById("ifrmActivities_A");
      oIframe5.style.display = 'none';
      oIframe5.style.visibility = "hidden";

//      revertMenuColor('tdVilla', 'achrFindAVilla');
//      revertMenuColor('tdHowBook', 'textHowBook');
//      revertMenuColor('tdInf', 'achrInfo');
//      revertMenuColor('tdBooking', 'bookVilla');
//      revertMenuColor('tdBrochure', 'achrBrochure');
      break;

  case "ifrmActivities_A":
      var oIframe4 = document.getElementById("ifrmActivities");
      var oIframe5 = document.getElementById("ifrmActivities_A");
      oIframe5.style.display = '';
      oIframe5.style.visibility = "visible";
      oIframe5.style.top = parseInt(130 + (parseInt(oIframe4.style.height))) + 'px';
      oIframe5.style.left = (parseInt(oIframe4.style.left)) + (parseInt(oIframe4.style.width)) + 'px';
//      oIframe5.style.top = (objSubMenuPos.y + 30) +'px';     
//      oIframe5.style.left = (subMenuXPos + 10)+ 'px';
      oIframe5.style.height = 117 + 'px';
      oIframe5.style.width = 230 + 'px';

      var oIframe2 = document.getElementById("ifrmInfo");
      oIframe2.style.display = 'none';
      oIframe2.style.visibility = "hidden";

      var oIframe3 = document.getElementById("ifrmDestination");
      oIframe3.style.display = 'none';
      oIframe3.style.visibility = "hidden";

//      revertMenuColor('tdVilla', 'achrFindAVilla');
//      revertMenuColor('tdHowBook', 'textHowBook');
//      revertMenuColor('tdInf', 'achrInfo');
//      revertMenuColor('tdBooking', 'bookVilla');
//      revertMenuColor('tdBrochure', 'achrBrochure');
      break;

    case "ifrmInfo":

      var oIframe2 = document.getElementById("ifrmInfo");
      oIframe2.style.display = '';
      oIframe2.style.visibility = "visible";
      //oIframe2.style.top = '32px';
      oIframe2.style.top = (objSubMenuPos.y + 45) +'px';     
      oIframe2.style.left = (subMenuXPos + 10)+ 'px';
      if (isCentre == 'false' || isCentre == false) {
        oIframe2.style.height = 250 + 'px';
        //oIframe2.style.left = subMenuXPos/2 - 8 + 'px';
      }
      else {
        oIframe2.style.height = 232 + 'px';
        //oIframe2.style.left = subMenuXPos/2 + 8 + 'px';
      }
      oIframe2.style.width = 200 + 'px';

      var oIframe4 = document.getElementById("ifrmActivities");
      oIframe4.style.display = 'none';
      oIframe4.style.visibility = "hidden";

      var oIframe3 = document.getElementById("ifrmDestination");
      oIframe3.style.display = 'none';
      oIframe3.style.visibility = "hidden";

      var oIframe5 = document.getElementById("ifrmActivities_A");
      oIframe5.style.display = 'none';
      oIframe5.style.visibility = "hidden";

//      revertMenuColor('tdVilla', 'achrFindAVilla');
//      revertMenuColor('tdHowBook', 'textHowBook');
//      revertMenuColor('tdCenter', 'achrCenter');
//      revertMenuColor('tdBooking', 'bookVilla');
//      revertMenuColor('tdBrochure', 'achrBrochure');
//      revertMenuColor('tdActivity', 'achrActivity');
      break;

    case "ifrmCentres":
      var oIframe5 = document.getElementById("ifrmCentres");
      oIframe5.style.display = '';
      oIframe5.style.visibility = "visible";
//      oIframe5.style.top = parseInt(objSubMenuPos.y + 8) + 'px';
//      oIframe5.style.left = subMenuXPos + 'px';
      oIframe5.style.top = parseInt(objSubMenuPos.y + 35) +'px';     
      oIframe5.style.left = (subMenuXPos + 10)+ 'px';
      oIframe5.style.height = 150 + 'px';
      oIframe5.style.width = 250 + 'px';

      var oIframe4 = document.getElementById("ifrmActivities");
      oIframe4.style.display = 'none';
      oIframe4.style.visibility = "hidden";

      var oIframe3 = document.getElementById("ifrmDestination");
      oIframe3.style.display = 'none';
      oIframe3.style.visibility = "hidden";

      var oIframe5 = document.getElementById("ifrmActivities_A");
      oIframe5.style.display = 'none';
      oIframe5.style.visibility = "hidden";

//      revertMenuColor('tdVilla', 'achrFindAVilla');
//      revertMenuColor('tdHowBook', 'textHowBook');
//      revertMenuColor('tdCenter', 'achrCenter');
//      revertMenuColor('tdBooking', 'bookVilla');
//      revertMenuColor('tdBrochure', 'achrBrochure');
//      revertMenuColor('tdActivity', 'achrActivity');
      break;
  }
  collapseOtherMenus(subMenu);
}

function hideSubMenu() {
  var obj;

  try {
    window.parent.removeUnderLineToText('achrFAQ');
    obj = document.getElementById("ifrmInfo");
    obj.style.display = "none";
    obj.style.visibility = "hidden";

    obj = document.getElementById("ifrmDestination");
    obj.style.display = "none";
    obj.style.visibility = "hidden";

    obj = document.getElementById("ifrmActivities");
    obj.style.display = "none";
    obj.style.visibility = "hidden";

    obj = document.getElementById("ifrmActivities_A");
    obj.style.display = "none";
    obj.style.visibility = "hidden";

    obj = document.getElementById("ifrmCentres");
    obj.style.display = "none";
    obj.style.visibility = "hidden";
  }
  catch (e) {
    obj = document.getElementById("ifrmCentres");
    obj.style.display = "none";
    obj.style.visibility = "hidden";
    obj.style.visibility = "hidden";

    var anyIFrameOpen = false;
    var objifrmEnews = document.getElementById("ifrmEnews");
    if ((objifrmEnews != undefined) && (objifrmEnews != null)) {
      if (objifrmEnews.style.visibility == 'visible') {
        anyIFrameOpen = true;
      }
    }
    //If E-News signup frame is open, do not reduce the width of search page
    if (anyIFrameOpen == false) {
      var objTopParent = window.parent.parent;
      var objifrmSearch = objTopParent.document.getElementById("ifrmSearch");
      objifrmSearch.style.width = "240" + "px";
    }
  }
//  revertMenuColor('tdVilla', 'achrFindAVilla');
//  revertMenuColor('tdHowBook', 'textHowBook');
//  revertMenuColor('tdCenter', 'achrCenter');
//  revertMenuColor('tdInf', 'achrInfo');
//  revertMenuColor('tdBooking', 'bookVilla');
//  revertMenuColor('tdBrochure', 'achrBrochure');
//  revertMenuColor('tdActivity', 'achrActivity');

  window.parent.removeUnderLineToText('achrCenter');
  window.parent.removeUnderLineToText('achrInfo');
  window.parent.removeUnderLineToText('achrActivity');

  if (typeof menuInt != "undefined")
    clearTimeout(menuInt);
}

function hideLayers() {
  var MainMenu1 = document.getElementById('achrCenter');
  var MainMenu2 = document.getElementById('achrActivity');
  var MainMenu3 = document.getElementById('achrInfo');

//  if (MainMenu1 != null) {
//    MainMenu1.className = 'menuText';
//  }
//  if (MainMenu2 != null) {
//    MainMenu2.className = 'menuText';
//  }
//  if (MainMenu3 != null) {
//    MainMenu3.className = 'menuText';
//  }
  menuInt = setTimeout('hideSubMenu()', 750);
}

function showMenuColor(objTd, objText) {
  var objClr = document.getElementById(objTd);
  //objClr.style.backgroundColor = gSTR_MENU_ROLLOVER;

  var objClrText = document.getElementById(objText);
  //objClrText.style.color = "#FFFFFF";
}

function revertMenuColor(objTd, objText) {

  var objClr = document.getElementById(objTd);
  var objClrText = document.getElementById(objText);
  if (objClr != null) {
//    objClr.style.backgroundColor = gSTR_MENU_COLOR;
//    objClrText.style.color = "#FFFFFF";
  }
}

function revertMainMenuColor() {
  revertMenuColor('tdCenter', 'achrCenter');
  revertMenuColor('tdInf', 'achrInfo');
  if (isCentre == false) {
//    revertMenuColor('tdActivity', 'achrActivity');
//    revertMenuColor('tdWhyBook', 'whyBook');
//    revertMenuColor('tdHowToBook', 'textHowToBook');
//    revertMenuColor('tdEnews', 'achrEnews');
  }
//  revertMenuColor('tdFAQ', 'achrFAQ');
//  revertMenuColor('tdAboutUs', 'AboutUs');
}

function popUpHelp(pageName) {
  var wnd = window.open(pageName, "help", "width=720,height=500,top=0,left=0,scrollbars=yes");
  wnd.focus();
}

function DisplayImage(status, mouseover, mouseout) {
  if (status == 'true') {
    var objMouseOver = document.getElementById(mouseover);
    var MouseOut = document.getElementById(mouseout);
    objMouseOver.style.display = '';
    objMouseOver.style.visibility = "visible";

    MouseOut.style.display = 'none';
    MouseOut.style.visibility = "hidden";

  }
  else {
    var objMouseOver = document.getElementById(mouseover);
    var MouseOut = document.getElementById(mouseout);
    objMouseOver.style.display = 'none';
    objMouseOver.style.visibility = "hidden";

    MouseOut.style.display = '';
    MouseOut.style.visibility = "visible";
  }

}
function ShowMore(id) {
  var showMoreDiv = document.getElementById(id);
  var showMorePic = document.getElementById('showMorePic');
  if (showMoreDiv.style.visibility == "visible") {
    showMoreDiv.style.display = 'none';
    showMoreDiv.style.visibility = "hidden";
    showMorePic.src = gSTR_COMMON_IMG_PATH + "/more.gif";
  }
  else {
    showMoreDiv.style.display = '';
    showMoreDiv.style.visibility = "visible";
    showMorePic.src = gSTR_COMMON_IMG_PATH + "/topArrow.gif";
  }

}

function popUp(pageName) {
  var wnd;
  var ipixLink;
  var centerCode = '<%=gSTR_CENTRE_CODE%>';
  if (centerCode == "AL") ipixLink = "?ID=389&fullname=Casa Bota&currentResortName= Quinta do Lago&gSTR_CENTRE_CODE=AL&home=1&ipixDetails=..$..$ipix$villas$AL$Bota_389_Ext_V1.ipx@@Exterior|..$..$ipix$villas$AL$Bota_389_Pooltable_V1.ipx@@Pool Table|..$..$ipix$villas$AL$Bota_389_Bed_V1.ipx@@Bedroom|..$..$ipix$villas$AL$Bota_389_Int_V1.ipx@@Interior";
  if (centerCode == "SP") ipixLink = "?ID=277&fullname=Los Cipreses&currentResortName= Puerto Banus&gSTR_CENTRE_CODE=SP&home=1&ipixDetails=..$..$ipix$villas$SP$Cipreses_277_Ext_V1.ipx@@Exterior|..$..$ipix$villas$SP$Cipreses_277_Pooltable_V1.ipx@@Pool Table|..$..$ipix$villas$SP$Cipreses_277_Bed_V1.ipx@@Bedroom|..$..$ipix$villas$SP$Cipreses_277_Int_V1.ipx@@Interior|..$..$ipix$villas$SP$Cipreses_277_Kitchen_V1.ipx@@Kitchen";
  if (centerCode == "MA") ipixLink = "?ID=491&fullname=Casa Tocheta&currentResortName= Puerto Pollenca&gSTR_CENTRE_CODE=MA&home=1&ipixDetails=..$..$ipix$villas$MA$Tocheta_491_Ext_V1.ipx@@Exterior";
  if (centerCode == "CO") ipixLink = "?ID=645&fullname=Villa Milka&currentResortName= Kalami&gSTR_CENTRE_CODE=CO&home=1&ipixDetails=..$..$ipix$villas$CO$milka_645_ext_v1.ipx@@Exterior|..$..$ipix$villas$CO$milka_645_bed_v1.ipx@@Bedroom|..$..$ipix$villas$CO$milka_645_int_v1.ipx@@Interior";
  if (centerCode == "ME") ipixLink = "?ID=664&fullname=Casa Victoria&currentResortName= Binibeca&gSTR_CENTRE_CODE=ME&home=1&ipixDetails=..$..$ipix$villas$ME$Victoria_664_Ext_v1.ipx@@Exterior|..$..$ipix$villas$ME$Victoria_664_bed_v1.ipx@@Bedroom|..$..$ipix$villas$ME$Victoria_664_Int_v1.ipx@@Interior";

  switch (pageName) {
    case "help_atol.asp":
      if (centerCode != "VP") {
        wnd = window.open("../../code/help/help_atol.asp", "atol", "width=550,height=300,top=0,left=0,scrollbars=yes");
      }
      else {
        wnd = window.open("code/help/help_atol.asp", "atol", "width=550,height=300,top=0,left=0,scrollbars=yes");
      }
      break;

    case "Villaenlargeview.asp":
      if (centerCode == "CY" || centerCode == "BL") {
        alert("No tours currently available.");
        return;
      }
      var wd = 520;
      var ht = 560;
      wnd = window.open("code/villas/Villaenlargeview.asp" + ipixLink, "VillaPlus", "menubar=no, toolbar=no, location=no, left=" + (screen.width - wd) / 2 + ",top=" + (screen.height - ht - 50) / 2 + ", scrollbars=yes, width=" + wd + ", height=" + ht);
      break;
  }
  wnd.focus();
}

function bookmark(url, title) {
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
    window.external.AddFavorite(url, title);
  }
  else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title, url, "");
  }
}

function addEvent(obj, evType, fn) {

  if (obj.addEventListener) {

    obj.addEventListener(evType, fn, false);

    return true;

  }

  else if (obj.attachEvent) {

    var r = obj.attachEvent("on" + evType, fn);

    return r;

  }

  else {
    return false;
  }
}
//FUNCTION IS USED TO KEEP CLICKED MENU TEXT BOLD OF RESPECTIVE PAGE.
function keepMenuTextBold() {
  var currentPage = gSTR_CURRENT_PAGE.toLowerCase();

  if (currentPage == "default.aspx") {
    applyUnderLineToText('Home');
  }
  else if (currentPage == "carlist.aspx") {
    applyUnderLineToText('achrInfo');
  }
}

//Function is used to keep main menu text style as bold when user move mouse on sub menu options 
function applyUnderLineToText(linkType) {
  var objLinkType = "";
  try {
    objLinkType = document.getElementById(linkType);
 //   objLinkType.className = "menuTextBoldUnderLine";
  }
  catch (ex) {
  }
}
//Function is used to make main menu text style as default when user move out mouse from sub menu 
function removeUnderLineToText(linkType) {
  var objLinkType = "";
  try {
    objLinkType = document.getElementById(linkType);
//    objLinkType.className = "menuText";
  }
  catch (ex)
        { }
  keepMenuTextBold();
}
