function openVideoOverlay(videoPath,videoWidth,videoHeight,videoType,videoLink,linkOutText){
	$.modal("<table id=\"simplemodal-table\"><tr><td class=\"simplemodal-tl\"></td><td class=\"simplemodal-tc\"></td><td class=\"simplemodal-tr\"><a href=\"#\" class=\"simplemodal-close\" title=\"Close overlay\"><img src=\"/video_player/simplemodal-close.png\" width=\"28\" height=\"28\" alt=\"Close overlay\" /></a></td></tr><tr><td class=\"simplemodal-ml\"></td><td><div id=\"noFlashOverlay\" style=\"width:"+videoWidth+"px; height:"+videoHeight+"px; background:#FFFFFF\"><div style=\"padding:30px\"><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a><p style=\"font-size:12px\">You need Flash player 9+ and JavaScript enabled to view this video.</p></div></div></td><td class=\"simplemodal-mr\"></td></tr><tr><td class=\"simplemodal-bl\"></td><td class=\"simplemodal-bc\"></td><td class=\"simplemodal-br\"></td></tr></table>",{opacity:50,zIndex:9998,overlayClose:true});
	if(videoType == "FLV"){
		
		var flvPath = "/video_player/FlvPlayer.swf";
		
		var flashvars = {};
		flashvars.flvTarget = videoPath;
		flashvars.flvWidth = videoWidth;
		flashvars.flvHeight = videoHeight;
		flashvars.autoPlay = "true";
		flashvars.flvLink = videoLink;
		flashvars.linkOutText = linkOutText;
		var params = {};
		params.bgcolor = "#000000";
		params.wmode = "opaque";
		var attributes = {};
		attributes.id = "overlayPlayer";
		swfobject.embedSWF(flvPath, "noFlashOverlay", videoWidth, videoHeight, "9.0.0", false, flashvars, params, attributes);
	}
	else if(videoType == "YouTube"){
		var flashvars = {};
		flashvars.fs = "1";
		var params = {};
		params.wmode = "opaque";
		params.autoplay = "1";
		params.allowScriptAccess = "always";
		params.allowFullScreen = "true";
		var attributes = {};
		attributes.id = "overlayPlayer";
		
		//http://www.youtube.com/watch?v=12dcxI9S1Nk
		//http://www.youtube.com/v/12dcxI9S1Nk
		videoPath = videoPath.split('/watch?v=').join('/v/').split('&')[0] + "?autoplay=1&autohide=1";
		
		swfobject.embedSWF(videoPath, "noFlashOverlay", videoWidth, videoHeight, "9.0.0", false, flashvars, params, attributes);
	}
}
