function show_player( $query ) {

	$url = "/xml/xspf.php";

	if( $query ) {
		$url+= $query;
	}

	var oWin = window.open( "/player.php?playlist=" + $url, "player", "screenX=20,screenY=500,width=400,height=170,resizable=no,titlebar=no,toolbar=no,scrollbars=no,menubar=no" );

	if (oWin==null || typeof(oWin)=="undefined") {
		document.getElementById( "popupMessage" ).className = "visible";
	}

}
	windowObject.addLoadFunction( initAutoSelectText );
	
	function initAutoSelectText() {
		var body = document.getElementById("pageContainer");
		var eles = grabEleByNameAndClass( "input", "autoSelect", body );
		for( i = 0; i < eles.length; i++ ) {
			eles[i].onfocus = autoSelectText;
			eles[i].onclick = autoSelectText;
		}
	}
	
	function autoSelectText() {
		this.select();
	}
	
	var videos = new Array();
	
	function swapVideo( video ) {
		var MainVideo = new ObjectRewrite('/flash/flvplayer.swf?file=' + videos[video]["video_url"] + "&autostart=true&enablejs=true", 355, 277, 7, "FFFFFF", "window", "mediaplayer");
		MainVideo.prepForFlash();
		grabElement("mainVideo").innerHTML = MainVideo.getHTML();	
		grabElement("mainVideoArtist").innerHTML = videos[video]["artistName"];

		var title = videos[video]["songTitle"];

		if(videos[video]["artistName"].length > 27)
			title = "...";
		if(title.length + videos[video]["artistName"].length > 30)
			title = title.substring(0, 27 - videos[video]["artistName"].length) + "...";

		grabElement("mainVideoTitle").innerHTML = title;

		var embed = document.getElementById("embedText");
		if(embed != null)
			embed.value = '<embed src="http://yamrecordings.com/flash/flvplayer.swf?file=http://yamrecordings.com' + videos[video]["video_url"] + '" wmode="window" quality="high" bgcolor="FFFFFF" width="355" height="277" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';


	}

	function swapYTVideo(video) {
		var MainVideo = new ObjectRewrite(videos[video]["video_url"], 355, 277, 7, "transparent", "transparent" );
	   	MainVideo.prepForFlash();
		grabElement("mainVideo").innerHTML = MainVideo.getHTML();	
		grabElement("mainVideoArtist").innerHTML = videos[video]["artistName"];

		var title = videos[video]["songTitle"];

		if(videos[video]["artistName"].length > 27)
			title = "...";
		if(title.length + videos[video]["artistName"].length > 30)
			title = title.substring(0, 27 - videos[video]["artistName"].length) + "...";

		grabElement("mainVideoTitle").innerHTML = title;


		if(embed != null)
			embed.value = '<object width="425" height="350"><param name="movie" value="' + videos[video]["video_url"] + '"></param><param name="wmode" value="transparent"></param><embed src="' + videos[video]["video_url"] + '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
	}


