function TDim(pX, pY)
{
  this.X = pX;
  this.Y = pY;
}

function getWindowDims()
{
  var dims = new TDim(0, 0);
  if (self.innerHeight) // all except Explorer
  {
	  dims.X = self.innerWidth;
  	dims.Y = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
	  // Explorer 6 Strict Mode
  {
	  dims.X = document.documentElement.clientWidth;
  		dims.Y = document.documentElement.clientHeight;
		
  }
  else if (document.body) // other Explorers
  {
    dims.X = document.body.clientWidth;
    dims.Y = document.body.clientHeight;
	
  }
  return dims;
}


function schliessen() {
 slideUp();
}

function showWerbung() {
 document.getElementById("werbung").style.visibility = 'visible';
 document.getElementById("cover").style.visibility = 'visible';
 //document.getElementById("cover").style.height = parseInt(dims2.y) + "px";
}

function Werbung() {
	showWerbung();
	init();
	slideDown();
	TimeoutClose = setTimeout("schliessen()",5000);
}


function moveTo(obj, x, y) {
        if (document.getElementById) {
        document.getElementById('menuDiv').style.left = x;
        document.getElementById('menuDiv').style.top = y;
        }
}

function init(){
        if(document.getElementById){
        obj = document.getElementById("werbung");
       	obj.style.top = -600 + "px";
        }
}

function slideDown(){
		dims = getWindowDims();
		document.getElementById("cover").style.height = dims.Y + "px";
        if(document.getElementById){
                if(parseInt(obj.style.top) < 100){
                        //obj.style.top = parseInt(obj.style.top) + 15 + "px";
                        //aktiv = window.setTimeout("slideDown()",10);
						obj.style.top = 100 + "px";
						cw = document.body.clientWidth/2 - 362;
						obj.style.left = cw + "px";
                }
        }
}

function slideUp(){
        if(document.getElementById){
                if(parseInt(obj.style.top) > -600){
                        obj.style.top = parseInt(obj.style.top) - 20 + "px";
                        TimeoutSlideUp = setTimeout("slideUp()",10);
                } else {
				 	document.getElementById("werbung").style.visibility = 'hidden';
					 document.getElementById("cover").style.visibility = 'hidden';
					 clearTimeout(TimeoutSlideUp);
				}
        }
}

function moveTo(obj, x, y) {
        if (document.getElementById) {
        document.getElementById('menuDiv').style.left = x;
        document.getElementById('menuDiv').style.top = y;
        }
}
