function getGpsFile(){
    var navigator = document.getElementById('navigator').value;
    var theForm = document.getElementById("leveransForm");
    var type;
    var completeUrl;
    var va = new Validator();
    var er = new ErrorRenderer();
    er.clearAll();

    if(document.getElementById('postombud').checked){
        type = "Postombud_";
        //csref = "gps_zip_postombud";
    }else if(document.getElementById('foretagscenter').checked){
        type = "Foretagscenter_";
        //csref = "gps_zip_foretagscenter";
    }else if(document.getElementById('frimarksombud').checked){
        type = "Frimarksombud_";
        //csref = "gps_zip_frimarksombud";
    }else if(document.getElementById('minuten').checked){
        type = "Brevlada_sistaminuten_";
        //csref = "gps_zip_sistam";
    }else if(document.getElementById('drivein').checked){
        type = "Brevlada_drivein_";
        //csref = "gps_zip_drivein";
    }

    if(theForm.navigator.value == ""){
        var errorEmpty = new Error(theForm.navigator, 'Här måste du välja en navigator');
        va.addError(errorEmpty);
    }

    if(!va.isRadioSelected(theForm.listType)){
        var errorEmpty = new Error(theForm.listType, 'Här måste du välja lista');
        va.addError(errorEmpty);
    }

    if(va.getErrors().length > 0){
        return er.displayErrors(theForm, va.getErrors());
    }else{
        //document.location.onclick = "if(typeOf Instadia sendEvent == 'function') {Instadia sendEvent('011yx', 'download # user clicked to download '" + type + navigator + ".zip');}";
        document.location.href = "http://www.pois.se/customers/se/posten/" + type + navigator + ".zip";
    }
}

function getGpsFileTest(){
    //alert("getGpsFileTest");
    var navigator = document.getElementById('navigator').value;
    var theForm = document.getElementById("leveransForm");
    var type;
    var completeUrl;
    var va = new Validator();
    var er = new ErrorRenderer();
    er.clearAll();

    if(!va.isListSelected(theForm.navigator)){
        var errorEmpty = new Error(theForm.navigator, 'Här måste du välja en navigator');
        va.addError(errorEmpty);
    }

    if(!va.isRadioSelected(theForm.listType)){
        var errorEmpty = new Error(theForm.listType, 'Här måste du välja lista');
        va.addError(errorEmpty);
    }

    if(va.getErrors().length > 0){
        return er.displayErrors(theForm, va.getErrors());
    }else{
        //document.location.onclick = "if(typeOf Instadia sendEvent == 'function') {Instadia sendEvent('011yx', 'download # user clicked to download '" + type + navigator + ".zip');}";
        //document.location.href = "http://www.pois.se/customers/se/posten/" + type + navigator + ".zip";
        document.location.href = "http://online.pois.se/NavfileHandler.ashx?i=1&o=" + va.getListValue() + "&c=4&l=" + va.getRadioValue();
    }
}


function getUniqueGpsFile(ssID){
    var navigator = document.getElementById('navigator').value;
    var theForm = document.getElementById("leveransForm");
    var type = "Postombud_";
    var completeUrl;
    var va = new Validator();
    var er = new ErrorRenderer();
    er.clearAll();

    if(theForm.navigator.value == ""){
        var errorEmpty = new Error(theForm.navigator, 'Här måste du välja en navigator');
        va.addError(errorEmpty);
    }

    if(va.getErrors().length > 0){
        return er.displayErrors(theForm, va.getErrors());
    }else{
        document.location.href = "http://www.pois.se/customers/se/posten/ssd/" + type + ssID + "_" + navigator + ".zip";
    }
}

function getGoogleFile(){
    var theForm = document.getElementById("leveransForm");
    var type;
    var va = new Validator();
    var er = new ErrorRenderer();
    er.clearAll();

    if(document.getElementById('postombud').checked){
        type = "Postombud_google_kml";
    }else if(document.getElementById('foretagscenter').checked){
        type = "Foretagscenter_google_kml";
    }else if(document.getElementById('frimarksombud').checked){
        type = "Frimarksombud_google_kml";
    }else if(document.getElementById('minuten').checked){
        type = "Brevlada_sistaminuten_google_kml";
    }else if(document.getElementById('drivein').checked){
        type = "Brevlada_drivein_google_kml";
    }


    if(!va.isRadioSelected(theForm.listType)){
        var errorEmpty = new Error(theForm.listType, 'Här måste du välja lista');
        va.addError(errorEmpty);
    }

    if(va.getErrors().length > 0){
        return er.displayErrors(theForm, va.getErrors());
    }else{
        document.location.onclick = "if(typeOf Instadia sendEvent == 'function') {Instadia sendEvent('011yx', 'download # user clicked to download '" + type + navigator + ".zip');}";
        document.location.href = "http://www.pois.se/customers/se/posten/" + type + ".zip";
    }
}
