	$(document).ready(function(){
//		  $(".innermenuu")click(function(){
//			  $.ajax({ url: "etc/changeday.php", });
//     });
		
		//  $("#navbar").mouseenter(function(event){	 
		//	   $("#nextbattle").hide();   
		//		   $("#navbar").css("height", "55px");
		//		   $("#maincontent").css("margin-top", "50px");	   
		//		   $(".innermenu").show();			
		//   });
		//   $(".innermenu").hide();
		//   $("#extendednews").hide();
		//   $(".extendnews").click(function(){
		//	   $("#extendednews").fadeIn("slow");
		//   });
		//   $("#navbar").mouseleave(function(event){
		//	   $("#navbar").css("height", "30px");
		//	   $("#maincontent").css("margin-top", "0px");
		//	   $(".innermenu").hide();
		//	   $("#nextbattle").show();
		// });	
		$("#headercover").css({"display": "block"});
		var t = 1;
			$("#voornaam").click(function(){
			if(t == 1){
			  $("#studentstock").animate({"margin-left": "-5px"}, "slow");
			  }
			  t++;
			});
			$('#headercoverimg').hide();
			$('#headercoverimg').slideDown(2000);
			$("#volume").hide();
			$("#volume").slideDown('slow');
			$("#dropitlikeits2010").hide();
			$(".herefor").click(function() { 
				$(".herefor").slideUp('slow', function(){
				  $("#headercoverimg").hide("fast");
					$("#dropitlikeits2010").slideDown('slow');	
				});	
			});
			 $(".year").click(function () {
				var x = $(this).children().attr('src');
				$('#dropitlikeits2010').children().each(function() {
					var child = $(this);
					if(child.children().attr('src') != x){
						child.hide(1000);
					}
				});
				$('#dropitlikeits2010').append("<p style='padding:0px;margin:0px;'>You will now be redirected</p>");
				//window.location.replace(x);
			});
			$("#topnav").change(function(){ 
				$("#navform").submit();
					window.location.replace("?id="+$("#topnav :selected").val());
					
			});	
			//$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
			
			$("ul.topnav li ").click(function() { //When trigger is clicked...
				//Following events are applied to the subnav itself (moving subnav up and down)
				$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

				$(this).parent().hover(function() {
				}, function(){
					$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
				});

				//Following events are applied to the trigger (Hover events for the trigger)
				}).hover(function() {
					$(this).addClass("subhover"); //On hover over, add class "subhover"
				}, function(){	//On Hover Out
					$(this).removeClass("subhover"); //On hover out, remove class "subhover"
			});
			

			$("#cycletestimonial").cycle({ 
			   fx:      'scrollHorz', 
				prev:   '#prev1', 
				next:   '#next1', 
				timeout: 0
				
			});
		   $("#cyclegold").cycle({ 
				fx:     'scrollLeft',
				timeout: 4000
				    
			});
		   $("#cyclebronze").cycle({ 
			    fx:     'scrollDown', 
			    timeout: 2000
			})
			
		 
		 var count0 = 0;
		 var count1 = 0;
		 var count2 = 0;
		 var count3 = 0;
		 	/* This is basic - uses default settings */

				$("a.grouped_elements").fancybox({
				'transitionIn'	:	'elastic',
				'transitionOut'	:	'elastic',
				'speedIn'		:	600, 
				'speedOut'		:	200, 
				'overlayShow'	:	false
			});

			$("div.fotoz0").slideUp(2000, function(){});
			$("div.fotoz1").slideUp(2000, function(){});
			$("div.fotoz2").slideUp(2000, function(){});
			$("div.fotoz3").slideUp(2000, function(){});
			
			 $("div.whyaccount").hide();	
			 $("div.battlevoorwaarden").hide();	
			 $("a.battlecondition").click(function() {
				$("textarea.whyaccount").hide();
				  $("textarea.battlevoorwaarden").show();
			   });
			 $("a.whyaccount").click(function() {
				  $("textarea.battlevoorwaarden").hide();
		       	  $("textarea.whyaccount").show();    	  
		   });
		    $("h2.foto0").click(function() { 
				  $("div.fotoz0").slideToggle();
				if(count0 % 2 == 1)
				{ 
					$("h2.foto0").css("width", "400px");
					
					count0 = count0+1;

				}
				else
				{
					$("h2.foto0").css("width", "100%");
					$("h2.foto0").css("margin-left", "0px");	
					count0 = count0+1;
				}
		   });
		     $("h2.foto1").click(function() { 
				  $("div.fotoz1").slideToggle();
				if(count1 % 2 == 1)
				{ 
					$("h2.foto1").css("width", "400px");

					count1 = count1+1;

				}
				else
				{
					$("h2.foto1").css("width", "100%");

					count1 = count1+1;
				}
		   });
		       $("h2.foto2").click(function() { 
				  $("div.fotoz2").slideToggle();
				if(count2 % 2 == 1)
				{ 
					$("h2.foto2").css("width", "400px");

					count2 = count2+1;

				}
				else
				{
					$("h2.foto2").css("width", "100%");
					$("h2.foto2").css("margin-left", "0px");	
					count2 = count2+1;
				}
		   });
		       $("h2.foto3").click(function() { 
				  $("div.fotoz3").slideToggle();
				if(count3 % 2 == 1)
				{ 
					$("h2.foto3").css("width", "400px");
					count3= count3+1;

				}
				else
				{
					$("h2.foto3").css("width", "100%");
					$("h2.foto3").css("margin-left", "0px");	
					count3 = count3+1;
				}
		   });
		       $("#errorField").hide();
		       $(".popover").each(function(intIndex){
		   		$(this).attr('rel', 'info').fancybox({
		   			'padding'        : 0,
		   			'scrolling'        : false,
		   			'autoScale'        : false,
		   			'titleShow'        : true,
		   			'transitionIn'    : 'elastic',
		   			'transitionOut'    : 'elastic'
		   		});
		   	});
		   	$("#reknr").keypress(function (e) {
		   		if( e.which!=8 && e.which!=13 && e.which!=9 && e.which!=0 && (e.which<48 || e.which>90 )) {
		   			$("#errorField").oneTime(5000,function() { $("#errorField").hide(); });
		   			$("#errorField").stopTime().html("A valid bank account number consist of numbers only, if you are entering an IBAN number make sure you use Capital Letters").show();
		   			return false;
		   		}
		   	});

		   	$("#telefoonnummer").keypress(function (e) {
		   		if((  e.which!=127 && e.which!=8 && e.which!=0 && ( e.which < 32 || e.which > 64) )) {
		   			$("#errorField").oneTime(5000,function() { $("#errorField").hide(); });
		   			$("#errorField").stopTime().html("You are trying to enter a character which is not allowed in this field").show();
		   			return false;
		   		}
		   	});

		   //	$("#reknr").bind("change",function (e) {
		   //	if ($(this).val().length != 7 && $(this).val().length != 9) {
		   		//	$("#errorField").stopTime().html("Een Nederlands rekeningnummer betaat uit 7 of 9 tekens.").show();
		   		//	$("#errorField").oneTime(5000,function() { $("#errorField").hide(); });
		   		//} else {
		   		//	$("#errorField").stopTime().hide();
		   		//}
		  // 	});

		   	$("#wachtwoord").bind("change",function (e) {
		   		if ($(this).val().length <= 5) {
		   			$("#errorField").stopTime().html("Your password should be at leas 6 characters").show();
		   			$("#errorField").oneTime(5000,function() { $("#errorField").hide(); });
		   		} else {
		   			$("#errorField").stopTime().hide();
		   		}
		   	});


		   	$("#valid").bind("submit",function() {
		   		var error=0;
		   		var errorMsg;
		   		if ($("#voornaam").val() == "") {
		   			error=1;
		   			errorMsg="Please enter your first name";
		   		}
		   		else if ($("#achternaam").val() == "") {
		   			error=1;
		   			errorMsg="Please enter your last name";
		   		}  
		   		else if (!$("#geslacht1").is(':checked') && !$("#geslacht2").is(':checked') ){
		   			error=1;
		   			errorMsg="Please provide gender information";
		   		}
		   		else if ($("#telefoonnummer").val() == "") {
		   			error=1;
		   			errorMsg="Please provide a phone number";
		   		} 
		   		else if ($("#emailadres").val() == "")  {
		   			error=1;
		   			errorMsg="Please provide an e-mail adress";
		   		}
		   		else if ($("#emailadres").val().indexOf('@') == -1 )  {
		   			error=1;
		   			errorMsg="The e-mail adress you entered is invalid";
		   		}
		   		else if ($("#emailadres").val().indexOf('.') == -1 )  {
		   			error=1;
		   			errorMsg="The e-mail adress you entered is invalid";
		   		}
		   		else if ($("#gebruikersnaam").val() == "") {
		   			error=1;
		   			errorMsg="Please choose an username";
		   		} 
		   		else if ($("#wachtwoord").val() == "") {
		   			error=1;
		   			errorMsg="Please choose a password";
		   		}
		   		else if ($("#wachtwoord2").val() == "") {
		   			error=1;
		   			errorMsg="Please repeat your password";
		   		}
		   		else if ($("#wachtwoord2").val() != $("#wachtwoord").val()) {
		   			error=1;
		   			errorMsg="The provided passwords did not match";
		   		}
		   		else if (checkibancore(($("#reknr").val().replace(/\s/g,''))) == 0 ||  $("#reknr").val() == ""){
		   			error=1;
		   			errorMsg="Please enter valid bank account information";
					//$("#reknr").val().length != 7 && $("#reknr").val().length != 9) ||
		   		}
		   		else if ($("#plaatsbank").val() == "") {
		   			error=1;
		   			errorMsg="Please provide the city your bank is located at";
		   		} 
		   		else if ($("#tnv").val() == "") {
		   			error=1;
		   			errorMsg="Please provide the name under which your bank account is registered";
		   		} 
		   		else if ($("#check_3").is(':checked') == false) {
		   			error=1;
		   			errorMsg="Please agree to our terms";
		   		}
		   		if (error) {
		   			$("#errorField").stopTime().html(errorMsg).show();
		   			$("#errorField").oneTime(5000,function() { $("#errorField").hide(); });
		   			return false;
		   		}	
		   	});

		 });

