var bExtendedSearchVisible = false;
var sScript = window.location.pathname;
var iPos = sScript.lastIndexOf('/');

sScript = sScript.substr(iPos + 1);

var sVisibleSearch;
switch (sScript) {
case 'index.php':
case 'package_tours.php':
    sVisibleSearch = 'packagetours';
    break;
case 'singlepauschal.php':
    sVisibleSearch = 'singlepauschal';
    break;
case 'hotels.php':
    sVisibleSearch = 'hotels';
    break;
}
/* actually type flights is not used in portal but linked directly to IBE */

function toggleExtendedSearch(sType) {
  var sExtendedSearchStatus, sOfferStatus;
  if (false == bExtendedSearchVisible) {
    sExtendedSearchStatus = 'show';
	showHideLayers('offer0', 'hide', 'offer1', 'hide');
    showHideLayers('specialoffer', 'hide');
	bExtendedSearchVisible = true;
  } else {
    sExtendedSearchStatus = 'hide';
	showHideLayers('offer0', 'show', 'offer1', 'show');
	showHideLayers('specialoffer', 'show');
	bExtendedSearchVisible = false;
  }
  switch (sType) {
  case 'packagetours':
	showHideLayers('extendedsearchpackagetour', sExtendedSearchStatus);
	break;
  case 'hotels':
	showHideLayers('extendedsearchhotel', sExtendedSearchStatus);
	break;
  case 'singlepauschal':
	showHideLayers('extendedsearchsinglepauschal', sExtendedSearchStatus);
    break;
  }
}

function setKeywords(sValue) {
    document.forms[0].elements['fts'].value =
        document.forms[0].elements['fts'].value + ' ' + sValue;
}
