function viewCover(url) {
	var popup=window.open(url,'lmtcover','height=520,width=520,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	if (window.focus) popup.focus();
}
function popupPlayer(uri) {
	var w = 390;
	var h = 485;
	if (navigator.userAgent.match(/chrome/i)) {
		w = 415; h = 530;
	}
	var popup=window.open('/player.php?'+uri,'lmtplayer','height='+h+',width='+w+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	if (window.focus) popup.focus();
}
function playAll(id, sel) {
	var url = 'album_id='+id;
	if (typeof sel != 'undefined') url += '&select='+sel;
	popupPlayer(url);
}
function playTrack(id) {
	popupPlayer('track_id='+id);
}
function playPlaylist(id, sel) {
	var url = 'playlist_id='+id;
	if (typeof sel != 'undefined') url += '&select='+sel;
	popupPlayer(url);
}
cache = new Array();
function preload() {
	var args_len = arguments.length;
	for (var i = args_len; i--;) {
		var cacheImage = document.createElement('img');
		cacheImage.src = arguments[i];
		cache[cache.length] = cacheImage;
	}
}
