﻿function fillTextBox(place) {
    switch(place){
        case 'name':
            $(".delName").val($(".newName").val());
            if ($(".invoName").length) {
                $(".invoName").val($(".newName").val());
            }
            break;
        case 'surname':
            $(".delSurname").val($(".newSurname").val());
            if ($(".invoSurname").length) {
                $(".invoSurname").val($(".newSurname").val());
            }
            break;
        default:
            break;
        }   
}


function postal(id, no) {

    $.ajax({
        type: "POST",
        url: "/preview.asmx/PreviewWS",
        data: '{"id": \"' + id + '\", "no" : \"' + no + '\"}',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(msg) {
            if (no != '5')
                $('#preview #content').html(msg.d);
            else {
                $('.RadCalendar').show();
            }
        },
        error: function(msg) {
            $('#preview').html("Error " + msg.d);
        }
    });
}