$=jQuery;
$(document).ready(function(){
	FB.init("d012b067e3d901a4d8054904662d3e40","/xd_receiver.htm");
	$('.odds_r').hover(
		function(){
			if($(this).children('.oddsfb').length==0){
				var ih='22px';
				var iw='110px';
				var bookie = $(this).siblings('td').eq(0).children('a').html();
				var bookie_id = $(this).siblings('td').eq(0).attr("bookie");
				var game_id = $(this).siblings('td').eq(0).attr("game");
				var odds1 = $(this).siblings('td').eq(1).children('a').html();
				var oddsx = $(this).siblings('td').eq(2).children('a').html();
				var odds2 = $(this).siblings('td').eq(3).children('a').html();
				var iframe1 = '<iframe onload="$(this).show();$(this).next().hide();" src="http://www.facebook.com/plugins/like.php?href=www.bold.dk%2Fodds%2F%3Femp%3D'+game_id+'-1-'+odds1+'-'+bookie_id+'&amp;layout=button_count&amp;show_faces=false&amp;width='+iw+'&amp;action=recommend&amp;colorscheme=light&amp;height='+ih+'" scrolling="no" frameborder="0" style="display:none;border:none; overflow:hidden; width:'+iw+'; height:'+ih+';" allowTransparency="true"></iframe><img src="http://static.bold.dk/img/v2/common/wait_animated.gif" style="margin-top: 2px; margin-left: 20px;"/>';
				var iframex = '<iframe onload="$(this).show();$(this).next().hide();" src="http://www.facebook.com/plugins/like.php?href=www.bold.dk%2Fodds%2F%3Femp%3D'+game_id+'-X-'+oddsx+'-'+bookie_id+'&amp;layout=button_count&amp;show_faces=false&amp;width='+iw+'&amp;action=recommend&amp;colorscheme=light&amp;height='+ih+'" scrolling="no" frameborder="0" style="display:none;border:none; overflow:hidden; width:'+iw+'; height:'+ih+';" allowTransparency="true"></iframe><img src="http://static.bold.dk/img/v2/common/wait_animated.gif" style="margin-top: 2px; margin-left: 20px;"/>';
				var iframe2 = '<iframe onload="$(this).show();$(this).next().hide();" src="http://www.facebook.com/plugins/like.php?href=www.bold.dk%2Fodds%2F%3Femp%3D'+game_id+'-2-'+odds2+'-'+bookie_id+'&amp;layout=button_count&amp;show_faces=false&amp;width='+iw+'&amp;action=recommend&amp;colorscheme=light&amp;height='+ih+'" scrolling="no" frameborder="0" style="display:none;border:none; overflow:hidden; width:'+iw+'; height:'+ih+';" allowTransparency="true"></iframe><img src="http://static.bold.dk/img/v2/common/wait_animated.gif" style="margin-top: 2px; margin-left: 20px;"/>';
				$(this).append('<div class="oddsfb" style="position:absolute;z-index:2"><div style="position:absolute;top:-16px;left:+15px;height:20px;width:10px;"><img src="http://static.bold.dk/img/v2/common/grey-left.png" /></div><div style="padding:5px;padding-bottom:1px;border:1px solid #ddd;position:absolute;background-color:#fff;top:-50px;left:+25px;height:85px;width:175px;"><div><b style="padding-bottom:4px;">Anbefal '+bookie+' odds</b></div><div class="oddsfb_odds">1: '+odds1+'</div><div class="oddsfb_button">'+iframe1+'</div><div class="oddsfb_odds">X: '+oddsx+'</div><div class="oddsfb_button">'+iframex+'</div><div class="oddsfb_odds">2: '+odds2+'</div><div class="oddsfb_button">'+iframe2+'</div></div></div>');
			}else{
				$(this).children('.oddsfb').show();
			}
		}
		,function(){
			$(this).children('.oddsfb').hide();
		})
})