theDiv = "";
theShow = "";
arrNav = ["home","artist","dj","article","review","calendar","multimedia","store"];
thePage = "home.php";
if (parent.location.search != "") {
	if (parent.location.search.indexOf("?b=") > -1 ) {
		thePage = unescape(parent.location.search.split("?b=")[1]);
	} else if (parent.location.search.indexOf("?show=") > -1 ) {
		thePage = "home.php";
		theShow = unescape(parent.location.search.split("?show=")[1]);
	} else {
		thePage = "home.php";
	}
}
isSafari = false;

//window.onload = function () {parent.frameloaded = true; xmlhttpPost(thePage);}

if ((navigator.userAgent.indexOf("safari") != -1) || (navigator.userAgent.indexOf("Safari") != -1)) {isSafari = true;}

var MM_contentVersion = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
if ( !MM_FlashCanPlay ) {
	window.location.replace("noflash.php");
}

function xmlhttpPost(strURL) {
	parent.nav.location = "navigator.php?nav=" + escape(strURL);
}

function xmlhttpPostFrame(strURL) {
	thePage = strURL;
	if (!isSafari) {Element.show('getting');Element.hide('mainbody');}
	new Ajax.Updater('mainbody', strURL, {asynchronous:true, evalScripts:true, onComplete:function(request){if (!isSafari) {Element.show('mainbody');Element.hide('getting');}}, parameters:('i=1')})
	setNav(strURL);
	window.scrollTo(0,0);
}
function xmlhttpPostPlayer() {
	new Ajax.Updater('player', '_includes/player.php', {asynchronous:true, evalScripts:true, parameters:('show='+theShow)})
}

function setNav(strURL){
	for (i=1;i<=arrNav.length;i++) {
		if (strURL.indexOf(arrNav[i-1]) > -1) {
			theDiv = arrNav[i-1];
			document.images['img'+i].src = eval('img'+i+'_on').src;
		} else {
			document.images['img'+i].src = eval('img'+i+'_off').src;
		}
	}
}
function loadPlaylist(newXMLPath) {
  if ((navigator.userAgent.indexOf("mac") != -1) || (navigator.userAgent.indexOf("Mac") != -1)) {
    strQuery = unescape(newXMLPath.split("=")[1]);
	location = "index.php?show="+strQuery;
  } else {
    document.BTR_MediaPlayer.SetVariable("_level0.newXMLPath", newXMLPath);
  }  
}
function searchMediaArchive(obj, dj, date, type) {
	filter = "";
	if (dj != "all") {
		filter += dj;
	}
	if (date != "all") {
		if (filter != "") filter += " AND ";	
		filter += date;
	}
	if (type != "all") {
		if (filter != "") filter += " AND ";
		filter += type;
	}
	url = "multimedia.php?obj=" + obj + "&filter=" + filter;
	xmlhttpPost(url);
}
function addBookmark(page) {
	parent.location = "index.php?b=" + escape(page)
}
function openWindow(P_filename, P_name, P_width, P_height, P_resizable, P_scrollbars) { 
	features = 'width=' + P_width + ', height=' + P_height + ', resizable=' + P_resizable + ', scrollbars=' + P_scrollbars;
	window.open(P_filename, P_name, features); 
} 

img1_on = new Image();
img1_on.src = '_images/nav_home_on.gif';
img1_off = new Image();
img1_off.src = '_images/nav_home_off.gif';
img2_on = new Image();
img2_on.src = '_images/nav_artists_on.gif';
img2_off = new Image();
img2_off.src = '_images/nav_artists_off.gif';
img3_on = new Image();
img3_on.src = '_images/nav_djs_on.gif';
img3_off = new Image();
img3_off.src = '_images/nav_djs_off.gif';
img4_on = new Image();
img4_on.src = '_images/nav_articles_on.gif';
img4_off = new Image();
img4_off.src = '_images/nav_articles_off.gif';
img5_on = new Image();
img5_on.src = '_images/nav_reviews_on.gif';
img5_off = new Image();
img5_off.src = '_images/nav_reviews_off.gif';
img6_on = new Image();
img6_on.src = '_images/nav_calendar_on.gif';
img6_off = new Image();
img6_off.src = '_images/nav_calendar_off.gif';
img7_on = new Image();
img7_on.src = '_images/nav_multimedia_on.gif';
img7_off = new Image();
img7_off.src = '_images/nav_multimedia_off.gif';
img8_on = new Image();
img8_on.src = '_images/nav_store_on.gif';
img8_off = new Image();
img8_off.src = '_images/nav_store_off.gif';

