/* -------------------------------------------- */
/* Include JS File => js/common.js
/* -------------------------------------------- */

function printit(){
	if (!window.print){
		alert("You need NS4.x or IE5 to use this print button!");
		return;
	}
	window.print();
} 
/* COLLAPSE & EXPAND CONTENT with JAVASCRIPT */
function collapse()
		{	
			// check if DOM is available, return if not
			if(!document.createTextNode){return;}
			// loop over all headlines of the 5th level
			var heads=document.getElementsByTagName('h6');
			for(var i=0;i<heads.length;i++)
			{		
					// grab the next sibling (the loop is needed because
					// of whitespace issues
					var tohide=heads[i].nextSibling;
					while(tohide.nodeType!=1)
					{
						tohide=tohide.nextSibling;
					}
					// hide the sibling by applying the class 'hidden' and 
					// show that the headline is clickable by applying 
					// the class 'trigger'
					cssjs('add',tohide,'hidden');
					cssjs('add',heads[i],'trigger');
					// store the element to be hidden in an attribute
					heads[i].tohide=tohide;
					// add the class 'hover' when the mouse touches the headline
					heads[i].onmouseover=function()
					{
						cssjs('add',this,'hover');
					}
					// remove the class 'hover' when the mouse leaves the headline
					heads[i].onmouseout=function()
					{
						cssjs('remove',this,'hover');
					}
					// if the user activates the headline
					heads[i].onclick=function()
					{
						// test if the class 'hidden' is already applied to the 
						// next sibling
						if(cssjs('check',this.tohide,'hidden'))
						{
							// if that is the case, replace it with shown and 
							// the headline class with open
							cssjs('swap',this,'trigger','open');			
							cssjs('swap',this.tohide,'hidden','shown');			
						} else {
							// and vice versa
							cssjs('swap',this,'open','trigger');			
							cssjs('swap',this.tohide,'shown','hidden');			
						}
					}
			}
			function cssjs(a,o,c1,c2)
			{
				switch (a){
					case 'swap':
						o.className=!cssjs('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);
					break;
					case 'add':
						if(!cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
					break;
					case 'remove':
						var rep=o.className.match(' '+c1)?' '+c1:c1;
						o.className=o.className.replace(rep,'');
					break;
					case 'check':
						return new RegExp('\\b'+c1+'\\b').test(o.className)
					break;
				}
			}
		}

