function showinfo(id){
$('#author-wrap').css({"display" : "block" });
mathY=($(window).height()/2)-($('#author-wrap').height()/2)
$('#author-wrap').animate({"top": mathY+100 }, 400, function() {
  $('#author-wrap').animate({"top": mathY }, 400);
});
$.post("/", { ajaload: "authorinfo", id: id}, function(data){
  $("#author-wrap-content").html(data);
}, "html");
return false;
}

function hideinfo(){
fdefHeight = $('#author-wrap').height()*-1;$('#author-wrap').animate({"margin-top": '-100%' }, 200);
$('#author-wrap').animate({"top": fdefHeight,"margin-top": 0 }, 0, function() {
  $('#author-wrap').css({"display" : "none"});
});
}

$(function() {
	$(window).load(function() {
		$('#namebox').css({"display" : "none" });
		$('#swbox').css({"display" : "none" });
		$('#feedbox').css({"display" : "none" });
		$('#worksbox').css({"display" : "none" });
		$('#feedbacktitlebox').css({"display" : "none" });
		$('ul.ourworks .text .bg ').fadeTo(1,0.8);
		fdefHeight = $('#feed-wrap').height()*-1
		$('#feed-wrap').animate({"top": fdefHeight}, 1);
		$('#namebox').slideDown('3000',function() {

											$('#swbox').slideDown('3000', function() {
											$('#worksbox').slideDown('3000', function() {
																					  $('#spambutbox').animate({"top" : "30px" }, '3000', function() {
											$('#feedbacktitlebox').slideDown('3000', function() {
											$('#feedbox').slideDown('3000'); }); }); } );



});
});
});
});

$(function() {
  $("#accordion").accordion({
    header: ".ui-accordion-header"
  });
	$('#spambutbox').click(function() {
		$('#layout').css({"display" : "block" });
		$('#layout').animate({"opacity" : .5 }, 1);
		$('#layout').animate({"height" : '100%' }, 500, function() {
			$('#feed-wrap').css({"display" : "block" });
			mathY=($(window).height()/2)-($('#feed-wrap').height()/2)
			$('#feed-wrap').animate({"top": mathY+100 }, 400, function() {
				$('#feed-wrap').animate({"top": mathY }, 400);
			});
		});
	});
});

$(function() {
	$('#layout').click(function() {
		$('#feed-wrap').animate({"margin-top": '-100%' }, 200);
		$('#feed-wrap').animate({"top": fdefHeight,"margin-top": 0 }, 0, function() {
			$('#layout').animate({"height" : "0%" }, 1000, function() {
					$('#layout').css({"display" : "none"});
					$('#feed-wrap').css({"display" : "none"});
			});
		 });

		$('body').css({"overflow" : "visible" });
	});
});

$(function() {
	$('.close').click(function() {
		$('#feed-wrap').animate({"margin-top": '-100%' }, 200);
		$('#feed-wrap').animate({"top": fdefHeight,"margin-top": 0 }, 0, function() {
			$('#layout').animate({"height" : "0%" }, 1000, function() {
					$('#layout').css({"display" : "none"});
					$('#feed-wrap').css({"display" : "none"});
			});
		 });

		$('body').css({"overflow" : "visible" });
	});
});

$(function() {
	$('#spambutbox').click(function() {
											$('#bgfb').css({"visibility" : "visibile" });

									});
		   });


       $(function() {
				$('.thumbnail .r').animate({"top": '0px' });

            $('.thumbnail .r').hover(function() {
               $(this).stop().animate({"top": '-30px' }, 200);
          }, function() {
	$(this).stop().animate({"top": '0px' }, 800);
           });
        });
//        $(function() {
//            $('.thumbnail .r').animate({"opacity": .5 });
//
//            $('.thumbnail .r').hover(function() {
//                $(this).stop().animate({ "opacity": 1 });
//            }, function() {
//                $(this).stop().animate({ "opacity": .5 });
//            });
//        });


window.onload=init;

function gE(id){
	return document.getElementById(id);
}
function init(){
	if(gE('spambutbox')){
		gE('spambutbox').onmouseover = function() {
			animIndex2=0;
			objShake=this;
			objShake.nx=this.offsetLeft;
			objShake.ny=this.offsetTop;
			defx=objShake.nx=this.offsetLeft;
			timer=setInterval('shake()', 50);
		}
		gE('spambutbox').onmouseout = function() {
			clearInterval(timer);
			this.style.left=this.nx+'px';
			this.style.top=this.ny+'px';
		}
	}
}

function shake(){
	if(animIndex2<1){
		animIndex2++;
		(Math.floor(Math.random()*2))?znak=1:znak=-1;
		objShake.style.left=(objShake.offsetLeft+(Math.floor(Math.random()*4)*znak))+'px';
		(Math.floor(Math.random()*2))?znak=1:znak=-1;
		objShake.style.top=(objShake.offsetTop+(Math.floor(Math.random()*5)*znak))+'px';
	}else{
		objShake.style.left=objShake.nx+'px';
		objShake.style.top=objShake.ny+'px';
		animIndex2=0;
	}
}
    $(window).resize(function () {
	scrolling=$("html").scrollTop();
      	mathY=($(window).height()/2)-($('#feed-wrap').height()/2)
	$('#feed-wrap').css({"top":mathY });
    });
	if ( $.browser.msie && $.browser.version.substr(0,1) <= 6 )
	{
    $(window).scroll(function () {
	scrolling=$("html").scrollTop();
      $("#feed-wrap").css({ 'margin-top':scrolling });
      $("#layout").css({ 'height':$('body').height() });
    });

};