﻿function RunLoad() {
    var ct = document.getElementById("Message")
    if ((ct != null) && (ct.value != "")) alert(ct.value)
}
function RunVerzenden() {
    return true
    //var q = window.confirm("Wilt u dit formulier verzenden ?")
    //return q
}


function CheckEmail(source, arguments) {
    var path = document.getElementById('PathForJs').innerHTML
    arguments.IsValid = GetHttpResponseText(path + "FormControle.aspx?action=email&value=" + arguments.Value) == "true";
}    
function CheckDate(source, arguments) {
    var path = document.getElementById('PathForJs').innerHTML
    arguments.IsValid = GetHttpResponseText(path + "FormControle.aspx?action=date&value=" + arguments.Value) == "true";
}    
function CheckNumber(source, arguments) {
    var path = document.getElementById('PathForJs').innerHTML
    arguments.IsValid = GetHttpResponseText(path + "FormControle.aspx?action=number&value=" + arguments.Value) == "true"; 
}    
function CheckCounter(source, arguments) {
    var path = document.getElementById('PathForJs').innerHTML
    arguments.IsValid = GetHttpResponseText(path + "FormControle.aspx?action=counter&value=" + arguments.Value) == "true"; 
}    
function CheckCurrency(source, arguments) {
    var path = document.getElementById('PathForJs').innerHTML
    arguments.IsValid = GetHttpResponseText(path + "FormControle.aspx?action=currency&value=" + arguments.Value) == "true"; 
}
function CheckURL(source, arguments) {
    var path = document.getElementById('PathForJs').innerHTML
    arguments.IsValid = GetHttpResponseText(path + "FormControle.aspx?action=url&value=" + arguments.Value) == "true"; 
}
function GetHttpResponseText(sURL,oData) { 
    try {
        var oHttp = (window.XMLHttpRequest != null) ? (new XMLHttpRequest()) : (new ActiveXObject("MSXML2.XMLHTTP"))
        oHttp.open((oData == null) ? "GET" : "POST", sURL, false)
        oHttp.send(oData)
        if (oHttp.status != 200) throw ("http error status: " + oHttp.status)
        return oHttp.responseText
    } catch(e) {
        throw ((e.message != null) ? e.message : e)
    }	
}    