var PageCulture = "en"; //this variable will be overwritten in the page if the culture is not en
//mouse over for td elements
function mover(td)
{	
	if(td.className=="tab-bg1") td.className="tab-bgo1";
	if(td.className=="tab-bg2") td.className="tab-bgo2";	
}
//mouse out for td elements
function mout(td)
{	
	if(td.className=="tab-bgo1") td.className="tab-bg1";
	if(td.className=="tab-bgo2") td.className="tab-bg2";		
}
//mouse click for td elements
function mclick(td)
{
	if(td == null || td.className == null || td.className.length == 0)
		return;
	if(td.id != null && td.id.length > 0 && td.id.indexOf("!") >= 0)
	{
		if(td.className=="tab-bg1" || td.className=="tab-bgo1") {td.className="tab-bgsel1";}
		else if(td.className=="tab-bg2" || td.className=="tab-bgo2") {td.className="tab-bgsel2";}			
	}	
	else if(td.className=="tab-bgsel1") {td.className="tab-bg1";}
	else if(td.className=="tab-bgsel2") {td.className="tab-bg2";}
}
function LanguageExt()
{

	return (PageCulture == "de" ? "lan=D;" : "");
}
//Stats link
function BM1(id)
{	
	MM_goToURL("_self","/sportsbook/cgi-win-2/itstat.exe?" + LanguageExt() + "MN" + id);	
}
//live betting link
function Live()
{
	MM_goToURL("_top","/sportsbook/cgi-win-2/itliveredirect.exe?"+LanguageExt());
}
//competition link
function BM2(sportType, competitionId)
{
	MM_goToURL("section","/sportsbook/cgi-win-2/itbframe.exe?qbtitle=" + sportType + ";frameref=itbet.exe?" + LanguageExt() + "sprtyp=" + sportType + ";scrncd=BI;compno=" + competitionId);
}
//Sport link
function BM3(sportType)
{
	MM_goToURL("section","/sportsbook/cgi-win-2/itbframe.exe?qbtitle=" + sportType + ";frameref=itbet.exe?" + LanguageExt() + "scrncd=BO;sprtyp=" + sportType);									
}
//Bet offer link
function BM4(offerId, sportType, isFR)
{	
	if(isFR == 1)
		MM_goToURL("section", "/sportsbook/cgi-win-2/itbframe.exe?qbtitle=" + sportType + ";frameref=itbet.exe?" + LanguageExt() + "scrncd=BO;spofno=" + offerId + ";hide=true;");	
	else
		MM_goToURL("section", "/sportsbook/cgi-win-2/itbframe.exe?frameref=BetOptions.exe?" + LanguageExt() + "spofno=" + offerId + ";hide=true;");			
}
function BM5(sportType, competitionId, optionString)
{	
	if(fr_Exists("section"))
		MM_goToURL("section", "/sportsbook/cgi-win-2/itbframe.exe?qbtitle=" + sportType + ";frameref=itbet.exe?scrncd=BO;sprtyp=" + sportType + ";scrncd=BI;compno=" + competitionId + ";" + LanguageExt() + "extra=" + optionString + "|");	
	else
		MM_goToURL("_top", "/sportsbook/cgi-win-2/itwww.exe?frameref=itbet.exe?scrncd=BO;sprtyp=" + sportType + ";scrncd=BI;compno=" + competitionId + ";" + LanguageExt() + "extra=" + optionString + "|");	
}
function fr_Exists(id)
{	
	return fr_Find(top.frames, id) != null;
}
function fr_Find(frameArray, id)
{	
	if(frameArray == null)
		return null;
	if(frameArray.length > 0)
	{
		if(frameArray[id] != null)
			return frameArray[id];
		else
		{
			for(var i=0; i< frameArray.length; i++)
			{						
				if(frameArray[i] != null && frameArray[i].frames)
				{			
				var frame = fr_Find(frameArray[i].frames, id);
				if(frame != null)
					return frame;							
				}
			}						
		}
	}	
	return null;
}
//Displays mock frame when frames based pages are loaded outside of the frameset
function FakeFrames()
{
	var framesTopDiv = document.getElementById("framesTopDiv");				
	var framesLeftDiv = document.getElementById("framesLeftDiv");				
	var contentDiv = document.getElementById("contentDiv");								
	var lanCode = "en";				
	if(PageCulture != null)
		lanCode = PageCulture;
	if(parent.frames == null || parent.frames.length==0)
	{
		if(framesTopDiv != null)
		{
			framesTopDiv.innerHTML = "<a href=\"/sportsbook/cgi-win-2/itwww.exe\" title=\"Play to win at Intertops.com.\"><img  src=\"/graphics/framebust_top_" + lanCode + ".gif\" alt=\"Play to win at Intertops.com.\" border=\"0\"/></a>";						
			framesTopDiv.className = "framesTopDivNoFrames";						
		}
		if(framesLeftDiv != null)	
		{				
			framesLeftDiv.innerHTML = "<a href=\"/sportsbook/cgi-win-2/itwww.exe\" title=\"Play to win at Intertops.com.\"><img  src=\"/graphics/framebust_left_" + lanCode + ".gif\" alt=\"Play to win at Intertops.com.\" border=\"0\"/></a>";					
			framesLeftDiv.className ="framesLeftDivNoFrames";						
		}
		if(contentDiv != null)
		{
			contentDiv.className = "contentDivNoFrames";
		}
		
		document.body.className = "bodyNoFrames";
	}
}
