﻿/**
 * Descripcion: Funciones javascript
 * Autor: German Valencia Salazar
 * Fecha: 03 de Septiembre de 2005
 * Version 1.0
 */
 
/// <summary>
/// Funcion encargado de la apertura de ventanas como pop-up
/// </summary>
function openWindow(path)
{
	if (parseInt(navigator.appVersion)>3)
	{
    	if (navigator.appName=="Netscape")
    	{
    	    xMax = window.innerWidth - 16;
            yMax = window.innerHeight - 16;
        }
        else if (navigator.appName.indexOf("Microsoft")!=-1)
        {
    	    xMax = screen.width;
	        yMax = screen.height - 60;
        }
        else
        {
    	    xMax = screen.width;
	        yMax = screen.height;
        }
	    
	    propiedades = "width=" + xMax + ", height=" + yMax + ", location=no, directories=no, status=yes, resizable=yes, scrollbars=yes, addressbar=no, menubar=no, copyhistory=no";
	    _window = window.open(path + "?heightScreen=" + yMax, '', propiedades);
	    _window.moveTo(0,0);
	    _window.opener.close();
	}
}
/// <summary>
/// Funcion encargado de la apertura de ventanas como pop-up
/// </summary>
function openWindowForSize(path, width, height)
{
	xPosicion = 0;
	yPosicion = 0;
	
	if(width < screen.width && height < (screen.height-60))
	{
		xPosicion = (screen.width - width)/2;
		yPosicion = (screen.height - 60 - height)/2;
	}
	
	propiedades = "width=" + width + ", height=" + height + ", location=no, directories=no, status=no, resizable=no, scrollbars=yes, addressbar=no, menubar=no, top=" + yPosicion + ", left=" + xPosicion;
	my_window = window.open(path, '', propiedades);
	//my_window.opener.close();
	my_window.focus();
}