$("div.header > div.middle > div#mainmenu > ul > li")
	.mouseover(function() {$(this).addClass("over")})
	.mouseout(function() {$(this).removeClass("over")})

var lightbox = function(callback) {
	return function(e) {
		if (typeof callback == "function") callback.call(this);
		$("div.modal").show();
		var left = parseInt($(window).width() / 2 - $("div.modal div.container").width() / 2);
		var top = parseInt($(window).height() / 2 - $("div.modal div.container").height() / 2) + (document.body.scrollTop || document.documentElement.scrollTop);	
		e.stopPropagation();
		e.preventDefault();
		$("div.modal div.mask").css({height: $("html").height()})
		$("div.modal div.container").css({left: left, top: top})
		$("div.modal a.close").click(function() {
			$("#video").html("");
			$("div.modal").hide();
		})
	}
}
$("a.quicktime").click(lightbox(function() {
	var width = 440
	var height = 264
	var file = this.href
	$("#video").html(
		'<object width="' + width + '" height="' + height + '"' +
			'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"' +
			'codebase="http://www.apple.com/qtactivex/qtplugin.cab">' +
			'<param name="src" value="' + file + '">' +
			'<param name="autoplay" value="true">' +
			'<param name="controller" value="false">' +
			'<embed src="' + file + '" width="' + width + '" height="' + height + '" autoplay="true" controller="false" pluginspage="http://www.apple.com/quicktime/download/"></embed>' +
		'</object>'
	)
}))
$("a.flash").click(lightbox(function() {
	var width = 480
	var height = 385
	var file = this.href
	$("#video").html(
		'<object width="' + width + '" height="' + height + '">' +
			'<param name="movie" value="' + file + '">' +
			'<param name="allowFullScreen" value="true">' +
			'<param name="allowscriptaccess" value="always">' +
			'<embed src="' + file + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' + width + '" height="' + height + '"></embed>' +
		'</object>'
	)
}))
