// JavaScript Document

  
function dateIsSpecial(year, month, day) {
    var m = SPECIAL_DAYS[month];
    if (!m) return false;
    for (var i in m) if (m[i] == day) return true;
    return false;
};

  // al seleccionar un dia del calendario, mandamos la variable ed
function dateChanged(calendar) {
	// Beware that this function is called even if the end-user only
    // changed the month/year.  In order to determine if a date was
    // clicked you can use the dateClicked property of the calendar:
	if (calendar.dateClicked) {
	// OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
				
		var year;
		if (calendar.date.getYear() < 1900){
			year = calendar.date.getYear()+1900;
		}else{
			year = calendar.date.getYear();
		}
		var m = calendar.date.getMonth();     // integer, 0..11
		m++;
		if (m <= 9) m = "0" + m
		
		var d = calendar.date.getDate();      // integer, 1..31
		if (d <= 9) d = "0" + d
		// redirect...
		window.location = "index.php?ed=" + year + "-" + m + "-" + d ;
	}
};

function ourDateStatusFunc(date, y, m, d) {
    if (dateIsSpecial(y, m, d))
      return "special";
    else
      return false; // other dates are enabled
      // return true if you want to disable other dates
};


//mostrar ocultar etiqueta div
/*function showFact(mydiv,myexpander) {
	if (document.getElementById(mydiv).className == "factbody_hide") {
			document.getElementById(mydiv).className = "factbody_show";
			
	} else {
			document.getElementById(mydiv).className = "factbody_hide";
			
	}
};*/

function showFact(mydiv,myexpander) {
	if (document.getElementById(mydiv).className == "factbody_hide") {
			document.getElementById(mydiv).className = "factbody_show";
			document.images[myexpander].src = "Images/minus.png";
	} else {
			document.getElementById(mydiv).className = "factbody_hide";
			document.images[myexpander].src = "Images/plus.png";
	}
}

function showFact2(mydiv) {
	if (document.getElementById(mydiv).className == "factbody_hide") {
			document.getElementById(mydiv).className = "factbody_show";
	} else {
			document.getElementById(mydiv).className = "factbody_hide";
	}
}

if (document.images)
{
  pic1 = new Image(18,18); 
  pic1.src = "Images/plus.png"; 
}
