$(document).ready(function(){

$.get("/index.php?component=Twitter", function(data){
  $("#tweettext").hide().html('<a href="http://twitter.com/judithhhhh" target="_blank"><img src="/templates/13-temp/v2/images/twitter-icon.png" id="twittericonsmall" alt="Twitter Icon" /></a> '+data).slideDown().fadeIn();
  $("#tweettext img").hover(
			      function () {
			        	$(this).attr("src", '/templates/13-temp/v2/images/twitter-icon-on.png');	        			        
			      }, 
			      function () {
			        	$(this).attr("src", '/templates/13-temp/v2/images/twitter-icon.png');
			      }
			    );
});
slideImage();
$('a[rel*=facebox]').facebox();


function slideImage()
{
	yScroll = document.body.scrollTop || document.documentElement.scrollTop;
	height = getHeight();

	menuend = 394;
	imageheight = imageWidth = $("#photo").attr("height");
	if ((imageheight+menuend) < (yScroll+height))
	{
		diff = (yScroll+height)-(imageheight+menuend)-3;
		$("#photo").css("margin-top", diff);
	}
	else
		$("#photo").css("margin-top", 0);
}

$(document).pngFix(); 


		 		$(window).scroll(function() 
		 		{		
					slideImage();
		 		});
		 		
		 		$(".button img").hover(
			      function () {
			        var cur = $(this).attr("src");
			        var to = $(this).attr("rel");
			        $(this).attr("src", to);
			        $(this).attr("rel", cur);
			        			        
			      }, 
			      function () {
			        var cur = $(this).attr("src");
			        var to = $(this).attr("rel");
			        $(this).attr("src", to);
			        $(this).attr("rel", cur);
			      }
			    );

				$("#twitterlink").click(function()
				{
					window.open ("http://twitter.com/judithhhhh"); 
				});
				
				$("#tweettext img").hover(
			      function () {
			        	$(this).attr("src", '/templates/13-temp/v2/images/twitter-icon-on.png');	        			        
			      }, 
			      function () {
			        	$(this).attr("src", '/templates/13-temp/v2/images/twitter-icon.png');
			      }
			    );
				
		 		$("#twitterlink").hover(
			      function () {
			        	$("#twitter").css("background", 'URL("/templates/13-temp/v2/images/twitter_balk.png")');	        			        
			      }, 
			      function () {
			        	$("#twitter").css("background", 'URL("/templates/13-temp/v2/images/twitter_balk2.png")');
			      }
			    );
			});
			function getHeight() {
			  var myWidth = 0, myHeight = 0;
			  if( typeof( window.innerWidth ) == 'number' ) {
			    //Non-IE
			    myWidth = window.innerWidth;
			    myHeight = window.innerHeight;
			  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			    //IE 6+ in 'standards compliant mode'
			    myWidth = document.documentElement.clientWidth;
			    myHeight = document.documentElement.clientHeight;
			  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			    //IE 4 compatible
			    myWidth = document.body.clientWidth;
			    myHeight = document.body.clientHeight;
			  }
			  return myHeight;
			}
			
jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
$.preloadImages("/templates/13-temp/v2/images/twitter_balk.png", "/templates/13-temp/v2/images/twitter_balk2.png", "/templates/13-temp/v2/images/twitter-icon.png", "/templates/13-temp/v2/images/twitter-icon-on.png");