var IMG = {
	// prefix for all "over" images
	imagebase : 'media/images/btn_',

	// flag for IE
	IE6 : false,

	// Initialize all menus for rollover
	menuinit : function() {
		if (IMG.IE6) {
			selector = 'span';
		} else {
			selector = 'img';
		}

		jQuery('#menu ' + selector).hover(function() {
			IMG.over(this);
		}, function() {
			IMG.out(this);
		});
	},

	// Swap image to non-rolled-over state
	out : function(elt) {
		IMG.setpng(elt, IMG.imagebase + jQuery(elt).attr('id') + '.jpg');
	},

	// Swap image to rolled-over state
	over : function(elt) {
		IMG.setpng(elt, IMG.imagebase + jQuery(elt).attr('id') + '-over.jpg');
	},

	// Preload rollover images and set the image name prefix.
	preloadimages : function() {
		base = arguments[0];
		IMG.imagebase = base;

		for(var i = 1; i<arguments.length; i++) {
			jQuery("<img>").attr("src", base + arguments[i]);
		}
	},

	// Set the source png for an element.
	setpng : function(elt, src) {
		if (IMG.IE6) {
			// this is the magic which loads a png, preserving
			// transparency.
			jQuery(elt).css('filter', "progid:DXImageTransform." +
							+ "Microsoft.AlphaImageLoader(src=\'"
							+ src + "\', sizingMethod='scale');");
		} else {
			jQuery(elt).attr('src', src);
		}
	}
}

var MUS = {
	ShowPicture: function ($link)
	{
		var src = $link.attr('href');
		var title = $link.children('img').attr('alt');
		var w = $link.attr('width');
		
//			$modal.length ? $modal.dialog('open') : $('<img alt="'+title+'" style="padding: 8px;" />').attr('src',src).appendTo('body').dialog({
		$('<img alt="'+title+'" style="padding:5px 0px;" />').attr('src',src).appendTo('body').dialog({
			title: title,
			modal: 'true',
			resizable: false,
			position: 'top',
			width: w + 'px'
		});
	}
}