var h2Element = null;



function ShowList (num)
{
	var el = document.getElementById("List" + num);
	
	for (i=1; document.getElementById("List" + i) != null; i++)
	{
		document.getElementById("List" + i).style.display = "none";
	}
	if(el != null)
	{
		el.style.display = "block";
	}

}





function ShowImage(RefId)
{
	if(document.getElementById("clipExtraInfo"))
		document.getElementById("clipExtraInfo").innerHTML = "";

	document.getElementById("player").innerHTML = "<img src='http://dynimg.rte.ie/" + RefId + "124ry.jpg'/>";
	highlightImage("image"+RefId);
}



function highlightImage(id)
{
	if(h2Element)
	{
		h2Element.className = "";
	}

	var el = document.getElementById(id);
	if(el != null && typeof(el) == "object")
	{
		el.className = "sel";
		h2Element = el;
	}
}



function buildDateArchive()
{
	var smonths = new Array("Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec" );
	var lmonths = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

		var todaysDate = new Date();

		todaysDate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 12, 0, 0);

		var counter = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 12,0,0);
		var start = new Date(2007, 3, 25, 12,0,0);

		var oneday = 86400000;

		var strmonth;
		var strdate;
		var str;

		document.write ("<select name='select' size='1' onChange='if(options[selectedIndex].value.length != 0) location=options[selectedIndex].value;'>	");
		document.write ("<option selected>[select date]</option>");
		var isToday = 1;

		while(counter.getTime() >= start.getTime())
		{
			strmonth = (counter.getMonth()+1) ;
			strdate = counter.getDate();
		
			if (10 > strmonth)
					strmonth="0" + strmonth;
					
			if (10 > strdate)
				strdate="0" + strdate;
			
			if (isToday == 1)
			{	
				str = "/news/elections2007/thehub.html" ;
				isToday = 0;
			}
			else {
				str = "/news/" + counter.getFullYear()  + "/"  +  strmonth + strdate  + "/thehub_av.html" ;
			}
			
			
			document.write("<option value=\"" + str + "\">" + strdate + " " + lmonths[counter.getMonth()] + " " + counter.getFullYear() + "</option>");
			counter.setTime(counter.getTime() - oneday);
		}

		document.write ("</select>");			
}
