//showWindow() calls a popup for glossary terms
//it accepts an input, "term" which is the name of the glossary item's definition file, minus the .html
function showWindow(e, term) {
//    var x=y=100;
	term = 'glossary/' + term + '.html';

	//setting the windowname makes new calls to this function open glossary terms in the same small window, to reduce clutter
    var glossaryWindow = window.open(term,'term_window','width=200,height=300,scrollbars=yes,screenX=100,screenY=100,left=100,top=100');
	//the call to the focus() method makes the glossary window pop into view if it is hidden behind another window
	//this is important if you already have a term open, then browse, and later select another term. the new term will not 
	//only appear in the window, but the window will come back into view.
	glossaryWindow.focus();
}


//popUpModule() does the same thing as showWindow(), except for modules for anime we cite
function popUpModule(e, the_item) {
    var x=y=100;
	if (document.layers)
	{
		//set filename to be module_animeName.html
		//for example, if the argument "jubei" is passed to this function, it tries to open "module_jubei.html"
		temp = the_item;
		the_item = 'module_' + temp + '.html';
	}
	else
	{
		the_item = 'module_' + the_item + '.html';
	}
    if (e != '') {
//        x = e.screenX;
//        y = e.screenY;
    }

    moduleWindow = window.open(the_item,'windowName','width=640,height=300,status=yes,resizable=yes,scrollbars=yes,screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y);
	//bring module window to foreground
    moduleWindow.focus();
}

function popUpHuman(e, the_item) {
    var x=y=100;
	
	// the_item is which person module file to open. depending on which one to open, use heights and widths given below 
	// (i.e., 470x350 for human_roland since his module is that width and height
	switch (the_item)
	{
		case "human_bonnie":
			var w = 470; var h = 330;
			break;
		case "human_roland":
			var w = 470; var h = 370;		
			break;
		case "human_brian":
			var w = 470; var h = 320;
			break;
		case "human_jeff":
			var w = 470; var h = 275;
			break;
		case "human_liana":
			var w = 475; var h = 360;
			break;
		default:
			//default size is 500 x 350 if the human specified isn't in this list.
			var w = 500; var h = 350;		
			break;
	}
	if (document.layers)
	{
		temp = the_item;
		the_item = 'module_' + temp + '.html';
	}
	else
	{
		the_item = 'module_' + the_item + '.html';
	}
    if (e != '') {
//        x = e.screenX;
//        y = e.screenY;
    }
	
	//pop up new module window
    moduleWindow = window.open(the_item,'','width=' + w + ',height=' + h + ',status=no,resizable=yes,screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y);
    moduleWindow.focus();
}


//changePage() calls a popup for cultural items in the genres modules
function changePage(newLoc, e)
 {

	//make sure the <select> on the page calling this function is called "selectedPage"
   nextPage = newLoc.options[newLoc.selectedIndex].value
		
   if (nextPage != "")
   {
   		//there are two cases, one for NS, the other for IE. This is in case font sizes and such cause you to want to resize your window
	   if (document.layers)
	   {
	   		//this case is for Netscape
	   		//calls a popup window with the following parameters
		  var culturePopUp = window.open(nextPage, 'culture', 'width=400,height=250,scrollbars=yes,resizable=yes,screenX=100,screenY=100');   
		  culturePopUp.focus();
	   }
	   else
	   {
	   		//this case is for IE
	   	  var culturePopUp = window.open(nextPage, 'culture', 'width=400,height=250,resizable=yes,scrollbars=yes,screenX=100,screenY=100,status=yes');
		  culturePopUp.focus();
	   }
   }
 }
