	  function pageoffset()
	  {
	  var page = new Object();
	  page.scrollY = (window.pageYOffset ||document.documentElement.scrollTop  || document.body.scrollTop);
	  page.scrollX = (window.pageXOffse  || document.documentElement.scrollLeft || document.body.scrollLeft);
	  page.innerX =  (window.innerWidth  || document.documentElement.clientWidth || document.body.clientWidth);
	  page.innerY =  (window.innerHeight ||document.documentElement.clientHeight || document.body.clientHeight);
          if(window.innerHeight) var scroll = 20; else var scroll = 0;
	  
	  page.absY = page.scrollY + page.innerY;
	  page.absX = page.scrollX + page.innerX -scroll;
	  return page;
	  }
	  


	  var adjust =    function(obj){
	  var p = pageoffset();
	  
	  obj.style.height = p.absY+'px';
	  obj.style.width =  p.absX+'px';
	  }
	  
	  	  var adjust2 =    function(obj){
	          var p = pageoffset();
	  
	          try
			  {
	          obj.style.left = (Math.round(p.innerX/2)-320)+'px';
			  obj.style.top = (Math.round(p.scrollY)+50)+'px';
			  }
			  catch(e){}
	  }
	  
	  
	  var setBG = function(clsn,url){
	  
	  var body = document.getElementsByTagName('body')[0];
	  var div = document.createElement('div');
	  div.className = clsn;
	  div.id = 'cover';
	  p = pageoffset();
	
	  div.style.height = p.absY+'px';
	  div.style.width =  p.absX+'px';
	  
	  body.appendChild(div);
	  
	  var r = new Request();
	      r.sendRequest(url);
	  
	  
	  
	  
	  window.onresize = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
	  
	  window.onscroll = function(){
          adjust(div);
		  adjust2($('coverform'));
	  }
  
	  }





var Request = function(){
	  
	  
	   this.sendRequest = function(url){
			
		var myXML = new Ajax.Request(
		
			url,
			{
			method: 'get',
			onComplete:this.getResponse,
			onFailure:this.showError
			}
		);
		}
		
		
		this.getResponse = function(r){
		
		  var body = document.getElementsByTagName('body')[0];
		  var div = document.createElement('div');
		      div.className = 'ajaxform';
			  div.id = 'coverform';
		  var p = pageoffset();
			  div.style.left = (Math.round(p.innerX/2)-320)+'px';
			  div.style.top = (Math.round(p.scrollY)+50)+'px';
		      div.innerHTML = r.responseText;
		      body.appendChild(div);
		
		  
		
		}
	  
	  
}




var rwinclose = function(){

var body = document.getElementsByTagName('body')[0];
window.onresize = null;
window.onscroll = null;
body.removeChild($('cover'));
body.removeChild($('coverform'));
}








 var oldonload = window.onload;

    var test = function(){


        var body = document.getElementsByTagName('body')[0];
        new Effect.Opacity(body, {duration:1.0, from:1.0, to:0.2});
        var div = document.createElement('div');
            div.className = 'recommendation';
            div.innerHTML = 'Das ist ein Test';
        $('rp').href = 'javascript:void(0);';

        var a = document.createElement('a');
            a.onclick = function(){new Effect.Opacity(body, {duration:1.0, from:0.2, to:1.0});Effect.Shrink(div,{ direction: 'top-left',duration: 1.0 });$('rp').href = 'javascript:test();';};
            a.innerHTML = '[Fenster schließen]';
            a.style.cursor = 'pointer';
            a.style.display = 'block';
            a.style.height = '30px';
        div.insertBefore(a,div.firstChild);
        div.style.display = 'none';
        body.appendChild(div);
        Effect.Grow(div,{direction: 'top-left', duration: 1.0 });
        
        //Effect.Appear(div, { duration: 1.0 });
        
    }
















/*






	  <style type="text/css">
	  
	  html{overflow-y:scroll;}
	  
	  body
	  {
	  margin:0px;
      padding:0px;
      height:100%;
	
	  }
	  
      .coverbody
	  {
	  position:absolute;
	  left:0px;
	  top:0px;
	  background-color:#000000;
	  filter:alpha(opacity=20);
	  -moz-opacity:0.2;
	  width:100px;
	  height:100px;
	  z-index:100;
	  }
	  
	  </style>


*/
