function Podcast()
{
	var m_initialized = false;
	
	this.initialize = function()
		{
			m_initialized = true;
		}
	
	this.display = function()
		{
			if(!m_initialized)
			{
				this.getPodcasts();	
				m_initialized = true;
			}
			_console.lastReloadComponent = this;
		}
	
	this.getPodcasts = function(id)
		{
			var args = new Object();
			if(Console.MODE_LARGE==_console.m_consoleMode)
			{
				args.ptrs = ProgramList.PAGESIZE_THUMB_ROWSIZE_LARGE;
				args.large = true;
			}
			else
				args.ptrs = ProgramList.PAGESIZE_THUMB_ROWSIZE;

			args.menuChannelIndex=g_lastChannelIndex;
			args.menuChannelId=g_lastChannelId;
				
			_console.getComponentContent("podcasts", args, this.getPodcastsCallBack);
		}
	
	this.getPodcastsCallBack = function(result)
		{
			var	tbl=document.getElementById("podcast_tbl");
			_util.removeTableRows(tbl);

			var items=_util.selectNodes(result, "/podcasts/podcast");
			if (items.length>0)
			{
				for (var i=0; i<items.length; i++)
					_podcast.createPodcastRow(tbl, items[i]);
			}
			
			if (tbl.rows.length==0)
			{
				var strMessage=getLocalizedString("highlights_no_games");
				_highlight.createTextMsgRow(tbl, strMessage);
			}
			// document.getElementById("content_Podcast").innerHTML = result;
		}

	this.playClick = function(objItem)
	{
		_console.playVideo(Console.PODCAST_F,objItem,objItem.link,null,0,false,'',false,g_lastChannelId,g_lastChannelIndex,'',null,true);
	}
	this.subscribeClick = function(url)
	{
		window.open(url);
	}
	this.downloadClick = function(url)
	{
		window.open(url);
	}
	this.createPodcastRow = function(tblDest, xmlNode)
		{
			var tbl,tr,td,img,input,div,a;

			var objItem=new Object();
			objItem.highlightType="game";
			objItem.title=_util.selectSingleNodeText(xmlNode, "title", true);
			objItem.description=_util.selectSingleNodeText(xmlNode, "description", true);
			objItem.itemTitle=_util.selectSingleNodeText(xmlNode, "itemTitle", true);
			objItem.itemDescription=_util.selectSingleNodeText(xmlNode, "itemDescription", true);
			objItem.link=_util.selectSingleNodeText(xmlNode, "link", true);
			objItem.pubDate=_util.selectSingleNodeText(xmlNode, "pubDate", true);
			objItem.subscriptionUrl=_util.selectSingleNodeText(xmlNode, "subscriptionUrl", true);
			objItem.thumbnail=_util.selectSingleNodeText(xmlNode, "thumbnail", true);

			tr=tblDest.insertRow(-1);
			td=tr.appendChild(document.createElement("td"));
			td.className="border tablebg";
			
			tbl=td.appendChild(document.createElement("table"));
			tbl.cellPadding="3";
			tbl.cellSpacing="0";
			tbl.border="0";
			// tbl.width="100%";
			tbl.className="description";

			tr=tbl.insertRow(-1);

			td=tr.appendChild(document.createElement("td"));
			img=td.appendChild(document.createElement("img"));
			img.style.width="40px";
			img.style.height="40px";
			img.src=objItem.thumbnail;

			td=tr.appendChild(document.createElement("td"));
			td.style.paddingLeft="10px";
			td.align="left";
			td.width="170";
			td.innerHTML="<b>" + objItem.title + "</b><br/>" + objItem.itemTitle;

			td=tr.appendChild(document.createElement("td"));
			td.width="310";
			td.innerHTML=objItem.itemDescription;

			td=tr.appendChild(document.createElement("td"));
			td.style.paddingLeft="10px";
			td.style.paddingRight="10px";
			td.style.width="80px";

			if (objItem.subscriptionUrl!=null)
			{
				input = document.createElement("input");
				input.type = "button";
				input.className = "button";
				input.value = getLocalizedString("subscribe");
				input.onclick=function(){_podcast.subscribeClick(objItem.subscriptionUrl)};
				input.onmouseover=function(){onMouseOverButton(this)};
				input.onmouseout=function(){onMouseOutButton(this)};
				td.appendChild(input);
			}
			
			td=tr.appendChild(document.createElement("td"));
			td.style.paddingRight="10px";
			input = document.createElement("input");
			input.type = "button";
			input.className = "button";
			input.value = getLocalizedString("download");
			input.onclick=function(){_podcast.downloadClick(objItem.link)};
			input.onmouseover=function(){onMouseOverButton(this)};
			input.onmouseout=function(){onMouseOutButton(this)};
			td.appendChild(input);
			
			td=tr.appendChild(document.createElement("td"));
			td.style.paddingRight="10px";
			input = document.createElement("input");
			input.type = "button";
			input.className = "button";
			input.value = getLocalizedString("play");
			input.onclick=function(){_podcast.playClick(objItem)};
			input.onmouseover=function(){onMouseOverButton(this)};
			input.onmouseout=function(){onMouseOutButton(this)};
			td.appendChild(input);

			return objItem;
		}
}