//thisDomain
var thisDomain_noW = window.location.hostname.replace("www.", "");
var thisDomain = thisDomain_noW.substring(0, thisDomain_noW.indexOf('.'));

//http_host
var HTTP_HOST = 'http://' + window.location.hostname + '/';
var HTTP_HOST_IMAGES = 'http://' + window.location.hostname.replace("www.", "images.") + '/';


function countHits(domain,id){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	//count ajax hit
    var queryString = "?domain=" + domain;
	ajaxRequest.open("GET", HTTP_HOST + "gals-out.php?id=" + id,true);
	ajaxRequest.send(null); 
}
