	// create the wQuery object if it doesn't already exist
	if(typeof(wQuery)=='undefined') wQuery = function(){};
	
	// create the root classbehaviours object if it doesn't already exist
	if(typeof(wQuery.classBehaviours)=='undefined') wQuery.classBehaviours = function(){};
	
	// create the handlers child object if it doesn't already exist
	if(typeof(wQuery.classBehaviours.handlers)=='undefined') wQuery.classBehaviours.handlers = function(){}
	
	// Open print dialog
	wQuery.classBehaviours.handlers.postBack = {
		// properties
		name: '_PostBack',
		// methods
		start: function(node){
			switch(node.type) {
			    case 'select-one'   : node.onchange = this.process; break;
			    case 'text'         : node.onchange = this.process; break;
			    default             : node.onclick = this.process; break;
			}
		},
		process: function(that) {
    		var objNode = (typeof (this.nodeName) == 'undefined') ? that : this;
    		if (objNode.className.indexOf('_confirm') > -1)
	    	    if (!confirm('Are you sure you want to perform this task?')) 
		        return false;

		    document.getElementById('autopostback').value = objNode.name;
			document.forms[0].submit(); 
		}
	}
			
	// add this addon to the wQuery object
	if(typeof(wQuery.fn)!='undefined'){
		// extend wQuery with this method
		wQuery.fn.postBack = function(){
			return this.each(
				function(){
					wQuery.classBehaviours.handlers.postBack.start(this);
				}
			);
		};
		// set the event handler for this wQuery method
		$(document).ready(
			function(){
				$(".postBack").postBack();
			}
		);
	}


// create the wQuery object if it doesn't already exist
if (typeof (wQuery) == 'undefined') wQuery = function() { };

// create the root classbehaviours object if it doesn't already exist
if (typeof (wQuery.classBehaviours) == 'undefined') wQuery.classBehaviours = function() { };

// create the handlers child object if it doesn't already exist
if (typeof (wQuery.classBehaviours.handlers) == 'undefined') wQuery.classBehaviours.handlers = function() { }

// Change a Form's Layout Based on its Values
wQuery.classBehaviours.handlers.displayOnValue = {
    // properties
    name: '_DisplayOnValue',
    index: 0,
    // methods
    start: function(node) {
        // find the refered id
        referedIds = wQuery.classBehaviours.utilities.getClassParameter(node, 'id', '').split(',');
        for (var a = 0; a < referedIds.length; a++) {
            if (referedIds[a] != '') {
                referedField = document.getElementById(referedIds[a]);
                if (referedField == null)
                    referedField = document.getElementsByName(referedIds[a])[0];
                // add all the elements belonging to this input field to an array
                referedObjs = (referedField.type == 'radio') ? document.getElementsByName(referedField.name) : new Array(referedField);
                // set event handlers for every element in the array
                for (var b = 0; b < referedObjs.length; b++) {
                    if (referedObjs[b].type == 'radio') {
                        referedObjs[b].onclick = this.changed;
                        referedObjs[b].onchange = this.changed;
                    } else {
                        referedObjs[b].onfocus = this.changed;
                        referedObjs[b].onchange = this.changed;
                    }
                }
                // delay and check the initial value
                this.update(node);
                node.id = (node.id) ? node.id : this.name + this.index++;
                setTimeout('wQuery.classBehaviours.handlers.displayOnValue.update(document.getElementById("' + node.id + '"))', 256);
            }
        }
    },
    update: function(objNode) {
        // compare element
        compareIds = wQuery.classBehaviours.utilities.getClassParameter(objNode, 'id', 'undefined').split(',');
        // get the required value
        compareValues = wQuery.classBehaviours.utilities.getClassParameter(objNode, 'value', 'undefined').split(',');
        // for all id value pairs
        compareDisplay = false;
        for (var a = 0; a < compareIds.length; a++) {
            if (compareIds[a] != '') {
                // get the refered input
                compareObj = document.getElementById(compareIds[a]);
                if (compareObj == null)
                    compareObj = document.getElementsByName(compareIds[a])[0];
                // get the input value
                compareValue = compareObj.value;
                for (var b = 0; b < compareValues.length; b++) {
                    if (compareObj.type == 'radio') {
                        compareDisplay = document.getElementsByName(compareIds[a])[compareValues[b]].checked;
                    }
                    else {
                        if ((typeof (compareObj.checked) != 'undefined'))
                            compareDisplay = compareObj.checked;
                        else if (compareValue == compareValues[b])
                            compareDisplay = true;
                    }
                }
            }
        }
        // show or hide the form part
        objNode.style.display = (compareDisplay) ? wQuery.classBehaviours.utilities.getVisibleState(objNode) : 'none';
        // apply new odd and even pattern
        tableNode = wQuery.classBehaviours.utilities.rootNode(objNode, 'TABLE');
        wQuery.classBehaviours.handlers.zebraTable.process(tableNode);
    },
    // events
    changed: function(that) {
        var objNode = (typeof (this.nodeName) == 'undefined') ? that : this;
        var dov = wQuery.classBehaviours.handlers.displayOnValue;
        // find the root of the form
        rootNode = wQuery.classBehaviours.utilities.rootNode(objNode, 'FIELDSET');
        // get all the elements of this class
        allNodes = wQuery.classBehaviours.utilities.getElementsByClassName(dov.name, rootNode);
        // ask them to update themselves
        for (var a = 0; a < allNodes.length; a++) dov.update(allNodes[a]);
    }
}

// Change a Form's Layout Based on its Values
wQuery.classBehaviours.handlers.displayIfChecked = {
    // properties
    name: 'displayIfChecked',
    index: 0,
    // methods
    start: function(node) {
        // set the click event
        if (node.type == 'radio') {
            node.onclick = this.changed;
            node.onchange = this.changed;
        } else {
            node.onfocus = this.changed;
            node.onchange = this.changed;
        }
        // check after loading
        setTimeout('wQuery.classBehaviours.handlers.displayIfChecked.changed(document.getElementById("' + node.id + '"))', 256);
    },
    // events
    changed: function(that) {
        var objNode = (typeof (this.nodeName) == 'undefined') ? that : this;
        var dic = wQuery.classBehaviours.handlers.displayIfChecked;
        // for all items of this class
        allPeerNodes = wQuery.classBehaviours.utilities.getElementsByClassName(dic.name, null);
        for (var b = 0; b < allPeerNodes.length; b++) {
            // get the target id's
            targetIds = wQuery.classBehaviours.utilities.getClassParameter(allPeerNodes[b], 'id', 'undefined').split(',');
            // get the required value
            sourceValue = wQuery.classBehaviours.utilities.getClassParameter(allPeerNodes[b], 'value', 'undefined');
            // get the checked status (if applicable)
            compareDisplay = (typeof (allPeerNodes[b].checked) != 'undefined') ? allPeerNodes[b].checked : compareObj.value == sourceValue;
            // for all target id's
            for (var a = 0; a < targetIds.length; a++) {
                document.getElementById(targetIds[a]).style.display = (compareDisplay) ? wQuery.classBehaviours.utilities.getVisibleState(objNode) : 'none';
            }
        }
    }
}

// add this addon to the wQuery object
if (typeof (wQuery.fn) != 'undefined') {
    // extend wQuery with this method
    wQuery.fn.displayOnValue = function() {
        return this.each(
            function() {
                wQuery.classBehaviours.handlers.displayOnValue.start(this);
            }
         );
    };
    // extend wQuery with this method
    wQuery.fn.displayIfChecked = function() {
        return this.each(
            function() {
                wQuery.classBehaviours.handlers.displayIfChecked.start(this);
            }
         );
    };
    // set the event handler for this wQuery method
    $(document).ready(
         function() {
             $(".displayOnValue").displayOnValue();
             $(".displayIfChecked").displayIfChecked();
         }
      );
}

// create the wQuery object if it doesn't already exist
if (typeof (wQuery) == 'undefined') wQuery = function() { };

// create the root classbehaviours object if it doesn't already exist
if (typeof (wQuery.classBehaviours) == 'undefined') wQuery.classBehaviours = function() { };

// create the handlers child object if it doesn't already exist
if (typeof (wQuery.classBehaviours.handlers) == 'undefined') wQuery.classBehaviours.handlers = function() { }

// resizes an iframed popup to the document's height
wQuery.classBehaviours.handlers.popUpLayer = {
    // properties
    name: 'popUpLayer',
    // methods
    start: function(node) {
        // cosmetic adjustments for MSIE 6
        if (navigator.userAgent.indexOf('MSIE 6') > -1)
            node.getElementsByTagName('DIV')[0].style.height = document.body.offsetHeight + 'px';
    }
}

// a (hidden) link for opening a popup layer
wQuery.classBehaviours.handlers.openPopUpLayer = {
    // properties
    name: 'openPopUpLayer',
    // methods
    start: function(node) {
        automation = wQuery.classBehaviours.utilities.getClassParameter(node, 'auto', 'no');
        if (automation == 'yes') {
            document.getElementById('popUpContents').src = node.href;
            this.open(node);
        }
        node.onmouseup = this.open;
    },
    // events
    open: function(that) {
        var node = (typeof (this.nodeName) == 'undefined') ? that : this;
        // tell the body that a layer is open (to avoid select elements shining through in MSIE 6)
        wQuery.classBehaviours.utilities.setClassParameter(document.body, 'popup', 'open');
        // if we can't find the ID, we are probably going to find in in the link
        linkTarget = (node.href != null) ? (node.href.indexOf('#') > -1) ? node.href.split('#')[1] : null : null;
        // get the target node
        linkTarget = wQuery.classBehaviours.utilities.getClassParameter(node, 'id', linkTarget);
        // transfer the title of the link to the popup
        if (node.getAttribute('title') != null && node.getAttribute('title') != '') document.getElementById(linkTarget).getElementsByTagName('H1')[0].innerHTML = node.getAttribute('title');
        // if there is no animation defined, open it the easy way
        if (node.className.indexOf('animatedClassName') < 0) document.getElementById(linkTarget).style.display = 'block';
        if (node.target == '') node.target = 'popUpContents';
    }
}

// closes a popup from within an iframe
wQuery.classBehaviours.handlers.closePopUpLayer = {
    // properties
    name: 'closePopUpLayer',
    // methods
    start: function(node) {
        node.onmousedown = (parent != self) ? this.closeInParent : this.closeInSelf;
    },
    // events
    closeInSelf: function(that) {
        var node = (typeof (this.nodeName) == 'undefined') ? that : this;
        // if we can't find the ID, we are probably going to find in in the link
        linkTarget = (node.href != null) ? (node.href.indexOf('#') > -1) ? node.href.split('#')[1] : null : null;
        // get the target node
        linkTarget = wQuery.classBehaviours.utilities.getClassParameter(node, 'id', null);
        // tell the body that a layer is closed (to avoid select elements shining through in MSIE 6)
        wQuery.classBehaviours.utilities.setClassParameter(document.body, 'popup', 'close');
        // trigger the close link of the target
        targetNode = document.getElementById(linkTarget).getElementsByTagName('A')[0];
        document.getElementById(linkTarget).style.display = 'none';
        document.getElementById('popUpContents').src = "about:blank";
        document.getElementById(linkTarget).style.display = 'none'
    },
    closeInParent: function(that) {
        var node = (typeof (this.nodeName) == 'undefined') ? that : this;
        // get the target node
        linkTarget = wQuery.classBehaviours.utilities.getClassParameter(node, 'id', null);
        // tell the body that a layer is closed (to avoid select elements shining through in MSIE 6)
        parent.wQuery.classBehaviours.utilities.setClassParameter(parent.document.body, 'popup', 'close');
        // trigger the close link of the target
        targetNode = parent.document.getElementById(linkTarget).getElementsByTagName('A')[0];
        document.getElementById('popUpContents').src = "about:blank";
        parent.document.getElementById('popUpWithIframe').style.display = 'none';
    }
}

// print the contents of the popup layer
wQuery.classBehaviours.handlers.printPopUpLayer = {
    // properties
    name: 'printPopUpLayer',
    // methods
    start: function(node) {
        node.onmousedown = this.print;
    },
    // events
    print: function(that) {
        var node = (typeof (this.nodeName) == 'undefined') ? that : this;
        // if this is an iframe
        iFrames = document.getElementsByTagName('IFRAME');
        if (iFrames.length > 0) {
            // print the contents of the iframe
            frames['popUpContents'].focus();
            frames['popUpContents'].print();
            // else
        } else {
            // print the page
            window.print();
        }
    }
}

// add this addon to the wQuery object
if (typeof (wQuery.fn) != 'undefined') {
    // extend wQuery with this method
    wQuery.fn.popUpLayer = function() {
        return this.each(
            function() {
                wQuery.classBehaviours.handlers.popUpLayer.start(this);
            }
         );
    };
    wQuery.fn.openPopUpLayer = function() {
        return this.each(
            function() {
                wQuery.classBehaviours.handlers.openPopUpLayer.start(this);
            }
         );
    };
    wQuery.fn.closePopUpLayer = function() {
        return this.each(
            function() {
                wQuery.classBehaviours.handlers.closePopUpLayer.start(this);
            }
         );
    };
    wQuery.fn.printPopUpLayer = function() {
        return this.each(
            function() {
                wQuery.classBehaviours.handlers.printPopUpLayer.start(this);
            }
         );
    };
    // set the event handler for this wQuery method
    $(document).ready(
         function() {
             $(".popUpLayer").popUpLayer();
             $(".openPopUpLayer").openPopUpLayer();
             $(".closePopUpLayer").closePopUpLayer();
             $(".printPopUpLayer").printPopUpLayer();
         }
      );
}

// create the wQuery object if it doesn't already exist
if (typeof (wQuery) == 'undefined') wQuery = function() { };

// create the root classbehaviours object if it doesn't already exist
if (typeof (wQuery.classBehaviours) == 'undefined') wQuery.classBehaviours = function() { };

// create the handlers child object if it doesn't already exist
if (typeof (wQuery.classBehaviours.handlers) == 'undefined') wQuery.classBehaviours.handlers = function() { }

// Replace a link to external content with the actual content
wQuery.classBehaviours.handlers.reloadFromUrl = {
    // properties
    name: '_ReloadFromUrl',
    refocus: '',
    index: 0,
    respite: 100,
    // methods
    start: function(node) {
        // if the node is marked to load automatically start loading else set an onclick event
        // debug(node.id);
        automatic = wQuery.classBehaviours.utilities.getClassParameter(node, 'auto', 'no');
        if (node.nodeName == 'IFRAME' || automatic == 'yes') this.clicked(node);
        else if (node.nodeName == 'BUTTON') node.onclick = this.clicked
        else if (node.nodeName == 'INPUT' && (node.type == 'button' || node.type == 'submit')) node.onclick = this.clicked
        else if (node.nodeName == 'INPUT' && (node.type == 'radio' || node.type == 'checkbox')) node.onclick = this.changed
        else if (node.nodeName == 'INPUT' && node.type == 'text') node.onchange = this.changed
        else if (node.nodeName == 'SELECT') node.onchange = this.changed
        else if (node.nodeName == 'TEXTAREA') node.onchange = this.changed
        else if (node.nodeName == 'A' && node.href.indexOf('javascript:__doPostBack') > -1) {
            node.href = '';
            node.onclick = this.clicked;
        }
        else if (node.nodeName == 'A') {
            node.onclick = this.clicked;
        }
    },
    wait: function(importProgress, referedNode, importError, requestTime) {
        var rfu = wQuery.classBehaviours.handlers.reloadFromUrl;
        // get the target for the indicator
        targetId = wQuery.classBehaviours.utilities.getClassParameter(referedNode, 'target', '');
        if (targetId != '') targetNode = document.getElementById(targetId)
        else targetNode = referedNode;
        // update the progress indicator
        wQuery.classBehaviours.utilities.setClassParameter(targetNode, 'progress', importProgress);
        wQuery.classBehaviours.utilities.setClassParameter(targetNode, 'error', importError);
        // only turn on the progress indicator after a short pause
        shownStatus = (new Date() - requestTime > rfu.respite) ? 1 : 0;
        wQuery.classBehaviours.utilities.setClassParameter(targetNode, 'show', shownStatus);
    },
    insert: function(importedObj, referedNode, importedText, requestTime) {
        var rfu = wQuery.classBehaviours.handlers.reloadFromUrl;
        // get the optional parameters from the refered node
        ping = wQuery.classBehaviours.utilities.getClassParameter(referedNode, 'ping', '0');
        if (ping == '1') return;

        targetId = wQuery.classBehaviours.utilities.getClassParameter(referedNode, 'target', null);
        sourceId = wQuery.classBehaviours.utilities.getClassParameter(referedNode, 'source', null);
        //  if a form is in the response take the action and reload
        noformId = wQuery.classBehaviours.utilities.getClassParameter(referedNode, 'noform', null);
        nonIntrusive = (wQuery.classBehaviours.utilities.getClassParameter(referedNode, 'gently', '0') == '1');

        if (targetId == null) {

            targetNode = wQuery.classBehaviours.utilities.rootNode(referedNode, null, null, 'axcontainer');
            if (targetNode != null)
                targetId = targetNode.id;
        }


        // get the content from the imported node
        importedNode = (sourceId != null) ?
				wQuery.classBehaviours.utilities.getXmlElementById(sourceId, importedObj, true) :
				importedObj;
        // forcefully insert the content into the target node
        if (!nonIntrusive) {
            // get the source HTML from the imported document
            importedHTML = wQuery.classBehaviours.ajax.serialize(importedNode, true);
            // strip any left over body tags from the content
            if (importedHTML.indexOf('<body') > -1) {
                //importedHTML = importedHTML.split('<body')[1].split('</body>')[0];
                importedHTML = importedHTML.substr(importedHTML.indexOf('>') + 1, importedHTML.length);
            }
            // if no id was given for the target node
            if (targetId == null) {
                // replace the refered node
                newDiv = document.createElement('div');
                newDiv.id = rfu.name + rfu.index++;
                referedNode.parentNode.replaceChild(newDiv, referedNode);
                targetNode = document.getElementById(newDiv.id);
            }
            // else
            else {
                // use the target id to find the node
                targetNode = document.getElementById(targetId);
            }
            //  if a full page is loaded and the noform is set do a redirect.
            if (noformId == '1' && new String(importedHTML).toLowerCase().indexOf('<form') > -1) {
                url = new String(importedHTML).toLowerCase();
                index = url.indexOf('action') + 8;
                url = url.substr(index, url.length - index);
                //  IE removed the " from the action="".
                index = url.indexOf('"') > url.indexOf('>') ? url.indexOf('>') : url.indexOf('"');
                url = url.substr(0, index);
                location.href = url;
                return;
            }
            // insert the imported HTML
            if (targetNode != null) {
                //  If empty hide the container
                if (importedHTML == '')
                    targetNode.style.display = 'none';
                else {
                    targetNode.style.display = 'block';
                    targetNode.innerHTML = importedHTML;
                }
            }
            // set the focus (if any)
            if (rfu.refocus != '') {
                currentNode = document.getElementById(rfu.refocus);
                if (currentNode != null && (currentNode.nodeName == 'INPUT' || currentNode.nodeName == 'SELECT' || currentNode.nodeName == 'TEXTAREA'))
                    if (currentNode.type != 'hidden') currentNode.focus();
            }
        }
        // or gently compare classnames and text
        else {
            // for all imported nodes
            importedChildNodes = importedNode.getElementsByTagName('*');
            for (var a = importedChildNodes.length - 1; a >= 0; a--) {
                // get the target ID
                exportedChildNodeId = importedChildNodes[a].getAttribute('id');
                // if it's a node with an existing ID
                if (exportedChildNodeId != null && exportedChildNodeId != '') {
                    // get the target node
                    exportedChildNode = document.getElementById(exportedChildNodeId);
                    // does this node actually exist?
                    if (exportedChildNode != null) {
                        // sync the classname
                        exportedChildNode.className = (importedChildNodes[a].className != null) ? importedChildNodes[a].className : importedChildNodes[a].getAttribute('class');
                        // sync the select options
                        if (importedChildNodes[a].nodeName == 'SELECT') {
                            // every node in this select
                            importedSelectOptions = importedChildNodes[a].getElementsByTagName('OPTION');
                            exportedSelectOptions = exportedChildNode.getElementsByTagName('OPTION');
                            // choose the longest list
                            selectOptionsLength = (importedSelectOptions.length > exportedSelectOptions.length) ? importedSelectOptions.length : exportedSelectOptions.length;
                            // for every item in the list
                            for (var b = selectOptionsLength - 1; b >= 0; b--) {
                                // if there is no exported option
                                if (b >= exportedSelectOptions.length) {
                                    // make a new option node
                                    newOptionElement = document.createElement('OPTION');
                                    newOptionText = document.createTextNode(importedSelectOptions[b].firstChild.nodeValue);
                                    newOptionElement.appendChild(newOptionText);
                                    newOptionElement.setAttribute('value', importedSelectOptions[b].value);
                                    exportedChildNode.appendChild(newOptionElement);
                                }
                                // if there is no imported option
                                else if (b >= importedSelectOptions.length) {
                                    // remove an option node
                                    exportedSelectOptions[b].parentNode.removeChild(exportedSelectOptions[b]);
                                }
                                // else
                                else {
                                    // transfer the imported to the exported node
                                    exportedSelectOptions[b].firstChild.nodeValue = importedSelectOptions[b].firstChild.nodeValue;
                                    exportedSelectOptions[b].value = importedSelectOptions[b].value;
                                }
                            }
                        }
                        // sync the text
                        importedHTML = wQuery.classBehaviours.ajax.serialize(importedChildNodes[a]);
                        importedHTML = importedHTML.substring(importedHTML.indexOf('>') + 1, importedHTML.lastIndexOf('<'));
                        isInlineMarkup = (
								exportedChildNode.innerHTML.toUpperCase().indexOf('<DIV') < 0 &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<SECTION') < 0 &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<ARTICLE') < 0 &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<HEADER') < 0 &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<FOOTER') < 0 &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<NAV') < 0 &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<FIELDSET') < 0 &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<SELECT') < 0 &&
								exportedChildNode.nodeName != 'SELECT' &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<OPTION') < 0 &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<TEXTAREA') < 0 &&
								exportedChildNode.nodeName != 'TEXTAREA' &&
								exportedChildNode.innerHTML.toUpperCase().indexOf('<INPUT') < 0 &&
								exportedChildNode.nodeName != 'INPUT'
							);
                        if (isInlineMarkup) exportedChildNode.innerHTML = importedHTML;
                    }
                }
            }
        }
        // reset the progress indicator
        wQuery.classBehaviours.utilities.setClassParameter(targetNode, 'progress', 4);
        wQuery.classBehaviours.utilities.setClassParameter(targetNode, 'error', 200);
        // activate any classbehaviours in there
        wQuery.classBehaviours.parser.parseNode(targetNode);
        //  legacy systems
        try { classBehaviour.parser.parseNode(targetNode); } catch (er) { };
        try { jQuery.parser.parseNode(targetNode); } catch (er) { };
        // OPTIONAL: replace the title
        replaceTitleId = wQuery.classBehaviours.utilities.getClassParameter(referedNode, 'title', null);
        if (replaceTitleId != null) document.getElementById(replaceTitleId).innerHTML = referedNode.title;
    },
    // events
    clicked: function(that, trigger) {
        var objNode = (typeof (this.nodeName) == 'undefined') ? that : this;
        var rfu = wQuery.classBehaviours.handlers.reloadFromUrl;
        //alert(objNode.id);
        // reminder the focus
        rfu.refocus = objNode.id;
        // try to get a URL from somewhere
        targetSrc = objNode.getAttribute('src');
        targetNode = wQuery.classBehaviours.utilities.rootNode(objNode, null, null, 'axcontainer');
        targetValue = objNode.getAttribute('value');

        //  get the id reference with holds the URI information
        hrefTarget = wQuery.classBehaviours.utilities.getClassParameter(objNode, 'id', '');
        // decide which URL has priority
        targetUrl =
                (hrefTarget != null && hrefTarget != '') ? document.getElementById(hrefTarget).value :
                (targetValue != null && targetValue != '') ? targetValue :
				(targetSrc != null && targetSrc != '') ? targetSrc :
				(targetNode != null && targetNode != '') ? ('axt=' + targetNode.id) : null;
        if (location.search != null && location.search != '')
            targetUrl = document.location.pathname + location.search + '&' + targetUrl;
        else
            targetUrl = document.location.pathname + '?' + targetUrl;

        ping = wQuery.classBehaviours.utilities.getClassParameter(objNode, 'ping', '');
        if (ping == '1') targetUrl = document.location.pathname + '?ping=1&v=' + document.getElementById(objNode.id).value + '&t=' + new Date();
        // get the post values
        postValues = wQuery.classBehaviours.ajax.getPostValues(trigger == null ? objNode : trigger);

        // get the post method
        postPrefix = (targetUrl.indexOf('?') < 0) ? '?' : '&';
        // if this is to be a refresh look, set the interval for it
        reloadInterval = parseInt(wQuery.classBehaviours.utilities.getClassParameter(objNode, 'interval', '-1'));
        if (reloadInterval > 0) {
            objNode.id = (objNode.id) ? objNode.id : rfu.name + rfu.index++;
            setTimeout('wQuery.classBehaviours.handlers.reloadFromUrl.clicked(document.getElementById("' + objNode.id + '"));', reloadInterval);
        }
        // place the AJAX request and cancel the click
        return wQuery.classBehaviours.ajax.addRequest(targetUrl, rfu.insert, rfu.wait, postValues, objNode);
        /* Always do a post
        return (new String(rootForm.getAttribute('method')).toLowerCase() == 'post') ?
        wQuery.classBehaviours.ajax.addRequest(targetUrl, rfu.insert, rfu.wait, postValues, objNode) :
        wQuery.classBehaviours.ajax.addRequest(targetUrl + postPrefix + postValues, rfu.insert, rfu.wait, null, objNode);
        */
    },
    changed: function(that) {
        var objNode = (typeof (this.nodeName) == 'undefined') ? that : this;
        var rfu = wQuery.classBehaviours.handlers.reloadFromUrl;
        // find the fieldset that belongs to this part of the form
        submitNode = wQuery.classBehaviours.utilities.rootNode(objNode, 'FIELDSET', null);
        // use the entire form if no fieldset was found
        if (submitNode.nodeName == 'BODY') {
            submitNode = wQuery.classBehaviours.utilities.rootNode(objNode, 'FORM', null);
        }
        // find any buttons in this fieldset
        buttonNodes = submitNode.getElementsByTagName('BUTTON');
        if (buttonNodes.length > 0) {
            submitNode = buttonNodes[0];
        }
        // or find any submit inputs in this fieldset instead
        else {
            inputNodes = submitNode.getElementsByTagName('INPUT');
            for (var a = 0; a < inputNodes.length; a++) if (inputNodes[a].type == 'submit' || inputNodes[a].type == 'button') submitNode = inputNodes[a];
        }
        // post it
        void (rfu.clicked(submitNode, objNode));
        return true;
    }
}

// add this addon to the wQuery object
if (typeof (wQuery.fn) != 'undefined') {
    // extend wQuery with this method
    wQuery.fn.reloadFromUrl = function() {
        return this.each(
				function() {
				    wQuery.classBehaviours.handlers.reloadFromUrl.start(this);
				}
			);
    };
    // set the event handler for this wQuery method
    $(document).ready(
			function() {
			    $(".reloadFromUrl").reloadFromUrl();
			}
		);
}

   // create the wQuery object if it doesn't already exist
   if(typeof(wQuery)=='undefined') wQuery = function(){};

   // create the root classbehaviours object if it doesn't already exist
   if(typeof(wQuery.classBehaviours)=='undefined') wQuery.classBehaviours = function(){};

   // create the handlers child object if it doesn't already exist
   if(typeof(wQuery.classBehaviours.handlers)=='undefined') wQuery.classBehaviours.handlers = function(){}

   // Alternates the classes of a table's rows and columns
   wQuery.classBehaviours.handlers.zebraTable = {
       // properties
       name: '_ZebraTable',
       // methods
       start: function(node) {
           this.process(node);
       },
       process: function(objNode) {
           var objRows, objCols, intCellNumber;
           // get all table rows
           objRows = objNode.getElementsByTagName('TR');
           // for all table rows
           for (var intRow = 0; intRow < objRows.length; intRow++) {
               // undo any previous classing
               objRows[intRow].className = objRows[intRow].className.replace('odd', '');
               objRows[intRow].className = objRows[intRow].className.replace('even', '');
               // add oddrow or evenrow class to the row
               objRows[intRow].className += (intRow % 2 == 0) ? ' odd' : ' even';
               // and row and col counters if they're not allready present
               if (objRows[intRow].className.indexOf('row_') < 0) objRows[intRow].className += ' row_' + intRow;
               // get all nodes in this row
               objCols = objRows[intRow].childNodes;
               // for every node in the row
               intCellNumber = 0;
               for (var intCol = 0; intCol < objCols.length; intCol++) {
                   // is this a cell or a header
                   if (objCols[intCol].nodeName.indexOf('text') < 0) {
                       // undo any previous classing
                       objCols[intCol].className = objCols[intCol].className.replace('odd', '');
                       objCols[intCol].className = objCols[intCol].className.replace('even', '');
                       // add oddcol or evencol class
                       objCols[intCol].className += (intCellNumber % 2 == 0) ? ' odd' : ' even';
                       // and row and col counters if they're not allready present
                       if (objCols[intCol].className.indexOf('col_') < 0) objCols[intCol].className += ' col_' + intCellNumber;
                       // keep cell numbers
                       intCellNumber += 1;
                   }
               }
           }
       }
   }

   // add this addon to the wQuery object
   if (typeof (wQuery.fn) != 'undefined') {
       // extend wQuery with this method
       wQuery.fn.zebraTable = function() {
           return this.each(
            function() {
                wQuery.classBehaviours.handlers.zebraTable.start(this);
            }
         );
       };
       // set the event handler for this wQuery method
       $(document).ready(
         function() {
             $(".zebraTable").zebraTable();
         }
      );
   }
/*
	name			: ClassBehaviours, the javascript framework based on class-name parsing
	update			: 9.3.17
	author			: Maurice van Creij, Marc Molenwijk
	dependencies	: jquery.classbehaviours.js
	info			: http://www.classbehaviours.com/

    This file is part of wQuery.classBehaviours.

    ClassBehaviours is a javascript framework based on class-name parsing.
    Copyright (C) 2008  Maurice van Creij

    ClassBehaviours is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ClassBehaviours is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ClassBehaviours. If not, see http://www.gnu.org/licenses/gpl.html.
*/

	// create the wQuery object if it doesn't already exist
	if(typeof(wQuery)=='undefined') wQuery = function(){};

	// create the root classbehaviours object if it doesn't already exist
	if(typeof(wQuery.classBehaviours)=='undefined') wQuery.classBehaviours = function(){};

	// create the handlers child object if it doesn't already exist
	if(typeof(wQuery.classBehaviours.handlers)=='undefined') wQuery.classBehaviours.handlers = function(){}

	// AJAX interface
	wQuery.classBehaviours.ajax = {
	    // properties
	    queue: new Array(),
	    // utilities
	    getNodeValue: function(node) {
	        // get the text value from a node if there is one
	        strValue = (node.childNodes.length > 0) ? node.firstChild.nodeValue : null;
	        // return it as text or a number
	        return (isNaN(strValue) || strValue == null) ? strValue : parseInt(strValue);
	    },
	    setNodeValue: function(node, strValue) {
	        // if this node already has a textNode
	        if (node.childNodes.length > 0) {
	            // set the value of the existing textNode
	            node.firstChild.nodeValue = strValue;
	        } else {
	            // or make a new textNode
	            var objNewNode = ajax.createTextNode(strValue);
	            node.appendChild(objNewNode);
	        }
	    },
	    getChildNumber: function(node) {
	        var nodes = node.parentNode.childNodes;
	        // look for the matching node in a list of childNodes
	        var intTextNodes = 0;
	        for (var intA = 0; intA < nodes.length; intA++) {
	            // count the amount of text nodes
	            if (nodes[intA].nodeName == '#text') intTextNodes += 1;
	            // return the found node and substract the amount of text nodes
	            if (node == nodes[intA]) return intA - intTextNodes;
	        }
	        // return null if no match was found
	        return null;
	    },
	    serialize: function(node, inner) {
	        // if the standard method is valid
	        if (typeof (XMLSerializer) != 'undefined') {
	            nodeXml = (new XMLSerializer()).serializeToString(node);
	        }
	        // if this is MSIE and XML was given
	        else if (node.xml != null) {
	            nodeXml = node.xml;
	        }
	        // if this is MSIE and a whole document was given
	        else if (node.getElementsByTagName('HTML').length > 0) {
	            nodeXml = '<!DOCTYPE html><HTML>' + node.getElementsByTagName('HTML')[0].innerHTML + '</HTML>';
	        }
	        // if this is MSIE and an HTML4 fragment was given
	        else if (node.innerHTML != null && node.innerHTML != '') {
	            nodeXml = '<' + node.nodeName + ' class="' + node.className + '" id="' + node.id + '">' + node.innerHTML + '</' + node.nodeName + '>';
	        }
	        // if this is MSIE and an HTML5 fragment was given
	        else {
	            // pick parent nodes until a node is found for which the innerHTML actually works
	            nodeXml = '';
	            nodeRoot = node;
	            while (nodeRoot != nodeRoot.parentNode && nodeXml == '') {
	                // try the next parent
	                nodeRoot = nodeRoot.parentNode;
	                // get the innerHTML of that
	                nodeXml = nodeRoot.innerHTML;
	            }
	            // to find the tag name of the string, look for the id in the string
	            idIndex = nodeXml.indexOf('id="' + node.id + '"');
	            if (idIndex < 0) idIndex = nodeXml.indexOf('id=' + node.id + ' ');
	            if (idIndex < 0) idIndex = nodeXml.indexOf('id=' + node.id + '>');
	            // split the string before this position
	            tagName = nodeXml.substring(0, idIndex);
	            // find the last < and split it after
	            openTagIndex = tagName.lastIndexOf('<');
	            tagName = tagName.substring(openTagIndex + 1);
	            // find the first ' ' and split it before
	            tagName = tagName.substring(0, tagName.lastIndexOf(' '));
	            // split the string after the id position
	            endTags = nodeXml.substring(idIndex);
	            // while the close tag was not found and the string did not end
	            charCount = openTagIndex + 1;
	            tagCount = 1;
	            tries = 0;
	            while (tagCount > 0 && tries < 5) {
	                // look forward through the string to count similar tags
	                nextStart = nodeXml.indexOf('<' + tagName, charCount);
	                if (nextStart == -1) nextStart = 1000000;
	                nextClose = nodeXml.indexOf('</' + tagName + '>', charCount);
	                if (nextClose == -1) nextClose = 1000000;
	                // if you find a similar opening tag add 1 to the count
	                if (nextStart < nextClose) {
	                    tagCount += 1;
	                    charCount = nextStart + 1;
	                }
	                // if you find a similar closing tag substract 1 from the count
	                if (nextClose < nextStart) {
	                    tagCount -= 1;
	                    charCount = nextClose + 1;
	                }
	                // if the count reaches 0 the proper closing tag was found
	                tries += 1;
	            }
	            // cut off the rest of the string using the character counter
	            closeTagIndex = nextClose + tagName.length + 3;
	            // return the resulting clip
	            nodeXml = nodeXml.substring(openTagIndex, closeTagIndex);
	        }
	        // remove the outer tag if required
	        if (inner) {
	            // split after first > and before last <
	            nodeXml = nodeXml.substring(nodeXml.indexOf('>') + 1, nodeXml.lastIndexOf('<'));
	        }
	        // give the extracted element back
	        return nodeXml;
	    },
	    deserialize: function(text) {
	        newElement = document.createElement('DIV');
	        newElement.innerHTML = text;
	        return newElement;
	    },
	    defaultProgress: function(progressStatus, progressNode, progressError) {
	        // fill the refered node with a progress report
	        progressNode.innerHTML = (progressStatus > -1) ? 'Loading: ' + Math.round(progressStatus * 100) + '%' : 'Error: ' + progressError;
	    },
	    defaultLoad: function(loadXml, loadNode, loadText) {
	        // fill the refered node with the returned html string
	        loadNode.innerHTML = loadText.split('<body>')[1].split('</body>')[0];
	    },
	    getPostValues: function(node, nodeId) {
	        // use the id if needed
	        if (nodeId != null) node = document.getElementById(nodeId);
	        // get all elements of this form
	        formNode = wQuery.classBehaviours.utilities.rootNode(node, 'FORM');
	        rootNode = wQuery.classBehaviours.utilities.rootNode(node, 'FIELDSET');
	        allNodes = formNode.getElementsByTagName('*');
	        postValues = '';
	        // see if we can do anything to make it easier for .NET
	        // .NET replaces the last _ with a $ for eventtarget validation
	        eventTarget = '';
	        split = node.id.split("_");
	        if (split.length > 1) {
	            for (var a = 0; a < split.length; a++)
	                if (split[a] != '')
	                eventTarget += (a == split.length - 1 ? '$' + split[a] : '_' + split[a]);
	        }
	        else eventTarget = node.id;
	        postValues = '__EVENTTARGET=' + eventTarget + '&';
	        // for all elements
	        // alert(allNodes.length);
	        for (var a = 0; a < allNodes.length; a++) {
	            // build the query string from the name and value pairs
	            if (
					allNodes[a].nodeName == 'INPUT' ||
					allNodes[a].nodeName == 'SELECT' ||
					allNodes[a].nodeName == 'TEXTAREA'
				)
	                if (
						allNodes[a].getAttribute('type') != 'submit' &&
						allNodes[a].getAttribute('type') != 'image' &&
						allNodes[a].getAttribute('type') != 'button' &&
						allNodes[a].getAttribute('type') != 'reset'
					)
	            //  Add all except the viewstate and eventtarget (.NET)
	                if (allNodes[a].name != '__VIEWSTATE' && allNodes[a].name != '__EVENTTARGET') {
	                postValues += (allNodes[a].checked || (allNodes[a].type != 'radio' && allNodes[a].type != 'checkbox')) ?
							    allNodes[a].name + '=' + escape(allNodes[a].value) + '&' :
							    '';
	            }
	        }
	        // add the value of the pressed button
	        if (node.nodeName == 'BUTTON' || node.getAttribute('type') == 'submit' || node.getAttribute('type') == 'button') postValues += (node.name == null ? node.id : node.name) + '=' + node.value + '&';
	        // add the cookie value too
	        if (document.cookie != null) postValues += document.cookie.replace(/; /gi, "&");
	        // return the values
	        return postValues;
	    },
	    // methods
	    addRequest: function(url, loadHandler, progressHandler, post, referingObject) {
	        // get the first free slot in the que
	        index = this.queue.length;
	        // add new request to the end of the que
	        this.queue[index] = new this.HttpRequest();
	        // set request constants
	        this.queue[index].idx = index;
	        this.queue[index].url = url;
	        this.queue[index].post = post;
	        this.queue[index].method = (post != null) ? 'POST' : 'GET';
	        // request events
	        this.queue[index].doOnLoad = loadHandler;
	        this.queue[index].doOnProgress = progressHandler;
	        this.queue[index].referObject = referingObject;
	        // ask the queue handler to handle the next queued item
	        this.handleQueue();
	        // return false
	        return false;
	    },
	    makeRequest: function(queued) {
	        // branch for native XMLHttpRequest object
	        if (window.XMLHttpRequest) {
	            queued.request = new XMLHttpRequest();
	            queued.request.onreadystatechange = this.progress;
	            queued.request.open(queued.method, queued.url, true);
	            if (queued.method == 'POST') {
	                queued.request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	                queued.request.setRequestHeader("Content-length", queued.post.length);
	                queued.request.setRequestHeader("Connection", "close");
	            }
	            queued.request.send(queued.post);
	            // branch for IE/Windows ActiveX version
	        } else if (window.ActiveXObject) {
	            queued.request = new ActiveXObject("Microsoft.XMLHTTP");
	            queued.request.onreadystatechange = this.progress;
	            queued.request.open(queued.method, queued.url, true);
	            if (queued.method == 'POST') {
	                queued.request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	                queued.request.setRequestHeader("Content-length", queued.post.length);
	                queued.request.setRequestHeader("Connection", "close");
	            }
	            queued.request.send(queued.post);
	            // if all else fails: load the document in an iFrame
	        } else if (window.frames) {
	            // create an iframe to read the document in
	            objIframe = document.createElement("IFRAME");
	            objIframe.src = queued.url;
	            objIframe.id = "feedimport0";
	            objIframe.name = "feedimport0";
	            objIframe.style = "visibility : invisible; position : absolute; left : -1600px; top : -1600px;";
	            //objIframe.onload = ajax_load; // Doesn't work in Opera
	            // append the iframe to the document
	            document.body.appendChild(objIframe);
	            // wait for the iframe to load
	            this.wait();
	        }
	    },
	    handleQueue: function() {
	        queue = wQuery.classBehaviours.ajax.queue;
	        // if the first item in the queue is a completed request
	        if (queue.length > 0) {
	            if (queue[0].ready == 4 /*&& ajax.queue[0].status==200*/) {
	                // remove the completed request
	                queue.reverse();
	                queue.length = queue.length - 1;
	                queue.reverse();
	            }
	        }
	        // if the first item in the queue isn't allready in progress
	        if (queue.length > 0) {
	            if (!(queue[0].ready < 4 && queue[0].ready != null)) {
	                this.makeRequest(queue[0]);
	            }
	        }
	    },
	    // events
	    progress: function() {
	        queued = wQuery.classBehaviours.ajax.queue[0];
	        // remember the readyState
	        queued.ready = queued.request.readyState;
	        // only if req shows "complete"
	        if (queued.request.readyState == 4) {
	            // remember the status
	            queued.status = queued.request.status;
	            // only if "OK"
	            if (queued.request.status == 200 || queued.request.status == 304) {
	                // update optional progress indicator code
	                if (queued.doOnProgress) queued.doOnProgress(1, queued.referObject, queued.request.status);
	                // get the imported text
	                queued.text = queued.request.responseText;
	                // get the imported document
	                queued.document = queued.request.responseXML;
	                // if the document is empty use a deserialized version of the text instead
	                if (queued.document == null) queued.document = wQuery.classBehaviours.ajax.deserialize(queued.text)
	                else if (queued.document.childNodes.length == 0) queued.document = wQuery.classBehaviours.ajax.deserialize(queued.text);
	                // trigger the load event
	                if (queued.doOnLoad) queued.doOnLoad(queued.document, queued.referObject, queued.text);
	                // request the next item in the queue to be handled
	                wQuery.classBehaviours.ajax.handleQueue();
	            } else {
	                // update optional progress indicator code
	                if (queued.doOnProgress) queued.doOnProgress(-1, queued.referObject, queued.request.status);
	            }
	        } else {
	            // update optional progress indicator code
	            if (queued.doOnProgress) queued.doOnProgress(queued.request.readyState, queued.referObject, 200);
	        }
	        // return the status if desired
	        return queued.request.readyState;
	    },
	    wait: function() {
	        queued = wQuery.classBehaviours.ajax.queue[0];
	        // if the xml document has loaded in the iframe
	        if (window.frames["feedimport0"]) {
	            // define the xml document object
	            queued.document = window.frames["feedimport0"].document;
	            queued.text = window.frames["feedimport0"].document.body.innerHTML;
	            // what to do after the xml document loads
	            queued.doOnLoad(queued.document, queued.referObject, queued.text);
	            // else try again in a while
	        } else {
	            setTimeout("ajax.wait()", 256);
	        }
	    }
	}
		// prototype http request object
		wQuery.classBehaviours.ajax.HttpRequest = function(){
			// request constants
			this.idx			=	null;
			this.url			=	null;
			this.post			=	null;
			this.method			=	'GET';
			// request events
			this.doOnLoad		=	null;
			this.doOnProgress	=	null;
			this.referObject	=	null;
			// request properties
			this.request		=	null;
			this.document		=	null;
			this.text			=	null;
			this.ready			=	null;
			this.status			=	null;
		}

	// debug console
		wQuery.classBehaviours.console = {
		    // porperties
		    id: 'debugConsole0',
		    limit: 32,
		    // methods
		    debug: function() {
		        // create the debug console if it doesn't exist yet
		        debugConsole = document.getElementById(wQuery.classBehaviours.console.id);
		        if (debugConsole == null) {
		            // create a new console node
		            newConsole = document.createElement('div');
		            newConsole.id = wQuery.classBehaviours.console.id;
		            document.body.appendChild(newConsole);
		            debugConsole = document.getElementById(wQuery.classBehaviours.console.id);
		        }
		        // set the console's properties
		        if (debugConsole.style.textAlign == '') debugConsole.style.textAlign = 'left';
		        if (debugConsole.style.background == '') debugConsole.style.background = '#ffffff';
		        if (debugConsole.style.border == '') debugConsole.style.border = 'solid 1px #000000';
		        if (debugConsole.style.bottom == '') debugConsole.style.bottom = 'auto';
		        if (debugConsole.style.height == '') debugConsole.style.height = (navigator.userAgent.indexOf('MSIE 6') > -1) ? '580px' : '98%';
		        if (debugConsole.style.left == '') debugConsole.style.left = 'auto';
		        if (debugConsole.style.overflow == '') debugConsole.style.overflow = 'auto';
		        if (debugConsole.style.padding == '') debugConsole.style.padding = '5px 5px 5px 5px';
		        if (debugConsole.style.position == '') debugConsole.style.position = (navigator.userAgent.indexOf('MSIE 6') > -1) ? 'absolute' : 'fixed';
		        if (debugConsole.style.right == '') debugConsole.style.right = '-1px';
		        if (debugConsole.style.top == '') debugConsole.style.top = '-1px';
		        if (debugConsole.style.width == '') debugConsole.style.width = '128px';
		        debugConsole.onclick = wQuery.classBehaviours.console.move;
		        newList = document.createElement('div');
		        newList.style.margin = '0px 0px 5px 0px';
		        newText = document.createTextNode(arguments[0]);
		        newList.appendChild(newText);
		        newConsole.appendChild(newList);
		    },
		    clear: function() {
		        // clear the entries
		        debugConsole = document.getElementById(wQuery.classBehaviours.console.id);
		        if (debugConsole != null) {
		            allLists = debugConsole.getElementsByTagName('ul');
		            for (var a = allLists.length - 1; a >= 0; a--)
		                removedChild = debugConsole.removeChild(allLists[allLists.length - 1]);
		        }
		    },
		    html: function(string) {
		        string = '<xmp>' + string + '</xmp>'
		        //this.debug(string)
		    },
		    // events
		    move: function(that) {
		        var node = (typeof (this.nodeName) == 'undefined') ? that : this;
		        // get the console
		        debugConsole = document.getElementById(wQuery.classBehaviours.console.id);
		        // toggle through several console positions
		        if (debugConsole.style.right == '-1px' && debugConsole.style.width == '128px') {
		            debugConsole.style.bottom = 'auto';
		            debugConsole.style.height = (navigator.userAgent.indexOf('MSIE 6') > -1) ? '580px' : '98%';
		            debugConsole.style.left = '-1px';
		            debugConsole.style.right = 'auto';
		            debugConsole.style.top = '-1px';
		            debugConsole.style.width = '128px';
		            debugConsole.style.zIndex = '100000';
		        } else if (debugConsole.style.left == '-1px' && debugConsole.style.width == '128px') {
		            debugConsole.style.bottom = '-1px';
		            debugConsole.style.height = '128px';
		            debugConsole.style.left = '-1px';
		            debugConsole.style.right = 'auto';
		            debugConsole.style.top = 'auto';
		            debugConsole.style.width = '98%';
		            debugConsole.style.zIndex = '100000';
		        } else if (debugConsole.style.bottom == '-1px' && debugConsole.style.width == '98%') {
		            debugConsole.style.bottom = 'auto';
		            debugConsole.style.height = (navigator.userAgent.indexOf('MSIE 6') > -1) ? '580px' : '98%';
		            debugConsole.style.left = 'auto';
		            debugConsole.style.right = '-1px';
		            debugConsole.style.top = '-1px';
		            debugConsole.style.width = '128px';
		            debugConsole.style.zIndex = '100000';
		        }
		    }
		}

	// cookies Library
	wQuery.classBehaviours.cookies = {
		// methods
		getDaysFromNow: function(intDays){
			var dateCurrent = new Date();
			var intCurrent = Date.parse(dateCurrent);
			var intPeriod = intDays*24*60*60*1000;
			var datePeriodInFuture = new Date(intCurrent+intPeriod);
			return datePeriodInFuture;
		},
		setCookie: function(name, value, expires, path, domain, secure) {
			var curCookie = name + "=" + escape(value) +
				((expires) ? "; expires=" + expires.toGMTString() : "") +
				((path) ? "; path=" + path : "") +
				((domain) ? "; domain=" + domain : "") +
				((secure) ? "; secure" : "");
			document.cookie = curCookie;
		},
		getCookie: function(name) {
			var dc = document.cookie;
			var prefix = name + "=";
			var begin = dc.indexOf("; " + prefix);
			if (begin == -1) {
				begin = dc.indexOf(prefix);
				if (begin != 0) return null;
			}else{
				begin += 2;
			}
			var end = document.cookie.indexOf(";", begin);
			if (end == -1)
				end = dc.length;
			return unescape(dc.substring(begin + prefix.length, end));
		},
		deleteCookie: function(name, path, domain) {
			if (getCookie(name)) {
				document.cookie = name + "=" +
				((path) ? "; path=" + path : "") +
				((domain) ? "; domain=" + domain : "") +
				"; expires=Thu, 01-Jan-70 00:00:01 GMT";
			}
		},
		fixDate: function(date) {
			var base = new Date(0);
			var skew = base.getTime();
			if (skew > 0)
				date.setTime(date.getTime() - skew);
		},
		makeBoolean: function(strIn){
			if(strIn=='true'){
				booOut = true;
			}else{
				booOut = false;
			}
			return booOut;
		},
		csv2array: function(csvIn){
			return csvIn.split(',');
		},
		array2csv: function(arrIn){
			return ''+arrIn;
		}
	}

	// general purpose functions
	wQuery.classBehaviours.utilities = {
		// returns all nodes of the same class
		getElementsByClassName: function(className, node){
			// use the whole body if no target was provided
			target = (node!=null) ? node : document ;
			// make an empty array for the results
			var foundNodes = new Array();
			// for all elements in the parent node
			var allNodes = (target.all) ? target.all : target.getElementsByTagName("*");
			for(var a=0; a<allNodes.length; a++){
				// if the item has a className
				if(allNodes[a].className){
					// process the classname
					nodeClass = allNodes[a].className + ' ';
					// add it to the results if the classname was found
					if(nodeClass.indexOf(className+' ')>-1) foundNodes[foundNodes.length] = allNodes[a];
				}
			}
			// return the list
			return foundNodes;
		},
		// emulates getElementById for XML documents
		getXmlElementById: function(id, doc, echo){
			// default value
			node = null ;
			// if a valid id was given
			if(id!=null){
				// look through all nodes
				allNodes = doc.getElementsByTagName('*');
				// until you find one with the right ID
				var a = 0;
				while(node==null && a<allNodes.length){
					if(allNodes[a].getAttribute('id')==id){
						node = allNodes[a];
					}
					a += 1;
				}
			}
			// return the cleaned content
			return (echo && node==null) ? doc : node;
		},
		// places a sibling node after a given node
		insertAfter: function(parentNode, siblingNode, newNode){
			nextNode = wQuery.classBehaviours.utilities.nextNode(siblingNode);
			if(nextNode==siblingNode) parentNode.appendChild(newNode)
			else parentNode.insertBefore(newNode, nextNode);
		},
		// detaries the available room on the screen
		screenHeight: function(){
			return (window.innerHeight) ? window.innerHeight : (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight ;
		},
		// return a parameter from the url's query strings
		getQueryParameter: function(paramName, defaultValue){
			// split the query string at the parameter name
			var queryParameters = document.location.search.split(paramName+"=");
			// split the parameter value from the rest of the string
			var queryParameter = (queryParameters.length>1) ? queryParameters[1].split("&")[0] : null ;
			// return the value
			return (queryParameter!=null) ? queryParameter : defaultValue ;
		},
		// gets the value of a parameter from a className
		getClassParameter: function(targetNode, paramName, defaultValue){
			if(targetNode!=null){
				// get the class parameter from the classname
				var classParameter = targetNode.className;
				// split the classname between the parameter name
				classParameter = (classParameter!=null) ? classParameter.split(paramName + '_') : new Array();
				// split the second piece between spaces and take the first part,  if there are two pieces
				classParameter = (classParameter.length>1) ? classParameter[1].split(' ')[0] : null ;
				// return the value
				return (classParameter!=null) ? classParameter : defaultValue ;
			}
		},
		// sets the value of a parameter from a className
		setClassParameter: function(targetNode, paramName, newValue){
			if(targetNode!=null){
				// create a default value, if there isn't one
				if(targetNode.className.indexOf(' ' + paramName + '_')<0) targetNode.className += ' ' + paramName + '_0';
				// get the old value
				oldValue = this.getClassParameter(targetNode, paramName, null);
				// replace the old value
				if(oldValue!=null) targetNode.className = targetNode.className.replace(paramName+'_'+oldValue, paramName+'_'+newValue);
			}
		},
		// get the next node without worrying about text nodes
		nextNode: function(node, count){
			testNode = node;
			if(count==null) count = 1;
			// look for the next html node
			for(var a=0; a<count; a++){
				do {
					testNode = testNode.nextSibling;
					if(testNode==null) testNode = node;
				}while(testNode.nodeName.indexOf('#text')>-1);
			}
			// return it
			return testNode;
		},
		// get the previous node without worrying about text nodes
		previousNode: function(node, count){
			testNode = node;
			if(count==null) count = 1;
			// look for the previous html node
			for(var a=0; a<count; a++){
				do {
					testNode = testNode.previousSibling;
					if(testNode==null) testNode = node;
				}while(testNode.nodeName.indexOf('#text')>-1);
			}
			// return it
			return testNode;
		},
		// get the first real child node without worrying about text nodes
		firstNode: function(node, count){
			return this.nextNode(node.firstChild, count);
		},
		// find the parent node with the given classname
		rootNode: function(node, rootTag, rootId, rootClass){
			// try parent nodes until you find the one which meets the conditions
			rootFound = false;
			while(!rootFound && node.nodeName!='BODY'){
				rootFound = (rootTag && node.nodeName) ? (node.nodeName.indexOf(rootTag)>-1) : rootFound ;
				rootFound = (rootId && node.id) ? (node.id.indexOf(rootId)>-1) : rootFound ;
				rootFound = (rootClass && node.className) ? (node.className.indexOf(rootClass)>-1) : rootFound ;
				node = (!rootFound) ? node.parentNode : node;
			}
			// pass it back
			return node;
		},
		// returns the visible display state needed for this element
		getVisibleState: function(node){
			// what kind of node is this
			switch(node.nodeName.toLowerCase()){
				case 'table' : visibleState='table' ; break;
				case 'thead' : visibleState='table-header-group' ; break;
				case 'tfoot' : visibleState='table-footer-group' ; break;
				case 'tbody' : visibleState='table-row-group' ; break;
				case 'tr' : visibleState='table-row' ; break;
				case 'td' : visibleState='table-cell' ; break;
				case 'th' : visibleState='table-cell' ; break;
				default : visibleState='block';
			}
			// apply the state
			return (document.all && navigator.userAgent.indexOf('Opera')<0) ? 'block' : visibleState;
		},
		// hide select form elements for graphic glitches in certain browsers
		hideSelects: function(node){
			if(
				navigator.userAgent.indexOf('MSIE 6')>-1 ||
				(navigator.userAgent.indexOf('Firefox/2')>-1 && navigator.userAgent.indexOf('Mac')>-1)
			){
				allSelects = (node) ? node.getElementsByTagName('SELECT') : document.getElementsByTagName('SELECT') ;
				for(var a=0; a<allSelects.length; a++){
					allSelects[a].style.visibility = 'hidden';
				}
			}
		},
		showSelects: function(node){
			if(
				navigator.userAgent.indexOf('MSIE 6')>-1 ||
				(navigator.userAgent.indexOf('Firefox/2')>-1 && navigator.userAgent.indexOf('Mac')>-1)
			){
				allSelects = (node) ? node.getElementsByTagName('SELECT') : document.getElementsByTagName('SELECT') ;
				for(var a=0; a<allSelects.length; a++){
					allSelects[a].style.visibility = 'visible';
				}
			}
		},
		// adds an event-handler the proper way
		addEvent: function(node, eventName, eventHandler){
			if(node.addEventListener) 	node.addEventListener(eventName, eventHandler, false)
			else if(node.attachEvent) 	node.attachEvent("on"+eventName, eventHandler)
			else 						node["on"+eventName] = eventHandler;
			return true;
		}
	}

	// Parser functions
	wQuery.classBehaviours.parser = {
	    // status of the parser
	    waiting: false,
	    // verify the state of the object
	    start: function() {
	        // if the document is complete enough start the behaviours, else wait until everything is loaded
	        var handlersCount = 0;
	        for (b in wQuery.classBehaviours.handlers) handlersCount++;
	        this.waiting = (handlersCount > 0 && document.body) ? this.parseDocument() : wQuery.classBehaviours.utilities.addEvent(window, 'load', this.parseDocument);
	    },
	    // scan the whole document
	    parseDocument: function() {
	        // pass the document object to the parser
	        wQuery.classBehaviours.parser.parseNode(document);
	        // return the status
	        return false;
	    },
	    // scan the document object model for target classNames
	    parseNode: function(node) {
	        // for all childnodes of the given node
	        var allNodes = node.getElementsByTagName("*");
	        for (var a = 0; a < allNodes.length; a++) {
	            // process the classnames of the node
	            this.processNode(allNodes[a]);
	        }
	        // do the same for the parent node
	        this.processNode(node);
	    },
	    // recursive version of the same function
	    parseNode: function(node) {
	        // process the node
	        parseChildNodes = (node.className != null) ? this.processNode(node) : true;
	        // parse any childnodes
	        if (parseChildNodes) for (var a = 0; a < node.childNodes.length; a++) this.parseNode(node.childNodes[a]);
	    },
	    // process the classnames of the node
	    processNode: function(node) {
	        // get its className
	        nodeClass = ' ' + node.className + ' ';
	        // for all class behaviours
	        for (b in wQuery.classBehaviours.handlers) {
	            // if the behaviour name is in the className tested node
	            if (nodeClass.indexOf(' ' + wQuery.classBehaviours.handlers[b].name + ' ') > -1) {
	                // apply its respective behaviour
	                if (wQuery.classBehaviours.handlers[b].start != null)
	                    wQuery.classBehaviours.handlers[b].start(node);
	            }
	        }
	        // decide if to continue parsing deeper into this branch
	        return (nodeClass.indexOf('doNotParse') < 0);
	    }
	}

	// short-cut wrapper functions
	debug1 = wQuery.classBehaviours.console.debug;
	getXmlElementById = wQuery.classBehaviours.utilities.getXmlElementById;
	getElementsByClassName = wQuery.classBehaviours.utilities.getElementsByClassName;

	// add this addon to the wQuery object
	if(typeof(wQuery.fn)!='undefined'){
		// set the event handler for this wQuery method
		$(document).ready(
			function(){
// TODO: at the moment this is handled by the individual classbehaviours modules, until this proves too slow
//				$.classBehaviours.parser.parseDocument()
			}
		);
	}else{
		// start the (backup) parsing of classes if the main wQuery library is not available
		wQuery.classBehaviours.parser.start()
	}


