bwr = navigator.appName;
ver = parseInt(navigator.appVersion);
NS4 = (bwr == "Netscape" && ver >= 4);
IE4 = (bwr == "Microsoft Internet Explorer" && ver >= 4);
v4 = (NS4 || IE4);

var maxheight = screen.availHeight-30;
var maxwidth = screen.availWidth-10;
var maxheight2 = screen.availHeight*.7;
var maxwidth2 = screen.availWidth*.7;
var newWin = null;
window.name = 'main';

function flashWindow(pageToLoad,winName,width,height) {

	xposition = (screen.availWidth - width) / 2;
	yposition = ((screen.availHeight - height) / 2) - 10;
	if ((parseInt(navigator.appVersion) >= 4 )) {
		xposition = (screen.availWidth - width) / 2;
		yposition = ((screen.availHeight - height) / 2) - 10;
    }
    args = "width=" + width + ","
    + "height=" + height + ","
    + "location=0,"
    + "menubar=0,"
    + "resizable=0,"
    + "scrollbars=0,"
    + "status=0,"
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only
	
	if (newWin != null && !newWin.closed) {
		newWin.close();
		newWin = null;
	}
    newWin = window.open(pageToLoad,winName,args);
    newWin.focus();
	
	if (NS4) {
		//return window.history.current();
	}
	else {
		//return window.history.current;
	}
	return;
}

function scrollingWindow(pageToLoad,winName,width,height) {

	xposition = (screen.availWidth - width) / 2;
	yposition = ((screen.availHeight - height) / 2) - 10;
	if ((parseInt(navigator.appVersion) >= 4 )) {
		xposition = (screen.availWidth - width) / 2;
		yposition = ((screen.availHeight - height) / 2) - 10;
    }
    args = "width=" + width + ","
    + "height=" + height + ","
    + "location=0,"
    + "menubar=0,"
    + "resizable=0,"
    + "scrollbars=1,"
    + "status=0,"
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only
	
	if (newWin != null && !newWin.closed) {
		newWin.close();
		newWin = null;
	}
    newWin = window.open(pageToLoad,winName,args);
    newWin.focus();
	
	if (NS4) {
		//return window.history.current();
	}
	else {
		//return window.history.current;
	}
	return;
}

function openAWindow(pageToLoad,winName,width,height) {
	if ((screen.availHeight < 748) || (screen.availWidth < 1032)) {
		width = screen.availWidth;
		height = screen.availHeight - 5;
		xposition = screen.availWidth / 2;
		yposition = (screen.availHeight / 2) - 3;
		if ((parseInt(navigator.appVersion) >= 4)) {
			xposition = 0;
			yposition = 0;
		}
		args = "outerWidth=" + width + ","
		+ "outerHeight=" + height + ","
		+ "location=0,"
		+ "menubar=0,"
		+ "scrollbars=1,"
		+ "resizable=1,"
		+ "status=0,"
		+ "titlebar=0,"
		+ "toolbar=0,"
		+ "hotkeys=0,"
		+ "screenx=" + xposition + ","  //NN Only
		+ "screeny=" + yposition + ","  //NN Only
		+ "left=" + xposition + ","     //IE Only
		+ "top=" + yposition;           //IE Only
	
		if (newWin != null && !newWin.closed) {
			newWin.close();
			newWin = null;
		}
		newWin = window.open(pageToLoad,winName,args);
		newWin.focus();
	
		if (NS4) {
			//return window.history.current();
		}
		else {
			//return window.history.current;
		}
		return;
	}
	else {
		xposition = (screen.availWidth - width) / 2;
		yposition = ((screen.availHeight - height) / 2) - 10;
		if ((parseInt(navigator.appVersion) >= 4 )) {
			xposition = (screen.availWidth - width) / 2;
			yposition = ((screen.availHeight - height) / 2) - 10;
		}
		args = "width=" + width + ","
		+ "height=" + height + ","
		+ "location=0,"
		+ "menubar=0,"
		+ "resizable=0,"
		+ "scrollbars=0,"
		+ "status=0,"
		+ "titlebar=0,"
		+ "toolbar=0,"
		+ "hotkeys=0,"
		+ "screenx=" + xposition + ","  //NN Only
		+ "screeny=" + yposition + ","  //NN Only
		+ "left=" + xposition + ","     //IE Only
		+ "top=" + yposition;           //IE Only
	
		if (newWin != null && !newWin.closed) {
			newWin.close();
			newWin = null;
		}
		newWin = window.open(pageToLoad,winName,args);
		newWin.focus();
	
		if (NS4) {
			//return window.history.current();
		}
		else {
			//return window.history.current;
		}
		return;
	}
}

function openMusic(info,number) {
	var encodedInfo = escape(info);
	var encodedNumber = escape(number);
	var encodedUrl = "http://www.melissapendill.com/html/dynamic_mp3_player.html?trackinfo=" + encodedInfo + "&tracknumber=" + encodedNumber;
	// CHECK FOR FLASH 6?
	flashWindow(encodedUrl,'disc',550,100);
}