/* Click tracking oarser */
var regEx = /goto\/(.*)_(.*)/i;

var regExDown = /download\/(.*)_(.*)/i;

$(document).ready(function() {

	$("a[@href*='/goto/']").click(function() { 

		p = regEx.exec( this.href )[1];

		if( p != '' )
		{
			return clt( this, 1, p );
		}

	});
	
	$("a[@href*='/download/']").click(function() { 

		p = regExDown.exec( this.href )[1];

		if( p != '' )
		{
			return clt( this, 2, p );
		}

	});
});

function clt( obj, type, product ) {


	var tt = new Array();
	tt[0] = 'Other Site Click';
	tt[1] = 'Poker Room Click';
	tt[2] = 'Download Click';
	

	var score = "0.00";
	
	var s=s_gi(s_account);

	s.pageName = '/landing-page/' + product;

	setTimeout("s.trackDownloadLinks="+s.trackDownloadLinks,600);
	s.trackDownloadLinks=false;
	
	setTimeout("s.trackExternalLinks="+s.trackExternalLinks,600);
	s.trackExternalLinks=false;

	var uid = false;

	currDate = new Date();
	ms = currDate.getTime();
	uid = 's11l' + langId + 't' + ms + product.replace(/-/g,'');
	
	switch( type ) {
		case 2:
			uid = uid + 'd';break;
	}

	s.transactionID = uid;
	s.eVar16 = uid;
	s.prop16 = uid;
		
	s.linkTrackVars="eVar1,eVar2,eVar16,prop16,events,products,transactionID";
	s.linkTrackEvents="purchase,event1";     
	s.eVar1 = 1;
	s.eVar2 = tt[type];
	s.events="purchase,event1";
	s.products="" + tt[type] + ";" + product + ";1;" + score;

	void(s.t());
	
	s.transactionID = "";
	s.eVar16 = "";
	s.prop16 = "";
	
	if( uid != false )
	{
		goto_link = obj.href.replace( '.php', '_' + uid + '.php' );
		window.open( goto_link );

		return false;
	}
	else
	{
		return true;
	}
}