$(document).ready(function(){
	$('#navigation').position ({
		at: 'center',
		of: '#navigation-parent'
	});

	// shows the newsletter form on clicking the 'Inscription' link
	  $(".newsletter").click(function(e) {
	          e.preventDefault();
	          $("#newsletter").fadeIn('fast');
	          $(".newsletter").addClass("window-open");
	      });
	   $("#newsletter").mouseup(function(e) {
	       return false
	   });
	  
	  
	 // hides the newsletter form on clicking the 'Inscription' link
	 $(document).mouseup(function(e) {
	       if($(e.target).parent("a.newsletter").length==0) {
	           $(".newsletter").removeClass("window-open");
	           $("#newsletter").fadeOut('fast');
	    }
	    });
	 
	   $('#newsletter a.close').click(function() {
	  $('#newsletter').fadeOut('fast');
	  return false;
	   });


	//submit a portfolio
  $(".submit-a-portfolio").click(function(e) {
	          e.preventDefault();
	          $("#submit-a-portfolio").fadeIn('fast');
	          $(".submit-a-portfolio").addClass("window-open");
	      });
	   $("#submit-a-portfolio").mouseup(function(e) {
	       return false
	   });	  
	 $(document).mouseup(function(e) {
	       if($(e.target).parent("a.submit-a-portfolio").length==0) {
	           $(".submit-a-portfolio").removeClass("window-open");
	           $("#submit-a-portfolio").fadeOut('fast');
	    }
	    });
	 
	   $('#submit-a-portfolio a.close').click(function() {
	  $('#submit-a-portfolio').fadeOut('fast');
	  return false;
	   });


	   
	// shows the share-to form on clicking the 'Inscription' link
	 $(".shareto").click(function(e) {
	         e.preventDefault();
	         $("#shareto").fadeIn('fast');
	         $(".shareto").addClass("window-open");
	     });
	  $("#shareto").mouseup(function(e) {
	      return false
	  });
	   // hides the share-to form on clicking the 'Inscription' link
	  $(document).mouseup(function(e) {
	      if($(e.target).parent("a.shareto").length==0) {
	          $(".shareto").removeClass("window-open");
	          $("#shareto").fadeOut('fast');
	   }
	   });
	
	  $('#shareto a.close').click(function() {
	 $('#shareto').fadeOut('fast');
	 return false;
	  });
	//profil artist & event navigation
	$('#tabs-container div').hide();
	$('#tabs-container div:first').fadeIn('fast');
	$('#tabs dl dd:first').addClass('active');
	
	$('#tabs dl dd a').click(function(){
	$('#tabs dl dd').removeClass('active');
	$(this).parent().addClass('active');
	var currentTab = $(this).attr('href');
	$('#tabs-container div').hide();
	$(currentTab).fadeIn('fast');
	return false;
	});
	
	//archives navigation
	var selectedTabList = $('#archives-list li.selected-tab a');
	var selectedTab = $(selectedTabList).attr('href');
	$('#archives div').hide();
	$(selectedTab).fadeIn('fast');
	
	$('#archives-list li a').click(function(){
	$('#archives-list li').removeClass('selected-tab');
	$(this).parent().addClass('selected-tab');
	var selectedTab = $(this).attr('href');
	$('#archives div').hide();
	$(selectedTab).fadeIn('fast');
	return false;
	});
	
	//drop down artists menu
	/*$(".artist-dropdown").click(function(e) {
	        e.preventDefault();
	        $("#artist-menu").fadeIn('fast');
	        $(".artist-dropdown").addClass("menu-open");
	        $("#arrow").attr("src", "themes/g3p/images/arrow-up.png");
	    });
	
	    $("#artist-menu").mouseup(function() {
	        return false
	    });
	    $(document).mouseup(function(e) {
	        if($(e.target).parent("a.artist-dropdown").length==0) {
	            $(".artist-dropdown").removeClass("menu-open");
	            $("#artist-menu").fadeOut('fast');
	            if($("li.artists").hasClass("current-page")){
	            	$("#arrow").attr("src", "themes/g3p/images/arrow-down-light.png");
	            } else {
	            $("#arrow").attr("src", "themes/g3p/images/arrow-down.png");
	            }
	     }
	     $('#artist-menu a.close').click(function() {
	     $(".artist-dropdown").removeClass("menu-open");
	     if($("li.artists").hasClass("current-page")){
	     	$("#arrow").attr("src", "themes/g3p/images/arrow-down-light.png");
	     } else {
	     $("#arrow").attr("src", "themes/g3p/images/arrow-down.png");
	     }
	     $('#artist-menu').fadeOut('fast');
	     return false;
	      });
    });*/
    
   /* $(".artist-dropdown").hover(function(e) {
		e.preventDefault();
		$("#artist-menu").fadeIn('fast');
		$(".artist-dropdown").addClass("menu-open");
		$("#arrow").attr("src", "themes/g3p/images/arrow-up.png");
	}, function(e) {
		if($(e.target).parent("a.artist-dropdown").length==0) {
			$(".artist-dropdown").removeClass("menu-open");
			$("#artist-menu").fadeOut('fast');
			if($("li.artists").hasClass("current-page")){
				$("#arrow").attr("src", "themes/g3p/images/arrow-down-light.png");
			} else {
			$("#arrow").attr("src", "themes/g3p/images/arrow-down.png");
			}
		 }
		 $('#artist-menu a.close').click(function() {
			 $(".artist-dropdown").removeClass("menu-open");
			 if($("li.artists").hasClass("current-page")){
				$("#arrow").attr("src", "themes/g3p/images/arrow-down-light.png");
			 } else {
			 $("#arrow").attr("src", "themes/g3p/images/arrow-down.png");
			 }
			 $('#artist-menu').fadeOut('fast');
			 return false;
		});
    });*/
});


