// JavaScript Document
$(function() {

	$('#kt_login1').click(function(){
		//alert('x');
		$('#loginForm').submit();
	});


	

	var t1 = $("#MenuBar1 li.active img");
	t1.attr('src',t1.attr('src').replace(/([^.]*)\.(.*)/, "$1-over.$2"));
	$("#MenuBar1 li img").removeClass('active');
	t1.addClass('active');


	$("#MenuBar1 li img").mouseover(
		function(){ // Change the input image's source when we "roll on"
			var t = $(this);
			if (!t.hasClass('active')){
				t.attr('src',t.attr('src').replace(/([^.]*)\.(.*)/, "$1-over.$2"));
			}
		}		
	);
	
	$("#MenuBar1 li img").mouseout(
		function(){ 
			var t= $(this);
			if (!t.hasClass('active')){
				t.attr('src',t.attr('src').replace('-over',''));
			}
		}		
	);	

	$("#who-what-how .image_o").hide();

	$("#who-what-how .image_h").mouseover(
		function(){ // Change the input image's source when we "roll on"
			var t = $(this);
			var id = '#'+t.attr('id');
			var id_o = '#'+t.attr('id')+'_o';
			//alert (id_o);
			$(id_o).show();
			$(id_o).css('z-index','1000');
		}		
	);
	
	$("#who-what-how .image_h").mouseout(
		function(){ // Change the input image's source when we "roll on"
			var t = $(this);
			var id = '#'+t.attr('id')+'_o';
			$(id).hide();
		}		
	);	


//	alert ($("#MenuBar1 li.active img").attr('src'));
																					
	$('#bul_wrapper div.hr2_login_item').hide();

	$('.download_rep').click(function(){
						
		var index 			= $(this).attr('id');
		//alert(index);
		var el = '#bul_wrapper #login' + index;
		//alert(el);
		$(el).show();


		var el1 = '#bul_wrapper #knop' + index;
		$(el1).hide();
	});


	$(".deelnemer").click(function() {
		$('.deelnemer').removeClass('active');
		//$('.medewerker_uitklap').css('z-index',-1);
		//alert(index);
		var index 			= $(this).attr('id');
		$('#' + index).addClass('active');
	});


	$('.medewerker_uitklap').hide();

	$("div.medewerker_wrapper").click(function() {
		//$('.medewerker_uitklap').css('z-index',-1);
		var index 			= $(this).attr('id');
		
		var isHidden		= 0;
		if( $('#medewerker_uitklap_' + index).is(':hidden') ) {
			isHidden = 1;
		}
		//alert(index);
		$('.medewerker_uitklap').hide("slow");
		if(isHidden == 1)
		{
			$('#medewerker_uitklap_' + index).toggle("slow");
		}
//		$('#medewerker_uitklap_' + index).css('z-index',1000);
		$("html, body").animate({ scrollTop:520 }, "slow");

		if ($('#medewerker_blok_' + index).hasClass('medewerker_blok_active')){
			$('#medewerker_blok_' + index).removeClass('medewerker_blok_active');
		}else{
			$('#medewerker_blok_' + index).addClass('medewerker_blok_active');
		}

		if ($('#medewerker_naam_' + index).hasClass('medewerker_naam_active')){
			$('#medewerker_naam_' + index).removeClass('medewerker_naam_active');
		}else{
			$('#medewerker_naam_' + index).addClass('medewerker_naam_active');
		}
	});


	$("div.medewerker_wrapper").mouseover(function() {
		//$('.medewerker_uitklap').css('z-index',-1);
		var index 			= $(this).attr('id');
		//alert(index);
		$(this).addClass('slow');
		//$('#medewerker_blok_' + index).removeClass('medewerker_blok');
		$('#medewerker_blok_' + index).addClass('medewerker_blok_hover');
		$('#med_naam_' + index).addClass('med_naam_hover');
  	});
	
	
	$("div.medewerker_wrapper").mouseout(function() {
		//$('.medewerker_uitklap').css('z-index',-1);
		var index 			= $(this).attr('id');
		//alert(index);
		$(this).addClass('slow');
		//$('#medewerker_blok_' + index).removeClass('medewerker_blok');
		$('#medewerker_blok_' + index).removeClass('medewerker_blok_hover');
		$('#med_naam_' + index).removeClass('med_naam_hover');
  	});	

	
	

	$('.lang').hide();
  	$('.kort').show();

  	$('.col-1').show();
	$('.col-2').hide();





	$("div.col-1").mouseover(function() {
		$('.col-1').show();
	 	$('.col-1').css('zIndex', 1);
	  	$('.col-2').hide();
		
		var index 			= $(this).attr('id');
		//alert(index);
		$('#col-2-' + index).toggle();

		$(this).toggle();
		$('#col-2-' + index).css('zIndex', 9999);
  	});

	$(".col-2").mouseout(function() {
		$(this).hide();
		var index 			= $(this).attr('id').replace('col-2-','#');
	  	//alert(index);
	  	$(index).show();
	});
	
	//	$("div.col-2").click(function() {
	//		
	//		var index 			= $(this).attr('id');
	//		//alert(index);
	//		$(this).toggle();
	//		$('#col-1-' + index).toggle();
	//  });	

	$("div.groep_naam a").click(function() {
		
		var index 			= $(this).attr('id');
		//alert(index);
		$('#kort_mod_mat_' + index).toggle('slow');
		$('#lang_mod_mat_' + index).toggle('slow');
		$("html, body").animate({ scrollTop:520 }, "slow");
  	});
	
	$("div.kop a").click(function() {
		
		var index 			= $(this).attr('id');
		//alert(index);
		$('#kort_' + index).toggle('slow');
		$('#lang_' + index).toggle('slow');
		$("html, body").animate({ scrollTop:520 }, "slow");
  	});
	
	

	$('.mod_docs').hide();
	$("div.mod_item a").click(function() {
		
		var index 			= $(this).attr('id');
		//alert(index);
		$('#list_' + index).toggle('slow');
		$("html, body").animate({ scrollTop:520 }, "slow");
  	});
	
	$('.deel_content').hide();
	$("ul.prog_deelnemers a.deelnemer").click(function() {
		
		var index 			= $(this).attr('id');
		
		var isHidden		= 0;
		if( $('#deel_' + index).is(':hidden') ) {
			isHidden = 1;
		}
		
		//alert(index);
		$('.deel_content').hide('slow');
		if(isHidden == 1)
		{
			$('#deel_' + index).toggle('slow');
		}		
		//alert(index);
				
		$("html, body").animate({ scrollTop:520 }, "slow");

  	});
	

  
});
