/*

GLOBE Web Portal Scripts
Created by Jason Soffe (Webmaster)
jason.soffe@fondation-merieux.org


*/

/* =gallery 
------------------------------------------------------------ */
function swapPhoto(photoSRC,theCaption) 
	{ 
	var displayedCaption = document.getElementById("caption");
	displayedCaption.firstChild.nodeValue = theCaption;
	document.images.imgPhoto.src = photoSRC; 
	} 
	
function toggleGlobeNews(id_news){
	jQuery("div#article_" + id_news).toggle("500");
}

jQuery(document).ready(function(){
	$("li.menu a").click(function() {
		if ($('ul#nav-hidden').attr('class') == 'show') {
		 	$('ul#nav-hidden').fadeOut('slow', function() {
		 		$('li.fr').slideDown('fast');
				$('li.en').slideDown('fast');
		    $('ul#nav').slideDown('fast');
		    $('ul#nav-hidden').removeClass('show');
		  });
		} else {
		  $('li.fr').slideUp('fast');
			$('li.en').slideUp('fast');
		 	$('ul#nav').slideUp('fast', function() {
		    $('ul#nav-hidden').fadeIn('slow').addClass('show');
		  });
		}
	});
	
	if ($("#main-nav").attr("class") == "-hide") {
		$('ul#nav-hidden').show().addClass('show');
		$('li.fr').hide();
		$('li.en').hide();
		$('ul#nav').hide();
	}
	
	$("li.menu_footer a").click(function() {
		if ($("div#footer").attr("id") != undefined) {
			$("div#footer").attr("id", "footer-hide");
		}
		else {
			$("div#footer-hide").attr("id", "footer");
		}
	});
	
	jQuery("div[id^='tool']").each(function(i){
		var id_select = jQuery(this).attr("id");
		jQuery("div#" + id_select + " table").hide();
		jQuery("div#" + id_select + " h3 a").click(function(e){
			if ((jQuery("div#" + id_select).attr("class")) == "tool") {
				jQuery("div#" + id_select + " table").fadeIn(500);
				jQuery("div#" + id_select).removeClass("tool").addClass("tool-select");
			} else {
				jQuery("div#" + id_select + " table").fadeOut(500);
				jQuery("div#" + id_select).removeClass("tool-select").addClass("tool");
			}
		});
	});
	
	jQuery("#quick-links-container").hide();
	jQuery("a.btn_ql").click(function(){
		jQuery("#quick-links-container").slideToggle();
		return false;
	});

	
	//jQuery("#publicationForm").hide();
	jQuery("a.searchToggle").click(function(){
		jQuery("#publicationForm").toggle("500");
	});

});

function calcIframeHeight() {
  var iframeHeight=document.getElementById('gabrielIframe').contentWindow.document.body.scrollHeight;
  document.getElementById('gabrielIframe').height=iframeHeight;
}
	
