

function getLayerRef (id, document) {
	// Funktion referenziert einen Layer als Objekt
	// Nutzung:
	// object = getLayerRef("layer");
	// object.style.color = "blue"; // nur ein Beispiel
	if (!document)
	document = window.document;
	if (document.layers) {
	for (var l = 0; l < document.layers.length; l++)
	  if (document.layers[l].id == id)
	    return document.layers[l];
	for (var l = 0; l < document.layers.length; l++) {
	  var result = getLayerRef(id, document.layers[l].document);
	  if (result)
	    return result;
	}
	return null;
	}
	else if (document.all) {
	return document.all[id];
	}
	else if (document.getElementById) {
	return document.getElementById(id);
	} else {
	return null;
	}
}
	

function ResizeLayer(height, width)
{
	var contentLayerName = 'content';
	
	if(!height) {
		height = 0;
	}
	
	if( window.innerHeight) {
		var windowHeight = window.innerHeight+5;
		var windowWidth = window.innerWidth;
	 } else {
		var windowHeight = document.body.offsetHeight;
		var windowWidth =  document.body.offsetWidth;
	   }
	
	if (windowWidth>width)
	   stylewidth = "95%";
	   //stylewidth = width + "px";
	else 
	   //stylewidth = "95%";
	   stylewidth = "100%";
	
	var obj_content;
	obj_content = getLayerRef(contentLayerName)
	if( obj_content ) {
		var newHeight = (windowHeight-310) ? windowHeight - parseInt(height) : 310;
		obj_content.style.height = newHeight + "px";
		obj_content.style.width = stylewidth;
	}
	
}

 function popup(w,h,site) {
        x = screen.availWidth/2-w/2;
        y = screen.availHeight/2-h/2;
        var popupWindow = window.open(
            '','','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y);
        popupWindow.document.write(site);
      }



