/************************************************************************/
/*                          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
// Google Analytics
//var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
//document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//
//try {
//var pageTracker = _gat._getTracker("UA-10852028-1");
//pageTracker._trackPageview();
//} catch(err) {}

// apply class to ID

function showITEMS(id)
{
	document.getElementById(id).className = "showItems";
}

function hideITEMS(id)
{
	document.getElementById(id).className = "hideItems";
}
// this is to hide span tag "p1" "p2"
function showP()
{
	var spans = document.getElementsByTagName("span");
	var i=0;
	for (i; i<spans.length; i++) 
	{
		spans[i].className = "phide";
	}
}
// this is to resize img with the name "pIMG" to a set height and width.
function getIMGS(width, height)
{	
	var images = document.getElementsByTagName("img");
	var y=0;
	for (y; y<images.length; y++) 
	{
		if (images[y].name == "pIMG")
		{
			images[y].id = "imgID" + y;
			images[y].width = width;
			images[y].height = height;
		}	

	}
}









