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 bodyElement = $(document.body);
	bodyElement.show();
	var params = {
		scale: "noScale",
		wmode: "opaque",
		menu: "false",
		allowFullScreen: "false"
	};
	var attributes = { id:"slider1" };
	swfobject.embedSWF("slider4.swf", "slider", "925", "276", "9.0.0", "expressInstall.swf", flashvarsa, params, attributes);
	
	swf = "";
	var a = String(window.location);
	a = a.split("/");
	if (a[3] == "c"){
		flashvars = {
			tLinks: "/c/,/c/sportsbook.shtml,/c/horsebook.shtml,/c/casino.shtml,/c/rules_regulations.shtml,/c/contact_us.shtml"
		};
		swf = "/c/menu.swf";
	}
	if (a[3] == "vn"){
		flashvars = {
			tLinks: "/vn/,/vn/sportsbook.shtml,/vn/horsebook.shtml,/vn/casino.shtml,/vn/rules_regulations.shtml,/vn/contact_us.shtml"
		};
		swf = "/vn/menu.swf";
	}
	var params = {
		scale: "noScale",
		wmode: "transparent",
		menu: "false",
		allowFullScreen: "false"
	};
	var attributes = { id:"topMenu" };
	if(swf!="")swfobject.embedSWF(swf, "topMenu", "520", "25", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
	$('.butt').each(function (index){
		var who ="#sp"+$(this).attr('id');
		$(who).hide();
		$(this).mouseover( function(){
			$(who).show();
		});
		$(this).mouseout( function(){
			$(who).hide();
		});
	});
	$('#gWrapper').append($('#langBarD'));
	$('#langBarD .trigger').click(function(){
		if($('.parent_d').height()>0){
			$('.parent_d').animate({height:'0px'},500,function(){$('.parent_d').css('overflow','hidden');$('.parent_d').css('overflow','visible');$('.parent_d .arrow img').removeClass('rev');});
			$('.langHolder').animate({height:'0px'},500,function(){});
		}else{
			$('.parent_d').animate({height:'80px'},500,function(){$('.parent_d').css('overflow','hidden');$('.parent_d').css('overflow','visible');$('.parent_d .arrow img').addClass('rev');});
			$('.langHolder').animate({height:'80px'},500,function(){});
		}
	});
	$('#langBarD .arrow').click(function(){
		$('#langBarD .trigger').click();
	});
});

function addToFavorites() {
	var urlAddress = "http://www.beteagle.ag";
	var pageName = "BetEagle";
	if (window.sidebar) { // firefox
		window.sidebar.addPanel(pageName, urlAddress, "");
	} else if( document.all ) { //MSIE
		window.external.AddFavorite( urlAddress, pageName);
	}
	else if(window.chrome){
		alert('Press ctrl+D to bookmark (Command+D for macs) after you click Ok');
	}
	else {
		alert("Sorry, your browser doesn't support this");
	}
} 
