// JavaScript Document

function onLoad() {
	
	$('a.scroller').bind("click", function() {
		$.scrollTo('#'+this.rel, 4000, { easing:'jswing' })
		return false;
	});
	
	// accordion to toggle links with class 'acc'
	$('ul.accordion > li > a').bind("click", function(e) {
		if ($(this).next('p').is(":visible")) {
			$(this).next('p').slideUp('fast');
			$(this).removeClass('active');
		} else {
			$('ul.accordion p').slideUp('fast');
			$(this).next('p').slideDown('fast');
			$(this).addClass('active');
		}
		return false;
	});

	$(".popin").bind("click", function(e) {
		//$("body").css('overflow', 'hidden');							   	
		//$("#bg_popin").width("100%").height("100%").fadeIn(300);
		
		$('#poster').addClass('poster');
		
		$('#poster').fadeIn(500);
		
		/*
		$('#popin').append(.jpg", function() {
			$('#popin').addClass('popin');
			alert(1);
		);
		 }*/
		
		return false;						
	});	


	// function to close open popins when link with class "close" is clicked
	$("#poster").bind("click", function(e) {
		$("#poster").fadeOut(500);
		//$("#bg_popin").fadeOut(300);
		//$("body").css('overflow', 'auto');	

		return false;						
	});	
	

}
