function imageOverlay() {
    $("div.photo-position").hover(
        function() { $(this).find("div:last").fadeIn(400) },
        function() { $(this).find("div:last").fadeOut() }
    );
}

  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 SetIEWidth() {	
	  var width = GetWidth();
	  if (width > 950)
	  {
		  $("#ContentLeftPage").css({
			  width: (width - 950) / 2
		  });
		  
		  $("#ContentMain").css(
			  "margin-left", ((width - 950) / 2) + "px"
		  );
		  
		  $("#ContentMain").css(
			  "margin-right", ((width - 950) / 2) + "px"
		  );
		  
		  $("#RightEmpty").css({
			  width: (width - 950) / 2
	      });
	  }
	  else
	  {
		  $("#ContentLeftPage").css({
			  width: "0px"
		  });
		  
		  $("#RightEmpty").css({
			  width: "0px"
		  });
		  
		  $("#ContentMain").css(
			  "margin-left", "0px"
		  );
		  
		  $("#ContentMain").css(
			  "margin-right", "0px"
		  );
	  }
  }

  function SetIE7Width() {
      var width = GetWidth();
      if (width > 950) {
          $("#ContentLeftPage").css({
              width: (width - 950) / 2
          });

          $("#ContentMain").css(
			  "margin-left", ((width - 950) / 2) + "px"
		  );

          $("#ContentMain").css(
			  "margin-right", ((width - 950) / 2) + "px"
		  );

          $("#RightEmpty").css({
              width: (width - 950) / 2
          });

          $(".left-page").css(
			  "right", (831 - ((width - 950) / 2)) + "px"
		  );
      }
      else {
          $("#ContentLeftPage").css({
              width: "0px"
          });

          $("#RightEmpty").css({
              width: "0px"
          });

          $("#ContentMain").css(
			  "margin-left", "0px"
		  );

          $("#ContentMain").css(
			  "margin-right", "0px"
		  );
      }
  } 
  
  function SetNotIEWidth() {	
	  var width = GetWidth();
	  if (width > 950)
	  {
		  $("#ContentLeftPage").css({
			  width: (width - 950) / 2 - 8
		  });
		  
		  $("#ContentMain").css(
			  "margin-left", ((width - 950) / 2 - 8) + "px"
		  );
		  
		  $("#ContentMain").css(
			  "margin-right", ((width - 950) / 2 - 8) + "px"
		  );
		  
		  $("#RightEmpty").css({
			  width: (width - 950) / 2 - 8
		  });
	  }
	  else
	  {
		  $("#ContentLeftPage").css({
			  width: "0px"
		  });
		  
		  $("#RightEmpty").css({
			  width: "0px"
		  });
	  }
  }
  
  function color(btnid) {
        var picture = "img/social/color_" + btnid.substr(3) + ".jpg";
		$("#" + btnid).attr({ src: picture });
  }
	  
  function grayscale(btnid) {
	  	var picture = "img/social/black_" + btnid.substr(3) + ".jpg";
		$("#" + btnid).attr({ src: picture });
  }
  
  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 + "&amp;t=" + document.title;
              break;
          case 'MySpace':
              window.location = "http://www.myspace.com/Modules/PostTo/Pages/?u=" + window.location.href + "&amp;t=" + document.title;
              break;
          case 'delicious':
              window.location = "http://del.icio.us/post?url=" + window.location.href + "&amp;title=" + document.title;
              break;
          case 'Digg':
              window.location = "http://digg.com/submit?phase=2&amp;url=" + window.location.href + "&amp;title=" + document.title;
              break;
          case 'StumbleUpon':
              window.location = "http://www.stumbleupon.com/submit?url=" + window.location.href + "&amp;title=" + document.title;
              break;
          case 'reddit':
              window.location = "http://reddit.com/submit?url=" + window.location.href + "&amp;title=" + document.title;
              break;
          case 'technorati':
              window.location = "http://www.technorati.com/faves?add=" + window.location.href;
              break;
          case 'netvibes':
              window.location = "http://www.netvibes.com/share?url=" + window.location.href + "&amp;title=" + document.title;
              break;
      }
  }
