function getPage(page){
var xmlhttp=false; //Clear our fetching variable
try {
xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); // Try the first kind of ActiveX object...
} catch (e) {
try {
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); // Try the second kind of ActiveX object
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest(); // If we were able to get a working ActiveX object, start an XMLHttpRequest
}
var file = 'code/market-switch.php?loc='; // This is the path to the file we just finished making *
xmlhttp.open('GET', file + page, true); // Open the file through GET, and add the page we want to retrieve as a GET variable **
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) { // Check if it is ready to receive data
var content = xmlhttp.responseText; // The data ***
if (content){ // Make sure there is something in the content variable
document.getElementById('submain').innerHTML = content; // Change the inner content of our div to the newly retrieved content ****
}
}
}
xmlhttp.send(null); // Nullify the XMLHttpRequest
return;
} 

