jQuery(document).ready(function($) {
	
	$(window).load(function () {
	$("#preloader11").fadeOut(1000);
	});	
	
	$('.fadeThis').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});

        $('.fadeThistwit').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});
		
		$('.fadeThisemail').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});
		
		$('.fadeThisrss').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(1000, 1);
	  }, function () {
	    $span.stop().fadeTo(1000, 0);
	  });
	});
								
	$("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");

	
	$(".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;
	});
	
	
	$('.white').addGlow({ textColor: 'white', haloColor: '#aaa', radius: 100 });
	$('.black').addGlow({ textColor: '#ff0000', haloColor: '#ccc', radius: 100 });
      $('.tblue').addGlow({ textColor: '#03EDED', haloColor: '#03EDED', radius: 100 });
      $('.fblue').addGlow({ textColor: '#3B5998', haloColor: '#3B5998', radius: 100 });
      $('.rss').addGlow({ textColor: '#E95C07', haloColor: '#E95C07', radius: 100 });
	  $('.pagenav').addGlow({ textColor: '#fff', haloColor: '#fff', radius: 30 });
      $('*').bind('glow:started', console.info);
      $('*').bind('glow:canceled', console.info);
	
});
