 $(function () {
		var mouseX = 0, mouseY = 0;
$(document).mousemove(function(e){
   mouseX = e.pageX;
   mouseY = e.pageY; 
});

// cache the selector
var follower = $("#follower");
var xp = 0, yp = 0;
var loop = setInterval(function(){
    // change 12 to alter damping, higher is slower
    xp += (mouseX - xp) / 50;
    follower.css({left:xp, top:46});
}, 0);
    });    
			 $(document).ready(function() {
			 	var x = '';
				$('.open').live('click',function() {
					 x = $('#hidden').val();
					
					if(x == 'close') {
						$('#form').slideUp(1000);
					  $('#login').animate({
					  	top: '45px',height:'34px'
					  }, 1000); 


						$('#hidden').val('open');
					}
					else {
						$('#form').slideDown(1000);
					  $('#login').animate({
					  	top: '40px',
						height:'210px'
					  }, 1000); 

					  
						$('#hidden').val('close');
					}
				});
			});
			 $(document).ready(function() {
	// Save  the jQuery objects for later use.
	var outer	= $("#preview_outer");
	var arrow	= $("#arrow");
	var thumbs	= $("#thumbs span");
 
	var preview_pos;
	var preview_els	= $("#preview_inner div");
	var image_width	= preview_els.eq(0).width(); // Get width of imaages
 
	// Hook up the click event
	thumbs.click(function() {
		// Get position of current image
		preview_pos = preview_els.eq( thumbs.index( this) ).position();
 
		// Animate them!
		outer.stop().animate( {'scrollLeft' : preview_pos.left},	500 );
		arrow.stop().animate( {'left' : $(this).position().left },	500 );
	});
 
	// Reset positions on load
	//arrow.css( {'left' : thumbs.eq(0).position().left } ).show();
	outer.animate( {'scrollLeft' : 0}, 0 );
 
	// Set initial width
	$("#preview_inner").css('width', preview_els.length * image_width);
});
