function nav(adres)
{
	window.location.href = adres;
}

function knopMouseOver(obj, naam)
{
	if (naam == "sub")
	{
		obj.style.background = "yellow";
		obj.style.border = "2px solid black";
		obj.style.backgroundImage = "none";
		obj.style.width = "126px";
		obj.style.height = "21px";
	}
	else
	{
		obj.style.background = "#FFF380";
		obj.style.border = "2px solid black";
		obj.style.backgroundImage = "none";
		obj.style.width = "126px";
		obj.style.height = "26px";
		if (naam == "mm")
		{
			obj.style.height = "36px";
		}
	}
}

function knopMouseOut(obj, naam)
{
	if (obj.id == 'huidig')
	{
		// do nothing :P
	}
	else if (naam == "sub")
	{
		obj.style.border = "0px solid black";
		obj.style.background = "yellow";
		obj.style.width = "130px";
		obj.style.height = "25px";
	}
	else
	{
		obj.style.background = "none";
		obj.style.border = "0px solid black";
		obj.style.backgroundImage = "url(images/button.png)";
		obj.style.width = "130px";
		obj.style.height = "30px";
		if (naam == "mm")
			obj.style.height = "40px";
	}
}

/* Menu slide functions inspired by Mart Hagenaars
see also: MartHagenaars.nl */

//var action = new Array(); // { 0=obj, 1= oude width, 2= oude height, 3 = nieuwe width, 4== nieuwe height, 5 = stappen, 6 = huidigestap


var pm = false;
var mm = false;
var sliding = false;
var action;

function menuKlap(naam)
{
	if (obj = document.getElementById(naam))
	{	
		if (naam == "pmknoppen")
		{
			obj.style.height = "150px";
			obj.style.width = "150px";
			pm = true;
		}
		else //mmknoppen
		{		
			obj.style.height = "150px"; //185
			obj.style.width = "150px";
			mm = true;
		}
	}
	
}

function menuSlide(naam)
{
	if (sliding) // resetting de andere actie
	{
		endAction();
	}
	sliding = true;
	
	if (obj = document.getElementById(naam))
	{	
		if (naam == "pmknoppen")
		{
			if (pm) // klap in
				resize(obj, 150, 150, 150, 0, 25);
			else // klap uit
				resize(obj, 150, 0, 150, 150, 25);
			pm = !pm;
		}
		else //mmknoppen
		{		
			if (mm) // klap in
				resize(obj, 150, 150, 150, 0, 25);//(obj, 150, 185, 150, 0, 25);
			else // klap uit
				resize(obj, 150, 0, 150, 150, 25);//(obj, 150, 0, 150, 185, 25)
			mm = !mm;
		}
	}
}

function resize(obj, w1, h1, w2, h2, stappen)
{
	action = new Array(obj, w1, h1, w2, h2, stappen, 0);
	stepResize();	
}

function endAction()
{
	obj = action[0];
	w2 = action[3];
	h2 = action[4];
	action[6] = action[5];
	
	obj.style.height = h2;
	obj.style.width = w2;
	sliding = false;
}

function stepResize()
{
	obj = action[0];
	
	w2 = action[3];
	w1 = action[1];
	h1 = action[2];
	h2 = action[4];
	stappen = action[5];
	index = action[6];
	
	if (index >= stappen)
	{
		obj.style.height = h2;
		obj.style.width = w2;
		sliding = false;
		return;
	}

	deltaW = (w2 - w1) / stappen;
	deltaH = (h2 - h1) / stappen;
	
	
	nieuweH = h1 + (deltaH * index);
	nieuweW = w1 + (deltaW * index);
	obj.style.height = nieuweH.toString() + 'px';
	obj.style.width = nieuweW.toString() + 'px';
	
	action[6] = index + 1;
	countdownTimer=setTimeout("stepResize(action)",7);
}

function submitBewerk() // niet meer gebruikt
{
	quasi2real();
	document.getElementById("designTekstH").value = document.getElementById("editorText").value;
	// resultaatTekstH is al opgeslagen door quasi2real();
}

var secret = 0;
function secretButton()
{
	if (secret == 3)
	{
		secret = 0;
		nav('admin');
	}
	else
		secret++;
}

/************* Foto album ****************/
function voegFotoToe()
{
	if (document.getElementById("naamFoto").value == "")
	{
		alert("U moet een foto selecteren");
		return false;
	}
	if (document.getElementById("kopFoto").value == "")
	{
		alert("U moet de foto een kop geven");
		return false;
	}
	quasi2real();
	document.getElementById("naamFotoH").value = document.getElementById("naamFoto").value;
}

function verwijderfoto()
{
	return confirm("Weet u zeker dat u deze foto wilt verwijderen uit het foto album?");
}

var oudObject = false;
function plakAdres(object, adres)
{
	document.getElementById("naamFoto").value = adres;
	if (oudObject)
	{
		oudObject.style.border = "0px solid black";
	}
	object.style.border = "4px solid blue";
	oudObject = object;
}