﻿// JScript File
var gSTR_TDMENUROLLOVER_COLOR = "#6f6f6f";
var gSTR_MENU_COLOR = "#6f6f6f";
var gSTR_MENU_ROLLOVER = "#6f6f6f";
var gSTR_VB_BLUE = "#6f6f6f";
var gSTR_TDMENUROLLOVER_COLOR = "#6f6f6f";
var gSTR_MENU_WHITE = "#6f6f6f";
var gSTR_MENU_TEXT_HOVER = "#6f6f6f";
var gSTR_MENU_TEXT = "#6f6f6f";
var gSTR_WHYCHOOSE_COLOR = "#0065B3";
var allIframes="destination,destination1,divActivities,divInfo";
	
function getmyurl(strUrl,isPopUp)
{
    if (isPopUp==false)
    {
 	    window.open(strUrl,'_parent');
    }
    else
    {
	     window.open(strUrl,'_blank');
    }
}
    
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 divCentres;
var divMain;
var divMainAnchor;
var divMaintext;
var parentTD;
var parentTD1;
var divArrow1;
var divArrow2;
var link;
	
function HideCentreDivNow()
{
    var obj;
    obj=document.getElementById("divCentres");
	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()
{
    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); 
    
    divCentres.style.display='';
	divCentres.style.visibility="visible";
	
	HighLightParentTD();
	
	if (divMain != null)
	{
	    showRollover(divMain,divMainAnchor,divMaintext);
	}
}
function showCentreDiv(subMenu, anchorName, linkName)
{
    //Hide already open Divs if any
    divCentres= document.getElementById("divCentres");	  
	divCentres.style.display="none";
	divCentres.style.visibility="hidden";
	//End Hide already open Divs if any
	clearTimeout(menuIntCentre);
    if(isCentre == 'True')
    {
        return;
    }
    var objSubMenuPos=getAnchorPosition(anchorName);
    var subMenuXPos;
	subMenuXPos=objSubMenuPos.x;
	var oIframe3 = document.getElementById("destination");
    
    link=null;
    divMain=null;
    divMainAnchor=null;
    divMaintext=null;
    divArrow1=null;
    divArrow2=null;
    ShowOnlyTheCentreshaving2009Prices(linkName)
    switch (linkName)
	{
	    case "achrFAQ":
	            oIframe3.style.display='none';
	            oIframe3.style.visibility="hidden";				
                divCentres.style.top=parseInt(objSubMenuPos.y + 35) +'px';  
                divCentres.style.left=(subMenuXPos + 5) + 'px';  
	            link= 'code/info/faq.asp';
	    break;
	        
        case "aFreeAcHp":
                 oIframe3.style.display='none';
		         oIframe3.style.visibility="hidden";				
		
                divCentres.style.top=parseInt(objSubMenuPos.y) + 'px';
                divCentres.style.left=(subMenuXPos+10+135)+'px';  
		        link= 'code_net/villas/villalists.aspx?ph=1';
        break;
        
        case "aBudgetSearch":
            
	        oIframe3.style.display='none';
	        oIframe3.style.visibility="hidden";				
	
            divCentres.style.top=parseInt(objSubMenuPos.y+61) + 'px';
            divCentres.style.left=(subMenuXPos+10+135)+'px';  
	        link= 'code/villas/searchvilla.asp';
	    break;
	    
	    case "aFindPerfectHoliday":
	        oIframe3.style.display='none';
	        oIframe3.style.visibility="hidden";				
	
            divCentres.style.top=parseInt(objSubMenuPos.y+18) + 'px';
            divCentres.style.left=(subMenuXPos+10+135)+'px';  
	        link= 'code_net/villas/villalists.aspx';
	    break;
	   
	     case "aPricesSearch":
	        oIframe3.style.display='none';
	        oIframe3.style.visibility="hidden";				
	
            divCentres.style.top=parseInt(objSubMenuPos.y+92) + 'px';
            divCentres.style.left=(subMenuXPos+10+135)+'px';  
	        link= 'code/budget/budgetsearch.asp';
	    break;
	    
	    case "aBooking":
	        oIframe3.style.display='none';
	        oIframe3.style.visibility="hidden";				
	
            divCentres.style.top=parseInt(objSubMenuPos.y+18+105) + 'px';
            
            divCentres.style.left=(subMenuXPos+10+135)+'px';  
	        link= 'code/tobook/bookvilla.asp';
	    break;
	    
	    case "aPrices2009":	
		        oIframe3.style.display='none';
		        oIframe3.style.visibility="hidden";				
		        //ShowOnlyTheCentreshaving2009Prices();
		        //Change for Implementing SearTile In ASp Pages ---Starts
                divCentres.style.top=parseInt(objSubMenuPos.y) + 'px';
                //Change for Implementing SearTile In ASp Pages ---Ends
                divCentres.style.left=(subMenuXPos+10+135)+'px';  
                
		        link= 'code/villas/searchVilla.asp?forYear=2009';
		break;     
	  
	    case "aQuickSearch1":
	        divCentres.style.top=parseInt(objSubMenuPos.y-5) + 'px';
	        divCentres.style.left=(subMenuXPos+207)+'px';  
	        link = 'code/villas/searchvilla.asp';
            parentTD = document.getElementById('tdFindVilla21');	            
            parentTD1 = document.getElementById('td1');
            divArrow1='Div1';
            divArrow2='Div2';
	    break;
	    case "aVillaAvail":
	        divCentres.style.top=parseInt(objSubMenuPos.y-5) + 'px';
	        divCentres.style.left=(subMenuXPos+207)+'px';  
	        link = 'code/budget/budgetsearch.asp';
            parentTD = document.getElementById('tdFindVilla22');
            parentTD1 = document.getElementById('td2');	 
             divArrow1='Div3';
            divArrow2='Div4';
	    break;
	    
	    case "aBookVillaHoliday":
	     divCentres.style.top=parseInt(objSubMenuPos.y-5) + 'px';
	        divCentres.style.left=(subMenuXPos+207)+'px';  
	        link = 'code/tobook/bookvilla.asp';
            parentTD = document.getElementById('tdFindVilla23');
            parentTD1 = document.getElementById('td3');	 
            divArrow1='Div5';
            divArrow2='Div6';
	    break;
	    
	     case "aMCarHire":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code_net/info/carlist.aspx';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
             parentTD = document.getElementById('tdMCarHire');
            parentTD1 = document.getElementById('td6');	 
            divArrow1='Div7';
            divArrow2='Div8';
	    break;
	    
	    case "aMFlights":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code/info/flights.asp';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
            parentTD = document.getElementById('tdFlights');
            parentTD1 = document.getElementById('td5');	
            divArrow1='Div9';
            divArrow2='Div10';
            
	    break;
	    
	      case "aMInsurance":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code/info/insurance.asp';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
             parentTD = document.getElementById('tdMInsurance');
            parentTD1 = document.getElementById('td7');	
            divArrow1='Div11';
            divArrow2='Div12';
	    break;
	    
	    
	     case "aMHealth":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code/info/health_safety.asp';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
             parentTD = document.getElementById('tdMHealth');
            parentTD1 = document.getElementById('td8');	
            divArrow1='Div13';
            divArrow2='Div14';
	    break;
	    
	     case "aMTransfers":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code/info/transfers.asp';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
             parentTD = document.getElementById('tdMTransfers');
            parentTD1 = document.getElementById('td9');	
            divArrow1='Div15';
            divArrow2='Div16';
	    break;
	    
	       case "aMFaq":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code/info/faq.asp';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
             parentTD = document.getElementById('tdMFaq');
            parentTD1 = document.getElementById('td10');
            divArrow1='Div17';
            divArrow2='Div18';	
	    break;
	    
	     case "aMUseFulInfo":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code/info/usefulinfo.asp';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
             parentTD = document.getElementById('tdMUseFulInfo');
            parentTD1 = document.getElementById('td11');	
            divArrow1='Div19';
            divArrow2='Div20';
	    break;
	    
	     case "aMBookingConditions":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code/common/bookingconditions.asp';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
             parentTD = document.getElementById('tdMUseFulInfo');
            parentTD1 = document.getElementById('td11');	
            divArrow1='Div19';
            divArrow2='Div20';
	    break;
	    
	    case "aMUseFulLinks":
	        divCentres.style.top=parseInt(objSubMenuPos.y-3) + 'px';
	        divCentres.style.left=(subMenuXPos+147)+'px';  
	        link = 'code/info/usefullinks.asp';
	        divMain = 'divInfo';
	        divMainAnchor = 'achrInfo';
            divMaintext ='achrInfo';
             parentTD = document.getElementById('tdMUseFulLinks');
            parentTD1 = document.getElementById('td12');
             divArrow1='Div21';
            divArrow2='Div22';	
           
	    break;

	case "aMWebTerms":
	    divCentres.style.top = parseInt(objSubMenuPos.y - 3) + 'px';
	    divCentres.style.left = (subMenuXPos + 147) + 'px';
	    link = 'code_net/info/websitetermsofuse.aspx';
	    divMain = 'divInfo';
	    divMainAnchor = 'achrInfo';
	    divMaintext = 'achrInfo';
	    parentTD = document.getElementById('tdMWebterms');
	    parentTD1 = document.getElementById('td13');
	    divArrow1 = 'Div23';
	    divArrow2 = 'Div24';
	    break;
	    
	    case "aMBooking":
	        divCentres.style.top=parseInt(objSubMenuPos.y+23) + 'px';
	        divCentres.style.left=(subMenuXPos+35)+'px';  
	        link = 'code/tobook/bookvilla.asp';
	        
	    break;
	    clearTimeout(menuIntCentre);
	}
    if (linkName == 'aPrices2009')
	{
	    divCentres.style.height=171+ 'px';
	    window.scrollBy(0,2000);
	}
	else
	{
	    divCentres.style.height=230+ 'px';
	}
	
	divCentres.style.width=100+ 'px';
	divCentres.style.display='';
	divCentres.style.visibility="visible";
	document.getElementById('aAlgarve').href='http://'+ ServerName + '/algarve/' + link;
	document.getElementById('aCorfu').href='http://'+ ServerName + '/corfu/' + link;
	document.getElementById('aKefalonia').href='http://'+ ServerName + '/kefalonia/' + link;
	document.getElementById('aCyprus').href='http://'+ ServerName + '/cyprus/' + link;
	document.getElementById('aCostadelSOl').href='http://'+ ServerName + '/costadelsol/' + link;
	document.getElementById('aCostaBlanca').href='http://'+ ServerName + '/costablanca/' + link;
	document.getElementById('aMenorca').href='http://'+ ServerName + '/menorca/' + link;
	document.getElementById('aMallorca').href='http://'+ ServerName + '/mallorca/' + link;
	document.getElementById('aTenerife').href = 'http://' + ServerName + '/tenerife/' + link;
	document.getElementById('aLanzarote').href = 'http://' + ServerName + '/lanzarote/' + link;
	document.getElementById('aFuerteventura').href = 'http://' + ServerName + '/fuerteventura/' + link;
	document.getElementById('aCrete').href='http://'+ ServerName + '/crete/' + link;
	document.getElementById('aRhodes').href='http://'+ ServerName + '/rhodes/' + link;
	divCentres.style.color = gSTR_MENUBACKGROUND_COLOR;	
}


function ShowOnlyTheCentreshaving2009Prices(linkName)
{
 
 
    
}
	
function LinkFromCentreDiv(centre)
{
    getmyurl('http://'+ ServerName + '/' + centre + '/' + link, false);
}
	
function showRollover(subMenu, anchorName, MainMenuText)
{
    var MainMenuElement = document.getElementById(MainMenuText);
	//MainMenuElement.className = 'menuTexthover';
   	subMenuName=subMenu;
   			
	var objSubMenuPos=getAnchorPosition(anchorName);
	var subMenuXPos;
	subMenuXPos=objSubMenuPos.x;
	
	switch (subMenu)
	{
	   
        case "destination":
			var oIframe3 = document.getElementById("destination");
			oIframe3.style.display='';
			oIframe3.style.visibility="visible";
			oIframe3.style.top=parseInt(objSubMenuPos.y+27) + 'px';
			oIframe3.style.left=(subMenuXPos) + 'px';
			
			if (isCentre == "False")
			{
			    oIframe3.style.height=230+ 'px';
			    oIframe3.style.width=150+ 'px';
			}
			else
			{
			    oIframe3.style.height=117+ 'px';
			    oIframe3.style.width=250+ 'px';
			}
			
			oIframe3.style.color = gSTR_MENUBACKGROUND_COLOR;
							
			var oIframe4 = document.getElementById("divActivities");				
			oIframe4.style.display='none';
			oIframe4.style.visibility="hidden";
			var oIframe2 = document.getElementById("divInfo");
			oIframe2.style.display='none';
			oIframe2.style.visibility="hidden";
			
//			revertMenuColor('tdWhyBook','achrWhyBook');
//			revertMenuColor('tdInf','achrInfo');
//			revertMenuColor('tdBrochure','achrBrochureRequest')
		break;
		
		case "destination1":
			var oIframe3 = document.getElementById("destination1");
		
			var oIframe4 = document.getElementById("divActivities");
			oIframe4.style.color = gSTR_MENUBACKGROUND_COLOR;
			oIframe3.style.color = gSTR_MENUBACKGROUND_COLOR;
			oIframe4.style.display='';
			oIframe4.style.visibility="visible";
		   				
		    var oIframe2 = document.getElementById("divInfo");
		    oIframe2.style.display='none';
		    oIframe2.style.visibility="hidden";
		    
//		    revertMenuColor('tdWhyBook','achrWhyBook');
//			revertMenuColor('tdInf','achrInfo');
//			revertMenuColor('tdBrochure','achrBrochureRequest')
		break;

		case "divActivities":
			var oIframe3 = document.getElementById("destination");
		
			var oIframe4 = document.getElementById("divActivities");
			
			oIframe4.style.color = gSTR_MENUBACKGROUND_COLOR;
			oIframe3.style.color = gSTR_MENUBACKGROUND_COLOR;
			
			oIframe4.style.display='';
			oIframe4.style.visibility="visible";
			oIframe4.style.top=parseInt(objSubMenuPos.y+(parseInt(oIframe3.style.height))) + 'px';
			oIframe4.style.left=(parseInt(oIframe3.style.left))+(parseInt(oIframe3.style.width)-3) + 'px';
			oIframe4.style.height=98 + 'px';
			oIframe4.style.width=250 + 'px';
				
		    var oIframe2 = document.getElementById("divInfo");
		    oIframe2.style.display='none';
		    oIframe2.style.visibility="hidden";
		    
//		    revertMenuColor('tdWhyBook','achrWhyBook');
//			revertMenuColor('tdInf','achrInfo');
//			revertMenuColor('tdBrochure','achrBrochureRequest')
		break;

		case "divInfo":
			var oIframe2 = document.getElementById("divInfo");
			oIframe2.style.display='';
			oIframe2.style.visibility="visible";
//			oIframe2.style.top=parseInt(objSubMenuPos.y+22) + 'px';
//			oIframe2.style.left=(subMenuXPos+10)- 11 + 'px';
            oIframe2.style.top = (objSubMenuPos.y + 45) +'px';     
            oIframe2.style.left = (subMenuXPos + 12)+ 'px';
			oIframe2.style.height=250 + 'px';
			if (isCentre == "False")
			{
			    oIframe2.style.width=150 + 'px';			   
			}
			else
			{
			    oIframe2.style.width=250 + 'px';			   
			}
			
			oIframe2.style.color = gSTR_MENUBACKGROUND_COLOR;
			
			var oIframe4 = document.getElementById("divActivities");				
			oIframe4.style.display='none';
			oIframe4.style.visibility="hidden";
			var oIframe3 = document.getElementById("destination");
			oIframe3.style.display='none';
			oIframe3.style.visibility="hidden";
			
//			revertMenuColor('tdWhyBook','achrWhyBook');
//			revertMenuColor('tdBrochure','achrBrochureRequest')
		break;
	}
	    collapseOtherMenus(subMenu);		
}
	
function hideSubMenu()
{
	var obj;
	
    obj=document.getElementById("divInfo");
	obj.style.display="none";
	obj.style.visibility="hidden";
	
	obj=document.getElementById("destination");
	obj.style.display="none";
	obj.style.visibility="hidden";
	
	obj=document.getElementById("destination1");
	obj.style.display="none";
	obj.style.visibility="hidden";

	obj=document.getElementById("divActivities");
	obj.style.display="none";
	obj.style.visibility="hidden";
	
	obj=document.getElementById("divCentres");
	obj.style.display="none";
	obj.style.visibility="hidden";
	
	
	//revertMenuColor('tdWhyBook','achrWhyBook');
//	revertMenuColor('tdHowBook','textHowBook');
//	revertMenuColor('tdCenter','textCenter');
//	revertMenuColor('tdInf','achrInfo');
//	revertMenuColor('tdBrochure','achrBrochureRequest');
	
	if (typeof menuInt!="undefined")
    clearTimeout(menuInt);
    clearTimeout(menuIntCentre);
}

function hideLayers()
{
    var MainMenu1=document.getElementById('achrCenter');
    //var MainMenu2=document.getElementById('achrFindAVilla');
    var MainMenu3=document.getElementById('achrInfo');
    
    //MainMenu1.className = 'menuText';
    //MainMenu2.className = 'menuText';
   // MainMenu3.className = 'menuText';
	menuInt=setTimeout('hideSubMenu()',750);
}
	
function showMenuColor(objTd,objText)
{
    var objClr=document.getElementById(objTd);
    objClr.style.backgroundColor=gSTR_MENU_ROLLOVER //"#FFEF7F";
    
    var objClrText=document.getElementById(objText);
    objClrText.style.color="#FFFFFF";
}

function revertMenuColor(objTd,objText)
{
   
    var objClr=document.getElementById(objTd);
    objClr.style.backgroundColor=gSTR_MENU_COLOR ;
    
    var objClrText=document.getElementById(objText);
    objClrText.style.color="#FFFFFF";
}

function revertMainMenuColor()
{
//    revertMenuColor('tdCenter','textCenter');
//	revertMenuColor('tdInf','achrInfo');
}
	
function showTdColor(tdId,textId)
{
   
	var objClr=document.getElementById(tdId);
	var objClrText=document.getElementById(textId);
	    objClr.style.backgroundColor=gSTR_TDMENUROLLOVER_COLOR;
	    objClrText.className = "MenuLinkHover";
	    //applyUnderLineToText(findParentTD(textId));
}

function revertTdColor(tdId,textId)
{
	var objClr=document.getElementById(tdId);
	objClr.style.backgroundColor=gSTR_MENUBACKGROUND_COLOR;
	
	var objClrText=document.getElementById(textId);
	objClrText.className = "menuLinks";
	//applyUnderLineToText(findParentTD(textId));
	//removeUnderLineToText(findParentTD(textId));
}

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");
	        }
		   // 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 alertDetails()
{
    var a;
    var popUpWidth=402;
    var popUpHeight=165;
    var leftPos=(screen.Width - popUpWidth)/2;
    var topPos=(screen.Height - popUpHeight)/2;
    var popUpProperties;
    popUpProperties = "width=" + popUpWidth + " height=165, top=" + topPos + ", left=" + leftPos;
    a=window.open('/code/info/versioninfo.asp','versionInfo', popUpProperties);
    a.focus();
}
//Bookmark functions
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 findParentTD(childTd)
{
    if(childTd == "IntroAL" || childTd == "IntroCO" || childTd == "IntroKE" || childTd == "IntroCY" || childTd == "IntroSP" || childTd == "IntroLA" || childTd == "IntroBL" || childTd == "IntroMA" || childTd == "IntroME")
    {
        return "achrCenter";
    }
    if(childTd == "aMCarHire" || childTd == "aMInsurance" ||childTd == "aMHealth" || childTd == "aMUseFulInfo" || childTd == "aMFlights" || childTd == "achrInfo" || childTd == "aMTransfers" || childTd == "aMUseFulLinks" || childTd == "aMEcoPolicy" || childTd == "aMBookingConditions" || childTd == "aMWebTerms")
    {
        return "achrInfo";
    }
    if(childTd == "aAlgarve" || childTd == "aCorfu" ||childTd == "aKefalonia" || childTd == "aCyprus" || childTd == "aCostadelSOl" || childTd == "aCostaBlanca" || childTd == "aMenorca" || childTd == "aMallorca" || childTd == "aLanzarote")
    {
        var objDivInfo= document.getElementById("divInfo");
        if(objDivInfo.style.visibility=="visible" || objDivInfo.style.display!="none")
        {
           return "achrInfo"; 
        }
        else
        {
           return "achrFAQ";  
        }  
    }
}

//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 = "mainMenuBoldText";
        }
        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 = "mainMenuText";
        }
        catch(ex)
        {}
        keepMenuTextBold();
}

function keepMenuTextBold()
{
     try
     {
            var currentPage = gSTR_CURRENT_PAGE.toLowerCase()
            if(currentPage == "intro.asp" || currentPage == "resortspage.asp" || currentPage == "details.asp" || currentPage == "regionmap.asp" || currentPage == "shopping.asp" || currentPage == "restaurant.asp")
            {
                applyUnderLineToText('achrCenter');
            }
            if (currentPage == "carlist.aspx" || currentPage == "flights.asp" || currentPage == "insurance.asp" || currentPage == "health_safety.asp" || currentPage == "transfers.asp" || currentPage == "usefulinfo.asp" || currentPage == "usefullinks.asp" || currentPage == "bookingconditions.asp" || currentPage == "ecopolicy.asp" || currentPage == "websitetermsofuse.aspx")
            {
                applyUnderLineToText('textInfo');
            }
            if(currentPage == "brochurerequest.aspx")
            {
                applyUnderLineToText('achrBrochureRequest');
            }
            if(currentPage == "faq.asp")
            {
                applyUnderLineToText('achrFAQ');
            }
            if(currentPage == "aboutus.asp")
            {
                applyUnderLineToText('achrAboutUs');
            }
            
            //---------------
            if(currentPage == "whybookwithus.asp")
            {
                applyUnderLineToText('achrWhyBook');
            }
            if(currentPage == "howtobook.asp")
            {
                applyUnderLineToText('achrHowBook');
            }
            if(currentPage == "brochurerequest.aspx")
            {
                applyUnderLineToText('achrBrochureRequest');
            }
            if(currentPage == "aboutus.asp")
            {
                applyUnderLineToText('achrAboutUs');
            }
      }
      catch(e)
      {
        
      }
}
addEvent(window, 'load', keepMenuTextBold);
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; 
    } 
}
