/*-------------------------------------
Copyright 2002 Uselab Amsterdam
http://www.uselab.com
last change: 1-5-2002 17:37
-------------------------------------*/

function validZip(inputzip,adres,plaats,vest_name){   
    x = inputzip;
    newx = "";
    for(i=0; i<(x.length); i++){
    if(x.substring(i,i+1) == ' '){newx = newx;
    }else{newx = newx + x.substring(i,i+1);}}      
    zip = newx;
    len = zip.length;
    cijfers = "0123456789";
    letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    if(len != 4 && len != 6){alert("Ongeldige postcode lengte")
    document.UserPostcodeForm.UserPostcodeField.focus()
    return false
    }else{for(i=0; i<4; i++){if (cijfers.indexOf(zip.charAt(i))<0)
    {alert("Ongeldige postcode cijfers")
    document.UserPostcodeForm.UserPostcodeField.focus()
    return false
    break}
    }for(i=4; i<6; i++){if (letters.indexOf(zip.charAt(i))<1)
    {alert("Ongeldige postcode letters")
    document.UserPostcodeForm.UserPostcodeField.focus()
    return false
    break}}}  
    userpostcode = newx;
    day = new Date();
    id = day.getTime();
    url = "http://tools.locatienet.com/location/" +
    "getroute.asp?"+
    "config_id=299&" +
   	"country_start=NL&" + 
    "detailmap=on&" +
    "optfactor=90&" +
    "speedprofile=1&" +
    "naam=" + vest_name +
    "&country_stop=NL&" +
    "postcode_start=" + userpostcode + 
    "&street_stop=" + adres +
    "&city_stop=" + plaats
    eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=yes,menubar=0,resizable=yes,width=600,height=450,left = 426,top = 232');");
    return false
}