//Para la fecha
var months=new Array(13);
months[1]="Ene";
months[2]="Feb";
months[3]="Mar";
months[4]="Abr";
months[5]="May";
months[6]="Jun";
months[7]="Jul";
months[8]="Ago";
months[9]="Sep";
months[10]="Oct";
months[11]="Nov";
months[12]="Dic";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
var spanday = document.getElementById("tope_dia");
var spandate = document.getElementById("tope_mes_ano");
if (year < 2000)
year = year + 1900;
spanday.innerHTML = date;
spandate.innerHTML = lmonth + ", " + year;


//Para la hora
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
var spanhora = document.getElementById("tope_hora");
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " p.m." : " a.m."

spanhora.innerHTML = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}

//Para las funciones de Favoritos

function CreateBookmarkLink() {

 var title = "Enfoque Regional"; 
  // Blogger - Replace with <$BlogItemTitle$> 
  // MovableType - Replace with <$MTEntryTitle$>

 url = "http://www.enfoqueregional.net";
  // Blogger - Replace with <$BlogItemPermalinkURL$> 
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }

 function MakeHome(link) {
	if (navigator.appName != 'Microsoft Internet Explorer') {
		alert("Su navegador no es Internet Explorer. Solo debe arrastrar la pestaña hacia el botón de Inicio para agregar a Enfoque Regional como Página de Inicio.");
	} else {
		link.style.behavior="url(#default#homepage)";
		link.setHomePage("http://www.enfoqueregional.net");
	}
 }