sec1 = 'info';
sec2 = 'mschaefer.nl';
ad = sec1+'@'+sec2;

function we() 
{
	document.write('email: <a href="mailto:'+ad+'">'+ad+'<\/a>');
}
var currentmonth = '';
var currentDate = new Date();
var month = currentDate.getMonth()+1;
var year = currentDate.getFullYear();


function getCalendar()
{ 
    var xhr; 
    try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {
        try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        {
          try {  xhr = new XMLHttpRequest();     }
          catch (e3) {  xhr = false;   }
        }
     }
  
    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
              if(xhr.status  == 200) 
			document.getElementById('calendar').innerHTML = xhr.responseText; 
              else 
			document.getElementById('calendar').innerHTML = "Error code " + xhr.status;
         }
    }; 

	if (currentmonth == '') {
		xhr.open('GET', '/cal.nsf/maand?openagent',  true); 
	} else {
		xhr.open('GET', '/cal.nsf/maand?openagent&m='+currentmonth,  true); 	
	}

   xhr.send(null); 
} 

function volgende()
{
	if (month==12) 
	{
		 year = year + 1;
		 month = 1;
	} else {
		month = month + 1;
	}
	currentmonth = String(month) + '-' + String(year);
	getCalendar();
}

function vorige()
{
	if (currentmonth!=''){
		if (month==1) 
		{
			year = year - 1;
			month = 12;
		} else {
			if ((month == (currentDate.getMonth()+1)) && (currentDate.getFullYear() == year)) {
				currentmonth = '';
			} else {
				month = month - 1;
			}
		}
		if (currentmonth != '') {
			currentmonth = String(month) + '-' + String(year);
		}

	}

	getCalendar();		
}

function vandaag()
{
	currentmonth = '';
	month = currentDate.getMonth()+1;
	year = currentDate.getFullYear();

	getCalendar();		
}
