﻿// sid - shader id
// tid - shader text id
function ShowShader(sid, tid, msg)
{
	var sha = document.getElementById(sid);
	var tex = document.getElementById(tid);
	if (sha) {
		sha.className = "shaderOn";
		tex.innerHTML = '<span>' + msg + '</span>';
	}
}

// sid - shader id
// tid - shader text id
function HideShader(sid, tid)
{
	var sha = document.getElementById(sid);
	var tex = document.getElementById(tid);
	if (sha) {
		sha.className = "shaderOff";
		tex.innerHTML = "&nbsp;";
	}
}

// sid - shader id
// tid - shader text id
function Show3Shader(sid, tid, msg) {
	var sha = document.getElementById(sid);
	var tex = document.getElementById(tid);
	if (sha) {
		sha.className = "shader3On";
		tex.innerHTML = '<span>' + msg + '</span>';
	}
}

// sid - shader id
// tid - shader text id
function Hide3Shader(sid, tid) {
	var sha = document.getElementById(sid);
	var tex = document.getElementById(tid);
	if (sha) {
		sha.className = "shader3Off";
		tex.innerHTML = "&nbsp;";
	}
}

// aid - adlinks container id
// sid - shader id
// cid - collapse container id
function ExpandAdLinks(aid, sid, cid)
{	
	//closes supplier links pop-up
	DisableVerticalSupplierLinksWithPublication()

	var ads = document.getElementById(aid);
	var sha = document.getElementById(sid);
	var col = document.getElementById(cid);
	if (ads) {
		sha.style.display = "none";
		ads.style.height = ads.scrollHeight + "px";
		col.style.display = "block";
		// This forces IE 7 to redraw the adlinks panel and position the 3 boxes below the adlinks to the correct position
		ads.parentNode.style.display = "none";
		ads.parentNode.style.display = "block"; 
	}
}

// aid - adlinks container id
// sid - shader id
// cid - collapse container id
// height - the height at which to collapse the container
function CollapseAdLinks(aid, sid, cid, height)
{
	//closes supplier links pop-up
	DisableVerticalSupplierLinksWithPublication()

	var ads = document.getElementById(aid);
	var sha = document.getElementById(sid);
	var col = document.getElementById(cid);
	if (ads) {
		ads.style.height = height + "px";
		sha.style.display = "block";
		col.style.display = "none";
		// This forces IE 7 to redraw the adlinks panel and position the 3 boxes below the adlinks to the correct position
		ads.parentNode.style.display = "none"; 
		ads.parentNode.style.display = "block";
	}
}

// show - bool value to show or hide drop down lists (true = visible)
function SetDropDownsVisibilityIE6(show)
{
	if (typeof document.body.style.maxHeight == "undefined") // This returns "undefined" only for IE6
	{
		var ddls = document.getElementsByTagName("select");
		for (i = 0; i < ddls.length; i++) {
			ddls[i].style.visibility = show ? "visible" : "hidden";
		}
	}
}

function EnableVerticalSupplierLinks(element)
{
	var lContainer = document.getElementById("verticalSupplierLinks");

	SetDropDownsVisibilityIE6(false);
	
	if (lContainer != null)
	{
		lContainer.style.top = findPosY(element) - 200 + 'px';
	
		SetSupplierDisplayStyle(lContainer,true);
	}
}

// by default - we hide the dropdown lists in IE6
function EnableVerticalSupplierLinksWithPublication(element, code, hideFlashMap, wideContainer, offsetX, offsetY, showDropDownLists)
{
	var lHtmlChildrenElements;
	var lContainer = document.getElementById("verticalSupplierLinksGeneralContainer");

//	if (!showDropDownLists)
//		SetDropDownsVisibilityIE6(false);
		
	if (hideFlashMap == true) {
		ShowCountryFlashMap(false);
	}
	
	if (lContainer != null) {
		if (offsetX != null)
			lContainer.style.left = (element.offsetLeft + 20) + offsetX + 'px';
		else
			lContainer.style.left = (element.offsetLeft + 20) + 'px';

		if (offsetY != null)
			lContainer.style.top = (element.offsetTop + 25) + offsetY + 'px';
		else
			lContainer.style.top = (element.offsetTop + 25) + 'px';

		if (wideContainer == true) {
			lContainer.style.width = '410px';
			if (offsetX == null) {
				lContainer.style.left = (element.offsetLeft) + 'px';
			}
		}
		else {
			lContainer.style.width = '201px';
		}
	
		SetSupplierDisplayStyle(lContainer,true);
		
		lHtmlChildrenElements = lContainer.childNodes;
	
		for (i = 0; i < lHtmlChildrenElements.length; i++)
		{
			if (lHtmlChildrenElements[i].id != null &&
			    lHtmlChildrenElements[i].id.indexOf ("verticalSupplierLinksSpecificContainer-") == 0)
			{
				if (lHtmlChildrenElements[i].id == ("verticalSupplierLinksSpecificContainer-" + code))
				{
					SetSupplierDisplayStyle(lHtmlChildrenElements[i], true);
				}
				else
				{
					SetSupplierDisplayStyle(lHtmlChildrenElements[i], false);
				}
			}
		}
		
		// Set the iframe
		var lIFrame = document.getElementById("SuppliersIFrame");
		var IE = document.all; // for IE6 we will add some extra width and height
		lIFrame.style.width = lContainer.scrollWidth + (IE ? 4 : 0) + "px";
		lIFrame.style.height = lContainer.scrollHeight + (IE ? 4 : 0) + "px";
		lIFrame.style.top = lContainer.offsetTop + "px";
		lIFrame.style.left = lContainer.offsetLeft + "px";
		lIFrame.style.display = "block";
	}
}


function DisableVerticalSupplierLinks()
{
	var lContainer = document.getElementById("verticalSupplierLinks");
	if (lContainer != null)
	{
		SetSupplierDisplayStyle(lContainer,false);
	}
	
	SetDropDownsVisibilityIE6(true);
}

function DisableVerticalSupplierLinksWithPublication ()
{
	var lContainer = document.getElementById("verticalSupplierLinksGeneralContainer");
	if (lContainer != null)
	{
		SetSupplierDisplayStyle(lContainer,false);
		
		// Set the iframe
		var lIFrame = document.getElementById("SuppliersIFrame");
		lIFrame.style.display = "none";
	}

	SetDropDownsVisibilityIE6(true);
	ShowCountryFlashMap(true);
}

function SetSupplierDisplayStyle(container,display)
{
		if(display == true)
		{	
			container.style.display = "block";
		}
		else
		{
			container.style.display = "none";
		}	
}

function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) 
	{
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) 
		{
			curtop += obj.offsetTop
		}
	}
	return curtop;
}


var BrowserDetector = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "IE",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};

function setBodyClassName ()
{
	var lBodyObject;
	var lBodyTags = document.getElementsByTagName ('body');

	if (lBodyTags != null && lBodyTags.length > 0)
	{
		BrowserDetector.init();
		lBodyObject = lBodyTags[0];
		if (lBodyObject.className != '')
		{
			lBodyObject.className = lBodyObject.className + ' ' + BrowserDetector.browser;
		}
		else
		{
			lBodyObject.className = BrowserDetector.browser;
		}
	}
}
// global variables
var popUpDivClassName = "popUpDivClass";
var pageLoaded = false;
var SelectedDropDown = '';

// This function creates an opaque overlay div 
// and adds the content of the contentPopup parameter to the center of the overlay
function CreateOverlayPopUpWindow(contentPopupId, closeButtonText, entityId) {
	if (CreateOuterOverlay(contentPopupId, closeButtonText, entityId))
		CreateOverlayContent(contentPopupId, closeButtonText, entityId);
}

// This function creates an opaque overlay div 
// and adds the content of the contentPopup parameter to the center of the overlay
function CreateFlightTicketsOverlayPopUpWindow(contentPopupId, closeButtonText, url, selectId) {
	if (CreateOuterOverlay(contentPopupId, closeButtonText, null)) {
		if (selectId != 'undefined' && selectId != null) {
			RememberSelection(selectId);
			SelectedDropDown = selectId;
		}
		CreateFlightOverlayContent(contentPopupId, closeButtonText, url);
	}
}

// This function creates an opaque overlay div for the google pop-up only
// and adds the content of the contentPopup parameter to the center of the overlay
function CreateGoogleOverlayPopUpWindow(contentPopupId, closeButtonText, entityId, score, url) {
	if (pageLoaded) {
		if (CreateOuterOverlay(contentPopupId, closeButtonText, entityId))
			CreateGoogleOverlayPopupContent(contentPopupId, closeButtonText, entityId, score, url);
	}
}

// This checks if the user accepts cookies. If it doesn't than the popup is not displayed
// NOTE: The test cookie is added in the control for the site selection overlay
function CheckCookie() {
    if (document.cookie == "") {
        return false;
    } else {
        return true;
    }
}

function CreateOuterOverlay(contentPopupId, closeButtonText, entityId) {
	var wucPopUpOverlayExtender = document.getElementById(contentPopupId);
	var lTempDivId = "tempDiv_" + contentPopupId;
	if (wucPopUpOverlayExtender == null) {
		//only show the pop-up when the overlay external control
		//in rendered into the page
		var tempDiv = document.getElementById(lTempDivId);
		if (tempDiv != null)
		//removes the div from page
			tempDiv.parentNode.removeChild(tempDiv);
		return false;
	}

	//set banners visibility
	//solution for the overlay banner pop-up problem
	ShowFlashObjects(false);
	ShowCountryFlashMap(false);
	ShowFrames(false);

	//create the overlay div
	var modalDiv = document.getElementById(lTempDivId);
	if (modalDiv == null) {
		modalDiv = document.createElement("div");
		modalDiv.name = lTempDivId;
		modalDiv.id = lTempDivId;

		if (typeof (tempDivClassName) != 'undefined') {
			//for syndication pages, it is set in the syndication pages
			modalDiv.className = tempDivClassName;
		}
		else {
			modalDiv.className = "modalBackground";
			modalDiv.style.width = screen.width + 'px';
			modalDiv.style.height = screen.height + 'px';

			if (typeof (BrowserDetector.browser) == 'undefined') {
				BrowserDetector.init();
			}
			if ((BrowserDetector.browser == 'IE' || BrowserDetector.browser == 'Explorer') && BrowserDetector.version < 7) {
				modalDiv.className += " modalBackgroundIE";
				modalDiv.style.height = document.body.offsetHeight;
			}
		}

		document.body.appendChild(modalDiv);
	}

	if (BrowserIsIE6())
	{
	    SetDropDownsVisibility(false);
    }
		
	return true;
}

function BrowserIsIE6() {
    return getInternetExplorerVersion() == 6;
}

// Returns the version of Internet Explorer or a -1 (indicating the use of another browser).
function getInternetExplorerVersion()
{
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");

        if (re.exec(ua) != null) {
            rv = parseFloat(RegExp.$1);
        }
    }
    return rv;
}

// show - bool value to show or hide drop down lists (true = visible)
function SetDropDownsVisibility(show) {
    if (typeof document.body.style.maxHeight == "undefined") // This returns "undefined" only for IE6
    {
        var ddls = document.getElementsByTagName("select");
        for (i = 0; i < ddls.length; i++) {
            ddls[i].style.visibility = show ? "visible" : "hidden";
        }
    }
}

function SetCustomVisibleDelay (timeout)
{
	setTimeout("setVisibility()", timeout);	
}

function setVisibility() {
    var div = document.getElementById("popupTopCloseButton");
    if (div != null) {
        div.style.display = "block";
    }
}

function CloseOverlay(lTempDivId, hideFlashMapCountry)
{
    var modalDiv = document.getElementById(lTempDivId);

    if (modalDiv != null) {
        if (BrowserIsIE6()) {
            SetDropDownsVisibility(true);
        }
    	modalDiv.style.display = "none";
    }    

    var popUpDiv = document.getElementById("temp_popupOverlayExternal");
    if(popUpDiv != null){
	    popUpDiv.style.display = "none";
	}
	
    //set banners visibility
    //solution for the overlay pop-up problem
	ShowFlashObjects(true);
	if (hideFlashMapCountry != true) {
		ShowCountryFlashMap(true);
	}
	ShowFrames(true);
	
	if (typeof (BrowserDetector.browser) == 'undefined') {
		BrowserDetector.init();
	}
	
	if (BrowserDetector.browser == 'Firefox' || BrowserDetector.browser == 'Mozilla') {
		//This piece of code makes sure that the videos from the page are not over the vertical supplier links if they are visible
		var lVerticalSuppliers = document.getElementById("SuppliersIFrame");
		if (lVerticalSuppliers != "undefined" && lVerticalSuppliers != null && lVerticalSuppliers.style.display == "block") {
			lVerticalSuppliers.contentWindow.document.body.innerHTML = lVerticalSuppliers.contentWindow.document.body.innerHTML;
			lVerticalSuppliers.style.display = "block";
		}
	}
}

function CloseOverlayFlight(lTempDivId) {
	var lHideFlash = false;
	if (SelectedDropDown.indexOf("flight_supp") > 0) {
		lHideFlash = true;
	}
	CloseOverlay(lTempDivId, lHideFlash);
	
	SetRememberSelections();
}

function CreateOverlayContent(contentPopupId, closeButtonText, entityId) 
{
    if (contentPopupId == 'InvisiblepopupOverlayExternal') {
        CreateExternalOverlayContent(contentPopupId, closeButtonText);
    }
    if (contentPopupId == 'SiteSelectionOverlayPopup') {
        CreateUserSiteSelectionOverlayContent(contentPopupId);
    }
   }

function CreateFlightOverlayContent(contentPopupId, closeButtonText, url) {
	var popUpDiv = document.getElementById("temp_popupOverlayExternal");

	if (popUpDiv == null) {
		popUpDiv = document.createElement("div");
		popUpDiv.name = "temp_popupOverlayExternal";
		popUpDiv.id = "temp_popupOverlayExternal";
		popUpDiv.className = popUpDivClassName;
		popUpDiv.style.left = Math.abs((screen.width - 990) / 2) + 145 + 'px';
		popUpDiv.style.top = 315 + 'px';
		document.body.appendChild(popUpDiv);
	}
	else {
		popUpDiv.style.display = "";
		document.getElementById("tempDiv_" + contentPopupId).style.display = "";
	}

	popUpDiv.innerHTML = "<div id='popupOverlayExternal' class='overlayExternal google-pop-up'>"
            + "<div id='popupTopCloseButton' onclick='CloseOverlayFlight(\"tempDiv_" + contentPopupId + "\")' class='close' style='cursor:pointer'>"
            + "<span>" + closeButtonText + "</span></div>"
            + "<iframe src='" + url + "' width='660' height='480' frameborder='0' marginheight='0' marginwidth='0' scrolling='no'></iframe>"
			+ "</div>";

	SetPopupScrollPosition(popUpDiv);   
}

function CreateExternalOverlayContent(contentPopupId, closeButtonText) 
{
    var popUpDiv = document.getElementById("temp_popupOverlayExternal");

    if (popUpDiv == null) {
        popUpDiv = document.createElement("div");
        popUpDiv.name = "temp_popupOverlayExternal";
        popUpDiv.id = "temp_popupOverlayExternal";
        popUpDiv.className = popUpDivClassName;
        popUpDiv.style.left = Math.abs((screen.width - 990) / 2) + 255 + 'px';
        popUpDiv.style.top = 10 + 'px';
        popUpDiv.innerHTML = "<div id='popupOverlayExternal' class='overlayExternal' style='width:550px'>"
            + "<div id='popupTopCloseButton' onclick='CloseOverlay(\"tempDiv_" + contentPopupId + "\")' class='topOverlayExternalCloseButton' style='display:none'>"
            + "<span>" + closeButtonText + "</span></div>"
			+ document.getElementById(contentPopupId).innerHTML
			+ "</div>";

        document.body.appendChild(popUpDiv);
    }
    SetCustomVisibleDelay(5000);
}

function CreateUserSiteSelectionOverlayContent(contentPopupId) {
    var popUpDiv = document.getElementById("temp_popupOverlayExternal");

    if (popUpDiv == null) {
    		popUpDiv = document.createElement("div");
        popUpDiv.name = "temp_popupOverlayExternal";
        popUpDiv.id = "temp_popupOverlayExternal";
        popUpDiv.className = popUpDivClassName;
        popUpDiv.style.top = 315 + 'px';
        popUpDiv.style.width = 'auto';
        popUpDiv.innerHTML = "<div id='popupOverlayExternal' class='overlayExternal'>"
			+ document.getElementById(contentPopupId).innerHTML
			+ "</div>";
        
        document.body.appendChild(popUpDiv);

        var lWidth = 0;
        if (popUpDiv.clientWidth)
        	lWidth = popUpDiv.clientWidth;
        if (lWidth != 0)
        	popUpDiv.style.marginLeft = Math.abs((screen.width - lWidth) / 2) + 'px';
    }
}

function CreateGoogleOverlayPopupContent(contentPopupId, closeButtonText, entityId, score, url) {
	var popUpDiv = document.getElementById("temp_popupOverlayExternal");

	if (popUpDiv == null) {
		popUpDiv = document.createElement("div");
		popUpDiv.name = "temp_popupOverlayExternal";
		popUpDiv.id = "temp_popupOverlayExternal";
		popUpDiv.className = popUpDivClassName;
		popUpDiv.style.left = Math.abs((screen.width - 990) / 2) + 145 + 'px';
		popUpDiv.style.top = 315 + 'px';
		document.body.appendChild(popUpDiv);
	}
	else
	{
		popUpDiv.style.display = "";
		document.getElementById("tempDiv_" + contentPopupId).style.display = ""; 
	}

	popUpDiv.innerHTML = "<div id='popupOverlayExternal' class='overlayExternal google-pop-up'>"
            + "<div id='popupTopCloseButton' onclick='CloseOverlay(\"tempDiv_" + contentPopupId + "\")' class='close' style='cursor:pointer'>"
            + "<span>" + closeButtonText + "</span></div>"
            + "<iframe src='" + url + "?entid=" + entityId + "&score=" + score
            + "' width='660' height='464' frameborder='0' marginheight='0' marginwidth='0' scrolling='no'></iframe>"
			+ "</div>";
			
	SetPopupScrollPosition(popUpDiv);
}

function SetPopupScrollPosition(popUpDiv)
{
	var lScrollY, lDefaultY = 100;

	if (window.scrollY)
		lScrollY = window.scrollY;
	else
		if (document.documentElement.scrollTop)
		lScrollY = document.documentElement.scrollTop;
	else
		lScrollY = document.body.scrollTop;

	popUpDiv.style.top = lScrollY + lDefaultY + 'px';
}

var BrowserDetect = {
	init: function() {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function(data) {
		for (var i = 0; i < data.length; i++) {
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function(dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
	},
	dataBrowser: [
		{ string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS: [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};

function SetPageLoaded() {
	pageLoaded = true;
}

BrowserDetect.init();

if (BrowserDetect.browser == 'Explorer') {
	window.onload = SetPageLoaded;
}
else {
	SetPageLoaded();
}

Type.registerNamespace('NetMatch.Zoover.Web.MyZoover.Services');
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService = function() {
	NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.initializeBase(this);
	this._timeout = 0;
	this._userContext = null;
	this._succeeded = null;
	this._failed = null;
}
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.prototype = {
	_get_path: function() {
		var p = this.get_path();
		if (p) return p;
		else return NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.get_path();
	},
	GetLoginBox: function(mlmmCode, succeededCallback, failedCallback, userContext) {
		return this._invoke(this._get_path(), 'GetLoginBox', false, { mlmmCode: mlmmCode }, succeededCallback, failedCallback, userContext);
	},
	GetForgotPasswordBox: function(mlmmCode, succeededCallback, failedCallback, userContext) {
		return this._invoke(this._get_path(), 'GetForgotPasswordBox', false, { mlmmCode: mlmmCode }, succeededCallback, failedCallback, userContext);
	},
	PerformLogin: function(userEmail, userPassword, rememberMe, mlmmCode, succeededCallback, failedCallback, userContext) {
		return this._invoke(this._get_path(), 'PerformLogin', false, { userEmail: userEmail, userPassword: userPassword, rememberMe: rememberMe, mlmmCode: mlmmCode }, succeededCallback, failedCallback, userContext);
	},
	PerformLogout: function(mlmmCode, succeededCallback, failedCallback, userContext) {
		return this._invoke(this._get_path(), 'PerformLogout', false, { mlmmCode: mlmmCode }, succeededCallback, failedCallback, userContext);
	},
	ForgotPassword: function(email, mlmmCode, succeededCallback, failedCallback, userContext) {
		return this._invoke(this._get_path(), 'ForgotPassword', false, { email: email, mlmmCode: mlmmCode }, succeededCallback, failedCallback, userContext);
	},
	GetMyZooverProfiles: function(emailAddresses, succeededCallback, failedCallback, userContext) {
		return this._invoke(this._get_path(), 'GetMyZooverProfiles', false, { emailAddresses: emailAddresses }, succeededCallback, failedCallback, userContext);
	} 
}
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.registerClass('NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService', Sys.Net.WebServiceProxy);
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance = new NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService();
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.set_path = function(value) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.set_path(value); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.get_path = function() { return NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.get_path(); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.set_timeout = function(value) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.set_timeout(value); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.get_timeout = function() { return NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.get_timeout(); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.set_defaultUserContext = function(value) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.set_defaultUserContext(value); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.get_defaultUserContext = function() { return NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.get_defaultUserContext(); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.set_defaultSucceededCallback = function(value) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.set_defaultSucceededCallback(value); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.get_defaultSucceededCallback = function() { return NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.get_defaultSucceededCallback(); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.set_defaultFailedCallback = function(value) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.set_defaultFailedCallback(value); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.get_defaultFailedCallback = function() { return NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.get_defaultFailedCallback(); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.set_path("/MyZoover/Services/MyZooverUIService.asmx");
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.GetLoginBox = function(mlmmCode, onSuccess, onFailed, userContext) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.GetLoginBox(mlmmCode, onSuccess, onFailed, userContext); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.GetForgotPasswordBox = function(mlmmCode, onSuccess, onFailed, userContext) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.GetForgotPasswordBox(mlmmCode, onSuccess, onFailed, userContext); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.PerformLogin = function(userEmail, userPassword, rememberMe, mlmmCode, onSuccess, onFailed, userContext) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.PerformLogin(userEmail, userPassword, rememberMe, mlmmCode, onSuccess, onFailed, userContext); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.PerformLogout = function(mlmmCode, onSuccess, onFailed, userContext) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.PerformLogout(mlmmCode, onSuccess, onFailed, userContext); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.ForgotPassword = function(email, mlmmCode, onSuccess, onFailed, userContext) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.ForgotPassword(email, mlmmCode, onSuccess, onFailed, userContext); }
NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService.GetMyZooverProfiles = function(emailAddresses, onSuccess, onFailed, userContext) { NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService._staticInstance.GetMyZooverProfiles(emailAddresses, onSuccess, onFailed, userContext); }
var gtc = Sys.Net.WebServiceProxy._generateTypedConstructor;
Type.registerNamespace('NetMatch.Zoover.MyZoover');
if (typeof (NetMatch.Zoover.MyZoover.MyZooverProfileInformation) === 'undefined') {
	NetMatch.Zoover.MyZoover.MyZooverProfileInformation = gtc("NetMatch.Zoover.MyZoover.MyZooverProfileInformation");
	NetMatch.Zoover.MyZoover.MyZooverProfileInformation.registerClass('NetMatch.Zoover.MyZoover.MyZooverProfileInformation');
}

/*
This script is used for myZoover functionality
*/
var _LoginBoxContainerId = "myZooverLoginBoxContainer";
var _ForgotPasswordBoxContainerId = "MyZooverModalContent";
var _Email = "";

// Gets the HTML for the login box
function GetLoginBox() {
    var proxy = new NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService();
    proxy.GetLoginBox(getMlmmCode(), getLoginBoxHTML, onError);
}

// Gets the HTMl for the Forgot Password popup
function GetForgotPasswordBox() {
	var proxy = new NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService();
	proxy.GetForgotPasswordBox(getMlmmCode(), getForgotPasswordBoxHTML, onError);
}

// Performs the login
function PerformLogin(user, pass, rememberMe) {
    var proxy = new NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService();
    proxy.PerformLogin(user, pass, rememberMe, getMlmmCode(), doLoginResult, onError);
}

// Performs the logout
function DoLogout() {
    var proxy = new NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService();
    proxy.PerformLogout(getMlmmCode(), doLogoutResult);
}

// Performs the forgot password action on a myZoover account email
function ForgotPassword(email) {
	_Email = email;
	var proxy = new NetMatch.Zoover.Web.MyZoover.Services.MyZooverUIService();
	proxy.ForgotPassword(email, getMlmmCode(), ForgotPasswordResult);
}

// Shows the error message in case the forgot password did not work as expected
function ForgotPasswordResult(result) {
	if (result != '') { alert(result); }
	else {
		alert(Password_Remembered.replace("{0}", _Email));
		RemoveForgotPasswordModal();
	}
}

// Refresh the login box if the login was successful
function doLoginResult(result) {
    if (result != '') { alert(result); }
    else {
        GetLoginBox();
    }
}

// Renders the HTML in the login box container
function getLoginBoxHTML(result) {
    if (result != '') { $get(_LoginBoxContainerId).innerHTML = result; }
}

// Renders the HTML in the login box container
function getForgotPasswordBoxHTML(result) {
	if (result != '') { $get(_ForgotPasswordBoxContainerId).innerHTML = result; }
}

// Refresh the login box after the logout
function doLogoutResult(result, userContext, methodName) {
    GetLoginBox();
}

function onError(result) {
	// Don't do anything in case of error - the client shouldn't know about the error.
	//if (result.get_statusCode() != '0')
		//alert(result.get_message());
}

function getMlmmCode() {
    if (typeof (MLMMCode) == 'undefined') {
        alert('There is no SiteContext defined!');
    }
    return MLMMCode;
}

// DoLogin function used here is registered from code
function MyZooverKeyPress(event) {
    if (navigator.appName == 'Netscape') {
        if (event.which == 13) {
            event.cancelBubble = true;
            event.returnValue = false;
            DoLogin();
            return false;
        }
    }
    else {
        if (window.event.keyCode == 13) {
            window.event.cancelBubble = true;
            window.event.returnValue = false;
            DoLogin();
            return false;
        }
    }
    return true;
}

function DoForgotPassword() {
	var lEmail = document.getElementById('txtMyZooverFPEmail');
	if (lEmail.value != '') {
		ForgotPassword(lEmail.value);
	} else {
		alert(Error_EmailRequired);
	}
}

function ForgotPasswordModal() {
	ShowDropDownsIE6(false);

	ShowCountryFlashMap(false);

	ShowVideoPlayer(false);

	var modalDiv = document.getElementById("MyZooverModalBg");
	if (modalDiv == null) {
		modalDiv = document.createElement("div");
		modalDiv.name = "MyZooverModalBg";
		modalDiv.id = "MyZooverModalBg";
		modalDiv.className = "modalBackground";
		modalDiv.style.width = document.body.offsetWidth + 'px';
		modalDiv.style.height = screen.height + 'px';

		if (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) {
			modalDiv.className += " modalBackgroundIE";
			modalDiv.style.height = document.body.offsetHeight;
		}
		document.body.appendChild(modalDiv);
	}
	else {
		modalDiv.style.display = "block";
	}

	var popUpDiv = document.getElementById("MyZooverModalMainContainer");
	if (popUpDiv == null) {
		popUpDiv = document.createElement("div");
		popUpDiv.name = "MyZooverModalMainContainer";
		popUpDiv.id = "MyZooverModalMainContainer";
		popUpDiv.className = "popUpDivClassMyZoover";

		popUpWindow = document.createElement('div');
		popUpWindow.id = 'MyZooverModalContent';
		popUpWindow.className = "popUpDivClassMyZoover";

		popUpDiv.appendChild(popUpWindow);

		document.body.appendChild(popUpDiv);
	}
	else {
		popUpDiv.style.display = "block";
	}
	
	var left = (document.body.offsetWidth - 500) / 2;
	if (left < 0) left = 0;
	popUpDiv.style.left = left + "px";

	SetDefaultMyZooverModalTopPosition();

	GetForgotPasswordBox();
}

function RemoveForgotPasswordModal() {
	var modalDiv = document.getElementById("MyZooverModalBg");
	if (modalDiv != null) {
		modalDiv.style.display = "none";
	}

	var popUpDiv = document.getElementById("MyZooverModalMainContainer");
	if (popUpDiv != null) {
		popUpDiv.style.display = "none";
	}

	ShowCountryFlashMap(true);

	ShowVideoPlayer(true);

	ShowDropDownsIE6(true);
}

// show - bool value to show or hide drop down lists (true = visible)
function ShowDropDownsIE6(show) {
	if (typeof document.body.style.maxHeight == "undefined") // This returns "undefined" only for IE6
	{
		var ddls = document.getElementsByTagName("select");
		for (i = 0; i < ddls.length; i++) {
			ddls[i].style.visibility = show ? "visible" : "hidden";
		}
	}
}

function ShowVideoPlayer(show) {
	var videoPlayer = document.getElementById('frameVideoPlayer');
	if (videoPlayer != null) {
		if (show) {
			videoPlayer.style.visibility = 'visible';
		}
		else {
			videoPlayer.style.visibility = 'hidden';
		}
	}
}

function SetDefaultMyZooverModalTopPosition() {
	var lScrollY, lDefaultY = 250;
	var lMyZooverMainModalContainer;

	if (window.scrollY)
		lScrollY = window.scrollY;
	else
		if (document.documentElement.scrollTop)
		lScrollY = document.documentElement.scrollTop;
	else
		lScrollY = document.body.scrollTop;

	lMyZooverMainModalContainer = document.getElementById('MyZooverModalMainContainer');
	if (lMyZooverMainModalContainer != null) {
		lMyZooverMainModalContainer.style.top = lScrollY + lDefaultY + 'px';
	}
}
// JavaScript functionality for the carousel control
var Carousel_ActiveTabIndex = 0;
var Carousel_LoopStopped = false;

$(function() {
	// In IE6 and IE7 we have an issue with the banner that overlaps the carousel. Refresh the carousel to fix the overlap.
	if ($.browser.msie && $.browser.version.substr(0, 1) <= 7) {
		setTimeout('CarouselRefresh(0)', 300); 
	}
});

function InitCarousel() {
	if (typeof arr_Carousel  == 'undefined' || arr_Carousel.length == 0) return;
	// We always set the first carousel tab to be the active one
	Carousel_SetActiveTab(0, false);
	// Set the onclick events for the carousel tabs
	for (i = 0; i < arr_Carousel.length; i++) {
		var lnkObj = document.getElementById(arr_Carousel[i][0]);
		if (lnkObj) {
			if (lnkObj.attachEvent) {
				lnkObj.attachEvent("onclick", new Function("Carousel_SetActiveTab(" + i + ", false)"));
			}
			else {
				lnkObj.setAttribute("onclick", "Carousel_SetActiveTab(" + i + ", false)");
			}
		}
	}
	// Start looping - only if looping time is greater than 0
	if (CarouselLoopTime > 0) {
		Carousel_LoopStopped = false;
		setTimeout(function() { CarouselLoop(Carousel_ActiveTabIndex + 1) }, CarouselLoopTime);
	}
}

// Method that handles the looping of the carousel tabs
function CarouselLoop(tabIndex) {
	if (tabIndex > 0 && !Carousel_LoopStopped && tabIndex < arr_Carousel.length) {
		Carousel_SetActiveTab(tabIndex, true);
		if (Carousel_ActiveTabIndex < arr_Carousel.length - 1) {
			// We continue the loop if we are not at the last tab
			setTimeout(function() { CarouselLoop(Carousel_ActiveTabIndex + 1) }, CarouselLoopTime);
		}
		else {
			// If we are at the last tab than after the display of the tab is done we get back to the first (thus stopping the loop)
			setTimeout(function() { Carousel_SetActiveTab(0, true) }, CarouselLoopTime);
		}
	}
}

// Method that activates a tab of the carousel control
function Carousel_SetActiveTab(tabIndex, fromLoop) {
	// We prevent setting an active tab from the loop if the loop was stopped by the user by clicking on a tab
	if (fromLoop && Carousel_LoopStopped) {
		return;
	}

	// Get the ids of the objects that need to be activated
	var linkId = arr_Carousel[tabIndex][0];
	var layerId = arr_Carousel[tabIndex][1];

	// Set all objects to off state
	Carousel_SetTabsOff();

	// Get the objects to be activated and activate them
	var lnkObj = document.getElementById(linkId);
	var layerObj = document.getElementById(layerId);
	if (lnkObj && layerObj) {
		Carousel_SetOnClass(lnkObj);
		Carousel_SetOnClass(layerObj);
		lnkObj.blur();
	}

	if (!fromLoop) {
		// If it is not from loop then we either have finshed the loop or the user has clicked on a tab and we must stop the loop
		Carousel_LoopStopped = true;
	}

	Carousel_ActiveTabIndex = tabIndex;
	// Check if the container has logos.
	var lLogosContainer = GetLogosContainer(layerId);
	if (lLogosContainer.length > 0) {
		// Logos container found, setup logos animation.
		clearInterval(_LogosInterval);
		SetLogosScrollRight(layerId);
	}
	else {
		clearInterval(_LogosInterval);
	}
}

function StopCarouselLoop() {
	Carousel_LoopStopped = true;
}

// Method that sets all the tabs of the carousel to off state
function Carousel_SetTabsOff() {
	for (i = 0; i < arr_Carousel.length; i++) {
		var obj = document.getElementById(arr_Carousel[i][0]);
		Carousel_SetOffClass(obj);
		obj = document.getElementById(arr_Carousel[i][1]);
		Carousel_SetOffClass(obj);
	}
}

// Method that sets the off state for the given object
// The logic is based on the fact that there are two CSS classes (xxx_off and xxx_on) 
// The method just replaces the _off part with the _on part
function Carousel_SetOffClass(obj) {
	if (obj == null) return;
	obj.className = obj.className.replace("_on", "_off");
}

// Method that sets the on state for the given object
// The logic is based on the fact that there are two CSS classes (xxx_off and xxx_on) 
// The method just replaces the _on part with the _off part
function Carousel_SetOnClass(obj) {
	if (obj == null) return;
	obj.className = obj.className.replace("_off", "_on");
}

// *******************************************************************************
// JS functionality for the logos in the flight tickets and car rental controls
// *******************************************************************************
var _LogosContainerId = "";
var _LogosInterval = null;
var _DefaultLogoWidth = 75;

function SetLogosScrollRight(logosContainerId) {
	_LogosContainerId = logosContainerId;
	_LogosInterval = setInterval(Logos_RightClick, 2000);
}

function Logos_RightClick() {
	var lLogosContainer = GetLogosContainer(_LogosContainerId);
	if (lLogosContainer.length == 0)
		return;
		
	// get all the logo divs
	var lLogosList = $(lLogosContainer[0]).find("div");
	
	// We have to move all the logos (div elements) to the left and bring the first one in the last position
	lLogosList.each(function(index, logo) {
		$(logo).animate({ "left": "-=" + _DefaultLogoWidth + "px" }, 500,
					function() {
						if (index != 0)
							return;

						var lLogo = lLogosList[0];
						lLogo.style.left = (lLogosList.length - 1) * _DefaultLogoWidth + "px";
						// Move the first element to the last position
						lLogosContainer[0].removeChild(lLogo);
						lLogosContainer[0].appendChild(lLogo);
					});
	});
}

function CarouselRefresh(counter) {
	if (!window.arr_Carousel || !window.IsAdlinkCarouselEnabled || arr_Carousel.length == 0) {
		return;
	}

	if (Carousel_ActiveTabIndex == 0) {
		var lCarousel = $('#' + arr_Carousel[Carousel_ActiveTabIndex][1]);
		// Add and remove a dummy CSS class to force the browser to refresh the layout.
		lCarousel.addClass("dummy-class");
		lCarousel.removeClass("dummy-class");

		if (counter < 10) {
			setTimeout('CarouselRefresh(' + ++counter + ')', 200);
		}
	}
}

function GetLogosContainer(containerId) {
	return $("#" + containerId).find("div.logoscontainer");
}

// This file is cached. If you change the content of the file than it should be renamed to force the clients to get the new version.

Type.registerNamespace('NetMatch.Zoover.Web.Services.Suppliers');
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService=function() {
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.initializeBase(this);
this._timeout = 0;
this._userContext = null;
this._succeeded = null;
this._failed = null;
}
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.prototype={
_get_path:function() {
 var p = this.get_path();
 if (p) return p;
 else return NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.get_path();},
TrackLinks:function(linksProperties,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'TrackLinks',false,{linksProperties:linksProperties},succeededCallback,failedCallback,userContext); }}
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.registerClass('NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService',Sys.Net.WebServiceProxy);
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance = new NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService();
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.set_path = function(value) { NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.set_path(value); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.get_path = function() { return NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.get_path(); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.set_timeout = function(value) { NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.set_timeout(value); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.get_timeout = function() { return NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.get_timeout(); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.set_defaultUserContext = function(value) { NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.set_defaultUserContext(value); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.get_defaultUserContext = function() { return NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.get_defaultUserContext(); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.set_defaultSucceededCallback = function(value) { NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.set_defaultSucceededCallback(value); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.get_defaultSucceededCallback = function() { return NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.get_defaultSucceededCallback(); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.set_defaultFailedCallback = function(value) { NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.set_defaultFailedCallback(value); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.get_defaultFailedCallback = function() { return NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.get_defaultFailedCallback(); }
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.set_path("/Services/Suppliers/SuppliersLinksService.asmx");
NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService.TrackLinks= function(linksProperties,onSuccess,onFailed,userContext) {NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService._staticInstance.TrackLinks(linksProperties,onSuccess,onFailed,userContext); }

function TrackSuppliersLinks(supplierLinksNames) {

    var service = new NetMatch.Zoover.Web.Services.Suppliers.SuppliersLinksService();

    service.TrackLinks(supplierLinksNames, OnTrackLinksComplete, OnTrackLinksError);
}

function OnTrackLinksComplete(result) {
}

function OnTrackLinksError(result) {
	// Removed the alert since on FireFox you get an annoying message if the user leaves the page before the 
	// request to the server has executed
	//alert(result.get_message());
}

/* EXPAND-COLLAPSE behaviour for suppliers with pricing info*/
// sid - shader id
// tid - shader text id
function ShowSuppliersShader(sid, tid, msg) {
	var sha = document.getElementById(sid);
	var tex = document.getElementById(tid);
	if (sha) {
		sha.className = "shader-on";
		tex.style.lineHeight = tex.clientHeight + 'px';
		tex.innerHTML = "<span>" + msg + "</span>";
	}
}

// sid - shader id
// tid - shader text id
function HideSuppliersShader(sid, tid) {
	var sha = document.getElementById(sid);
	var tex = document.getElementById(tid);
	if (sha) {
		sha.className = "shader-off";
		tex.innerHTML = "&nbsp;";
	}
}

// sid - shader id
// stid - shader text id
// cid - collapse container id
function ExpandSuppliers(sid, cid, stid, hidden_suppliers_id) {
	//closes supplier links pop-up
	DisableVerticalSupplierLinksWithPublication()

	var sha = document.getElementById(sid);
	var shta = document.getElementById(stid);
	var col = document.getElementById(cid);
	var hidden_suppliers = document.getElementById(hidden_suppliers_id);

	if (sha)
		sha.style.display = "none";
	if (shta)
		shta.style.display = "none";
	if (col)
		col.style.display = "block";
	if (hidden_suppliers)
		hidden_suppliers.style.display = "block"

	// This forces IE 7 to redraw the adlinks panel and position the 3 boxes below the adlinks to the correct position
	sha.parentNode.parentNode.style.display = "none";
	sha.parentNode.parentNode.style.display = "block";
}

// sid - shader id
// stid - shader text id
// cid - collapse container id
function CollapseSuppliers(sid, cid, stid, hidden_suppliers_id) {
	//closes supplier links pop-up
	DisableVerticalSupplierLinksWithPublication()

	var sha = document.getElementById(sid);
	var shta = document.getElementById(stid);
	var col = document.getElementById(cid);
	var hidden_suppliers = document.getElementById(hidden_suppliers_id);

	if (sha)
		sha.style.display = "block";
	if (shta)
		shta.style.display = "block";
	if (col)
		col.style.display = "none";

	if (hidden_suppliers)
		hidden_suppliers.style.display = "none"

	// This forces IE 7 to redraw the adlinks panel and position the 3 boxes below the adlinks to the correct position
	sha.parentNode.parentNode.style.display = "none";
	sha.parentNode.parentNode.style.display = "block";
}

// for IE6 only - as height: 100% does not work on IE6 - we force the shader and the shader text to have it's parent container
function setIE6ShaderHeight(shc, sha, sht) {
	var shcElement = document.getElementById(shc);
	if (shcElement != null) {
		var height = shcElement.offsetHeight;
		var shaElement = document.getElementById(sha);
		var shtElement = document.getElementById(sht);
		if ((shaElement != null) && (shtElement != null)) {
			shaElement.style.height = height;
			shtElement.style.height = height;
		}
	}
}

/*
function PriceInfo(name, price){
	var _Name = name;
	var _Price = price;
	
	this.getName = function() { return _Name; }
	this.getPrice = function() { return _Price; }
}

function PriceInfoToolTip(){
	this.PriceInfoArray = new Array();
}

PriceInfoToolTip.prototype.Length = function(){
	return this.PriceInfoArray.length;
}

PriceInfoToolTip.prototype.InfoAtIndex = function(index){
if (index < this.PriceInfoArray.length) {
	return this.PriceInfoArray[index];
	}
	return null;
}

PriceInfoToolTip.prototype.AddPriceInfo = function(priceInfo) {
	this.PriceInfoArray[this.PriceInfoArray.length] = priceInfo;
}

function HoverTooltips(){
	this.HoverInfo = new Array();
	this.Codes = new Array();
	this.DurationTitle = "";
	this.PriceTitle = "";
	this.HoverTitle = "";
	this.ParentsTitle = "";
}

HoverTooltips.prototype.AddPriceInfo = function(code, name, price) {
	var lExistingInfo = this.GetObjectForCode(code);
	if (lExistingInfo == null) {
		var lPriceInfo = new PriceInfoToolTip();
		lPriceInfo.AddPriceInfo(new PriceInfo(name, price));
		this.HoverInfo[this.HoverInfo.length] = lPriceInfo;
		this.Codes[this.Codes.length] = code;
	}
	else {
		lExistingInfo.AddPriceInfo(new PriceInfo(name, price));
	}
}

// The method that returns the current object for the current code if it exists and null if it doesn't exist

HoverTooltips.prototype.GetObjectForCode = function(code) {
	for (var i = 0; i < this.Codes.length; i++) {
		if (this.Codes[i] == code) {
			return this.HoverInfo[i];
		}
	}
	return null;
}

HoverTooltips.prototype.SetDurationTitle = function(value) {
	this.DurationTitle = value;
}

HoverTooltips.prototype.GetDurationTitle = function() {
	return this.DurationTitle;
}

HoverTooltips.prototype.SetPriceTitle = function(value) {
	this.PriceTitle = value;
}

HoverTooltips.prototype.GetPriceTitle = function() {
	return this.PriceTitle;
}

HoverTooltips.prototype.SetAccommodationTitle = function(value) {
	this.HoverTitle = value;
}

HoverTooltips.prototype.GetAccommodationTitle = function() {
	return this.HoverTitle;
}

HoverTooltips.prototype.SetParentsTitle = function(value) {
	this.ParentsTitle = value;
}

HoverTooltips.prototype.GetParentsTitle = function() {
	return this.ParentsTitle;
}

HoverTooltips.prototype.GetHtmlForCode = function(code, div, containerName, widthOffset) {
	var lInfo = this.GetObjectForCode(code);
	div.style.color = "#4C9EDB";
	var lContainer = document.getElementById(containerName);
	if (lInfo != null && lContainer != null) {
		var lParent = this.GetAccommodationTitle().length + this.GetParentsTitle().length;
		var lRatio = lInfo.Length() > 6 ? 22 : 24;
		if (lInfo.Length() < 3 && lParent < 80) {
			lRatio += 5;
		}
		var lExtra = lParent > 80 ? 40 : 31;
		if (lParent > 80) {
			lRatio += 2;
			if (lInfo.Length() > 6) {
				lRatio -= 2;
			}
		}
		var lHeight = lInfo.Length() * lRatio + (lParent / 50) * lExtra + 22;
		var lTop = div.offsetTop + 19;
		var lLeft = div.offsetLeft + parseInt(widthOffset) + 10;
		if (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1 || navigator.userAgent.toLowerCase().indexOf('msie 7') != -1) {
			lTop = div.parentNode.offsetTop + 18;
			lLeft += 6;
			if (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) {
				lLeft += 12;
			}
		}

		if (lInfo.Length() < 3 && lParent > 70) {
			lHeight += 30;
		}

		var lStyle = "height:" + lHeight + "px;top:" + lTop + "px;left:" + lLeft + "px";
		var lHtml = "<div class=\"hoverContainer\" style=\"" + lStyle + "\"><div class=\"hoverAccoTitle\">" + this.GetAccommodationTitle()
			+ "<span class=\"parentsTitle\">" + this.ParentsTitle + "</span></div>";
		var lFirstDiv = "<div class=\"durationContainer\"><span class=\"priceTitle\">" + this.GetDurationTitle() + "</span><br/>";
		var lSecondDiv = "<div class=\"priceContainer\"><span class=\"priceTitle\">" + this.GetPriceTitle() + "</span><br/>";
		for (var i = 0; i < lInfo.Length(); i++) {
			var lObj = lInfo.InfoAtIndex(i);
			if (lObj != null) {
				lFirstDiv += "<span>" + lObj.getName() + "</span><br/>";
				lSecondDiv += "<span>" + lObj.getPrice() + "</span><br/>";
			}
		}
		lFirstDiv += "</div>";
		lSecondDiv += "</div>";
		lHtml += lFirstDiv + lSecondDiv + "</div>";
		lContainer.innerHTML = lHtml;
		lContainer.style.display = "block";
	}
}

HoverTooltips.prototype.HideHtmlCode = function(div, containerName) {
	div.style.color = "#FF5D10";
	var lContainer = document.getElementById(containerName);
	if (lContainer != null) {
		lContainer.style.display = "none";
	}
}

var HoverTooltipsAccos = new HoverTooltips();

*/

/* --END-- SUPPLIERS FOR PRICING INFO */


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();