
function dmbox(sLinkHref,pwidth,pheight) {
	var flvplayer = 'swf/player-licensed.swf';
	var path = window.location.pathname ;;
	var dir = path.substr(0,path.lastIndexOf("/"));
	var windowy = jQuery(window).scrollTop() + jQuery(window).height();
	var windowx = jQuery(window).width();

	var top = Math.round(jQuery(window).scrollTop() + ((jQuery(window).height() / 2) - (pheight / 2)));
	var left= Math.round(((jQuery(window).width() / 2) - (pwidth / 2)));
	if (jQuery("#lbMiddle").length == 0)
	{
                var _middle = jQuery(document.createElement("div")).attr({"id": "lbMiddle"}).css({'position':'absolute','z-index':'3','top': (top-50) + 'px', 'left':  left + 'px','width': pwidth+'px', 'height': (pheight+25)+'px'});
        	jQuery("body").append(_middle); 
        }
		jQuery("#lbMiddle").css({"display":"block"});	
		var _center = jQuery(document.createElement("div")).attr({"id": "lbCenter"}).css({'position':'absolute','z-index':'3','width': pwidth+'px', 'height': pheight+'px'});
		var _close = jQuery(document.createElement("a")).attr({id: 'lbCloseLink', href: '#'}).css({'text-align':'center','border':'outset 3px black','font':'small bold Verdana, Arail, Serif','position':'absolute','z-index':'5','left':'0px','background-color': '#efefef','top': (pheight+2) + 'px','display':'block','width':(pwidth-6)+'px','color':'#000'}).html('Close Video').click(closeMe);
		jQuery("#lbMiddle").append(_center);
		jQuery("#lbMiddle").append(_close);
		var so = new SWFObject(flvplayer, "ply", pwidth, pheight, "9", "#ffffff");
		so.addParam("wmode", "opaque");
		so.addVariable("file",dir + "/" + sLinkHref);
		so.addVariable("autostart","true");
		so.write(jQuery("#lbCenter").attr("id"));
 };

function closeMe()
	{
			jQuery("#lbMiddle").css({'display':'none'}).html('');
			return false;
	}

