
////////////////////// 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 hc(type)
{
	$(type).className = "snlx2";
}

function nhc(type)
{
	$(type).className = "snlx";
}

function pull_sport_data(sport,type,id,file,team_id,target,doc_id)
{
	$('content').show();
	if (type == "scoreboard")
	{
		document.getElementById('page_type').value = type;
	}
	showLoadingGif();
	if (type == "index" || type == "index2" || type == "scoreboard" || type == "scoreboard2")
	{
		new Ajax.Updater('sport_data_area', '/ajax/live_scores.php',  { method: 'get', 
		onComplete: function(transport){CD_Init();}, 
		parameters: { sport: sport, type: type, file: file, team_id: team_id, doc_id: doc_id } });
	}
	else
	{
		$('center_content').src = '/ajax/data_file.php?sport='+sport+'&type='+type+'&file='+file+'&team_id='+team_id+'&doc_id='+doc_id;
		//new Ajax.Updater('sport_data_area', '/ajax/data_file.php',  { method: 'get', parameters: { sport: sport, type: type, file: file, team_id: team_id, doc_id: doc_id } });
	}
	$('page_type').value = type;
}

function get_date_schedule(sport,type,id,file,team_id,target,doc_id)
{
	$('content').show();

	document.getElementById('page_type').value = "pastscore";
	var year = $F('past_scoreboard');
	var month = $F('past_scoreboard');
	var day = $F('past_scoreboard');
	new Ajax.Updater('sport_data_area', '/ajax/data_file.php',  { method: 'get', parameters: { sport: sport, type: type, year: year, month: month, day: day } });
}

function get_week_schedule(sport,type,id,file,team_id,target,doc_id)
{
	$('content').show();
	new Ajax.Updater('sport_data_area', '/ajax/data_file.php',  { method: 'get', parameters: { sport: sport, type: type, week: past_scoreboard } });
}

function pull_preview(sport,type,id)
{
	$('content').show();
	var file = $F('file');
	showLoadingGif();
	new Ajax.Updater('sport_data_area', '/ajax/data_file.php',  { method: 'get', parameters: { sport: sport, type: type, file: file} });
}

function clear_classes(sport)
{
	if (sport == "soccer" || sport == "golf" || sport == "auto" || sport == "exotics")
	{
		if ($('tab-index'))
		{
			$('tab-index').className = 'snlx';
		}
		if ($('tab-gallery'))
		{
			$('tab-gallery').className = 'snlx';
		}
		if ($('tab-stories'))
		{
			$('tab-stories').className = 'snlx';
		}
	}
	else if (sport == "boxing")
	{
		if ($('tab-index'))
		{
			$('tab-index').className = 'snlx';
		}
		if ($('tab-gallery'))
		{
			$('tab-gallery').className = 'snlx';
		}
		if ($('tab-stories'))
		{
			$('tab-stories').className = 'snlx';
		}
		if ($('tab-standings'))
		{
			$('tab-standings').className = 'snlx';
		}
	}
	else
	{
		if ($('tab-index'))
		{
			$('tab-index').className = 'snlx';
		}
		if ($('tab-standings'))
		{
			$('tab-standings').className = 'snlx';
		}
		if ($('tab-gallery'))
		{
			$('tab-gallery').className = 'snlx';
		}
		if ($('tab-previews') || $('tab-preview'))
		{
			$('tab-previews').className = 'snlx';
		}
		if ($('tab-recaps'))
		{
			$('tab-recaps').className = 'snlx';
		}
		if ($('tab-stories'))
		{
			$('tab-stories').className = 'snlx';
		}
	}
}

function change_class(id,sport)
{
	if (sport == "soccer" || sport == "golf" || sport == "auto" || sport == "exotics")
	{
		if (id == 'tab-index' || id == 'tab-scoreboard' || id == 'tab-odds')
		{
			$('tab-index').className = 'sportsnavlink';
		}
		else if (id == 'tab-gallery')
		{
			$('tab-gallery').className = 'sportsnavlink';
		}
		else if (id == 'tab-stories')
		{
			$('tab-stories').className = 'sportsnavlink';
		}
	}
	else if (sport == "boxing")
	{
		if (id == 'tab-index' || id == 'tab-scoreboard' || id == 'tab-odds')
		{
			$('tab-index').className = 'sportsnavlink';
		}
		else if (id == 'tab-gallery')
		{
			$('tab-gallery').className = 'sportsnavlink';
		}
		else if (id == 'tab-stories')
		{
			$('tab-stories').className = 'sportsnavlink';
		}
		else if (id == 'tab-standings')
		{
			$('tab-stories').className = 'sportsnavlink';
		}
	}
	else
	{
		if (id == 'tab-index' || id == 'tab-scoreboard')
		{
			$('tab-index').className = 'sportsnavlink';
		}
		else if (id == 'tab-standings')
		{
			$('tab-standings').className = 'sportsnavlink';
		}
		else if (id == 'tab-gallery')
		{
			$('tab-gallery').className = 'sportsnavlink';
		}
		else if (id == 'tab-previews')
		{
			$('tab-previews').className = 'sportsnavlink';
		}
		else if (id == 'tab-recaps')
		{
			$('tab-recaps').className = 'sportsnavlink';
		}
		else if (id == 'tab-stories')
		{
			$('tab-stories').className = 'sportsnavlink';
		}
	}
}

function showLoadingGif()
{
	$('center_content').innerHTML  = '<table cellpadding="0" cellspacing="0" border="0"width=576 align=center><tr><td height=200 valign=middle align=middle>	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="570" height="248" id="loader_ball" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="/swf/loader_ball.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="/swf/loader_ball.swf" quality="high" bgcolor="#ffffff" width="570" height="248" name="loader_ball" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></td></tr></table>';
}