var tunerRef;
	
function tuned() {
	if (typeof(tunerRef) == "undefined") {
		return false;
	}
	else if (typeof(tunerRef) == "object") {
		return true;
	} // may vary w/browsers
	else {
		return false;
	}
}

function tuneOut() {
	if (tuned()) {
		tunerRef.window.wmp.stop();
	}
}
function closeTuner() {
	if (tuned()) {
		tunerRef.close();
	}
}

function openTuner() {
	if (typeof(tunerRef) != "object") {
		tunerRef = window.open('wmptest.htm','tunerWin','left=20,top=20,width=250,height=100,location=0,menubar=0,status=0,toolbar=0,resizable=1');
	}
}

function tuneIn () {
	if (tuned()) {
		tunerRef.window.eval('go("http://www.live365.com/cgi-bin/play.m3u?station=judoka2k&tag=V1P")');
	}
}

function setState() {
	 tunerRef = window.open('http://undercoverradio.com/wmptest.htm','tunerWin','left=20,top=20,width=250,height=100,location=0,menubar=0,status=0,toolbar=0,resizable=1');
	
	if (tuned()) {
		$("openBtn").className = "hide";
		$("closeBtn").className = "hide";
		
		if ( (typeof(tunerRef) != "undefined") && (tunerRef != null) && (typeof(tunerRef.wmp) == "function") && (tunerRef.wmp.playState == 3)) {
			$("playBtn").className = "hide";
			$("stopBtn").className = "show";
			$("meter").className   = "show";
		}
		else {
			$("playBtn").className = "show";
			$("stopBtn").className = "hide";
			$("meter").className   = "hide";
		}
	}
	else {
		$("openBtn").className = "show";
		$("closeBtn").className = "hide";
		$("playBtn").className = "hide";
		$("stopBtn").className = "hide";
		$("meter").className   = "hide";
	}
}