//Para el reloj
var Hoy = new Date();
var futuro = new Date (2010,9,3,0,0); 
var actualiza = 1000; 
function faltan(){ 
    Hora = Hoy.getHours() 
    Minutos = Hoy.getMinutes() 
    Segundos = Hoy.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 Anio = Hoy.getFullYear(); 
    var Fecha = Dia[Hoy.getDay()] + ", " + Hoy.getDate() + " de " + Mes[Hoy.getMonth()] + " de " + Anio + ", a las "; 
    var Inicio, Script, Final, Total 
    Inicio = "" 
    Script = Fecha + Hora + ":" + Minutos + ":" + Segundos 
    Final = "" 
    Total = Inicio + Script + Final 
    document.getElementById('Fecha_Reloj').innerHTML = Total 
    Hoy.setSeconds(Hoy.getSeconds() +1)
    
var ahora = new Date();
var faltan = futuro - ahora; 
if (faltan > 0){ 
var segundos = Math.round(faltan/1000); 
var minutos = Math.floor(segundos/60); 
var segundos_s = segundos%60; 
var horas = Math.floor(minutos/60); 
var minutos_s = minutos%60; 
var dias = Math.floor(horas/24); 
var horas_s = horas%24; 
var br = "<br/>";
document.getElementById('Cuenta_Regresiva').innerHTML= dias + " dias : " + horas_s + " horas : " + 
+minutos_s + " minutos : " + segundos_s + " segundos "; 
setTimeout("faltan()",actualiza); 
} 
else{ 
document.getElementById('Cuenta_Regresiva').innerHTML= "0 dias : 0 horas : 0 minutos : 0 segundos" ; 
return true; 
} 
} 


//FONCTION FOR DOWNLOAD FAQ LINK AND BOX ARTICLES
function MontreCacheItems(idImgOpen,idImgClose,idDivItems,idMenuSelect) {
	if((document.getElementById && document.getElementById(idImgOpen).style.display == 'inline') || (document.all && document.all[idImgOpen].style.display == 'inline') || (document.layers && document.layers[idImgOpen].display == 'inline') ) {
		cache(idImgOpen);
		montre(idImgClose,'inline');
		if((document.getElementById && document.getElementById(idDivItems) != null) || (document.all && document.all[idDivItems] != undefined ) || (document.layers && document.layers[idDivItems] != undefined) ) {
			montre(idDivItems,'block');
		} else {
			montre(idMenuSelect,'block');
		}
	} else {
		cache(idImgClose);
		montre(idImgOpen,'inline');
		if((document.getElementById && document.getElementById(idDivItems) != null) || (document.all && document.all[idDivItems] != undefined ) || (document.layers && document.layers[idDivItems] != undefined) ) {
			cache(idDivItems);
		} else {
			cache(idMenuSelect);
		}
	}
}

function montre(id, display) {
  	if (display != 'block' && display != 'inline') display = 'block';
  	if (document.getElementById) {
    	document.getElementById(id).style.display = display;
  	} else if (document.all) {
    	document.all[id].style.display = display;
  	} else if (document.layers) {
    	document.layers[id].display = display;
  	}
}

function cache(id) {
  if (document.getElementById) {
    document.getElementById(id).style.display = 'none';
  }
  else if (document.all) {
    document.all[id].style.display = 'none';
  }
  else if (document.layers) {
    document.layers[id].display = 'none';
  }
}

function PopupWindow(page, titre, largeur, hauteur, resizeyn, scrollb) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page, titre,
    "top=" + top +
    ", left=" + left +
    ", width=" + largeur +
    ", height=" + hauteur +
    ", directories=no, menubar=no, status=no, resizable=" + resizeyn +
    ", scrollbars=" +scrollb +
    ",location=no");
}
//para solo numeros en input

function no_numeros(cadena, obj, e){
	opc = false;
	tecla = (document.all) ? e.keyCode : e.which;
	if (cadena == "%d")
	if (tecla > 47 && tecla < 58)
	opc = true;
	if (cadena == "%f"){
	if (tecla > 47 && tecla < 58)
	opc = true;
	if (obj.value.search("[.*]") == -1 && obj.value.length != 0)
	if (tecla == 46)
	opc = true;
	}
	if (tecla == 8) {opc = true;} // tecla backspace
	
	return opc;
	}
