/******************************
cust_col.js - allows customizational functions for cdm pages
without editing the cdm pages themselves too much.  Shouldn't be effected
by updates as much.
********************************/

/************************************
function search_load is to be run in the search.php file and is run when
the page loads.

It is responsible for unchecking all collection boxes except the ilstudia 
box if CISOROOT is set to '/ilstudia'.

If the collection is 'isuhistory' it redirects the browser from the search.php
page to the isuhistory home page, with has it's own advanced search section.

The following code must be added to the <head> in search.php:

<? if(isset($_GET['CISOROOT'])){$CISOROOT = $_GET['CISOROOT']; } else {$CISOROOT='';} ?>
<script language="javascript">var GCISOROOT = "<? echo $CISOROOT; ?>"</script>
<script language="javascript" src="cust_col.js"></script>

</head>

Following is added to the jscripts/search.js file at the end of the ShowWhat(), ShowAllFields, ShowSelectedFields, ShowByDate and ShowProximityFields functions.

search_load();

*******************************/

function search_load()
{
	switch (GCISOROOT)
	{
		case '/ilstudia':
			unCheckBoxes();
		
			var bsb = document.BurmaSelectedFields;
			for (i=0; i<bsb.elements.length; i++)
			{
				if(bsb.elements[i].value == '/ilstudia')
				{
					bsb.elements[i].checked = true;
				}
			}
			break;
		case '/icca':
                        unCheckBoxes();

                        var bsb = document.BurmaSelectedFields;
                        for (i=0; i<bsb.elements.length; i++)
                        {
                                if(bsb.elements[i].value == '/icca')
                                {
                                        bsb.elements[i].checked = true;
                                }
                        }
                        break;
		case '/isuhistory':
			window.location.href = 'http://tempest.lib.ilstu.edu/index_isuhistory.php';
			break;
		default:
			CheckBoxes();
			break;
	}

}
