var json;

function showVideo()
{	
	return false;
	
			new Ajax.Request("http://www.themovechannel.com/tmc.system/tmc.ajax.crossdomain.asp", {
		method: 'post',
		postBody:"{url:'http://www.themovechannel.tv/services/featuredVideoService.asmx/GetVideos/',getType:'json'}",
			asynchronous:true,
		onSuccess: function(transport) {
		
			try {
			var vids="";
			json=transport.responseJSON;
			json.each(function(j){
				vids=vids + "video" + j.number + "=" + j.rtmp + "&";
			});
			
			/*json.each(function(j){
				vids=vids + "video" + j.number + "=rtmp://88.208.233.121/vod_TMC/Property/InterPhone/movie.flv&";
				}
			);*/
			$("videoLink").href=json[0].url;
			$("videoLink").innerHTML="www.TheMoveChannel.TV";
		//	$('dvTV').innerHTML="<embed id='emPlayer' width='300' height='243' align='middle' type='application/x-shockwave-flash' flashvars='" + vids + "' autostart='true' salign='t' allowfullscreen='true' allowscriptaccess='sameDomain' menu='true' name='tmctv2' bgcolor='#000000' devicefont='false' scale='showAll' loop='true' play='true' pluginspage='http://www.macromedia.com/go/getflashplayer' quality='high' src='/tmctv_s5.swf'/>"+$("dvTV").innerHTML;
			var homepagePaused=getCookie("homepageVideoPaused");
			var homepageVol=getCookie("homepageVideoVol");
			if (homepageVol=="") homepageVol=100;
			
			
			$('dvTV').innerHTML="<embed width='300' height='243'  align='middle' type='application/x-shockwave-flash' flashvars='paused=" + homepagePaused + "&volume=" + homepageVol + "&" + vids + "'  salign='lt' allowfullscreen='false' allowscriptaccess='sameDomain' menu='true' name='tmctv_s5' bgcolor='#ffffff' devicefont='false' wmode='window' scale='showall' loop='true' play='true' pluginspage='http://www.macromedia.com/go/getflashplayer' quality='high' src='tmctv_s5.swf'/>" + $('dvTV').innerHTML;
			}
			catch (e)
			{
			
			}
		}
		});
		
		
}

 function getVolumeFromFlash(str) {
  document.cookie = "homepageVideoVol=" + str + ";";

  return str + " received";
 }
  function getPausedFromFlash(str)
 {
 document.cookie = "homepageVideoPaused=true;";
  return str + " received";
 }

 function getPlayFromFlash(str)
 {
	 document.cookie = "homepageVideoPaused=false;";
  return str + " received";
 }
 
 
function getVideoIndexFromFlash(r)
{
	json.each(function(j){
		if (j.rtmp==r)
		{
			$("videoLink").attributes["href"].value=j.url;
			$("videoLink").innerHTML="www.TheMoveChannel.TV";
		}
	});
}

 function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}
