// Multiple submission checker.
var submitted = false;

function resetSubmit(formType)
{
	submitted = false;
	//alert("resetting...");
	if(formType != null && formType =='quick')
	{
		document.forms[0].submit.disabled = false;
	}
	else
	{
		document.forms[1].submit.disabled = false;
	}
}

function checkSubmit(thisForm)
{
	if (submitted == false)
	{
		submitted = true;
		thisForm.submit.disabled = true;
		//alert("about to call reset");
		setTimeout('resetSubmit()', 5000); 
		return true;
	}
	else
	{
		return false;
	}
}

function isBlank(s)
{
	// looks for any non-blank character and returns false if one is found.
    for ( var i = 0; i < s.length; i++)
    {
   		var c = s.charAt(i);
        if ( ( c != ' ' ) && ( c != '\n' ) && ( c !='\t' ) )
        {
        return false;
        }
    }
    return true;
}

// use on the quick search to stop both blank searches and multiple submissions
function checkSubmitStopBlank(thisForm)
{
	var searchTerms = thisForm.searchTerm.value;
	if ( ( searchTerms == "" ) || ( searchTerms == null ) || ( isBlank( searchTerms ) ) )
	{
		// don't care about anything else, so return without doing anything:
		return false;
	}
	if (submitted == false)
	{
		submitted = true;
		thisForm.submit.disabled = true;
		//alert("about to call reset");
		setTimeout("resetSubmit('quick')", 5000); 
		return true;
	}
	else
	{
		return false;
	}
}

function openActivity(url)
{
        var popup = window.open(url, "activity_window",'width='+(screen.availWidth-100)+',height='+(screen.availHeight-100)+',resizable=1,toolbar=1,location=0,directories=0,addressbar=1,scrollbars=1,status=0,menu bar=0,top=0,left=0,screenX=0,screenY=0'); return false;
		popup.focus();
}

/* start - SMALL POPUP */
function openSmall(urlsmall)
{
        var popup = window.open(urlsmall, "small_window",'width='+(screen.availWidth/2.5)+',height='+(screen.availHeight/2.5)+',resizable=1,toolbar=1,location=0,directories=0,addressbar=1,scrollbars=1,status=0,menu bar=0,top=0,left=0,screenX=0,screenY=0'); return false;
		popup.focus();
		popup.location = urlsmall;
}
/* finish - SMALL POPUP */

/* start - MEDIUM POPUP */
function openMedium(urlmedium)
{
	var popup = window.open(urlmedium, "medium_window",'width='+(screen.availWidth/1.5)+',height='+(screen.availHeight/1.5)+',resizable=1,toolbar=1,location=0,directories=0,addressbar=1,scrollbars=1,status=0,menu bar=0,top=0,left=0,screenX=0,screenY=0'); return false;
	popup.focus();
	popup.location = urlmedium;
}
/* finish - MEDIUM POPUP */

/* start - LARGE POPUP */
function openLarge(urllarge)
{
        var popup = window.open(urllarge, "large_window",'width='+(screen.availWidth-90)+',height='+(screen.availHeight-100)+',resizable=1,toolbar=1,location=0,directories=0,addressbar=1,scrollbars=1,status=0,menu bar=0,top=0,left=0,screenX=0,screenY=0'); return false;
		popup.focus();
		popup.location = urllarge;		
}
/* finish - LARGE POPUP */


// Flash sniffer from moock.org

// =============================================================================
// These are the user defined globals.
// Modify the following variables to customize the inspection behaviour.

var requiredVersion = 6;   // Version the user needs to view site (max 9, min 2)
var useRedirect = false;    // Flag indicating whether or not to load a separate
                           // page based on detection results. Set to true to
                           // load a separate page. Set to false to embed the
                           // movie or alternate html directly into this page.
// =============================================================================

// *************
// Everything below this point is internal until after the BODY tag.
// Do not modify! Proceed to the BODY tag for further instructions.
// *************

// System globals
var flash2Installed = false;    // boolean. true if flash 2 is installed
var flash3Installed = false;    // boolean. true if flash 3 is installed
var flash4Installed = false;    // boolean. true if flash 4 is installed
var flash5Installed = false;    // boolean. true if flash 5 is installed
var flash6Installed = false;    // boolean. true if flash 6 is installed
var flash7Installed = false;    // boolean. true if flash 7 is installed
var flash8Installed = false;    // boolean. true if flash 8 is installed
var flash9Installed = false;    // boolean. true if flash 9 is installed
var maxVersion = 9;             // highest version we can actually detect
var actualVersion = 0;          // version the user really has
var hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
var jsVersion = 1.0;            // the version of javascript supported

// Check the browser...we're looking for ie/win
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; // true if we're on windows

// This is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
  document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

// Next comes the standard javascript detection that uses the
// navigator.plugins array. We pack the detector into a function so that
// it preloads before being run.

function detectFlash() {
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      // Some version of Flash was found. Time to figure out which.

      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);

      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // We can get the major version by grabbing the character before the period
      // note that we don't bother with minor version detection.
      // Do that in your movie with $version or getVersion().
      var flashVersion = parseInt(flashDescription.substring(16));

      // We found the version, now set appropriate version flags. Make sure
      // to use >= on the highest version so we don't prevent future version
      // users from entering the site.
      flash2Installed = flashVersion == 2;
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion >= 9;
    }
  }

  // Loop through all versions we're checking, and
  // set actualVersion to highest detected version.
  for (var i = 2; i <= maxVersion; i++) {
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }

  // If we're on msntv (formerly webtv), the version supported is 4 (as of
  // January 1, 2004). Note that we don't bother sniffing varieties
  // of msntv. You could if you were sadistic...
  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 4;

  // DEBUGGING: uncomment next line to display flash version
  // alert("version detected: " + actualVersion);

  // We're finished getting the version on all browsers that support detection.
  // Time to take the appropriate action.

  // If the user has a new enough version...
  if (actualVersion >= requiredVersion) {
    // ...then we'll redirect them to the flash page, unless we've
    // been told not to redirect.
    if (useRedirect) {
      // Need javascript1.1 to do location.replace
      if(jsVersion > 1.0) {
        // It's safe to use replace(). Good...we won't break the back button.
        window.location.replace(flashPage);
      } else {
        // JavaScript version is too old, so use .location to load
        // the flash page.
        window.location = flashPage;
      }
    }

    // If we got here, we didn't redirect. So we make a note that we should
    // write out the object/embed tags later.
    hasRightVersion = true;
  } else {
    // The user doesn't have a new enough version.
    // If the redirection option is on, load the appropriate alternate page.
    if (useRedirect) {
      // Do the same .replace() call only if js1.1+ is available.
      if(jsVersion > 1.0) {
        window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
      } else {
        window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
      }
    }
  }
}

detectFlash();  // call our detector now that it's safely loaded.

// Change class function to change class of a given element (id)

function changeIdClass(theId, theClass){
	x = document.getElementById(theId);
   	x.className = theClass;
}

// Set style function to change style of a given elelement (id)

function setStyle(theId, theStyle, theValue){
	x = document.getElementById(theId);
	x.style[theStyle] = theValue;
}

// Set attribute function to change attribute of a given element (id)

function setAtt(theElement, theAttribute, theValue){
  	x = document.getElementById(theElement);
  	x.setAttribute(theAttribute, theValue);
}

// Toggle script for site map

function toggle(targetId, targetImg){
	if (document.getElementById){
		target = document.getElementById(targetId);
		theImg = document.getElementById(targetImg);
	}
	if (target.style.display == "none"){
		target.style.display = "";
		theImg.setAttribute("src","/images/collapse.gif");
		theImg.setAttribute("alt","Collapse this section");
	} else {
		target.style.display = "none";
		theImg.setAttribute("src","/images/expand.gif");
		theImg.setAttribute("alt","Expand this section");
	}
}

// Preload a couple of hidden images (inspiration from K10K.net)

function createObject(imgName,imgSrc) {
	eval(imgName+' = new Image()');
	eval(imgName+'.src = "'+imgSrc+'"');
}

// createObject('collapse_cont','/images/collapse_cont.gif');
// createObject('expand_cont','/images/expand_cont.gif');
createObject('collapse','/images/collapse.gif');
createObject('expand','/images/expand.gif');

// Switching function for sitemap

function switchLists(){
	for (var i = 1; i < 5; i++) {
		document.getElementById("maplist"+i).style.display="none";
		document.getElementById("image"+i).style.display="inline";
	}
}

// Start rollover functions written by Dreamweaver 4.0

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/* for displayArchive.jsp start */
function notes(url)
{
	var popup = window.open("", "notes_window",'toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=450,height=400');
	popup.focus();
	popup.location = url;
}
/* for displayArchive.jsp finish */

/* doTheLinks manages all links in document with specific class names */
/* NOT USED */
/*function doTheLinks() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className && links[i].className.match("popUp")) {
			hideSpan = document.createElement('span');
			hideSpan.className = 'hiddenText';
			hideText = document.createTextNode(' - this link will open in a new window');
			hideSpan.appendChild(hideText);
			links[i].setAttribute("title", "This link will open in a new window");
			links[i].appendChild(hideSpan);
		}
		if (links[i].className && links[i].className.match("externalLink")) {
			hideSpan = document.createElement('span');
			hideSpan.className = 'hiddenText';
			hideText = document.createTextNode(' - link to external site');
			hideSpan.appendChild(hideText);
			links[i].setAttribute("title", "Link to external site");
			links[i].appendChild(hideSpan);
		}
		// attributes if single page only e.g. end session - named 'popUpSmall'
		if (links[i].className && (' ' + links[i].className + ' ').indexOf(' popUp1 ') != -1) {
			links[i].onclick = function() {
window.open(this.href,'HSCPopUp1','width=480,height=320,resizable=1,toolbar=1,location=0,directories=0,addressbar=1,scrollbars=1,status=0,menubar=0');
				return false;
			}
		} 
		// attributes if medium popup - named 'popUpHelp'
		else if (links[i].className && (' ' + links[i].className + ' ').indexOf(' popUpHelp ') != -1) {
			links[i].onclick = function() {
window.open(this.href,'HSCPopUpHelp','width=600,height=550,resizable=1,toolbar=1,location=0,directories=0,addressbar=1,scrollbars=1,status=0,menubar=0');
				return false;
			}
		} 
		// attributes if large popup - named 'popUpMulti'
		// change PRODUCT for your product name and add attributes as required
		else if (links[i].className && (' ' + links[i].className + ' ').indexOf(' popUpMulti ') != -1) {
			links[i].onclick = function() {
window.open(this.href,'HSCPopUpMulti','width=600,height=580,resizable=1,toolbar=1,location=0,directories=0,addressbar=1,scrollbars=1,status=0,menubar=0');
				return false;
			}
		}
	}
}*/

/* Focus any window as it loads */
/* NOT USED */
/*function doFocus() {
	window.focus();
}*/

/* Calls for above functions NB this section removed as causing errors

addEvent(window,'load',doFocus);
addEvent(window,'load',doTheLinks);
addEvent(window,'unload',EventCache.flush); */

function openUrlWindow(id) {
	page = id;
	windowPrefs = "toolbar=no,directories=no,status=yes,menubar=yes,scrollbars=no,resizable=yes,width=540,height=230";
	urlWindow = window.open(page, "openUrl", windowPrefs);
	urlWindow.focus();
}

function pop_help(item_url)
	{
		window.open(item_url,'pop_help','toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,scrollbars=yes,width=640,height=615');
	}
	
	
function pop_durable(item_url)
	{
		window.open(item_url,'pop_durable','toolbar=no,directories=no,status=yes,menubar=yes,scrollbars=no,resizable=yes,width=540,height=230');
	}	

// *** START UNOBTRUSIVE SCRIPTS (AP) ***

/* Add Event function taken from http://www.dustindiaz.com/rock-solid-addevent/ */
/* Note: This function is required for all unobtrusive scripts */

function addEvent( obj, type, fn ) {
	if (obj.addEventListener) {
		obj.addEventListener( type, fn, false );
		EventCache.add(obj, type, fn);
	}
	else if (obj.attachEvent) {
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
		EventCache.add(obj, type, fn);
	}
	else {
		obj["on"+type] = obj["e"+type+fn];
	}
}

/* add Array.push if needed (ie5) */
if(Array.prototype.push == null){
	Array.prototype.push = function(){
		for(var i = 0; i < arguments.length; i++){
			this[this.length] = arguments[i];
		};
		return this.length;
	};
};

/*	EventCache Version 1.0
	Copyright 2005 Mark Wubben

	Provides a way for automagically removing events from nodes and thus preventing memory leakage.
	See <http://novemberborn.net/javascript/event-cache> for more information.
	
	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/
/* Note: This function is required for all unobtrusive scripts */
	
var EventCache = function(){
	var listEvents = [];
	return {
		listEvents : listEvents,
		add : function(node, sEventName, fHandler){
			listEvents.push(arguments);
		},
		flush : function(){
			var i, item;
			for(i = listEvents.length - 1; i >= 0; i = i - 1){
				item = listEvents[i];
				if(item[0].removeEventListener){
					item[0].removeEventListener(item[1], item[2], item[3]);
				};
				if(item[1].substring(0, 2) != "on"){
					item[1] = "on" + item[1];
				};
				if(item[0].detachEvent){
					item[0].detachEvent(item[1], item[2]);
				};
				item[0][item[1]] = null;
			};
		}
	};
}();

String.prototype.trim = function() {
    return this.replace( /^\s+|\s+$/i, "" );
}

function addClassName (elem, className) {
	if (elem.className.indexOf(className) == -1)
	elem.className = (elem.className + " " + className).trim();
}

function removeClassName (elem, className) {
    elem.className = elem.className.replace(className, "").trim();
}

function fixAnchors() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if(!links[i].getAttribute('href')){
			addClassName(links[i],'nolink');
		}
	}
	
}

addEvent(window,'load',fixAnchors);
addEvent(window,'unload',EventCache.flush);

// *** END UNOBTRUSIVE SCRIPTS (AP) ***

//new durable url layer
/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}  

/* NEW POPUP WINDOW SCRIPT */
/* add Array.push if needed (for IE5.x) */
if (Array.prototype.push == null) {
	Array.prototype.push = function(item) {
		this[this.length] = item; return this.length;
	}
}

/* Add Event function taken from http://www.dustindiaz.com/rock-solid-addevent/ */

function addEvent( obj, type, fn ) {
	if (obj.addEventListener) {
		obj.addEventListener( type, fn, false );
		EventCache.add(obj, type, fn);
	}
	else if (obj.attachEvent) {
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
		EventCache.add(obj, type, fn);
	}
	else {
		obj["on"+type] = obj["e"+type+fn];
	}
}

/*	EventCache Version 1.0
	Copyright 2005 Mark Wubben
	Provides a way for automagically removing events from nodes and thus preventing memory leakage.
	See <http://novemberborn.net/javascript/event-cache> for more information.
	This software is licensed under the CC-GNU LGPL http://creativecommons.org/licenses/LGPL/2.1/ */
	
var EventCache = function(){
	var listEvents = [];
	return {
		listEvents : listEvents,
		add : function(node, sEventName, fHandler){
			listEvents.push(arguments);
		},
		flush : function(){
			var i, item;
			for(i = listEvents.length - 1; i >= 0; i = i - 1){
				item = listEvents[i];
				if(item[0].removeEventListener){
					item[0].removeEventListener(item[1], item[2], item[3]);
				};
				if(item[1].substring(0, 2) != "on"){
					item[1] = "on" + item[1];
				};
				if(item[0].detachEvent){
					item[0].detachEvent(item[1], item[2]);
				};
				item[0][item[1]] = null;
			};
		}
	};
}();

/* doTheLinks manages all links in document with specific class names */

function doTheLinks() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className && links[i].className.match("popUp")) {
			hideSpan = document.createElement('span');
			hideSpan.className = 'hiddenText';
			hideText = document.createTextNode(' - this link will open in a new window');
			hideSpan.appendChild(hideText);
			links[i].setAttribute("title", "This link will open in a new window");
			links[i].appendChild(hideSpan);
// IE 5 needs special treatment because it's a bit special
if(!links[i].ownerDocument) {
				blankImg = document.createElement('img');
				blankImg.src = '/images/blank.gif';
				blankImg.className = 'borderNone';
				links[i].appendChild(blankImg);
			}
		}
		if (links[i].className && links[i].className.match("externalLink")) {
			hideSpan = document.createElement('span');
			hideSpan.className = 'hiddenText';
			hideText = document.createTextNode(' link to external site, this link will open in a new window');
			hideSpan.appendChild(hideText);
			links[i].setAttribute("title", "Link to external site, this link will open in a new window");
			links[i].appendChild(hideSpan);
// IE 5 needs special treatment because it's a bit special
if(!links[i].ownerDocument) {
				blankImg = document.createElement('img');
				blankImg.src = '/images/blank.gif';
				blankImg.className = 'borderNone';
				links[i].appendChild(blankImg);
			}
		}
		// attributes if single page only e.g. Durable URL - named 'popUpSmall'
		// change PRODUCT for your product name and add attributes as required
		if (links[i].className && (' ' + links[i].className + ' ').indexOf(' popUpSingle ') != -1) {
			links[i].onclick = function() {
window.open(this.href,'HSCPopUpSingle','width=480,height=360,resizable=1,toolbar=1,location=0,directories=0,addressbar=1,scrollbars=1,status=0,menubar=0');
				return false;
			}
		} 
		// attributes if medium popup - named 'popUpHelp'
// change PRODUCT for your product name and add attributes as required
		else if (links[i].className && (' ' + links[i].className + ' ').indexOf(' popUpHelp ') != -1) {
			links[i].onclick = function() {
window.open(this.href,'HSCPopUpHelp','width=640,height=480,resizable=1,toolbar=1,location=1,directories=0,addressbar=1,scrollbars=1,status=0,menubar=0');
				return false;
			}
		} 
		// attributes if large popup - named 'popUpMulti' and 'externalLink'
		// change PRODUCT for your product name and add attributes as required
		else if (links[i].className && (' ' + links[i].className + ' ').indexOf(' popUpMulti ') != -1 || (' ' + links[i].className + ' ').indexOf(' externalLink ') != -1) {
			links[i].onclick = function() {
window.open(this.href,'','width=500,height=480,resizable=1,toolbar=1,location=1,directories=0,addressbar=1,scrollbars=1,status=0,menubar=0');
				return false;
			}
		}
	}
}

/* Focus any window as it loads */

function doFocus() {
	window.focus();
}

/* Calls for above functions */

addEvent(window,'load',doFocus);
addEvent(window,'load',doTheLinks);
addEvent(window,'unload',EventCache.flush);

