//Evolution Pop-up Window
//Make pop-up window different for each of the different kinds of window we need
//Re-size for certain ones status bar for others
function epop(type,loc,w,h) {
	var bname = navigator.appName;
	var bversion = parseInt(navigator.appVersion);
	var bplatform = navigator.platform;
	var ewindow;
	
	// Default states of status bar, resize box, scroll bars
	// you may need to put status bar on NN on Mac so scroll bars work proplerly
	var stat = 'no';
	var reSize = 'no';
	var scroll = 'no';
	// glossary location
	//var glossLoc = 'http://10.100.151.7/wgbh/evolution/glossary/glossary.html';
	var glossLoc = '/wgbh/evolution/library/glossary/glossary.html';
	//Define properties of pop-up, dependent on resource type
	if (type == "image" || type == "Image") {
		if (!w) {
			w = 530;
		}
		if (!h) {
			h= 500;
		}
		if (bname == 'Netscape' && bplatform != "Win32") {
			stat = 'yes';
		}
		reSize = 'yes';
		scroll = 'yes';
	} else if (type == "feature" || type == "Feature") {
		if (!w) {
			w = 650;
		}
		if (!h) {
			h= 428 + 22;
		}
	} else if (type == "facnote") {
		if (!w) {
			w = 400;
		}
		if (!h) {
			h= 200;
		}
		scroll = 'yes';
		stat = 'yes';
	} else if (type == "text" || type == "Text") {
		if (!w) {
			w = 420;
		}
		if (!h) {
			h= 500;
		}
		// text windows need to scroll
		reSize = 'yes';
		scroll = 'yes';
		if (bname == 'Netscape' && bplatform != "Win32") {
			stat = 'yes';
		}
	} else if (type == "video" || type == "Video") {
		if (!w) {
			w = 500;
		}
		if (!h) {
			h = 500;
		}
	} else if (type == "audio" || type == "Audio") {
		if (!w) {
			w = 360;
		}
		if (!h) {
			h = 150;
		}
	} else if (type == "qt") {
		if (!w) {
			w = 360;
		}
		if (!h) {
			h = 344 + 81;
		}
	} else if (type == "real") {
		if (!w) {
			w = 360;
		}
		if (!h) {
			h = 384 + 30;
		}
	} else if (type == "qt_cc") {
		if (!w) {
			w = 360;
		}
		if (!h) {
			h = 344 + 80;
		}
	} else if (type == "real_cc") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 360;
		}
	} else if (type == "qt_letter") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 320 + 80;
		}
	} else if (type == "real_letter") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 360 + 30;
		}
	} else if (type == "qt_letter_cc") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 320 + 80;
		}
	} else if (type == "real_letter_cc") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 360;
		}
	} else if (type == "qt_audio") {
		if (!w) {
			w = 360;
		}
		if (!h) {
			h = 150;
		}
	} else if (type == "real_audio") {
		if (!w) {
			w = 360;
		}
		if (!h) {
			h = 150;
		}
	} else if (type == "glossary" || type == "Glossary" || type == "gloss" || type == "Gloss") {
		if (!w) {
			w = 315;
		}
		if (!h) {
			h= 200;
		}
		if (bname == 'Netscape' && bplatform != "Win32") {
			stat = 'yes';
		}
		// prepend glossary page loc 
		loc = glossLoc + '#' + loc;
		// glossary window should to scroll
		reSize = 'yes';
		scroll = 'yes';
		if (bname == 'Netscape' && bplatform != "Win32") {
			stat = 'yes';
		}
	} else { // Default
		if (!loc) {
			loc = type;
			type = 'Default';
		}
		if (!w) {
			w = 650;
		}
		if (!h) {
			h= 428;
		}
		reSize = 'yes';
	}
	ewindow = window.open(loc,type,'width='+w+',height='+h+',toolbar=no,status='+stat+',scrollbars='+scroll+',resizable='+reSize+',menubar=no,directories=no');
	ewindow.focus();
}

