/*# this script is used by products.php, product_details.php to update the current region then refresh the page*/// create request objectfunction createXMLHttpRequest() {	    var ua;	    if(window.XMLHttpRequest) {        try {            ua = new XMLHttpRequest();        } catch(e) {            ua = false;        }      } else if(window.ActiveXObject) {        try {           ua = new ActiveXObject("Microsoft.XMLHTTP");        } catch(e) {           ua = false;        }    }    return ua;}	var req = createXMLHttpRequest();// handle response, populate fields with event infofunction handleResponse() {	    if(req.readyState == 4){        var response = req.responseText;		// if update successful        if(response == 'region updated') {				// refresh page to load new prices for this region			window.location.reload(true);         }    }}// called by drop down menu to update current regionfunction updateRegion(region) {		// make sure that ajax request object is support by browser	if(req){		req.open("post", 'region/region_control.php', true);		req.onreadystatechange = handleResponse; 		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");		req.send('curr_region=' + escape(region));		// request object not supported (for example IE(mac)) so set via redirect with querystring	} else {	//	window.location.href = '?set_region=' + region; 		alert("Sorry, it looks as if you are using an outdated browser. \n\nPlease upgrade to a recent version of Safari (for Mac), Firefox or Internet Explorer (for Windows) to insure full compatibility with our website.");	}}