function BannerTrack(url, crb) {
	this.trk_mems = new Tracking();
	this.trk_mems.initFCookie();
	var index = (this.trk_mems.creferer.indexOf(":") != -1) ? this.trk_mems.creferer.indexOf(":") + 1 : ((this.trk_mems.creferer.indexOf("%3A") != -1) ? this.trk_mems.creferer.indexOf("%3A") + 3 : -1);
	this.csrc= index != -1 ? this.trk_mems.creferer.substr(index) : '';
	if (typeof member!="undefined" && typeof profile!="undefined") {
			this.trk_mems.init(member, profile);
	}

	this.csrc='';
	this.ctag='';
	this.crb=crb;
	this.urldwnld=url;
	this.exiturl = this.trk_mems.readCookie("banner_exiturl");
	this.openexitstatus=1;


	this.trckImg = function(_url) {
		var url=_url+(_url.indexOf("?") == -1 ? "?": "&")+this.trk_mems.getQuery();

		try {
			var img=document.createElement('img');
			img.setAttribute('src', url);
			img.setAttribute('width', 0);
			img.setAttribute('height', 0);
			img=document.body.appendChild(img);
			img.style.visibility="hidden";
			img.style.display="none";
			return true;
		}
		catch (ex) { }
		return false;
	}

	this.trackImg = function()
	{

		if (this.trk_mems.readCookie('make_impr') != '') {
			return this.trckImg('http://banner.vegasred.com');
		}
	}

	this.isURL = function(str) {
		if (str == '@' || str == '-') {
			return false;
		}
		if (typeof str == "string") {
			return (str.search(/^(http:\/\/)?[a-zA-Z0-9][a-zA-Z0-9\.\-_]+/) != -1);
		} else {
			return false;
		}
	}

	this.exitPage = function(lang, msg)
	{
		if (this.openexitstatus==0 || this.exiturl=="-") return false;

		var exitsiteurl="http://banner.europacasino.com/cgi-bin/redir.cgi?id=N"+"&member="+this.trk_mems.member+"&profile=exit";
		var exiturl = "";
		if (this.isURL(this.exiturl)) {
			if (this.exiturl.substr(0, 4) == 'http') {
				exiturl=this.exiturl;
			} else {
				exiturl='http://' + this.exiturl;
			}
		} else {
			exiturl="http://www.vegasred.com/trcpromo-"+(this.exiturl=="@" ? "campx-"+this.trk_mems.member+"-" : this.trk_mems.member+"-exit-")+"pmail4-"+lang;
		}

		if(confirm(msg)) {
			window.open(exitsiteurl,'','toolbar, location=yes, width=814, height=728, menubar=yes, status=yes, resizable=yes, scrollbars=yes, directories=yes');
		} else {
			window.open(exiturl,'exitwin','toolbar, location=yes, width=850, height=728, menubar=yes, status=yes, resizable=yes, scrollbars=yes, directories=yes');
		}
		return true;
	}

	this.updateRef = function(cr) {
		if (this.csrc || this.ctag || (this.crb && cr)) {
			var p= this.csrc ? 'source:'+escape(this.csrc)+';' : '';
	   		p+= this.ctag ? 'tag:'+escape(this.ctag)+';' : '';
			p+=(this.crb && cr) ? 'dp:'+escape(this.crb)+'+'+escape(cr) : '';
			this.trk_mems.creferer = p;
		}
	}

	this.download = function(cr, win) {
		this.updateRef(cr);
		this.openexitstatus=0;
		win.location.href=this.urldwnld + (this.urldwnld.indexOf('?') > 0 ? '&' : '?') + this.trk_mems.getQuery();
		return true;
	}
}