function Browse(name, defaultId, initialized, servletpath)
{
	var m_name = name;
	var m_componentName = "_" + name.toLowerCase();
	var m_defaultId = defaultId;
	var m_initialized = false;
	var m_servletpath = "browse";
	if(initialized!=null)
		m_initialized = initialized
	if(servletpath!=null)
		m_servletpath = servletpath;
	var m_programList = new ProgramList();
	
	this.display = function()
		{
			if(!m_initialized)
			{
				this.getCategory(m_defaultId);	
				m_initialized = true;
			}
			_console.lastReloadComponent = this;
		}
	
	var m_lastId = null;
	this.reload = function()
		{
			this.resetMode();
			this.getCategory(m_lastId);
		}
	
	this.resetMode = function()
		{
			m_programList.setMode();
		}
		
	this.setMode = function(m, cid)
		{
			m_programList.setMode(m);
			this.getCategory(cid);
		}
		
	this.getCategory = function(cid, pn)
		{
			if(pn==null)
				pn = 1;
			var args = new Object();
			args.cid = cid;
			args.component = m_componentName;
			if(cid=="newvideos")
			{
				args.newvideos = "true";
				args.count = ProgramList.PAGESIZE_THUMB;
			}
			if(String(cid).indexOf("hotvideos")==0)
			{
				args.hotvideos = cid;
				args.count = ProgramList.PAGESIZE_THUMB;
			}
			if(cid=="toprated")
			{
				args.toprated = "true";
				args.count = ProgramList.PAGESIZE_THUMB;
			}
			m_programList.setURLParams(args, pn);
			if(Console.MODE_LARGE==_console.m_consoleMode)
			{
				args.ptrs = ProgramList.PAGESIZE_THUMB_ROWSIZE_LARGE;
				args.large = "true";
			}
			m_lastId = cid;
			_console.getComponentContent(m_servletpath, args, this.getCategoryCallBack);
			_util.cancelEvt(window.event);
		}
		
	this.getCategoryCallBack = function(result)
		{
			document.getElementById("content_"+m_name).innerHTML = result;
			var cats = new Array();
			switch(m_name)
			{
			case "WhatsNew":
				cats[0] = "Top Videos";
				cats[1] = "Whats New";
				break;
			case "WhatsHot":
				cats[0] = "Top Videos";
				cats[1] = "Whats Hot";
				break;
			case "TopRated":
				cats[0] = "Top Videos";
				cats[1] = "Top Rated";
				break;
			default:
				var bc = document.getElementById("breadCrumb");
				if(bc!=null)
				{
					var ls = bc.getElementsByTagName("A");
					for(var i=0;i<ls.length;i++)
						cats[cats.length] = ls[i].innerHTML;
				}
				break;	
			}
			if(cats.length>0)
				trackBrowse(cats);
		}
}

function LiveEvent()
{
	var m_initialized = false;
	
	this.initialize = function()
		{
			m_initialized = true;
		}
	
	this.display = function()
		{
			if(!m_initialized)
			{
				this.getLiveEvents();	
				m_initialized = true;
			}
			_console.lastReloadComponent = this;
		}
	
	var m_lastId = null;
	this.reload = function()
		{
			if(m_lastId==null)
				this.getLiveEvents();
			else
			{
				var args = new Object();
				args.id = m_lastId;
				if(Console.MODE_LARGE==_console.m_consoleMode)
				{
					args.ptrs = ProgramList.PAGESIZE_THUMB_ROWSIZE_LARGE;
					args.large = true;
				}
				else
					args.ptrs = ProgramList.PAGESIZE_THUMB_ROWSIZE;
				_console.getComponentContent("liveevents", args, this.getLiveEventsCallBack);
			}
		}
	
	this.getLiveEvents = function()
		{
			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;
			_console.getComponentContent("liveevents", args, this.getLiveEventsCallBack);
		}
	
	this.getLiveEvent = function(videoType, videoId, videoPath, videoFormats)
		{
			if(videoType==Console.VIDEO_VOD)
				_console.changeLayoutMode(Console.MODE_REGULAR);
				
			var args = new Object();
			args.id = videoId;
			if(Console.MODE_LARGE==_console.m_consoleMode)
			{
				args.ptrs = ProgramList.PAGESIZE_THUMB_ROWSIZE_LARGE;
				args.large = true;
			}
			else
				args.ptrs = ProgramList.PAGESIZE_THUMB_ROWSIZE;
			m_lastId = videoId;
			_console.getComponentContent("liveevents", args, this.getLiveEventsCallBack);
			_console.playVideo(videoType, videoId, videoPath, videoFormats);
		}
	
	this.getLiveEventsCallBack = function(result)
		{
			document.getElementById("content_LiveEvent").innerHTML = result;
			var t = new Array();
			t[0] = "Live Events";
			trackBrowse(t);
		}
}