/*
name			: Class Behaviour
update			: 20051129
author			: Xander Bindt, Frank van Rooijen, Maurice van Creij
dependencies		: lib_classbehaviour.js
info				: http://www.woollymittens.nl/content/details.asp?id=20040805133501
*/
	// MAIN
	// main class-behaviour object
	function ClassBehaviour(){
		/* properties */
			this.handlers			=	new Array();
		/* methods */
			// return a parameter from the url's query strings
			this.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 ;
										}
			// returns a string of parameters found in the classname which can be [eval]uated
			this.getClassParameter	=	function(targetNode, paramName, defaultValue){
											// get the class parameter from the classname
											var classParameter = targetNode.className;
											// split the classname between the parameter name
											classParameter = classParameter.split(paramName + '_');
											// 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 ;
										}
			// returns the visible display state needed for this element
			this.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;
										}
			// (cross)fader and pseudo event handler
			this.fader				=	new Fader;
			// get the previous node without worrying about text nodes
			this.nextNode			=	function(node){
											// look for the next html node
											do {
												node = node.nextSibling;
											} while(node.nodeName.indexOf('#text')>-1);
											// return it
											return node;
										}
			// get the next node without worrying about text nodes
			this.previousNode		=	function(node){
											// look for the previous html node
											do {
												node = node.previousSibling;
											} while(node.nodeName.indexOf('#text')>-1);
											// return it
											return node;
										}
			// parse the document for classnames
			this.parseDocument		=	function(){
											// get all document nodes
											var allNodes = (document.all) ? document.all : document.getElementsByTagName("*");
											// for all tags
											for(var a=0; a<allNodes.length; a++){
												// if the item has a className
												if(allNodes[a].className){
													// get the classname
													nodeClass = allNodes[a].className;
													// for all behaviours
													for(var b=0; b<this.handlers.length; b++){
														// if the behaviour's name exists in the class name, apply it's events
														if(nodeClass.indexOf(this.handlers[b].name)>-1) this.handlers[b].start(allNodes[a]);
													}
												}
											}
										}
			// adds an event-handler the proper way
			this.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;
										}
			// find the parent node with the given classname
			this.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 all nodes of the same class
			this.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;
											}
	}
	// create the main class-behaviour object
	var classBehaviour = new ClassBehaviour;
	
		// AJAX interface
		function Ajax(){
			// properties
			this.queue			=	new Array();
			// utilities
			this.getNodeValue	=	function(objNode){
										strValue = (objNode.childNodes.length>0) ? objNode.firstChild.nodeValue : null ;
										return (isNaN(strValue) || strValue==null) ? strValue : parseInt(strValue);
									}
			this.setNodeValue	=	function(objNode,strValue){
										if(objNode.childNodes.length>0){
											objNode.firstChild.nodeValue = strValue;
										}else{
											var objNewNode = ajax.createTextNode(strValue);
											objNode.appendChild(objNewNode);
										}
									}
			this.getChildNumber =	function(objNode){
										var objNodes = objNode.parentNode.childNodes;
										var intTextNodes = 0;
										for(var intA=0; intA<objNodes.length; intA++){
											if(objNodes[intA].nodeName == '#text') intTextNodes += 1;
											if(objNode==objNodes[intA]) return intA - intTextNodes;
										}
										return null;
									}
			this.serialize		=	function serialize(ajax){
										ser = new XMLSerializer();
										str = ser.serializeToString(ajax);
										return(str);
									}
			// methods
			this.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 HttpRequest();
										// set request constants
										this.queue[index].idx			=	index;
										this.queue[index].url			=	url;
										this.queue[index].post			=	post;
										this.queue[index].method		=	(post) ? '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();
									}
			this.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();
										}
									}
			this.handleQueue	=	function(){
										queue = classBehaviour.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
			this.progress		=	function(){
										queued = classBehaviour.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);
												// prepare the document
												queued.document = queued.request.responseXML;
												queued.text = queued.request.responseText;
												// 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
												classBehaviour.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/4, queued.referObject, 200);
										}
										// return the status if desired
										return queued.request.readyState;
									}
			this.wait			=	function(){
										queued = classBehaviour.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
			function HttpRequest(){
				// 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;
			}
		// add this module to the classBehaviours object
		classBehaviour.ajax = new Ajax;

	// UTILITIES
		function Fader(){
			/* properties */
			this.timeOut	=	null;
			/* methods */
			this.getFade	=	function(node){
									var fadeValue = null;
									// get the fade value using the proper method
									if(typeof(node.style.MozOpacity)!='undefined')	fadeValue = Math.round(parseFloat(node.style.MozOpacity)*100);
									if(typeof(node.style.filter)!='undefined')		fadeValue = parseInt(node.filters.alpha.opacity);
									if(typeof(node.style.opacity)!='undefined')		fadeValue = Math.round(parseFloat(node.style.opacity)*100);
									// return the value
									return fadeValue;
								}
			this.setFade	=	function(node, amount){
									// set the fade value using the proper method
									if(typeof(node.style.MozOpacity)!='undefined')	node.style.MozOpacity = amount/100;
									if(typeof(node.style.opacity)!='undefined')		node.style.opacity = amount/100;
									if(typeof(node.style.filter)!='undefined') 		node.style.filter = "alpha(opacity=" + amount + ")";
									/*
									filter:alpha(opacity=50);	imageobject.filters.alpha.opacity=opacity
									-moz-opacity: 0.5;			imageobject.style.MozOpacity=opacity/100
									opacity: 0.5;
									-khtml-opacity: 0.5;
									*/
								}
			this.fadeIn		=	function(idIn, step, delay, evalEvent){
									var cf = classBehaviour.fader;
									// get the fading object
									node = document.getElementById(idIn);
									// get the current fade
									fade = cf.getFade(node) + step;
									// if not 100%
									if((fade)<100){
										// set the new fade
										cf.setFade(node, fade);
										// next step
										cf.timeOut = setTimeout("classBehaviour.fader.fadeIn('"+idIn+"',"+step+","+delay+",'"+evalEvent+"')", delay);
									// else
									}else{
										// set the fade to 100%
										cf.setFade(node, 100);
										// trigger the end event
										eval(evalEvent);
									}
								}
			this.fadeOut	=	function(idOut, step, delay, evalEvent){
									var cf = classBehaviour.fader;
									// get the fading object
									node = document.getElementById(idOut);
									// get the current fade
									fade = cf.getFade(node) - step;
									// if not 100%
									if(fade>0){
										// set the new fade
										cf.setFade(node, fade);
										// next step
										cf.timeOut = setTimeout("classBehaviour.fader.fadeOut('"+idOut+"',"+step+","+delay+",'"+evalEvent+"')", delay);
									// else
									}else{
										// set the fade to 100%
										cf.setFade(node, 0);
										// trigger the end event
										eval(evalEvent);
									}
								}
			this.crossFade	=	function(idIn, idOut, amount, step, delay, evalEvent){
									var cf = classBehaviour.fader;
									// if the amount is not the end value yet
									if(amount<=100){
										// set the fade amounts
										cf.setFade(document.getElementById(idIn), amount);
										cf.setFade(document.getElementById(idOut), 100-amount);
										// unhide the new page
										document.getElementById(idIn).style.display = 'block';
										// construct the fade function
										var evalLoop = "classBehaviour.fader.crossFade('"+idIn+"', '"+idOut+"', "+(amount+step)+", "+step+", "+delay+", '"+evalEvent+"')";
										// repeat the fade
										setTimeout(evalLoop, delay);
									}else{
									// else
										// cancel the opacity style
										var node = document.getElementById(idIn);
										if(typeof(node.style.MozOpacity)!='undefined')	node.style.MozOpacity = 'auto';
										if(typeof(node.style.filter)!='undefined')		node.style.filter = 'none';
										if(typeof(node.style.opacity)!='undefined')		node.style.opacity = 'auto';
										// hide the old page
										document.getElementById(idOut).style.display = 'none';
										// trigger the end event
										cf.onEnd(evalEvent);
									}
								}
			/* events */
			this.onEnd		=	function(evalEvent){
									// execute a stored eventEval
									eval(evalEvent);
								}
		}

	// BEHAVIOURS
	// replace in class
		// define this class behaviour
		function ClassMouseHover(){
			/* properties */
			this.name 		= 	'classMouseHover';
			/* methods */
			this.start		=	function(node){
									node.onmouseover = this.addHover;
									node.onmouseout = this.remHover;
								}
			this.hasNoStateClass 	= 	function(objNode){
											return (objNode.className.indexOf('link')<0 && objNode.className.indexOf('hover')<0 && objNode.className.indexOf('active')<0);
										}
			/* events */
			this.addHover 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var cmh = classBehaviour.classMouseHover;
									// replace link by hover
									objNode.className = (cmh.hasNoStateClass(objNode)) ? 'hover ' + objNode.className : objNode.className.replace('link','hover') ;
								}
			this.remHover 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var cmh = classBehaviour.classMouseHover;
									// replace hover by link
									objNode.className = (cmh.hasNoStateClass(objNode)) ? 'link ' + objNode.className : objNode.className.replace('hover','link') ;
								}
			this.addActive 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var cmh = classBehaviour.classMouseHover;
									// replace link by active
									objNode.className = objNode.className.replace('link','active') ;
									// replace hover by active
									objNode.className = objNode.className.replace('hover','active') ;
									// if there's still no active class
									if(cmh.hasNoStateClass(objNode)) objNode.className = 'active ' + objNode.className;
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.classMouseHover = new ClassMouseHover;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.classMouseHover;
		
	// make all sub elements fake the :hover attribute with .hover		// define this class behaviour		function PseudoHover(){			/* properties */			this.name 		= 	'pseudoHover';			/* methods */			this.start		=	function(node){									// get all elements									allNodes = node.getElementsByTagName('LI');									// for all elements									for(var a=0; a<allNodes.length; a++){										// add the hover event										classBehaviour.classMouseHover.start(allNodes[a]);									}								}		}		// add this function to the classbehaviour object		classBehaviour.pseudoHover = new PseudoHover;		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.pseudoHover;
		
	// replace in src sub-string
		// define this class behaviour
		function SrcMouseHover(){
			/* properties */
			this.name 			= 	'srcMouseHover';
			this.cache 			= new Array();
			/* methods */
			this.start			=	function(node){
										this.cacheImages(node);
										node.onmouseover = this.addHover;
										node.onmouseout = this.remHover;
									}
			this.cacheImages	= 	function(that) {
										var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
										// if this is not the image, it must be the parent
										if(!objNode.src) objNode = objNode.getElementsByTagName('IMG')[0];
										// replace link by hover
										var cacheIdx = this.cache.length;
										// hover version
										this.cache[cacheIdx] = new Image();
										this.cache[cacheIdx].src = objNode.src.replace('_link','_hover');
										// active version
										this.cache[cacheIdx+1] = new Image();
										this.cache[cacheIdx+1].src = objNode.src.replace('_link','_active');
									}
			/* events */
			this.addActive 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// if this is not the image, it must be the parent
									if(!objNode.src) objNode = objNode.getElementsByTagName('IMG')[0];
									// replace link by active
									objNode.src = objNode.src.replace('_link','_active');
									// replace hover by active
									objNode.src = objNode.src.replace('_hover','_active');
								}
			this.addHover 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// if this is not the image, it must be the parent
									if(!objNode.src) objNode = objNode.getElementsByTagName('IMG')[0];
									// replace link by hover
									objNode.src = objNode.src.replace('_link','_hover');
								}
			this.remHover 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// if this is not the image, it must be the parent
									if(!objNode.src) objNode = objNode.getElementsByTagName('IMG')[0];
									// replace link by hover
									objNode.src = objNode.src.replace('_hover','_link');
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.srcMouseHover = new SrcMouseHover;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.srcMouseHover;
		
	// replace in src sub-string
		// define this class behaviour
		function FadeMouseHover(){
			/* properties */
			this.name 			= 'fadeMouseHover';
			this.cache 			= new Array();
			this.count			= 0;
			this.timeOut		= null;
			/* methods */
			this.start			=	function(node){
										this.cacheImages(node);
										// node.onload = this.setUpFader;
										this.setUpFader(node);
									}
			this.setUpFader		=	function(that){
										var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
										var fmh = classBehaviour.fadeMouseHover;
										// give this image an id, if it doesn't have one
										if(!objNode.id) objNode.id = 'fadingImage' + fmh.count;
										fmh.count += 1;
										// set the active version of the image source as a background-image of the container
										objNode.parentNode.style.backgroundImage = 'url(' + objNode.src.replace('_link','_hover') + ')';
										// set the image as a block element
										objNode.parentNode.style.display = 'block';
										objNode.parentNode.style.width = objNode.width + 'px';
										objNode.parentNode.style.height = objNode.height + 'px';
										// set the default fade
										classBehaviour.fader.setFade(objNode, 100);
										// set up the events
										objNode.onmouseover = fmh.addHover;
										objNode.onmouseout = fmh.remHover;
									}
			this.cacheImages	 = 	function(that) {
										var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
										// if this is not the image, it must be the parent
										if(!objNode.src) objNode = objNode.getElementsByTagName('IMG')[0];
										// replace link by hover
										var cacheIdx = this.cache.length;
										// hover version
										this.cache[cacheIdx] = new Image();
										this.cache[cacheIdx].src = objNode.src.replace('_link','_hover');
									}
			/* events */
			this.addHover 	= 	function(that, id){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var fmh = classBehaviour.fadeMouseHover;
									// if an id is passed. It overrides the event node
									if(id) objNode = document.getElementById(id);
									// if there's no fade active at the moment // fade out the image
									if(classBehaviour.fader.getFade(objNode)%100==0){
										classBehaviour.fader.fadeOut(objNode.id, 20, 50, '');
									// else try again in a bit
									}else{
										// fmh.timeOut = setTimeout("classBehaviour.fadeMouseHover.addHover(null, '" + objNode.id + "')",50);
									}
								}
			this.remHover 	= 	function(that, id){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var fmh = classBehaviour.fadeMouseHover;
									// if an id is passed. It overrides the event node
									if(id) objNode = document.getElementById(id);
									// if there's no fade active at the moment // fade in the image
									if(classBehaviour.fader.getFade(objNode)%100==0){
										classBehaviour.fader.fadeIn(objNode.id, 20, 50, '');
									// else try again in a bit
									}else{
										fmh.timeOut = setTimeout("classBehaviour.fadeMouseHover.remHover(null, '" + objNode.id + "')",50);
									}
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.fadeMouseHover = new FadeMouseHover;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.fadeMouseHover;
		
	// add display='none'; on parse
		// define this class behaviour
		function HideThisNode(){
			/* properties */
			this.name 		= 	'hideThisNode';
			/* methods */
			this.start		=	function(node){
									// store the node's height in it's className
									node.className += ' height_' + node.offsetHeight;
									// hide the node
									node.style.display = 'none';
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.hideThisNode = new HideThisNode;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.hideThisNode;
		
	// affirms the visibility status in regard to toggles
		// define this class behaviour
		function ShowThisNode(){
			/* properties */
			this.name 		= 	'showThisNode';
			/* methods */
			this.start		=	function(node){
									// store the node's height in it's className
									node.className += ' height_' + node.offsetHeight;
									// apply the visible state
									node.style.display = classBehaviour.getVisibleState(node);
									// fill the "previous node" parameters of a related object
									classBehaviour.toggleNextNode.lastNode = node;
									classBehaviour.toggleNextNode.lastNode = node;
// TODO: untested test for childnodes
									// if this isn't the first node
									if(node.parentNode.childNodes[0] != node){
										// pick the previousnode
										objPreviousNode = (node.previousSibling.nodeName.indexOf("text")<0) ? node.previousSibling : node.previousSibling.previousSibling ;
										// store it as the 'previous' toggle
										if(objPreviousNode!=null) classBehaviour.toggleNextNode.lastNext = objPreviousNode;
									}
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.showThisNode = new ShowThisNode;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.showThisNode;
	
	// Open print dialog
		// define this class behaviour
		function OpenAsPrintable(){
			/* properties */
			this.name 		= 	'openAsPrintable';
			/* methods */
			this.start		=	function(node){
									node.onclick = this.process;
								}
			this.process 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// If there is a demo popup
									if(document.getElementById('tgtPopTitle')){
										// copy the title to the print popup title
										document.getElementById('tgtPopTitle').innerHTML = document.getElementById('content').getElementsByTagName('h1')[0].innerHTML;
										// copy the content tot the print popup content
										document.getElementById('tgtPopText').innerHTML = (document.getElementById('content').innerHTML.indexOf('</h1>')>-1) ? document.getElementById('content').innerHTML.split('</h1>')[1] : document.getElementById('content').innerHTML.split('</H1>')[1];
										// show the print popup
										classBehaviour.openLayerPopUp.show(document.getElementById('popup0'));
										// open the print dialog
										setTimeout("window.print();",2048);
									}else{
										window.print();
									}
									// cancel the click
									return false;
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.openAsPrintable = new OpenAsPrintable;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.openAsPrintable;

	// Add or remove display:none; onclick
		// define this class behaviour
		function ToggleNextNode(){
			/* properties */
			this.name 		= 	'toggleNextNode';
			this.nextNode	=	null;
			this.lastNode	=	null;
			this.lastLink	=	null;
			this.locked	=	false;
			/* methods */
			this.start		=	function(node){
									node.onclick = this.toggleNext;
								}
			this.animate	=	function(){
									var tnn = classBehaviour.toggleNextNode;
									// set the loop status
									tnn.locked = true;
									openingComplete = true;
									closingComplete = true;
									// FOR THE CLOSING NODE
									if(tnn.lastNode){
										// what is the content's height of this object
										closingContentHeight = parseInt(classBehaviour.getClassParameter(tnn.lastNode, 'height', '0'));
										closingContentOffset = parseInt(classBehaviour.getClassParameter(tnn.lastNode, 'offset', '0'));
										closingCurrentHeight = parseInt(tnn.lastNode.offsetHeight) + closingContentOffset;
										// calculate the step-size
										closingStep = Math.round(closingContentHeight / 10);
										// if the current height isn't big enough
										if(closingCurrentHeight > closingStep){
											closingComplete = false;
											// set the container to hide any overflow
											tnn.lastNode.style.overflow = 'hidden';
											// set the container to the current height + a step
											tnn.lastNode.style.height = (closingCurrentHeight - closingStep) + 'px';
										// else
										}else{
											closingComplete = true;
											// hide the node
											tnn.lastNode.style.display = 'none';
											// remove the overflow parameter
							//				tnn.lastNode.style.overflow = 'visible';
											// set the height to automatic
											tnn.lastNode.style.height = 'auto';
											// RESET THE PARENT NODE (since the animation loop prevents this to be done in it's regular function "toggleNext"
											titleNode = classBehaviour.previousNode(tnn.lastNode);
											titleNode.className = titleNode.className.replace('active','passive');
											titleNode.parentNode.className = titleNode.parentNode.className.replace('active','passive');
											if(titleNode.src!=null) titleNode.src = titleNode.src.replace('active','passive');
										}
									}
									// FOR THE OPENING NODE
									if(tnn.nextNode /*&& closingComplete*/){
										// what is the content's height of this object
										openingContentHeight = parseInt(classBehaviour.getClassParameter(tnn.nextNode, 'height', '0'));
										openingContentOffset = parseInt(classBehaviour.getClassParameter(tnn.nextNode, 'offset', '0'));
										openingCurrentHeight = parseInt(tnn.nextNode.offsetHeight) + openingContentOffset;
										// calculate the step-size
										openingStep = Math.round(openingContentHeight / 10);
										// if the current height isn't big enough
										if(openingCurrentHeight <= openingContentHeight - openingStep){
											openingComplete = false;
											// set the container to hide any overflow
											tnn.nextNode.style.overflow = 'hidden';
											// set the container to the current height + a step
											tnn.nextNode.style.height = (openingCurrentHeight + openingStep) + 'px';
											// make the node visible
											tnn.nextNode.style.display = classBehaviour.getVisibleState(tnn.nextNode);
										// else
										}else{
											openingComplete = true;
											// remove the overflow parameter
							//				tnn.nextNode.style.overflow = 'visible';
											// set the height to automatic
											tnn.nextNode.style.height = 'auto';
										}
									}
									// REPEAT OR END
									// if both limits are reached
									if(openingComplete && closingComplete){
										// remember the new last node
										tnn.lastNode = tnn.nextNode;
										// restore the click lock
										tnn.locked = false;
									// else
									}else{
										// call this function again
										setTimeout("classBehaviour.toggleNextNode.animate();", 10);
									}
								}
			/* events */
			this.toggleThis = 	function(that, strClosePrevious){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tnn = classBehaviour.toggleNextNode;
									// restore previous node
									if(tnn.lastNode!=null && tnn.lastNode!=objNode && strClosePrevious=='yes') tnn.lastNode.style.display = 'none';
									// toggle node's visibility
									objNode.style.display = (objNode.style.display=='none') ? classBehaviour.getVisibleState(objNode) : 'none' ;
									// remember last node
									tnn.lastNode = objNode;	
								}
			this.toggleAnim =	function(that, strClosePrevious){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tnn = classBehaviour.toggleNextNode;
									// store the animating nodes
									if(strClosePrevious=='no'){
										tnn.nextNode = (objNode.style.display=='none') ? objNode : null ;
										tnn.lastNode = (objNode.style.display=='none') ? null : objNode ;
									}else{
										tnn.nextNode = (objNode.style.display=='none') ? objNode : null ;
										tnn.lastNode = (objNode.style.display=='none') ? tnn.lastNode : objNode ;
									}
									// measure the height of the content in the opening node
									tnn.animate();
								}
			this.toggleNext = 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tnn = classBehaviour.toggleNextNode;
									// if there is not a running animation
									if(!tnn.locked){
										// get parent recursion
										var intParentRecursion = parseInt(classBehaviour.getClassParameter(objNode,'useParent','0'));
										var objParentNode = objNode;
										for(var a=0; a<intParentRecursion; a++) objParentNode = objParentNode.parentNode;
										// check if a previousnode needs closing
										var strClosePrevious = classBehaviour.getClassParameter(objNode,'closePrevious','no');
										// get optional id
										var strCloseId = classBehaviour.getClassParameter(objNode, 'id', null);
										// animated folding
										var strAnimated = classBehaviour.getClassParameter(objNode,'animated','yes');
										// determine the next node
										var objNextNode;
										if(strCloseId!=null){
											objNextNode = document.getElementById(strCloseId);
										}else if(objParentNode.nextSibling){
											objNextNode = (objParentNode.nextSibling.nodeName.indexOf("text")<0) ? objParentNode.nextSibling : objParentNode.nextSibling.nextSibling ;
										}
										// if there is a next node
										if(objNextNode!=null){
											// toggle it's visibility
											if(strAnimated=='yes'){
												tnn.toggleAnim(objNextNode, strClosePrevious);
											}else{
												tnn.toggleThis(objNextNode, strClosePrevious);
											}
											// If the next node has been hidden
											if(objNextNode.style.display=='none'){
												// restore current node's click state
												objNode.className = objNode.className.replace('active','passive');
												objNode.parentNode.className = objNode.parentNode.className.replace('active','passive');
												if(objNode.src!=null) objNode.src = objNode.src.replace('active','passive');
											}else{
												// mark current node as active
												objNode.className = objNode.className.replace('passive','active');
												objNode.parentNode.className = objNode.parentNode.className.replace('passive','active');
												if(objNode.src!=null) objNode.src = objNode.src.replace('passive','active');
												// restore previous node's click state
												if(tnn.lastLink!=null && tnn.lastLink!=objNode && strClosePrevious=='yes'){
													tnn.lastLink.className = tnn.lastLink.className.replace('active','passive');
													tnn.lastLink.parentNode.className = tnn.lastLink.parentNode.className.replace('active','passive');
													if(objNode.src!=null) tnn.lastLink.src = tnn.lastLink.src.replace('active','passive');
												}
											}
											// remember last node
											tnn.lastLink = objNode;
										}
									}
									// cancel onclick event
									return false;
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.toggleNextNode = new ToggleNextNode;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.toggleNextNode;
		
	// Add or remove display:none; onclick
		// define this class behaviour
		function ToggleBasketNode(){
			/* properties */
			this.name 		= 	'toggleBasketNode';
			this.nextNode	=	null;
			this.lastNode	=	null;
			this.lastLink	=	null;
			this.locked	=	false;
			/* methods */
			this.start		=	function(node){
									node.onclick = this.toggleNext;
								}
			this.animate	=	function(){
									var tnn = classBehaviour.toggleBasketNode;
									// set the loop status
									tnn.locked = true;
									openingComplete = true;
									closingComplete = true;
									// FOR THE CLOSING NODE
									if(tnn.lastNode){
										// what is the content's height of this object
										closingCurrentHeight = parseInt(tnn.lastNode.offsetHeight);
										closingContentHeight = parseInt(classBehaviour.getClassParameter(tnn.lastNode, 'height', '0'));
										// calculate the step-size
										closingStep = Math.round(closingContentHeight / 10);
										// if the current height isn't big enough
										if(closingCurrentHeight > closingStep){
											closingComplete = false;
											// set the container to hide any overflow
											tnn.lastNode.style.overflow = 'hidden';
											// set the container to the current height + a step
											tnn.lastNode.style.height = (closingCurrentHeight - closingStep) + 'px';
										// else
										}else{
											closingComplete = true;
											// hide the node
											tnn.lastNode.style.display = 'none';
											// remove the overflow parameter
											tnn.lastNode.style.overflow = 'visible';
											// set the height to automatic
											tnn.lastNode.style.height = 'auto';
											// RESET THE PARENT NODE (since the animation loop prevents this to be done in it's regular function "toggleNext"
											titleNode = classBehaviour.previousNode(tnn.lastNode).getElementsByTagName('a')[0];
											titleNode.className = titleNode.className.replace('active','passive');
											if(titleNode.src!=null) titleNode.src = titleNode.src.replace('active','passive');
										}
									}
									// FOR THE OPENING NODE
									if(tnn.nextNode){
										// what is the content's height of this object
										openingCurrentHeight = parseInt(tnn.nextNode.offsetHeight);
										openingContentHeight = parseInt(classBehaviour.getClassParameter(tnn.nextNode, 'height', '0'));
										// calculate the step-size
										openingStep = Math.round(openingContentHeight / 10);
										// if the current height isn't big enough
										if(openingCurrentHeight <= openingContentHeight - openingStep){
											openingComplete = false;
											// set the container to hide any overflow
											tnn.nextNode.style.overflow = 'hidden';
											// set the container to the current height + a step
											tnn.nextNode.style.height = (openingCurrentHeight + openingStep) + 'px';
											// make the node visible
											tnn.nextNode.style.display = classBehaviour.getVisibleState(tnn.nextNode);
										// else
										}else{
											openingComplete = true;
											// remove the overflow parameter
											tnn.nextNode.style.overflow = 'visible';
											// set the height to automatic
											tnn.nextNode.style.height = 'auto';
										}
									}
									// REPEAT OR END
									// if both limits are reached
									if(openingComplete && closingComplete){
										// remember the new last node
										tnn.lastNode = tnn.nextNode;
										// restore the click lock
										tnn.locked = false;
									// else
									}else{
										// call this function again
										setTimeout("classBehaviour.toggleBasketNode.animate();", 10);
									}
								}
			/* events */
			this.toggleThis = 	function(that, strClosePrevious){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tnn = classBehaviour.toggleBasketNode;
									// restore previous node
									if(tnn.lastNode!=null && tnn.lastNode!=objNode && strClosePrevious=='yes') tnn.lastNode.style.display = 'none';
									// toggle node's visibility
									objNode.style.display = (objNode.style.display=='none') ? classBehaviour.getVisibleState(objNode) : 'none' ;
									// remember last node
									tnn.lastNode = objNode;	
								}
			this.toggleAnim =	function(that, strClosePrevious){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tnn = classBehaviour.toggleBasketNode;
									// store the animating nodes
									if(strClosePrevious=='no'){
										tnn.nextNode = (objNode.style.display=='none') ? objNode : null ;
										tnn.lastNode = (objNode.style.display=='none') ? null : objNode ;
									}else{
										tnn.nextNode = (objNode.style.display=='none') ? objNode : null ;
										tnn.lastNode = (objNode.style.display=='none') ? tnn.lastNode : objNode ;
									}
									// measure the height of the content in the opening node
									tnn.animate();
								}
			this.toggleNext = 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tnn = classBehaviour.toggleBasketNode;
									// if there is not a running animation
									if(!tnn.locked){
										// get parent recursion
										var intParentRecursion = parseInt(classBehaviour.getClassParameter(objNode,'useParent','0'));
										var objParentNode = objNode;
										for(var a=0; a<intParentRecursion; a++) objParentNode = objParentNode.parentNode;
										// check if a previousnode needs closing
										var strClosePrevious = classBehaviour.getClassParameter(objNode,'closePrevious','no');
										// get optional id
										var strCloseId = classBehaviour.getClassParameter(objNode, 'id', null);
										// animated folding
										var strAnimated = classBehaviour.getClassParameter(objNode,'animated','yes');
										// determine the next node
										var objNextNode;
										if(strCloseId!=null){
											objNextNode = document.getElementById(strCloseId);
										}else if(objParentNode.nextSibling){
											objNextNode = (objParentNode.nextSibling.nodeName.indexOf("text")<0) ? objParentNode.nextSibling : objParentNode.nextSibling.nextSibling ;
										}
										// if there is a next node
										if(objNextNode!=null){
											// toggle it's visibility
											if(strAnimated=='yes'){
												tnn.toggleAnim(objNextNode, strClosePrevious);
											}else{
												tnn.toggleThis(objNextNode, strClosePrevious);
											}
											// If the next node has been hidden
											if(objNextNode.style.display=='none'){
												// restore current node's click state
												objNode.className = objNode.className.replace('active','passive');
												if(objNode.src!=null) objNode.src = objNode.src.replace('active','passive');
											}else{
												// mark current node as active
												objNode.className = objNode.className.replace('passive','active');
												if(objNode.src!=null) objNode.src = objNode.src.replace('passive','active');
												// restore previous node's click state
												if(tnn.lastLink!=null && tnn.lastLink!=objNode && strClosePrevious=='yes'){
													tnn.lastLink.className = tnn.lastLink.className.replace('active','passive');
													if(objNode.src!=null) tnn.lastLink.src = tnn.lastLink.src.replace('active','passive');
												}
											}
											// remember last node
											tnn.lastLink = objNode;
										}
									}
									// cancel onclick event
									return false;
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.toggleBasketNode = new ToggleBasketNode;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.toggleBasketNode;
		
	// Replaces all png's in the container with gif alternatives in Internet Explorer 6 and lower.
		// preload cosmetic tweak
		if(document.all && (navigator.userAgent.indexOf('MSIE 6.0')>-1 || navigator.userAgent.indexOf('MSIE 5')>-1) && navigator.userAgent.indexOf('Opera')<0)
				document.writeln("<style>img.pngAlternative {visibility:hidden;}</style>");
		// define this class behaviour
		function PngAlternative(){
			/* properties */
			this.name 		= 	'pngAlternative';
			this.lastNode	=	null;
			this.lastNext	=	null;
			/* methods */
			this.start		=	function(node){
									this.process(node);
								}
			/* events */
			this.process	=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// if this is a crappy browser
									if
									(
										document.all && 
										(navigator.userAgent.indexOf('MSIE 6.0')>-1 || navigator.userAgent.indexOf('MSIE 5')>-1) && 
										navigator.userAgent.indexOf('Opera')<0
									)
									{
										objNode.src = objNode.src.replace('.png', '.gif');
										objNode.style.visibility = 'visible';
									}
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.pngAlternative = new PngAlternative;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.pngAlternative;
		
	// Keep the dropshadow's layer the same size as the content's layer
		// define this class behaviour
		function MatchDropshadowSize(){
			/* properties */
			this.name 		= 	'matchDropshadowSize';
			/* methods */
			this.start		=	function(node){
									this.process(node);
								}
			/* events */
			this.process	=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// measure the height of the content node (the last one)
									var contentHeight = objNode.offsetHeight;
									var contentWidth = objNode.offsetWidth;
									// make the content absolutely positioned
									objNode.style.position = 'absolute';
									// pass this size to the container
									objNode.parentNode.style.height = contentHeight + 'px';
									objNode.parentNode.style.width = contentWidth + 'px';
									// pass this size to the dropshadow
									shadowNode = classBehaviour.previousNode(objNode);
									shadowNode.style.height = contentHeight + 'px';
									shadowNode.style.width = contentWidth + 'px';
									// unhide the shadow
									shadowNode.style.visibility = 'visible';
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.matchDropshadowSize = new MatchDropshadowSize;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.matchDropshadowSize;

	    // Open an overlay as a popup window
		// define this class behaviour
		function OpenLayerPopUp(){
			/* properties */
			this.name 		= 	'openLayerPopUp';
			/* methods */
			this.start		=	function(node){
									// find the target layer
									targetPopUp = null;
									// process the node
									this.process(node);
									// the node's open button
									node.onclick = this.show;
									// open the popup immediately if required
									if(classBehaviour.getClassParameter(node, 'auto', 'no')=='yes') this.show(node);
								}
			this.fadeIn	=	function(id, amount){
									node = document.getElementById(id);
									nodes = node.getElementsByTagName('div');
									nodeShadow = nodes[0];
									nodeContent = nodes[1];
									// if the amount is not 50
									if(amount<70){
										// hide the popup content
										nodeContent.style.display = 'none';
										// set the shadow's fade to the next step
										nodeShadow.style.display = 'block';
										if(typeof(nodeShadow.style.MozOpacity)!='undefined')	nodeShadow.style.MozOpacity = amount/100;
										if(typeof(nodeShadow.style.filter)!='undefined')		nodeShadow.style.filter = "alpha(opacity=" + amount + ")";
										if(typeof(nodeShadow.style.opacity)!='undefined')		nodeShadow.style.opacity = amount/100;
										// show the popup collection
										node.style.display = 'block';
										// repeat the fade
										setTimeout("classBehaviour.openLayerPopUp.fadeIn('" + id + "'," + (amount+10) + ")",10);
									}else{
									// else
										// show the popup content
										nodeContent.style.display = 'block';
									}
								}
			this.fadeOut	=	function(id, amount){
									node = document.getElementById(id);
									if (!node) return;
									nodes = node.getElementsByTagName('div');
									if (!nodes) return;
									nodeShadow = nodes[0];
									nodeContent = nodes[1];
									// if the amount is not 100
									if(amount>0){
										// hide the popup content
										nodeContent.style.display = 'none';
										// set the fade to the next step
										if(typeof(nodeShadow.style.MozOpacity)!='undefined')	nodeShadow.style.MozOpacity = amount/100;
										if(typeof(nodeShadow.style.filter)!='undefined')		nodeShadow.style.filter = "alpha(opacity=" + amount + ")";
										if(typeof(nodeShadow.style.opacity)!='undefined')		nodeShadow.style.opacity = amount/100;
										// repeat the fade
										setTimeout("classBehaviour.openLayerPopUp.fadeOut('" + id + "'," + (amount-10) + ")",10);
									}else{
										// show the popup content
										node.style.display = 'none';
									    //  Show the iframe that contains the 3D java viewer
									    if (document.getElementById('3dViewer'))
									        document.getElementById('3dViewer').style.display = 'block';										
									}
								}
			/* events */
			this.process	=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// prepare the popup's layout
								}
			this.show		=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var olp = classBehaviour.openLayerPopUp;
									// get the popup's object from the href or the popup itsself
									if(objNode.href){
										// find the id in the # of the href or from a given parameter
										popUpId = (objNode.href.indexOf("#")==0) ? objNode.href.split('#')[1] : classBehaviour.getClassParameter(objNode, 'id', 'popup0') ;
										
										//  find the bigger popup
										if (objNode.className == 'openLayerPopUpWide') popUpId = 'popup1';
										
										popUp = document.getElementById(popUpId);
									}else{
										popUp = objNode;
									}
									//  hide 3D viewer iframe
									if(document.getElementById('3dViewer'))
										document.getElementById('3dViewer').style.display = 'none';
									
									// if there is an iframe in the popup load the url into it
									popUpIframes = popUp.getElementsByTagName('iframe');
									popUpTitles = popUp.getElementsByTagName('h1');
									if(popUpIframes.length>0 && objNode.href){
										// if the link had a title and if the popup has a title. put the link title in the popup
										if(objNode.title && popUpTitles.length>0) popUpTitles[0].innerHTML = objNode.title;
										// load the href in the iframe
									    if (objNode.className.indexOf('openLayerPopUpPost') > -1)
									    {
									        document.forms[0].target = 'popup0frame';
									        document.forms[0].action = objNode.href;
									        document.forms[0].submit();
									    }
									    else
										    popUpIframes[0].src = objNode.href;
									}
									// find the close gadget
									popUpCloser = popUp.getElementsByTagName('a')[0];
									popUpCloser.onclick = olp.hide;
									// find the shadow overlay of the popup
									popUpOverlay = popUp.getElementsByTagName('div')[0];
									// remove the scroll bars
									if(navigator.appVersion.indexOf('MSIE 6')>-1 || navigator.appVersion.indexOf('MSIE 5')>-1){
										window.scrollTo(0,0);
										document.body.parentNode.style.overflow = "hidden";
										allSelects = document.getElementById('content').getElementsByTagName('select');
										for(var a=0; a<allSelects.length; a++) allSelects[a].style.visibility = 'hidden';
									}
									// fade the popup in
									olp.fadeIn(popUp.id, 0);
										//popUp.style.display = 'block';
									// cancel the click
									return false;
								}
			this.hide		=	function(that){
			                        var olp = classBehaviour.openLayerPopUp;
									// restore the scroll bars
									if(navigator.appVersion.indexOf('MSIE 6')>-1 || navigator.appVersion.indexOf('MSIE 5')>-1){
										document.body.parentNode.style.overflow = "auto";
										allSelects = document.getElementById('content').getElementsByTagName('select');
										for(var a=0; a<allSelects.length; a++) allSelects[a].style.visibility = 'visible';
									}
									// what is this???
			                        if (that)
			                        {
			    						var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									    olp.fadeOut(objNode.parentNode.parentNode.parentNode.parentNode.parentNode.id, 70);
									}
									else
									{

										olp.fadeOut('popupIntel', 70);
									    olp.fadeOut('popup1', 70);
									    olp.fadeOut('popup0', 70);
                                    }
									
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.openLayerPopUp = new OpenLayerPopUp;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.openLayerPopUp;

		

	    // Open an overlay as a popup window
		// define this class behaviour
		function CloseLayerPopUp(){
			/* properties */
			
			this.name 		= 	'closeLayerPopUp';
			/* methods */
			this.start		=	function(node){
									// the node's open button
									node.onclick = this.show;
								}
			this.show		=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									top.classBehaviour.openLayerPopUp.hide();
									return false;
                                }								
		}
		// add this function to the classbehaviour object
		classBehaviour.closeLayerPopUp = new CloseLayerPopUp;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.closeLayerPopUp;
		
	// Defines something a layer popup and automaticaly opens it after a set time
		// define this class behaviour
		function LayerPopUp(){
			/* properties */
			this.name 		= 	'layerPopUp';
			/* methods */
			this.start		=	function(node){
									// get the required time delay
									delay = parseInt(classBehaviour.getClassParameter(node, 'autodeploy', '9999'));
									// if the delay is a rational one
									if(delay!=9999){
										// set a timeout for the popup
										setTimeout("classBehaviour.layerPopUp.showId('" + node.id + "')",delay);
									}
								}
			/* events */
			this.showId	=	function(id){
									classBehaviour.openLayerPopUp.show(document.getElementById(id));
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.layerPopUp = new LayerPopUp;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.layerPopUp;
		
	// tabbed content
		// define this class behaviour
		function TabbedContent(){
			/* properties */
			this.name 		= 	'tabbedContent';
			/* methods */
			this.start		=	function(node){
									// get all tabs
									allTabs = node.getElementsByTagName('a');
									// store the most likely opened tab
									openedTab = allTabs[0];
									// for all tabs
									for(var a=0; a<allTabs.length; a++){
										// get the id this tab refers to
										tabId = allTabs[a].href.split('#')[1];
										// apply onclick events to the referred tab
										allTabs[a].onclick = this.open;
										// apply the starting state of the tab if needed
										if(allTabs[a].className.indexOf('closedTab')<0) allTabs[a].className += ' closedTab';
										// apply the starting state of the referred content if needed
										document.getElementById(tabId).style.display = 'none';
										// if this tab is referred to in the page url, remember it as active
										if(document.location.href.indexOf(allTabs[a].href)>-1) openedTab = allTabs[a];
										// if this tab was manualy set
										if(allTabs[a].className.indexOf('openedTab')>-1) openedTab = allTabs[a];
									}
									// if there is a pager
									pager = document.getElementById(classBehaviour.getClassParameter(node, 'pagerId', 'none'));
									if(pager){
										// assign the events for the buttons
										pager.getElementsByTagName('a')[0].onclick = this.previous;
										pager.getElementsByTagName('a')[1].onclick = this.next;
									}
									// open the most likely first tab
									this.open(openedTab, true);
								}
			/* events */
			this.next		=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tbd = classBehaviour.tabbedContent;
									// get the pager information
									pagerInfo = objNode.parentNode.parentNode.getElementsByTagName('span')[0].firstChild.nodeValue;
									// what is the current pagenumber
									currentPage = parseInt(pagerInfo.split('/')[0]);
									// how many pages are there
									totalPages = parseInt(pagerInfo.split('/')[1]);
									// what is the next page
									nextPage = (currentPage<totalPages) ? currentPage + 1 : 1 ;
									// what is the tabs strip
									tabStrip = document.getElementById(classBehaviour.getClassParameter(objNode.parentNode.parentNode, 'tabsId', 'none'));
									if(tabStrip){
										// get the relevant page from the tab strip
										targetTab = tabStrip.getElementsByTagName('a')[nextPage-1];
										// activate it's click
										tbd.open(targetTab);
									}
								}
			this.previous	=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tbd = classBehaviour.tabbedContent;
									// get the pager information
									pagerInfo = objNode.parentNode.parentNode.getElementsByTagName('span')[0].firstChild.nodeValue;
									// what is the current pagenumber
									currentPage = parseInt(pagerInfo.split('/')[0]);
									// how many pages are there
									totalPages = parseInt(pagerInfo.split('/')[1]);
									// what is the next page
									previousPage = (currentPage>1) ? currentPage - 1 : totalPages ;
									// what is the tabs strip
									tabStrip = document.getElementById(classBehaviour.getClassParameter(objNode.parentNode.parentNode, 'tabsId', 'none'));
									if(tabStrip){
										// get the relevant page from the tab strip
										targetTab = tabStrip.getElementsByTagName('a')[previousPage-1];
										// activate it's click
										tbd.open(targetTab);
									}
								}
			this.open		=	function(that, noAnimation){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var tbd = classBehaviour.tabbedContent;								
									
									// INDEX THE TAB STATES
									// get all tabs
									var allTabs = objNode.parentNode.parentNode.getElementsByTagName('a');
									var prevTab = null;
									var pageNumber = 0;
									// find the current tab
									for(var a=0; a<allTabs.length; a++){
										// rememeber the previous tab
										if(allTabs[a].className.indexOf('openedTab')>-1) prevTab = allTabs[a];
										// count the new pagenumber
										if(allTabs[a]==objNode) pageNumber = a;
									}
									
									// PREVIOUS TAB
									if(prevTab){
										// mark the previous tab as passive
										prevTab.className = prevTab.className.replace('openedTab', 'closedTab');
										// id the previous tabbed content
										prevContentId = prevTab.href.split('#')[1];
									}
									
									// NEXT TAB
									// mark the next tab as active
									objNode.className = objNode.className.replace('closedTab', 'openedTab');
									// id the next tabbed content
									nextContentId = objNode.href.split('#')[1];
									
									// FADE ANIMATION
									isAnimated = (noAnimation) ? 'no' : classBehaviour.getClassParameter(objNode, 'animated', 'yes') ;
									if(isAnimated=='yes'){
										// make the previous tab float
										document.getElementById(prevContentId).style.position = 'absolute';
										document.getElementById(prevContentId).style.top = '0px';
										// make the next tab no float
										document.getElementById(nextContentId).style.position = 'relative';
										// order the animation
										classBehaviour.fader.crossFade(nextContentId, prevContentId, 0, 10, 50, null);
									}else{
										if(prevTab) document.getElementById(prevContentId).style.display = 'none';
										document.getElementById(nextContentId).style.display = 'block';
									}
									
									// PAGE NUMBER
									// update page-numbering
									pager = document.getElementById(classBehaviour.getClassParameter(objNode.parentNode.parentNode, 'pagerId', 'none'));
									if(pager){
										pager.getElementsByTagName('span')[0].firstChild.nodeValue = (pageNumber+1) + '/' + allTabs.length ;
									}
									
									// cancel the jump to the anchor
									return false;
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.tabbedContent = new TabbedContent;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.tabbedContent;
		
	// Defines something a layer popup and automaticaly opens it after a set time
		// define this class behaviour
		function ThumbnailToPhoto(){
			/* properties */
			this.name 		= 	'thumbnailToPhoto';
			this.busy		=	false;
			/* methods */
			this.start		=	function(node){
									// set the event for this thumbnail
									node.onclick = this.showPhoto;
									// set the doublebuffer initial state
									var targetId = classBehaviour.getClassParameter(node, 'id', 'photoTarget');
									document.getElementById(targetId).getElementsByTagName('img')[0].style.display = 'block';
									document.getElementById(targetId).getElementsByTagName('img')[1].style.display = 'none';
								}
			/* events */
			this.showPhoto	=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var ttp = classBehaviour.thumbnailToPhoto;
									// get the display buffers
									var targetId = classBehaviour.getClassParameter(objNode, 'id', 'photoTarget');
									bufferA = document.getElementById(targetId).getElementsByTagName('img')[0];
									bufferB = document.getElementById(targetId).getElementsByTagName('img')[1];
									// get the active buffer 
									bufferIn = (bufferA.style.display=='none') ? bufferA : bufferB;
									bufferOut = (bufferIn==bufferA) ? bufferB : bufferA ;
									// get the target values from the thumbnail
									targetAlt = objNode.getElementsByTagName('img')[0].alt;
									targetSrc = objNode.href;
									// if there is no fade in progress and the target os not the same as the current image
									if(!ttp.busy && targetSrc!=bufferOut.src){
										// lock this function
										ttp.busy = true;
										// set the new source for the image from the clicked thumbnail
										bufferIn.alt = targetAlt;
										bufferIn.src = targetSrc;
										// call the fader
										bufferIn.onload = 	new function(){
																// trigger the crossfade
																classBehaviour.fader.crossFade(bufferIn.id, bufferOut.id, 0, 10, 50, 'classBehaviour.thumbnailToPhoto.unlock()');
															};
									}
									// cancel the click
									return false;
								}
			this.unlock		=	function(){
									classBehaviour.thumbnailToPhoto.busy = false;
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.thumbnailToPhoto = new ThumbnailToPhoto;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.thumbnailToPhoto;
		
	    // Scroll the list items of a container
		// define this class behaviour
		function ListScroller(){
			/* properties */
			this.name 		= 	'listScroller';
			this.object		=	null;
			this.dimensions =	new Coordinates();
			this.limits		=	new Coordinates();
			this.speed		=	new Coordinates();
			this.distance	=	new Coordinates();
			this.delay		=	null;
			this.interval	=	null;
			/* methods */
			this.start		=	function(node){
									// make a new instance of the scroller object
									this.object			= node;
									this.dimensions.x	= parseInt(classBehaviour.getClassParameter(node, 'width', '128'));
									this.dimensions.y	= parseInt(classBehaviour.getClassParameter(node, 'height', '84'));
									this.speed.x		= -1 * parseInt(classBehaviour.getClassParameter(node, 'left', '0'));
									this.speed.y		= -1 * parseInt(classBehaviour.getClassParameter(node, 'top', '2'));
									this.delay			= parseInt(classBehaviour.getClassParameter(node, 'delay', '64'));
									this.distance.x		= 0;
									this.distance.y		= 0;
									// clone the list items for double buffering
									var scrollList		= this.object.getElementsByTagName('UL')[0];
									var scrollItems		= scrollList.getElementsByTagName('LI');
									var itemsMax		= scrollItems.length;
									for(var a=0; a<itemsMax; a++){
										var new_node = scrollItems[a].cloneNode(true);
										scrollList.appendChild(new_node); 
									}
									// note the scrolling limits
									this.limits.x	= this.dimensions.x * itemsMax;
									this.limits.y	= this.dimensions.y * itemsMax;
									// set prerequisite styles
										//	UL settings
										scrollList.style.width	= (this.dimensions.x * 2 * itemsMax) + 'px';
										scrollList.style.height	= (this.dimensions.y * 2 * itemsMax) + 'px';
										// LI settings
										for(var a=0; a<scrollItems.length; a++){
											scrollItems[a].style.width	= this.dimensions.x + 'px';
											scrollItems[a].style.height	= this.dimensions.y + 'px';
										}

									this.object.onmouseout	= this.scroll;
									this.object.onmouseover = this.pause;									

									// manual controls
									document.getElementById('C43_Game_selection1_gameSelectorScrollerUp').onmousedown = this.scrollUp;
									document.getElementById('C43_Game_selection1_gameSelectorScrollerUp').onmouseup = this.restore;
									document.getElementById('C43_Game_selection1_gameSelectorScrollerDown').onmousedown = this.scrollDown;
									document.getElementById('C43_Game_selection1_gameSelectorScrollerDown').onmouseup = this.restore;
									
									this.scroll();
								}
			this.step		=	function(){
									var scrollCanvas		=	this.object.getElementsByTagName('UL')[0];
									// update styles
									scrollCanvas.style.left	=	(Math.abs(this.distance.x)>=Math.abs(this.limits.x)) ? '0px' : (this.distance.x + this.speed.x) + 'px';
									scrollCanvas.style.top	=	(Math.abs(this.distance.y)>=Math.abs(this.limits.y)) ? '0px' : (this.distance.y + this.speed.y) + 'px';
									// update stored positions
									this.distance.x			=	parseInt(scrollCanvas.style.left);
									this.distance.y			=	parseInt(scrollCanvas.style.top);
									return 0;
								}
			/* events */
			this.scrollUp	=	function () {
									classBehaviour.listScroller.speed.y = 10;
									return false;
								}
			this.scrollDown	=	function () {
									classBehaviour.listScroller.speed.y = -10;
									return false;
								}
			this.restore	=	function() {
									classBehaviour.listScroller.speed.y = -2;
								}
			this.scroll		=	function(){
									classBehaviour.listScroller.interval = setInterval('classBehaviour.listScroller.step()', classBehaviour.listScroller.delay);
									return false;
								}
			this.pause		=	function(){
									clearInterval(classBehaviour.listScroller.interval);
									return false;
								}
		}
			function Coordinates(x,y,z){
				this.x = x;
				this.y = y;
				this.z = z;
			}
		// add this function to the classbehaviour object
		classBehaviour.listScroller = new ListScroller;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.listScroller;
		
		function CustomizeValidator(){
			/* properties */
			this.name 		= 	'customizeValidator';
			/* methods */
			this.start		=	function(node){
									node.onclick = this.process;
								}		
			this.process 	= 	function(that){
                                    if(classBehaviour.customizeList.errors > 0)
                                    {
                                        alert(document.getElementById('NoProceed').value);
                                        return false;
                                    }
								}								
		}
		classBehaviour.customizeValidator = new CustomizeValidator;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.customizeValidator;		
		
    	// manage the customization budget
		// define this class behaviour
		function CustomizeList(){
			/* properties */
			this.name 		= 	'customizeList';
			this.list		=	null;
			this.errors     =   0;
			this.current    =   0;
			/* methods */
			this.start		=	function(node){
									// store the list
									this.list = node;
									// get all the form elements in the list
									allInputs = node.getElementsByTagName('input');
									// for all for elements
									for(var a=0; a<allInputs.length; a++){
										// if this elements is a radiobutton
										if(allInputs[a].getAttribute('type')=='radio' || allInputs[a].getAttribute('type')=='checkbox'){
											// add the event handler
											allInputs[a].onclick = this.process;
										}
									}
									// calculate the total price
									this.redraw();
								}
			this.process 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var czl = classBehaviour.customizeList;
									// store the active item
									classBehaviour.customizeList.current = objNode.value;
									// select the first item
// TODO: 2009-03-27
//									czl.selectFirst(objNode);
									// redraw the form
									czl.redraw(objNode);
								}							
			this.waitReply	=	function(waitStatus, waitNode, waitError){
									// TODO: what do we use as a progress indicator
								}
			this.loadReply	=	function(loadXml, loadNode, loadText){
									if(loadXml!=null){
										classBehaviour.customizeList.errors = 0;
										var czl = classBehaviour.customizeList;
										// for all notifications
										allNotifications = loadXml.getElementsByTagName('notification');
										
										allPlaceholders = classBehaviour.getElementsByClassName('notification', null);
										
										for(var a=0; a<allPlaceholders.length; a++){
										    allPlaceholders[a].className = allPlaceholders[a].className.replace('error', 'empty').replace('remark', 'empty');
										}
										
										for(var a=0; a<allNotifications.length; a++){
											// get the id
											notificationId = allNotifications[a].getAttribute('id');
											// get the class
											notificationClass = allNotifications[a].getAttribute('class');
											// get the content
											notificationText = (allNotifications[a].childNodes.length>0) ? allNotifications[a].firstChild.nodeValue : '' ;
											// fill in the notification
											notificationObject = document.getElementById(notificationId);
									/* TODO: What does this do? - Maurice */
											if (notificationObject == null)
											    continue;
											    
											notificationObject.className = notificationObject.className.replace(' child' , '');
											if (classBehaviour.previousNode(notificationObject).getElementsByTagName('input')[0].checked)
											{
											    notificationObject.className += ' child';
											}
									/* /TODO */
											notificationObject.className = notificationObject.className.replace('error' , notificationClass).replace('remark', notificationClass).replace('empty', notificationClass);
											notificationObject.innerHTML = notificationText;
											
											if (notificationObject.className.indexOf('error') > -1)
											    classBehaviour.customizeList.errors++;
										}
									}
								}
			/* events */
			this.selectFirst =	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// select the first sub-item
									if(objNode.className.indexOf('displayIfChecked')>-1){
										targetId = classBehaviour.getClassParameter(objNode, 'id', null);
										if(targetId!=null && objNode.checked){
											targetObj = document.getElementById(targetId);
											// get the sub items
											if(targetObj!=null){
												childInputs = targetObj.getElementsByTagName('INPUT');
												for(var a=0; a<childInputs.length; a++){
													if(childInputs[a].className.indexOf('checked')>-1){
														childInputs[a].checked = true;
													}
												}
											}
										}
									}
								}
			this.redraw		=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									
									var czl = classBehaviour.customizeList;
									// get the default price
									var totalPrice = parseFloat(document.getElementById('customizeBase').value);
									var optionsList = '';
									// get the nomenclature
									currencySymbol = (document.getElementById('currencySymbol')) ? document.getElementById('currencySymbol').value + ' ' : '&pound; ';
									addSymbol = (document.getElementById('addSymbol')) ? document.getElementById('addSymbol').value + ' ' : 'add ';
									substractSymbol = (document.getElementById('substractSymbol')) ? document.getElementById('substractSymbol').value + ' ' : 'subtract ';
									// get all lists
								//	allLists = czl.list.getElementsByTagName('ul');
									allLists = classBehaviour.getElementsByClassName('customizeOption', czl.list);
									// for all lists
									for(var a=0; a<allLists.length; a++){
										deltaPrice = 0;
										// get all list items
										allItems = allLists[a].getElementsByTagName('li');
										// for all list items
										for(var b=0; b<allItems.length; b++){
											// if this is a list item and not a piece of comment
											if(allItems[b].className.indexOf('notification')<0){
												// if the list item is checked
												if(allItems[b].getElementsByTagName('input')[0].checked){
													// highlight the item
													allItems[b].className = allItems[b].className.replace('passive', 'active');
													// price difference
													deltaPrice = parseFloat(allItems[b].getElementsByTagName('input')[1].value);
													// add the price difference
													totalPrice += deltaPrice;
													// add the option to the options list
													optionsList += '<li><div>' + allItems[b].getElementsByTagName('label')[0].innerHTML + '</div></li>';
												// else
												}else{
													// remove the highlight
													allItems[b].className = allItems[b].className.replace('active', 'passive');
												}
											}
										}
										// revisit the items to adjust their price difference indicator
										for(var c=0; c<allItems.length; c++){
											// if this is a list item and not a piece of comment
											if(allItems[c].className.indexOf('notification')<0){
												// only for radio buttons does the price difference need to be recalculated
												if(allItems[c].getElementsByTagName('input')[0].getAttribute('type')=='radio'){
													// get listed price difference
													labelPrice = parseFloat(allItems[c].getElementsByTagName('input')[1].value);
													// add it to the total price difference
													labelPrice -= deltaPrice;
													// change the label if it's a radio button, but not a check box
													allItems[c].getElementsByTagName('em')[0].innerHTML = (labelPrice<0) ? 
														substractSymbol+currencySymbol+formatCurrency(Math.abs(labelPrice)) : 
														addSymbol+currencySymbol+ formatCurrency(Math.abs(labelPrice));
												}
											}
										}
									}
									// post the total price
									    ckinPrice = (document.getElementById('ckinPrice')) ? parseFloat(document.getElementById('ckinPrice').value) : 0 ;
										document.getElementById('customizePrice').innerHTML = formatCurrency(totalPrice+ckinPrice);
										//debug('INPUT: ' + document.getElementById('ckinPrice').value);
										//debug('CURR: ' + formatCurrency(document.getElementById('ckinPrice').value));
										// document.getElementById('customizePrice').innerHTML = totalPrice.toFixed(2) ;
										// document.getElementById('customizePrice').innerHTML = totalPrice.toLocaleString();
									// post the options list
									document.getElementById('customizeList').innerHTML = optionsList;
									// store the name value pair for later reference
								/* TODO: WTF? - Maurice */
									//  Call the validation at page load
									if(that==null)
									{
									    that = this; objNode = this;
									}
								/* /TODO */
									if(that!=null){
										postValues = (typeof(objNode.name)!='undefined' && typeof(objNode.value)!='undefined') ? objNode.name + '=' + objNode.value + '&' : '' ;
										allInputs = czl.list.getElementsByTagName('INPUT');
										for(var a=0; a<allInputs.length; a++) if(typeof(allInputs[a].checked)!='undefined') if(allInputs[a].checked) postValues += allInputs[a].name + '=' + allInputs[a].value + '&';
										// tell the server of the selected item
										postValues += '&current=' + classBehaviour.customizeList.current;
										postUrl = document.getElementById('postUrl').value;
										
										classBehaviour.ajax.addRequest(postUrl, czl.loadReply, czl.waitReply, postValues, czl.list);
									}
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.customizeList = new CustomizeList;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.customizeList;

	    // manage the customization skins
		// define this class behaviour
		function CheckNextBox(){
			/* properties */
			this.name 		= 	'checkNextBox';
			/* methods */
			this.start		=	function(node){
									node.onclick = this.process;
									
								}
			this.process 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// Is the skins list available

									var objCheck = document.getElementById(classBehaviour.getClassParameter(objNode, 'target', ''));
									if (objCheck.checked)
									    objCheck.checked = false;
									else if (!objCheck.checked)   
									    objCheck.checked = true;
									
                                    classBehaviour.addValueTo.toggleAll(objCheck);

                                    return false;
								}
		}
		// add this function to the classbehaviour object
		// [20090220 MARKR]
		classBehaviour.checkNextBox = new CheckNextBox;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.checkNextBox;

	    // manage the customization skins
		// define this class behaviour

	// manage the customization skins
		// define this class behaviour
		function SkinChoice(){
			/* properties */
			this.name 		= 	'skinChoice';
			/* methods */
			this.start		=	function(node){
									node.onclick = this.process;
								}
			this.process 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// Is the skins list available
									if(document.getElementById('skinList')){
                                        document.getElementById('skinList').innerHTML = '<li><div>'+objNode.getElementsByTagName('span')[0].innerHTML+'</div></li>';
                                        document.getElementById('skin').value = objNode.className.replace('skinChoice', '');
									}
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.skinChoice = new SkinChoice;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.skinChoice;

// hover the next node near the mouse pointer
		// define this class behaviour
		function Hover2NextNode(){
			/* properties */
			this.name 		= 	'hover2NextNode';
			this.opened	=	null;
			/* methods */
			this.start		=	function(node){
									// mouse handlers
									node.onmouseover = this.show;
									node.onmouseout = this.hide;
									// cancel the mouseover of the target node
									targetNode = classBehaviour.nextNode(node);
									targetNode.onmouseover = this.cancel;
								}
			/* events */
			this.show		=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// close the previous node
									if(classBehaviour.hover2NextNode.opened) classBehaviour.hover2NextNode.opened.style.visibility = 'hidden';
									// open the current node
									targetNode = classBehaviour.nextNode(objNode);
									targetNode.style.visibility = 'visible';
									// store the visible node
									classBehaviour.hover2NextNode.opened = targetNode;
								}
			this.hide		=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									targetNode = classBehaviour.nextNode(objNode);
									targetNode.style.visibility = 'hidden';
								}
			this.cancel	=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									targetNode.style.visibility = 'visible';
									return false;
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.hover2NextNode = new Hover2NextNode;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.hover2NextNode;
		
	// add display='none'; on parse
		// define this class behaviour
		function HideThisNode(){
			/* properties */
			this.name 		= 	'hideThisNode';
			/* methods */
			this.start		=	function(node){
									// store the node's height in it's className
									node.className += ' height_' + node.offsetHeight;
									// hide the node
									node.style.display = 'none';
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.hideThisNode = new HideThisNode;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.hideThisNode;

	// manage the customization budget
		// define this class behaviour
		function ScrollList(){
			/* properties */
			this.name 		= 	'scrollList';
			this.list		=	null;
			this.focus		=	null;
			/* methods */
			this.start		=	function(node){
									// add the right event handler to the button
									node.onmousedown = (classBehaviour.getClassParameter(node, 'scrollDirection', 'down')=='up') ? this.startUp : this.startDown ;
									node.onmouseup = this.cancel;
									node.onmouseout = this.cancel;
								}
			/* events */
			this.startUp	=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var sl = classBehaviour.scrollList;
									id = classBehaviour.getClassParameter(objNode, 'id', 'scrollList0');
									sl.scrollUp(id);
								}
			this.startDown	=	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var sl = classBehaviour.scrollList;
									id = classBehaviour.getClassParameter(objNode, 'id', 'scrollList0');
									sl.scrollDown(id);
								}
			/* methods */
			this.cancel		=	function(){
									clearTimeout(classBehaviour.scrollList.timeout);
									classBehaviour.scrollList.focus = null;
								}
			this.scrollUp	=	function(id){
									var sl = classBehaviour.scrollList;
									// how high is the container
									var container = document.getElementById(id);
									var borderHeight = container.offsetHeight;
									// how heigh is the content
									var content = container.getElementsByTagName('UL')[0];
									var contentHeight = content.offsetHeight;
									// where is the content
									var contentScroll = (content.style.marginTop) ? parseInt(content.style.marginTop) : 0 ;
									// if the contant can still move
									if(contentScroll<0){
										// move it
										content.style.marginTop = (contentScroll + 10) + 'px';
									}
									// next step
									sl.timeout = setTimeout('classBehaviour.scrollList.scrollUp("' + id + '")', 10);
								}
			this.scrollDown	=	function(id){
									var sl = classBehaviour.scrollList;
									// how high is the container
									var container = document.getElementById(id);
									var borderHeight = container.offsetHeight;
									// how heigh is the content
									var content = container.getElementsByTagName('UL')[0];
									var contentHeight = content.offsetHeight;
									// where is the content
									var contentScroll = (content.style.marginTop) ? parseInt(content.style.marginTop) : 0 ;
									// if the contant can still move
									if(borderHeight-contentHeight<contentScroll){
										// move it
										content.style.marginTop = (contentScroll - 10) + 'px';
									}
									// next step
									sl.timeout = setTimeout('classBehaviour.scrollList.scrollDown("' + id + '")', 10);
								}

		}
		// add this function to the classbehaviour object
		classBehaviour.scrollList = new ScrollList;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.scrollList;

	// makes an element scroll along with the page
		// define this class behaviour
		function PseudoFixed(){
			/* properties */
			this.name 		= 	'pseudoFixed';
			this.timer		=	null;
			this.nodes		=	new Array();
			/* methods */
			this.start		=	function(node){
									// add this fixed item to the array
									this.nodes[this.nodes.length] = node;
									// set the event handler
									window.onscroll = this.update;
									clearInterval(this.timer);
								}
			this.update 	= 	function(that){
									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var psf = classBehaviour.pseudoFixed;
									
									// get the scroll offset
									var scrollOffset = 0;
								  	if (self.pageYOffset){	scrollOffset = self.pageYOffset;}
									  else if (document.documentElement && document.documentElement.scrollTop){ scrollOffset = document.documentElement.scrollTop; }
										else if (document.body) {	scrollOffset = document.body.scrollTop;}
									
									// for all fixed items in the array
									for(var a=0; a<psf.nodes.length; a++){
										if(scrollOffset>350 && psf.nodes[a].offsetHeight<document.body.offsetHeight-50){
											if(navigator.appVersion.indexOf("MSIE 5")>-1 || navigator.appVersion.indexOf("MSIE 6")>-1){
												psf.nodes[a].style.marginTop = (scrollOffset - 350) + 'px';
											}else{
												psf.nodes[a].style.position = 'fixed';
												psf.nodes[a].style.top = '13px';
											}
										}else{
											psf.nodes[a].style.position = 'relative';
										}
									}
								}
		}
		// add this function to the classbehaviour object
		classBehaviour.pseudoFixed = new PseudoFixed;
		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.pseudoFixed;
		
	// Update a slide based on clicks on radio-buttons		// define this class behaviour		function ImageToRadio(){			/* properties */			this.name 		= 	'imageToRadio';			/* methods */			this.start		=	function(node){									node.onclick = this.setImage;								}			/* events */			this.setImage	=	function(that){									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;									// where is the target
									targetId = classBehaviour.getClassParameter(objNode, 'id', 'photoTarget');
									classBehaviour.radioToPhoto.setImage(document.getElementById(targetId));
								}		}		// add this function to the classbehaviour object		classBehaviour.imageToRadio = new ImageToRadio;		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.imageToRadio;

	// Update a slide based on clicks on radio-buttons		function RadioToPhoto(){			/* properties */			this.name 		= 	'radioToPhoto';			/* methods */			this.start		=	function(node){									node.onclick = this.setImage;								}			/* events */			this.setImage	=	function(that){									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;									// where is the target
									targetId = classBehaviour.getClassParameter(objNode, 'id', 'photoTarget');
									// set the source
									pathContainer = classBehaviour.nextNode(objNode).innerHTML;									objNode.checked = true;									document.getElementById(targetId).src = pathContainer;								}		}		// add this function to the classbehaviour object		classBehaviour.radioToPhoto = new RadioToPhoto;		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.radioToPhoto;

	// Casing content		function CasingsContent(){			/* properties */			this.name 		= 	'casingsContent';			/* methods */			this.start		=	function(node){									// get the row nodes
									for(var a=0; a<node.childNodes.length; a++){
										if(node.childNodes[a].nodeName=='DIV'){
											// get col rows
											for(var b=0; b<node.childNodes[a].childNodes.length; b++){
												if(node.childNodes[a].childNodes[b].nodeName=='DIV'){
													// give them column numbers
													node.childNodes[a].childNodes[b].className += " column_" + b;
													// give them mouseover events
													node.childNodes[a].childNodes[b].onmouseover = this.over;
													node.childNodes[a].childNodes[b].onmouseout = this.out;
												}
											}
										}
									}								}			/* events */			this.over		=	function(that){									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// what column number is this
									colNumber = parseInt(classBehaviour.getClassParameter(objNode, "column", "0"));
									// get the row nodes
									node = objNode.parentNode.parentNode;
									for(var a=0; a<node.childNodes.length; a++){
										if(node.childNodes[a].nodeName=='DIV'){
											// get col rows
											for(var b=0; b<node.childNodes[a].childNodes.length; b++){
												if(node.childNodes[a].childNodes[b].nodeName=='DIV'){
													// highlight the right col in every row
													if(node.childNodes[a].childNodes[b].className.indexOf('column_'+colNumber)>-1){
														if(node.childNodes[a].childNodes[b].className)
															node.childNodes[a].childNodes[b].className = node.childNodes[a].childNodes[colNumber].className.replace('link','hover');
														if(node.childNodes[a].childNodes[b].getElementsByTagName('IMG').length>0)
															node.childNodes[a].childNodes[b].getElementsByTagName('IMG')[0].src = node.childNodes[a].childNodes[colNumber].getElementsByTagName('IMG')[0].src.replace('link','hover');
													}
												}
											}
										}
									}								}			this.out		=	function(that){									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									// what column number is this
									colNumber = parseInt(classBehaviour.getClassParameter(objNode, "column", "0"));
									// get the row nodes
									node = objNode.parentNode.parentNode;
									for(var a=0; a<node.childNodes.length; a++){
										if(node.childNodes[a].nodeName=='DIV'){
											// get col rows
											for(var b=0; b<node.childNodes[a].childNodes.length; b++){
												if(node.childNodes[a].childNodes[b].nodeName=='DIV'){
													// highlight the right col in every row
													if(node.childNodes[a].childNodes[b].className.indexOf('column_'+colNumber)>-1){
														if(node.childNodes[a].childNodes[colNumber].className)
															node.childNodes[a].childNodes[colNumber].className = node.childNodes[a].childNodes[colNumber].className.replace('hover','link');
														if(node.childNodes[a].childNodes[colNumber].getElementsByTagName('IMG').length>0)
															node.childNodes[a].childNodes[colNumber].getElementsByTagName('IMG')[0].src = node.childNodes[a].childNodes[colNumber].getElementsByTagName('IMG')[0].src.replace('hover','link');
													}
												}
											}
										}
									}								}		}		// add this function to the classbehaviour object		classBehaviour.casingsContent = new CasingsContent;		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.casingsContent;
		
        /*
            Payment window listener
        */
        var paymentWindow;
        function PaymentWindowListener() {
            var win	= paymentWindow; 
            try {
                if(	!(win && win.open && !win.closed)) {
                    document.forms[0].submit();
                } else { Recall(); }
            } catch(er) { Recall(); }
        }
        function Recall() {
            setTimeout("PaymentWindowListener();", 100 );
        }
		
		
        function InitPayment(){
	        /* properties */
	        this.name 		= 	'initPayment';
	        /* methods */
	        this.start		=	function(node){
	                                node.onclick = this.open;
	                                node.swap = this.swap;
	                                this.hide();
						        }
	        /* events */
	        this.open		=	function(that){
	                                var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;

	                                paymentWindow = window.open(this.href,'PaymentWindow','width=600,height=480,scrollbars=1,resizable=1');
	                                PaymentWindowListener();
	                                this.swap();
	                                return false;
						        }

	        /* Commodore project specific! */
	        this.hide       =   function(){
//	                                var result1 = classLib.getElementsByClassName('swap1', document);
//	                                if (result1) 
//	                                {
//	                                    result1[0].style.display = 'none';
//	                                }
						        }
        	
	        this.swap		=	function(){
//	                                var result0 = classLib.getElementsByClassName('swap0', document);
//	                                var result1 = classLib.getElementsByClassName('swap1', document);
//	                                if (result0 && result1) 
//	                                {
//	                                    result0[0].style.display = 'none';
//	                                    result1[0].style.display = 'block';
//	                                }
						        }
        						
        }
        // add this function to the classLib object
        classBehaviour.initPayment = new InitPayment;
        classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.initPayment;
		
	// Construct an empty stylesheet based on the hierarchy of tags
		//document.writeln('<button class="makeStylesheet" style="position : absolute; left : 0px; top : 0px;">Click to create stylesheet.</button>');
		// define this class behaviour		function MakeStylesheet(){			/* properties */			this.name 				=	'makeStylesheet';
			this.styleSheet			= 	"/* " + document.location.href.split('/')[document.location.href.split('/').length-1] + " */\n";
			this.referenceCss		=	"";
			this.rootObject			= 	document.body;			/* methods */			this.start				=	function(node){
											// make a reference stylesheet from the current stylesheets
											this.makeReferenceCss();
											// set the click event of the button
											node.onclick = this.showNodeClasses;
											/*
											debug(
												document.styleSheets[0].cssRules[1].selectorText,
												document.styleSheets[0].cssRules[1].cssText,
												document.styleSheets[0].cssRules[1].style.getPropertyValue('font-family')
											);
											*/										}
			this.makeReferenceCss	=	function(){
											for(var a=0; a<document.styleSheets.length; a++)
												for(var b=0; b<document.styleSheets[a].cssRules.length; b++)
													this.referenceCss += document.styleSheets[a].cssRules[b].selectorText + ' {}\n\t';
										}
			this.isFormElement		=	function(node){
											return (('INPUT,SELECT,TEXTAREA,BUTTON').indexOf(node.nodeName)>-1);
										}
			this.isClassBehaviour	=	function(newEntry){
											foundHandler = false;
											// for all behaviours, if the behaviour's name exists in the class name, apply it's events											for(var b=0; b<classBehaviour.handlers.length; b++)												foundHandler = (newEntry.indexOf(classBehaviour.handlers[b].name)>-1) ? true : foundHandler;
											// report back
											return foundHandler;
										}
			this.isInStylesheet		=	function(newEntry){
											foundStyle = false;
											// clean the new entry
											newEntry = newEntry.replace(/\t/gi,'').replace(' {}\n','').replace(',','');
											// if the style allready exists in this constructed stylesheet
											foundStyle = (this.styleSheet.indexOf(newEntry)>-1);
											// if the style allready exists in any rule in another stylesheet
											foundStyle = (this.referenceCss.indexOf(newEntry)>-1) ? true : foundStyle ;
											// report back
											return foundStyle;
										}
			this.getNodeClasses		=	function(objNode, intRecursion, prefix){
											var strTabs = '';
											var idPrefix, classPrefix, tagPrefix, addPrefix;
											var newEntry = '';
											// for every recursion add one tab
											for(var intB=0; intB<intRecursion; intB++) strTabs += '\t';
											// get the child nodes
											var objChildNodes = objNode.childNodes;
											// for every childnode
											for(var intA=0; intA<objChildNodes.length; intA++){
												// reset prefixes
												idPrefix = '';
												classPrefix = '';
												tagPrefix = '';
												addPrefix = '';
												// if it has an id, but is not a form element
												if(typeof(objChildNodes[intA].id)!='undefined' && !this.isFormElement(objChildNodes[intA])){
													if(objChildNodes[intA].id!=''){
														// add class to stylesheet prototype
														newEntry = strTabs + '#' + objChildNodes[intA].id + ' {}\n';
															// strStyleSheet += strTabs + prefix + '#' + objChildNodes[intA].id + ' {}\n'
														// add this style only if there's not double
														if(!this.isInStylesheet(newEntry)) this.styleSheet += newEntry;
														// update the prefix
														idPrefix = '#' + objChildNodes[intA].id;
													}
												}
												// if it has a className
												if(typeof(objChildNodes[intA].className)!='undefined'){
													if(objChildNodes[intA].className!=''){
														// split the classnames
														allClasses = objChildNodes[intA].className.split(' ');
														// for all classes
														for(var b=allClasses.length-1; b>=0; b--){
															// add class to stylesheet prototype
															newEntry = strTabs + prefix + objChildNodes[intA].nodeName.toLowerCase() + '.' + allClasses[b] + ' {}\n';
															// add this style only if there's not double
															if(!this.isInStylesheet(newEntry) && !this.isClassBehaviour(newEntry)){
																// update the prefix
																this.styleSheet += newEntry;
																// if the last entry was a link
																if(objChildNodes[intA].nodeName=='A'){
																	// repeat it four times with the mouseover states
																	this.styleSheet += '\t' + strTabs + prefix + objChildNodes[intA].nodeName.toLowerCase() + '.' + allClasses[b] + ':link,\n';
																	this.styleSheet += '\t' + strTabs + prefix + objChildNodes[intA].nodeName.toLowerCase() + '.' + allClasses[b] + ':visited {}\n';
																	this.styleSheet += '\t' + strTabs + prefix + objChildNodes[intA].nodeName.toLowerCase() + '.' + allClasses[b] + ':hover,\n';
																	this.styleSheet += '\t' + strTabs + prefix + objChildNodes[intA].nodeName.toLowerCase() + '.' + allClasses[b] + ':active {}\n';
																	// and jump further in
																	intRecursion += 1;
																}
															}
															// update the prefix
															classPrefix = objChildNodes[intA].nodeName.toLowerCase() + '.' + allClasses[b];
														}
													}
												}
												// if it has neither
												if(
													objChildNodes[intA].className=='' && 
													(objChildNodes[intA].id=='' || this.isFormElement(objChildNodes[intA])) && 
													objChildNodes[intA].nodeName.indexOf('text')<0 && 
													objChildNodes[intA].nodeName.indexOf('comment')<0
												){
													// add class to stylesheet prototype
													newEntry = strTabs + prefix + objChildNodes[intA].nodeName.toLowerCase() + ' {}\n';
													// add this style only if there's not double
													if(!this.isInStylesheet(newEntry)){
														this.styleSheet += newEntry;
														// if the last entry was a link
														if(newEntry.indexOf(' a {}')>-1){
															// repeat it four times with the mouseover states
															this.styleSheet += '\t' + newEntry.replace('a {}','a:link,');
															this.styleSheet += '\t' + newEntry.replace('a {}','a:visited {}');
															this.styleSheet += '\t' + newEntry.replace('a {}','a:hover,');
															this.styleSheet += '\t' + newEntry.replace('a {}','a:active {}');
															// and jump further in
															intRecursion += 1;
														}
													}
													// update the prefix
													tagPrefix = objChildNodes[intA].nodeName.toLowerCase();
												}
												// if it has childNodes
												if(objChildNodes[intA].childNodes.length>0){
													// update the prefix
													if(idPrefix){
														addPrefix = idPrefix + ' ';
													}else if(classPrefix){
														addPrefix = prefix + classPrefix + ' ';
													}else if(tagPrefix){
														addPrefix = prefix + tagPrefix + ' ';
													}
													// recurse
													this.getNodeClasses(objChildNodes[intA], intRecursion+1, addPrefix);
												}
											}
										}
			this.showNodeClasses	=	function(){
											var mss = classBehaviour.makeStylesheet;
											document.body.style.textAlign = 'left';
											document.body.style.background = '#ffffff none';
											document.body.style.color = '#000000';
											document.body.style.fontFamily = 'Sans Serif';
											document.body.style.fontSize = '12pt';
											mss.getNodeClasses(mss.rootObject, 0 , '');
											document.body.innerHTML = '<pre>' + mss.styleSheet + '</pre>';
										}		}		// add this function to the classbehaviour object		// classBehaviour.makeStylesheet = new MakeStylesheet;		// classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.makeStylesheet;
		
	// Casing content		function IndexChanged(){			/* properties */			this.name 		= 	'indexChanged';	        /* methods */
	        this.start		=	function(node){
	                                node.onchange = this.redirect;
						        }
	        /* events */
	        this.redirect	=	function(that){
	                                var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
                                    var put = document.getElementById(classBehaviour.getClassParameter(objNode, 'id', 'i'));
                                    if (put) put.value = objNode.value;
                                    document.forms[0].submit();
	                                return false;
						        }		}		// add this function to the classbehaviour object		classBehaviour.indexChanged = new IndexChanged;		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.indexChanged;
		
	// Shows elements based on the state of a related radio button or checkbox		// define this class behaviour		function DisplayIfChecked(){			// properties			this.name 		= 	'displayIfChecked';			this.timeout	= 	null;			// methods 			this.start		=	function(node){
//									classBehaviour.addEvent(node, 'click', this.delay);
//									classBehaviour.addEvent(node, 'change', this.delay);
									node.onmouseup = this.delay;
									node.onchange = this.delay;									this.delay(node);								}			// events			this.delay  	=   function(that){									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;									var dic = classBehaviour.displayIfChecked;									// cancel the previous timeout								//	clearTimeout(dic.timeout);									// wait a little while for MSIE									dic.timeout = setTimeout("classBehaviour.displayIfChecked.toggle('" + objNode.id + "')", 100);								}			this.toggle		= 	function(id){									// source object									var objNode = document.getElementById(id);									// get all inputs									var allInputs = document.getElementsByTagName('input');									// for all inputs									for(var a=0; a<allInputs.length; a++){										// if this is a radio and it belong to the same named group										if(allInputs[a].name == objNode.name){											// get the target id											targetId = classBehaviour.getClassParameter(allInputs[a], 'id', 'displayIfChecked');											targetObj = document.getElementById(targetId);											// hide the targetnode if checked											if(targetObj){												targetObj.style.display = (allInputs[a].checked) ? classBehaviour.getVisibleState(targetObj) : 'none' ;												classBehaviour.previousNode(targetObj).className = (allInputs[a].checked) ? classBehaviour.previousNode(targetObj).className.replace('link', 'active') : classBehaviour.previousNode(targetObj).className.replace('active', 'link') ;
												// uncheck any radio buttons deeper in the hierarchie
												childToggles = targetObj.getElementsByTagName('input');
												for(var b=0; b<childToggles.length; b++){
													if(objNode!=childToggles[b] && childToggles[b].type=='radio' && childToggles[b].className!='radio checked'){
// TODO: 2009-03-27
//														childToggles[b].checked = false;
													}
												}
												classBehaviour.customizeList.redraw();
											}										}									}								}		}		// add this function to the classbehaviour object		classBehaviour.displayIfChecked = new DisplayIfChecked;		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.displayIfChecked;	
			
	    // Adds a value defines in a checkbox to a total		// define this class behaviour		function AddValueTo(){			// properties			this.name 		= 	'addValueTo';			// methods 			this.start		=	function(node){
									node.onclick = (node.type=='radio') ? this.toggleAll : this.toggle;
									// update a previously stored value
									setTimeout('classBehaviour.addValueTo.update("'+node.id+'")', 512);								}			// events
			this.update		=	function(id){
									objNode = document.getElementById(id);
									if(objNode.checked) classBehaviour.addValueTo.toggle(objNode);
								}
			this.toggleAll	=	function(that){									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;
									var avt = classBehaviour.addValueTo;
									// update all elements of the same name
									allNodes = document.getElementsByTagName('*');
									for(var a=0; a<allNodes.length; a++){
										if(allNodes[a].className!=null)
											if(allNodes[a].className.indexOf(avt.name)>-1 && allNodes[a].name==objNode.name) 
												avt.toggle(allNodes[a]);
									}
								}			this.toggle  	=   function(that){									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;									// get the target id									var targetId = classBehaviour.getClassParameter(objNode, 'id', null);
									if(targetId!=null){
										// get the target value
										targetNode = document.getElementById(targetId);
										targetValue = parseInt(targetNode.innerHTML.replace('.', '').replace(',', ''));
										// get the source value
										sourceValue = classBehaviour.getClassParameter(objNode, 'price', '0.00');
										sourceValue = parseInt(sourceValue.replace('.', '').replace(',', ''));
										// active or deactivate the container
										objNode.parentNode.parentNode.className = (objNode.checked) ? 
																						objNode.parentNode.parentNode.className.replace('link', 'active').replace('hover', 'active') : 
																						objNode.parentNode.parentNode.className.replace('active', 'link');
										// add or remove this item to the checkout list
										skinListNode = document.getElementById('skinList');
										if(objNode.checked){
											// if the item doesn't already exist
											if(document.getElementById(objNode.id + 'InList')==null){
												newListItem = document.createElement('li');
												newListItem.id = objNode.id + 'InList';
												sourceTitle = objNode.parentNode.parentNode.getElementsByTagName('label')[0];
												newListItemText = document.createTextNode(sourceTitle.innerHTML);
												newListItem.appendChild(newListItemText);
												skinListNode.appendChild(newListItem);
												targetValue = targetValue + sourceValue;
											}
										}else{
											newListItem = document.getElementById(objNode.id + 'InList');
											if(newListItem!=null){
												skinListNode.removeChild(newListItem);
												targetValue = targetValue - sourceValue;
											}
										}
										// write the target value back
										targetNode.innerHTML = formatCurrency((targetValue/100).toFixed(2));
									}								}		}		// add this function to the classbehaviour object		classBehaviour.addValueTo = new AddValueTo;		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.addValueTo;
		
		// define this class behaviour		function AddChecked(){			// properties			this.name 		= 	'addChecked';			// methods 			this.start		=	function(node){
									node.onclick = this.toggle;
								}			// events
			this.toggle  	=   function(that){									var objNode = (typeof(this.nodeName)=='undefined') ? that : this ;									var targetNode = document.getElementById('Remember');									objNode.href += (targetNode.checked ? ',1' : ',0');								}		}		// add this function to the classbehaviour object		classBehaviour.addChecked = new AddChecked;		classBehaviour.handlers[classBehaviour.handlers.length] = classBehaviour.addChecked;		
		
	// start the parsing of classes
	classBehaviour.parseDocument();
