// JavaScript Document
function check(value) {
var value = document.getElementById('monthlycost').value;
if (value == 'PAYG') {
document.href = '/mobile-broadband/index.php#paygo';	
}
}
function handleHttpResponseResults() {

    if (http.readyState == 4) {
        // spit info out
        var text =  http.responseText;
        document.getElementById('viewresults').innerHTML = text;

    }

}


//  this is now he main ajax function you now add the url and parimeters as one link and it will call it
function resultCall(url) {
    var friendurl = url;
    http.open('GET', friendurl , true);
    http.onreadystatechange = handleHttpResponseResults;
    http.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');
    http.send('null');
}


// this builds the url strinf and then sends information for the results to display
function CallSearch () {
    var url = '/mobile-broadband/index.php?';
    speed        = document.getElementById('speed').value;
    download     = document.getElementById('download').value;
    modemcost    = document.getElementById('modemcost').value;
    monthlycost  = document.getElementById('monthlycost').value;
    clength      = document.getElementById('clength').value;
    network      = document.getElementById('network').value;
	gift         = document.getElementById('gift').value;
	supp         = document.getElementById('sup').value;

//    sendurl = url + 
    sendurl = url + 'speed='+speed+'&download='+download+'&modemcost='+modemcost+'&monthlycost='+monthlycost+'&clength='+clength+'&sup='+supp+'&network='+network+'&gift='+gift+'&ajax=1';
    resultCall(sendurl);
}



function getHTTPObject() {
    var xmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
    try {
    xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
    } catch (e) {
    try {
    xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
    } catch (E) {
    xmlhttp = false;
    }
    }
    @else
    xmlhttp = false;
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
        try {
            xmlhttp = new XMLHttpRequest();
        } catch (e) {
            xmlhttp = false;
        }
    }
    return xmlhttp;
}
var http = getHTTPObject();