/*POP UP CODE PORTUNA*/
var prvWindow;
var arrDpop = new Array();

function showPopup(id, width, height, x, y){
var tmpT = getobj('popup'+id);

	if(!width) width=450;
	if(!x) x=150;
	if(!y) y=150;
		
	if(id!=prvWindow){
		try{
			getobj('popup'+prvWindow).style.display = 'none';
		}catch(e){
		}
		if(tmpT){
			if(!arrDpop[id]){
				tmpT.style.width = width + 'px';
				if(height){
					if(height=='auto'){
						tmpT.style.height = 'auto';
					} else{
						tmpT.style.height = height + 'px';
					}
				}else{
					tmpT.style.height = 'auto';
				}
				tmpT.style.left = x + 'px';
				tmpT.style.top = y + 'px';
				
				arrDpop[id] = true;
				Drag.makeDraggable(tmpT);
			}
			tmpT.style.display = '';
		}
		prvWindow = id;
	}
}

function hidePopup(id){
var tmpT = getobj('popup'+id);
	
	try{
		tmpT.style.display = 'none';
	}catch(e){
	}
	prvWindow = '';
}

function getobj(id){
	return document.getElementById(id);
}
