	// *****************************************************************************************************************
	// Browser detector (extend for more browsers if necessary...)
	// *****************************************************************************************************************
	var isIE = ((navigator.userAgent.toUpperCase().indexOf("MSIE") > -1) && (navigator.userAgent.toUpperCase().indexOf("OPERA") == -1));
	var isIE6orBelow = (isIE && parseBrowserVersion(navigator.appVersion) < 7);

	function parseBrowserVersion(appVer) {
		if (isIE)
			return parseInt(appVer.substr(appVer.toUpperCase().indexOf('MSIE ')+5, 1));

		// return zero as default (unknown version)
		return 0;
	}

	// *****************************************************************************************************************
	// Editorial info window
	// *****************************************************************************************************************

	function editorialPopup(name, windowName, blockType) {
		if (!blockType)
			blockType = 'info';
		window.open('/presentation/frameset/editorialPopup.jsp?blockType='+blockType+'&type=Editorial&name='+name, windowName, 'status=no,toolbar=no,menubar=no, scrollbar=yes,location=no, norezise,width=520,height=450,left=80,top=80');
		return false;
	}


	// *****************************************************************************************************************
	// Find location window
	// *****************************************************************************************************************

	var FIND_LOCATION_CITY_INPUT, FIND_LOCATION_BOUND;

	// opens an find location window
	function findLocation(cityObj, bound)
	{
		FIND_LOCATION_CITY_INPUT = cityObj;
		FIND_LOCATION_BOUND = bound;
		window.open('main?type=General&name=IATAPicker', 'citylookup', 'width=600, height=450, resizable=yes, toolbar=no, titlebar=no, scrollbars');
	}

	// sets the find location code in the form
	function setFindLocationCode(inCode) {
		FIND_LOCATION_CITY_INPUT.value = inCode;
		resetDestinationInput(FIND_LOCATION_CITY_INPUT.form, FIND_LOCATION_BOUND, 1)
	}


	// *****************************************************************************************************************
	// Flight info window
	// *****************************************************************************************************************

	function getFlightInfo(sLinearized)
	{
		var flightNr = "main?type=General&name=FlightInfo&FLIGHT_VALUE=" + sLinearized;
		window.open(flightNr, 'newWin', 'scrollbars=yes, status=yes, width=640, height=400');
	}

	function getTripDetails(sid, avail)
	{
		var tripDetails = "main?type=General&name=TripDetails&sid=" + sid + (avail ? "&avail=true" : "");
		window.open(tripDetails, 'newWin', 'scrollbars=yes, status=yes, width=640, height=400');
	}


	// *****************************************************************************************************************
	// Destination guide printer friendly window
	// *****************************************************************************************************************

	function openDestinationInfoPrint(destinationKey)
	{
		window.open("/main?type=General&name=DestinationInfoPrint&destinationKey=" + escape(destinationKey), 'destInfoPrintWin', 'scrollbars=yes, status=yes, resizable=yes, width=595, height=550');
	}


	// *****************************************************************************************************************
	// Hotels.com map window
	// *****************************************************************************************************************

	function openMapWindow(url) {
		window.open(url, 'hotelComMap', 'width=478,height=333,top=170, left=162,toolbar=no, location=no, directories=no, status=no, menubar=no, dependent=yes, resizable=no,status=no,scrollbars=no');
	}


	// *****************************************************************************************************************
	// Add bookmark function
	// *****************************************************************************************************************

	function addbookmark(bookmarkurl, bookmarktitle) {
		if (document.all)
			window.external.AddFavorite(bookmarkurl,bookmarktitle)
	}


	// *****************************************************************************************************************
	// Show wait message div and transition handling
	// *****************************************************************************************************************

	function showWaitMessage() {
		showMilkyLayer(true);
		// Check if wait elements exists
		if (getDiv("waitMessage")){
			window.scroll(0, 0);
			display('waitMessage', true);
		}
	}

	function showMilkyLayer(display) {
		// Activate wait message shadow if found
		waitMessageShadowDiv = getDiv('waitMessageShadow');
		if (waitMessageShadowDiv) {
			waitMessageShadowDiv.style.width = document.body.offsetWidth+'px';
			setTimeout("display('waitMessageShadow', "+display+")", 1);
			displaySelectBoxesInPage(display);
		}
	}

	function showWaitMsgAndSubmit(formObj) {

		showWaitMessage();

		if (formObj != null){
			displaySelectBoxesInPage(true);
			formObj.submit();
		}
	}

    function chooseFlowTransition( formObj, action ) {
    	if (action)
    		formObj.action.value = action;
    	showWaitMsgAndSubmit(formObj);
    }



	// *****************************************************************************************************************
	// Show wait message div and transition handling
	// *****************************************************************************************************************

	function showSplashMessage(splashText, visible, waitBarMaxSeconds) {
		if (getDiv('splashMessage')) {
			getDiv('splashMessageText').innerHTML = splashText;
			display('splashMessage', visible);
			if (waitBarMaxSeconds && parseInt(waitBarMaxSeconds) > 0 && getDiv('lccWaitBarDiv')) {
				display('lccWaitBarDiv', true);
				fillSplashWaitBar(0, waitBarMaxSeconds);
			}
		}
	}

	function fillSplashWaitBar(barLength, maxTime) {
		if (getDiv('lccWaitBarDiv')) {
			getDiv('lccWaitBarDiv').style.width = (barLength + '%')
			if (barLength < 100) {
				barLength = barLength + (10/maxTime);
				setTimeout("fillSplashWaitBar("+barLength+", "+maxTime+")", 100);
			}
		}
	}



	// *****************************************************************************************************************
	// Display of right menu extension
	// *****************************************************************************************************************

	function showMenuExtension() {
		if (getDiv('menu-right')) {
			show('menu-right', true);
        }
        if (getDiv('main-right')) {
            document.getElementById('main-right').style.borderRight = "1px solid #cccccc";            
        }
    }


	// *****************************************************************************************************************
	// String and int handling
	// *****************************************************************************************************************

	// counts number of occurences of a string or char in a string
	// Usage:
	//		var pucko = "pucko hej å hå...";
	//		var countAA = pucko.count("å");
	String.prototype.count = function(s) {
		return (this.length - this.replace(new RegExp(s,"g"), '').length) / s.length;
	}
	
	function trimSpaces(str){
		if (str) {
			// trim leading spaces
			while(str.charAt(0)==' ')
				str = str.substring(1,str.length);

			// trim trailing spaces
			while(str.charAt(str.length-1)==' ')
				str = str.substring(0,str.length-1);

			return str;
		} else
			return str;
	}

	function trimAllSpaces(str){
		if (str) {
			newStr = '';
			for (cAt=0; cAt < str.length; cAt++)
				newStr += (str.charAt(cAt) == ' ' ? '' : str.charAt(cAt));
			return newStr;
		} else
			return str;
	}

    // Unfortunatly we need this function because of a bug in javascripts parseInt function
    // cant convert "08" or "09" to a number
    function tlIntParser(num) {
		var strnum = ""+num;
		var ret;
		var firstdig = strnum.substring(0,1);
		if(firstdig=="0") {
			ret = strnum.substring(1,2);
			return parseInt(ret);
		} else
			return parseInt(strnum);
    }


	// *****************************************************************************************************************
	// DIV functions
	// *****************************************************************************************************************

	// get the DIV object by a given ID
	function getDiv(id){
		if (document.layers)
			return document.layers[id];
		else if (document.all)
			return document.all[id];
		else if (document.getElementById)
			return document.getElementById(id);
	}

	// get any document object by a given ID (same as getDiv but we do not want to change everywhere and getDiv is not always a suitable name)
	function getDocumentObject(id){
		return getDiv(id);
	}

	// Shows a DIV value by given ID
	// NOTE! The difference between this function and  the display function is that this one just hides or shows the
	// 		 value in the DIV but the space it posseses on the page is never removed. The display function on the other
	//		 hand collapse it's space (so basically the page can move when the DIV is displayed or collapsed)
	function show(id, visible) {
		if (document.layers) {
			vista = visible ? 'show' : 'hide';
			getDiv(id).visibility = vista;
		} else if (document.all) {
			vista = visible ? 'visible' : 'hidden';
			getDiv(id).style.visibility = vista;
		} else if (document.getElementById) {
			vista = visible ? 'visible' : 'hidden';
			getDiv(id).style.visibility = vista;
		}
	}

	// Displays a DIV value by given ID
	// NOTE! See note for function above...
	function display(id, visible) {
        if (!getDiv(id))
            return;
        
		if (document.layers) {
			vista = visible ? 'show' : 'hide';
			getDiv(id).visibility = vista;
		} else if (document.all && getDiv(id).style) {
			getDiv(id).style.visibility = (visible ? 'visible' : 'hidden');
			getDiv(id).style.display = (visible ? 'block' : 'none');
		} else if (document.getElementById && getDiv(id).style) {
			getDiv(id).style.visibility = (visible ? 'visible' : 'hidden');
			getDiv(id).style.display = (visible ? 'block' : 'none');
		}
	}

	// This function opens one div and closes another...
	function switchDisplay(openDivId, closeDivId) {
		display(openDivId, true);
		display(closeDivId, false);
	}

    function toggleDisplay(objId) {
        var docObj = getDocumentObject(objId)
        if (docObj && docObj.style)
            display(objId, (docObj.style.display == "none"));
    }

	// This function is used when we have a list of div that can be opened or closed (when one div is opened the other
	// ones will be closed, see blkFAQ.jsp for example...)
	// Parameters:
	//	   divPrefix 	= the base name of the div list
	//		divIdx		= the div index in the list
	function collapseList(divPrefix, divIdx) {
		breakLoop = false;
		for (i=0; !breakLoop; i++) {
			if (!getDiv(divPrefix+i))
				breakLoop = true;
			else
				display(divPrefix+i, (divIdx == i && getDiv(divPrefix+i).style.display == 'none'));
		}
	}

	// This functions sets a div in the center of the page no matter of the window size and div width
	function setDivInCenter(divId) {
		divObj = getDiv(divId);
		if (divObj) {
			windowWidth = document.body.offsetWidth;
			divObjWidth = 370;

			if (divObj.currentStyle && divObj.currentStyle.width) {
				// IE style
				intWidth = parseInt(divObj.currentStyle.width);
				if (intWidth && !isNaN(intWidth))
					divObjWidth = intWidth;
			} else if (window.getComputedStyle(divObj, '')) {
				// Mozilla style
				computedStyle = window.getComputedStyle(divObj, '');
				intWidth = parseInt(computedStyle.getPropertyValue('width'));
				if (intWidth && !isNaN(intWidth))
					divObjWidth = intWidth;
			}

			divObj.style.left = (windowWidth/2)-(divObjWidth/2)+'px';
		}
	}

	// *****************************************************************************************************************
	// Help div at mouse position
	// *****************************************************************************************************************

	var HELP_DIV_OBJ_ID = 'helpDivAtMousePosition';
	function showHelpDivAtMousePosition(e, divText, topCompensation, leftCompensation, styleClass, sticky, chrome, headerText, closeText) {
		if (!e) var e = window.event;

		// create div object (remove it if it exists, offsetHeight for IE in hideSelectBoxesUnderDiv() call reasons...)
		var helpDivObj = getDiv(HELP_DIV_OBJ_ID);
		if (!helpDivObj)
			return;

		var finalDivText = "";
		if (chrome) {
            helpDivObj.className = 'chromeMouseOverInfo';
            helpDivObj.style.position = 'absolute';
            helpDivObj.style.zIndex = '99999';

			var chromeHeaderDiv = "<div class='chromeHeader' style='display:block;'><a id='stickyAnchorCloseX' href='javascript:hideHelpDivAtMousePosition()'>"+closeText+" &raquo;</a>"+headerText+"</div>";
			var helpDivInnerDiv = "<div id="+HELP_DIV_OBJ_ID+"-inner' class='chromeMouseOverInfoInner' style='position:absolute;z-index:99999;display:block;'>"+divText+"</div>";
		} else {
			helpDivObj.className = (!styleClass ? 'defaultMouseOverInfo' : styleClass);
            helpDivObj.style.position = 'absolute';
            helpDivObj.style.zIndex = '99999';

			if (sticky)
				finalDivText = "<a id='stickyAnchorCloseX' href='javascript:hideHelpDivAtMousePosition()'>X</a>"+divText;
			else
				finalDivText = divText;
		}

		// set mouse position and text for div
        var mPos = getActualMousePosXY(e);
		var mousePosX = mPos[0]+leftCompensation;
		var mousePosY = mPos[1]+topCompensation;
		helpDivObj.style.top = mousePosY+'px';
        helpDivObj.style.left = mousePosX+'px';

		helpDivObj.innerHTML = finalDivText;
        if (sticky)
            showWaitMessageShadow();
        display(HELP_DIV_OBJ_ID, true);
		hideSelectBoxesUnderDiv(HELP_DIV_OBJ_ID);
	}

    function showHelpTextLayer(divText, headerText, closeText, centered) {
        // create div object (remove it if it exists, offsetHeight for IE in hideSelectBoxesUnderDiv() call reasons...)
		var helpDivObj = getDiv(HELP_DIV_OBJ_ID);
		if (!helpDivObj)
			return;

        helpDivObj.className = 'chromeMouseOverInfo';
        helpDivObj.style.position = 'absolute';
        helpDivObj.style.zIndex = '99999';
		helpDivObj.style.height = '250px';

		var finalDivText = "<div class='chromeHeader' style='display:block;'><a id='stickyAnchorCloseX' href='javascript:hideHelpDivAtMousePosition()'>"+closeText+" &raquo;</a>"+headerText+"</div>";
		finalDivText += "<div id="+HELP_DIV_OBJ_ID+"-inner' class='chromeMouseOverInfoInner' style='position:absolute;z-index:99999;display:block;'>"+divText+"</div>";

        helpDivObj.style.top = '130px';
		helpDivObj.style.left = (centered ? (parseInt(document.body.clientWidth)-400)/2 + 'px' : '180px');

        helpDivObj.innerHTML = finalDivText;
		showWaitMessageShadow();
        this.scroll(0,0);
        display(HELP_DIV_OBJ_ID, true);
		hideSelectBoxesUnderDiv(HELP_DIV_OBJ_ID);
    }

    function showObjAtMousePos(e, divId, topCompensation, leftCompensation) {
        if (!e) var e = window.event;

        var divObj = getDiv(divId);
        if (!divObj)
            return;

        divObj.style.position = 'absolute';
        divObj.style.zIndex = '99999';

        // set mouse position and text for div
        var mPos = getActualMousePosXY(e);
        var mousePosX = mPos[0]+leftCompensation;
        var mousePosY = mPos[1]+topCompensation;
        divObj.style.top = mousePosY+'px';
        divObj.style.left = mousePosX+'px';

        display(divId, true);
        hideSelectBoxesUnderDiv(divId);
    }

    function hideObjAtMousePos(divId) {
        if (getDiv(divId))
            display(divId, false);
        displaySelectBoxesInPage(false);
    }
    
    function hideHelpDivAtMousePosition() {
        hideObjAtMousePos(HELP_DIV_OBJ_ID);
		hideWaitMessageShadow();
	}

	function showWaitMessageShadow() {
	    if(document.getElementById){
	        if(document.getElementById('waitMessageShadow')) {
	            var s = document.getElementById('waitMessageShadow');
	            s.style.display = "block";
                s.style.width = document.body.offsetWidth+'px';
	            s.style.visibility = "visible";
	            displaySelectBoxesInPage(true);
	        }
	    }
	}

	function hideWaitMessageShadow() {
	    if(document.getElementById){
	        if(document.getElementById('waitMessageShadow')) {
	            var s = document.getElementById('waitMessageShadow');
	            s.style.display = "none";
	            s.style.visibility = "hidden";
	            displaySelectBoxesInPage(false);
	        }
	    }
	}

	// *****************************************************************************************************************
	// Input and select box handling
	// *****************************************************************************************************************

	// Gets a the index of a value in a select box
	function getIdxInSelectBox(formObj, selectBoxName, forValue){
		if (formObj && formObj[selectBoxName] && formObj[selectBoxName].options) {
			for (i=0; i < formObj[selectBoxName].options.length; i++) {
				if (formObj[selectBoxName].options[i].value == forValue)
					return i;
			}
		} else
			alert("...failed to get index for value in select box...");

		return 0;
	}

	// Gets a the index of a value in a select box that starts with a given value
	function getIdxInSelectBoxStartsWith(formObj, selectBoxName, forValue){
		if (formObj && formObj[selectBoxName] && formObj[selectBoxName].options) {
			for (i=0; i < formObj[selectBoxName].options.length; i++) {
				if (formObj[selectBoxName].options[i].value.indexOf(forValue) == 0)
					return i;
			}
		} else
			alert("...failed to get index for value in select box...");

		return 0;
	}

	// This function searchs a select box for a value and returns its index
	function setSelectIdxFromValue(selBox, value){
		if (selBox) {
			for (i=0; i < selBox.length; i++) {
				if (selBox[i].value == value) {
					selBox.selectedIndex = i;
					break;
				}
			}
		}
	}

	// This function clears (sets to given reset value) the value for one input field if the master input field has a
	// value. Note that if the sub input type is a select box we set the selected index to zero
	function clearSubIfMasterValue(formObj, masterInput, subInput, resetValue) {
		if (formObj && formObj[masterInput] && formObj[subInput]) {
			masterValue = trimSpaces(formObj[masterInput].value);
			slaveValue = trimSpaces(formObj[subInput].value);
			if (masterValue && slaveValue) {
				if (formObj[subInput].type == 'select-one')
					formObj[subInput].selectedIndex = 0;
				else
					formObj[subInput].value = resetValue;
			}
		}
	}

	// Adds an option to a select box
	function addOptionToSelectBox(selBoxObj, optionValue, optionText, selectOption){
		newOption = new Option();
		newOption.value = optionValue;
		newOption.text = optionText;

		newOptionIdx = selBoxObj.options.length;
		selBoxObj.options[newOptionIdx] = newOption;

		if (selectOption)
			selBoxObj.options[newOptionIdx].selected = true;
	}

    function getRadioCheckedValue(radioObj) {
            for (var i = 0; i < radioObj.length; i++) {
                if (radioObj[i].checked)
                    return radioObj[i].value;
            }
            return -1;
        }

	// Hides all select boxes in a page (IE layer-select box issue...)
	function displaySelectBoxesInPage(hideBoxes) {
		if (isIE6orBelow) {
			allSelects = document.all.tags("select");
			if (allSelects) {
				for (i=0; i < allSelects.length; i++)
					allSelects[i].style.visibility = (hideBoxes ? 'hidden' : 'visible');
			}
		}
	}

	// Hides all select boxes in a page (IE layer-select box issue...)
	function hideSelectBoxesUnderDiv(divId) {
		// NOTE! We only do this for old versions of IE so need to consider browser compability here
		if (isIE6orBelow) {
			var divObj = getDiv(divId);

			// Set coordinates in order left, top, width, height
			var coordinates = new Array(getDivLeftPos(divId), getDivTopPos(divId), getDivWidth(divId), getDivHeight(divId));
			var allSelects = document.all.tags("select");

            if (allSelects) {
				for (var i=0; i < allSelects.length; i++) {
					selectLeft = getPageOffsetLeft(allSelects[i]);
					selectTop = getPageOffsetTop(allSelects[i]);
					selectWidth = allSelects[i].offsetWidth;
					selectHeight = allSelects[i].offsetHeight;
					//alert(coordinates+'\n'+(selectLeft+','+selectTop+','+selectWidth+','+selectHeight));

					var horisontalMatch = false;
					var verticalMatch = false;
					if (selectLeft > coordinates[0] && selectLeft < (coordinates[0]+coordinates[2]))
						horisontalMatch = true;
					else if ((selectLeft+selectWidth) > coordinates[0] && (selectLeft+selectWidth) < (coordinates[0]+coordinates[2]))
						horisontalMatch = true;

					if (horisontalMatch) {
						if (selectTop > coordinates[1] && selectTop < (coordinates[1]+coordinates[3]))
							verticalMatch = true;
						else if ((selectTop+selectHeight) > coordinates[1] && (selectTop+selectHeight) < (coordinates[1]+coordinates[3]))
							verticalMatch = true;
					}

					if (horisontalMatch && verticalMatch)
						allSelects[i].style.visibility = 'hidden';
				}
			}
		}
	}

	// gets the absolute left position of an object
	function getDivLeftPos(divId) { return getObjLeftPos(getDiv(divId)); }
	function getObjLeftPos(obj) {
		var objLeft = obj.offsetLeft;
		while(obj.offsetParent!=null) {
			var objParent = obj.offsetParent;
			objLeft += objParent.offsetLeft;
			obj = objParent;
		}
		return objLeft;
	}

	// gets the absolute left position of an object
	function getDivTopPos(divId) { return getObjTopPos(getDiv(divId)); }
	function getObjTopPos(obj) {
		var objTop = obj.offsetTop;
		while(obj.offsetParent!=null) {
			var objParent = obj.offsetParent;
			objTop += objParent.offsetTop;
			obj = objParent;
		}
		return objTop;
	}

	function getDivWidth(divId) { return getObjWidth(getDiv(divId)); }
	function getObjWidth(obj) {
		if (obj.currentStyle && obj.currentStyle.width) {
			var objWidth = parseInt(obj.currentStyle.width);
			if (objWidth && !isNaN(objWidth))
				return objWidth;
			else {
				var objWidthOffsetWidth = obj.offsetWidth;
				if (objWidthOffsetWidth && !isNaN(objWidthOffsetWidth))
					return objWidthOffsetWidth;
			}
		} else if (window.getComputedStyle(obj, '')) {
			var computedStyle = window.getComputedStyle(obj, '');
			objWidth = parseInt(computedStyle.getPropertyValue('width'));
			if (objWidth && !isNaN(objWidth))
				return objWidth;
		}
		return -1;
	}

	function getDivHeight(divId) { return getObjHeight(getDiv(divId)); }
	function getObjHeight(obj) {
		if (isIE6orBelow) {
			var objHeight = parseInt(obj.scrollHeight);
			if (!objHeight) objHeight = 100;
			if (objHeight && !isNaN(objHeight))
				return objHeight;
		} else if (obj.offsetHeight) {
			var objHeight = parseInt(obj.offsetHeight);
			if (objHeight && !isNaN(objHeight))
				return objHeight;
		} else if (window.getComputedStyle(obj, '')) {
			var computedStyle = window.getComputedStyle(obj, '');
			objHeight = parseInt(computedStyle.getPropertyValue('height'));
			if (objHeight && !isNaN(objHeight))
				return objHeight;
		}
		return -1;
	}

	// calculates an objects left position in window (help function to hideSelectBoxesUnderDiv() initially so may not have full browser compability...)
	function getPageOffsetLeft(obj){
		var x = obj.offsetLeft;
  		if (obj.offsetParent != null)
    			x += getPageOffsetLeft(obj.offsetParent);
  		return x;
	}

	// calculates an objects top position in window (help function to hideSelectBoxesUnderDiv() initially so may not have full browser compability...)
	function getPageOffsetTop(obj){
		var x = obj.offsetTop;
  		if (obj.offsetParent != null)
    			x += getPageOffsetTop(obj.offsetParent);
  		return x;
	}

	function getActualMousePosXY(e) {
		if (!e) var e = window.event;

		var scrOfX = 0, scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
			scrOfY = window.pageYOffset;
			scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			//DOM compliant
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			//IE6 standards compliant mode
			scrOfY = document.documentElement.scrollTop;
			scrOfX = document.documentElement.scrollLeft;
		}

		return [ (parseInt(e.clientX)+scrOfX), (parseInt(e.clientY)+scrOfY) ];
//		return [ (parseInt(e.clientX)+scrOfX), (parseInt(window.document.body.scrollTop) + parseInt(e.clientY)+scrOfY) ];
	}


	// *****************************************************************************************************************
	// UNUSED METHOD, MIGHT BE USEFUL IN THE FUTURE, LEAVE IT FOR NOW...
	// *****************************************************************************************************************
	function getObjectById(docObjId) {
		return document.getElementById(docObjId);
	}

	function getObjectsByName(objName){
		var objArr;
		if (document.all)
			objArr = document.all[objName];
		else if (document.getElementById)
			objArr = document.getElementsByName(objName);
		else
			objArr = new Array();

		return objArr;
	}


	// *****************************************************************************************************************
	// Help for Ajax-filled destination-guide. In QS, RS and advanced searches etc.
	// *****************************************************************************************************************
/*
// FUNCTIONALITY HERE REPLACED BY showHelpDivAtMousePosition()
    function showAjaxHelp(whatDivId, whatTxt){
        if(document.getElementById(whatDivId)){
            elem = document.getElementById(whatDivId);
            elem.innerHTML = whatTxt;
            elem.style.display = "block";
        }
    }

    function hideAjaxHelp(whatDivId){
        if(document.getElementById(whatDivId)){
            elem = document.getElementById(whatDivId);
            elem.innerHTML = '';
            elem.style.display = "none";
        }
    }
*/

	// *****************************************************************************************************************
	// Debug info functions
	// *****************************************************************************************************************

    function toggleDebug(showDiv) {
      var debugDiv = document.getElementById("debug-div");
      if(showDiv == false || debugDiv.style.visibility=='visible') {
        debugDiv.style.visibility='hidden';
        debugDiv.style.display='none';
      } else {
        debugDiv.style.visibility='visible';
        debugDiv.style.display='block';
      }
    }

    function openDebug() {
      var debugDiv = document.getElementById("debug-div");
      debugDiv.style.visibility='visible';
      debugDiv.style.display='block';
    }

    function closeDebug() {
      var debugDiv = document.getElementById("debug-div");
      debugDiv.style.visibility='hidden';
      debugDiv.style.display='none';
    }

    function openSettings(product, settingName){
        url = 'main?type=General&name=GenDebug&product=' + escape(product);
        if ( settingName != null && settingName != "" ) {
            url = url + "&settingName=" + escape(settingName);
        }
        window.open(url, 'DebugSettings', 'width=1024,height=800,resizable=yes,status=no,scrollbars=yes');
    }


    function openPopupCalendar(divId){
        if(document.getElementById(divId).style.display == "none") {
            document.getElementById(divId).style.display = "block";
            hideSelectBoxesUnderDiv(divId);
        } else {
            document.getElementById(divId).style.display = "none";
			displaySelectBoxesInPage(false);
		}
    }