
var $j = jQuery.noConflict();

$j(document).ready(function () {
	$j('#intro').delay(2000).animate({ opacity: 0}, 4000, function() {$j('#intro').remove();});

	var hash = location.hash;
	var count = 0;


	$j('div.main_page>p').css({display: "none"});
	$j('div.main_page>div').css({display: "none"});
	
	if (hash){
		$j('#' + hash.substr(2)).children().toggle();
		++count;
	}
	
	$j('#intro').click(function(){
		$j('#intro').remove();
	});
	
	$j('.main_page h2 a').click(function(){
		hash = location.hash;
		link_clicked = $j(this).attr('href');
		if (hash != link_clicked){
			if ($j(this).parent().parent().find('p').is(':hidden')){
				++count;
				if (count > 3){
					count = 1;
					$j('.main_page').children().hide();
				}
			}
				
		}
	
		$j(this).parent().parent().children().animate({ opacity: 'toggle'}, 1000, function() {});
		return false;

	});
	
	/*// SCROLLING
	$j(window).scroll(function() {
		int = $j(window).scrollTop();
		if (int >= $j(window).height() ){
			$j('body').animate({'backgroundColor': '#333' }, { queue: false, duration: 9000 });
			} else {
			$j('body').animate({'backgroundColor': '#fff' }, { queue: false, duration: 9000 });
			}
			
		});
	*/
	

});

