if( typeof XMLHttpRequest == "undefined" ){
	
	XMLHttpRequest = function(){
		
	  try{ return new ActiveXObject("Msxml2.XMLHTTP.6.0") }catch(e){}
	  try{ return new ActiveXObject("Msxml2.XMLHTTP.3.0") }catch(e){}
	  try{ return new ActiveXObject("Msxml2.XMLHTTP") }catch(e){}
	  try{ return new ActiveXObject("Microsoft.XMLHTTP") }catch(e){}
	  throw new Error("This browser does not support XMLHttpRequest or XMLHTTP.")
	}
	;
}

var xmlhttp = new XMLHttpRequest();


function GetCountry(ip){
	
	xmlhttp.open('POST', "http://www.formyip.com/ipcountry_popup.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "ipaddresses=" + ip ;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	alert(xmlResponse);	
}

function SetRating(rateID, galleryID, galleryItemID, rate, lang) {
	
	xmlhttp.open('POST', "rate.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "rateID=" + rateID + "&galleryID=" + galleryID + "&galleryItemID=" + galleryItemID + "&rate=" + rate + "&lang=" + lang;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
		
		document.getElementById(galleryItemID + "_div").innerHTML = xmlResponse;
	}
}
