<!--

var ma=new Date();
var eddigmehetanaptar=ma.getFullYear()+1;
var teasertable='<table width="100%" border=0 cellpadding=1 cellspacing=0 class=boxszoveg style="border: 1px dashed #0043CC; background-color: #FFFFFF;" align=center>';
teasertable+='<tr><td align=left><div id="showdate"></div></td><td align=right><a href="javascript:;" onclick="document.getElementById(\'teaser-container\').style.display=\'none\'; return false;"><img src="user_includes/calendar/icon_close.gif" border=0></a></td></tr>';
teasertable+='<tr><td colspan=2><table width="100%" border=0 cellpadding=2 cellspacing=0 class=boxszoveg><tr><td><div id="teaser-content" style="display: inline;"></div></td></tr></table></td></tr>';
teasertable+='</table>';
  
  if(!SPECIAL_DAYS) {
    var SPECIAL_DAYS=new Array();
    }

  if(!CONSTANTS) {
    var CONSTANTS="";
    }

    function showTeaser(what,edate) {
        var nagyide=document.getElementById('teaser-container');
	var calel=document.getElementById('calendar-container');
	var sdate=document.getElementById('showdate');
	nagyide.innerHTML=teasertable;
        nagyide.style.display='inline';
	var ide=document.getElementById('teaser-content');
        ide.innerHTML=what;
	}

  function dateIsSpecial(year, month, day) {
    month=month+1;
    if(month<10) month="0"+month;
    if(day<10) day="0"+day;
    var key = ""+year+"_"+month+"_"+day;
    var m = SPECIAL_DAYS[key+'_0'];
    var n = SPECIAL_DAYS[key+'_1'];
    if (!m && !n) return false;
//    for (var i in m) if (m[i] == day) return true;
//    return false;
    return true;
  };

  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 y = calendar.date.getFullYear();
      var m = calendar.date.getMonth()+1;     // integer, 0..11
      var d = calendar.date.getDate();      // integer, 1..31
      if(m<10) m="0"+m;
      if(d<10) d="0"+d;
      key=y+"_"+m+"_"+d;
//      document.getElementById('teaser-container').style.display='none';
      if(SPECIAL_DAYS[key+'_0'] || SPECIAL_DAYS[key+'_1']) {
        location='index.php?pg=events_'+key+'_'+lang;
        }
    }
  };

  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
  };

  Calendar.setup(
    {
      flat         : "calendar-container", // ID of the parent element
      flatCallback : dateChanged,           // our callback function
      dateStatusFunc : ourDateStatusFunc

    }
  );

//-->
