var xmlHttp
var xmlHttp1
var xmlHttp2
var region

function showRegions(str,r)
{
if (r==1) {
 xmlHttp1=GetXmlHttpObject()
 xmlHttp=xmlHttp1
}
else if (r==2) {
 xmlHttp2=GetXmlHttpObject()
 xmlHttp=xmlHttp2
}
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="http://www.queerattitude.com/qa4.4.func.ajax.php"
url=url+"?f=showRegions&r="+r+"&c="+str
url=url+"&sid="+Math.random()
region=r
//if (xmlHttp.overrideMimeType) {
//    xmlHttp.overrideMimeType('text/xml');
    // See note below about this line
//}
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (region==1 && (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete"))
 {
    if (xmlHttp1.status == 200) {
        document.getElementById("region1").innerHTML=xmlHttp1.responseText
        document.getElementById("region2").innerHTML=""
    }
    else {
        alert("Problem retrieving data: " + xmlHttp1.status + " " + xmlHttp1.statusText);
    }
 }
if (region==2 && (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete"))
 { 
 document.getElementById("region2").innerHTML=xmlHttp2.responseText 
 }
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}