﻿function menuShow( id, me ) {
	var d = document.getElementById( id );
	d.style.display='block';
	
	var m = document.getElementById( me );
	m.style.background = '#336699';
}

function menuHide( id, me ) {
	var d = document.getElementById( id );
	d.style.display='none';
	
	var m = document.getElementById( me );
	m.style.background = '#6181BC';
}


function CopyCodeToClipboard(iCode)
		{
			var rng;
			switch (iCode)
			{
				case 1:
					rng = document.getElementById("lblCode1a").createTextRange();
					break;
				case 2:
					rng = document.getElementById("lblCode2a").createTextRange();
					break;
				case 3:
					rng = document.getElementById("lblCode3a").createTextRange();
					break;
			}
			if (rng != null)
			{
				rng.execCommand("RemoveFormat");
				rng.execCommand("Copy");
			}
		}
document.onreadystatechange = function()
{
	if (document.readyState == "complete")
	{
		document.onreadystatechange = null;
		document.body.oncontextmenu = function() { return false; }
	}
}
function CheckFormFields()
{
	var sValue = document.getElementById("SearchBy").value;
	if (sValue != "club" || sValue != "country")
	{
		if (document.getElementById("SearchParameter1").style.display == "none")
			sValue = "country";
		else sValue = "club";
		document.getElementById("SearchBy").value = sValue;
	}
}
function UpdateSearchDisplay()
{
	var sValue = document.getElementById("SearchBy").value;
	if (sValue == "club")
	{
		document.getElementById("SearchParameter1").style.display = "inline";
		document.getElementById("SearchParameter2").style.display = "none";
	} else if (sValue == "country")
	{
		document.getElementById("SearchParameter1").style.display = "none";
		document.getElementById("SearchParameter2").style.display = "inline";
	}
}
function setDropDownSelection(ddId, ddValue, ddMultiSelect)
{
	ddObj = document.getElementById(ddId);
	if(!ddMultiSelect)
	{
		for(y=0; y<ddObj.options.length; y++)
			ddObj.options[y].selected = false;
	}
	for(y=0; y<ddObj.options.length; y++)
	{
		if(ddObj.options[y].value == ddValue)
			ddObj.options[y].selected = true;
	}
}
function AddToFavorites()
{
	var sURL = "http://www.worldfootballers.com/";
	var sTitle = "World Footballers";
	try
	{
		if (window.sidebar && window.sidebar.addPanel)
		{
    		//Gecko (Netscape 6 etc.) - add to Sidebar
    		window.sidebar.addPanel( this.title, this.href, '' );
		} else if (window.external && (navigator.platform == 'Win32' || (window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1)))
		{
    		//IE Win32 or iCab - checking for AddFavorite produces errors for no
    		//good reason, so I use a platform and browser detect.
    		//adds the current page page as a favourite; if this is unwanted,
    		//simply write the desired page in here instead of 'location.href'
    		window.external.AddFavorite(sURL, sTitle);
		} else if (window.opera && window.print)
		{
    		//Opera 6+ - add as sidebar panel to Hotlist
    		return true;
		}
	} catch(e) {}
}
function SetHome()
{
   document.body.style.behavior = "url(#default#homepage)";
   document.body.setHomePage("http://www.worldfootballers.com/");
}