function attachEvent(el, event_name, function_name) {
	if(typeof(el) == "string") {
		el = $(el);
	}
	if(el.addEventListener) {
		el.addEventListener(event_name.substring(2, event_name.length), function_name, false);
	} else if(el.attachEvent) {
		el.attachEvent(event_name, function_name);
	} else {
		eval("el." + event_name + " = " + function_name);
	}
}

function init() {
	lbmovie = document.getElementById("lbmovie");
	if(lbmovie) {
		old_href = lbmovie.getAttribute("href");
		lbmovie.setAttribute("href", "#");
		attachEvent(lbmovie, "onclick", showLB);
	}
}

attachEvent(window, "onload", init);

function showLB() {
	var lbdiv = document.createElement("div");
	lbdiv.innerHTML  = "<div style=\"position:absolute; background-color:black; top:0px; left:0px; right:0px; bottom: 0px; opacity: .7; -moz-opacity:.7 -webkit-opacity:.7; filter:alpha(opacity=70);\">&nbsp;</div>";
	lbdiv.innerHTML += '<object name="m1" id="m1" style="position:absolute; width:320px; height:255px; top:50%; left:50%; margin-left:-160px; margin-top:-127px;\" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="255" width="320">\n';
	lbdiv.innerHTML += '<param name="src" value="' + old_href + '">\n';
	lbdiv.innerHTML += '<param name="autoplay" value="true">\n';
	lbdiv.innerHTML += '<param name="type" value="video/quicktime" height="255" width="320">\n';
	lbdiv.innerHTML += '<embed name="m2" id="m2" enablejavascript="true" style="position:absolute;  width:320px; height:255px; top:50%; left:50%; margin-left:-160px; margin-top:-127px;"  src="' + old_href + '" height="255" width="320" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/">\n';
	lbdiv.innerHTML += '</object>\n';
	lbdiv.innerHTML += '<a style="position:absolute; width:320px; height:20px; text-align:center; top:50%; left:50%; margin-left:-160px; margin-top:140px;\" href="#" onclick="javascript:try{document.m1.Stop();}catch(err){try{document.m2.Stop();}catch(err2){location.reload();}} this.parentNode.parentNode.removeChild(this.parentNode);">Close Movie</a>\n';
	document.getElementsByTagName("body")[0].appendChild(lbdiv);
}

var old_href = '';