function showoriginal() {
	// toggle style entry
	var spans = document.getElementsByTagName('span');
	var n = 0;
	for (i=0; i<spans.length; i++) {
		//if (spans[i].className=='original') spans[i].className = 'originals';
		if (spans[i].className=='originals') {
			spans[i].innerHTML = ' ('+original[n]+')';
			n++;
		}
	}
	document.getElementById('showoriginal1').style.display = 'none';
	document.getElementById('showoriginal2').style.display = 'none';
	document.getElementById('showoriginal3').style.display = 'none';
}
function SetCookie(cookieName,cookieValue) {
	//Supports deleting
	if (cookieValue=='') {
		var expire = new Date();
		expire.setTime(expire.getTime() - 3600000*24*7);
		document.cookie = cookieName+"=;expires="+expire.toGMTString();
	}
	else document.cookie = cookieName+"="+escape(cookieValue)+'; path=/';
}
function GetCookie(cookieName) {
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return "";
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length;
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
function donateclick() {
	var donatecount = parseInt(GetCookie('donatecount'));
	if (isNaN(donatecount)) donatecount = 1;
	if ((donatecount % 10) == 3) document.getElementById('donateshow').style.display = '';
	donatecount++;	
	SetCookie('donatecount',donatecount);
}
var wimpyWindow;
function popmp3(id,title,lnk) {
	var playlist;
	wimpyWindow = window.open('','wimpy','status=0,menubar=0,scrollbars=0,toolbar=0,location=0,resizable=0,height=300,width=520,left=150,top=0');
	if (wimpyWindow.document.location.href=='about:blank') {
		// Set to wimpy doc with initial file specified
		wimpyWindow.document.location.href = '/wimpy/wimpy.htm?title='+title+'&file=/getfile.php?ID%3D'+id+'%26method%3DS&link='+lnk;
	} else {
		// Check to see if we already have this file added
		pn = -1; pi = 0;
		playlist = wimpyWindow.wimpy_getPlaylist();
		while (pi<playlist.length && pn==-1) {
			if (playlist[pi][2]=='/getfile.php?ID='+id+'&method=S') pn = pi;
			pi++;
		}
		wimpyWindow.focus();
		if (pn>-1) wimpyWindow.wimpy_gotoTrack(pn);
		else wimpyWindow.wimpy_addTrack(true,'/getfile.php?ID='+id+'&method=S','',title,lnk,'/coverart.jpg'); 
	}
}