WhatPageID = 'HOMEPAGE'

var StartDate
var EndDate
var DefaultOLParams

function MainExec(params)
{
	Init();
	ShowAllToLevel = 1;
	MainTFWEngine('','Package')
	
	//load hotel search
		hotelListBoxLength = '50';
		
}


function Init()
{
	
}

function CallHeaderLink()
{
	XSLTemplateRef = 'VAT'
	//document.getElementById("DEBUG").innerHTML = APPSWebServerURL + 'web2/include/header/content.asp?' + defaultParams + '&XSLTEMPLATEREF=' + XSLTemplateRef
	PassAjaxResponseToFunction(APPSWebServerURL + 'web2/include/header/content.asp?' + defaultParams, 'ShowHeaderLink')
}

function ShowHeaderLink(response)
{
	CleanResponse = FilterContent(response)
	
	ListOfElem = CleanResponse.split('-*-')
	document.getElementById("HEADERLINK").innerHTML =  ListOfElem[1]
	
}

function CallShopForList()
{
	XSLTemplateRef = 'VAT'
	//document.getElementById("DEBUG").innerHTML = APPSWebServerURL + 'web2/include/ShopFor/content.asp?' + defaultParams + '&XSLTEMPLATEREF=' + XSLTemplateRef
	PassAjaxResponseToFunction(APPSWebServerURL + 'web2/include/ShopFor/content.asp?' + defaultParams + '&XSLTEMPLATEREF=' + XSLTemplateRef, 'ShowShopForList')
}

function ShowShopForList(response)
{
	CleanResponse = FilterContent(response)
	
	ListOfElem = CleanResponse.split('-*-')
	document.getElementById("SHOPFORCONTENT").innerHTML =  ListOfElem[1]
	
}

function CallFooterLink()
{
	XSLTemplateRef = 'VAT'
	//document.getElementById("DEBUG").innerHTML = APPSWebServerURL + 'web2/include/footer/content.asp?' + defaultParams + '&XSLTEMPLATEREF=' + XSLTemplateRef
	PassAjaxResponseToFunction(APPSWebServerURL + 'web2/include/footer/content.asp?' + defaultParams + '&XSLTEMPLATEREF=' + XSLTemplateRef, 'ShowFooterLink')
}

function ShowFooterLink(response)
{
	CleanResponse = FilterContent(response)
	
	ListOfElem = CleanResponse.split('-*-')
	document.getElementById("FOOTERLINK").innerHTML =  ListOfElem[1]
	
}

function CallPromotions()
{
	XSLTemplateRef = 'Vat'
	//document.getElementById("DEBUG").innerHTML = APPSWebServerURL + 'web2/Homepage/Include/Promotions/content.asp?' + defaultParams
	PassAjaxResponseToFunction(APPSWebServerURL + 'web2/Homepage/Include/Promotions/content.asp?' + defaultParams, 'ShowPromotions')
}

function ShowPromotions(response)
{
	CleanResponse = FilterContent(response)
	
	ListOfElem = CleanResponse.split('-*-')
	document.getElementById("PROMOTIONS").innerHTML =  ListOfElem[1]
	
}

function CallLimitedOffers()
{
	XSLTemplateRef = 'Vat'
	//document.getElementById("DEBUG").innerHTML = APPSWebServerURL + 'web2/Homepage/Include/LimitedOffers/content.asp?' + defaultParams
	PassAjaxResponseToFunction(APPSWebServerURL + 'web2/Homepage/Include/LimitedOffers/content.asp?' + defaultParams, 'ShowLimitedOffers')
}

function ShowLimitedOffers(response)
{
	CleanResponse = FilterContent(response)
	
	ListOfElem = CleanResponse.split('-*-')
	document.getElementById("LIMITEDOFFERS").innerHTML =  ListOfElem[1]
	
}

function CallReasonsToChooseAgent()
{
	XSLTemplateRef = 'Vat'
	//document.getElementById("DEBUG").innerHTML = APPSWebServerURL + 'web2/Homepage/Include/ReasonsToChooseAgent/content.asp?' + defaultParams
	PassAjaxResponseToFunction(APPSWebServerURL + 'web2/Homepage/Include/ReasonsToChooseAgent/content.asp?' + defaultParams, 'ShowReasonsToChooseAgent')
}

function ShowReasonsToChooseAgent(response)
{
	CleanResponse = FilterContent(response)
	
	ListOfElem = CleanResponse.split('-*-')
	if(ListOfElem[1]){
		if (document.getElementById("REASONSTOCHOOSEAGENTCONTENT")){
			document.getElementById("REASONSTOCHOOSEAGENTCONTENT").innerHTML =  ListOfElem[1]
		}
		if (document.getElementById("REASONSTOCHOOSEAGENTHOLDERTD")){
			document.getElementById("REASONSTOCHOOSEAGENTHOLDERTD").style.display = '';
		}
	}
	
	
}

function sendForm()
{
	var sel = document.deals.where.selectedIndex;
			
	if (sel < 1)
		return false;
		
		document.deals.action = document.deals.where.options[sel].value;
		document.deals.submit();
		return true;

}	

function GoToUlysseContent(link)
{
	if (document.getElementById(link))
	{		
		var linkRef = document.getElementById(link);
		var linkUrlRef = linkRef.href
		window.location.href = linkUrlRef;
		
	}
}
