var url2 = '';
var linktarget2 = '';

function playSound(playerName, iDelay, url, linktarget) {
	if (iDelay > 0) { url2 = url; linktarget2 = linktarget;
		
		niftyplayer(playerName).playToggle();
		window.setTimeout("weiter();", iDelay);
	} else {
		niftyplayer(playerName).playToggle();
		
		if (linktarget == '_blank') {
			window.open(url2);
		} else {
			document.location.href=url2;
		}
	}
}

function weiter() {

	if (url2.length > 0) {
		if (linktarget2 == '_blank') {
			window.open(url2);
		} else {
			document.location.href=url2;
		}
	}
}

function getContent(url) {

	//alert('url:' + url);
	//alert(document.location.href);

	$.ajax({
	url: url.replace(/\.html/, "/ajax.html"),
	success: function(html) {
		var markerstart = '<!--- MAIN CONTENT START -->';
		var markerend = '<!--- MAIN CONTENT END -->';
		
		html = html.substring(html.indexOf(markerstart),html.indexOf(markerend)+markerend.length) 
		$("#content")
			.fadeOut()
			.removeClass("loading")
			.css("display", "none")
			.html(html)
			.fadeIn();
	}
	});
}

