var popupWinmousemoveBack,popupWinmouseupBack;
var popupWinofsX,popupWinofsY;
var popupWintmrHide=-1;
var popupWintmrId=-1;

var incHeight = 26;
var incWidth = 8;
var minHeight = 76;

if (navigator.appName == "Netscape") {
	incHeight = 23;
	incWidth = 68;
	minHeight = 76;
}

        
function popupWinespopup_DragDrop(e) {
  popupWinmousemoveBack=document.body.onmousemove;
  popupWinmouseupBack=document.body.onmouseup;
  ox=(e.offsetX==null)?e.layerX:e.offsetX;
  oy=(e.offsetY==null)?e.layerY:e.offsetY;
  popupWinofsX=ox; popupWinofsY=oy;

  document.body.onmousemove=popupWinespopup_DragDropMove;
  document.body.onmouseup=popupWinespopup_DragDropStop;
  if (popupWintmrHide!=-1) clearInterval(popupWintmrHide);
}


function popupWinespopup_DragDropMove(e) {
	el=document.getElementById('popupWin');          
	if (e==null&&event!=null)
	{
	  el.style.left=(event.clientX*1+document.body.scrollLeft-popupWinofsX)+'px';
	  el.style.top=(event.clientY*1+document.body.scrollTop-popupWinofsY)+'px';
	  event.cancelBubble=true;
	}
	else
	{
	  el.style.left=(e.pageX*1-popupWinofsX)+'px';
	  el.style.top=(e.pageY*1-popupWinofsY)+'px';
	  e.cancelBubble=true;
	}
	if ((event.button&1)==0) popupWinespopup_DragDropStop();
}

function popupWinespopup_DragDropStop() {
  document.body.onmousemove=popupWinmousemoveBack;
  document.body.onmouseup=popupWinmouseupBack;
}
        
function popupWinespopup_Close() {
  if (popupWintmrId==-1)
  {
    el=document.getElementById('popupWin');
    el.style.filter='';
    el.style.display='none';
    if (popupWintmrHide!=-1) clearInterval(popupWintmrHide); popupWintmrHide=-1;
    
  }
}  
    
function resizeLayer() {
	var objMain = document.getElementById("popupWin");
	var objTitle = document.getElementById("popupWin_header");
	var obj = document.getElementById("popupWin_content");
	
	var alto = obj.scrollHeight;   	
	var ancho = obj.scrollWidth;
	   	   	
	if (alto < 76) {
		alto = minHeight;
		obj.style.height=minHeight;
	}
	   	
	if (ancho < 224) {
		ancho = 223;
		obj.style.width=224;
	}  	
	objMain.style.height=alto+incHeight;   	
	objMain.style.width=ancho+incWidth;
	objTitle.style.width=ancho;   	
}      
   
function showLayerAdvise(title,textHTML) {

	
	var objMain = document.getElementById("popupWin");
	var objMsgTitle = document.getElementById("popupWintitleEl");
 	var obj = document.getElementById("popupWin_content");
 	obj.innerHTML = textHTML;
 	objMsgTitle.innerHTML	= title;   	
 	objMain.style.display='block';	   		   		   	
 	resizeLayer();

}