var loadPlayer = 1;


function initializeTV() {
	player = getFlashMovieObject('wTVplayer');
	
	dhtmlHistory.initialize();
   	dhtmlHistory.addListener(handleHistoryChange);
   	
   	dhtmlHistory.add("section:" + selectedTab, selectedVid);
   	
}


function handleHistoryChange(newLocation, historyData) {
	if (newLocation != '') { 
	  	newLocation =  newLocation.replace(/section\:/, "");
   		changeTab(newLocation, 'Up', historyData)	
   	}
}



function getFlashMovieObject(movieName) {
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}



function changeButton(whichButton, whichState) {
	var butEl = document.getElementById(whichButton + 'But');
		
	butEl.src = '/images/remote/' + whichButton + whichState + '.png';
}


function changeChannel(which, whichVid) {
	player.channelChange(which, whichVid);
}

function toggleGuide() {
	player.toggleGuide(true);
}

function remoteChangeChannel(which) {
	player.remoteChangeChannel(which);
}

function guideChannelUp() {
	player.guideChannelUp();
}

function guideChannelDown() {
	player.guideChannelDown();
}

function guideItemUpPress() {
	player.guideItemUpPress();
}

function guideItemDownPress() {
	player.guideItemDownPress();
}

function guideItemUpRelease() {
	player.guideItemUpRelease();
}

function guideItemDownRelease() {
	player.guideItemDownRelease();
}




function playerReady(){
	
}



