/************************************************************************/
/*                          default.js                                 	*/
/*                                                                      */
/* Generic JavaScript functions for use on the UQ homepage.             */
/* Version 1.0                                                          */
/* 21 September 2005                                               	*/
/*                                                                      */
/* Search select and AJAX quick links                               	*/
/************************************************************************/





// For AJAX Quick Link //

function showHide(id) {

	// Change the button first
	//closeOthers()
	
	var moreID = 		document.getElementById(id);

	// Check to see if we should:
	// show or hide
	if (moreID.style.display == "block") {
		moreID.style.display = "none";
	} else {
		moreID.style.display = "block";
	}

}

// For the Header Search form //

function goto_url(form) {
		if (form.CiRestriction.value == "") {
			alert("Please enter some text and then press GO");
			return false;
		}

		var url = form.search_select[form.search_select.selectedIndex].value +
		escape(form.CiRestriction.value);
		//alert(url);


		//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;
	}

function ShowPopup(page,name,options)
{
Window = window.open(page,name,options);
}

      NS4 = document.layers;
      if (NS4) {
         origWidth = innerWidth;
         origHeight = innerHeight;
      }   
   function reDo() {
      if (innerWidth != origWidth || innerHeight != origHeight) 
         location.reload();
   }   
   if (NS4) onresize = reDo;
   
   
   
function writeEmail(emailAddress_array, displayName) {

      var emailAddress = "";

      for (var i=0; i<emailAddress_array.length - 1; i++)

            emailAddress += "&#" + emailAddress_array[i] + ";";


      if (typeof(displayName) == "undefined" || displayName == "" || displayName == "email me")

            displayName = emailAddress;

 document.write("<a href='#' title='Click to email " + emailAddress.replace("'", "&#39;") + "<" + emailAddress + ">' onclick='document.location.href=\"mail\u0074o\u003a" + emailAddress + "\"; return false;'>" + displayName.replace("'", "&#39;") + "</a>");

}


//  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-8705460-1");  
pageTracker._trackPageview();
} catch(err) {}

