//<![CDATA[
	window.XMLHTTP = null;
	window.mood = "";
	
	window.onload = function(){
		if(window.XMLHttpRequest){
			window.XMLHTTP = new XMLHttpRequest();
		}
		else if(window.ActiveXObject){
			try{
				window.XMLHTTP = new ActiveXObject("Msxml2.XMLHTTP");

				}catch(ex){
				try{
					window.XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch(ex){
					alert (ex);
				}
			}
		}
	}
	
	function set_mood(mood){
		window.mood = mood;
		var mood_div = document.getElementById("innercontent");
		var mood_name = document.getElementById("str_colour");
		//alert(mood_name.innerHTML);
		// black, white, grey, red, orange, yellow, green, blue, purple, pink
		var mood_colour = new Array("000000","ffffff","969696","f71e01","f79601","f7ee01","69e701","028af9","a105fc","fd06e0");
		var font_colour = new Array("ffffff","000000","ffffff","ffffff","ffffff","000000","000000","ffffff","ffffff","ffffff");
		document.getElementById("content02").style.backgroundColor = "#"+mood_colour[mood];
		mood_div.style.backgroundColor = "#"+mood_colour[mood];
		mood_div.style.color = "#"+font_colour[mood];
		var mood_xml_url = "/mood/mood.xml";
		window.XMLHTTP.open("GET", mood_xml_url);
		window.XMLHTTP.onreadystatechange = show_mood;
		window.XMLHTTP.send(null);
	}
		
	function show_mood(){
		if(XMLHTTP.readyState == 4){
			var font_colour = new Array("cnavilinks","cnavilinks_02","cnavilinks","cnavilinks","cnavilinks","cnavilinks_02","cnavilinks_03","cnavilinks","cnavilinks","cnavilinks");
			var mood_div = document.getElementById("innercontent");
			mood_div.innerHTML = "";
			var tmp = "";
			var obj = XMLHTTP.responseXML;
			if(obj.getElementsByTagName("moods")[0].getElementsByTagName("mood").length>0){
				var moods = obj.getElementsByTagName("moods")[0].getElementsByTagName("mood");

				// track
				tmp += '<table width="477" border="0" cellspacing="0" cellpadding="0" ><tr><td width="190" align="right"><a href="#" onclick="play_track('+moods[window.mood].getElementsByTagName("track")[0].getElementsByTagName("trackid")[0].firstChild.nodeValue+')"><img height="99" width="99" border="0" src="'+moods[window.mood].getElementsByTagName("track")[0].getElementsByTagName("image")[0].firstChild.nodeValue+'"></a></td>';
				tmp += '<td align="left" width="287"><strong>'+moods[window.mood].getElementsByTagName("track")[0].getElementsByTagName("trackname")[0].firstChild.nodeValue+'</strong><br />'+moods[window.mood].getElementsByTagName("track")[0].getElementsByTagName("artistname")[0].firstChild.nodeValue+'<br/><img src="/de/images/spacer.gif" width="1" height="10" border="0" /><br/><a href="#" onclick="play_track('+moods[window.mood].getElementsByTagName("track")[0].getElementsByTagName("trackid")[0].firstChild.nodeValue+')" class="'+font_colour[window.mood]+'"><strong>play</strong></a></td>';
				tmp += '</tr><tr>';
				
				if(window.mood == 0) tmp += '<td colspan="2" align="left"><img src="/de/images/lion/gfc_1x1_fff.gif" width="477" height="1" style="clear:left; margin-left:10px" vspace="15" /></td>';
				else tmp += '<td colspan="2" align="left"><img src="/de/images/lion/gfc_1x1_000.gif" width="477" height="1" style="clear:left; margin-left:10px" vspace="15" /></td>';
				
				// PL
				tmp += '</tr><tr>';
				tmp += '<td width="190" align="right"><a href="#" onclick="playlist('+moods[window.mood].getElementsByTagName("playlist")[0].getElementsByTagName("id")[0].firstChild.nodeValue+')"><img align="left" height="76" width="190" hspace="10" border="0" src="'+moods[window.mood].getElementsByTagName("playlist")[0].getElementsByTagName("image")[0].firstChild.nodeValue+'" hspace="10"></a></td>';
				tmp += '<td align="left" width="287"><strong>'+moods[window.mood].getElementsByTagName("playlist")[0].getElementsByTagName("name")[0].firstChild.nodeValue+'</strong><br/>'+moods[window.mood].getElementsByTagName("playlist")[0].getElementsByTagName("descr")[0].firstChild.nodeValue+'<br/><br/><a href="#" onclick="playlist('+moods[window.mood].getElementsByTagName("playlist")[0].getElementsByTagName("id")[0].firstChild.nodeValue+')" class="'+font_colour[window.mood]+'"><strong>play</strong></a></td>';
				tmp += '</tr><tr>';
				
				if(window.mood == 0) tmp += '<td colspan="2" align="left"><img src="/de/images/lion/gfc_1x1_fff.gif" width="477" height="1" style="clear:left; margin-left:10px" vspace="15" /></td>';
				else tmp += '<td colspan="2" align="left"><img src="/de/images/lion/gfc_1x1_000.gif" width="477" height="1" style="clear:left; margin-left:10px" vspace="15" /></td>';
				tmp += '</tr><tr>';
				
				// RADIO
				tmp += '<td width="190" align="right"><a href="#" onclick="channel('+moods[window.mood].getElementsByTagName("channel")[0].getElementsByTagName("id")[0].firstChild.nodeValue+')"><img align="left" height="76" width="190" border="0" src="'+moods[window.mood].getElementsByTagName("channel")[0].getElementsByTagName("image")[0].firstChild.nodeValue+'" hspace="10"></a></td>';
				tmp += '<td align="left" width="287"><strong>'+moods[window.mood].getElementsByTagName("channel")[0].getElementsByTagName("name")[0].firstChild.nodeValue+'</strong><br/>'+moods[window.mood].getElementsByTagName("channel")[0].getElementsByTagName("descr")[0].firstChild.nodeValue+'<br/><br/><a href="#" onclick="channel('+moods[window.mood].getElementsByTagName("channel")[0].getElementsByTagName("id")[0].firstChild.nodeValue+')" class="'+font_colour[window.mood]+'"><strong>play</strong></a></td>';
				tmp += '</tr></table>';
				mood_div.innerHTML = tmp;
			}
		}
	}

	function play_track(id){
		Play(id, '0');
	}
	function playlist(id){
		Play(id, '2');
	}
	function channel(id){
		Play(id, '5');
	}