		/*
			Gordonstoun International Summer School
			---------------------------------------
			Author:				Sam Hampton-Smith
			Website:			www.hampton-smith.com
			Date:				28th October 2010
			---------------------------------------
		*/


			jQuery(document).ready(function(){ 					   
				var viewportwidth = 771;
				var viewportheight = 400;
									   
				jQuery("#parallax").mousemove(function(e) {
					newX = (e.pageX- jQuery("#parallax").offset().left);
					newY = (e.pageY- jQuery("#parallax").offset().top);
					jQuery(".moveme").each(function(){
						rangeX = ($(this).width()-viewportwidth);	
						thisX = 0-(rangeX*(newX/viewportwidth));
						rangeY = ($(this).height()-viewportheight);						   						
						thisY = 0-(rangeY*(newY/viewportheight));
						jQuery(this).css({left:thisX, top: thisY});
					});
				});
				
				var t;
				
				jQuery("#programmeslider").mouseover(function(){
					clearTimeout(t);
					jQuery(this).stop().animate({right:0},500);					
				});
				jQuery("#programmeslider").mouseout(function(){
					t = setTimeout(function(){jQuery("#programmeslider").animate({right:-222},500);},1000);
				});
				
				s = setInterval(function(){
					paraheight = jQuery("#coursedates p:first").height();
					jQuery("#coursedates p:first").animate({marginTop:0-paraheight},1000,function(){
						jQuery("#coursedates p:last").after(jQuery("#coursedates p:first"));
						jQuery("#coursedates p:last").css({marginTop:0});
					});
				},3000);
				
			});
