jQuery(document).ready(function($) {

	$("ul.sf-menu").superfish({

		autoArrows: false,

		delay: 500, // one second delay on mouseout

		animation: {opacity:'toggle', height:'show'}, // fade-in and slide-down animation

		speed: 500, // faster animation speed

		autoArrows: false, // disable generation of arrow mark-up

		dropShadows: false // disable drop shadows

	});

	

	$("#grid-content").vgrid({

		easeing: "easeOutQuint",

		time: 500,

		delay: 0

	});

	

	$(window).load(function () {

		$("#grid-content").vgrid({

			easeing: "easeOutQuint",

			time: 500,

			delay: 0

		});

	});

	

	

	

	$("a[rel^='prettyPhoto']").prettyPhoto({

		animationSpeed: 'normal', /* fast/slow/normal */

		padding: 15, /* padding for each side of the picture */

		opacity: 0.7, /* Value betwee 0 and 1 */

		showTitle: false, /* true/false */

		allowresize: true, /* true/false */

		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */

		theme: 'dark_square', /* light_rounded / dark_rounded / light_square / dark_square */

		hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */

		modal: false, /* If set to true, only the close button will close the window */

		changepicturecallback: function(){}, /* Called everytime an item is shown/changed */

		callback: function(){} /* Called when prettyPhoto is closed */

	});

	

	$("#advertising a:nth-child(odd)").addClass("marginright5px");



	// This line prevents a page redirect (caused by .post_float below) when casting a thumbsup vote

	$('.thumbsup').click(function(event) { event.stopPropagation(); });



	$(".post_float").click(function(){

		var hreff = $(this).find("h2 a").attr("href");

		//document.location(hreff);

		window.location = hreff;

	});

	

	$("#tweets").tweet({

          join_text: "auto",

          username: twitterlogin,

          avatar_size: 48,

          count: 5,

          auto_join_text_default: "", 

          auto_join_text_ed: "",

          auto_join_text_ing: "",

          auto_join_text_reply: "",

          auto_join_text_url: "",

          loading_text: "loading tweets..."

        });

	$("#twitter_toggle").click(function () {

		$("#tweets").slideToggle(400);

		return false;

	});

	

	

});
