/////////////////////////////////////////////////////////
//                                                     //
//          Developed by: Web Development Team         //
//                                                     //
//Copyright© 2000 University of Wisconsin - Platteville//
//                                                     //
//-----------------------------------------------------//
// This code will generate JUST the footer that has    //
// been approved for use at UW - Platteville.          //
// Search code is attached if it is requested.         //
/////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////
// DateUpdated variable is reset so the footer script  //
// will not error out.                                 //
/////////////////////////////////////////////////////////
var DateUpdated = "";

/////////////////////////////////////////////////////////
//       getJustFooter(search,stamp,name,username)     //
//-----------------------------------------------------//
// This code will return JUST the approved footer.     //
/////////////////////////////////////////////////////////
function getJustFooter(search,stamp,name,username) {
searchVal = search.toUpperCase()
stamp = document.lastModified;	//stamp is the DateUpdated field re-written.
if (searchVal == "Y") {
document.write(
	"<TABLE BGCOLOR='CCDDFF' BORDER='1' CELLSPACING='0' CELLPADDING='0' ALIGN=center>"
	+ "<TR><TD><TABLE BGCOLOR='CCDDFF' CELLPADDING='0' CELLSPACING='0' BORDER='0'><TR><TD WIDTH='330' HEIGHT='70' COLSPAN='3'><CENTER>"
	+ "<FORM NAME='AdvSearchForm' ACTION='http://search.uwplatt.edu/NSearch/SearchServlet' METHOD='get' onSubmit='javascript:return doQuery(this);'>"
	+ "<INPUT TYPE='hidden' NAME='country' VALUE='en'><INPUT TYPE='HIDDEN' NAME='version' VALUE='1' DISABLED>"
	+ "<INPUT TYPE='hidden' NAME='operator0' VALUE='0'><INPUT TYPE='hidden' NAME='numhits' VALUE='30'>"
	+ "<INPUT TYPE='hidden' NAME='template' VALUE=''><INPUT TYPE='hidden' NAME='date' VALUE=''>"
	+ "<INPUT TYPE='hidden' NAME='country' VALUE='en'><INPUT TYPE='hidden' NAME='lang' VALUE='English'>"
	+ "<INPUT TYPE='HIDDEN' NAME='queryitems' VALUE='1'>"
	+ "<FONT CLASS='title'>UWP Site Search</FONT><BR><INPUT TYPE='TEXT' NAME='query0' SIZE='35'><BR>"
	+ "<A HREF='http://search.uwplatt.edu' CLASS='advanced'>(Click Here For Advanced Options)</A></CENTER></FORM></TD><TD WIDTH='50'>"
	+ "<A HREF='javascript:doQuery(document.AdvSearchForm)' onMouseOver='qfind.src=qfindb.src; return true' onMouseOut='qfind.src=qfinda.src; return true'><IMG NAME='qfind' SRC='http://www.uwplatt.edu/search/qfinda.gif' ALT='Search' BORDER='0'></A></TD>"
	+ "<TD WIDTH='50'><A HREF='javascript:doHelp()' onMouseOver='uhelp.src=helpb.src; return true' onMouseOut='uhelp.src=helpa.src; return true'><IMG NAME='uhelp' SRC='http://www.uwplatt.edu/search/helpa.gif' ALT='Help' BORDER='0'></A></TD>"
	+ "</TR></TABLE></TD></TR></TABLE>"
	+ "<TABLE BORDER=0 WIDTH=90% CELLSPACING=0 CELLPADDING=5 ALIGN=CENTER><TR><TD ALIGN=CENTER>| <A HREF='http://www.uwplatt.edu' CLASS='nav-link'>UWP-Home </A>| <A HREF='http://www.uwplatt.edu/tree.html' CLASS='nav-link'>Tree </A>"
	+ "| <A HREF='http://search.uwplatt.edu' CLASS='nav-link'>Search </A>| <A HREF='http://www.uwplatt.edu/help.html' CLASS='nav-link'>Help </A>| <A HREF='http://www.uwplatt.edu/web/contact.html' CLASS='nav-link'>Web Master </A>|<BR><FONT CLASS='nav-foot'> Document Last Modified: "
	+ stamp +"</FONT><BR><FONT CLASS='nav-foot'>Copyright © 2001, University of Wisconsin - Platteville<BR>& The Board of Regents - University of Wisconsin System</FONT>"
	);
} else {
document.write(
	"<BR><HR WIDTH=80% ALIGN=CENTER><TABLE BORDER=0 WIDTH=90% CELLSPACING=0 CELLPADDING=5 ALIGN=CENTER><TR><TD ALIGN=CENTER>| <A HREF='http://www.uwplatt.edu' CLASS='nav-link'>UWP-Home </A>| <A HREF='http://www.uwplatt.edu/tree.html' CLASS='nav-link'>Tree </A>"
	+ "| <A HREF='http://search.uwplatt.edu' CLASS='nav-link'>Search </A>| <A HREF='http://www.uwplatt.edu/help.html' CLASS='nav-link'>Help </A>| <A HREF='http://www.uwplatt.edu/web/contact.html' CLASS='nav-link'>Web Master </A>|<BR><FONT CLASS='nav-foot'> Document Last Modified: "
	+ stamp +"</FONT><BR><FONT CLASS='nav-foot'>Copyright © 2001, University of Wisconsin - Platteville<BR>& The Board of Regents - University of Wisconsin System</FONT>"
	);	
}
if (name == "") {
	alert ("Please enter a name in the 'var PageOwner' field.");	
} else if (username == "" ){
document.write(
	"<BR><FONT CLASS='nav-foot'>Page Maintained By: " + name + "</FONT></TD></TR></TABLE>"
	);
} else {
document.write(
	"<BR><FONT CLASS='nav-foot'>Page Maintained By: </FONT><A HREF='mailto:" + username + "@uwplatt.edu' CLASS='nav-link'>" + name + "</A></TD></TR></TABLE>"
	);	
	}
}

/////////////////////////////////////////////////////////
//                  Begin search code                  //
/////////////////////////////////////////////////////////
qfinda = new Image();
qfinda.src = "http://search.uwplatt.edu/images/qfinda.gif";
qfindb = new Image();
qfindb.src = "http://search.uwplatt.edu/images/qfindb.gif";
helpa = new Image();
helpa.src = "http://search.uwplatt.edu/images/helpa.gif";
helpb = new Image();
helpb.src = "http://search.uwplatt.edu/images/helpb.gif";

function autoSelectLocale(SearchForm)
{
 //Set focus to the query text box
 SearchForm.query0.focus();
 //Only auto-select on the first load (by checking if a search has already been entered)
 if (VerifySearchData(SearchForm) == true) return;
 var country = "";
 var locale = navigator.language;  //Navigator
 if (locale == navigator.asdf)
    locale = navigator.browserLanguage;  //IE
 if (locale == navigator.asdf) return;  //Undefined
 if (locale.length > 2)
 {
    country = locale.substring(3,5);
    country = country.toUpperCase();
    locale = locale.substring(0,2);
    locale = locale.toLowerCase();
 }
 //Select the appropriate language option in the LANG select box
 if (country == "CN")
 {
    SearchForm.lang.selectedIndex = 0;
 }
 else if (country == "TW")
 {
    SearchForm.lang.selectedIndex = 1;
 }
 else
 {
    var languages = SearchForm.lang;
    for (var i = 2; i < languages.length; i++)
    {
       if (languages[i].value == locale)
       {
          SearchForm.lang.selectedIndex = i;
	  break;
       }
    }
 }
 //Make sure the Country is also updated
 setCountry(SearchForm.lang);
}

function setCountry(langSelection)
{
 //Init country to "no country"
 country.value = "";
 //Country only used on some selections
 if (langSelection.selectedIndex == 0)
    country.value = "CN";
 if (langSelection.selectedIndex == 1)
    country.value = "TW";
}

function doHelp()
{
 var wLeft  = 0;
 var wTop   = 0;
 if (window.screenX != window.asdf)
 {//Nav
    wLeft  = window.screenX;
    wTop   = window.screenY;
 }
 if (window.screenLeft != window.asdf)
 {//IE
    wLeft  = window.screenLeft;
    wTop   = window.screenTop;
 }
 wLeft = wLeft+30;
 wTop  = wTop+30;
 var location = "location=no,dependent=yes,toolbar=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes,left=" + wLEft + ",top=" + wTop + ",wIDth=700,height=500";
 var w=window.open("http://search.uwplatt.edu/novellsearch/SearchHelp.html",'NWSCHelp',location);
 w.focus();
}

function VerifySearchData(SearchForm)
{
 //return true only if we have a user-entered query
 return (SearchForm.query0.value.length > 0);
}

function doQuery(SearchForm)
{
 if (VerifySearchData(SearchForm) == true)
 {
    //Submit the form
    SearchForm.submit();
    //Restore all form elements to their operational state
    SearchForm.operator0[1].disabled = false;
    SearchForm.numhits.disabled = false;
    SearchForm.template.disabled = false;
    SearchForm.date.disabled = false;
    SearchForm.lang.disabled = false;
    SearchForm.country.disabled = false;
 }
}
/////////////////////////////////////////////////////////
//                   End search code                   //
/////////////////////////////////////////////////////////