<!--
///////////////////////////////////
// Default Javascript Processing //
///////////////////////////////////

// These defaults should be changed the way it best fits the site
var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=190,height=140';

function popupCentre()
{
	var w = (screen.availWidth / 3) * 2;
	var h = (screen.availHeight / 3) * 2;
	var l = (screen.availWidth - w) / 2;
	var t = (screen.availHeight - h) / 2;
	_POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width='+w+',height='+h+',left='+l+',top='+t;
}

function rawPopup(url, target, features) {
    // pops up a window containing url optionally named target, optionally having features
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target  )) target   = '_blank';
    var theWindow = window.open(url, target, features);
	// message to user if the window open failed
	if(theWindow==null || typeof(theWindow)=="undefined"){
		alert('This function will only work if you allow non-automatic popups (Medium filter level in Internet Explorer SP2)');
	} else {
    	theWindow.focus();
	}
    return theWindow;
}

function standardPopup(url, target, features) {
	rawPopup(url, target, features);
}

function linkPopup(src, features) {
    // to be used in an html event handler as in: <a href="..." onclick="linkPopup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
    return rawPopup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

// Write e-mail address dynamically to avoid spambots
function email(name, domain, suffix, text){
   var address = name + "\u0040" + domain + "." + suffix;
   var url = "mailto:" + address;

   if( ! text ) {
      text = address;
   }
   document.write("<a href=\"" + url + "\">" + text + "</a>");
}

// Type Checking
function isUndefined(a) 	{ return typeof a == 'undefined' }
function isObjectNull(a)	{ return typeof a == 'object' && !a }
function isFunction(a) 		{ return typeof a == 'function'; }
function isObject(a) 		{ return (a && typeof a == 'object') || isFunction(a); }
function isArray(a) 		{ return (a && typeof a == 'array'); }
// (c) Senior Internet 2004
//-->