function initJQueryStuff() {

	// Stripe all data tables
	var alternateRowColors = function(table,context) {
		$jq(table + ' tbody tr:odd').removeClass('even').addClass('odd');
	    $jq(table + ' tbody tr:even').removeClass('odd').addClass('even');
	};
	// @todo multiple data tables to be striped
    alternateRowColors("table.data","#content");
    
    // Hover zebra tables
    $jq("table.zebra tbody tr","#content").
		mouseover(function() {
			$jq(this).addClass("over");
		}).
		mouseout(function() {
			$jq(this).removeClass("over");
		});

	// Print
	if (window.location.search.indexOf("print") > 0) {
		//console.info(window.location.search.indexOf("print"));
		$jq('#content').prepend('<div id="print-container" style="text-align:right"><form><input type="submit" class="submit ignore" id="print" value="Drucken" /></form><hr /></div>');
		$jq('#print').click(function() {
			window.print();
			return false;
		});
	}

	// OnlineBewerbung Adam+Eva Award
	var hasErrors = $jq("#elements > div.form-error").size() > 0;
	var fieldList = new Array("presenter", "category-wrapper", "furtherInformation", "client", "architect", "lecaCaterer", "exhibitionConstructor", "agency", "partner", "conceptGuide");
	$jq("#"+fieldList.join(" .title label,#")+" .title label").each(function(i) {
		$jq(this).
			prepend('<div class="toggle"></div>').
			toggle(function(){
			   	$jq(this).parent().addClass("expanded").next().show();
			 },function(){
		   		$jq(this).parent().removeClass("expanded").next().hide();
			});
		if (hasErrors) {
			$jq(this).click();
		} else {
			$jq(this).parent().next().hide();
		}
	});
	
	// wbw category-tree
	$jq("#categories", "#inner-extra").treeview({
		prerendered: true
	});
	
	// wbw category tooltips
	$jq("#categories a", "#inner-extra").Tooltip({
	    showURL: false	    
	});
	
	// wbw tabs 
	/*$jq("#tabs").tabs();*/
	
	// turnover list
	$jq("h6", "#turnoverList").each(function() {
		var buffer = $jq(this).text();
		$jq(this).text("").append('<a href="#">'+buffer+'</a>'); 
	})
	.find("a")
	.click(function () {
     	$jq(this)
			.parent()
			.next()
			.toggleClass("selected");
		return false;
	});
	
	// award-submission: todos
	$jq('.alert').click(function() {
		var id = this.getAttribute('id');
		var plainId = id.substring('alert'.length);
		var todoId = 'todo' + plainId;
//		alert(todoId);
		$jq('#' + todoId).toggleClass("hidden");//.show("slow");
	});
	
	// slideshow on homepage
	
	// manually highlight ForumNav-Element accoring to displayed slide on Rdy
	$hlght = $jq("div.active").find('a').attr('rel');

	if ($hlght) {
		$jq('#' + $hlght).addClass('selected');
	}
	
	// Start Slide Show
	startSlide();

	// Show corrospnding Slide on ForumNav MouseOver
	$jq("#forum-nav li").mouseover(function (e) {
		
		if ($jq(this).hasClass('selected')) {
			return;
		} 
		else {	
			
			$jq('#forum-nav li').removeClass('selected');
			$jq(this.id).addClass('selected');
			nxtId = this.id;
			var $next = $jq('#slideshow a[rel="' + nxtId + '"]').parent();
			stopSlide();
			slideSwitch($next);
		} 
	});
	
}

/**
 * Common functions
 */
var EventListener = {
	add: function(obj,type,fn) {
		if (obj.attachEvent) {
			obj['e'+type+fn] = fn;
			obj[type+fn] = function() { obj['e'+type+fn](window.event); }
			obj.attachEvent('on'+type,obj[type+fn]);
		} else
		obj.addEventListener(type,fn,false);
	},
	remove: function(obj,type,fn) {
		if (obj.detachEvent) {
			obj.detachEvent('on'+type,obj[type+fn]);
			obj[type+fn] = null;
		} else
		obj.removeEventListener(type,fn,false);
	}
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/,"");
}

function addClassName(el,className) {
	removeClassName(el,className);
	el.className = (el.className + " " + className).trim();
}

function removeClassName(el,className) {
	el.className = el.className.replace(className,"").trim();
}

// @todo (REVISIT) remove this function?
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}
