var ua        = navigator.userAgent.toLowerCase(); 
var is_pc_ie  = ( (ua.indexOf('msie') != -1 ) && ( ua.indexOf('win') != -1 ) && ( ua.indexOf('opera') == -1 ) && ( ua.indexOf('webtv') == -1 ) );

function playSong(flashquery){
	var movieid = "myFlash";
	flashquery = "soundnum="+flashquery+"&loadNewSound=1";
	var i,values;
	if(is_pc_ie){
		var chunk = flashquery.split("&");
		for(i in chunk){
			values = chunk[i].split("=");
			document[movieid].SetVariable(values[0],values[1]);
		}
	}else{
		var divcontainer = "flash_setvariables_"+movieid;
		if(!document.getElementById(divcontainer)){
			var divholder = document.createElement("div");
			divholder.id = divcontainer;
			document.body.appendChild(divholder);
		}
		document.getElementById(divcontainer).innerHTML = "";
		var divinfo = "<embed src='/media/gateway.swf' FlashVars='lc="+movieid+"&fq="+escape(flashquery)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		document.getElementById(divcontainer).innerHTML = divinfo;
	}
}

function popImage(imageURL,imageTitle){
	window.open("/includes/imageviewer.html?"+imageURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function showImage(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}


function setMaincontentSize() {
	if (navigator.appName != "Microsoft Internet Explorer") {
		document.getElementById('maincontent').style.height=document.body.clientHeight-310+'px';
		if (document.getElementById('rightcontent') != null) {
			document.getElementById('rightcontent').style.height=document.body.clientHeight-310+'px';
		}
	}
}

function showLyrics(soundnum) {
	var language = 'de';
	if (document.location.href.indexOf('com/en/') >= 1) {
		language = 'en';	
	}
	LyricsDisplay=window.open('/'+language+'/'+'lyrics/'+soundnum+'.html','LyricsDisplay','height=400,width=300,toolbar=no,scrollbars=yes');
}