// $Id: $

var xmlhttp = false;
	
function update_stats(imageURL) {
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	
	xmlhttp.open("HEAD", "db/script/upd_url_stats.php?url="+imageURL,true);
	xmlhttp.send(null);	
	
	pageTracker._trackPageview(imageURL);
}

function follow_link(stat_URL,new_URL) {
	update_stats(stat_URL);
	
	if (typeof new_URL == "undefined") {
		new_URL = stat_URL;
	}

	newWin=window.open(new_URL,'');
	newWin.focus();
}

