<!-- 
// (c) 2000-2003 Live365, Inc.  All rights reserved.

var gBaseURL = "http://www.live365.com";
var gStoreURL = "https://store01.live365.com";

// activate these for internal development and QA
 //gBaseURL = "http://fc02.corp.nanocosm.com";
 //gStoreURL = "https://bmxdev2.corp.nanocosm.com";

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    var now = new Date();
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=" + now.toGMTString();
  }
  return true;
}

//DeleteCookie("SaneID", "/", "www.live365.com"); we no longer need this


function ReadCookieVal(offset) 
{
	var endstr = document.cookie.indexOf (";", offset);

	if (endstr == -1)
		endstr = document.cookie.length;

	return unescape(document.cookie.substring(offset, endstr));
}


function ReadCookie(name) 
{
	var j;
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;

	while (i < clen) {
		j = i + alen;
		
		if (document.cookie.substring(i, j) == arg)
			return ReadCookieVal (j);

		i = document.cookie.indexOf(" ", i) + 1;
		
		if (i == 0) 
			break; 
	}

	return null;
}

if (self.location.protocol != 'https:') {
	document.write('<scr'+'ipt language="JavaScript" src="' + gBaseURL + '/scripts/clientdetect.js"></scr' + 'ipt>');
	document.write('<scr'+'ipt language="JavaScript" src="' + gBaseURL + '/scripts/ads.js"></scr' + 'ipt>');
}
else {
	document.write('<scr'+'ipt language="JavaScript" src="/scripts/clientdetect.js"></scr' + 'ipt>');
	document.write('<scr'+'ipt language="JavaScript" src="/scripts/ads.js"></scr' + 'ipt>');
}

var gAdString 	= "";
var gPath		= "home";
var gImageURL	= "";
// use store server to serve images if on store.
	if (self.location.protocol == 'https:')
		gImageURL = self.location.protocol + "//" + self.location.host;
	else
		gImageURL = gBaseURL;	

function GoTo(url)
{
	var CurrentDate = new Date();
	document.location = url + '?' + CurrentDate.getTime();
	return true;
}

function GoToWebX(url)
{
	var CurrentDate = new Date();
	document.location = url + '!' + CurrentDate.getTime();
	return true;
}

function MM_preloadImages() 
{
	var d = document; 

	if (d.images) { 
		if(!d.MM_p) 
			d.MM_p = new Array();

		var i, j = d.MM_p.length, a = MM_preloadImages.arguments; 
		
		for (i = 0; i < a.length; i++) {
			if (a[i].indexOf("#") != 0) { 
				d.MM_p[j] = new Image; 
				d.MM_p[j++].src = gBaseURL + a[i];
			}
		}
	}
}

function MM_swapImgRestore() 
{
	var i, x, a = document.MM_sr; 

	for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) 
		x.src = x.oSrc;
}

function MM_findObj(n, d) 
{
	var p,i,x;  

	if (!d) 
		d = document; 
	
	if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
		d = parent.frames[n.substring(p+1)].document; 
		n = n.substring(0,p);
	}

	if (!(x = d[n]) && d.all) 
		x = d.all[n]; 
	
	for (i = 0; !x && i < d.forms.length; i++) 
		x = d.forms[i][n];

	for (i = 0; !x && d.layers && i < d.layers.length; i++) 
		x = MM_findObj(n, d.layers[i].document); 
	
	return x;
}

function MM_swapImage() 
{
	var i, j = 0, x, a = MM_swapImage.arguments; 
	
	document.MM_sr = new Array; 
	
	for (i = 0; i < (a.length-2); i += 3)
		if ((x = MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function DrawSubNavItemRow(left,right,baseURL,menu) 
{

document.write('<table cellspacing="0" cellpadding="0" border="0" width="100%">');
document.write('<tr valign="middle">');
document.write('<td background="' + gImageURL + '/navigation/images/topnav-bg-3.gif" height="29" nowrap class="subnav">&nbsp;&nbsp;');

	if (left && left.length > 0) {
		for (i = 0; i < left.length; i += 2) {
			if (i > 0)
			document.write('&nbsp;|&nbsp;');
			document.write('<A class="subnavlink" href="' + baseURL + left[i] + '">' + left[i+1] + '</A>');						
		}
	}			
	else
		document.write('&nbsp;&nbsp;<img src="' + gImageURL + '/images/dot.gif" width="1" height="1" border="0">');
				
document.write('<br><img src="' + gImageURL + '/images/dot.gif" width="1" height="10" border="0" align="absmiddle"></td>');
document.write('<td background="' + gImageURL + '/navigation/images/topnav-bg-3.gif" nowrap><img src="' + gImageURL + '/images/dot.gif" width="10" height="29" border="0"></td>');
document.write('<td background="' + gImageURL + '/navigation/images/topnav-bg-3.gif" align="right" nowrap><img src="' + gImageURL + '/images/dot.gif" width="10" height="1" border="0" align="absmiddle"></td>');
document.write('<td background="' + gImageURL + '/navigation/images/topnav-bg-3.gif" align="right" nowrap class="subnav">&nbsp;&nbsp;');
	
	if (right && right.length > 0) {
		for (i = 0; i < right.length; i += 2) {			
			if (i > 0)
			document.write('&nbsp;|&nbsp;');
			document.write('<A CLASS="subnavlink" HREF="' + baseURL + right[i] + '">' + right[i+1] + '</A>');
		}
	}
	else
		document.write('<img src="' + gImageURL + '/images/dot.gif" width="1" height="1" border="0">');
			
document.write('&nbsp;&nbsp;<br><img src="' + gImageURL + '/images/dot.gif" width="1" height="10" border="0" align="absmiddle"></td>');
document.write('</tr>');
document.write('</table>');
}

function DrawSubNavBar(menu)
{						   
	var tmd = new Date();
	var tm = tmd.getTime();
	var i;
	var count;
	var left;
	var right;
	var baseURL = gBaseURL;;
	var name = ReadCookie("sessionid");
	var bcast_mode = "OR";
	
	if (menu == "broadcast" || menu == "easycast") {
		bcast_mode = ReadCookie("bcastmode");

		if (!name || name == "" || bcast_mode == "")
			menu = "broadcastintro";
	}
	
	
	// Start Listen Subnavigation
	if (menu == "listen" || menu == "musiclibrary") {
		gPath = "list";		
		//commURL = "http://community.live365.com/cgi-bin/WebX.fcgi?14@@";
		baseURL = "";	
		left = new Array(			
			gBaseURL + "/help/how-to-search.html", "How to Search",
			"http://forums.live365.com/viewforum.php?f=27", "System Status",
			gBaseURL + "/downloads/index.live?from=listen", "Downloads",
			gBaseURL + "/listen/downloads/start365/index.html", "Start365",					
			gBaseURL + "/cgi-bin/clicks.cgi?page=listen_subnav&url=/listen/preferred-member.live", "Free Trial - <font class=subnav-adfree>VIP Listening: No Ads, Total Access!</font>"	
		);
			
		if (name) {
			right = new Array(
				gBaseURL + "/cgi-bin/directory.cgi?searchfields=TAC&genre=Presets", "MyLive365",				
				gBaseURL + "/members/login.live?action=out&path=" + gPath + "&" + tm, "Log Out"
			);
		} 
		else {
			right = new Array(
				gBaseURL + "/mylive365/", "MyLive365",
				gBaseURL + "/registration/index.live?" + tm, "Sign Up",
				gBaseURL + "/members/login.live?path=" + gPath + "&" + tm, "Log In"
			);
		}
	}
	// End Listen Subnavigation
	
	// Start About Us Subnavigation
	else if (menu == "about") {
		gPath = "about";
		left = new Array(
			"/info/index.html", "About Us",
			"/contact.html", "Contact Us",
			"/info/advertise.html", "Advertise",
			"/info/management.html", "Team",
			"/info/press/index.html", "Press",
			"/info/legal.html", "Legal", 
			"/pro/index.html", "PRO Broadcasting"
		);

		if (name) {
			right = new Array(
				"/cgi-bin/directory.cgi?searchfields=TAC&genre=Presets", "MyLive365",				
				"/members/login.live?action=out&path=" + gPath + "&" + tm, "Log Out"
			);
		}
		else {
			right = new Array(				
				"/registration/index.live", "Sign Up",
				"/members/login.live?path=" + gPath + "&" + tm, "Log In"
			);
		}
	}
	// End About Us Subnavigation
	
	// Start Legal Subnavigation
	else if (menu == "legal") {
		baseURL = "";		
		left = new Array(
			gBaseURL + "/info/legal.html", "Legal",
			gBaseURL + "/info/user.html", "Broadcaster Agreement",
			gBaseURL + "/info/terms.html", "Terms of Use",
			gBaseURL + "/info/privacy.html", "Privacy Policy",
			"http://live365.trakhelp.com/bin/topic.py?topic=5", "Legal FAQ",
			gBaseURL + "/info/rules.html", "Rules"
		);

		gPath = "legal";
		
		if (name) {
			right = new Array(				
				gBaseURL + "/cgi-bin/directory.cgi?searchfields=TAC&genre=Presets", "MyLive365",
				gBaseURL + "/members/login.live?action=out&path=" + gPath + "&" + tm, "Log Out"
			);
		}
		else {
			right = new Array(
				gBaseURL + "/mylive365/", "MyLive365",
				gBaseURL + "/registration/index.live", "Sign Up",
				gBaseURL + "/members/login.live?path=" + gPath + "&" + tm, "Log In"
			);
		}
	}
	// End Legal Subnavigation
	
	// Start Broadcast Subnavigation
	else if (menu == "broadcast" || menu == "easycast") {
		baseURL = "";

		var session_cookie = name.split(":");

		if (bcast_mode == "LI") {
			left = new Array(
				gBaseURL + "/broadcast/broadcast.live", "Status",			
				gBaseURL + "/broadcast/station-update.live?" + tm, "Edit",			
				gBaseURL + "/broadcast/thirdparty.live?" + tm, "Resources",
				gBaseURL + "/broadcast/billing.html", "Billing/Order"							
			);
		} 
		else if (bcast_mode == "RE") {
			left = new Array(		
				gBaseURL + "/broadcast/broadcast.live", "Status",				
				gBaseURL + "/broadcast/station-update.live?" + tm, "Edit",
				gBaseURL + "/broadcast/controls.live", "Resources",
				gBaseURL + "/broadcast/billing.html", "Billing/Order"									
			);
		}
		else { // (bcast_mode == "OR") or others TBD
			left = new Array(			
				gBaseURL + "/broadcast/broadcast.live", "Status",
				gBaseURL + "/cgi-bin/link.cgi?topic=stationinfo", "Edit",
				gBaseURL + "/broadcast/tools.live", "Resources",								
				gBaseURL + "/broadcast/billing.html", "Billing/Order"				
			);
		} 

		right = new Array(				
			gBaseURL + "/cgi-bin/directory.cgi?searchfields=TAC&genre=Presets", "MyLive365",
			gBaseURL + "/members/login.live?action=out&path=" + gPath + "&" + tm, "Log Out"
		);
	}
	// End Broadcast Subnavigation
	
	// Start Store Subnavigation
	else if (menu == "store") {
		baseURL = "";
		left = new Array(
			"http://www.cafeshops.com/cp/store.aspx?s=live365", "Shop",
			"http://www.cafeshops.com/cp/viewcart.aspx", "Shopping Cart",
 			"http://www.cafeshops.com/cp/help/custserv.aspx", "Customer Service",
			"http://www.cafeshops.com/cp/help/shipping.aspx", "Shipping"

		);
		
		right = new Array();
	}
	// End Store Subnavigation
	
	// Start Advertise Subnavigation
	else if (menu == "advertise") {
		baseURL = "";
		left = new Array(
			gBaseURL + "/info/advertise.html", "The Power of the Platform",
			gBaseURL + "/info/audience.html", "Our Audience",
 			gBaseURL + "/info/contact.html", "Contact Us"			
		);
		
		right = new Array();
	}
	// End Advertise Subnavigation
	
	// Start Community Subnavigation
	else if (menu == "community") {
		baseURL = "";
		gPath = "comm";
		
		left = new Array(			
			gBaseURL + "/community/chat.live?" + tm, "Chat",
			"http://forums.live365.com", "Message Boards",
			"http://live365.trakhelp.com/bin/request.py", "Support",				
			gBaseURL + "/community/guidelines.html", "Guidelines"
		);
			
		if (name) {
			right = new Array(									
				gBaseURL + "/cgi-bin/directory.cgi?searchfields=TAC&genre=Presets", "MyLive365",
				gBaseURL + "/members/login.live?action=out&path=" + gPath + "&" + tm, "Log Out"
			);
		} 
		else {
			right = new Array(
				gBaseURL + "/mylive365/", "MyLive365",
				gBaseURL + "/registration/index.live?" + tm, "Sign Up",
				gBaseURL + "/members/login.live?path=" + gPath + "&" + tm, "Log In"
			);
		}
	}
	// End Community Subnavigation
	
	// Start Error Subnavigation
	else if (menu == "error") {
		baseURL = "";
		left = new Array(			
			gBaseURL + "/help/listen/index.html", "How to Listen",
			gBaseURL + "/help/broadcast/index.html", "How to Broadcast",
			gBaseURL + "/help/quickstart.html", "QuickStart",
			gBaseURL + "/help/glossary.html", "Glossary",
			"http://forums.live365.com/viewforum.php?f=20", "Status Report",
			"http://live365.trakhelp.com/bin/request.py", "Contact",
			"http://live365.trakhelp.com/", "FAQ"			
			);
		
		right = new Array();	
	}
	// End Error Subnavigation
	
	// Start Help Subnavigation
	else if (menu == "help") {
		baseURL = "";

		left = new Array(			
			gBaseURL + "/help/listen/index.html", "How to Listen",
			gBaseURL + "/help/broadcast/index.html", "How to Broadcast",
			gBaseURL + "/help/quickstart.html", "QuickStart",
			gBaseURL + "/help/glossary.html", "Glossary",
			"http://forums.live365.com/viewforum.php?f=20", "Status Report",
			"http://live365.trakhelp.com/bin/request.py", "Contact",
			"http://live365.trakhelp.com/", "FAQ"			
		);
		
		right = new Array();
	}
	// End Help Subnavigation
	
	// Start Jump Subnavigation (obsolete)
	else if (menu == "jump") {
		left = new Array();
		right = new Array();
	}
	// End Jump Subnavigation
	
	// Start Registration Subnavigation
	else if (menu == "registration") {
		left = new Array();
		right = new Array();
	}
	// End Registration Subnavigation
	
	// Start Broadcast Intro Navigation (For new users)
	else if (menu == "broadcastintro") {
		baseURL = "";
	
		left = new Array(			
			gStoreURL + "/orders/orderform.live","Personal Broadcasting",
			gBaseURL + "/pro/index.html","PRO Broadcasting"
		);
		
		if (name) {
			gPath = "bcast";
			right = new Array(
				gBaseURL + "/cgi-bin/directory.cgi?searchfields=TAC&genre=Presets", "MyLive365",
				gBaseURL + "/members/login.live?action=out&path=" + gPath + "&" + tm, "Log Out"
			);
		} 
		else {			
			right = new Array(
				gBaseURL + "/mylive365/", "MyLive365",
				gBaseURL + "/registration/index.live?" + tm, "Sign Up",
				gBaseURL + "/members/login.live?path=" + gPath + "&" + tm, "Log In"
			);
		}
	} 
	// End Broadcast Intro Subnavigation
	
	// Start Home Subnavigation
	else if (menu == "home"){
		left = new Array(
			"/help/quickstart.html", "QuickStart",
			"/help/how-to-search.html", "How to Search",
			"/downloads/index.live", "Downloads",
			"/listen/downloads/start365/index.html", "Start365",			
			"/cgi-bin/clicks.cgi?page=home_subnav&url=/listen/preferred-member.live", "Free Trial - <font class=subnav-adfree>VIP Listening: No Ads, Total Access!</font>"	
		);

		gPath = "home";
		
		if (name) {
			right = new Array(
				"/cgi-bin/directory.cgi?searchfields=TAC&genre=Presets", "MyLive365",
				"/members/login.live?action=out&path=" + gPath + "&" + tm, "Log Out"
			);
		}
		else {			
			right = new Array(
				"/mylive365/", "MyLive365",
				"/registration/index.live?" + tm, "Sign Up",
				"/members/login.live?path=" + gPath + "&" + tm, "Log In"
			);
		}
	} 
	// End Home Subnavigation
    
	// Start PLR Subnavigation
	else if (menu == "plr"){
		left = new Array("/pro/index.html","PRO Broadcasting",
				//"/plr/basic.html","Basic",
				//"/plr/premium.html","Premium",
				"/pro/contact.html","Contact Us");
		
		right = new Array();
	}
	// End PLR Subnavigation
	
	// Start Default
    else {
		left = new Array();
		right = new Array();
	}
	// End Default

	DrawSubNavItemRow(left,right,baseURL,menu);
}

function DrawNavButtons(subNavDomain)
{
	var now = new Date();
	var tm = now.getTime();
	if (subNavDomain == "community") {
		var helpLink = "http://forums.live365.com/faq.php";	
		
	/*
	} else if (subNavDomain == "listen") {
		var helpLink = "http://live365.trakhelp.com/bin/topic.py?topic=1";
	
	} else if (subNavDomain == "broadcast" || subNavDomain == "broadcastintro" || subNavDomain == "easycast") {
		var helpLink = "http://live365.trakhelp.com/bin/topic.py?topic=2";
	
	} else if (subNavDomain == "store") {
		var helpLink = "http://www.cafeshops.com/cp/help/custserv.aspx";
	*/
	
	} else  {
		var helpLink = "http://live365.trakhelp.com/";	
	}
	var shopLink = "http://www.cafeshops.com/cp/store.aspx?s=live365";
	
	document.write('<tr valign="bottom">');
	document.write('<td class="navbuttons" width="100%" height="33" valign="bottom">');
if (subNavDomain != "orderform") {
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="387">');
	document.write('<tr>');
	document.write('<td width="76">');
	if (subNavDomain == "home") {
			document.write('<a target=_self href="' + gBaseURL + '/index.live"><img src="' + gImageURL + '/navigation/images/topnav-home-h2.gif" width="76" height="27" alt="Home" border="0"></a>');
	} else {
			document.write('<a target=_self href="' + gBaseURL + '/index.live" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'homebutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-home-h2.gif\',1)" onMouseDown="MM_swapImage(\'homebutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-home-h2.gif\',1)" onMouseUp="MM_swapImage(\'homebutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-home-h2.gif\',1)"><img src="' + gImageURL + '/navigation/images/topnav-home-b2.gif" name="homebutton" width="76" height="27" alt="Home" border="0"></a>');
	}
	document.write('</td>');
	document.write('<td width="73">');
	if (subNavDomain == "listen") {
		document.write('<a target=_self href="' + gBaseURL + '/listen/index.live"><img src="' + gImageURL + '/navigation/images/topnav-listen-h2.gif" width="73" height="27" alt="Listen" border="0"></a>');
	} else {
		document.write('<a target=_self href="' + gBaseURL + '/listen/index.live" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'listenbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-listen-h2.gif\',1)" onMouseDown="MM_swapImage(\'listenbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-listen-h2.gif\',1)" onMouseUp="MM_swapImage(\'listenbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-listen-h2.gif\',1)"><img src="' + gImageURL + '/navigation/images/topnav-listen-b2.gif" name="listenbutton" width="73" height="27" alt="Listen" border="0"></a>');
	}
	document.write('</td>');
	document.write('<td width="74">');
	if (subNavDomain == "broadcastintro" || subNavDomain == "broadcast" || subNavDomain == "easycast") {
		document.write('<a target=_self href="' + gBaseURL + '/broadcast/index.live?' + tm + '"><img src="' + gImageURL + '/navigation/images/topnav-broadcast-h2.gif" width="74" height="27" alt="Broadcast" border="0"></a>');
	} else {
		document.write('<a target=_self href="' + gBaseURL + '/broadcast/index.live?' + tm + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'broadcastbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-broadcast-h2.gif\',1)" onMouseDown="MM_swapImage(\'broadcastbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-broadcast-h2.gif\',1)" onMouseUp="MM_swapImage(\'broadcastbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-broadcast-h2.gif\',1)"><img src="' + gImageURL + '/navigation/images/topnav-broadcast-b2.gif" width="74" height="27" name="broadcastbutton" alt="Broadcast" border="0"></a>');
	}
	document.write('</td>');
	document.write('<td width="87">');
	if (subNavDomain == "musiclibrary") {
		document.write('<a target=_self href="' + gBaseURL + '/cgi-bin/library.cgi"><img src="' + gImageURL + '/navigation/images/topnav-musiclibrary-h2.gif" width="87" height="27" alt="Music Library" border="0"></a>');
	} else {
		document.write('<a target=_self href="' + gBaseURL + '/cgi-bin/library.cgi" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'musiclibrarybutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-musiclibrary-h2.gif\',1)" onMouseDown="MM_swapImage(\'musiclibrarybutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-musiclibrary-h2.gif\',1)" onMouseUp="MM_swapImage(\'musiclibrarybutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-musiclibrary-h2.gif\',1)"><img src="' + gImageURL + '/navigation/images/topnav-musiclibrary-b2.gif" width="87" height="27" name="musiclibrarybutton" alt="Music Library" border="0"></a>');
	}
	document.write('</td>');
	document.write('<td width="74">');
	if (subNavDomain == "community") {
		document.write('<a target=_self href="' + gBaseURL + '/community/index.html"><img src="' + gImageURL + '/navigation/images/topnav-community-h2.gif" width="74" height="27" alt="Community" border="0"></a>');
	} else {
		document.write('<a target=_self href="' + gBaseURL + '/community/index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'communitybutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-community-h2.gif\',1)" onMouseDown="MM_swapImage(\'communitybutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-community-h2.gif\',1)" onMouseUp="MM_swapImage(\'communitybutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-community-h2.gif\',1)"><img src="' + gImageURL + '/navigation/images/topnav-community-b2.gif" name="communitybutton" width="74" height="27" alt="Community" border="0"></a>');
	}
	document.write('</td>');
	document.write('<td width="45">');
	if (subNavDomain == "store") {
		document.write('<a target=_self href="' + shopLink + '"><img src="' + gImageURL + '/navigation/images/topnav-shop-h2.gif" width="45" height="27" alt="Shop" border="0"></a>');
	} else {
		document.write('<a target=_self href="' + shopLink + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'shopbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-shop-h2.gif\',1)" onMouseDown="MM_swapImage(\'shopbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-shop-h2.gif\',1)" onMouseUp="MM_swapImage(\'shopbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-shop-h2.gif\',1)"><img src="' + gImageURL + '/navigation/images/topnav-shop-b2.gif" name="shopbutton" width="45" height="27" alt="Shop" border="0"></a>');
	}
	document.write('</td>');
	document.write('<td width="46">');
	if (subNavDomain == "help") {
		document.write('<a target=_self href="' + helpLink + '"><img src="' + gImageURL + '/navigation/images/topnav-help-h2.gif" width="46" height="27" alt="Help" border="0"></a>');
	} else {
		document.write('<a target=_self href="' + helpLink + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'helpbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-help-h2.gif\',1)" onMouseDown="MM_swapImage(\'helpbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-help-h2.gif\',1)" onMouseUp="MM_swapImage(\'helpbutton\',\'\',\'' + gImageURL + '/navigation/images/topnav-help-h2.gif\',1)"><img src="' + gImageURL + '/navigation/images/topnav-help-b2.gif" name="helpbutton" width="46" height="27" alt="Help" border="0"></a>');
	}
	document.write('</td>');
	document.write('</tr>');
	document.write('</table>');
} else {
	document.write('<img src="' + gImageURL + '/images/dot.gif" width="314" height="27" border="0">');
}	
	document.write('</td>');
	document.write('<td width="20"  class="navbuttons"><img src="' + gImageURL + '/images/dot.gif" width="20" height="33" border="0"></td>');
	document.write('<td align="right" valign="bottom"  class="navbuttons"><img src="' + gImageURL + '/navigation/images/topnav-rightedge.gif" width="95" height="18" border="0"></td>');
document.write('</tr>');
}

function DrawLogoAd(genre, useDART, subNavDomain)
{
	if (DrawLogoAd.arguments.length < 2)
		useDART = true;
	if (DrawLogoAd.arguments.length < 3)
		subNavDomain = "";	

	if (self.location.protocol != 'https:' && subNavDomain != 'store' && self.location.href.indexOf("trakhelp") == -1) {
			if (subNavDomain.indexOf("-sky") != -1){
				if(displayPreferredAds()){
					document.write('<img src="' + gImageURL + '/images/logo-topnavbar.gif" width="77" height="33" align="absmiddle" border="0" alt="Live365.com" vspace="5"> &nbsp; <font class="motto">The World\'s Largest Internet Radio Network</font>');
				}
				else{
					document.write('<a href="http://click.atdmt.com/AVE/go/lv365aws05500015ave/direct/01/" target="_blank" class="navsponsor"><img src="http://view.atdmt.com/AVE/view/lv365aws05500015ave/direct/01/" width="75" height="40" align="absmiddle" border="0" alt="AT&T Wireless" vspace="5"></a> &nbsp; <a href="http://click.atdmt.com/AVE/go/lv365aws05500015ave/direct/01/" target="_blank" class="navsponsor">Enter to become a big-shot record exec in NYC</a>');
				}
			}
			else{
				DrawBannerAd(genre, useDART, subNavDomain);
			}
	}
	else
		//document.write('<img src="' + gImageURL + '/images/dot.gif" width="1" height="1" border="0">');
		if (subNavDomain != "orderform")
		document.write('<img src="' + gImageURL + '/images/dot.gif" width="468" height="60" border="0">');
		else 
		document.write('<img src="' + gImageURL + '/images/dot.gif" width="468" height="10" border="0">');
}

function DrawHeader(subNavDomain, genre, useDART)		
{		
if (subNavDomain != "orderform")
var bgImage = gImageURL + "/navigation/images/topnav-bg-1.gif";
else
var bgImage = gImageURL + "/navigation/images/topnav-bg-billing.gif";
	document.write('<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr valign="top"><td><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr valign="top">');
if (subNavDomain != "orderform") {
    document.write('<td background="' + bgImage + '" width="115" height="68"><a href="' + gBaseURL + '/index.live"><img src="' + gImageURL + '/navigation/images/topnav-logo2.gif" width="115" height="68" alt="Live365.com" border="0"></a></td>');
	document.write('<td background="' + bgImage + '" width="5"><img src="' + gImageURL + '/images/dot.gif" width="5" height="68" border="0"></td>');
} else {
	document.write('<td valign="bottom" background="' + bgImage + '"><img src="/images/topnav-leftedge1.gif" border="0" width="115" height="9"></td>');
	document.write('<td background="' + bgImage + '" width="5"><img src="' + gImageURL + '/images/dot.gif" width="5" height="18" border="0"></td>');
}	
	
	document.write('<td background="' + bgImage + '" width="100%" align="right" nowrap>');
	document.write('<table align="right" cellspacing="0" cellpadding="2" border="0" width="100%"><tr><td width="100%" align="right">');
	if (self.location.protocol == 'https:')
		gImageURL = self.location.protocol + "//" + self.location.host;			
	else
		gImageURL = gBaseURL;				
	DrawLogoAd(genre, useDART, subNavDomain)	
	document.write('</td></tr></table></td></tr></table><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>');
    document.write('<td background="' + gImageURL + '/navigation/images/topnav-bg-2.gif" height="30" valign="top"><img src="' + gImageURL + '/navigation/images/topnav-leftedge.gif" width="115" height="25" alt="" border="0"></td>');
	document.write('<td background="' + gImageURL + '/navigation/images/topnav-bg-2.gif" width="300"><img src="' + gImageURL + '/images/dot.gif" width="300" height="30" border="0"></td>');
	document.write('<td background="' + gImageURL + '/navigation/images/topnav-bg-2.gif" nowrap align="right" valign="top">');
	document.write('<table border="0" align="right" cellpadding="2" cellspacing="0"><tr valign="middle">');
	document.write('<td width="54"><img src="' + gImageURL + '/navigation/images/topnav-logo-small.gif" width="54" height="25" alt="Live365" border="0"></td>');
	document.write('<td class="plain" nowrap><font class="motto">The World\'s Largest Internet Radio Network</font><img src="' + gImageURL + '/images/dot.gif" width="10" height="1" border="0" align="absmiddle"></td>');
	document.write('</tr></table></td></tr></table>');
	document.write('<table cellspacing="0" cellpadding="0" border="0" width="100%">');
	if (DrawHeader.arguments.length < 2)
		genre = "";

	if (DrawHeader.arguments.length < 3)
		useDART = true; // can't rely on house ads being there
		
	//DrawLogoAd(genre, useDART, subNavDomain)
	
	var i = subNavDomain.indexOf("-sky");

	if (i != -1)
		subNavDomain = subNavDomain.substr(0, i);
			
	DrawNavButtons(subNavDomain);
	
	document.write('</table>');
	if (subNavDomain && subNavDomain != "undefined" && subNavDomain != "null") 
		DrawSubNavBar(subNavDomain);

	document.write('</td></tr></table>'); 

}




function DoSearch()
{
	var url = gBaseURL + "/cgi-bin/directory.cgi";
	var val;
	
	if (document.SearchForm1.searchdesc.value != "") {
		val = escape(document.SearchForm1.searchdesc.value);
		val = val.replace(/[\+]/g, "%2b");

		url += '?genre=search&searchdesc=' + val;

		val = document.SearchForm1.searchfields[document.SearchForm1.searchfields.selectedIndex].value;
		if (val != "")
			url += '&searchfields=' + val;

		if (document.SearchForm1.searchgenre.selectedIndex >= 0) {
			val = document.SearchForm1.searchgenre[document.SearchForm1.searchgenre.selectedIndex].value;

			if (val != "" && val != "All")
				url += '&searchgenre=' + val;
		}
	}

	document.location = url;
	return false;
}


function DoGenreSearch()
{
	var url = gBaseURL + "/cgi-bin/directory.cgi";
	var value = GetGenreID(document.forms.SearchForm1.genre.selectedIndex - 1);
	
	if (value) {
		if (value == "Presets" && !ReadCookie("sessionid")) {
			alert('You must be logged in to go to your list of Presets');
			document.forms.SearchForm1.genre.selectedIndex = 0;
		   	return false;
		}

		url += '?genre=' + value;
	}

	document.location = url;
	return false;
}

//DRAW SEARCH BAR START
function DrawSearchBar(obsolete)
{
	var size = (navigator.appName == "Netscape") ? 6 : 8;
	document.write('<form name="SearchForm1" onsubmit="return DoSearch()">');
document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
document.write('<tr>');
document.write('<td><img src="' + gImageURL + '/images/dot.gif" width="10" height="1" border="0"></td>');
document.write('<td width="100%">');
document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr>');
		document.write('<td colspan="3" class="content-header"><a name="advsearch"></a>Advanced Search</font></td>');
	document.write('</tr>');
	document.write('<tr>');
		document.write('<td bgcolor="c0c0c0"><img src="' + gImageURL + '/images/dot.gif" width="1" height="5" border="0"></td>');
		document.write('<td bgcolor="c0c0c0" width="4"><img src="' + gImageURL + '/images/dot.gif" width="4" height="1" border="0"></td>');
		document.write('<td bgcolor="c0c0c0"><img src="' + gImageURL + '/images/dot.gif" width="1" height="1" border="0"></td>');
	document.write('</tr>');
	document.write('<tr>');
		document.write('<td colspan="3"><img src="' + gImageURL + '/images/dot.gif" width="1" height="4" border="0"></td>');
	document.write('</tr>');
	document.write('<tr>');
		document.write('<td>');			
			document.write('<table border="0" cellpadding="4" cellspacing="0" width="100%">');
			document.write('<tr>');			
			document.write('<td class="informationbox-content" nowrap width="30"><font class="content-header">Search:</font></td>');
			document.write('<td class="informationbox-content" width="50"><input type="text" name="searchdesc" size="' + size + '" class="searchinput"></td>');
			document.write('<td class="informationbox-content" nowrap width="40">limited&nbsp;to</td>');
			document.write('<td class="informationbox-content" width="75">');
			DrawNamedGenreSelections("searchgenre", "All Genres", "", -1, 1);
			document.write('</td>');
			document.write('<td class="informationbox-content" width="75">');
			document.write('<SELECT NAME="searchfields" class="searchinput">');
			document.write('<OPTION VALUE="TAC" selected>Artists/Tracks/CDs</OPTION>');
			document.write('<OPTION VALUE="A">-- Artists only</OPTION>');
			document.write('<OPTION VALUE="T">-- Tracks only</OPTION>');
			document.write('<OPTION VALUE="C">-- CDs only</OPTION>');
			document.write('<OPTION VALUE="">Live365 Stations</OPTION>');
			document.write('<OPTION VALUE="L">Locations</OPTION>');
			document.write('<OPTION VALUE="H">Broadcasters</OPTION>');			
			document.write('</SELECT>');
			document.write('</td>');
			document.write('<td class="informationbox-content" width="20"><input type="image" src="' + gImageURL + '/navigation/images/go.gif" width="20" height="20" border="0" alt="Go" align="absmiddle">&nbsp;</td>');	
			document.write('</tr>')
			document.write('</table>');
		document.write('</td>');		
		document.write('<td class="plain" align="center" valign="middle"><img src="/images/dot.gif" width="4" height="1" border="0"></td>');
		document.write('<td width="100%">');
			document.write('<table border="0" cellpadding="4" cellspacing="0" width="100%">');
			document.write('<tr>');
			document.write('<td class="informationbox-content" nowrap width="35">or&nbsp;<font class="content-header">Browse:</font></td>');
			document.write('<td class="informationbox-content" width="75">');
			DrawNamedGenreSelections("genre", 0, "DoGenreSearch", -1, 1);
			document.write('</td>');
			document.write('<td class="informationbox-content" width="100%"><a href="javascript:DoGenreSearch()"><img src="' + gImageURL + '/navigation/images/go.gif" width="20" height="20" border="0" alt="Go" align="absmiddle"></td>');			
			document.write('</tr>');
			document.write('</table>');
		document.write('</td>');
	document.write('</tr>');
document.write('</table>');
document.write('</td>');
document.write('<td><img src="' + gImageURL + '/images/dot.gif" width="10" height="1" border="0"></td>');
document.write('</tr>');
document.write('</table>');
document.write('</form>');
	
 	document.write('<P>');
}	
//DRAW SEARCH BAR END	


function DrawFooter(domain, drawBanner)
{
	var tmd = new Date();
	var tm = tmd.getTime();
	var maxFrames = 0;
	if (client.isIE && (domain == "listen"))
		maxFrames = 1;
	
	if (DrawFooter.arguments.length < 2)
		drawBanner = true;
	if (self.location.protocol != 'https:') {
		DrawSearchBar(1);
	}
	if (self.location.protocol != 'https:') {
		document.writeln('<DIV class="footer" ALIGN="center">');
		document.writeln('<A HREF="' + gBaseURL + '/index.live">Home</A> - <A HREF="' + gBaseURL + '/listen/index.live">Listen</A> - '); 
		document.writeln('<A TARGET="_top" HREF="' + gBaseURL + '/broadcast/index.live?' + tm + '">Broadcast</A> - ');
		document.writeln('<A TARGET="_top" HREF="' + gBaseURL + '/cgi-bin/library.cgi">Music Library</A> - ');
		document.writeln('<A HREF="' + gBaseURL + '/community/index.html">Community</A> - '); 	
		document.writeln('<A HREF="http://www.cafeshops.com/cp/store.aspx?s=live365">Shop</A> - ');
		document.writeln('<A HREF="' + gBaseURL + '/help/index.html">Help</A><BR>');
		document.writeln('<A HREF="' + gBaseURL + '/downloads/index.live">Downloads</A> - ');
		document.writeln('<A HREF="' + gBaseURL + '/info/index.html">About Us</A> - ');
		document.writeln('<A HREF="' + gBaseURL + '/info/advertise.html">Advertise With Us</A> - ');
		document.writeln('<A HREF="' + gBaseURL + '/labelservices/index.live">Label Services</A> - ');		
		document.writeln('<A HREF="' + gBaseURL + '/affiliate/index.html">Affiliate Program</A> - '); 
		document.writeln('<A HREF="' + gBaseURL + '/plr/referral/index.html">Referral Program</A> - ');
		document.writeln('<A HREF="' + gBaseURL + '/info/legal.html">Legal Info</A><BR>');	
		document.writeln('</div>');
	}
	if (domain != "store") {
		document.writeln('<p>');
		document.writeln('<DIV class="copyright" ALIGN="center">');
		document.writeln('Live365.com is an officially licensed ASCAP and BMI site.<BR>');
		document.writeln('&copy; 1999-2003 Live365, Inc. All rights reserved.<BR>');  
		document.writeln('<img src="' + gImageURL + '/images/dot.gif" WIDTH=1 HEIGHT=5 BORDER=0 NAME="ContentImage"><BR>');
		document.writeln('&nbsp;');
		document.writeln('<BR></DIV>');
	}	
}


function PopUpTenWays(thePage) 
{
	popUpWin = window.open(thePage,'popWin','resizeable=no,scrollbars=no,location=no,toolbar=no,width=420,height=440');
}


function LaunchWindow(url)
{
    open(url);
    return true;
}

function DrawGenreImage(genre)
{
	var safe = unescape(genre);
	safe = safe.replace(/\W/g, '_');
    document.write('<img src="/genres/images/genre-' + safe + '.gif" width="277" height="42" border="0" alt="' + genre + '">');
}


