 function firstLetterCaps(string) {
			partOne = string.substring(0,1);
			partTwo = string.substring(1,string.length);
			return partOne.toUpperCase() + partTwo.toLowerCase();
			}       

function firstCaps (string) {
		lastSpace = -2;
		outputString = "";
		for ( a=0; a<string.length; a++) {
				thisLetter = string.substring(a,a+1);
				if ( thisLetter == " " ) {
						lastSpace = a;
						}
			  
				if ( a==0 || a == lastSpace+1 ) {
						outputString += thisLetter.toUpperCase();
						}
				else {
						outputString += thisLetter.toLowerCase();
						}
				} 
		return outputString     ;
		}

function UC(textfield)
{
	textfield.value = textfield.value.toUpperCase();
}


// Begin Numbers only -- onkeypress="return numeralsOnly(event)" ------------------------------>
function numeralsOnly(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 
        ((evt.which) ? evt.which : 0));
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        alert("Hier kunt u alleen getallen invullen !");
        return false;
    }
    return true;
}


// Begin Letters only --- onkeypress="return lettersOnly(event)" ------------------------------>
function lettersOnly(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 
        ((evt.which) ? evt.which : 0));
    if (charCode > 31 && (charCode < 65 || charCode > 90) && 
        (charCode < 97 || charCode > 122)) {
        alert("Hier kunt u alleen letters invullen !");
        return false;
    }
    return true;
}

function HideOrShowStuff()
{
    if (document.getElementById)
    {
		var radio1 = "";	
		var radio2 = "";
		// Hide all regions
		
		document.getElementById('wkpost').style.display = 'none';
        document.getElementById('wkpre').style.display = 'none';
		document.getElementById('gkpost').style.display = 'none';
        document.getElementById('gkpre').style.display = 'none';
		
		len1 = document.contact.IsCustomer.length;
		len2 = document.contact.TypeVraag.length;
		
		for (i = 0; i <len1; i++) 
		{
			if (document.contact.IsCustomer[i].checked) 
			{
				radio1 = document.contact.IsCustomer[i].value;
			}
		}
		
		for (i = 0; i <len2; i++) 
		{
			if (document.contact.TypeVraag[i].checked) 
			{
				radio2 = document.contact.TypeVraag[i].value;
			}
		}
		
        if (radio1 != '') 
		{
			if (radio2 != '')
			{
				if (radio1 == 1)
				{
					if (radio2 == 1)
					{
						document.getElementById('wkpost').style.display = 'block';		
					}	
					else
					{
						document.getElementById('wkpre').style.display = 'block';	
					}
				}
				else
				{
					if (radio2 == 1)
					{
						document.getElementById('gkpost').style.display = 'block';		
					}	
					else
					{
						document.getElementById('gkpre').style.display = 'block';	
					}	
				}
			}
		}
   	}
    else
    {
        alert('Sorry, your browser doesn\'t support this');
    }
}

function ResetForm()
{
	contact.wkpostMobielnummer.value = '';
	contact.wkpostemail.value = '';
	contact.wkpostVraag.value = '';
	contact.wkpreMobielnummer.value = '';
	contact.wkpreemail.value = '';
	contact.wkpreVraag.value = '';
	contact.gkpostVoornaam.value = '';
	contact.gkpostTussenvoegsel.value = '';
	contact.gkpostAchternaam.value = '';
	contact.gkpostTelefoonnummer.value = '';
	contact.gkpostEmailadres.value = '';
	contact.gkpostVraag.value = '';
	
	contact.gkpreVoornaam.value = '';
	contact.gkpreTussenvoegsel.value = '';
	contact.gkpreAchternaam.value = '';
	contact.gkpreTelefoonnummer.value = '';
	contact.gkpreEmailadres.value = '';
	contact.gkpreVraag.value = '';
}
