//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= 495;
		}
		if (bname == 'Netscape' && bplatform != "Win32") {
		stat = 'yes';
		}
		reSize = 'yes';
	} else if (type == "feature" || type == "Feature") {
		if (!w) {
			w = 650;
		}
		if (!h) {
			h= 428;
		}
	} 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 = 500;
		}
		if (!h) {
			h = 500;
		}
/*// added by Peter to handle letterboxed video pop ups*/
/*	} else if (type == "letterbox" || type == "Letterbox") {*/
/*		if (!w) {*/
/*			w = 424;*/
/*		}*/
/*		if (!h) {*/
/*			h = 340;*/
/*		}*/
// added by Peter to handle quicktime 4x3 video pop ups
	} else if (type == "qt") {
		if (!w) {
			w = 360;
		}
		if (!h) {
			h = 344;
		}
// added by Peter to handle real 4x3 video pop ups
	} else if (type == "real") {
		if (!w) {
			w = 360;
		}
		if (!h) {
			h = 384;
		}
// added by Peter to handle quicktime 4x3 video pop ups
	} else if (type == "qt_cc") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 320;
		}
// added by Peter to handle real 4x3 video pop ups
	} else if (type == "real_cc") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 340;
		}
// added by Peter to handle quicktime letterboxed video pop ups
	} else if (type == "qt_letter") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 320;
		}
// added by Peter to handle real letterboxed video pop ups
	} else if (type == "real_letter") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 370;
		}
// added by Peter to handle quicktime letterboxed video pop ups
	} else if (type == "qt_letter_cc") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 320;
		}
// added by Peter to handle real letterboxed video pop ups
	} else if (type == "real_letter_cc") {
		if (!w) {
			w = 424;
		}
		if (!h) {
			h = 340;
		}
// added by Peter to handle glossary pop up
	} 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;
// end added by Peter
	} 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();
}




