
	var isScrollingPage=true;
	var CLEAR_IFRAME_SRC = 'javascript:false;';
	var bg0="http://i.friendscout24.de/datingr5/img/rps/1/6/5/8.png";
	var bg8="http://i.friendscout24.de/datingr5/img/rps/1/6/6/6.png"; 
	
	function getBrowserWindowDimensions(){var s=self,d=document,de=d.documentElement;if(s.innerHeight){return {width:s.innerWidth, height:s.innerHeight};}else if(de&&de.clientHeight){return {width:de.clientWidth, height:de.clientHeight};}return {width:d.body.clientWidth, height:d.body.clientHeight};}
	function resizeOverlayIFrame(_obj, _h, _w){_obj.height=_h;_obj.width=_w;}
	function resizeObj(cObj, cObjHeight, cObjWidth){cObj.style.height=parseInt(cObjHeight)+'px';cObj.style.width=parseInt(cObjWidth)+'px';}
	function moveObjTo(_obj, _fromTop, _fromLeft){_obj.style.top=_fromTop+'px';_obj.style.left=_fromLeft+'px';}
	
	
	
	function overlayShow(){
		document.getElementById('overlayLoadingImage').style.visibility='hidden';
		document.getElementById('overlay').style.visibility='visible';
	}
	
	function overlayHide(){
		document.getElementById('overlay').style.visibility='hidden';
		overlayResize(1,1);
	}
	
	function overlayReposition(_absPosition){
		document.getElementById('overlay').style.top=_absPosition.top+'px';
		document.getElementById('overlay').style.left=_absPosition.left+'px';
	}
	
	function centeredOverlayCoords(_w, _h){
		var b=getBrowserWindowDimensions();
		var _fromLeft = b.width > _w ? parseInt(b.width/2-(_w/2)) : 1;
		var _fromTop = b.height > _h ? parseInt(b.height/2-(_h/2)) : 1;
		return {'left': _fromLeft, 'top': _fromTop};
	}
	
	function greyoutShow(_fade){
		if(typeof _fade == 'undefined'){_fade=0;document.getElementById('greyout').style.visibility='visible';}
		setGreyoutFade(_fade);
		_fade < 8?window.setTimeout(function(){greyoutShow(_fade+2)},20):overlayShow();
	}
	
	function greyoutHide(_fade, _endAction){
		setGreyoutFade(_fade);
		_fade > 1 ?window.setTimeout(function(){greyoutHide(_fade-2, _endAction)},20):(document.getElementById('greyout').style.visibility='hidden', window.setTimeout(function(){try{eval(_endAction)}catch(e){};},20));
	}
	
	function setGreyoutFade(_fade){
		var _o = document.getElementById('greyout').style;
		if(navigator.userAgent.indexOf("Opera") != -1){
			if(_fade==0 || _fade==8)_o.background="Url("+eval('bg'+_fade)+")"; 
		}else {
			_o.background="#fff";
		    _o.opacity = (_fade / 10);
		    _o.MozOpacity = (_fade / 10);
		    _o.KhtmlOpacity = (_fade / 10);
		    _o.filter = "alpha(opacity=" + (_fade*10) + ")";
		}
		_o = null;
	}
	
	function greyoutResize(_withScrollbar){
		if(typeof _withScrollbar == 'undefined')_withScrollbar=isScrollingPage;
		var b=getBrowserWindowDimensions();
		
		if(_withScrollbar==true)
			resizeObj(document.getElementById('greyout'), b.height, (1*b.width-16));
		else{
			//document.getElementById('content').style.overflow='hidden';
			resizeObj(document.getElementById('greyout'), b.height, (1*b.width));
		}
		moveObjTo(document.getElementById('overlayLoadingImage'), parseInt(b.height/2)-parseInt(getDimensions('overlayLoadingImage').height/2), parseInt(b.width/2)-parseInt(getDimensions('overlayLoadingImage').width/2));
	}
	
	function overlayResize(_w,_h){
		if(navigator.userAgent.toLowerCase().indexOf("mac")!=-1 && navigator.userAgent.toLowerCase().indexOf("safari")!=-1){
			_w=_w+5;
			_h=_h+5;
		}
		resizeObj(document.getElementById('overlay'),_h,_w);
		resizeOverlayIFrame(document.getElementById('overlayIContent'),_h,_w);
		overlayReposition(centeredOverlayCoords(_w,_h));
		if(arguments.length>2 && document.frames)document.frames['overlayIContent'].document.body.style.width=arguments[2]; /* called by sizeWin() from globals.js */
	}
	
	function contentResize(){
		var b=getBrowserWindowDimensions();
		
		if(isScrollingPage==false){
			//document.getElementById('content').style.overflow='hidden';
			if(navigator.userAgent.toLowerCase().indexOf("mac")!=-1 && navigator.userAgent.toLowerCase().indexOf("safari")!=-1){
				b.height=b.height+5;
				b.width=b.width+5;
			}
		}
		greyoutResize();
		resizeObj(document.getElementById('content'), b.height, b.width);
	}
	
	/* (_url, backlinkUrl) */
	function overlayLoad(_url){
		document.getElementById("overlayLoadingImage").style.visibility='visible';
		overlayHide();
		if(arguments.length==2){
			_url = _url.indexOf("?")!=-1?_url+"&overlayclosinglink="+arguments[1]:_url+"?overlayclosinglink="+arguments[1];
		}
		if(document.frames){
			document.frames['overlayIContent'].document.location.replace(_url);
		}else if(document.getElementById('overlayIContent').contentDocument){
			document.getElementById('overlayIContent').contentDocument.location.replace(_url);
		}else{
			document.getElementById('overlayIContent').src=_url;
		}
		//document.getElementById('content').style.overflow='hidden';
		greyoutResize(false);
		greyoutShow();
	}
	
	function overlayReload(_url){
		overlayLoad(_url);
	}
	
	function overlayUnload(){
		overlayUnloadAndAction(arguments.length==0?'void(0)':arguments[0]);
	}
	
	function overlayUnloadAndAction(_action){
		overlayHide();
		greyoutHide(6, _action);
		greyoutResize();
		if(isScrollingPage==true){
			document.getElementById('content').style.overflow='auto';
		}
		if(document.frames){
			document.frames['overlayIContent'].document.location.replace(CLEAR_IFRAME_SRC);
		}else if(document.getElementById('overlayIContent').contentDocument){
			document.getElementById('overlayIContent').contentDocument.location.replace(CLEAR_IFRAME_SRC);
		}else{
			document.getElementById('overlayIContent').src=CLEAR_IFRAME_SRC;
		}
	}