= 4) {
isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
if (isNav4) {
winw = window.innerWidth;
winh = window.innerHeight;
}
if (isIE4) {
winw = document.body.clientWidth;
winh = document.body.clientHeight;
}
swidth = (screen.width / 2) - (winw / 2);
sheight = (screen.height / 2) - (winh / 2);
self.moveTo(swidth,sheight);
}
function redirect(url) {
if (url != null) {
location.href = url;
}
return false;
}
function DateSuffix(dt){
switch(dt){
case "1":
return "1st";
break;
case "2":
return "2nd";
break;
case "3":
return "3rd";
break;
case "01":
return "1st";
break;
case "02":
return "2nd";
break;
case "03":
return "3rd";
break;
case "21":
return "21st";
break;
case "22":
return "22nd";
break;
case "23":
return "23rd";
break;
case "31":
return "31st";
break;
default:
return dt + "th";
break;
}
}
function statusSet(newStat){
window.status = newStat;
return true;
}
// These variables are used to determine which DOM is available to us
var isDOM = (typeof(document.getElementsByTagName) != 'undefined' && typeof(document.createElement) != 'undefined') ? 1 : 0;
var isIE4 = (typeof(document.all) != 'undefined' && parseInt(navigator.appVersion) >= 4 && !typeof(window.opera)) ? 1 : 0;
var capable = (isDOM || isIE4) ? 1 : 0;
// Calculates the location of the object we are after, based on the DOM
// supported by this user agent. Works out the object based on the user agent
function getObj(el) {
var whichEl = false;
if (isDOM) {
var whichEl = document.getElementById(el);
} else if (isIE4) {
var whichEl = document.all(el);
}
return whichEl;
}// Expands an element, given an element name. If the second parameter is true, it will
// collapse all other open of this prefix elements first.
function _expand(elNo) {
if (!capable) return;
if (!this.multiple) this.collapseAll();
var whichEl = getObj(this.prefix + elNo + 'Child');
whichEl.style.display = 'block';
return false;
}
// Collapse an element, given an element name.
function _collapse(elNo) {
if (!capable) return;
var whichEl = getObj(this.prefix + elNo + 'Child');
whichEl.style.display = 'none';
return false;
}
// Toggles the display mode. Probably the most useful method here - this
// will open a closed element, or close an opened one, given the element name
function _toggle(elNo) {
if (!capable) return;
var whichEl = getObj(this.prefix + elNo + 'Child');
if (whichEl.style.display == 'block'){
this.collapse(elNo);
} else {
this.expand(elNo);
}
return false;
}
// Find out the number of elements in this prefix.
// IMPORTANT: Only works if element numbers are sequential integers with no gaps.
function _getNumElements() {
var i=0;
while (++i){
var obj = getObj(this.prefix + i + 'Parent');
if (!obj) return i-1;
}
}
// Collapses all elements of this prefix
function _collapseAll() {
var numElements = this.getNumElements();
for(i = 1; i <= numElements; i++) this.collapse(i);
return;
}
// Master object - allows multiple versions of this code to run on the same page
function hiddenContent(prefix, multiple) {
// Properties
this.prefix = prefix; // (string) the prefix used for page object controlled from this object
this.multiple = multiple; // (bool) allow several tags of the same prefix to be open at once?
// Methods
this.getNumElements = _getNumElements;
this.collapseAll = _collapseAll;
this.expand = _expand;
this.collapse = _collapse;
this.toggle = _toggle;
}