jQuery(document).ready(function() {
	
	jQuery('div#flvplay').dialog({
	autoOpen: false,
	draggable: false,
	modal: true,
	resizable: false,
	minWidth: 710,
	minHeight: 370,
	beforeClose: function(event, ui) { 
		jQuery('div#flvplay').html('');
	}
	});
	
	jQuery('a.vidlink').click(function() {
		var videoID = jQuery(this).attr('id');
		flashSend(videoID);
		jQuery('div#flvplay').dialog('open');
		return false;
	});

 });
 
function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}

function flashSend(id) {
  so.addVariable("xmlURL", id);
  so.write("flvplay");
}

function closeTV()
{
	jQuery('div#flvplay').dialog('close');
	jQuery('div#flvplay').html('');
}

 function trailerSend(id) {
  so.addVariable("vtype", "trailer");
  so.addVariable("xmlURL", id);
  so.write("flvplay");
  moveTv();
  document.getElementById("tv-dock").style.display = "block";
	
  if (document.documentElement.scrollTop != 100) document.documentElement.scrollTop = "100";
  if (document.body.scrollTop != 100) document.body.scrollTop = "100";
  
}
 
 function playMovie(text)
 {
	getFlashMovie("player").sendTextToFlash(text);
	clearTimeout(playTheMovie);	
 }
