function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
	if (theValue == true || theValue == false)
	  eval("obj."+theProp+"="+theValue);
	else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

//popup
var popupWin = null;

function popdown() {
  if (popupWin && !popupWin.closed) popupWin.close();
}

function popupBuchenTT(abort_url, ttdata) {
  var url = 'https://www.its.de/buchen_verlassen_tt.php?abort_url='+abort_url+'&ttdata='+ttdata;
  if (!url) return true;
  w = 645; 
  h = 630;
  var args = 'width='+w+',height='+h+',scrollbars,resizable,status';
  popdown();
  popupWin = window.open(url,'popup',args);
  if(popupWin)
  	popupWin.focus();
  return false;
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 810; 
  h = (h) ? h += 25 : 600;
  var args = 'width='+w+',height='+h+',scrollbars,resizable,status';
  popdown();
  popupWin = window.open(url,'popup',args);
  if(popupWin)
  	popupWin.focus();
  return (popupWin) ? false : true;
}

function popupfva(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 810; 
  h = (h) ? h += 25 : 600;
  var args = 'width='+w+',height='+h+',scrollbars,resizable,status';
  popdown();
  popupWin = window.open(url,'popupfva',args);
  if(popupWin)
  	popupWin.focus();
  return (popupWin) ? false : true;
}

function popunder(theURL, theName, features, ispopunder) {
	if (!theURL || !theName)
		return;
	if (!features)
		features = '';
	var win=window.open(theURL, theName, features)
	if(ispopunder) {
		win.blur()
		window.focus()
	}
}

//window.onunload = popdown;
//window.onfocus = popdown;

//image viewer
function changeImage(filename, imagename)
{
	eval("document."+imagename+".src = filename");
}

//NEWSLETTER NORM
function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
        if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
        if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
        if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0;                         
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  theURL += "?";
  theURL += "errorPage=/public/error.jsp&";
  theURL += "action=remoteBox&";
  theURL += "gid=40017261&";
  theURL += "mps=1wpdazy7iksazrxymm7jf54mlg1synwgn2h77yh9eyjpzanu4iugbjh8ntc&";
  theURL += "alt_page_1=/public/remotebox.jsp&";
  theURL += "uemail="+document.newsletter.uemail.value+"&";
  theURL += "action_type=subscribe";
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
        ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
        popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
        popupWindow[wp].document.body.onbeforeunload = function() {
            if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
            window.onbeforeunload = null;   }  
        autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
    window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}

//NEWSLETTER IBE STARTSEITEN
function GP_AdvOpenWindow2(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
        if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
        if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
        if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0;                         
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  theURL += "?";
  theURL += "errorPage=/public/error.jsp&";
  theURL += "action=remoteBox&";
  theURL += "gid=40017261&";
  theURL += "mps=1wpdazy7iksazrxymm7jf54mlg1synwgn2h77yh9eyjpzanu4iugbjh8ntc&";
  theURL += "alt_page_1=/public/remotebox.jsp&";
  theURL += "uemail="+document.form1.uemail.value+"&";
  theURL += "action_type=subscribe";
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
        ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
        popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
        popupWindow[wp].document.body.onbeforeunload = function() {
            if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
            window.onbeforeunload = null;   }  
        autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
    window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}

//NEWSLETTER ABMELDEN
function GP_AdvOpenWindow3(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
        if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
        if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
        if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0;                         
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  theURL += "?";
  theURL += "errorPage=/public/error.jsp&";
  theURL += "action=remoteBox&";
  theURL += "gid=40017261&";
  theURL += "mps=1wpdazy7iksazrxymm7jf54mlg1synwgn2h77yh9eyjpzanu4iugbjh8ntc&";
  theURL += "alt_page_1=/public/remotebox.jsp&";
  theURL += "uemail="+document.nlabmelden.uemail.value+"&";
  theURL += "action_type=unsubscribe";
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
        ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
        popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
        popupWindow[wp].document.body.onbeforeunload = function() {
            if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
            window.onbeforeunload = null;   }  
        autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
    window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}


	function setElememtHTML(value, targetElement) {
		//if IE 4+
		if (document.all) {
			eval(targetElement+'.innerHTML = value;');
		//else if NS 4
		} else if (document.layers) {
			eval('document.'+targetElement+'.document.write(value);');
			eval('document.'+targetElement+'.document.close();');
		}
		//else if NS 6 (supports new DOM)
		else if (document.getElementById) {
			rng = document.createRange();
			el = document.getElementById(targetElement);
			rng.setStartBefore(el);
			htmlFrag = rng.createContextualFragment(value);
			while (el.hasChildNodes())
				el.removeChild(el.lastChild);
			el.appendChild(htmlFrag);
		}
	}
	function display_children(obj) {
		//var val = document.form1.children_travelers.options[document.form1.children_travelers.selectedIndex].value;
		var val = document.form1.children_travelers.value;
		if(val > 0) {
			MM_changeProp('children_handler','','style.display','block','DIV');
			for(i=0;i<val;i++) {
				MM_changeProp('child'+(i+1),'','style.display','block','DIV');
			}
			for(i=1;i<=3;i++) {
				if(i>val) MM_changeProp('child'+i,'','style.display','none','DIV');
			}
		} else {
			MM_changeProp('children_handler','','style.display','none','DIV');
			for(i=1;i<=3;i++) {
				MM_changeProp('child'+i,'','style.display','none','DIV');
			}
		}
	}
	
	var popUpWin=0;
	function popUpWindow(URLStr, left, top, width, height)
	{  if(popUpWin)  {    
	if(!popUpWin.closed) popUpWin.close();  
	}  
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	}
	

	function clearInput(target){
		if(document.getElementById(target).value){
			document.getElementById(target).value = '';
		}
	}	
	
	//on load function 
	function addLoadEvent(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
			if (oldonload) {
				oldonload();
			}
				func();
			}
		}
	}
	
	function getBrowser(){
		/*  Autor, Entwicklung 8/2002 Kristof Lipfert Duesseldorf    */
		/*  Version 2005-12-09                                  */
		if(document.ids)browserName='nc4';
		else if( document.all && !document.getElementById )browserName='ie4';
		else if( window.opera && !document.createElement )browserName='op5';
		else if( window.opera && window.getComputedStyle )  {
				  if(document.createRange)browserName='op8';
					else if(window.navigate)browserName='op7.5';
									 else browserName='op7.2';}
		else if( window.opera && document.compatMode )browserName='op7';
		else if( window.opera && document.releaseEvents )browserName='op6';
		else if( document.contains && !window.opera )browserName='kq3';
		else if(window.pkcs11&&window.XML)browserName='f15';
		else if( window.getSelection && window.atob )browserName='nn7';
		else if( window.getSelection && !document.compatMode )browserName='nn6';
		else if( window.clipboardData && document.compatMode )
		  browserName=window.XMLHttpRequest? 'IE7' : 'IE6';
		else if( window.clipboardData ){browserName='ie5';
			 if( !document.createDocumentFragment ) browserName+='.5';
			 if( document.doctype && !window.print ) browserName+='m';}
		else if( document.getElementById && !document.all ) browserName='op4';
		else if( document.images && !document.all ) browserName='nn3';
		else if(document.clientWidth&&!window.RegEbrowserNamep)browserName='kq2';
		else browserName='NoName';
	
	return browserName;		
	}
	
	//delivers json OBJ array size (lenght()) doesnt work here
	function getLen(array_value){
		var i = 0;
		for (key in array_value){
			i++;
		}
	return (i);
	}
	
	//array key exists json OBJ
	function keyExists(array_value, search_key){
		for (key in array_value){
			if(search_key == key)
			return true;
		}
	return false;
	}	
	
	//search an array value
	function valueExists(array_value, search_value){
		for (i = 0; i < array_value.length; i++){
			if(search_value == array_value[i])
			return true;
		}
	return false;
	}
	
	function getVariantText(type){
		var variantText = new Array();
		variantText['I'] = '<strong>Young & Easy:<\/strong> Trotz kleinerem Budget große Sprünge machen: Für die Altersklasse 18–30 ohne Kinder bietet „Young & Easy“ besondere Preisvorteile.<br \/><br \/>';
		variantText['S'] = '<strong>Seniorenvorteil:<\/strong> Gäste ab 50, 55 bzw. 60 Jahren genießen bei den 50+/55+/60+ Vorteilen Preisnachlässe oder Extraservice. Beim Angebot "Oma/Opa gratis" ist die Unterbringung in ausgewählten Häusern mancher Zielgebiete für mitreisende Großeltern kostenlos. Welche Vergünstigung bei Ihrem Angebot zutrifft entnehmen Sie bitte der Hotelinformation. <br \/><br \/>';
		variantText['V'] = '<strong>Familienpreis:<\/strong> Familien, die aus zwei Erwachsenen und 2-4 Kindern bestehen genießen besondere Preisvorteile.<br \/><br \/>';
		variantText['H'] = '<strong>Spezialangebot:<\/strong> Spezialangebote sind von Hotel zu Hotel unterschiedlich. Weitere Hinweise entnehmen Sie bitte der Hotelinformation.<br \/><br \/>';
		variantText['J'] = '<strong>Junge Familie:<\/strong> Junge Familien verdienen besondere Unterstützung. Paare mit mindestens einem Kind (die Altersgrenzen variieren von Hotel zu Hotel) profitieren von besonderen Preisvorteilen.<br \/><br \/>';
		variantText['M'] = '<strong>Mietwagen inklusive:<\/strong> Allzeit mobil - in diesen Angeboten ist ein Mietwagen bereits enthalten.<br \/><br \/>';
		variantText['T'] = '<strong>Angebot ohne Transfer:<\/strong> Dieses Angebot beinhaltet keinen Transfer. Sie haben die Möglichkeit einen Mietwagen online dazu zu buchen oder alternativ einen Taxitransfer über unser Online-Service-Center zu reservieren.<br \/><br \/>';

	return(variantText[type]);
	}
	
	//hide element before DOM Load
	document.documentElement.className += " reweJsLoad";
	
	function createDateObj(dateStr)
	{
		// erzeugt dateobjekt
		
		if(dateStr == "") return new Date;
		var dateArr = dateStr.split(".");
	
		var day = dateArr[0];
		var month = dateArr[1] - 1;
		//var year = parseInt(dateArr[2]) + 2000;
		if (dateArr[2] < 2000)
			var year = 20 + dateArr[2];
		else
			var year = dateArr[2];
	
		if (dateArr.length == 3 && dateArr[0] > 0 && dateArr[1] > 0 && dateArr[2] > 0)
			return new Date(year, month, day);
	
		return false;
	}	

	/***********************************************************************************************************************************************************/
	/*	 	AJAX BUILD FUNCTIONS /FLYOUT FUNCTIONS	*/
	/*		USE GLOBAL FLY OUT						*/
	/***********************************************************************************************************************************************************/
	var xmlHttp 		= null;
	var loadingscreen 	= '<img src="/images/startseitenpanel/loading.gif" alt="Laden..." />';
	var currentFlyOut 	= '';

	function closeFlyOut(){
		document.getElementById('panelFlyOut').style.display = 'none';
		setElementProperty(loadingscreen, 'flyOutCt');
	}
	
	//show and place the flyout
	function showFlyOut(name, width){
		
		setElementProperty(loadingscreen, 'flyOutCt');
		
		var eventShow = true;
		if((name == currentFlyOut || currentFlyOut == '') && document.getElementById('panelFlyOut').style.display == 'block' && doClose){
			//alert(currentFlyOut+"<>"+name);
			closeFlyOut();
			eventShow =  false;
			//name = '';
		}
		else{
			//alert('3 DISPLAY: '+document.getElementById('panelFlyOut').style.display+' CLOSE: '+doClose+' FLYOUT: '+currentFlyOut+' NAME: '+name);
			if(width=='auto') {
				document.getElementById('panelFlyOut').style.width = 'auto'; 
			} else {
				document.getElementById('panelFlyOut').style.width = width.toString()+'px'; 
			}
			document.getElementById('panelFlyOut').style.display = 'block';	
			doClose = true;
			//name = '';
		}
		
		if(document.getElementById('surround')){
			document.getElementById('surround').onclick = function(){};
		}
		else if(document.getElementById('iehackwrap')){
			document.getElementById('iehackwrap').onclick = function(){};	
		}
		currentFlyOut = name;
		
		return eventShow;
	}

	//return requested element
	function getEt(id){
		return (document.getElementById(id));	
	}

	//getElementposition from target Element
	function getElementPosition(targetElement) {
		var offsetTrail = document.getElementById(targetElement);
		var offsetLeft = 0;
		var offsetTop = 0;
		var offsetarray = new Array();
		while (offsetTrail) {
			offsetLeft += offsetTrail.offsetLeft;
			offsetTop += offsetTrail.offsetTop;
			offsetTrail = offsetTrail.offsetParent;
		}
		if (navigator.userAgent.indexOf("Mac") != -1 && 
			typeof document.body.leftMargin != "undefined") {
			offsetLeft += document.body.leftMargin;
			offsetTop += document.body.topMargin;
		}
		offsetarray = Array(offsetLeft, offsetTop);
	
	return offsetarray;
	}

	
	//define position for target;
	function setElementPosition(targetElement, showElement, left, top, offsetElement){
		
		offsetarrayForm = new Array();
		offsetarray 	= getElementPosition(targetElement);
		
		if(typeof(offsetElement)=='string' && document.getElementById(offsetElement)) {
			offsetarrayForm = getElementPosition(offsetElement);
		} else {
			if(document.getElementById('panelFormSurround') && (targetElement.search(/price/) == -1))
				offsetarrayForm = getElementPosition('panelFormSurround');
			else if(document.getElementById('priceFormSurround'))
				offsetarrayForm = getElementPosition('priceFormSurround');
			else if(document.getElementById('boxContentSrdS_NP'))
				offsetarrayForm = getElementPosition('boxContentSrdS_NP');
			else if(document.getElementById('dcCont'))
				offsetarrayForm = getElementPosition('dcCont');
			else if(document.getElementById('RD_dcCont'))
				offsetarrayForm = getElementPosition('RD_dcCont');
			else if(document.getElementById('boxSurroundXXXL_NM'))
				offsetarrayForm = getElementPosition('boxSurroundXXXL_NM');	
			else if(document.getElementById('boxContentSurroundXL_NM'))
				offsetarrayForm = getElementPosition('boxContentSurroundXL_NM');
			else
				offsetarrayForm = getElementPosition('surround');
		}
		
		leftposition = offsetarray[0]+left-offsetarrayForm[0];
		topposition = offsetarray[1]+top;
		document.getElementById(showElement).style.left = leftposition.toString()+'px';
		document.getElementById(showElement).style.top = topposition.toString()+'px';	
	}
	
	//sets Element property 
	function setElementProperty(value, targetElement) {
		//if IE 4+
		if (document.all) {
			eval(targetElement+'.innerHTML = value;');
		//else if NS 4
		} else if (document.layers) {
			eval('document.'+targetElement+'.document.write(value);');
			eval('document.'+targetElement+'.document.close();');
		}
		//else if NS 6 (supports new DOM)
		else if (document.getElementById) {
			rng = document.createRange();
			el = document.getElementById(targetElement);
			rng.setStartBefore(el);
			htmlFrag = rng.createContextualFragment(value);
			while (el.hasChildNodes())
				el.removeChild(el.lastChild);
			el.appendChild(htmlFrag);
		}
	} 
	
	function getFlyoutHeight(){
		var ftHeight = document.getElementById("panelFlyOut").offsetHeight;
		if(getBrowser() == 'IE6'){
			ftHeight -= 9
		}
		
	return (ftHeight);
	}
	
	function getRandom( min, max ) {
		
		if( min > max ) {
			return( -1 );
		}
		
		if( min == max ) {
			return( min );
		}
		
		return( min + parseInt( Math.random() * ( max-min+1 ) ) );
		
	}
	
	function loadScreen(text){
		scroll(0,0);
		if(document.getElementById('offerBox')) {
			document.getElementById('offerBox').style.display = 'none';
		}
		ProgressImage = document.getElementById('loaderAni');

		document.getElementById('boxLoadingScreenSrd').style.display = 'block';
		document.getElementsByTagName('body')[0].style.overflow = 'hidden';
		document.getElementsByTagName('html')[0].style.overflow = 'hidden';
		if(text != ''){
			document.getElementById('loadingText').innerHTML = text;
		}
		setTimeout(function(){
			ProgressImage.src = ProgressImage.src;
		/*	if(typeof travelType !== "undefined" && typeof travelType !== null && travelType == "NF") {
				$("#loadScreenLogoCt img").attr("src","/images/RD_images/airlineLogosSmall.jpg");
			} else {
				$("#loadScreenLogoCt img").attr("src","/images/RD_images/veranstalterLogosSmall.jpg");
			}*/
		},100);
		if(travelType && travelType == "NF") {
			animateLogos2(true);
		} else {
			animateLogos2(false);
		}
		return true;
	}
	
	function animateLogos2(airlines) {
		if(airlines) {
			var width = 1107;
		} else {
			var width = 994;
		}
		var width1 = width - 323;
    	$("#loadScreenLogoCt img.first").animate({ left:"-"+width1+"px" }, 15000, "linear", function() {
    		$("#loadScreenLogoCt img.first").animate({ left:"-"+width+"px" }, 6500, "linear");
    		$("#loadScreenLogoCt img.second").animate({ left:"0px" }, 6500, "linear", function() {
    			$("#loadScreenLogoCt img.first").removeClass("first").addClass("second").css("left","323px");
    			$(this).removeClass("second").addClass("first");
    			animateLogos2(airlines);
    		});
    	});
    	return true;
    }
	//-----------------------------------------------------------------------------------------------------------------------//
    // A-X-send function //POST
	function writeAjax(fileElement, targetElement, requestUri){
		if (window.ActiveXObject){
			// Internet Explorer
			try {
				xmlHttp = new ActiveXObject("Msxm12.XMLHTTP");
			}
			catch (e){
				
				try {
					xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e) {}
			}
		}
		else if (window.XMLHttpRequest){
			// Opera, Firefox
			try {
				xmlHttp = new XMLHttpRequest();
			}
			catch (e) {}
		}
		
		if (xmlHttp){
			xmlHttp.open("POST", fileElement, true);
			xmlHttp.onreadystatechange = function(evt) { 
				if (xmlHttp.readyState == 4){
					setElementProperty(xmlHttp.responseText, targetElement);
					if(isStartPanel == true){
						var ftFrom = 16;
						if(getBrowser() == 'IE6'){
							//ftFrom = 19;	
						}
						setElementPosition(posElement, 'panelFlyOut', ftFrom, -(16+getFlyoutHeight()));	
					}
				}};
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
			xmlHttp.send(requestUri);
		}
		else {
			setTimeout("writeAjax('"+fileElement+"','"+targetElement+"')",500);
		}

	return(true);
	}
	
	 // A-X-send function //POST
	function writeAjaxObject(obj, fileElement, targetElement, requestUri){
		if (window.ActiveXObject){
			// Internet Explorer
			try {
				obj = new ActiveXObject("Msxm12.XMLHTTP");
			}
			catch (e){
				
				try {
					obj = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e) {}
			}
		}
		else if (window.XMLHttpRequest){
			// Opera, Firefox
			try {
				obj = new XMLHttpRequest();
			}
			catch (e) {}
		}
		
		if (obj){
			obj.open("POST", fileElement, true);
			obj.onreadystatechange = function(evt) { 
				if (obj.readyState == 4){
					setElementProperty(obj.responseText, targetElement);
					isXmlHttpReadyFunc();
				}}	
			obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
			obj.send(requestUri);
		}
		else {
			setTimeout("writeAjax('"+fileElement+"','"+targetElement+"')",500);
		}

	return(true);
	}
	
	function isXmlHttpReadyFunc(){}
	

	/***********************************************************************************************************************************************************/
	
	/*	 	AJAX CART FUNCTIONS	*/

	/***********************************************************************************************************************************************************/	
	function setCart(cartLink,btn){
		setElementPosition('sucheNameTxt', 'panelFlyOut', -690, 18);

		if(showFlyOut('sucheNameTxt', 500)){
			if(writeAjax('/ajax_module/ibe/cartController.php?'+cartLink, 'flyOutCt', cartLink)){
				xmlHttp.onreadystatechange = function(evt) { 
					if (xmlHttp.readyState == 4){
						if(xmlHttp.responseText == 'cart_response_1001'){
							setElementProperty('Das Angebot wurde in Ihre Merkliste eingefügt.', 'flyOutCt');
							document.getElementById(btn).className = 'btnMerklisteSetFixSrd variantBtn';
							document.getElementById(btn).innerHTML = '<span>Ist gemerkt!</span>';
						}
						else if(xmlHttp.responseText == 'cart_response_1002'){
							setElementProperty('Das gewählte Angebot befindet sich bereits in Ihrer Merkliste.', 'flyOutCt');
						}			
						else{
							setElementProperty('Es sind Fehler aufgetereten', 'flyOutCt');	
						}
					}
				}
			}	
		}
	}
	

	/***********************************************************************************************************************************************************/
	
	/* VIEWPORT_SIZE */

	/***********************************************************************************************************************************************************/
	
	function getViewportSize () {
		var box = new Object();
		box.x = "[unbekannt]";
		box.y = "[unbekannt]";
		if (self.innerHeight) {
			box.x = self.innerWidth;
			box.y = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			box.x = document.documentElement.clientWidth;
			box.y = document.documentElement.clientHeight;
		} else if (document.body) {
			box.x = document.body.clientWidth;
			box.y = document.body.clientHeight;
		}
		return box;
	}
	
	/***********************************************************************************************************************************************************/
	
	/* COOKIES */

	/***********************************************************************************************************************************************************/
	function Set_Cookie( name, value, expires, path, domain, secure )
	{
		// set time, it's in milliseconds
		var today = new Date();
		today.setTime( today.getTime() );
		
		/*
		if the expires variable is set, make the correct
		expires time, the current script below will set
		it for x number of days, to make it for hours,
		delete * 24, for minutes, delete * 60 * 24
		*/
		if ( expires )
		{
			expires = expires * 1000 * 60 * 60 * 24;
		}
		var expires_date = new Date( today.getTime() + (expires) );
		
		document.cookie = name + "=" +escape( value ) +
			( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
			( ( path ) ? ";path=" + path : "" ) +
			( ( domain ) ? ";domain=" + domain : "" ) +
			( ( secure ) ? ";secure" : "" );
	}
	
	// this fixes an issue with the old method, ambiguous values
	// with this test document.cookie.indexOf( name + "=" );
	function Get_Cookie( check_name ) {
		// first we'll split this cookie up into name/value pairs
		// note: document.cookie only returns name=value, not the other components
		var a_all_cookies = document.cookie.split( ';' );
		var a_temp_cookie = '';
		var cookie_name = '';
		var cookie_value = '';
		var b_cookie_found = false; // set boolean t/f default f
	
		for ( i = 0; i < a_all_cookies.length; i++ )
		{
			// now we'll split apart each name=value pair
			a_temp_cookie = a_all_cookies[i].split( '=' );
	
	
			// and trim left/right whitespace while we're at it
			cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
			// if the extracted name matches passed check_name
			if ( cookie_name == check_name )
			{
				b_cookie_found = true;
				// we need to handle case where cookie has no value but exists (no = sign, that is):
				if ( a_temp_cookie.length > 1 )
				{
					cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
				}
				// note that in cases where cookie is initialized but no value, null is returned
				return cookie_value;
				break;
			}
			a_temp_cookie = null;
			cookie_name = '';
		}
		if ( !b_cookie_found )
		{
			return null;
		}
	}
	// this deletes the cookie when called
	function Delete_Cookie( name, path, domain ) {
		if ( Get_Cookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
	}
	

