function Report(website, div, url, name) {

	this._website = website;
	this.div = (div) ? div : "report";
	this._url = (url == undefined) ? "http://the7thart.dreamhosters.com/reports/php/" : url;
	this._name = (name == undefined) ? "report" : name;
	
	this._visitid = 0;
	
	this.loaded = false;
	
	
	this._getCookie = function(name) {
	
		var start = document.cookie.indexOf(name + "=");
		var len = start + name.length + 1;
		
		if((!start) && (name != document.cookie.substring(0, name.length))) return(null);
		else if(start == -1) return(null);
		
		var end = document.cookie.indexOf(";", len);
		if(end == -1) end = document.cookie.length;
		
		return(unescape(document.cookie.substring(len, end)));
		
	}
	
	this._setCookie = function(name, value) {
		
		var today = new Date();
		today.setTime(today.getTime());
		var expires_date = new Date(today.getTime() + (3650 * 1000 * 60 * 60 * 24));
		
		document.cookie = name + "=" + value + ";expires=" + expires_date.toGMTString();
		
	}
	
	this._getUser = function() {
		return(this._getCookie("user"));
	}
	this._saveUser = function(id) {
		this._setCookie("user", id);
	}
	
	this.setVisitId = function(visitid, userid) {
		
		this._visitid = visitid;
		
		this._userid = userid;
		this._saveUser(userid);
		
		this.loaded = true;
		if(typeof(this.onLoad) == "function") this.onLoad();
		
	}
	
	this.getBasicQS = function() {
		var qs =  this._url + "report.php?";
		qs += 'r=' + (new Date() * 1);
		qs += "&visitid=" + this._visitid;
		qs += "&userid=" + this._userid;
		qs += "&objname=" + this._name + "&action=";
		return(qs);
	}
	
	
	this.noFlash = function(version) {
		if(!visitid || !userid || this.loaded) return;
		this.setVisitId(visitid, userid);
		document.getElementById(this.div).innerHTML += '<img src="' + this.getBasicQS() + 'userinfo&flashversion=' + version + '&noflash=1">';
	}
	this.start = function(version) {
		if(!visitid || !userid || this.loaded) return;
		this.setVisitId(visitid, userid);
		document.getElementById(this.div).innerHTML += '<img src="' + this.getBasicQS() + 'userinfo&flashversion=' + version + '">';
	}
	
	this._userid = this._getUser();
	if(!this._userid) this._userid = 0;
	
	document.write('<script language="javascript" src="' + this.getBasicQS() + 'init&website=' + this._website + '"></script>');
	document.write('<div id="' + this.div + '" style="width:1px; height:1px; overflow:hidden; position:absolute; top:-100px;"></div>');

}