function show_pic($url) {
	document.getElementById('picture_one').src = $url;
}

var FO_small;
var FO_autostart = true;
var tvMediaPlayer;

jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    return this;
}

function show_window_image (file_name, thumb_path, title) {
  document.getElementById('large_player').innerHTML = "<img src='" + file_name + "' id='showImage' />";

	$('#image_shadow').css('width', $(window).width() + "px");
  $('#image_shadow').css('height', $(window).height() + "px");

  var h = 350;	
  
  $('#video').css('height', h+20+"px");
  $('#video_player').css('height', h+20+"px");
  
	$('#image_shadow').center();
	$('#video').center();
	$('#image_shadow').show();
	$('#video').show();
}

function showJWPlayer(file_name, thumb_path, title, type) {
	var h = 350;
  if (type == 'ply') h = 30;

	var so = new SWFObject('player.swf',type,'645',h,'9');
	so.addParam('allowfullscreen','true');
	so.addParam('wmode','opaque');
	so.addVariable('skin','media/modieus.swf');
	so.addParam('playerready','playerReady');
	so.addVariable('file',file_name);
	so.addVariable('autostart','true');
	so.write('large_player');
	
	$('#image_shadow').css('width', $(window).width() + "px");
	$('#image_shadow').css('height', $(window).height() + "px");
	
  $('#video').css('height', h+20+"px");
  $('#video_player').css('height', h+20+"px");
  
	$('#image_shadow').center();
	$('#video').center();
	$('#image_shadow').show();
	$('#video').show();
}


function close_video_window() {
	if (tvMediaPlayer) {
		tvMediaPlayer.sendEvent('STOP');
		tvMediaPlayer = null;
	}
	$('#video').hide();
	$('#image_shadow').hide();
}

function playerReady(thePlayer) {
	tvMediaPlayer = window.document[thePlayer.id];
}

