function getElementsByClassName(className)
	{
		var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
		var allElements = document.getElementsByTagName("*");
		var results = [];

		var element;
		for (var i = 0; (element = allElements[i]) != null; i++) {
			var elementClass = element.className;
			if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
				results.push(element);
		}

		return results;
	}


function OpenWindow(url, currency) {
	if (url.indexOf("?") == -1)
		var newUrl = url + "?language=de&currency=" + currency;
	else
		var newUrl = url + "&language=de&currency=" + currency;
	hswindow=window.open(newUrl,"Potato","width=780,height=580,location=no,menubar=no,statusbar=no,toolbar=no,scrollbars=yes,dependent=yes,resizable=yes,screenX=10,screenY=10");
	hswindow.focus();
}

function OpenTrackWindow(id, currency) {
	OpenWindow("https://www.potatosystem.com/process/sell?tan=" + id, currency);
}

function ToggleTracklist(id) {		
		divel = getElementsByClassName('tracklist-shadow');
		for(i=0; i<divel.length ;i++) {			
			divel[i].style.display = 'none';			
		}
		
		divel = getElementsByClassName('showtracks');
		for(i=0; i<divel.length ;i++) {
			divel[i].style.display = 'block';			
		}
		
		ShowTracks(id);
}
function ShowTracks(id) {
	document.getElementById('tracks' + id).style.display = 'block';
	document.getElementById('link' + id).style.display = 'none';
}

function HideTracks(id) {
	document.getElementById('tracks' + id).style.display = 'none';
	document.getElementById('link' + id).style.display = 'block';
}

function ShowArtists() {
	if (document.getElementById('artists').style.display == 'none') {
		document.getElementById('artists').style.display = 'block';
	}
	else {
		document.getElementById('artists').style.display = 'none';
	}
}

