 	$(window).bind('resize', function() {   
		$("#socialWrapper").hide();
	  	$("#setsocial").hide();
		SetWidth();
	});

	$(document).ready(function () {
	    $("#socialWrapper").hide();
	    $("#setsocial").hide();
	    $("div.page-num a[class^='aspNetDisabled']").css('color', '#CCC');
	    SetWidth();
	    var top = $('#social').offset().top - parseFloat($('#social').css('marginTop').replace(/auto/, 0));

	    $(window).scroll(function (event) {
	        // what the y position of the scroll is
	        var y = $(this).scrollTop();

	        // whether that's below the form
	        if (y >= top) {
	            // if so, ad the fixed class
	            $('#social').addClass('fixed');
	        } else {
	            // otherwise remove it
	            $('#social').removeClass('fixed');
	        }
	    });
	   
	    $('div.container').hover(
	   function () { $(this).css('background-color', '#ffefbb').css('border', '1px solid #e5c365') },
	   function () { $(this).css('background-color', '#fff').css('border', '1px solid #fff') }
	  );


	    $('div.reader').hover(function () {
	        $(this).css('border', '4px solid #ffe8a6');
	        var imgTitle = $(this).children(':first-child');

	        switch (imgTitle.attr("src")) {
	            case "img/review.jpg":
	                imgTitle.attr({ src: "img/review_highlighted.jpg" })
	                break;
	            case "img/tutorial.jpg":
	                imgTitle.attr({ src: "img/tutorial_highlighted.jpg" })
	                break;
	            case "img/post.jpg":
	                imgTitle.attr({ src: "img/post_highlighted.jpg" })
	                break;
	            case "img/article.jpg":
	                imgTitle.attr({ src: "img/article_highlighted.jpg" })
	                break;
	        }

	    },
	   function () {
	       $(this).css('border', '4px solid #ced4df');
	       var imgTitle = $(this).children(':first-child');

	       switch (imgTitle.attr("src")) {
	           case "img/review_highlighted.jpg":
	               imgTitle.attr({ src: "img/review.jpg" })
	               break;
	           case "img/tutorial_highlighted.jpg":
	               imgTitle.attr({ src: "img/tutorial.jpg" })
	               break;
	           case "img/post_highlighted.jpg":
	               imgTitle.attr({ src: "img/post.jpg" })
	               break;
	           case "img/article_highlighted.jpg":
	               imgTitle.attr({ src: "img/article.jpg" })
	               break;
	       }
	   }
	  );

	   $('div.twitter-followers').twitterFriends({
	       username: 'asprobot'
	   });

	   $(function () {
	       switch (document.title) {
	           case "ASP.NET Robot - Contact":
	               $('.menu-bar li').removeClass("current");
	               $('.menu-bar li:eq(1)').addClass("current");
	               break;
	           case "About the developer of ASP.NET Robot dot com website":
	               $('.menu-bar li').removeClass("current");
	               $('.menu-bar li:eq(2)').addClass("current");
	               break;
	       }
	   });

	});
 
 
 
  function GetWidth() {
	  var width = 0;
	  if (self.innerHeight) {
		  width = self.innerWidth;
	  }
	  else if (document.documentElement && document.documentElement.clientHeight) {
		  width = document.documentElement.clientWidth;
	  }
	  else if (document.body) {
		  width = document.body.clientWidth;
	  }

	  return width;
  }
  
  function SetWidth() {	
	  if ($.browser.msie && $.browser.version.substr(0,1)<7) {
		  $("#socialWrapper").hide();
		  $("#setsocial").show();
	  }
	  else
	  {
		  var width = GetWidth();
		  if (width >= 1220)
		  { 
			  $("#socialWrapper").css(
				  "left", (((width - 950) / 2) - 120) + "px"
			  );
			  $("#socialWrapper").show();
			  $("#setsocial").hide();
		  }
		  else
		  {
			  $("#socialWrapper").hide();
			  $("#setsocial").show();
		  }
	  }
  }
  
	$(function() {
		$("#menu-bar").lavaLamp({
			fx: "backout",
			speed: 700,
			click: function(event, menuItem) {
				return true;
			}
		});
});



function BookmarkThis(name) {
    switch (name) {
        case 'Twitter':
            window.location = "http://twitter.com/home?status=" + window.location.href;
            break;
        case 'Facebook':
            window.location = "http://www.facebook.com/sharer.php?u=" + window.location.href + "&t=" + document.title;
            break;
        case 'MySpace':
            window.location = "http://www.myspace.com/Modules/PostTo/Pages/?u=" + window.location.href + "&t=" + document.title;
            break;
        case 'delicious':
            window.location = "http://del.icio.us/post?url=" + window.location.href + "&title=" + document.title;
            break;
        case 'Digg':
            window.location = "http://digg.com/submit?phase=2&amp;url=" + window.location.href + "&title=" + document.title;
            break;
        case 'StumbleUpon':
            window.location = "http://www.stumbleupon.com/submit?url=" + window.location.href + "&title=" + document.title;
            break;
        case 'Google':
            window.location = "http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=" + window.location.href + "&title=" + document.title;
            break;
        case 'LinkedIn':
            window.location = "http://www.linkedin.com/shareArticle?mini=true&amp;url=" + window.location.href + "&title=" + document.title + "&ro=false&amp;summary=&amp;source=";
            break;
        case 'reddit':
            window.location = "http://reddit.com/submit?url=" + window.location.href + "&title=" + document.title;
            break;
        case 'Buzz':
            window.location = "http://www.google.com/buzz/post?message=" + document.title + "&url=" + window.location.href;
            break;
        case 'Technorati':
            window.location = "http://www.technorati.com/faves?add=" + window.location.href;
            break;
        case 'Netvibes':
            window.location = "http://www.addtoany.com/add_to/netvibes_share?linkurl=" + window.location.href + "&linkname=" + document.title;
            break;
        case 'FriendFeed':
            window.location = "http://friendfeed.com/?title=" + document.title + "&url=" + window.location.href;
            break;
    }

}
