//------------------------------------------
// Vervagen van achtergrond
//------------------------------------------
function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//------------------------------------------
// change the opacity for different browsers
//------------------------------------------
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

//------------------------------------------
// show the underlying tablerows
//------------------------------------------
function toggle_plaats(plaats)
{
	if(document.getElementsByClassName){
		var tr = document.getElementsByClassName(plaats);
		for(i=0; i < tr.length; i++)
		{
			tr[i].style.display = (tr[i].style.display == 'table-row' ? 'none' : 'table-row');
		}
	}
	else {
		var tr = document.getElementsByTagName("tr");
		for(i=0; i < tr.length; i++){
			var classname_tr = "tabletekst " + plaats;
			if(tr[i].className == classname_tr){
				tr[i].style.display = (tr[i].style.display == 'block' ? 'none' : 'block');
			}
		}
	}
/*
	if(document.getElementsByClassName)
	{
		for(i=-1; i<100; i++)
		{
			id = plaats + i;
			tr = document.getElementById(id);
			if(!tr) break;
			//document.getElementById("help").innerHTML = id;
			tr.style.display = (tr.style.display == "table-row" ? "none" : "table-row");
		}
	}
	else 
	{
		for(i=-1; i<100; i++)
		{
			id = plaats + i;
			tr = document.getElementById(id);
			if(!tr) break;
			//document.getElementById("help").innerHTML = id;
			tr.style.display = (tr.style.display == "block" ? "none" : "block");
		}
	}
*/
}

//------------------------------------------
// convert id to emailaddress
//------------------------------------------
function make_email(id)
{
	email = "mailto:" + id + "@stlos.nl";
	document.location.href = email;
}

function mailto(gebruikersnaam, domein, school) 
{ 
	document.location.href = "mailto:" + gebruikersnaam + "@" + domein + "?subject=WordOverblijfMedewerker " + school; 
} 
//------------------------------------------
// change cursor and text-decoration on mouse over
//------------------------------------------
function mouse_over(id)
{
	document.getElementById(id).style.textDecoration='underline';
	document.getElementById(id).style.cursor='pointer';
}

//------------------------------------------
// change back cursor and text-decoration on mouse over
//------------------------------------------
function mouse_out(id)
{
	document.getElementById(id).style.textDecoration='none';
	document.getElementById(id).style.cursor='pointer';
}
