$(document).ready(function(){
	Push();
	$(window).scroll(Push).resize(Push);
	$.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'});;
		}
	});
	
		   $("#slide_panel").hide();
			$(".slide_button").click(function(){
				$("#slide_panel").slideToggle("slow");
			});
					   $("#mstream_slide_panel").hide();
						$(".mstream_slide").click(function(){
							$("#mstream_slide_panel").slideToggle("slow");
			});
	
	$('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);
		}
	};
});

