function clearDefaultValue(obj) {
    with(obj) if(value == defaultValue) value = '';
}
function restoreDefaultValue(obj) {
    with(obj) if(value == '') value = defaultValue;
}

// Spezial-Funktion GB
function winOpen (obj, wdth, hght, diffDomain) {
   var url = obj.href || obj.action;
   var props = 'width=' + wdth + ',height=' + hght;
   props += ',directories=no,location=no,menubar=no,toolbar=no,resizable=no,status=no,scrollbars=yes'; 

   // Der IE8 hat ein Problem mit obj.target. 
   if(obj.target == '') {
      obj.target = 'foobarie8';
   }

   if(((window[obj.target] && window[obj.target].closed)) ||
      !window[obj.target] ||
      (typeof(window[obj.target])=='undefined') ) {
      window[obj.target] = window.open(url, obj.target, props );
   } else {
           if(diffDomain) {
            window[obj.target].location.href = url;
        } else if(window[obj.target].location.href.indexOf(url)<0) {
              window[obj.target].location.href = url;
        }
   }
   window[obj.target].focus();
   if(obj.href) return false;
}


//--------------------------------------------------------------------------------
// Öffnet Fenster (popup) mit freien Parametern
//--------------------------------------------------------------------------------

function openPopup(url, w, h, name, parameters) {
    if (name == null) {
        name = "_blank";
    }
    var features = 'width='+w+',height='+h;
    if (parameters == null) {
        features += ',scrollbars=yes,resizable=no,location=no,menubar=no,toolbar=no';
    } else {
        features += "," + parameters;
    }
    if (self.window.name != "popupOK" ) {
        self.window.name == "popupOK"
        thomascookwin = window.open(url, name, features);
        window.thomascookwin.focus();
    }
    else {
        if (window.thomascookwin.closed == true) {
            thomascookwin = window.open(url, name, features);
            window.thomascookwin.focus();
        } else {
            window.thomascookwin.location.href=url;
            window.thomascookwin.resizeTo(w,h);
            window.thomascookwin.focus();
        }
    }
}


//------------------------------------------------------------------------------------
// Für die Reisebuerosuche
//------------------------------------------------------------------------------------

function preventDefaultValueSubmit (obj) {
    with(obj) {
        for(i=0; i<elements.length; i++) {
            with(elements[i]) if(value == defaultValue && type=="text") value = "";
        }
    }
}

//------------------------------------------------------------------------------------
// Für Highlighting IBE Rahmen
//------------------------------------------------------------------------------------

function highlightMainNav () {

	var activeNavItem;
	if (document.cookie) {
		with (document.cookie) activeNavItem = parseInt(substring(indexOf('hl=')+3, length));
	}

	if(activeNavItem && activeNavItem <= document.getElementById('MainNav').getElementsByTagName('LI').length)
		document.getElementById('MainNav').getElementsByTagName('LI')[activeNavItem-1].getElementsByTagName('A')[0].className = 'active';
}
     

function boxToggle ( obj ) { 
	with ( obj.parentNode.getElementsByTagName('DIV')[0].style ) {
	  display = ( display == '' ) ? 'none' : '';
	}
	obj.className = ( obj.className == 'switchOn' ) ?  'switchOff' : 'switchOn';
}

//--------------------------------------------------------------------------------
// R&uuml;ckverlinkung aus dem Golfpopup
//--------------------------------------------------------------------------------

function changeOpener(URL)
{      
   window.opener.location.href=URL;
   this.window.close();
}




