<!-- 
// (c) 2000 Live365.com.  All rights reserved.
// This file needs to be munged

// Defined window handles
var gPopUp   		= null;

// HelpPopUpFunction()
//  will popup window with header and footer formating.
//  middleframe = required = the file that you want to show up in the window.
//  topframe = optional = override the header file
//  bottomframe = optional = override the footer file
function HelpPopUpFunction(middleframe, topframe, bottomframe, height, width, windowName, advert)
{
	if (HelpPopUpFunction.arguments.length < 7 || HelpPopUpFunction.arguments[6] == "")
		advert = false;
	if (HelpPopUpFunction.arguments.length < 6 || HelpPopUpFunction.arguments[5] == "")
		windowName = "Live365";
	if (HelpPopUpFunction.arguments.length < 5 || HelpPopUpFunction.arguments[4] == "")
		width = 472;
	if (HelpPopUpFunction.arguments.length < 4 || HelpPopUpFunction.arguments[3] == "")
		height = 280;

	var URL = buildArgString(middleframe, topframe, bottomframe, advert);

	openWindow(height,width,URL,windowName);	// launch window with height then width and then window name
}

// popUp()
//   to be used for simply popups where formating should not be used (for flash presentations)
//   URL = required = pass in the page that you want to display
//   height = optional = pass in height of popup window
//   width = optional = pass in wdith of popup window
function popUp(URL, height, width) {

	var windowName = "PopUp";

	var lHeight	= (height) ? height : "280";
	var lWidth	= (width) ? height : "472";
	openWindow (lHeight, lWidth, URL, windowName);
}

// openWindow()
//   supports popUp() & HelpPopUpFunction() = actually launches window and allows you to have both open at same time.
//   height = optional = pass in height of popup window
//   width = optional = pass in wdith of popup window
//   URL = required = pass in the page that you want to display
//   windowName = to allow multiple windows
function openWindow (height, width, URL, windowName) {
	gPopUp = window.open(URL, windowName,'resizeable=no,scrollbars=no,width=' + width + ',height=' + height + '');	
	gPopUp.focus();
}


function buildArgString(middleframe, topframe, bottomframe, advert)
{
	var URL, serverURL;
	serverURL = "http://www.live365.com";
	
	// BUID ARG STRING
	URL = serverURL + "/popup/frameset.html?topframe=";

	// Set top frame contents
	if (advert) {
		URL = URL + serverURL + "/popup/top-advert.html";
		URL = URL + "&middleframe=";		
	} else {
		if(topframe)
			URL = URL + topframe;
		else
			URL = URL + serverURL + "/popup/top_default.html";
		URL = URL + "&middleframe=";
	}
		
	// Set middle frame contents
	if(middleframe)
		URL = URL + middleframe;
	else
		URL = URL + serverURL + "/popup/404.html";		
	URL = URL + "&bottomframe=";

	// Set bottom frame contents	
	if(bottomframe)
		URL = URL + topframe;
	else
		URL = URL + serverURL + "/popup/bottom_default.html";	
	URL = URL + "&advert=" + advert;

	return URL;
}
//-->
