// JavaScript Document
var CustomURL=location.href;

if(window.location.host.indexOf("www")<0&&window.location.host.indexOf("bbopokertables")>=0)
{	
	if(window.location.host.indexOf("bbopokertables.com")>=0)
	{
		window.location.href="http://www.bbopokertables.com"+window.location.pathname;
	}
	else
	{
		window.location.href="http://www.bbopokertables.ca"+window.location.pathname;	
	}
}



document.write('<div class="live_person" id="live_person">');
document.write('<li>');
document.write('<a id="_lpChatBtn" href="https://server.iad.liveperson.net/hc/28614741/?cmd=file&file=visitorWantsToChat&site=28614741&byhref=1&imageUrl=https://www.bbopokertables.com/liveperson" target="chat28614741"  onClick="lpButtonCTTUrl = \'https://server.iad.liveperson.net/hc/28614741/?cmd=file&file=visitorWantsToChat&site=28614741&imageUrl=https://www.bbopokertables.com/liveperson&referrer=\'+escape(document.location); lpButtonCTTUrl = (typeof(lpAppendVisitorCookies) != \'undefined\' ? lpAppendVisitorCookies(lpButtonCTTUrl) : lpButtonCTTUrl); lpButtonCTTUrl = ((typeof(lpMTag)!=\'undefined\' && typeof(lpMTag.addFirstPartyCookies)!=\'undefined\')?lpMTag.addFirstPartyCookies(lpButtonCTTUrl):lpButtonCTTUrl);window.open(lpButtonCTTUrl,\'chat28614741\',\'width=475,height=400,resizable=yes\');return false;">');
document.write('<img src="https://server.iad.liveperson.net/hc/28614741/?cmd=repstate&site=28614741&channel=web&&ver=1&imageUrl=https://www.bbopokertables.com/liveperson" name="hcIcon" alt="Chat Button" border=0>');
document.write('</a>');
document.write('</li>');
document.write('</div>');

var lpMTagConfig = {'lpServer' : "server.iad.liveperson.net",'lpNumber' : "28614741",'lpProtocol' : "https"}; function lpAddMonitorTag(src){if(typeof(src)=='undefined'||typeof(src)=='object'){src=lpMTagConfig.lpMTagSrc?lpMTagConfig.lpMTagSrc:'/hcp/html/mTag.js';}if(src.indexOf('http')!=0){src=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+src+'?site='+lpMTagConfig.lpNumber;}else{if(src.indexOf('site=')<0){if(src.indexOf('?')<0)src=src+'?';else src=src+'&';src=src+'site='+lpMTagConfig.lpNumber;}};var s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','iso-8859-1');s.setAttribute('src',src);document.getElementsByTagName('head').item(0).appendChild(s);} if (window.attachEvent) window.attachEvent('onload',lpAddMonitorTag); else window.addEventListener("load",lpAddMonitorTag,false);




function get_height(mclass)
{
	var mheight="";
	
	if(mclass=="menu_1")
	{
		mheight="260px";
	}
	else if(mclass=="menu_2")
	{
		mheight="221px";
	}
	else if(mclass=="menu_5")
	{
		mheight="75px";
	}
	
	return mheight;	
}

function hover_links_over(index){
	$(index).children("ul").css("height","0px");
	$(index).children("ul").dequeue().animate({height:get_height($(index).attr("class"))},500);
	//}

}

function hover_links_out(index){

		$(index).children("ul").dequeue().animate({height:'0px'},500,function(){$(this).css("display","none");});


}


function hover_links1_over(){
	//if(hover_link_sign){
	//hover_link_sign=false;
	$(this).children("dl").css("height","0px");
	$(this).children("dl").animate({height:'25px'},500);
	//}

}

function hover_links1_out(){

		$(this).children("dl").animate({height:'0px'},400,function(){$(this).css("display","none");});


}

function top_area_change()
{
	if(window.location.host.indexOf("ca")<0)
	{
		//usa	
	}
	else
	{
		$(".top_section .area").css("display","none");	
	}

	$(".top_section .contact_us").after('<div class="change_area"><ul><li><a href="http://www.bbopokertables.com">USA</a></li><li><a href="http://www.bbopokertables.ca">Canada</a></li></ul></div>');
	
	$(".top_section").css("position","relative");
	$(".change_area").css({"position":"absolute","right":"10px","top":"0px","width":"119px"});
	
	$(".change_area li:eq(0) a").css({"background":"url(/images/usaca_button.jpg)","width":"57px","height":"31px","float":"left","line-height":"1000px","overflow":"hidden"});
	
	$(".change_area li:eq(1) a").css({"background":"url(/images/usaca_button.jpg) 57px 0","width":"57px","height":"31px","float":"left","line-height":"1000px","overflow":"hidden","margin-left":"5px"});
	
	if(window.location.host.indexOf("ca")<0)
	{
		//usa	
		$(".change_area li:eq(0) a").css({"background-position":"0 0"});
		$(".change_area li:eq(1) a").css({"background-position":"57px -31px"});
		$(".change_area li:eq(1) a").hover(function(){
			$(".change_area li:eq(1) a").css({"background-position":"57px 0px"});
		},function(){
			$(".change_area li:eq(1) a").css({"background-position":"57px -31px"});
		});
	}
	else
	{
		$(".change_area li:eq(0) a").css({"background-position":"0 -31px"});
		$(".change_area li:eq(1) a").css({"background-position":"57px 0px"});
		$(".change_area li:eq(0) a").hover(function(){
			$(".change_area li:eq(0) a").css({"background-position":"0 0"});
		},function(){
			$(".change_area li:eq(0) a").css({"background-position":"0 -31px"});
		});
	}
}

$(function(){

$("li:contains('Chairs discounted')").css("display","none");

$("#facebook_google").html('<p style="float:left;padding:0px;margin:0px;margin-left:5px;margin-right:5px;"><iframe src="http://www.facebook.com/plugins/like.php?href='+escape(location.href.replace("localhost:8022","www.bbopokertables.com")).replace(/\//g,"%2F")+'&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></p><p><g:plusone></g:plusone></p>');


$("div.video_text").append('<p><iframe src="http://www.facebook.com/plugins/like.php?href='+escape(location.href.replace("localhost:8022","www.bbopokertables.com")).replace(/\//g,"%2F")+'&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></p>');

//$(".menu_1 li:eq(0)").after("<li><a href=\"/Gen_III_Limited_Edition.html\">Gen III Pro - Limited Edition Special</a></li>");
//alert(window.location.pathname);
if(window.location.pathname!="/"&&window.location.pathname!="/index.html")
{
	//alert(window.location.href.indexOf("index.html"));
$("div.top").after('<h1 style="color:#999; padding:10px 0 10px 80px; float:left;font-size:11px; font-weight:normal;margin:0px;" class="snav">Popular Searches: <a href="/poker_tables.html">Poker Tables</a>  /  <a href="/casino-x2.html">Professional Poker Tables</a>  /  <a href="/Rockwell.html">Furniture Poker Tables</a>  /  <a href="/albatross_poker_table.html">Dining Poker Tables and Chairs</a>  /  <a href="/pokertables/index.php?main_page=index&cPath=19_24">Sale Poker Tables</a></h1>');
}


top_area_change();
$("div.custom ul li:eq(5)").html('<a href="http://www.bbopokertables.com/blog/">BBO Poker Tables Blog</a>');
$("div.poker ul li:eq(6) a").css("color","#f00");

$.post("/default.asp?component=log&param=tracking",{request_url:location.href});
//alert($("li.menu_1 li").length);
if($("li.menu_1 li").length==14)
{
	$("li.menu_1 li:eq(12)").remove();
	$("li.menu_1 ul").append('<li><a href="javascript:" class="h3">Matching Poker Chairs ></a></li><li><a href="/Premium-Poker-Table-Chairs.html">Premium Poker Table Chairs - <span style="color:#900;">NEW</span> High End Chairs</a></li><li><a href="/poker_table_chair_black.html">Poker Chair - Matching Furniture Style</a></li>');
}
//$(".menu_5 ul li:eq(2)").remove();
$(".menu_5 ul li").remove();
$(".menu_5 ul").css("width","250px");
$(".menu_5 ul").append('<li><a href="/videos.html">Watch BBO Videos</a></li><li><a href="/playing-surfaces.html">How to Pick a Playing Surface - FAQ</a></li><li><a href="/shipping-info.html">Additional Shipping Info - FAQ</a></li><li><a href="/table-shapes.html">What\'s the Best Shape for Me? - FAQ</a></li><li><a href="http://www.Facebook.com/BBOPokerTables" target="_blank">Play on our Facebook</a></li><li><a href="/blog/">Read Stuff on Our Blog</a></li>');
$(".menu_1 li:contains('Royale')").remove();
//$("div.poker ul").append('<li><a href="/SanTurkey-Poker-Table-Giveaway.html" target="_self" class="red">San-Turkey Holiday Giveaway!</a></li>');
$("div.bbo ul li:eq(5)").remove();
$("div.bbo ul li:eq(0)").after('<li><a href="/faq.html" target="_self" class="">FAQ/Poker Table Info</a></li>');
$("div.custom ul").prepend('<li><a href="http://www.resellerratings.com/store/BBO_Poker_Tables" target="_blank">Customer Reviews</a></li>');
$("div.bbo ul li:eq(5)").html('<a href="/become-an-international-distributor.html" target="_self" class="">International Distributors</a>');
$("div.bbo ul li:eq(6)").remove();
$("div.bbo ul li:eq(4)").after('<li><a href="/Dealers.html" target="_self" class="">USA Poker Table Dealers</a></li>');
//$("div.poker ul").append('<li><a href="/SanTurkey-Poker-Table-Giveaway.html" target="_self" class="red">San-Turkey Holiday Giveaway!</a></li>');
$(".menu_1 ul li:eq(5) a").html("Casino X2 - Professional Card Room Table - <span style='color:#c00;'>CLOSEOUT</span>");
$(".menu_1 ul").css("width","350px");
$(".menu_1 ul li a").css("width","330px");
$(".menu_1 ul li:eq(10)").remove();
$("div.bottom div div:contains('2011')").html("2012 &copy; Copyright BBOPokerTables.com");
$(".similar ul li .title").each(function(data){
													 // alert($(this).html());
												if($(this).text()=="Casino X2")
												{
													$(this).next().text("MSRP $1399.00");
													$(this).next().css("text-decoration","line-through");
													$(this).next().after("<div class='price' style='color:#900;font-weight:bold;'><font style=\"color:#f00;\">$839 - CLOSEOUT</font></div>");
												}
												
												 
												 });
});



$(function(){
		//if(v5_sale_start()){v5_sale();}
		$("#.bottom_main_links li:last-child").css("border","none");
		var now=new Date();
		var date2=Date.parse("2012-1-2 00:00:00".replace(/-/g,"/"));
		if(now<date2)
		{
			$.getScript("/template/holiday/2011-11_12/holiday.js");			
		}
		else
		{
			$("div.promotion").html('<a href="/v5series.htm"><img src="/template/upload/file/2012-2/v5-clearance.png" alt="" border="0"/></a>');
			}
}
);


function v5_sale_start()
{
	var date1=Date.parse("2011-10-15 0:0:0".replace(/-/g,"/"));
var date2=Date.parse("2011-10-17 0:0:0".replace(/-/g,"/"));
var now=new Date();

if(date1>now)
{

}
else if(date2<=now)
{
	
}else
{
return true;

}
return false;
	}

function v5_sale()
{
	
	//$("div.wrap").prepend('<div style="background:#fff; color:#000; height:55px; width:960px; float:left; line-height:55px;"><span style="font-size:18px;font-weight:bold; float:left;margin-left:40px;"><font style="color:#f00;">WEEKEND FLASH SALE!</font> 24% OFF our V5 Series Pro Poker Table!</span> <span style="font-style:italic;float:left;margin-top:0px;margin-left:20px;">Sale Ends 10-16-11</span> <a href="/v5series.htm" style="float:left;margin-top:15px;margin-left:20px;"><img src="/template/upload/file/2011-10/buy-now-btn.png"/></a></div>');
}

$(function(){
	$("img.why_buy_bbo").click(function(){
		uniworld_pop_windows_empty('<img src="template/upload/file/2011-11/4/infographic-mockup.png" alt="why buy bbo?" border="0" usemap="#wbbMap" style="cursor:auto;" /><map name="wbbMap" id="wbbMap"><area shape="rect" coords="544,1304,806,1401" href="javascript:uniworld_close_windows_newstyle();" /></map>');
		
	});
	if(location.href=="http://www.bbopokertables.com/pokertables/"||location.href=="http://www.bbopokertables.com/pokertables"||location.href=="http://www.bbopokertables.com/pokertables/index.php")
	{
		location.href="/";
		}
});
