var bestlists = new Object();
bestlists.titan = '<li>Nr. 1 beoordeelde online poker site</li><li>150% Bonus tot $500!</li><li>Geweldige software & aanbiedingen</li>';
bestlists.pacific = '<li>100% Bonus tot $400</li><li>Veel vis aan de tafels</li><li>Geanimeerde hand herhaling</li>';
bestlists.fulltilt = '<li>Accepteert Nederlandse pokerspelers</li><li>100% Bonus tot $600</li><li>Speel met de professionals</li>';
bestlists.bwin = '<li>100% Bonus tot $100</li><li>OnGame netwerksite</li><li>Software in het Nederlands</li>';
bestlists.partypoker = '<li>100% Bonus tot $500</li><li>Accepteert Nederlandse pokerspelers</li><li>Geweldige software & aanbiedingen</li>';

$(function() {
		   
	BrowserDetect.init();
	if (BrowserDetect.browser == 'Safari' || BrowserDetect.browser == 'Chrome') {
		document.body.className='webkit';//raw for speed
		$('#best5sites ol li').each(function(i){
			$(this).prepend('<em>' + (i+1) + '.</em>');
		});
	}		  

	$.preloadImages('http://www.pokersites.com/nl/imgs/screen-titan.jpg','http://www.pokersites.com/nl/imgs/logo-titan.jpg','http://www.pokersites.com/nl/imgs/screen-pacific.jpg','http://www.pokersites.com/nl/imgs/logo-pacific.jpg','http://www.pokersites.com/nl/imgs/screen-fulltilt.jpg','http://www.pokersites.com/nl/imgs/logo-fulltilt.jpg','http://www.pokersites.com/nl/imgs/screen-partypoker.jpg','http://www.pokersites.com/nl/imgs/logo-partypoker.jpg','http://www.pokersites.com/nl/imgs/screen-bwin.jpg','http://www.pokersites.com/nl/imgs/logo-bwin.jpg');

		$('ol li').mouseover(function() {
		$(this).parent().children('li').removeClass('active');
		var whoami = $(this).attr('class');
		$(this).addClass('active');
		$('#theLink').attr('href', $(this).children('a').attr('href'));
		$('#theLink img.screen').attr('src', '/nl/imgs/screen-' + whoami + '.jpg');
		$('#theLink img.logo').attr('src', '/nl/imgs/logo-' + whoami + '.jpg');
		$('#best5sites ul').html(bestlists[whoami]);
	});

	$('#best5sites').mouseleave(function() {
		$('#best5sites li').removeClass('active');
		$('#best5sites li.titan').addClass('active');
		$('#theLink').attr('href', $(this).children('li.titan a').attr('href'));
		$('#theLink img.screen').attr('src', '/nl/imgs/screen-titan.jpg');
		$('#theLink img.logo').attr('src', '/nl/imgs/logo-titan.jpg');
		$('#best5sites ul').html(bestlists['titan']);
	});
	});




var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		}]
};