//faq
function showVraag(vraagnummer)
{
	if (document.getElementById("antwoord-"+vraagnummer)) document.getElementById("antwoord-"+vraagnummer).style.display = 'block';
}

//popups algemeen
function showPopup(location, title)
{
	if (!title) title = 'The Future Krimpen';
	var screenWidth = screenHeight = 0;
	screenWidth = screen.width;
	screenHeight = screen.height;
	
	//var popupVars = 'left=0,top=0,width='+screenWidth+',height='+screenHeight+',scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no';
	var popupVars = 'left='+(screenWidth/4)+',top='+(screenHeight/4)+',width='+(screenWidth/2)+',height='+(screenHeight/2)+',scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no';
	//alert('pages/popups/pagePopup.php?location='+location+'&title='+title);
	window.open("pages/popups/pagePopup.php?location="+location+'&title='+title,title,popupVars);
}

//foto-popup
function uploadFoto(type)
{
	//open popup window
	showPopup('uploadFoto.php&type='+type);
}
function uploadBSDFoto(type)
{
	//open popup window
	showPopup('uploadBSDFoto.php');
}


function showFoto(location)
{
	//open popup window
	document.getElementById('overlay').style.display = 'block';
	//document.getElementById('lightbox').innerHTML = 'test';
	document.getElementById('lightbox').innerHTML = '<img src="'+location+'" title="Foto" alt="Foto kon niet geladen worden"/>';
}


/*
functies.js
*/

function hoverMasTab(id, selected)
{
	if (!selected) selected = false;
	switch (id)
	{
		case 'klus': //eerste
		{
			if (document.getElementById(id))
			{
				//document.getElementById(id).style.backgroundColor = '#FFFFFF';
				document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddleHover.jpg)';
				document.getElementById(id).style.backgroundRepeat = 'repeat-x';
			}
			if (document.getElementById(id+'Left'))
			{
				document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftHover.png"/>';
			}
			if (selected == 'oproep')
			{
				if (document.getElementById('oproepLeft'))
				{
					document.getElementById('oproepLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelectedPrevHover.png"/>';
				}
			}
			else if (document.getElementById('oproepLeft'))
			{
				document.getElementById('oproepLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevHover.png"/>';
			}
			break;
		}
		case 'lock': //laatste
		{
			if (document.getElementById(id))
			{
				//document.getElementById(id).style.backgroundColor = '#FFFFFF';
				document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddleHover.jpg)';
				document.getElementById(id).style.backgroundRepeat = 'repeat-x';
			}
			if (document.getElementById(id+'Left'))
			{
				if (selected=='aanmelden') document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelectedHover.png"/>';
				else document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillHover.png"/>';
			}
			if (document.getElementById('tabRight'))
			{
				document.getElementById('tabRight').innerHTML = '<img src="recources/img/template/mas/tabRightHover.png"/>';
			}
			break;
		}
		default:
		{
			if (document.getElementById(id))
			{
				//document.getElementById(id).style.backgroundColor = '#FFFFFF';
				document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddleHover.jpg)';
				document.getElementById(id).style.backgroundRepeat = 'repeat-x';
			}
			if (document.getElementById(id+'Left'))
			{
				if (selected == 'klus' && id == 'oproep')
				{
					if (document.getElementById('oproepLeft'))
					{
						document.getElementById('oproepLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelectedHover.png"/>';
					}
				}
				else if (selected == 'oproep' && id == 'smoelenboek')
				{
					if (document.getElementById('smoelenboekLeft'))
					{
						document.getElementById('smoelenboekLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelectedHover.png"/>';
					}
				}
				else if (selected == 'smoelenboek' && id == 'aanmelden')
				{
					if (document.getElementById('aanmeldenLeft'))
					{
						document.getElementById('aanmeldenLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelectedHover.png"/>';
					}
				}
				else document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillHover.png"/>';
			}
			
			
			if (id=='oproep')
			{
				if (document.getElementById('smoelenboekLeft'))
				{
					if (selected=='smoelenboek') document.getElementById('smoelenboekLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelectedPrevHover.png"/>';
					else document.getElementById('smoelenboekLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevHover.png"/>';
				}
			}
			else if (id=='smoelenboek')
			{
				if (document.getElementById('aanmeldenLeft'))
				{
					if (selected=='aanmelden') document.getElementById('aanmeldenLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelectedPrevHover.png"/>';
					else document.getElementById('aanmeldenLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevHover.png"/>';
				}
			}
			else if (id=='aanmelden')
			{
				if (document.getElementById('lockLeft'))
				{
					if (selected=='lock') document.getElementById('lockLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelectedPrevHover.png"/>';
					else document.getElementById('lockLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevHover.png"/>';
				}
			}
			
			break;
		}
	}
}

function leaveMasTab(id, selected)
{
	if (!selected) selected = false;
	switch (id)
	{
		case 'klus': //eerste
		{
			if (id==selected) 
			{
				if (document.getElementById(id))
				{
					//document.getElementById(id).style.backgroundColor = '#C1FFC1';
					document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddleSelected.jpg)';
					document.getElementById(id).style.backgroundRepeat = 'repeat-x';
				}
				if (document.getElementById(id+'Left'))
				{
					document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftSelected.png"/>';
				}
				
				if (document.getElementById('oproepLeft'))
				{
					document.getElementById('oproepLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelected.png"/>';
				}
			}
			else
			{
				if (document.getElementById(id))
				{
					//document.getElementById(id).style.backgroundColor = '#FFFF5D';
					document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddle.jpg)';
					document.getElementById(id).style.backgroundRepeat = 'repeat-x';
				}
				if (document.getElementById(id+'Left'))
				{
					document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeft.png"/>';
				}
				
				if (document.getElementById('oproepLeft'))
				{
					if (selected == 'oproep') document.getElementById('oproepLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelected.png"/>';
					else document.getElementById('oproepLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFill.png"/>';
				}
			}
			break;
		}
		case 'lock': //laatste
		{
			if (id==selected)
			{
				if (document.getElementById(id))
				{
					//document.getElementById(id).style.backgroundColor = '#C1FFC1';
					document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddleSelected.jpg)';
					document.getElementById(id).style.backgroundRepeat = 'repeat-x';
				}
				if (document.getElementById(id+'Left'))
				{
					document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelected.png"/>';
				}
				if (document.getElementById('tabRight'))
				{
					document.getElementById('tabRight').innerHTML = '<img src="recources/img/template/mas/tabRightSelected.png"/>';
				}
			}
			else
			{
				if (document.getElementById(id))
				{
					//document.getElementById(id).style.backgroundColor = '#FFFF5D';
					document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddle.jpg)';
					document.getElementById(id).style.backgroundRepeat = 'repeat-x';
				}
				if (document.getElementById(id+'Left'))
				{
					if (selected=='aanmelden') document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelected.png"/>';
					else document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFill.png"/>';
				}
				if (document.getElementById('tabRight'))
				{
					document.getElementById('tabRight').innerHTML = '<img src="recources/img/template/mas/tabRight.png"/>';
				}
			}
			break;
		}
		default:
		{
			if (selected==id)
			{
				if (document.getElementById(id))
				{
					//document.getElementById(id).style.backgroundColor = '#FF0000'; //C1FFC1
					document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddleSelected.jpg)';
					document.getElementById(id).style.backgroundRepeat = 'repeat-x';
				}
				if (document.getElementById(id+'Left'))
				{
					document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelected.png"/>';
				}
				if (id=='oproep') {if (document.getElementById('smoelenboekLeft')) document.getElementById('smoelenboekLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelected.png"/>';}
				else if (id=='smoelenboek') {if (document.getElementById('aanmeldenLeft')) document.getElementById('aanmeldenLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelected.png"/>';}
				else if (id=='aanmelden') {if (document.getElementById('lockLeft')) document.getElementById('lockLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelected.png"/>';}
			}
			else
			{
				if (document.getElementById(id))
				{
					//document.getElementById(id).style.backgroundColor = '#FFFF5D'; //FFFF5D
					document.getElementById(id).style.backgroundImage = 'url(recources/img/template/mas/tabMiddle.jpg)';
					document.getElementById(id).style.backgroundRepeat = 'repeat-x';
				}
				if (document.getElementById(id+'Left'))
				{
					if (id=='oproep' && selected=='klus') {document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelected.png"/>';}
					else if (id=='smoelenboek'&&selected=='oproep') {document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelected.png"/>';}
					else if (id=='aanmelden'&&selected=='smoelenboek') {document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFillPrevSelected.png"/>';}
					else document.getElementById(id+'Left').innerHTML = '<img src="recources/img/template/mas/tabLeftFill.png"/>';
				}
				
				if (id=='oproep')
				{
					if (document.getElementById('smoelenboekLeft'))
					{
						if (selected=='smoelenboek') document.getElementById('smoelenboekLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelected.png"/>';
						else document.getElementById('smoelenboekLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFill.png"/>';
					}
				}
				else if (id=='smoelenboek')
				{
					if (document.getElementById('aanmeldenLeft'))
					{
						if (selected=='aanmelden') document.getElementById('aanmeldenLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelected.png"/>';
						else document.getElementById('aanmeldenLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFill.png"/>';
					}
				}
				else if (id=='aanmelden')
				{
					if (document.getElementById('lockLeft'))
					{
						if (selected=='lock') document.getElementById('lockLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFillSelected.png"/>';
						else document.getElementById('lockLeft').innerHTML = '<img src="recources/img/template/mas/tabLeftFill.png"/>';
					}
				}
			}
			break;
		}
	}
}
