// JavaScript Document



	var isIE = (window.ActiveXObject)? true : false;

	var menuButtonOnImageSuffix  = "_on";

	var menuButtonOffImageSuffix = "_off";

	var inlogNaamText = 'Uw inlognaam...';

	var paswoordText = 'Uw paswoord...';

	var postcodeText = 'Uw postcode...';

	var huisnummerText = 'Uw huisnummer...';

	var inlogNaamTextNA = 'Inlognaam is verplicht...';

	var paswoordTextNA = 'Paswoord is verplicht...';

	var postcodeTextNA = 'Postcode is verplicht...';

	var huisnummerTextNA = 'Huisnummer is verplicht...';

	var tb_HuisNummer, tb_PostCode, tb_InlogNaam, tb_Paswoord;
	var userInput = false;
	
	function init(e)

	{

		tb_HuisNummer = document.getElementById("tb_HuisNummer");

		tb_PostCode   = document.getElementById("tb_PostCode");

		tb_InlogNaam  = document.getElementById("tb_InlogNaam");

		tb_Paswoord   = document.getElementById("tb_Paswoord");
		tb_HuisNummer.value = huisnummerText;

		tb_PostCode.value   = postcodeText;

		tb_InlogNaam.value  = inlogNaamText;

		tb_Paswoord.value   = paswoordText;



		document.getElementById("menuButton_OnsBedrijf").attachEvent('onmouseover', MouseOver);

		document.getElementById("menuButton_OnsBedrijf").attachEvent('onmouseout', MouseOut);

		document.getElementById("menuButton_Distributie").attachEvent('onmouseover', MouseOver);

		document.getElementById("menuButton_Distributie").attachEvent('onmouseout', MouseOut);

		document.getElementById("menuButton_FietsenDistr").attachEvent('onmouseover', MouseOver);

		document.getElementById("menuButton_FietsenDistr").attachEvent('onmouseout', MouseOut);

		document.getElementById("menuButton_Historie").attachEvent('onmouseover', MouseOver);

		document.getElementById("menuButton_Historie").attachEvent('onmouseout', MouseOut);

		document.getElementById("menuButton_Contact").attachEvent('onmouseover', MouseOver);

		document.getElementById("menuButton_Contact").attachEvent('onmouseout', MouseOut);

		tb_HuisNummer.attachEvent('onblur', textboxOnblur);

		tb_PostCode.attachEvent('onblur', textboxOnblur);

		tb_InlogNaam.attachEvent('onblur', textboxOnblur);

		tb_Paswoord.attachEvent('onblur', textboxOnblur);

		tb_HuisNummer.attachEvent('onfocus', textboxOnFocus);

		tb_PostCode.attachEvent('onfocus', textboxOnFocus);

		tb_InlogNaam.attachEvent('onfocus', textboxOnFocus);

		tb_Paswoord.attachEvent('onfocus', textboxOnFocus);

	}



	function MouseOver(e)

	{

		if(isIE)

		{

			e.srcElement.style.backgroundImage =

				e.srcElement.style.backgroundImage.replace(menuButtonOffImageSuffix, menuButtonOnImageSuffix);

		}else{

		}
	}
	function MouseOut(e)

	{

		if(isIE)

		{

			e.srcElement.style.backgroundImage =

				e.srcElement.style.backgroundImage.replace(menuButtonOnImageSuffix, menuButtonOffImageSuffix);

		}else{

		}

	}
	function textboxOnblur(e)

	{

		if(e.srcElement.value == '')

		{
		  e.srcElement.style.color = '#999999';
			switch(e.srcElement.id)

			{

			case tb_HuisNummer.id:

			  tb_HuisNummer.value = huisnummerText;

			  break;    

			case tb_PostCode.id:

			  tb_PostCode.value   = postcodeText;

			  break;    

			case tb_InlogNaam.id:

			  tb_InlogNaam.value  = inlogNaamText;

			  break;    

			case tb_Paswoord.id:

			  tb_Paswoord.value   = paswoordText;

			  break;    

			default:

			  e.srcElement.value  = 'Tekst niet gevonden...';

			}

		}else if(e.srcElement.id == tb_PostCode.id && tb_PostCode != postcodeText)

		{

			tb_PostCode.value = tb_PostCode.value.replace(' ',  '');

		}
	}
	function textboxOnFocus(e)

	{

		e.srcElement.style.color = '#333333';

		switch(e.srcElement.id)

		{

		case tb_HuisNummer.id:

		  if(tb_HuisNummer.value != huisnummerText && tb_HuisNummer.value != huisnummerTextNA )

		  	return;

		  break;    

		case tb_PostCode.id:

		  if(tb_PostCode.value   != postcodeText && tb_PostCode.value   != postcodeTextNA)

		  	return;

		  break;    

		case tb_InlogNaam.id:

		  if(tb_InlogNaam.value  != inlogNaamText && tb_InlogNaam.value  != inlogNaamTextNA)

		  	return;

		  break;    

		case tb_Paswoord.id:

		  if(tb_Paswoord.value   != paswoordText && tb_Paswoord.value   != paswoordTextNA)

		  	return;

		  break;    

		default:

		  e.srcElement.value  != 'Tekst niet gevonden...';

		}
		e.srcElement.value = '';

	}

	
	
/*	function MM_preloadImages() { //v3.0

			var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

					var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

					if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

	}*/



function checkTTForm(form)

{

		 // controleer of tb_HuisNummer en tb_PostCode wel gezet zijn

			var OK = true;

			if (tb_HuisNummer && tb_PostCode)

			{
			   if(!userInput)
			   {
						if( tb_HuisNummer.value == '' || tb_HuisNummer.value == huisnummerText || tb_HuisNummer.value == huisnummerTextNA)

						{

//									huisnummerText = 'Huisnummer is verplicht...';

									tb_HuisNummer.style.color = '#FF0000';

 								tb_HuisNummer.value = huisnummerTextNA;

									OK = false;

						}

						if( tb_PostCode.value == '' || tb_PostCode.value == postcodeText || tb_PostCode.value == postcodeTextNA)

						{

//									postcodeText = 'Postcode is verplicht...';

									tb_PostCode.style.color = '#FF0000';

 								tb_PostCode.value = postcodeTextNA;

									OK = false;

						}
				}
			}

			if(OK) form.submit();

}







function checkWOForm(form)

{

			var OK = true;

		 // controleer of tb_InlogNaam en tb_Paswoord wel gezet zijn

			if (tb_InlogNaam && tb_Paswoord)

			{

						if( tb_InlogNaam.value == '' || tb_InlogNaam.value == inlogNaamText || tb_InlogNaam.value == inlogNaamTextNA)

						{

									tb_InlogNaam.style.color = '#FF0000';

 								tb_InlogNaam.value = inlogNaamTextNA;

									OK = false;

						}

						if( tb_Paswoord.value == '' || tb_Paswoord.value == paswoordText || tb_Paswoord.value == paswoordTextNA)

						{

									tb_Paswoord.style.color = '#FF0000';

 								tb_Paswoord.value = paswoordTextNA;

									OK = false;

						}

			}

			if(OK) form.submit();

}
