jQuery(document).ready(function($) {
	$('.handle').hover(function(){
		if ($(this).parent().hasClass('open')) {
			$(this).css({'background-position':'-21px -22px'});
		} else {
			$(this).css({'background-position':'-21px 0'});
		};
	},
	function(){
		if ($(this).parent().hasClass('open')) {
			$(this).css({'background-position':'0 -22px'});
		} else {
			$(this).css({'background-position':'0 0'});
		};
	});
	
	$('.tweet-container').fadeIn();

  $('.container-right').tabSlideOut({
      tabHandle: '.handle',
      pathToTabImage: '/wp-content/themes/rumble/images/sidebar-button.png',
      imageHeight: '22px',
      imageWidth: '21px',
      tabLocation: 'right',
      speed: 300,
      action: 'click',
      topPos: '0',
      fixedPosition: false
  });

	// contact form watermarks
	$("#your-name").watermark({
	    watermarkedClass: "watermarked",
	    watermarkedText: "name..."
	});
	$("#your-email").watermark({
	    watermarkedClass: "watermarked",
	    watermarkedText: "email..."
	});
	$("#your-message").watermark({
	    watermarkedClass: "watermarked",
	    watermarkedText: "message..."
	});

	// fancybox
	$("a.work-cloudstream").fancybox({ 
		'padding': 0,
		'zoomOpacity' : true,
		'zoomSpeedIn' : 500,
		'zoomSpeedOut' : 500,
		'overlayOpacity' : 0.4
	});
});
