var xChildWindow = null;
function show_menu(targetId){
	//alert('Its working');
	// Make sure the element exists before calling it's properties
	$('bsball').hide();
	$('pftball').hide();
	$('soccer').hide();
	$('exotics').hide();
	$('hockey').hide();
	$('golf').hide();
	$('auto').hide();
	$('cftball').hide();
	$('cbkball').hide();
	$('pbkball').hide();
	$('boxing').hide();
	if (($(targetId) != null))
	// Toggle visibility between none and inline
	//alert(document.getElementById(targetId).style.display);
	if (($(targetId).style.display == 'none'))
	{
		$(targetId).show();
		$('test').show();

	} else {
		$(targetId).hide();
		$('test').hide();

	}
}
function bjSlide(temp)
{
	alert('working');
  alert(temp);
}
function hide_menu()
{
	$('bsball').hide();
	$('pftball').hide();
	$('soccer').hide();
	$('exotics').hide();
	$('hockey').hide();
	$('golf').hide();
	$('auto').hide();
	$('cftball').hide();
	$('cbkball').hide();
	$('pbkball').hide();
	$('boxing').hide();
}
function showMenu(targetId) {
	if (document.getElementById) {
		target = document.getElementById( targetId );
		target.style.display = "block";
	}
}
function hideMenu(targetId){
	if (document.getElementById) {
		target = document.getElementById( targetId );
		target.style.display = "none";
	}
}
////////////////////// OPEN WIN POP UP //////////////////////
function openwin(url, name, options) {
	var win = window.open(url, name, options);
}

////////////////////// GAME POP UP//////////////////////
function gamePop(url, name, width, height, resizable, scrollbars) {
	var str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width;
	str += ",resizable=" + resizable + ",scrollbars=" + scrollbars;
	if (window.screen) {
		var ah = screen.availHeight - 0;
		var aw = screen.availWidth - 0;

		var xc = (aw - width) / 2;
		var yc = (ah - height) / 2;

		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
	}
	var win =  window.open(url, name, str);
	if (window.focus) {win.focus()}
}

function content_pop(url,url2) {
	xWinOpen(url);
	window.location.href = url2;
}
function index_sq_pop()
{
	url = 'http://popup.allpro.info/nfl-football/game-previews/';
	xWinOpen(url);
	//window.location.href = url2;	
}

function xWinOpen(sUrl)
{
  var features = "left=0,top=0,width=722,height=800,location=0,menubar=0," +
    "resizable=1,scrollbars=1,status=0,toolbar=0";
  if (xChildWindow && !xChildWindow.closed) {
  	xChildWindow.location.href = sUrl;
  }
  else {
  	xChildWindow = window.open(sUrl, "ALLPROINFO", features);
  }
  xChildWindow.focus();
  return false;
}

function hover_class(type)
{
	$(type).className = "sportsnavlinkx2";
}

function no_hover_class(type)
{
	$(type).className = "sportsnavlinkx";
}
function hc(type)
{
	$(type).className = "snlx2";
}

function nhc(type)
{
	$(type).className = "snlx";
}
function hover_class_drop(type)
{
	$(type).className = "wagercontentx";
}

function no_hover_class_drop(type)
{
	$(type).className = "wagercontent";
}
function saveScreenSize()
{
	var width = screen.width;
	var height = screen.height;
	new Ajax.Request('http://www.allpro.com/ajax/screen_size.php',  {
	method: 'POST',
	parameters: { width: width, height: height }
	});
}

function get_screen_width()
{
	var pageWidth = ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) ;
	var pageHeight = ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) +100;
	//alert(width);
	//alert(height);
	//var width = document.body.clientWidth;
	$('hidden_table').width = pageWidth;
	$('hidden_table2').width = pageWidth;

	//var height = document.body.offsetHeight + 100;
	$('hidden_table_cell').width = pageWidth;
	$('hidden_table_cell').height = pageHeight;
	$('hidden_table_cell2').width = pageWidth;
	$('hidden_table_cell2').height = pageHeight;
  var test = pageWidth/2;
  test = test - 495 +61;
  //$('sport_data_area').style.left = test + 'px';

	//saveScreenSize();
}
function show_squares()
{
	$('header').hide();
	$('squares_viewer').show();
	$('squares_viewer2').show();
	window.scrollTo(0,0);
}