//<![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("mood-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("mood-content").style.backgroundColor = "#"+mood_colour[mood];
		mood_div.style.backgroundColor = "#"+mood_colour[mood];
		mood_div.style.color = "#"+font_colour[mood];
		//var mood_xml_url = "/cgi-bin/getrss.cgi?q=mood";
		var mood_xml_url = "/xml/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("mood-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");

				
			var tr_trackid = $(moods).eq(window.mood).find('track').find('trackid').text(); 
			var tr_image = $(moods).eq(window.mood).find('track').find('image').text(); 
			var tr_trackname = $(moods).eq(window.mood).find('track').find('trackname').text(); 
			var tr_artistname = $(moods).eq(window.mood).find('track').find('artistname').text(); 
			
			var pl_name = $(moods).eq(window.mood).find('playlist').find('name').text(); 
			var pl_id = $(moods).eq(window.mood).find('playlist').find('id').text(); 
			var pl_image = $(moods).eq(window.mood).find('playlist').find('image').text(); 
			var pl_descr = $(moods).eq(window.mood).find('playlist').find('descr').text(); 

			var ch_name = $(moods).eq(window.mood).find('channel').find('name').text(); 
			var ch_id = $(moods).eq(window.mood).find('channel').find('id').text(); 
			var ch_image = $(moods).eq(window.mood).find('channel').find('image').text(); 
			var ch_descr = $(moods).eq(window.mood).find('channel').find('descr').text(); 			
				
						
						tmp += '<div class="result '+font_colour[window.mood]+'">';
								
								tmp += '<div class="col"><div class="left">	<a class="image" align="right" href="join-now.html" onclick=""><img height="99" width="99" border="0" src="'+tr_image+'"></a></div>';
								tmp += '<div class="right"><a class="image" href="join-now.html" onclick=""><span class="trackname">'+tr_trackname+'</span></a><span class="artistname">'+tr_artistname+'</span></div></div><div class="clear"></div>';


								tmp += '<div class="col"><div class="left"><a class="image"  href="join-now.html" onclick=""><img height="76" width="190" border="0" src="'+pl_image+'"></a></div>';
								tmp += '<div class="right"><span class="name">'+pl_name+'</span><span class="descr">'+pl_descr+'</span><a href="join-now.html" onclick="">play</a></div></div><div class="clear"></div>';


								tmp += '<div class="col" style="border-bottom:0;"><div class="left" style="width:190px; height:76px; "><a class="image"  href="join-now.html" onclick=""><img height="76" width="190" border="0" src="'+ch_image+'"></a>&nbsp;</div>';
								tmp += '<div class="right"><span class="name">'+ch_name+'</span><span class="descr">'+ch_descr+'</span><a href="join-now.html" onclick="">play</a></div></div><div class="clear"></div>';						
						
						tmp += '</div>';
						mood_div.innerHTML = tmp;
			
				/*

				// 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" valign="top"><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');
	}


	function play_album(id){

		mywindow = window.open("http://www.napster.co.uk/listen-to-music/", "Nshop");
		mywindow.focus();

	}

	function play_track(id){

		mywindow = window.open("http://www.napster.co.uk/listen-to-music/", "Nshop");
		mywindow.focus();

	}

	function show_playlist(id){

		mywindow = window.open("http://www.napster.co.uk/listen-to-music/", "Nshop");
		mywindow.focus();

	}

	function channel(id){

		mywindow = window.open("http://www.napster.co.uk/listen-to-music/", "Nshop");
		mywindow.focus();

	}