﻿function ConfirmarEliminar()
{
	return confirm(CONFIRMACIONELIMINAR);
}

function ConfirmarEliminarPagina()
{
	return confirm(CONFIRMACIONELIMINARPAGINA);
}

function ConfirmarEliminarElemento()
{
	return confirm(CONFIRMACIONELIMINARELEMENTO);
}


function RedimensionarPagina()
{
	var width;
    var height;
	switch (screen.width) 
	{
		case 800 : /* 800x600 */
			width = 778;
            height = "100%";
			break;       
		case 1024 : /* 1024x768 */
			width = 1002;
            height = "96.8%";
			break;     
		case 1200 : /* 1200x800 */
			width = 1178;
            height = "97.5%";
			break;  
		case 1280 : /* 1280x1024 */
			width = 1257;
            height = "100%";
			break;
		case 1680 : /* 1680x1050 */
			width = 1658;
            height = "97.8%";
			break;
        case 1920 : /* 1920x1200 */
			width = 1890;
            height = "98.2%";
			break;
	}
	
	if (!(navigator.appName == "Microsoft Internet Explorer"))
	{
		width = width + 5 + "px";
	}
	
	if (navigator.appVersion.indexOf('MSIE 6')>=0)
	{ 
		document.getElementsByTagName('body')[0].style.width = width;
	}
	else
	{
		document.getElementsByTagName('html')[0].style.width = width;
		document.getElementsByTagName('html')[0].style.height = height;
		document.getElementsByTagName('html')[0].style.overflow = "scroll";
	}	
}

function CapturarEnter(btnClientId,btnUniqueId,event)
{
    if (document.all)
    {
        if (event.keyCode==13)
        {
            event.returnValue=false;
            event.cancel=true;
            document.getElementById(btnClientId).click();
       
        }
    }
    else if (document.getElementById)
    {
        if (event.which==13)
        {
            event.returnValue=false;
            event.cancel=true;
            __doPostBack(btnUniqueId,'')
        }
    }
}

function AbrirVentanaNavegador(url)
{
    window.open(url,'_blank');
}


function checkSize (obj) 
{
	if(obj.value.length >= 500)
	{
		alert('Has superado el tamaño máximo permitido'); 
		return false;
	};
}

