$(document).ready(function(){
	Push();
	$(window).scroll(Push).resize(Push);
	$('#session_box').hide();
	$.get('/useflash.php', function(data){
		var rand = "head"+Math.floor(Math.random()*3+1)+".jpg";
		if(data == 'true') {
			swfobject.embedSWF("/head.swf", "flash", "940", "300", "9", "", { pic:rand }, "");
		} else {
			$('#head .mask').css({background:'transparent url(/css/images/'+rand+') -10px no-repeat'});;
		}
	});
	$('#btn_session').click(function(){
		$('#session_box').slideToggle();
	});
	$('a.scroll').click(function() {
		$(window).scrollTo($(this).attr('rel'), 800, {queue:true});
		return false;
	});
	
	function Push() {
		if(($('body').height()-$('#spacer').height()) < $(window).height()) {
			$('#spacer').height($(window).height()-($('body').height()-$('#spacer').height()));
		} else {
			$('#spacer').height(0);
		}
	};
});
