function AbrirCentro(url,nompopup,popW,popH,resizable,scroll){
	w = screen.availWidth;
	h = screen.availHeight;
	var leftPos = (w-popW)/2; topPos = (h-popH)/2;
	leftPos = leftPos - 20;
	topPos = topPos - 20;
	window.open(url,nompopup,'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',resizable=' + resizable + ',scrollbars=' + scroll );
}
function FechaActual () {
	marcacion = new Date() 
	Hora = marcacion.getHours() 	
	Minutos = marcacion.getMinutes() 
	Segundos = marcacion.getSeconds()	

	if (Hora<=9) { Hora = "0" + Hora }
	if (Minutos<=9) { Minutos = "0" + Minutos  }
	if (Segundos<=9) { Segundos = "0" + Segundos }

	var Dia = new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"); 
	var Mes = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"); 
	var Hoy = new Date(); 
	var Anio = Hoy.getFullYear(); 
	var Fecha = "Lima - Perú, " + Dia[Hoy.getDay()] + " " + Hoy.getDate() + " de " + Mes[Hoy.getMonth()] + " del " + Anio; 
	FechaTotal = Fecha

	document.getElementById('FechaReloj').innerHTML = FechaTotal 
	setTimeout("FechaActual()",1000)
}
function OverImg(name) {
	actual = document.getElementById(name).src
	total = actual.length
	tipo = actual.substr(total-3,total)
	if (tipo=="jpg") {
		formato = "jpg"
	} else {
		formato = "gif"
	}
	document.getElementById(name).src = "images/" + name + "_over." + formato;
}
function OutImg(name) {
	actual = document.getElementById(name).src
	total = actual.length
	tipo = actual.substr(total-3,total)
	if (tipo=="jpg") {
		formato = "jpg"
	} else {
		formato = "gif"
	}	
	document.getElementById(name).src = "images/" + name + "." + formato;
}

function OverVid(name) {
	actual = document.getElementById(name).src
	total = actual.length
	tipo = actual.substr(total-3,total)
	if (tipo=="flv") {
		formato = "flv"
	}
	document.getElementById(name).src = "videos/" + name + "_over." + formato;
}
function OutVid(name) {
	actual = document.getElementById(name).src
	total = actual.length
	tipo = actual.substr(total-3,total)
	if (tipo=="flv") {
		formato = "flv"
	}
	document.getElementById(name).src = "videos/" + name + "." + formato;
}

function Busqueda() {
	document.megabyte.action = "busqueda.php";
	document.megabyte.method = "post"
	if (document.megabyte.buscador.value == "") {
		alert("Debe de ingresar un valor para iniciar la busqueda.");
		document.megabyte.buscador.focus();
		return;
	}
	document.megabyte.submit();
}
function EsEmail(string) {
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
		return true;
	} else {
		return false;
	}
}
function Montos(string) {
    var valid = "0123456789.";
    var rpta = '';
    for (var i=0; i<string.length; i++){
        val = string.substring(i, i+1);
        if (valid.indexOf(val) > -1) rpta += val;
    }
    return rpta;
}
function Enteros(string) {
    var valid = "0123456789";
    var rpta = '';
    for (var i=0; i<string.length; i++){
        val = string.substring(i, i+1);
        if (valid.indexOf(val) > -1) rpta += val;
    }
    return rpta;
}
function Caracteres(string) {
    var invalid = "!ñÑ´áéíóúÁÉÍÓÚ{}[]-";
    var rpta = '';
    for (var i=0; i<string.length; i++){
        inval = string.substring(i, i+1);
        if (invalid.indexOf(inval) > -1) rpta += inval;
    }
    return rpta;
}
function Espacio(string) {
    var invalid = " ";
    var rpta = '';
    for (var i=0; i<string.length; i++){
        inval = string.substring(i, i+1);
        if (invalid.indexOf(inval) > -1) rpta += inval;
    }
    return rpta;
}
function Puntos(string) {
    var invalid = ".";
    var rpta = '';
    for (var i=0; i<string.length; i++){
        inval = string.substring(i, i+1);
        if (invalid.indexOf(inval) > -1) rpta += inval;
    }
    return rpta;
}
/*-----------------RELOJ PRINCIPAL----------------------------------------------------------*/
   function clock() 
            {
            if (!document.layers && !document.all) return;
     				var dias_semana = new Array ('Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','Sábado');
     				var nombres_mes = new Array ('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre');
     				var fecha = new Date ();
     				var dia = fecha.getDay ();
     				dia = dias_semana[dia];
     				var dia_mes = fecha.getDate();
     				var mes = fecha.getMonth ();
     				mes = nombres_mes[mes];
     				var anio = fecha.getYear();
     				anio = anio;
					var hours = fecha.getHours();
					hours = hours;
					var minutes = fecha.getMinutes();
					minutes = minutes;
					var seconds = fecha.getSeconds();
					seconds = seconds;
					var amOrPm = " AM";
					if (hours > 11) amOrPm = " PM";
					if (hours > 12) hours = hours - 12;
					if (hours == 0) hours = 12;
					if (minutes <= 9) minutes = "0" + minutes;
					if (seconds <= 9) seconds = "0" + seconds;
					dispDate =  dia + " " + dia_mes + " de " + mes + " del " + anio + "    ";
					dispTime =  "  " + hours + ":" + minutes + ":" + seconds + amOrPm + "  ";
					if (document.layers) 
						{
						document.layers.pendule.document.write(dispDate);
						document.layers.pendule.document.write(dispTime);
						document.layers.pendule.document.close();
						}
					else
					if (document.all)
					pendule.innerHTML = '<p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0" align="left"><font face="Verdana" font color="#333" size=1>' + dispDate + '<img src="img_/ico_reloj.gif">' + dispTime + '</font></p>';
					setTimeout("clock()", 1000);
				}
/*-----------------HORA de INGRESO---------------------------------------*/
function mueveReloj(){
	momentoActual = new Date()
	hora = momentoActual.getHours()
	minuto = momentoActual.getMinutes()
	segundo = momentoActual.getSeconds()
	
	str_segundo = new String (segundo)
	if (str_segundo.length == 1) 
		segundo = "0" + segundo
		
	str_minuto = new String (minuto)
	if (str_minuto.length == 1) 
		minuto = "0" + minuto

	str_hora = new String (hora)
	if (str_hora.length == 1) 
		hora = "0" + hora
		
	horaImprimible = hora + ":" + minuto + ":" + segundo
	
	document.example.reloj.value = horaImprimible
	
	setTimeout("mueveReloj()",1000)
}
mueveReloj()