function showMovie(id) {
   var previewDiv=document.getElementById('channel-left');
   var infoDiv=document.getElementById('channel-right');

   // Different approach to the home page here - we use an iframe to
   // load the movie player and synopsis as we don't have the movie
   // information to hand here, and use JS to set them up since
   // there's two to change for one click
   previewDiv.innerHTML='<h2>Preview</h2><iframe frameborder=0 id="channel-left-clip" src="movie-preview.php?id='+id+'" scrolling="no" width="100%" height="100%"></iframe>';
   infoDiv.innerHTML='<h2>Summary</h2><iframe frameborder=0 id="channel-right" src="movie-details.php?id='+id+'" style="padding-right: 0px; margin: 1px 0px 0px 10px; height: 300px; width: 525px; "></iframe>';
   //window.location.hash='movie-info';
   var obj=document.getElementById('channel-left');
   obj.scrollIntoView(true);
}
	
function showCarousel(dayOffset, provider) {
	swfobject.embedSWF("carousel-movies/Carousel.swf", "carousel1", "850", "300", "9.0.0", false, {xmlfile:"carousel-movies-xml.php?provider=" + provider + "%26days="+dayOffset, loaderColor:"0x666666", messages:"Loading carousel::Loading schedules::Loading titles::Use arrow keys to move carousel"}, {wmode: "transparent"});
}

function showList(pWeek, pColor)
{
	if (pWeek < 0)
	{
		document.week=0;
		pWeek = 0;       // Don't do anything to go further back than 4 weeks.
        }
        else if (pWeek > 2)
        {
		document.week = 2;
		pWeek = 2;
	}
	
	for(iWeek = -3; iWeek<10; iWeek++)
        {
		var aWeekDiv = document.getElementById("tilelistweek"+iWeek);

		// if this week is between the 4 week window
                if((pWeek-3)<=iWeek && iWeek <= (pWeek))
                {
			// allow it to be displayed
                        aWeekDiv.style.display='';
                        aWeekDiv.style.backgroundColor= '';
		
			// if this week is the 'new week'
                        if (iWeek == pWeek)
                        {
                                aWeekDiv.style.backgroundColor=pColor;
                                aWeekDiv.style.height='76px';
                        }
                }
                else
                {
			if (aWeekDiv != null)
			{
		              aWeekDiv.style.backgroundColor= '';
                	      aWeekDiv.style.display='none';
			}
                }
        }
}

document.week=0;
document.dayOffset=0;

