$(document).ready(function() {
	 // variable init
		var projectenurl = '/img/crowd_project_unsel_over.gif';
		var makersurl = '/img/crowd_makers_unsel_over.gif';
		var publicatiesurl = '/img/crowd_publicaties_unsel_over.gif';

	$(".crowdbutton").hover(function() {
		this.src = this.src.replace("_unsel","_sel");
			}, function() {
		if ($(this).hasClass('noclick')) {
		
			this.src = this.src.replace("_sel","_unsel");
		}
	});
	
	$("img#project_button").click(
		function () {
		$(".crowdbutton").addClass('noclick');
		$(this).removeClass('noclick');
		this.src = this.src.replace("_unsel","_sel");
		$("#crowd_project_tekst").show();	
		$("#crowd_makers_tekst").hide();
		$("#crowd_publicaties_tekst").hide();
		
		$('img#publicaties_button').attr('src', publicatiesurl);
		$('img#makers_button').attr('src', makersurl);	
		}
	);
	
	$("img#makers_button").click(
		function () {
		$(".crowdbutton").addClass('noclick');
		$(this).removeClass('noclick');
		
		//$("img#project_button").src = $("img#project_button").src.replace("_sel","_unsel");
	//	if ($(".crowdbutton").hasClass('noclick')) {
	//		this.src = this.src.replace("_sel","_unsel");
		//}	
		
	
		$('img#project_button').attr('src', projectenurl);
		$('img#publicaties_button').attr('src', publicatiesurl);

		this.src = this.src.replace("_unsel","_sel");
		$("#crowd_project_tekst").hide();	
		$("#crowd_makers_tekst").show();
		$("#crowd_publicaties_tekst").hide();
		}
	);
	
	$("img#publicaties_button").click(
		function () {
		$(".crowdbutton").addClass('noclick');
		$(this).removeClass('noclick');
		this.src = this.src.replace("_unsel","_sel");
		$("#crowd_project_tekst").hide();	
		$("#crowd_makers_tekst").hide();
		$("#crowd_publicaties_tekst").show();
		$('img#project_button').attr('src', projectenurl);
		$('img#makers_button').attr('src', makersurl);	
		}
	);
	
	/*$(".crowdbutton").click(function() {
		var newSrc = $(".crowdbutton").attr("src").replace("_sel", "_unsel");
		$(".crowdbutton").attr("src", newSrc);  
		this.src = this.src.replace("_unsel","_sel");		
       
		$(".crowdbutton").removeClass("klik");
		$(this).addClass("klik");
	}); 
	
	/*
$("img#project_button").click(
 		function () {
 		menuselect = 'updates';
 		this.src = this.src.replace("_unsel","_sel");
 		$("img#makers_button").src = $("img#makers_button").src.replace("_sel","_unsel");
 		$("img#publicaties_button").src = $("img#publicaties_button").src.replace("_sel","_unsel");
 			//changeMenuStatus();
			//changeMenu(this);
			//loadPage(menuselect);	
			//refreshFonts();
			}
	);

	$("img#project_button").hover(
 		 function () {
 		// alert(menuselect);
 		 if (menuselect != 'updates') {
			this.src = this.src.replace("_unsel","_sel");
		 }
  	}, 
 		 function () {
 		 if (menuselect != 'updates') {
			this.src = this.src.replace("_sel","_unsel");
		 }
  		}
	);
	
	$("img#makers_button").click(
 		function () {
 		menuselect = 'makers';
 		this.src = this.src.replace("_unsel","_sel");
 			//changeMenuStatus();
			//changeMenu(this);
			//loadPage(menuselect);	
			//refreshFonts();
			}
	);

	$("img#makers_button").hover(
 		 function () {
 		 //alert(menuselect);
 		 if (menuselect != 'makers') {
			this.src = this.src.replace("_unsel","_sel");
		 }
  	}, 
 		 function () {
 		 if (menuselect != 'makers') {
			this.src = this.src.replace("_sel","_unsel");
		 }
  		}
	);
	
	$("img#publicaties_button").click(
 		function () {
 		menuselect = 'publicaties';
 		this.src = this.src.replace("_unsel","_sel");
 			//changeMenuStatus();
			//changeMenu(this);
			//loadPage(menuselect);	
			//refreshFonts();
			}
	);

	$("img#publicaties_button").hover(
 		 function () {
 		// alert(menuselect);
 		 if (menuselect != 'publicaties') {
			this.src = this.src.replace("_unsel","_sel");
		 }
  	}, 
 		 function () {
 		 if (menuselect != 'publicaties') {
			this.src = this.src.replace("_sel","_unsel");
		 }
  		}
	);
*/
	
	
});



