$(document).ready(function() {

	//hide all desicriptions when page loads
	$(".jQueryExpr .description").hide();
	$(".jQueryFaq .description").hide();

	//EXPRESSIONS
	//toggle the description
	$(".jQueryExpr li a").click(function() {
		$(this).parent().parent().find("li a.selected").not(this).removeClass("selected");	//removes 'selected' class from previous item selected
		$(this).toggleClass("selected");	//toggles 'selected' class on the current clicked link
		$(this).parent().parent().parent().children(".description").toggle();	//toggles the description
		$(this).parent().find(".selected").parent().parent().parent().children(".description").show();	//shows the description if any selected
	});
	//hide description when clicking the close button (image)
	$(".jQueryExpr .description .close").click(function() {
		$(this).parent().parent().parent().hide();
		$(this).parent().parent().parent().parent().find("li a.selected").removeClass("selected");
	});

	//FAQ
	$(".jQueryFaq .faq li a").click(function() {
		$(this).parent().children("div.description").toggle();
		$(this).toggleClass("selected");
	});
	//hide description when clicking the close button (image)
	$(".jQueryFaq .description .close").click(function() {
		$(this).parent().parent().parent().hide();
		$(this).parent().parent().parent().parent().find("a.selected").removeClass("selected");
	});

	/* make div's same height */
	if (media=screen) {
	$(".jqColumn").vjustify();

	/* make div's same height */
	$(".jqColumn2").vjustify();
	  }

	//Click-tooltip
	$('.clickme').cluetip({activation: 'click', width: 400});

	$('a.load-local').cluetip({local:true, width: 400, showTitle:true});
	$('a.load-local-help').cluetip({local:true, width: 550, showTitle:true});
	$('a.tipafriend').cluetip({local:true, width: 200, showTitle:true});

	$('a.load-remote').cluetip({local:false, width: 400, showTitle:true});

	/* mouseover-effect for rows in tables */
	/*$(".stripeMe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});*/


	/* mouseover-effect for rows in tables */
	$(".crosstripeMe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});

	/* mouseover-effect for columns in tables */
	$(".crosstripeMe td").mouseover(function() {$(this).addClass("current");}).mouseout(function() {$(this).removeClass("current");});

	/* mouseover-effect for current cell moused over */
	$(".crosstripeMe").columnHover({eachCell:true, hoverClass:'over'});


	/* show-hide leseweb */
	var showLeseweb = getCookie('LESEWEB');
	if(showLeseweb == 'show') {
	  $("#leseweb").removeClass("invisible");
	}

    $(".leseweb").click( function() {
 	  if($("#leseweb").is(':hidden')) {
 	    $("#leseweb").removeClass("invisible");
 	    setCookie('LESEWEB', 'show', null, "/"); 	    
 	  }
 	  else {
 	    $("#leseweb").addClass("invisible");
 	    deleteCookie('LESEWEB', "/");
 	  } 	 
    });
    
    $(".close_leseweb").click( function() {
 	  $("#leseweb").addClass("invisible");
 	  deleteCookie('LESEWEB', "/");
    });
});