<!--
function showBox()
{
    $.blockUI.defaults.css = {padding:        0,
        margin:         0,
        width:          '30%', 
        top:            '40%', 
        left:           '35%', 
        textAlign:      'center', 
        color:          '#000', 
        border:         '3px solid #aaa',
        backgroundColor:'#fff'};
	$.blockUI({ 
		message: $('#lightboxDiv')
	}); 
}

function FormatInitials(inputField)
{
    var temp = "";
	var splitstring = "";
	
	inputField.value = '' + inputField.value;
	splitstring = inputField.value.split(" ");
	for(i = 0; i < splitstring.length; i++)
	{
		temp += splitstring[i];
	}
	
	inputField.value = temp.toUpperCase().split('.').join('').split('').join('.')+'.';
}

function ValidateField(inputField, showError)
{
    var allFieldsOK = true;

    if(!checkEmpty(document.getElementById('dhr').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='gender')
        {
            document.getElementById('errorGender').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorGender').style.display = 'none';
    }
    
    if(!checkEmpty(document.getElementById('initialen').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='initialen')
        {
            document.getElementById('errorInitials').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorInitials').style.display = 'none';
    }
    
    if(!checkEmpty(document.getElementById('achternaam').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='achternaam')
        {
            document.getElementById('errorLastname').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorLastname').style.display = 'none';
    }
    
    if(!IsZipCode(document.getElementById('postcodePrive').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='postcode')
        {
            document.getElementById('errorZipCode').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorZipCode').style.display = 'none';
    }
    
    if(!IsNumeric(document.getElementById('huisnummerPrive').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='huisnummer')
        {
            document.getElementById('errorHouseNumber').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorHouseNumber').style.display = 'none';
    }
    
    //if(!checkEmail(document.getElementById('toevoegingPrive').value))
    //{
    //    allFieldsOK = false;
    //    
    //    if(inputField.name=='toevoeging')
    //    {
    //        document.getElementById('errorHouseNumber').style.display = 'block';
    //    }
    //}
    //else
    //{
    //    document.getElementById('errorHouseNumber').style.display = 'none';
    //}
    
    if(!checkEmpty(document.getElementById('straatPrive').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='straat')
        {
            document.getElementById('errorStreet').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorStreet').style.display = 'none';
    }
    
    if(!checkEmpty(document.getElementById('plaatsPrive').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='plaats')
        {
            document.getElementById('errorCity').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorCity').style.display = 'none';
    }
    
    if(!IsPhoneNumber(document.getElementById('telefoon').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='telefoon')
        {
            document.getElementById('errorPhone').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorPhone').style.display = 'none';
    }
    
    if(!checkEmail(document.getElementById('email').value))
    {
        allFieldsOK = false;
        
        if(showError && inputField.name=='email')
        {
            document.getElementById('errorEmail').style.display = 'block';
        }
    }
    else
    {
        document.getElementById('errorEmail').style.display = 'none';
    }

    setStyle(allFieldsOK);
}

var emailPattern = /^\w+(?:[.-]?\w+)\w+@\w+(?:[.-]?\w+)\w+\.(?:com|net|org|nl|eu|be|de|uk|info|[a-z]{2})$/

function checkEmail(email)
{
    if(email.indexOf('@')>-1)
    {
        if(email.indexOf('.')>-1)
        {
	        if (emailPattern.test(email))
	        {
                return true;
	        }
	    }
	}
    return (false);
}

function checkEmpty(value)
{
    if(Trim(value).length==0)
    {
        return false;
    }
    else
    {
        return true;
    }
}

function IsNumeric(strString)
{
    var strValidChars = "0123456789";
    var strChar;
    var blnResult = true;

    if (strString.length == 0) return false;
    for (i = 0; i < strString.length && blnResult == true; i++)
    {
        strChar = strString.charAt(i);
        if (strValidChars.indexOf(strChar) == -1)
        {
            blnResult = false;
        }
    }
    return blnResult;
}

function IsPhoneNumber(strString)
{
    var strValidChars = "0123456789-+ ";
    var strChar;
    var blnResult = true;

    if (strString.length == 0) return true; //empty is allowed
    for (i = 0; i < strString.length && blnResult == true; i++)
    {
        strChar = strString.charAt(i);
        if (strValidChars.indexOf(strChar) == -1)
        {
            blnResult = false;
        }
    }
    return blnResult;
}

function IsZipCode(strString)
{
    var strValidNums = "0123456789";
    var strValidChars = "abcdefghijklmnopqrstuvwxyxABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var strChar;
    var blnResult = true;

    if (strString.length != 6) return false;
    for (i = 0; i < 6 && blnResult == true; i++)
    {
        strChar = strString.charAt(i);
        if(i<4)
        {
            if (strValidNums.indexOf(strChar) == -1)
            {
                blnResult = false;
            }
        }
        if(i>3)
        {
            if (strValidChars.indexOf(strChar) == -1)
            {
                blnResult = false;
            }
        }
    }
    return blnResult;
}

function Trim(value)
{
    value = value.replace(/^\s+/,''); 
    value = value.replace(/\s+$/,'');
    return value;
}

function setStyle(success)
{
	if (success)
	{
	       document.getElementById('formSubmitBtn').removeAttribute("disabled");
	       document.getElementById('formSubmitBtn').src = '/voordelen/images/bestel_informatiepakket_roze.gif';                  
	}
	else
	{
		   document.getElementById('formSubmitBtn').setAttribute("disabled","disabled");
	       document.getElementById('formSubmitBtn').src = '/voordelen/images/bestel_informatiepakket_grijs.gif';
	}
}
-->