/** Swinburne University of Technology Website: js functions javascript
 *  javascript file including functions destined to the 
 *  implementation of visual effects in the website
 *
 *  MODIFIED:
 *  version 1.0, 12 July 2004.
 * @version 1.1, 28 July 2004.
 * @version 1.2, 27 October 2004. added text size and cookie functions
 * @version 1.3, 6 January 2005. added domain parameter for the text size and cookie
 * @version 1.4, 29 January 2007. removed resize functions
 * @author David Jimenez david@swin.edu.au
 */

/**
 *  Preloads rollover images so they are ready to the rollover effect
 */

function function_preloadImages() { 
  var d=document; if(d.images){ if(!d.function_p) d.function_p=new Array();
    var i,j=d.function_p.length,a=function_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.function_p[j]=new Image; d.function_p[j++].src=a[i];}}
}

/**
 *  Restores original images after the rollover effect
 */

function function_swapImgRestore() { 
  var i,x,a=document.function_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function function_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=function_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/**
 *  Swaps the image when the mouse is over the image doing a rollover effect
 */

function function_swapImage() { 
  var i,j=0,x,a=function_swapImage.arguments; document.function_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=function_findObj(a[i]))!=null){document.function_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


