//	REQUIRED FOR THE FLASH MENU NAVIGATION
var myVDir;
var myStr;
var slash;
var arrLiveSites, liveSitesCtr;
var localMachinesCtr=0;
	
function getArray()
{
	try
	{
		myVDir=window.location.toString();
		myVDir=myVDir.split("/")
		
		myStr=window.location.toString();
		slash=myStr.lastIndexOf("/");
		myStr=myStr.substr(slash+1);//myStr wil now have the actual .asp or .html file name			
		arrLiveSites=strLiveSites.toString().split(",");
		localMachines=localMachines.split(",");
	}
	catch(er)
	{
	}
}	
			
function gotoPage(folder,pageName,target)
{
	getArray()	
	var path;
		for(liveSitesCtr=0;liveSitesCtr<arrLiveSites.length;liveSitesCtr++)
		{
			if(window.location.hostname==arrLiveSites[liveSitesCtr])
			{
				if(folder=="home")
				{
					if(myStr.toLowerCase()==pageName.toString().toLowerCase() || myStr=="")
					{
						alert("You are already viewing the clicked page.")
						return;
					}
					else
					{
						path="http://"+window.location.hostname+"/"+pageName;
					}
				}
				else
				{
					if(myStr.toLowerCase()==pageName.toString().toLowerCase() || (myStr+"#top").toLowerCase()==(pageName+"#top").toString().toLowerCase())
					{
						alert("You are already viewing the clicked page.");
						return;
					}
					else
					{
						path="http://"+window.location.hostname+"/"+folder+"/"+pageName;
					}
				}
			}
		}
		for(localMachinesCtr=0;localMachinesCtr<localMachines.length;localMachinesCtr++)
		{			
			if(window.location.hostname==localMachines[localMachinesCtr])
			{

				if(folder=="home")
				{
					if(myStr.toLowerCase()==pageName.toString().toLowerCase() || myStr=="")
					{
						alert("You are already viewing the clicked page.")
						return;
					}
					else
					{
						path="http://"+window.location.hostname+"/"+myVDir[3]+"/"+pageName;
					}
				}
				else
				{
					if(myStr.toLowerCase()==pageName.toString().toLowerCase() || (myStr+"#top").toLowerCase()==(pageName+"#top").toString().toLowerCase())
					{
						alert("You are already viewing the clicked page.");
						return;
					}
					else
					{
						path="http://"+window.location.hostname+"/"+myVDir[3]+"/"+folder+"/"+pageName;
					}
				}
			}			
			
		}
		window.open(path,"_parent");
}
//FLASH MENU NAVIGATION ENDS HERE	
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=400, height=200, top=" + topPos + ", left=" + leftPos;
        a=window.open(STR_ALGORE_URL+'/code/info/VersionInfo.asp','versionInfo', popUpProperties);
        a.focus();
}
//-------
// JScript source code
function print_page(pageURL)
{
    window.print();
}
//----------
function back_page(pageURL)
{
    window.history.back(1);
}
//---------
function popUpHelp(pageName)
{
    var wnd	= window.open(pageName,"help","width=790,height=500,top=0,left=0,scrollbars=yes");
    wnd.focus();
}
//----------
function popUp_HelpATOL(pageName)
{
    var wind = window.open(STR_ALGORE_URL+'/code/help/'+pageName,"help","width=550,height=300,top=0,left=0,scrollbars=yes");
}
//---Used for page bookmark
  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 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();
}

