window.onload=CheckAgent;

var request = false;
try {
 request = new XMLHttpRequest();
} catch (trymicrosoft) {
 try {
   request = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (othermicrosoft) {
   try {
     request = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (failed) {
     request = false;
   }
 }
}
if (!request)
alert("Error initializing XMLHttpRequest!");
/********************************************/
var request2 = false;
try {
 request2 = new XMLHttpRequest();
} catch (trymicrosoft) {
 try {
   request2 = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (othermicrosoft) {
   try {
     request2 = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (failed) {
     request2 = false;
   }
 }
}
if (!request2)
alert("Error initializing XMLHttpRequest!");

/******************/
/* Trim functions */
/******************/
function LTrim( value ) {
var re = /\s*((\S+\s*)*)/;
return value.replace(re, "$1");
}
function RTrim( value ) {
var re = /((\s*\S+)*)\s*/;
return value.replace(re, "$1");
}
function trim( value ) {
return LTrim(RTrim(value));
}
/*************************/
/* End of trim functions */
/*************************/

function easy(){
window.location = "Easy.html";
}

function comprehensive(){
window.location = "Comprehensive.html";
}

function accurate(){
window.location = "Accurate.html";
}

function prices(){
window.location = "Prices.html";
}

function consultancy(){
window.location = "Consult.html";
}

function CheckAgent(){
agent = window.location.search.substring(1);
if (!agent || agent.length != 3) return;

url = "PHP/storeAgent.php?agent=" + agent;
request.open("GET", url, true);
request.send(null);
}