
		function getUrlVars(){
		 var vars = [], hash;
		 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
		   for(var i = 0; i < hashes.length; i++)
		  {        hash = hashes[i].split('=');
		 vars.push(hash[0]);
			vars[hash[0]] = hash[1];    }
		return vars;}


          $(function() {
        var all_bottom = -($(".pictures").height()-$(".gallery").height())+15

            $(".button_up").click(function() {
            var current=parseInt($(".pictures").css('top'));
            var mostanimal = $('.pictures:animated').length;
            if (current<-109 && mostanimal==0){
                $(".pictures").animate({ top: "+=91" }, 550);
                }
            });
            $(".button_down").click(function() {
             var current_bottom = parseInt($(".pictures").css('top'));

            var mostanimal = $('.pictures:animated').length;
              if (current_bottom>all_bottom && mostanimal==0){
             $(".pictures").animate({ top: "-=91" }, 550);
                                   }});

       $("div.thumb").hover(function() {
       $(this).find(".grey").stop().fadeTo('normal', 0 , function() {
			$(this).hide()

                    		});
	} , function() {
		$(this).find(".grey").stop().fadeTo('normal', 1).show();
	});

     });
             $(function() {
        $('.pictures a').lightBox();

$.ajax({
	type:"GET",
    url:'open_picture.php?graffiti='+getUrlVars()['graffiti'],
    success:
        function(answer){
            if (answer==1){
        		$(".thumb a:[id="+getUrlVars()['graffiti']+"]").click();
                }}
});


    });


