var clicked=null
var subcatClicked=null
function ShowSubcat(Catid)
{
	if(clicked == null)
	{
		document.getElementById('trSubcat0').style.display=''
		clicked=Catid 
	}	
	else
	{
		if(clicked==Catid && document.getElementById('trSubcat'+Catid).style.display=='none')
		{
			document.getElementById('trSubcat'+Catid).style.display=''
			document.getElementById('imgDwn'+Catid).style.display=''
			document.getElementById('img'+Catid).style.display='none'
		}
		else
		{
			document.getElementById('img'+Catid).style.display='none'
			document.getElementById('imgDwn'+Catid).style.display=''
			document.getElementById('img'+clicked).style.display=''
			document.getElementById('imgDwn'+clicked).style.display='none'
			document.getElementById('trSubcat'+Catid).style.display=''
			document.getElementById('trSubcat'+clicked).style.display='none'
		}
		clicked=Catid
	}	
}
function ShowIkons(SubCatid)
{
	if(subcatClicked == null)
	{
		document.getElementById('trIkons'+SubCatid).style.display=''
		subcatClicked=SubCatid
	}	
	else
	{
		document.getElementById('trIkons'+subcatClicked).style.display='none'
		document.getElementById('trIkons'+SubCatid).style.display=''
		subcatClicked=SubCatid
	}	
}
function ShowIkonsNew(Catid)
{
	if(clicked == null)
	{
		document.getElementById('trIkons'+Catid).style.display=''
		clicked=Catid
	}	
	else
	{
		/*document.getElementById('trIkons'+clicked).style.display='none'
		document.getElementById('trIkons'+Catid).style.display=''*/
		if(clicked==Catid && document.getElementById('trIkons'+Catid).style.display=='none')
		{
			document.getElementById('trIkons'+Catid).style.display=''
			document.getElementById('imgDwn'+Catid).style.display=''
			document.getElementById('img'+Catid).style.display='none'
		}
		else
		{
			document.getElementById('img'+Catid).style.display='none'
			document.getElementById('imgDwn'+Catid).style.display=''
			document.getElementById('img'+clicked).style.display=''
			document.getElementById('imgDwn'+clicked).style.display='none'
			document.getElementById('trIkons'+Catid).style.display=''
			document.getElementById('trIkons'+clicked).style.display='none'
		}
		clicked=Catid
	}	
}
function ChangeImage(ThePath, TheImgName, FilePath, TagName)
{
	iWidth=80;
	iHeight=60;
	if(TagName=="TopIkons" ||  TagName=="NewIkons" || TagName=="TopIkonMusic" || TagName=="NewIkonMusic" || TagName=="TopIkonVideo" || TagName=="NewIkonVideo" )
	{
		iWidth=iWidth+12;
		iHeight=iHeight+12
	}
	ObjImg=document.getElementById('td'+TagName)
	ObjLbl=document.getElementById('lbl'+TagName)
	
	ThePath=ThePath.replace('//','/')
	ObjImg.innerHTML ="<a href='"+FilePath+"'><img src='"+ThePath+"' alt='' name='imgTopCitizenGames' width='"+iWidth+"' height='"+iHeight+"' border='0' id='imgTopCitizenGames' runat='server' /></a>" 
	ObjLbl.innerHTML = TheImgName
	//alert(ThePath)
}

function ChangeTab(Obj,ObjOtherTab,ObjClickedDiv,ObjOtherDiv)
{
	ObjClickedDiv.style.display='';
	ObjOtherDiv.style.display='none';
	Obj.className='bgcolorwht heading';
	ObjOtherTab.className='bgcolorlightblue';
}
function ChangeGrayTab(Obj,ObjOtherTab,ObjClickedDiv,ObjOtherDiv)
{
	ObjClickedDiv.style.display='';
	ObjOtherDiv.style.display='none';
	Obj.className='profilelinkheading activetab';
	ObjOtherTab.className='profilelinkheading inactivetab';
}
function HideTowTabs(Obj, ObjClickedDiv, ObjOtherTab1, ObjOtherTab2, ObjOtherDiv1, ObjOtherDiv2)
{
	ObjClickedDiv.style.display='';
	ObjOtherDiv1.style.display='none';
	ObjOtherDiv2.style.display='none';
	Obj.className='bgcolorwht heading';
	ObjOtherTab1.className='bgcolorlightblue';
	ObjOtherTab2.className='bgcolorlightblue';
}
function ChangeContestImage(ThePath, FileName, TheID, ObjImg, TheProfileID)
{
	if(FileName!='')
		ObjImg.src = ThePath		
	window.document.getElementById('play').innerHTML='<a href="html/games/imadeplaygame.aspx?Token='+TheID+"&ProfileToken="+TheProfileID+'" onclick="GoToPage(\''+TheID+'\',\''+TheProfileID+'\');" class="verd10pxgreybld">Play Now</a>'		
}
function GoToPage(TheId, TheProfileID)
{
	location.href="html/games/imadeplaygame.aspx?Token="+TheId +"&ProfileToken="+TheProfileID
}
function ChangeContestImage1(ThePath, FileName, TheID, ObjImg,TheProfileID)
{
	if(FileName!='')
		ObjImg.src = ThePath		
	window.document.getElementById('play').innerHTML='<a href="../html/games/imadeplaygame.aspx?Token='+TheID+"&ProfileToken="+TheProfileID+'" onclick="GoToPage(\''+TheID+'\',\''+TheProfileID+'\');" class="verd10pxgreybld">Play Now</a>'		
}
function GoToPage1(TheId)
{
	location.href="html/games/imadeplaygame.aspx?Token="+TheId
}
if(document.getElementById('trSubcat0')!=null)
{
document.getElementById('trSubcat0').style.display=''
clicked=0;
}
