 
$(document).ready(function(){
 
/* hide scroll bars if view port is above 800px */	
var height = $(window).height();
if( height > 800 ){ $('body').css('overflow', 'hidden'); 
}

/* menu animations */
$('a#m1').mouseenter(function(event) { $('a#m1 img').animate({  opacity: "0.7" } , 400 );  }); 
$('a#m1').mouseleave(function(event) { $('a#m1 img').animate({  opacity: "1.0" } , 400 );  });   
$('a#m2').mouseenter(function(event) { $('a#m2 img').animate({  opacity: "0.7" } , 400 );  }); 
$('a#m2').mouseleave(function(event) { $('a#m2 img').animate({  opacity: "1.0" } , 400 );  });   
$('a#m3').mouseenter(function(event) { $('a#m3 img').animate({  opacity: "0.7" } , 400 );  }); 
$('a#m3').mouseleave(function(event) { $('a#m3 img').animate({  opacity: "1.0" } , 400 );  });   
$('a#m4').mouseenter(function(event) { $('a#m4 img').animate({  opacity: "0.7" } , 400 );  }); 
$('a#m4').mouseleave(function(event) { $('a#m4 img').animate({  opacity: "1.0" } , 400 );  });   
$('a#m5').mouseenter(function(event) { $('a#m5 img').animate({  opacity: "0.7" } , 400 );  }); 
$('a#m5').mouseleave(function(event) { $('a#m5 img').animate({  opacity: "1.0" } , 400 );  });   
$('a#m6').mouseenter(function(event) { $('a#m6 img').animate({  opacity: "0.7" } , 400 );  }); 
$('a#m6').mouseleave(function(event) { $('a#m6 img').animate({  opacity: "1.0" } , 400 );  });   
$('a#m7').mouseenter(function(event) { $('a#m7 img').animate({  opacity: "0.7" } , 400 );  }); 
$('a#m7').mouseleave(function(event) { $('a#m7 img').animate({  opacity: "1.0" } , 400 );  });   
	

/* on page load */
$('.content_block').css('opacity', "0.1" );
$('.content_block').animate({  opacity: "1.0" } , 1200 ); 

/* initial */
$('#youtube2').css('display', 'none' );
$('#youtube3').css('display', 'none' );
$('#vid2_y').remove();
$('#vid3_y').remove();

/* home page - youtube */ 
$('a#you1, a#you1b').click(function(event) {  
	  $('#vid2_y').remove();
	  $('#vid3_y').remove();
	  $('#vid1').append('<object id="vid1_y" width="320" height="265"><param name="movie" value="http://www.youtube.com/v/C4paCPtVkio&amp;hl=en_GB&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/C4paCPtVkio&amp;hl=en_GB&amp;fs=1&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>	');
	  
	  $('#youtube1').css('display', 'block' );
	  $('#youtube2').css('display', 'none' );
	  $('#youtube3').css('display', 'none' );
	  event.preventDefault();
	}); 
 
$('a#you2, a#you2b').click(function(event) {  
	
  $('#vid1_y').remove();
  $('#vid3_y').remove();
  $('#vid2').append('<object id="vid2_y" width="320" height="265"><param name="movie" value="http://www.youtube.com/v/5P9vLrShzFA&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/5P9vLrShzFA&amp;hl=en_US&amp;fs=1&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object> ');
 
  $('#youtube1').css('display', 'none' );
  $('#youtube2').css('display', 'block' );
  $('#youtube3').css('display', 'none' );
  event.preventDefault();
}); 
$('a#you3, a#you3b').click(function(event) {  
	  $('#vid2_y').remove();
	  $('#vid1_y').remove();
	  $('#vid3').append(' <object id="vid3_y" width="320" height="265"><param name="movie" value="http://www.youtube.com/v/XR14dmbYjOc&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XR14dmbYjOc&amp;hl=en_US&amp;fs=1&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>	');	

	  $('#youtube1').css('display', 'none' );
	  $('#youtube2').css('display', 'none' );
	  $('#youtube3').css('display', 'block' );
	  event.preventDefault();
	}); 

/* NEW MEMBERS -  UPDATES THE TOTAL FOR THE FORM */
$('input#joining_fee2').click(function() {
 $('input#total').val("$290.00"); 
});
$('input#joining_fee3').click(function() {
 $('input#total').val("$290.00"); 
});
$('input#joining_fee4').click(function() {
 $('input#total').val("$290.00"); 
}); /* below not used */
$('input#joining_fee5').click(function() {
 $('input#total').val("$290.00"); 
});
$('input#joining_fee6').click(function() {
 $('input#total').val("$290"); 
});		
$('input#joining_fee7').click(function() {
	 $('input#total').val("$290.00"); 
	});		
$('input#joining_fee8b').click(function() {
	 $('input#total').val("$290.00"); 
	});
 
$('.uniformHide').css("display", "none");	

$('input#new_uniform').change(function() {
	$('.uniformHide').css("display", "table-row");	
 	$('#p8, #p9, #p10, #p11, #p12, #p13, #p14, #extra_nairn_6789, #extra_nairn_101112').text('+ $80');
 	$('.p8b').text('TOTAL = $280.00');
 	$('.p9b').text('TOTAL = $280.00');
 	$('.p10b').text('TOTAL = $280.00');

 	$('.p11b').text('TOTAL = $280.00');
 	$('.p12b').text('TOTAL = $280.00');
 	$('.p13b').text('TOTAL = $280.00');
        $('.nairn1').text('TOTAL = $280.00');
        $('.nairn2').text('TOTAL = $280.00');


 	$('.p14b').text('TOTAL = $280.00');

});

$('input#new_uniform_no').change(function() {
	$('.uniformHide').css("display", "none");	
 	$('#p8, #p9, #p10, #p11, #p12, #p13, #p14').text('');
 	$('.p8b').text('TOTAL = $200.00');
 	$('.p9b').text('TOTAL = $200.00');
 	$('.p10b').text('TOTAL = $200.00');
 	$('.p11b').text('TOTAL = $200.00');
 	$('.p12b').text('TOTAL = $200.00');
 	$('.p13b').text('TOTAL = $200.00');
 	$('.p14b').text('TOTAL = $200.00');

});
/*  EXISTING MEMBERS -  THE TOTAL FOR THE EMAIL FORM */
$('input#joining_fee8').click(function() {
	 $('input#total').val("$200.00"); 
	});
	$('input#joining_fee9').click(function() {
	 $('input#total').val("$200.00"); 
	});
	$('input#joining_fee10').click(function() {
	 $('input#total').val("$200.00"); 
	});  /* below not used */


/* About Us */
$('#memberLinks').css('display', 'block' );


var collapsed = 0;

$('a#mLink4').click(function() { 
	$('#membersScrollWindow').scrollTop(0);
	$('#membersScrollWindow').css('overflow-y', 'hidden' ); 
	if( collapsed==1)
	{
		  $('#member1, #member2, #member3, #member4').animate({ height: '260px' }, 800, function() { });	
	}
	  $('#member1, #member2, #member3').animate({
		  height: '0px' 
		  }, 800, function() {
			    // Animation complete.	 
			  $('.member').css('margin-bottom', '0px' ); 		 	
 
			  
		 
			  collapsed = 1;
	  });	 
 
}); //END fucntion

$('a#mLink3').click(function() { 
	$('#membersScrollWindow').scrollTop(0);	
	$('#membersScrollWindow').css('overflow-y', 'hidden' ); 
	 
	if( collapsed==1)
	{
		  $('#member1, #member2, #member3, #member4').animate({ height: '260px' }, 800, function() {   });	
	}
	
	  $('#member1, #member2, #member4').animate({
		  height: '0px' 
		  }, 800, function() {
			    // Animation complete.	 
			  $('.member').css('margin-bottom', '0px' ); 
 	
			  		  
			  collapsed = 1;
	  });	 

}); //END fucntion

$('a#mLink2').click(function() {
	$('#membersScrollWindow').scrollTop(0);	
	$('#membersScrollWindow').css('overflow-y', 'hidden' ); 
	 
	if( collapsed==1)
	{
		  $('#member1, #member2, #member3, #member4').animate({ height: '260px' }, 800, function() {   });	
	}
	
	  $('#member1, #member3, #member4').animate({
		  height: '0px' 
		  }, 800, function() {
			    // Animation complete.	 
			  $('.member').css('margin-bottom', '0px' ); 
 
			  		  
			  collapsed = 1;
	  });	 

}); //END fucntion

$('a#mLink1').click(function() {
	$('#membersScrollWindow').scrollTop(0);	
	$('#membersScrollWindow').css('overflow-y', 'hidden' ); 
	 
	if( collapsed==1)
	{
		  $('#member1, #member2, #member3, #member4').animate({ height: '260px' }, 800, function() {   });	
	}
	
	  $('#member2, #member3, #member4').animate({
		  height: '0px' 
		  }, 800, function() {
			    // Animation complete.	 
			  $('.member').css('margin-bottom', '0px' );
 
			  
			  collapsed = 1;
	  });	 

}); //END fucntion
});

 


