function bookmark(){
	var url = 'http://' + document.URL;
	if (window.sidebar) { // Mozilla Firefox Bookmark		
	window.sidebar.addPanel(document.title, url,"");	} 
	else if( window.external ) { // IE Favorite		
	window.external.AddFavorite( url, document.title); }	
	else if(window.opera && window.print) { // Opera Hotlist		
	alert("Presione Crtl+D para agregar este sitio en sus favoritos"); 
	}
	return false
}
function printPage(){
window.print();
return false
}
function showfecha(){ 
	momentoActual = new Date(); 
	dia = (momentoActual.getDate() < 10 ? "0" + momentoActual.getDate() : momentoActual.getDate());
	diasem = momentoActual.getDay();
	var nomsem = new Array('Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado');
	mes = momentoActual.getMonth();
	anio = momentoActual.getYear(); 	
	var nommes = new Array("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre");
	if( anio < 2000 )
		anio = eval(1900+anio);
	horaImprimible = nomsem[diasem] + ", " + dia + " de " + nommes[mes] + " de " + anio;
	if( document.getElementById('cl1') != null )
	    document.getElementById('cl1').innerHTML = horaImprimible; 
}
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; 	
	if( document.getElementById('cl') != null )
	    document.getElementById('cl').innerHTML = horaImprimible; 
    setTimeout("mueveReloj()",1000); 
} 
function showfecha_en(){ 
	momentoActual = new Date(); 
	dia = (momentoActual.getDate() < 10 ? "0" + momentoActual.getDate() : momentoActual.getDate());
	diasem = momentoActual.getDay();	
	mes = momentoActual.getMonth();
	anio = momentoActual.getYear(); 	
	var nomsem = new Array('Sunday','Monday','Thuesday','Wednesday','Thursday','Friday','Saturday');	
	var nommes = new Array(	"january","february","march","april","may","june","july","august","september",
		"october","november","december");	
	if( anio < 2000 )
		anio = eval(1900+anio);
	horaImprimible = nomsem[diasem] + ", " + nommes[mes] + " " + dia + " " + anio;
	if( document.getElementById('cl1') != null )
	    document.getElementById('cl1').innerHTML = horaImprimible; 
}
function ReloadImg(){
	protectwebform_reload_image();
	return false;
}
function callJavascript(str) {
	xmlHttp=objAjax();
	if (xmlHttp==null)
	  {
	  alert ("Su navegador no soporta AJAX!");
	  return;
	  } 
	var url="/inc/cambia_estado.asp";
	url=url+"?sid="+Math.random();
	url=url+'&estado='+ String(str);
	xmlHttp.onreadystatechange=CambiaStd;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function CambiaStd() 
{ 
	if (xmlHttp.readyState==4)
		cadena=unescape(xmlHttp.responseText);					
}
function addEvento() {
  var lenlaces = document.getElementsByTagName('a');
  for (var i=0; i<lenlaces.length; i++) {
		if (lenlaces[i].className.match("imprime")) {
		  lenlaces[i].onclick = printPage; 
		  lenlaces[i].onkeypress = printPage; 
		}
		if (lenlaces[i].className.match("favorito")) {
		  lenlaces[i].onclick = bookmark; 
		  lenlaces[i].onkeypress = bookmark; 
		}
		if (lenlaces[i].className.match("showDiv")) {
		  lenlaces[i].onclick =  function(){document.getElementById('avisosEnviar').style.display='block';  return false;}
		  lenlaces[i].onkeypress = function(){document.getElementById('avisosEnviar').style.display='block'; return false; }
		}	
		if (lenlaces[i].className.match("protectweb")) {
		  lenlaces[i].onclick = ReloadImg ;
		  lenlaces[i].onkeypress = ReloadImg;	}			
	}
}
window.onload = addEvento;
