//Broadcast listen screen launch script V2.1 Copyright 2010 MFAC
//
var logPath_OO="http://www.rocknrollzone.com/cgi-bin/hitlog.pl?bcast=OO32-"
var logPath_OR="http://www.rocknrollzone.com/cgi-bin/hitlog.pl?bcast=OR64-"
var autoPlayURL_OO="http://www.live365.com/stations/57204?play"
var autoPlayURL_OR="http://www.live365.com/stations/167063?play"

ob1=(new Image())
var gMiniWindow=false
var loop=0
//
function dispHTML(dspID) {
	dspID=tagOpen+dspID+tagClose
	if(document.all) document.all.dyn1.innerHTML=dspID
	else if (document.getElementById) {
		document.getElementById('dyn1').innerHTML=dspID
	}
	else if(document.layers) {
		document.dyn1Net.document.write(dspID)
		document.dyn1Net.document.close()
	}
}
//
function loadPlayer() {
    window.open(autoPlayURL)
	setTimeout("window.history.back()",10000)
}
//
function manual() {
    if (live) ob1.src=logPath+"M"
    loop=0
	setTimeout("window.history.back()",1000)
}
//
function runTest() {
   	if (gMiniWindow==null) {
        if (live) ob1.src=logPath+loop
        dispHTML(status1); loop=0
		timerVar2=setTimeout("loadPlayer()",2000)
	}
	else if (loop<6) {
		loop++; timerVar2=setTimeout("runTest()",2000)
		dispHTML('Please Stand By... &nbsp\;'+(loop-1))
	}
	else {
        dispHTML(status0); loop=0
		if (live) ob1.src=logPath+"X"
	}
}
//
function setStation(st) {
   if (st=="OO"){logPath=logPath_OO; autoPlayURL=autoPlayURL_OO}
   else {logPath=logPath_OR; autoPlayURL=autoPlayURL_OR}

   autoPlayTag="<A HREF=\"" +autoPlayURL+ "\" TARGET=\"_blank\" onClick=\"manual()\">Live365 station page</A>"

   status0="Sorry ! Live365 stations may either be temporarily unavailable or blocked from your network"
   +" ... &nbsp\;Perhaps try again later<BR>&nbsp\;<BR>"
   +" If your browser is set for high-security, try manually launching the "+autoPlayTag+"."

   status1="Auto-launching this broadcast from the "+autoPlayTag+" ...<BR>&nbsp\;<BR>"
   +"Please disable all pop-up blockers until the station page has opened !"

   tagOpen="<SPAN CLASS='X75'><B>"; tagClose="</B></SPAN>"

   runTest()
}
//
listenExt=true