// IE Hover FunctionalitystartList = function() {	if (document.all&&document.getElementById) {		navRoot = document.getElementById("nav");		for (i=0; i<navRoot.childNodes.length; i++) {			node = navRoot.childNodes[i];			if (node.nodeName=="LI") {				node.onmouseover=function() {					this.className+=" over";				}				node.onmouseout=function() {					this.className=this.className.replace(" over", "");				}			}		}	}}window.onload=startList;function toggleElements(className,containerID,mode) {	var elements = document.getElementsByClassName(className,$(containerID));	for(var i=0;i<elements.length;i++){		if(elements[i].firstChild.style.display == 'none'){			elements[i].firstChild.style.display = mode;		} else {			elements[i].firstChild.style.display = 'none';		}		if(elements[i].lastChild.style.display == 'none'){			elements[i].lastChild.style.display = mode;		} else {			elements[i].lastChild.style.display = 'none';		}	}}// Show/Hide Div Layer by IDfunction toggleLayer(whichLayer) {	if (document.getElementById) {		// this is the way the standards work		var style2 = document.getElementById(whichLayer).style;		style2.display = style2.display? "":"block";	} else if (document.all) {		// this is the way old msie versions work		var style2 = document.all[whichLayer].style;		style2.display = style2.display? "":"block";	} else if (document.layers) {		// this is the way nn4 works		var style2 = document.layers[whichLayer].style;		style2.display = style2.display? "":"block";	}}function swapLayers(offLayer1, offLayer2, onLayer) {//	toggleLayer(offLayer);//	toggleLayer(onLayer);	switchLayer(offLayer1, "");	if(offLayer2) {		switchLayer(offLayer2, "");	}	switchLayer(onLayer, "block");}function switchLayer(whichLayer, sw) {	if (document.getElementById) {		// this is the way the standards work		var style2 = document.getElementById(whichLayer).style;		style2.display = sw;	} else if (document.all) {		// this is the way old msie versions work		var style2 = document.all[whichLayer].style;		style2.display = sw;	} else if (document.layers) {		// this is the way nn4 works		var style2 = document.layers[whichLayer].style;		style2.display = sw;	}}function clearText(fieldID){	var thefield = document.getElementById(fieldID);	if (thefield.defaultValue==thefield.value) {		thefield.value = "";	}}function clearField(id) {	document.getElementById(id).value = "";}function addEventBase(obj, type, fn, name_hash) {    if (obj.addEventListener) {        obj.addEventListener(type, fn, false);    } else if (obj.attachEvent) {        obj["e" + type + fn + name_hash] = fn;        obj[type + fn + name_hash] = function () {obj["e" + type + fn + name_hash](window.event);};        obj.attachEvent("on" + type, obj[type + fn + name_hash]);    }}function rmEventBase(obj, type, fn, name_hash) {	obj.style.color = "#000";    if (obj.removeEventListener) {        obj.removeEventListener(type, fn, false);    } else if (obj.detachEvent) {        obj["e" + type + fn + name_hash] = '';        obj[type + fn + name_hash] = function () { };        obj.detachEvent("on" + type, obj[type + fn + name_hash]);    }}function placeholderSetup(id) {    var el = document.getElementById(id);    if (!el) {        return;    }    var ph = el.getAttribute("placeholder");    if (ph && ph != "") {        el.value = ph;        el.style.color = "#777";        el.is_focused = 0;        addEventBase(el, "focus", placeholderFocus);        addEventBase(el, "blur", placeholderBlur);    }}function placeholderFormSetup(el) {    var children = $A(el.childNodes);	children.each(		function(node) {			if(node.tagName == 'INPUT' && node.getAttribute("placeholder") && node.value == '') {				var ph = node.getAttribute("placeholder");		        node.value = ph;		        node.style.color = "#777";		        node.is_focused = 0;		        addEventBase(node, "focus", placeholderFocus);		        addEventBase(node, "blur", placeholderBlur);			} else {				placeholderFormSetup(node);			}		}	);}function placeholderFocus() {    if (!this.is_focused) {        this.is_focused = 1;        this.value = "";        this.style.color = "#000";        var rs = this.getAttribute("radioselect");        if (rs && rs != "") {            var re = document.getElementById(rs);            if (!re) {                return;            }            if (re.type != "radio") {                return;            }            re.checked = true;        }    }}function placeholderBlur() {    var ph = this.getAttribute("placeholder");    if (this.is_focused && ph && this.value == "") {        this.is_focused = 0;        this.value = ph;        this.style.color = "#777";    }}function placeholderSubmit(el) {    var children = $A(el.childNodes);	children.each(		function(node) {			if(node.tagName == 'INPUT' && node.getAttribute("placeholder")) {			    var ph = node.getAttribute("placeholder");			    if (node.value == ph) {			    	node.value = "";			    }			} else {				placeholderSubmit(node);			}		}	);}function toggleSub(a, id, tag) {	if(a.className == '') {		a.className = 'expanded';	} else {		a.className = '';	}	var el = $(id);	var children = $A(el.childNodes);	children.each(		function(node) {			if(node.tagName == tag) {				if(node.style.display == "block") {					node.style.display = "none";				} else {					node.style.display = "block";				}			}		}	);}function toggleCheckboxes(el, chkbx) {	var method;	if(chkbx.checked == true) {		method = true;		cls = ' highlight';	} else {		method = false;		cls = ''	}	highlightParent(chkbx, cls);	checkChildItems(el.lastChild, method);}function checkChildItems(el, method) {	var subItems = $A(el.childNodes);	subItems.each(		function (node) {			if(node.type == "checkbox") {				node.checked = method;				node.disabled = method;			} else {				checkChildItems(node, method);			}		}	);}function numbersonly(myfield, e, dec) {	var key;	var keychar;		if (window.event) 	   key = window.event.keyCode;	else if (e)	   key = e.which;	else	   return true;	keychar = String.fromCharCode(key);		// control keys	if ((key==null) || (key==0) || (key==8) || 	    (key==9) || (key==13) || (key==27) )	   return true;		// numbers	else if ((("0123456789.").indexOf(keychar) > -1))	   return true;		// decimal point jump	else if (dec && (keychar == "."))	   {	   myfield.form.elements[dec].focus();	   return false;	   }	else	   return false;}function goTo(page) {/* This function is called from the navigation menu   to jump to the designated URL. Empty values   are ignored. */   	if (page != "" ) {		document.location.href = page;	}	return false;}// Function to deal with wysiwygvar textareaOff=0function checkTextarea(textareaID) {	if (textareaOff == 0) {		generate_wysiwyg(textareaID);		this.textareaOff=1;	}}<!-- Begin emailCheckfunction emailCheck (emailStr) {/* The following pattern is used to check if the entered e-mail address   fits the user@domain format.  It also is used to separate the username   from the domain. */var emailPat=/^(.+)@(.+)$//* The following string represents the pattern for matching all special   characters.  We don't want to allow special characters in the address.    These characters include ( ) < > @ , ; : \ " . [ ]    */var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"/* The following string represents the range of characters allowed in a    username or domainname.  It really states which chars aren't allowed. */var validChars="\[^\\s" + specialChars + "\]"/* The following pattern applies if the "user" is a quoted string (in   which case, there are no rules about which characters are allowed   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com   is a legal e-mail address. */var quotedUser="(\"[^\"]*\")"/* The following pattern applies for domains that are IP addresses,   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal   e-mail address. NOTE: The square brackets are required. */var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$//* The following string represents an atom (basically a series of   non-special characters.) */var atom=validChars + '+'/* The following string represents one word in the typical username.   For example, in john.doe@somewhere.com, john and doe are words.   Basically, a word is either an atom or quoted string. */var word="(" + atom + "|" + quotedUser + ")"// The following pattern describes the structure of the uservar userPat=new RegExp("^" + word + "(\\." + word + ")*$")/* The following pattern describes the structure of a normal symbolic   domain, as opposed to ipDomainPat, shown above. */var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")/* Finally, let's start trying to figure out if the supplied address is   valid. *//* Begin with the coarse pattern to simply break up user@domain into   different pieces that are easy to analyze. */var matchArray=emailStr.match(emailPat)if (matchArray==null) {  /* Too many/few @'s or something; basically, this address doesn't     even fit the general mould of a valid e-mail address. */	alert("The Email Address appears to be incorrect or missing. Please check that all characters, for example @ and ., have been entered correctly.")	return false}var user=matchArray[1]var domain=matchArray[2]// See if "user" is valid if (user.match(userPat)==null) {    // user is not valid    alert("The username appears to be invalid or missing. Please check the Email Address again.")    return false}/* if the e-mail address is at an IP address (as opposed to a symbolic   host name) make sure the IP address is valid. */var IPArray=domain.match(ipDomainPat)if (IPArray!=null) {    // this is an IP address	  for (var i=1;i<=4;i++) {	    if (IPArray[i]>255) {	        alert("Destination IP address is invalid!")		return false	    }    }    return true}// Domain is symbolic namevar domainArray=domain.match(domainPat)if (domainArray==null) {	alert("The domain name in the Email Address does not appear to be valid. Please check the entered Email Address again.")    return false}/* domain name seems valid, but now make sure that it ends in a   three-letter word (like com, edu, gov) or a two-letter word,   representing country (uk, nl), and that there's a hostname preceding    the domain or country. *//* Now we need to break up the domain to get a count of how many atoms   it consists of. */var atomPat=new RegExp(atom,"g")var domArr=domain.match(atomPat)var len=domArr.lengthif (domArr[domArr.length-1].length<2 ||     domArr[domArr.length-1].length>3) {   // the address must end in a two letter or three letter word.   alert("The Email Address must end in a three-letter domain, or two letter country. Please check the entered Email Address again.")   return false}// Make sure there's a host name preceding the domain.if (len<2) {   var errStr="This Email Address is missing a hostname.  Please check the entered Email Address again."   alert(errStr)   return false}// If we've gotten this far, everything's valid!return true;}//  End emailCheck -->// $Id: drupal.js,v 1.22.2.2 2006/08/19 19:55:20 killes Exp $/** * Only enable Javascript functionality if all required features are supported. */function isJsEnabled() {  if (typeof document.jsEnabled == 'undefined') {    // Note: ! casts to boolean implicitly.    document.jsEnabled = !(     !document.getElementsByTagName ||     !document.createElement        ||     !document.createTextNode       ||     !document.documentElement      ||     !document.getElementById);  }  return document.jsEnabled;}// Global Killswitch on the <html> elementif (isJsEnabled()) {  document.documentElement.className = 'js';}/** * Make IE's XMLHTTP object accessible through XMLHttpRequest() */if (typeof XMLHttpRequest == 'undefined') {  XMLHttpRequest = function () {    var msxmls = ['MSXML3', 'MSXML2', 'Microsoft']    for (var i=0; i < msxmls.length; i++) {      try {        return new ActiveXObject(msxmls[i]+'.XMLHTTP')      }      catch (e) { }    }    throw new Error("No XML component installed!");  }}/** * Creates an HTTP GET request and sends the response to the callback function. * * Note that dynamic arguments in the URI should be escaped with encodeURIComponent(). */function HTTPGet(uri, callbackFunction, callbackParameter) {  var xmlHttp = new XMLHttpRequest();  var bAsync = true;  if (!callbackFunction) {    bAsync = false;  }  xmlHttp.open('GET', uri, bAsync);  xmlHttp.send(null);  if (bAsync) {    xmlHttp.onreadystatechange = function() {      if (xmlHttp.readyState == 4) {        callbackFunction(xmlHttp.responseText, xmlHttp, callbackParameter);      }    }    return xmlHttp;  }  else {    return xmlHttp.responseText;  }}/** * Creates an HTTP POST request and sends the response to the callback function * * Note: passing null or undefined for 'object' makes the request fail in Opera 8. *       Pass an empty string instead. */function HTTPPost(uri, callbackFunction, callbackParameter, object) {  var xmlHttp = new XMLHttpRequest();  var bAsync = true;  if (!callbackFunction) {    bAsync = false;  }  xmlHttp.open('POST', uri, bAsync);  var toSend = '';  if (typeof object == 'object') {    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');    for (var i in object) {      toSend += (toSend ? '&' : '') + i + '=' + encodeURIComponent(object[i]);    }  }  else {    toSend = object;  }  xmlHttp.send(toSend);  if (bAsync) {    xmlHttp.onreadystatechange = function() {      if (xmlHttp.readyState == 4) {        callbackFunction(xmlHttp.responseText, xmlHttp, callbackParameter);      }    }    return xmlHttp;  }  else {    return xmlHttp.responseText;  }}/** * Redirects a button's form submission to a hidden iframe and displays the result * in a given wrapper. The iframe should contain a call to * window.parent.iframeHandler() after submission. */function redirectFormButton(uri, button, handler) {  // (Re)create an iframe to target.  createIframe();  // Trap the button  button.onmouseover = button.onfocus = function() {    button.onclick = function() {      // Prepare variables for use in anonymous function.      var button = this;      var action = button.form.action;      var target = button.form.target;      // Redirect form submission      this.form.action = uri;      this.form.target = 'redirect-target';      handler.onsubmit();      // Set iframe handler for later      window.iframeHandler = function () {        var iframe = $('redirect-target');        // Restore form submission        button.form.action = action;        button.form.target = target;        // Get response from iframe body        try {          response = (iframe.contentWindow || iframe.contentDocument || iframe).document.body.innerHTML;          // Firefox 1.0.x hack: Remove (corrupted) control characters          response = response.replace(/[\f\n\r\t]/g, ' ');          if (window.opera) {            // Opera-hack: it returns innerHTML sanitized.            response = response.replace(/&quot;/g, '"');          }        }        catch (e) {          response = null;        }        $('redirect-target').onload = null;        $('redirect-target').src = 'about:blank';        response = parseJson(response);        // Check response code        if (response.status == 0) {          handler.onerror(response.data);          return;        }        handler.oncomplete(response.data);      }      return true;    }  }  button.onmouseout = button.onblur = function() {    button.onclick = null;  }}/** * Adds a function to the window onload event */function addLoadEvent(func) {  var oldOnload = window.onload;  if (typeof window.onload != 'function') {    window.onload = func;  }  else {    window.onload = function() {      oldOnload();      func();    }  }}/** * Adds a function to a given form's submit event */function addSubmitEvent(form, func) {  var oldSubmit = form.onsubmit;  if (typeof oldSubmit != 'function') {    form.onsubmit = func;  }  else {    form.onsubmit = function() {      return oldSubmit() && func();    }  }}/** * Retrieves the absolute position of an element on the screen */function absolutePosition(el) {  var sLeft = 0, sTop = 0;  var isDiv = /^div$/i.test(el.tagName);  if (isDiv && el.scrollLeft) {    sLeft = el.scrollLeft;  }  if (isDiv && el.scrollTop) {    sTop = el.scrollTop;  }  var r = { x: el.offsetLeft - sLeft, y: el.offsetTop - sTop };  if (el.offsetParent) {    var tmp = absolutePosition(el.offsetParent);    r.x += tmp.x;    r.y += tmp.y;  }  return r;};function dimensions(el) {  return { width: el.offsetWidth, height: el.offsetHeight };}/** * Returns true if an element has a specified class name */function hasClass(node, className) {  if (node.className == className) {    return true;  }  var reg = new RegExp('(^| )'+ className +'($| )')  if (reg.test(node.className)) {    return true;  }  return false;}/** * Adds a class name to an element */function addClass(node, className) {  if (hasClass(node, className)) {    return false;  }  node.className += ' '+ className;  return true;}/** * Removes a class name from an element */function removeClass(node, className) {  if (!hasClass(node, className)) {    return false;  }  // Replaces words surrounded with whitespace or at a string border with a space. Prevents multiple class names from being glued together.  node.className = eregReplace('(^|\\s+)'+ className +'($|\\s+)', ' ', node.className);  return true;}/** * Toggles a class name on or off for an element */function toggleClass(node, className) {  if (!removeClass(node, className) && !addClass(node, className)) {    return false;  }  return true;}/** * Emulate PHP's ereg_replace function in javascript */function eregReplace(search, replace, subject) {  return subject.replace(new RegExp(search,'g'), replace);}/** * Removes an element from the page */function removeNode(node) {  if (typeof node == 'string') {    node = $(node);  }  if (node && node.parentNode) {    return node.parentNode.removeChild(node);  }  else {    return false;  }}/** * Prevents an event from propagating. */function stopEvent(event) {  if (event.preventDefault) {    event.preventDefault();    event.stopPropagation();  }  else {    event.returnValue = false;    event.cancelBubble = true;  }}/** * Parse a JSON response. * * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message. */function parseJson(data) {  if (data.substring(0,1) != '{') {    return { status: 0, data: data.length ? data : 'Unspecified error' };  }  return eval('(' + data + ');');}/** * Create an invisible iframe for form submissions. */function createIframe() {  // Delete any previous iframe  deleteIframe();  // Note: some browsers require the literal name/id attributes on the tag,  // some want them set through JS. We do both.  window.iframeHandler = function () {};  var div = document.createElement('div');  div.id = 'redirect-holder';  div.innerHTML = '<iframe name="redirect-target" id="redirect-target" class="redirect" onload="window.iframeHandler();"></iframe>';  var iframe = div.firstChild;  with (iframe) {    name = 'redirect-target';    setAttribute('name', 'redirect-target');    id = 'redirect-target';  }  with (iframe.style) {    position = 'absolute';    height = '1px';    width = '1px';    visibility = 'hidden';  }  document.body.appendChild(div);}/** * Delete the invisible iframe for form submissions. */function deleteIframe() {  var holder = $('redirect-holder');  if (holder != null) {    removeNode(holder);  }}/** * Wrapper around document.getElementById(). */function $(id) {  return document.getElementById(id);}