var TuneinTabMenu = '<!-- Browser Tunein Tab Menu --> \
	<ul class="navigation" id="TuneinList_88" style="display: block; width: 385px;";> \
      <li><a id="TuneinList_link_0" href="javascript:DisplayStream(\'TuneinList_\', 0);var tuneinstream=1;" style="font-size:9px"><span><span>Featured Sermon</span></span></a></li> \
      <li><a id="TuneinList_link_1"  href="javascript:DisplayStream(\'TuneinList_\', 1);var tuneinstream=2;" class="nowplaying" style="font-size:9px"><span><span>Bible Study</span></span></a></li> \
      <li><a id="TuneinList_link_2"  href="javascript:DisplayStream(\'TuneinList_\', 2);var tuneinstream=3;" style="font-size:9px"><span><span>Healing-Prayer</span></span></a></li> \
      <li><a id="TuneinList_link_3"  href="javascript:DisplayStream(\'TuneinList_\', 3);var tuneinstream=4;" style="font-size:9px"><span><span>Music</span></span></a></li> \
	  <li><a id="TuneinList_link_88" href="javascript:DisplayStream(\'TuneinList_\', 88)" style="font-size:9px"><span><span>next..</span></span></a></li> \
    </ul> \
	<ul class="navigation" id="TuneinList_99" style="display: none; width: 385px;";> \
      <li><a class="tabselected" id="TuneinList_link_4" href="javascript:DisplayStream(\'TuneinList_\', 4);var tuneinstream=5;" style="font-size:9px"><span><span>Espa&#241;ol</span></span></a></li> \
	  <li><a id="TuneinList_link_5" href="javascript:DisplayStream(\'TuneinList_\', 5); var tuneinstream=6;" style="font-size:9px"><span><span>Fran&ccedil;ais</span></span></a></li> \
	  <li><a id="TuneinList_link_6" href="javascript:DisplayStream(\'TuneinList_\', 6);var tuneinstream=false;" style="font-size:9px"><span><span>Videos</span></span></a></li> \
	  <li><a id="TuneinList_link_7" href="javascript:DisplayStream(\'TuneinList_\', 7);var tuneinstream=\'od\';" style="font-size:9px"><span><span>Sermons Ondemand</span></span></a></li> \
	  <li><a id="TuneinList_link_99" href="javascript:DisplayStream(\'TuneinList_\', 99)" style="font-size:9px"><span><span>prev..</span></span></a></li> \
    </ul> \
   <div class="streamborder" style="width:430px;"></div> \
 <!-- Sermon Today --> \
<table width="385" border="0" align="left" cellpadding="1" cellspacing="0" background="/LWBImages/Menus/TabsMenuThemes/streambkgd.png" id="TuneinList_0" style="display: none" valign="top"> \
  <tr> \
    <td width="90%" class="scripture" style="font-size:10px;">Now Playing: <span id="Songtitle_TuneinList_0" class="stylenowplaying" style="font-size:10px;"></span></td>\
	<td width="10%" class="statistic"><span id="Listeners_TuneinList_0" style="font-size:10px; color:#006600"></span>/50&nbsp;</td> \
  </tr> \
  <tr> \
    <td colspan="2"><div class="streamborderbottom" style="width:430px;"></div></td> \
  </tr> \
<!--tunein-button-->\
</table> \
<!-- Bible Study --> \
<table width="385" border="0" align="left" cellpadding="1" cellspacing="0" background="/LWBImages/Menus/TabsMenuThemes/streambkgd.png" id="TuneinList_1" style="display:none" valign="top"> \
  <tr> \
    <td width="90%" class="scripture" style="font-size:10px;">Now Playing: <span id="Songtitle_TuneinList_1" class="stylenowplaying"  style="font-size:10px;"></span></td>\
    <td width="10%" class="statistic"><span id="Listeners_TuneinList_1" style="font-size:10px; color:#006600"></span>/50&nbsp;</td>\
  </tr> \
  <tr> \
    <td colspan="2"><div class="streamborderbottom" style="width:430px;"></div></td> \
  </tr> \
<!--tunein-button-->\
</table> \
<!-- Prayer-Healng Line --> \
<table width="385" border="0" align="left" cellpadding="1" cellspacing="0" background="/LWBImages/Menus/TabsMenuThemes/streambkgd.png" id="TuneinList_2" style="display: none" valign="top"> \
  <tr> \
    <td width="90%" class="scripture" style="font-size:10px;">Now Playing: <span id="Songtitle_TuneinList_2" class="stylenowplaying"  style="font-size:10px;"></span></td> \
	<td width="10%" class="statistic"><span id="Listeners_TuneinList_2" style="font-size:10px; color:#006600"></span>/50&nbsp;</td>\
  </tr> \
  <tr> \
    <td colspan="2"><div class="streamborderbottom" style="width:430px;"></div></td> \
  </tr> \
<!--tunein-button-->\
</table> \
<!-- Music --> \
<table width="385" border="0" align="left" cellpadding="1" cellspacing="0" background="/LWBImages/Menus/TabsMenuThemes/streambkgd.png" id="TuneinList_3" style="display: none" valign="top"> \
  <tr> \
    <td width="90%" class="scripture" style="font-size:10px;">Now Playing: <span id="Songtitle_TuneinList_3" class="stylenowplaying"  style="font-size:10px;"></span></td>\
	<td width="10%" class="statistic"><span id="Listeners_TuneinList_3" style="font-size:10px; color:#006600"></span>/50&nbsp;</td> \
    </span></td> \
  </tr> \
  <tr> \
    <td colspan="2"><div class="streamborderbottom" style="width:430px;"></div></td> \
  </tr> \
<!--tunein-button-->\
</table> \
<!-- Spanish Sermons --> \
<table width="385" border="0" align="left" cellpadding="1" cellspacing="0" background="/LWBImages/Menus/TabsMenuThemes/streambkgd.png" id="TuneinList_4" style="display: none" valign="top"> \
  <tr>\
    <td width="90%" class="scripture" style="font-size:10px;">Serm&oacute;n Resaltado: <span id="Songtitle_TuneinList_4" class="stylenowplaying"  style="font-size:10px;"></span></td> \
	<td width="10%" class="statistic"><span id="Listeners_TuneinList_4" style="font-size:10px; color:#006600"></span>/50&nbsp;</td>\
  </tr> \
  <tr> \
    <td colspan="2"><div class="streamborderbottom" style="width:430px;"></div></td> \
  </tr> \
<!--tunein-button-->\
</table> \
<!-- French Sermons --> \
<table width="385" border="0" align="left" cellpadding="1" cellspacing="0" background="/LWBImages/Menus/TabsMenuThemes/streambkgd.png" id="TuneinList_5" style="display: none" valign="top"> \
  <tr> \
    <td width="90%" class="scripture" style="font-size:10px;">Sermon Du Jour: <span id="Songtitle_TuneinList_5" class="stylenowplaying"  style="font-size:10px;"></span></td> \
	<td width="10%" class="statistic"><span id="Listeners_TuneinList_5" style="font-size:10px; color:#006600"></span>/50&nbsp;</td>\
  </tr> \
  <tr> \
    <td colspan="2"><div class="streamborderbottom" style="width:430px;"></div></td> \
  </tr> \
<!--tunein-button-->\
</table> \
<!-- Wm Branham Videos --> \
<table width="895" border="0" align="center" cellPadding="1" cellSpacing="0" id="TuneinList_6" class="lwbnavigation" valign="top">\
    <tr>\
      <td width="49" rowspan="4"><div id="TuneinList_videoscreen"><a href="javascript:go_to(\'http://www.macromedia.com/go/getflashplayer\');">Get the flash player</a> to see these videos.</div></td>\
      <td width="5" rowspan="4">&nbsp;</td>\
      <td colspan="3" class="scripture"><div align="center"><span class="StreamTitle">William Branham Videos</span><br />\
            <span class="nowplaying"><em>(Select thumbnail below to see video)<br><span>Select Sub-title(work in progress): <a href="javascript:createplayer(current_video, true, \'TuneinList_videoscreen\',\'ENG\')">English</a>&nbsp;<a href="javascript:createplayer(current_video, true, \'TuneinList_videoscreen\',\'FRN\')">French</a>&nbsp;<a href="javascript:createplayer(current_video, true, \'TuneinList_videoscreen\',\'SPN\')">&nbsp;Spanish</a></span></em></span><br />&nbsp;</div></td>\
      <td width="18">&nbsp;</td>\
      <td width="10">&nbsp;</td>\
      <td width="500" align="left" class="statisticsbox">Listeners</td>\
    </tr>\
    <tr>\
      <td width="106" class="thumbnail"><a href="javascript:createplayer(\'/lwbplayer/ondemand.php?file=/LWBVideos/WmBinterview.flv\', true, \'TuneinList_videoscreen\')"><font color="#009900" style="font-weight:bold";>Interview</font><img src="../LWBVideos/WmBinterview.jpg" height="75" width="100" alt="Wm Branham Interview - 53-0800"  /></a></td>\
      <td width="106" class="thumbnail"><a href="javascript:createplayer(\'/lwbplayer/ondemand.php?file=/LWBVideos/PrayerHealingLine1.flv\', true, \'TuneinList_videoscreen\')"><font color="#009900" style="font-weight:bold";>Prayer-Healine Line</font><img src="../LWBVideos/PrayerHealingLine1.jpg" height="75" width="100" alt="Prayer-Healing Line1 - 53-0800" /></a></td>\
      <td width="155" class="thumbnail"><a href="javascript:createplayer(\'/lwbplayer/ondemand.php?file=/LWBVideos/WmBSermon.flv\', true, \'TuneinList_videoscreen\')"><font color="#009900" style="font-weight:bold";>Deep Calleth Unto the Deep</font><img src="../LWBVideos/WmBSermon.jpg" alt="Wm Branham Sermon - 54-0624" width="100" height="75" /></a></td>\
      <td>&nbsp;</td>\
      <td>&nbsp;</td>\
	  <td valign="top" align="left" style="font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#006600"><span id="Listeners_TuneinList_6" style="font-size:10px; color:#006600"></span><span class="statistic">/25</span></td>\
    </tr>\
    <tr>\
      <td class="thumbnail"><a href="javascript:createplayer(\'/lwbplayer/ondemand.php?file=/LWBVideos/HowToReceiveHealing.flv\', true, \'TuneinList_videoscreen\')"><img src="../LWBVideos/HowToReceiveHealing.jpg" height="75" width="100" alt="How To receive Healing - 54-0624" /><br /><font color="#009900">How To Receive Healing</font></a></td>\
      <td class="thumbnail"><a href="javascript:createplayer(\'/lwbplayer/ondemand.php?file=/LWBVideos/PrayerHealingLinePrep.flv\', true, \'TuneinList_videoscreen\')"><img src="../LWBVideos/PrayerHealingLinePrep.jpg" height="75" width="100" alt="Prayer Healing Line Prep - 54-0624" /><br /><font color="#009900">Preparing To Receive Healing</font></a></td>\
      <td style="padding-bottom:7px;" class="thumbnail"><div align="left"><a href="javascript:createplayer(\'/lwbplayer/ondemand.php?file=/LWBVideos/PrayerHealingLine2.flv\', true, \'TuneinList_videoscreen\')"><img src="../LWBVideos/PrayerHealingLine2.jpg" height="75" width="100" alt="Prayer Healing Line2 - 54-0624" /><font color="#009900"><br />Prayer-Healing Line</font></a></div></td>\
     <td>&nbsp;</td>\
	</tr>\
	<tr>\
    <td colspan="6">&nbsp;</td>\
  </tr>\
  </table>\
<!-- Wm Branham Sermons Ondemand--> \
<table width="385" border="0" align="left" cellpadding="1" cellspacing="0" background="/LWBImages/Menus/TabsMenuThemes/streambkgd.png" id="TuneinList_7" style="display: none" valign="top"> \
  <tr> \
    <td width="90%" class="scripture" style="font-size:10px;">Wm Branham Sermon Library: </td>\
	<td width="10%" class="statistic"><span id="Listeners_TuneinList_7" style="font-size:10px; color:#006600"></span>/50&nbsp;</td> \
	</tr>\
  <tr>\
  <td colspan="2"><INPUT id="OndemandSearch_TuneinList" TYPE="Text" style="width:350px; font-size:12px;" class="ondemandinput" VALUE="Enter Sermon Title or Reference Number"></td> \
  </tr> \
  <tr> \
    <td colspan="2"><div class="streamborderbottom" style="width:430px;"></div></td> \
  </tr><!--tunein-button-->\
</table> \
 <!-- Browser Tunein Tab Menu End --><br>';
function tunein_od(refnum) {
		var baselink = 'http://' + document.domain + (window.location.port != "" ? ":"+window.location.port : "");
		regex = /((SPN)|(FRN))?(\d\d)-((\d\d\d\d[AaEeBbWwSsXxMm]?)|(pl-\d\d))/;
		var matches = regex.exec(refnum);
		refnum = matches[0];
		tunein(baselink + '/lwbplayer/ondemand.php?file=' + refnum,false,true);
}
function tuneinlist_tunein (defaultplayer,placename,download,textfile) {
	if (tuneinstream) {
		if (String(tuneinstream).match(/^\d$/)) {
			if (!defaultplayer) lwbplay(tuneinstream);
			else window.location.href = '/tunein.lwb?type=pls&stream=' + tuneinstream;
		} else if ((tuneinstream=="od") && document.getElementById("OndemandSearch_" + placename.replace(/_/,"")).odvalid) {
			var refnum = document.getElementById("OndemandSearch_" + placename.replace(/_/,"")).value;
			var baselink = 'http://' + document.domain + (window.location.port != "" ? ":"+window.location.port : "");
			regex = /((SPN)|(FRN))?(\d\d)-((\d\d\d\d[AaEeBbWwSsXxMm]?)|(pl-\d\d))/;
			var matches = regex.exec(refnum);
			refnum = matches[0];
			if (defaultplayer) window.location.href= '/tunein.lwb?type=pls&stream=' + encodeURIComponent(baselink + '/lwbplayer/ondemand.php?file=' + refnum);
			else if (download) window.location.href= '/lwbplayer/ondemand.php?file=' + refnum + "&download=true";
			else if (textfile) go_to('/LWBWBTextfiles/gettf.php?textfile=' + refnum + ".htm")
			else lwbplay('"'+ baselink + '/lwbplayer/ondemand.php?file=' + refnum +'"');
		}
	}
}
function DisplayStream (streamname,streamid) {
	var ntabs = 8;
	//try { cClick(); } catch(e) {}
	if (document.getElementById("TuneinList_Download")) document.getElementById("TuneinList_Download").innerHTML = "";
	 if (streamid == 88) {
		 document.getElementById(streamname + 88).style.display = "none";
		 document.getElementById(streamname + 99).style.display = "block";
		 streamid = 4;
	  }
	  if (streamid == 99){
		 document.getElementById(streamname + 88).style.display = "block";
		 document.getElementById(streamname + 99).style.display = "none";
		 streamid = 0;
	  }
	try {
	  if (document.getElementById('Songtitle_' + streamname + streamid)) { document.getElementById('Songtitle_' + streamname + streamid).innerHTML = document.getElementById('songtitle_menu_' + (streamid+1)).innerHTML;}
	  if (document.getElementById('Listeners_' + streamname + streamid)) { document.getElementById('Listeners_' + streamname + streamid).innerHTML = listeners_stats[(streamid+1)]; }
	} catch (e) {}
	if (streamid == 6 ) {
		  if (typeof(deconcept) == 'undefined') { addjs ('/LWBVideos/mediaplayer4.3/swfobject.js',true);}
		 document.getElementById(streamname + "videoscreen").innerHTML = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="0" HEIGHT="0"><EMBED src="Yourfilename.swf" WIDTH="0" HEIGHT="0" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
		 createplayer('/LWBImages/Video/LWBvideosplash.png',true,streamname+"videoscreen"); //Create an instance of flashplayer
		}
	if (streamid == 4 ) SPN=true   //if Spanish, switch language
	else SPN=false;
	if (streamid == 5 ) FRN=true   //if French, switch language
	else FRN=false;
	if (streamid == 7) { 
		if (typeof(ondemandloaded) == 'undefined') addjs ('/lwbplayer/ondemandsearch.php' + (location.pathname.match(/\/Spanish\/i/) ? "?SPN=true" : "") + (location.pathname.match(/\/Spanish\/i/) ? "?SPN=true" : ""),true);
		if (document.getElementById("OndemandSearch_" + streamname.replace(/_/,"")) && typeof(document.getElementById("OndemandSearch_" + streamname.replace(/_/,"")).odvalid) == 'undefined') tuneinlist_setup_od("OndemandSearch_" + streamname.replace(/_/,""));
		if (document.getElementById("TuneinList_Download")) document.getElementById("TuneinList_Download").innerHTML = "<span style='margin:5px;padding:3px;border:1px #000099; color:#006666; font-weight:bold;cursor:pointer;' onclick='tuneinlist_tunein(false,&quot;TuneinList_&quot;,true);' title=\"Click to download sermon audio to your computer.\" onmouseover=\"this.style.color='#CC0000'\" onmouseout=\"this.style.color='#006666'\">Download Sermon Audio</span> <span style='margin:5px;padding:3px;border:1px #000099; color:#006666; font-weight:bold;cursor:pointer;' onclick='tuneinlist_tunein(false,&quot;TuneinList_&quot;,false,true);' title=\"Click to view sermon transcript.\" onmouseover=\"this.style.color='#CC0000'\" onmouseout=\"this.style.color='#006666'\">View Sermon Transcript</span><br>";
	}
	if (document.getElementById(streamname + streamid).style.display == "none" || document.getElementById(streamname+streamid).style.display=="") {
		document.getElementById(streamname + "link_" + streamid).className = "tabselected";
		document.getElementById(streamname + streamid).style.display = "block";
		if (document.getElementById("streamborderbottom")) document.getElementById("streamborderbottom").style.display="block";
	} else {
		document.getElementById(streamname + streamid).style.display = "none";
		document.getElementById(streamname + "link_" + streamid).className = "tabunselected";
		if (document.getElementById("streamborderbottom")) document.getElementById("streamborderbottom").style.display="none";
	}
	for (x=0; x < ntabs; x++) {
		if ( x != streamid) {
			document.getElementById(streamname + x ).style.display = "none";
			document.getElementById(streamname + "link_" + x ).className = "";
		}
	}
 }
 //Video stuff
 var current_video = '/LWBImages/Video/LWBvideosplash.png';
function createplayer(theFile, go, where, lang) {
	current_video = theFile;
	var s = new SWFObject('/LWBVideos/mediaplayer4.3/player.swf','thePlayerId','340','240','9');
	var cap = encodeURIComponent(theFile.replace(".flv",(lang ? "-" + lang : "") + ".xml"));
//  s.addVariable("callback", "/LWBVideos/statistics.php");
//  s.addVariable("file","../LWBVideos/videostats.xml");
    s.addParam('allownetworking','all');
	s.addParam("allowscriptaccess","always");
	s.addParam("allowfullscreen","true");
//	s.addParam("wmode","opaque");
	s.addParam("seamlesstabbing","true");
	s.addParam("usecaptions","true");
    s.addVariable("enablejs","true");
//	s.addVariable("displayclick","fullscreen");
//	s.addVariable("abouttext","Living Word Broadcast");
//  s.addVariable("author","Robert Wilson");
//	s.addVariable("description", "William Branham Videos - presented by Living Word Broadcast");
	s.addVariable("image", "/LWBImages/Video/LWBvideosplash.png");
	s.addVariable("stretching", "uniform");
//	s.addVariable("aboutlink","http://www.lwbcast.org");
	s.addVariable("width","340");
	s.addVariable("height","240");
	s.addVariable("displayheight","240");
	s.addVariable("overstretch","fit");
    s.addVariable("showicons","false");
//  s.addVariable('backcolor','0xF8F491'); 
//	s.addVariable('lightcolor','0xF27B00'); 
	s.addVariable('stretching','fill');
	s.addVariable('controlbar','over');
	s.addVariable("file",encodeURIComponent(theFile));
	s.addVariable("captions",cap);
    s.addVariable("plugins", "accessibility");
	s.addVariable("accessibility.fontsize", "18");
	s.addVariable("accessibility.volume","90");
	  if (go) { s.addVariable("autostart","true"); }
	s.write(where);
}

//End Vidoeo Stuff
var tuneinstream;
function tunein (stream,selstream,download) {  
	var baselink = 'http://' + document.domain + ":" + window.location.port + '/';
	if ( (typeof SPN != 'undefined') && (SPN) && !selstream) {
		var caption = "LWB Sintonizador";
		var english = false;
		var instructions1 = "Por favor seleccione uno de los reproductores de abajo para sintonizar"; 
	}
	else if ( (typeof FRN != 'undefined') && (FRN) && !selstream) {
		var caption = "Navigateur de branchement LWB";
		var english = false;
		var instructions1 = "Choisissez un format pour ecouter";
	}
	else {
		var english = true;
		var caption = "LWB Player";
		var instructions1 = "Please select a player to Tune-in";
	}
	if (selstream) {
		var ovdata = "<span style='margin:5px;padding:3px;border:1px #000099; color:#006666; font-weight:bold;cursor:pointer;' onclick='tuneinlist_tunein(true,\"TuneinList_\");' onmouseover=\"this.style.color='#CC0000'\" onmouseout=\"this.style.color='#006666'\">Use my default player</span>";
		ovdata +=    "<span style='margin:5px;padding:3px;border:1px #000099; color:#006666; font-weight:bold;cursor:pointer;' onclick='tuneinlist_tunein(false,\"TuneinList_\")' onmouseover=\"this.style.color='#CC0000'\" onmouseout=\"this.style.color='#006666'\">Use LWBPlayer <i>(recommended)</i></span><br>";
		ovdata += "<span id=\"TuneinList_Download\"></span>";
		ovdata += "<br>" + TuneinTabMenu;
	} else {
		var ovdata = "<span style='margin:5px;padding:3px;border:1px #000099; color:#006666; font-weight:bold;cursor:pointer;' onclick=\"window.location.href='/tunein.lwb?type=pls&stream=" + encodeURIComponent(stream) +"'\" onmouseover=\"this.style.color='#CC0000'\" onmouseout=\"this.style.color='#006666'\">Use my default player</span>";
		ovdata +=    "<span style='margin:5px;padding:3px;border:1px #000099; color:#006666; font-weight:bold;cursor:pointer;' onclick='lwbplay(&quot;" + stream + "&quot;);' onmouseover=\"this.style.color='#CC0000'\" onmouseout=\"this.style.color='#006666'\">Use LWBPlayer <i>(recommended)</i></span><br>";
		if (download) ovdata += "<span style='margin:5px;padding:3px;border:1px #000099; color:#006666; font-weight:bold;cursor:pointer;' onclick='window.location.href=&quot;" + stream + "&download=true&quot;;' title=\"Click to download this file to your computer.\" onmouseover=\"this.style.color='#CC0000'\" onmouseout=\"this.style.color='#006666'\">Download Sermon</span> <span style='margin:5px;padding:3px;border:1px #000099; color:#006666; font-weight:bold;cursor:pointer;' onclick='go_to(&quot;/LWBWBTextfiles/gettf.php?textfile=" + stream.substring(stream.indexOf("file=")+5) + ".htm&quot;);' title=\"Click to download this file to your computer.\" onmouseover=\"this.style.color='#CC0000'\" onmouseout=\"this.style.color='#006666'\">View Sermon Transcript</span><br>";
	}

	if (english) {
	ovdata += "<br><div style='font-size:12px;'><a href=\"javascript:go_to('/lwbplayer/TuneinFAQ.htm')\">Please Click Here</a> for Help</div>";
	}
	var ol_orig = ol_fgbackground;
	var ol_width = "450";
	//var ol_fgbackground = "../browsertunein/pics/browsertuneinbk.jpg";
	overlib(ovdata, STICKY, CAPTION, caption + '<br><i>(' + instructions1 + ')</i>', HAUTO, VAUTO);
	if (selstream) DisplayStream("TuneinList_",0); tuneinstream = 1;
	var overdivlinks = document.getElementById('overDiv').getElementsByTagName('a');
	overdivlinks[0].onmouseover = function () {};
	overdivlinks[0].href = "javascript:void(0);";
	overdivlinks[0].onclick = function () { var tuneinstream = false; return cClick();}
//ol_fgbackground = ol_orig;
}