
function openPopup(_url, _width, _height, _scroll){
	var width = parseInt(_width, 10);
	var height = parseInt(_height, 10);
	
	openWindow(_url, 'cacique', width, height, null, null, _scroll);
}


function openWindow(url, name, w, h, x, y, _scroll){

	var screenWidth = screen.width;
	var screenHeight = screen.height;
	
	var wW = (w!=null) ? w : screenWidth-50;
	var wH = (h!=null) ? h : screenHeight-150;
		
	var wX = (x!=null) ? x : Math.round(screenWidth/2-(wW/2));
	var wY = (y!=null) ? y : Math.round(screenHeight/2-(wH/2));
    
    var name = (name != null) ? name : 'dyPopup';
    
    var scrollbar = (_scroll != null) ? _scroll : 0;

    var win = window.open(url, name, 'resizable=0,scrollbars=1,status=0,location=0,toolbar=0,menubar=0,width='+wW+',height='+wH+',screenX='+wX+',screenY='+wY+',left='+wX+',top='+wY+'');

    return win;
}