/* JavaScript File Pixelant											*/
/* functions.js 													*/
/* Modified June 21th 2010								 			*/
/* http://www.pixelant.se/	 									    */

$(document).ready(function() { 
						   
// ---------------------------------- target blank - checks for anchor tags that should be open in new window ------------------------------------------

	$('a[rel=external]').attr({'target': '_blank'});
	$('a[rel=nofollow external]').attr({'target': '_blank'});

// ------------------------------------ css - controls the first child and last child for IE browsers --------------------------------------------------
	
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {
		
		$('.pagemenu li:last-child').css({'background': 'none'});
		$('.pagemenu li div.dropdown').css({'background-color': '#f66e11'});
		$('.languages li ul.dropdown').css({'background-color': '#f66e11'});
		$('.intranet .pagemenu li div.dropdown').css({'background-color': '#5eb451'});
		$('.intranet .languages li ul.dropdown').css({'background-color': '#5eb451'});
	}

// ------------------------------------------ css - adds the even and odd classes to all tables  -------------------------------------------------------

	$('table tr:nth-child(even)').addClass('even');
	$('table tr:nth-child(odd)').addClass('odd');

// --------------------------------------------------- css - controls the dropdown menu ----------------------------------------------------------------
	
	$('.pagemenu li').hover( function () { $(this).find('div.dropdown').show(); $(this).find('div.dropdown').parent().addClass('hover'); }, function () { $(this).find('div.dropdown').hide(); $(this).find('div.dropdown').parent().removeClass('hover'); });
	$('.languages li').hover( function () { $(this).addClass('hover'); }, function () { $(this).removeClass('hover'); });


	$('.figures .header a').toggle(
	  function () {
		$(this).parent().siblings('.data').children().css({'display':'none'});
	  },
	  function () {
		$(this).parent().siblings('.data').children().css({'display':'block'});
	  }
	);

// -----------------------------------------------------------------------------------------------------------------------------------------------------

});
