//--------------------------------------------//
// functions to create popup windows
//--------------------------------------------//
function popup(theLocation,x,y){
makeNewWindow(theLocation,x,y);}
var newWindow = null;
function makeNewWindow(theLocation,x,y) {
	var theParams = "width="+x+",height="+y+","
	theParams += "toolbar=no,scrollbars=yes,status=yes,location=no,resizable=yes,menubar=yes"
	var windowName = "Courseinfo"
	newWindow = window.open("",windowName,theParams);
	if (newWindow != null) {
		newWindow.location = theLocation;
	}
}

	function popblank(file) {
		popup = window.open(file,'blank','width=620,height=420,menubar,toolbar,location,status,resizable,scrollbars,screenX=30,screenY=30');
		if (document.images) {popup.focus();}
	}

//--------------------------------------------//
// Essential Page version 1.0
//
// Author : Hoi-Hung Tsang (hoi@tsang.cc)
// Lastupd: 4/30/2001
//--------------------------------------------//
// function sequence:
// public:
// 	[1] hideAllSubMenus
// 	[2] hideAllMenuButtons
// 	[3] essMakeSearch
// 	[4] essMakeMenu
// private:
// 	(5) essMakeMainMenuRow
// 	(6) essMakeSubMenuRow
// 	(7) essMakeSubMenuLayer
// 	(8) essGetMenuButtonOnMouseOverAction
// 	(9) essGetMenuSpacerOnMouseOverAction
// 	(10) essGetSubMenuOnMouseOverAction
// 	(11) essGetSubMenuOnMouseOutAction



	var CERTIFY_NEWLINE = "<BR>" + makeSpacer(1, 2) + "<BR>";						// Certify Info Line Break
var MASOTTA_EMAIL = '<A class=gray HREF="mailto:jeffrey.gworek@yale.edu">Jeff Gworek</A>'
	var CERTIFY_MESSAGE = "Certifying Authority: " + MASOTTA_EMAIL + 			// Certify Info Maessage
												", Director, Yale Printing &amp; Publishing Services," +			
												CERTIFY_NEWLINE +
												"Yale University - Administration";

//----------------------------------------------------------//
// 									Certify Message maker
//----------------------------------------------------------//
// input: none;
// output: HTML string of certify message
//----------------------------------------------------------//
function shMakeCertifyMessage(lastUpd)
{
	return CERTIFY_MESSAGE + ", " + lastUpd + "<BR>\n" + 
				 "Yale University website: <A class=gray href=\"http://www.yale.edu\">www.yale.edu</A>";
}




//---------------------------------------//
// variables for SEARCH box 
//---------------------------------------//
	var SEARCH_TARGET = "http://google.yale.edu/search";
	var SEARCH_METHOD = "get";
	var SEARCH_NAME = "gs";



//------------------------------------------------//
// HomePage builder
//------------------------------------------------//
// input: homepage index (check with HomePage.js)
// output: none
//------------------------------------------------//
function buildHomePage(pageIndex)
{
		var page = new HomePage(pageIndex);
		page.printHeader();
		page.printMenu()
		page.printBody();
		page.printFooter();
}




//------------------------------------------------//
// HomePage builder
//------------------------------------------------//
// input: homepage index (check with HomePage.js)
// output: none
//------------------------------------------------//
function buildSubPage(sectionIndex, pageIndex)
{
		var page = new SubPage(sectionIndex, pageIndex);
		page.printHeader();
		page.printMenu()
		page.printBody();
		page.printFooter();
}




//---------------------------------------//
// Search Box Maker
//---------------------------------------//
// input: none;
// output: HTML string of a search box 
//---------------------------------------//
function shMakeSearch()
{
	// create search box top spacer row
	var spacer = makeSpacer(1, 12);
	var spacerCell = makeCell(spacer, "colspan=3 height=10");
	var spacerRow = makeRow(spacerCell);

	// create title image cell
	var title = makeSpacer(18, 19) + 
							makeImage("images/search_ris.gif", 59, 19, 0) + 
							makeSpacer(10, 19);
	var titleCell = makeCell( title, "valign=center width=87");

	// create input text field
	var fieldCell = makeCell( '<input name="q" type="text" size="10" alt="Search Yale University" style="color:#6666aa;font-family:Verdana,Geneva,Arial,sans-serif;font-style:italic;font-size:9pt;vertical-align:middle;" onfocus="this.value=\'\';" />', "valign=top");

	// create go button input
	var goBut = makeSpacer(5, 19) + '<input type="image" border=0 value="Search" name="Submit" src="images/search_go.gif">' + makeSpacer(10, 19);
	var goButCell = makeCell( goBut, "valign=center width=35");

	// create form with title image, input text field, and go button
	var formTagPre = "<FORM name=\"" + SEARCH_NAME + "\"" +
									        "action=\"" + SEARCH_TARGET + "\"" +
									        "method=\"" + SEARCH_METHOD + "\"  target=\"popblank('');\">";
	var formTagSuf = '<input type="hidden" name="sort" value="date:D:L:d1"><input type="hidden" name="output" value="xml_no_dtd"><input type="hidden" name="oe" value="UTF-8"><input type="hidden" name="ie" value="UTF-8"><input type="hidden" name="proxyreload" value="1"><input type="hidden" name="site" value="Yale_University"><input type="hidden" name="as_sitesearch" value="www.yale.edu/ris"><input type="hidden" name="client" value="bluesite_frontend"><input type="hidden" name="proxystylesheet" value="bluesite_frontend"></FORM>';
	var searchform = formTagPre + titleCell + fieldCell + 
									 goButCell + formTagSuf

	// create search row 
	var searchRow = makeRow(searchform);

	// create search table with top spacer row and search row
	// and return it
	var rows = new Array(spacerRow, searchRow);
	return makeTable(rows, "border=0 cellspacing=0 cellpadding=0");
}










