/* Thickbox needs to hide the video player whenever it displays a modal.
   The alternative is to use the wmode=transparent rendering mode when
   embedding the Flash object, but that would reduce video playback performance.
*/

// Override tb_init function as it is defined in thickbox-min.js
function tb_init(domChunk){
	$(domChunk).click(function(){
	var t = this.title || this.name || null;
	var a = this.href || this.alt;
	var g = this.rel || false;
	tb_show(t,a,g);
	this.blur();
	$("#player_api").parent().css("visibility","hidden");
	return false;
	});
}

// Override tb_remove function as it is defined in thickbox-min.js
function tb_remove() {
 	$("#TB_imageOff").unbind("click");
	$("#TB_closeWindowButton").unbind("click");
	$("#TB_window").fadeOut("fast",function(){
		$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();
		$("#player_api").parent().css("visibility","visible");
		});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	document.onkeyup = "";
	return false;
}