/************************************************************************/
/*                          template.js                                 */
/*                                                                      */
/* Generic JavaScript functions for use on the UQ template.             */
/* Version 1.0                                                          */
/* 5th October 2003                                                     */
/*                                                                      */
/* Modifications:                                                       */
/*                                                                      */
/* 27th July 2006 - Chris Chudleigh                                     */
/* Added function changePage() to enable                                */
/* select search menu to jump to advanced search pages                  */
/************************************************************************/

function Is_Password(evt) {
	var charCode=(evt.which) ? evt.which : event.keyCode
		if ((charCode < 48) || (charCode > 57 && charCode < 65)  ||  (charCode > 90 && charCode < 97) || (charCode > 122)) {
			alert("Character Removed!  Only numbers and letters and are allowed")
			return false
		} else if (charCode == 13) {

		}
		return true
}


// For the Quick links pulldown-menu of the left hand side menu of the site
function changepage(formObject)
{
    var url;
    
    url = formObject.options[formObject.options.selectedIndex].value;

    if(url != "empty")
        {
        window.location = url;
        url = "";
        }
}   


// Add any more functions below

function changePage(form)
{
	 
	   if (form.search_text.value == "") 
    {
        alert("Please enter some text and then press Search");
        return false;
    }
		
	  if (form.search_select.selectedIndex==1)
		{
			
			document.location = form.search_select[form.search_select.selectedIndex].value  +
    escape(form.search_text.value);
		}
		else  if (form.search_select.selectedIndex==2)
		{
			document.location = form.search_select[form.search_select.selectedIndex].value  +
    escape(form.search_text.value);
		}
		else
		{return}
		
}