﻿

/// <reference path="submitreq.js" />

/// <reference path="../boxy/jquery-1.2.3.min.js" />


function submitForm() {

    var fname, lname, emailid, phoneno, postcode, mobile, address, houseno,  stairliftType;
    fname = document.getElementById('txtname').value;
    lname = document.getElementById('txtLastname').value;
    emailid = document.getElementById('txtEmail').value;
    phoneno = document.getElementById('txtTel').value;
    postcode = document.getElementById('txtPostcode').value;
    mobile = document.getElementById('txtMobile').value;

    address = document.getElementById('txtaddress').value;
    houseno = '';  //document.getElementById('txtHouseno').value;

    var dduserType = document.getElementById('dduserType').value;


    stairliftType = document.getElementById('ddstairlifttype').value;


    var leadtype = ''; // document.getElementById('leadtype').value;

    if (fname == '' ||  phoneno == '' || postcode == '' ) {
        
        alert('Please provide us with \n->Name\n->Telephone\n->Postcode');
        return false;
    }else {

        // hide button to avoid double click
        document.getElementById('imgSubmit').style.display = 'none';
        document.getElementById('divprocessing').style.display = 'block';


    //    $.blockUI({ message: '<h1><img src="images/ajax-loader.gif" /> Processing your request just a moment...</h1>' });



    var formType = "stairliftForm";
        
        
        var processAcornURL = 'process.aspx?form=' + formType + '&fname=' + fname
                        + '&lname=' + lname + '&email=' + emailid + '&phoneno=' + phoneno
                        + '&postcode=' + postcode + '&mobile=' + mobile + '&address='
                        + address + '&hno=' + houseno + '&usr=' + dduserType 
                        + '&lifttype=' + stairliftType + '&leadtype=' + leadtype + '';


       // alert(processAcornURL);
        //window.location = 'thankyou.aspx';

        getAjaxCall(processAcornURL);
      //  $.unblockUI();

        //parent.window.location = processAcornURL;
      //  parent.window.location = 'thankyou.aspx';
        return true;
    }

}



