/**
 * Show videos in Shadowbox for non-mobile browsers and in the YT application for mobile browsers.
 * @author jose.dsilva
 */
Shadowbox.init({
  modal: true,
  viewportPadding: 0,
  overlayOpacity:0.8
});

function showFilmInShadowBox(id, wd, ht) {
	Shadowbox.open({
		content: '<iframe src="/ajax/getsidebarfilmiframe/?id='+id+'" type="text/html" width="'+wd+'" height="'+ht+'" frameborder="0"></iframe>',
		player: "html",
		width: wd,
		height: ht
	});
}

$(document).ready(function() {
  $(".show-shadowbox").click(function(event) {
	var filmId = $(this).attr('filmid');
  	var a=$(this).attr('framedim').split(";");
    var w=(a[0].split(":"))[1];
    var h=(a[1].split(":"))[1];

    showFilmInShadowBox(filmId, w, h);
    return false;
  });
});

