/************************************************************************/
/*                          template.js                                 */
/*                                                                      */
/* Generic JavaScript functions for use on the UQ template.             */
/* Version 1.0                                                          */
/* 5th October 2003                                                     */
/*                                                                      */
/************************************************************************/


// Taken out by Ho Customized function replaced below
// 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

// Course Outline Table Display for Listing Files in Folder  Must use Class="Tbl" for CSS
<!--
   var elem = "TR";

 window.onload = function(){
  if(document.getElementsByTagName){
   var el = document.getElementsByTagName(elem);
    for(var i=0; i<el.length; i++){
      if(el[i].childNodes[0].tagName != "TH"
      && el[i].parentNode.parentNode.className.indexOf("tbl") != -1){
     if(i%2 == 1){
      el[i].className = "on";
      el[i].onmouseout  = function(){
	     this.className = "on";
      }
    } else {
      el[i].className = "off";
      el[i].onmouseout  = function(){
	     this.className = "off";
      }
    }
      el[i].onmouseover = function(){
	     this.className = "hover";
      }
   }
  }
 }
}
  //-->

// Use to pic random Image to Feature-Left position  
// This script was supplied free by Hypergurl
// http://www.hypergurl.com
<!--
    // JavaScript to interpolate random images into a page.
    var ic = 8;     // Number of alternative images
    var xoxo = new Array(ic);  // Array to hold filenames
        
xoxo[0] = "http://www.nrsm.uq.edu.au/Images/rotating/level2.jpg";
xoxo[1] = "http://www.nrsm.uq.edu.au/images/rotating/level2_02.jpg";
xoxo[2] = "http://www.nrsm.uq.edu.au/Images/rotating/level2_03.jpg";
xoxo[3] = "http://www.nrsm.uq.edu.au/Images/rotating/level2_04.jpg";
xoxo[4] = "http://www.nrsm.uq.edu.au/Images/rotating/level2_05.jpg";
xoxo[5] = "http://www.nrsm.uq.edu.au/Images/rotating/level2_06.jpg";
xoxo[6] = "http://www.nrsm.uq.edu.au/Images/rotating/level2_07.jpg";
xoxo[7] = "http://www.nrsm.uq.edu.au/Images/rotating/level2_08.jpg";

function pickRandom(range) {
if (Math.random)
return Math.round(Math.random() * (range-1));
else {
var now = new Date();
return (now.getTime() / 1000) % range;
}
}
// Write out an IMG tag, using a randomly-chosen image name.
var choice = pickRandom(ic);
// -->


// Add this to where you want the image to appear in the body of the page
// "<SCRIPT LANGUAGE="JavaScript">document.writeln('<TD'+'><IMG SRC="'+xoxo[choice]+'" HEIGHT=184 WIDTH=120 BORDER=0 ><'+'/TD>');
// SCRIPT>"

// This script for For the Quick links pulldown-menu of the left hand side menu of the site
// replacing the function at begining of file
function changepage(formObject)
{
	var url;
    url = formObject.options[formObject.options.selectedIndex].value;
	newwindow = window.open(url,'outlines','height=600, width=700, location=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=yes, top=70, left=180');
if (window.focus) {newwindow.focus()}
}  

// Function for UQ Program  outline popups

<!--
function popitup(url)
{
	newwindow=window.open(url,'program','height=600, width=700, location=yes, menubar=yes, resizable=yes, scrollbars=yes, toolbar=yes, top=70, left=180');
	if (window.focus) {newwindow.focus()}
}

// -->



// Function for Si Net Pop Search


<!--
function sinetpopitup(url)
{
	newwindow=window.open(url,'sinet','height=740,width=800,location=no,menubar=no,resizable=no,scrollbars=no,toolbar=no,top=90,left=180');
	if (window.focus) {newwindow.focus()}
}

// -->


// Use to pic random Image to Feature-Right position  


<!--
    // JavaScript to interpolate random images into a page.
    var myPictures = 6;     // Number of alternative images
    var xoxo1 = new Array(myPictures);  // Array to hold filenames
        
xoxo1[0] = "Images/feature/feature_01.jpg";
xoxo1[1] = "Images/feature/feature_02.jpg";
xoxo1[2] = "Images/feature/feature_03.jpg";
xoxo1[3] = "Images/feature/feature_04.jpg";
xoxo1[4] = "Images/feature/feature_02.jpg";
xoxo1[5] = "Images/feature/feature_04.jpg";

function pickRandom(range) {
if (Math.random)
return Math.round(Math.random() * (range-1));
else {
var now1 = new Date();
return (now1.getTime() / 1000) % range;
}
}
// Write out an IMG tag, using a randomly-chosen image name.
var imageSelect = pickRandom(myPictures);
// -->


// Add this to where you want the image to appear in the body of the page
// "<SCRIPT LANGUAGE="JavaScript">document.writeln('<TD'+'><IMG SRC="'+xoxo1[imageSelect]+'" HEIGHT=184 WIDTH=120 BORDER=0 ><'+'/TD>');
// SCRIPT>"


// Last date modified

<!--
var d = new Date(document.lastModified)
// document.write("Last modified on " + d)
//-->

// Srub link box for IE
<!--
function P7_Scrub(obj) { //v1.0 by PVII
 if(obj.blur){obj.blur();}
}
//-->


//Bread Crumb link

<!--
var path = "";
var href = document.location.href;
var s = href.split("/");
var iLoop;

for (iLoop=2; iLoop<(s.length-1); iLoop++) 
{
	path+="<A HREF=\""+href.substring(0,href.indexOf("/"+s[iLoop])+s[iLoop].length+1)+"/\">"+s[iLoop]+"</A> &raquo; ";
}

iLoop=s.length-iLoop;

var urlLink = path;
//-->



