function gup( name )
	{
	  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( window.location.href );
	  if( results == null )
		return "";
	  else
		return results[1];
	}
	
	function isNumeric(sText)
	{
		var ValidChars = "0123456789.";
		var IsNumber=true;
		var Char;
		for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
		  Char = sText.charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
			 IsNumber = false;
			 }
		  }
		return IsNumber;
	}

	var brow = navigator.appName;
	brow = brow.search(/microsoft/i);
	if (brow > -1) brow="1";
	if (brow == -1) brow="0";
	
$(document).ready(function() {
	var params = {
		scale: "noScale",
		wmode: "transparent",
		menu: "false",
		allowFullScreen: "false"
	};
	var attributes = { id:"slider1" };
	swfobject.embedSWF("slider3.swf", "slider", "925", "276", "9.0.0", "expressInstall.swf", flashvarsa, params, attributes);
	$('body').css('display','block;');
	//getFeed();
});
var t;
var current;
function getFeed(){
	$('#nonflash').html('<div id="swButts"><div><div id="hswSport1" class="hswitcher" style="display: block;">Refreshing...</div>');
	$.ajax({ url: "feed.php" })
    .success(function(responseXML) {
		$('#nonflash').html(responseXML);
		$('.hswitcher h1').remove();
		$('.hswitcher p').remove();
		$('.hswitcher *').css('width','');
		$('.hswitcher table').css('width','100%');
		$('.scoresfeed-providers').remove();
		$('.scoresfeed-columns tr td:nth-child(n+4)').remove();
		$('.scoresfeed-content tr td:nth-child(n+4)').remove();
		$('.scoresfeed-content tr td').attr('style','');
		$('.hswitcher').hide();
		current = $('#hswSport1 .hscroll');
		$('#hswSport1').show();
		$('.switcher').click(function(e){
			clearTimeout(t);
			t=setTimeout("getFeed()",60000);
			$('.hswitcher').hide();
			$('.hscroll').css('top','0px');
			current = $('#h'+$(this).attr('id')+' .hscroll');
			$('#h'+$(this).attr('id')).show();
			tickerScroll();
		});
		tickerScroll();
		t=setTimeout("getFeed()",60000);
	});
}
function tickerScroll(){
	//alert('ticked');
	$('.hswitcher').unbind();
	$(".hscroll").stop();
	$(".hscroll").clearQueue();
	ticktop=current.height();
	if (ticktop>124){
		$('.hswitcher').mouseover(function(){
		$(".hscroll").pauseAnimation();
		});
		$('.hswitcher').mouseout(function(){
			$(".hscroll").resumeAnimation();
		});
		var ntime=Math.floor(ticktop/124)*7000;
		//alert(ntop);
		$(".hscroll").delay(1000).startAnimation({
			top: -ticktop
		}, ntime, 'linear', function() {
			// Animation complete.
			$(".hscroll").attr('style','top:124px;');
			tickerScroll();
		});
	}
}
