//
//	Javascript GEO functions
//

function geo_country_change(c)
{
	var stateDiv=document.getElementById('geo_state_select_span');
	if(stateDiv!=null)
	{
		var xmlGeo=null;

		// Try Firefox, Opera 8.0+, Safari
		// Then Try Internet Explorer
		try { xmlGeo=new XMLHttpRequest(); }
		catch (e) {
			try { xmlGeo=new ActiveXObject("Msxml2.XMLHTTP"); }
			catch (e) { xmlGeo=new ActiveXObject("Microsoft.XMLHTTP"); }
		}
		if (xmlGeo!=null)
		{
			var url= "index.php?rnd="+(Math.random()*100000)+"&do=geo_state_select&country="+c.value;
			xmlGeo.open("POST",url,false);
			xmlGeo.send(null);
			stateDiv.innerHTML = xmlGeo.responseText;

			var stateTagSpan = document.getElementById('geo_state_tag');
			if(stateTagSpan != null)
			{
				var url= "index.php?rnd="+(Math.random()*100000)+"&do=geo_state_tag&country="+c.value;
				xmlGeo.open("POST",url,false);
				xmlGeo.send(null);
				stateTagSpan.innerHTML = xmlGeo.responseText;
			}
		}
	}
}
