
function webinarSubmit(postUrl) {

    if (!postUrl) postUrl = "pdfRegister.php";

    var vld = $("#pdfForm").valid();
    if (! vld) { 
        return false;
    }

    var fields = ["name", "title", "company", "email", "phone", "webinarId"];  var values = {};
    for (var i = 0; i < fields.length; i++) {
        values[fields[i]] = $("#"+fields[i])[0].value;
    }

    var html = $.ajax({
      url: postUrl,
      async: false,
      data: values,
      success: webinarSuccess,
      error: webinarError
     }).responseText;
}

function webinarSuccess() {
    DvLayerHide('DvLayer01','DvLayerCon_Img01');
    DvLayerOpen('DvLayer01','DvLayerCon_Img02','90');
}

function webinarError(request, error, thrown) {
    alert("Server error: " + request.statusText);
}

var formTarget='';

function pdfForm() {
    formTarget = 'pdf';
    $("#formHeader").html("PDF Download Request");
    $("#formTitle").html("Please fill out this form to download the PDF");
    DvLayerOpen('DvLayer01','DvLayerCon_Img01','90');
}

function webinarForm(id) {
    formTarget = 'webinar';
    $("#formHeader").html("Download Request: " + id);
    $("#formTitle").html("Please fill out this form to download the requested document");
    if (id) {
        $("#webinarId").val(id);
    }
    DvLayerOpen('DvLayer01','DvLayerCon_Img01','90');
}
