function popitup(url)
{
	var ancho=250;
	var alto=150;
	var x=(screen.width-ancho)/2;
	var y=(screen.height-alto)/2;
	newwindow=window.open(url, 'name', 'width=250, height=150, status=yes,scrollbars=no , titlebar=no, toolbar=no,menubar=no,resizable=NO,top='+y+',left='+x);
	if (window.focus) {newwindow.focus()}
	return false;
}

function openWin(url, name) 
{
	var ancho=800;
	var alto=600;
	var x=(screen.width-ancho)/2;
	var y=(screen.height-alto)/2;
	var newwin = window.open(url, name, 'toolbar=no,location=no,directories=no,status=yes,menubar=0,scrollbars=yes,resizable=no,top=0,left=0');
	if(newwin != null) {
		if (newwin.opener == null) {
			newwin.opener = self;
		}
	}
	newwin.focus();
	return newwin;
}

function openWinDim(url, name, dimAncho, dimAlto) 
{
	var ancho=dimAncho;
	var alto=dimAlto;
	var x=(screen.width-ancho)/2;
	var y=(screen.height-alto)/2;
	var opciones = "width="+ancho+", height="+alto+", location=no,directories=no,status=yes,scrollbars=no , titlebar=no, toolbar=no,menubar=no,resizable=no,top="+y+",left="+x;  
	var newwin = window.open(url, name, opciones);
	if(newwin != null) {
		if (newwin.opener == null) {
			newwin.opener = self;
		}
	}
	newwin.focus();
	return newwin;
}


function popitup2(url)
{
	var ancho=450;
	var alto=300;
	var x=(screen.width-ancho)/2;
	var y=(screen.height-alto)/2;
	newwindow=window.open(url, 'name', 'width=450, height=300, status=yes,scrollbars=no , titlebar=no, toolbar=no,menubar=no,resizable=NO,top='+y+',left='+x);
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitupDim(url,dimAncho,dimAlto)
{
	var ancho = dimAncho;
        var alto = dimAlto;
   //alert(ancho);
	var x=(screen.width-ancho)/2;
	var y=(screen.height-alto)/2;
	newwindow=window.open(url, 'name', 'width='+ancho+', height='+alto+', status=yes,scrollbars=no , titlebar=no, toolbar=no,menubar=no,resizable=NO,top='+y+',left='+x);
	if (window.focus) {newwindow.focus()}
	return false;
}

function verDoc(url,nombre,numregistro,fechaRegistro,idFirma,urlValidacion,tipo){

	var ancho=450;
	var alto=300;
	var x=(screen.width-ancho)/2;
	var y=(screen.height-alto)/2;
	
	url=url+'?'+'n='+nombre+'&r='+numregistro+'&f='+fechaRegistro+'&i='+idFirma+'&u='+urlValidacion+'&t='+tipo;

	//alert(url);

	newwindow=window.open(url, 'name', 'width=450, height=300, status=yes,scrollbars=yes , titlebar=no, toolbar=no,menubar=no,resizable=NO,top='+y+',left='+x);
	if (window.focus) {newwindow.focus()}
	return false;

}

function verDoc(url,nombre,numregistro,fechaRegistro,idFirma,urlValidacion,tipo, idCifrado){

	var ancho=450;
	var alto=300;
	var x=(screen.width-ancho)/2;
	var y=(screen.height-alto)/2;
	
	url=url+'?'+'n='+nombre+'&r='+numregistro+'&f='+fechaRegistro+'&i='+idFirma+'&u='+urlValidacion+'&t='+tipo+'&c='+idCifrado;

	//alert(url);

	newwindow=window.open(url, 'name', 'width=450, height=300, status=yes,scrollbars=yes , titlebar=no, toolbar=no,menubar=no,resizable=NO,top='+y+',left='+x);
	if (window.focus) {newwindow.focus()}
	return false;
}

function mostrardiv() 
{
	div = document.getElementById('flotante');
	div.style.display = '';
	div = document.getElementById('contenedorInfo1');
	div.style.display = 'none';
	div = document.getElementById('contenedorInfo2');
	div.style.display = '';

}
function cerrar() 
{
	div = document.getElementById('flotante');
	div.style.display='none';
	div = document.getElementById('contenedorInfo1');
	div.style.display = '';
	div = document.getElementById('contenedorInfo2');
	div.style.display = 'none';
}

function clear_input(input, valor) 
{
   if (input.value == valor)
      input.value = "";
}
/*
 * Obtiene la fecha actual en formato dd/mm/yyyy 
 */
function obtenerFechaActual () {
	var f = new Date();
	var dia = f.getDate();
	if(dia < 10) {
		dia = "0" + dia;
	}
	var mes = f.getMonth() + 1;
	if(mes < 10) {
		mes = "0" + mes;
	}
	var anyo = f.getFullYear();
	return (dia + "/" + mes + "/" + anyo);
}

