var ViewVideo = 
{
	init: function()
	{
		$('moreSources').onclick = function()
		{
			this.disable();
			this.setValue('Loading Sources...');
		}
		
		ViewVideo.resizeIframe();
	},
	
	resizeIframe: function()
	{
		var iHeight = window.innerWidth; //Firefox

		if (document.body.clientHeight)
		{
			iHeight = document.body.clientHeight; //IE
		}
		
		if (!$('video-frame'))
		{
			return;
		}
		
		$('video-frame').style.height = parseInt(iHeight - $('video-frame').offsetTop) + 'px';
	}
}

var SearchDownloads =
{
	init: function()
	{
		var pDownload1 = $('downloadButtoniSoftwareTV');
		var pDownload2 = $('downloadButtonLimewire');
		
		if (!pDownload1 || !pDownload2)
		{
			return;
		}
		
		var szMessage = 'Available: <strong style="color: #509f03;">Yes</strong>';
		
		setTimeout(function() { pDownload1.update(szMessage); }, 425 );
		setTimeout(function() { pDownload2.update(szMessage); }, 775 );
	}	
}

Event.observe(window, 'resize', ViewVideo.resizeIframe);
Event.observe(window, 'load', ViewVideo.init);
Event.observe(window, 'load', SearchDownloads.init);
Event.observe(window, 'load', function() { Semto_Rating.init('rate-video', VidsTv.getBaseUrl()) });
Event.observe(window, 'load', function() { Semto_Report.init('report-video', VidsTv.getBaseUrl()) });