var current    = false;
var switchoff  = false; 

function hide_pd(){
 if(current) document.getElementById('PD_'+current).style.visibility = 'hidden';
 switchoff = false;
}

function pd( id ){ 
 if(id && switchoff) {
	window.clearTimeout(switchoff);
	hide_pd();
 }
 if(id){
   document.getElementById('PD_'+id).style.visibility= 'visible';  
   current = id;
 }
 if(!id){
   switchoff = window.setTimeout("hide_pd()", 250);  
 }    
}


 function getWindowHeight() {
	if (window.innerHeight) return window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight)
		return document.documentElement.clientHeight;
	else if (document.body && document.body.clientHeight)
		return document.body.clientHeight;
	else return null;
	}

function getElementHeight(Elem) {
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all){
		var elem = document.all[Elem];
	}
    xPos = elem.style.pixelHeight;
	if(!xPos) xPos = elem.offsetHeight;
	return xPos;  
}

var realContH = 0;
function resizeMe(){ 
  var base          = 450; //+ footer      
  var contentH      = getElementHeight('content');          
  var screenHeight  = getWindowHeight();  
  if(!realContH)    realContH = contentH;  
  if(screenHeight > base+realContH){
     newHeight = realContH + (screenHeight-(base+realContH));
     document.getElementById('content').style.height = newHeight+'px';
    }  
}