var $j = jQuery.noConflict();

$j(document).ready(function() {
	
	/************* VARIABLES ************/
	
	var SocialTabWidth = $j('#social-tab').width() + 40
	var BodyWidth = $j(document.body).width()
	
	/************************************/
	
	$j('#social-tab').css('margin-left', -((SocialTabWidth - 80 ) / 2))	
	$j('#social-tab, #social-push').click(function() {
		$j('#social').stop(true, true).slideToggle();
	});
	
	$j('#sportpas-button').click(function() {
		$j('#sportpas-content').stop(true, true).animate({ width: "toggle", opacity: "toggle"}, 300 )
	});
	
	$j('#left #children a').click(function() {
		
		href = $j(this).attr("href")

		$j(this).attr("href", href + "#main") 
	});

	if ( window.addEventListener ) {
    var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
    window.addEventListener("keydown", function(e){
        kkeys.push( e.keyCode );
        if ( kkeys.toString().indexOf( konami ) >= 0 )
			alert("Jonas").repeat(5)

    }, true);
	}
	
	$j('marquee').attr('scrollamount', '6').mouseover(function() {
            $j(this).attr('scrollamount','0')
        }).mouseout(function() {
            $j(this).attr('scrollamount','6')
        });

	$j("#slider").easySlider({
		auto: true,
		continuous: true,
		controlsShow: false,
		pause: 5000,
		speed: 1200
	});
	WindowWidth = $j(window).width()
	$j("#slider, #slider li").css('width' , WindowWidth)

	$j('#main table').attr('border', '0').css('width', '100%')
	$j('#main table').each(function() {
		$j(this).find('tr').each(function(idx) {
			if (idx % 2 == 0)
			{
			  $j(this).addClass("uneven")
			}
			else
			{
			  $j(this).find('td').attr('style', 'background-color: #ebfbff')
			}
		})
	})
	
	$j("#studentenleven #left #children li.current_page_item:last").addClass('active');

});
