/************************************************************************/
/*                          template.js                                 */
/*                                                                      */
/* Generic JavaScript functions for use on the UQ template.             */
/* Version 1.0                                                          */
/* 5th October 2003                                                     */
/*                                                                      */
/************************************************************************/


// 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 = "";
        }
}   


// For the Header Search form
function goto_url(form) 
{

    if (form.search_text.value == "") 
    {
        alert("Please enter some text and then press Search");
        return false;
    }

    var url = form.search_select[form.search_select.selectedIndex].value +
    escape(form.search_text.value);


    // Uncomment this lines if you want the current window to change
    document.location = url;

    // Uncomment this line if you want the search in a new window
    //search_window = window.open(url);

    return false;
}

// Add any more functions below

<!--
	function get_random(maxNum)	{
		if (Math.random && Math.round) {
			var ranNum= Math.round(Math.random()*(maxNum-1));
			ranNum+=1;
			return ranNum;
		} else {
			today= new Date();
			hours= today.getHours();
			mins= today.getMinutes();
			secn= today.getSeconds();
			if (hours==19)
				hours=18;
			var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
			return ranNum;
  		}
	}

	// Object constructor
	function picRecord(image, txt, locn) {
		this.image = image
		this.txt = txt
		this.locn = locn
	}

	function get_Image() {
		if (document.images) {
			var choose_one= get_random(16);
			choose_one--;
			var pics= new Array(16)
				pics[0]=new picRecord("images/rotate/flasks.jpg","Cell Engineering","celleng.html")
				pics[1]=new picRecord("images/rotate/guava.jpg","Cell Engineering","celleng.html")
				pics[2]=new picRecord("images/rotate/hood.jpg","Cell Engineering","celleng.html")
				pics[3]=new picRecord("images/rotate/incubator.jpg","Cell Engineering","celleng.html")
				pics[4]=new picRecord("images/rotate/media.jpg","Cell Engineering","celleng.html")
				pics[5]=new picRecord("images/rotate/analyzer.jpg","Cell Engineering","celleng.html")
				pics[6]=new picRecord("images/rotate/scales.jpg","Cell Engineering","celleng.html")
				pics[7]=new picRecord("images/rotate/gfp.jpg","Cell Engineering","celleng.html")

				pics[8]=new picRecord("images/rotate/mab.jpg","Glycosylation and Protein Engineering","proteina.html")
				pics[9]=new picRecord("images/rotate/electrospray.jpg","Glycosylation and Protein Engineering","proteina.html")
				pics[10]=new picRecord("images/rotate/hplc.jpg","Glycosylation and Protein Engineering","proteina.html")
				pics[11]=new picRecord("images/rotate/shaker.jpg","Glycosylation and Protein Engineering","proteina.html")

				pics[12]=new picRecord("images/rotate/nanospray.jpg","Proteomics","proteome.html")
				pics[13]=new picRecord("images/rotate/qstar.jpg","Proteomics","proteome.html")
				pics[14]=new picRecord("images/rotate/symbiot.jpg","Proteomics","proteome.html")
				pics[15]=new picRecord("images/rotate/voyager.jpg","Proteomics","proteome.html")

			document.write("<a href='"+pics[choose_one].locn+"'><IMG SRC='"+pics[choose_one].image+"' width='191' height='145' border='0' alt='"+pics[choose_one].txt+"'></a>");
		} else {
			document.write("<IMG SRC='images/rotate/flasks.jpg' width='191' height='145' border='0' alt='Cell Engineering'>");
		}
	}

