jQuery.noConflict();
jQuery(document).ready(function($){

		/* CLOSE BUTTON */
		$('#content').prepend('<div id="open"><a href="#" id="clickopen"><img src="http://perspektivet.wpwizard.net/wp-content/themes/perspektivet/images/pluss.png" border="0" \/></a></div><div id="close"><a href="#" id="clickclose"><img src="http://perspektivet.wpwizard.net/wp-content/themes/perspektivet/images/close.png" border="0" \/></a></div>');
	    $('#close').css('display', 'none');
		$('body').css('overflow', 'hidden');


		/* ANTIMATE CONTENT */
	    contheight = $('#content').height();
		$('#content').animate({"top" : ($('#page').height())-132}, 0);

	    sideboxheight = $('#sidebox').height();
		$('#sidebox').animate({"top" : ($('#page').height())+1000}, 0);

		$('#clickopen').click(function( event ) {
			event.preventDefault();
		    $('#content').css('height', contheight);

			$('#content, #sidebox').animate({
				"top": "20"
				}, {
			    duration: 1000, 
			    specialEasing: {
				width: 'linear',
				height: 'easeOutBounce'
			    }, 
				complete: function() {
				$('body').css('overflow', 'auto');
			    $('#content').css('height', contheight);
				}
    		});
    
		    $('#close').css('display', 'block');
		    $('#open').css('display', 'none');
		});

		$('#clickclose').click(function( event ) {
			event.preventDefault();
			Pos = ($('#content').position());
			$('#content').animate({"top" : ($('#page').height())-132}, 1000);
			$('#sidebox').animate({"top" : ($('#page').height())+1000}, 1000);
		    $('#close').css('display', 'none');
		    $('#open').css('display', 'block');
		    $('body').css('overflow', 'hidden');
		});

		$(window).resize(function() {
			contpos = $('#content').position();
			if(contpos.top!='20'){
				$('#content').css({"top" : ($('#page').height())-132});
			}
		});

});

