// globals 
var MainOpen = -1;

//used by flash to determine if the user is currently logged in or not.

/*********************** SERVICES ************************************/
function CheckServicesTR()
{
	if ((document.all.voteTbl) || (document.all.DGTbl))
	{
		document.all.servicesImgTR.style.display = "";
	}
	else
	{
		document.all.servicesImgTR.style.display = "none";
	}
}


function SetGrayScale(SelectedTable)
{
	SelectedTable.className="GrayScale"
}


function RemoveGrayScale(SelectedTable)
{
	SelectedTable.className="NotGrayScale"
}


function ShowHideParticipation() 
{
	var OldStyle = servicesTbl.style.display;
	
	if (OldStyle == "") 
	{
		servicesTbl.style.display = "none";
		document.getElementById('imgParticipation').src = "/news/Images/News/participations-header-expand.gif";
	}
	else
	{
		servicesTbl.style.display = "";
		document.getElementById('imgParticipation').src = "/news/Images/News/participations-header-collapse.gif";
	}
	return false;
}
/*********************************************************************/



/*********************************************************************/

function SelectMenu(){

	var FlashCookie  = readCookie__("FlashVersionCookie");
	
	
	var FlashMenu = document.getElementById("FlashMenuTD")
	var HTMLMenu = document.getElementById("HTMLMenuTD")
	var FlashVersion = document.getElementById("FlashVersionTD")
	var HTMLVersion = document.getElementById("HTMLVersionTD")
	if (FlashCookie != null){
		if (FlashCookie == "ToFlash"){
			if (FlashMenu) 
				document.getElementById("FlashMenuTD").style.display='block';
			if (HTMLMenu)
				document.getElementById("HTMLMenuTD").style.display='none';
				
			if(FlashVersion)
				document.getElementById("FlashVersionTD").style.display='block';
			if(HTMLVersion)
				document.getElementById("HTMLVersionTD").style.display='none';
		}
		else{
			if (FlashMenu) 
				document.getElementById("FlashMenuTD").style.display='none';
			if (HTMLMenu)
				document.getElementById("HTMLMenuTD").style.display='block';
				
			if(FlashVersion)
				document.getElementById("FlashVersionTD").style.display='none';
			if(HTMLVersion)
				document.getElementById("HTMLVersionTD").style.display='block';
			}1
		}
	else{
			if (FlashMenu) 
				document.getElementById("FlashMenuTD").style.display='none';
			if (HTMLMenu)
				document.getElementById("HTMLMenuTD").style.display='block';
				
			if(FlashVersion)
				document.getElementById("FlashVersionTD").style.display='none';
			if(HTMLVersion)
				document.getElementById("HTMLVersionTD").style.display='block';
	}
	
	//getTop("dvMains","dvLeftSub","dvRightSub")
}


function ShowHidSubSections (obj,channelGuid,NotchTDID)
{
	var trobj;
	var counter;
	var strId;
	counter = 0;
	while(true)
	{
		//debugger;
		//alert(obj)
		strId= channelGuid + "_" + counter;
		trobj = document.getElementById(strId);
		if (trobj==null)
			break;
		else
		{
			/*if (navigator.appName.indexOf("Netscape") > -1 ){
				document.getElementById("NotchTDID")
			}
			else{
					
			}*/
			if (trobj.style.display=='none')
			{
				trobj.style.display='';
				document.getElementById(NotchTDID).style.backgroundColor = "";
				MainOpen = -1;
			}
			else
			{
				trobj.style.display='none';
				document.getElementById(NotchTDID).style.backgroundColor = "#CEB469";
				MainOpen = NotchTDID;
			}
		}
		counter++;
	}	
}



function getTop( strMainID, strSubLeft, strSubRight,intIfLayout3)
	{
		try 
		
		{
		if (navigator.appName.indexOf("Netscape") > -1 )
			{
			
				if (window.document.getElementById(strMainID))
					window.document.getElementById(strMainID).style.width="355";
				if (window.document.getElementById(strSubLeft))
					window.document.getElementById(strSubLeft).style.width="262";
				if (window.document.getElementById(strSubRight))
					window.document.getElementById(strSubRight).style.width="262";
				
			}
		
		var originalTop;
		var currentHeight;
		var originalHeight;
		var intTop;
		var BreakingNewChange;
		BreakingNewChange = 0;

		if (!(document.getElementById("hdBreakingNews")))
			{
				BreakingNewChange = 25;
			}
			
		//Main story
		if (strMainID.toLowerCase() == 'dvmains')
		{

				if (topflag == 100)
				{
					originalTop = 333;
					if (navigator.appName.indexOf("Netscape") > -1 )
					{
						originalTop = 331 ;
					}

				}
				else 
				{
					originalTop = 363 ;
					if (navigator.appName.indexOf("Netscape") > -1 )
					{
						originalTop = 361 ;
					}
				}
				 
			if (document.getElementById (strMainID))
			{
			
				originalHeight= 60;
				currentHeight = document.getElementById (strMainID).offsetHeight
				if (currentHeight < 60)
					{
						currentHeight = 60;
						document.getElementById(strMainID).style.height="60"
					}
				intTop =  originalTop  - (currentHeight - originalHeight)
				document.getElementById(strMainID).style.top = intTop  - BreakingNewChange
				
			}
		}
		if (strSubLeft.toLowerCase() == 'dvleftsub') 
		{
				if (topflag == 100)
				{
					originalTop = 531;
					if (navigator.appName.indexOf("Netscape") > -1 )
					{
						originalTop = 529 ;
					}
				}
				else 
				{
					originalTop = 561 ;
					if (navigator.appName.indexOf("Netscape") > -1 )
					{
						originalTop = 559 ;
					}
				}
			if (document.getElementById(strSubLeft))
			{
				originalHeight= 50;
				currentHeight = document.getElementById(strSubLeft).offsetHeight
				if (currentHeight < 50)
					{
						currentHeight = 50;
						document.getElementById(strSubLeft).style.height="50"
					}
				intTop =  originalTop  - (currentHeight - originalHeight)
				document.getElementById(strSubLeft).style.top=(parseInt(intTop)  - parseInt(BreakingNewChange))  +  parseInt(intIfLayout3);
			}
		}
		if (strSubRight.toLowerCase() == 'dvrightsub') 
		{
		
				if (topflag == 100)
				{
					originalTop = 531;
					if (navigator.appName.indexOf("Netscape") > -1 )
					{
						originalTop = 529 ;
					}
				}
				else 
				{
					originalTop = 561;
					if (navigator.appName.indexOf("Netscape") > -1 )
					{
						originalTop = 559 ;
					}

				}
			if (document.getElementById(strSubRight))
			{
				originalHeight= 50;
				currentHeight = document.getElementById(strSubRight).offsetHeight
				if (currentHeight < 50)
					{
						currentHeight = 50;
						document.getElementById(strSubRight).style.height="50"
					}
				intTop =  originalTop  - (currentHeight - originalHeight)
				document.getElementById(strSubRight).style.top= (parseInt(intTop ) - parseInt(BreakingNewChange)) + parseInt(intIfLayout3);
			}
		}
	}
	catch (e)
		{
			//Do Nothing
		}

	}