$(document).ready(function(){	

	$('#nav_global li').hover(function(){
		$(this).find('a:first').addClass('active');
	},
	function(){
		$(this).find('a:first').removeClass('active');
	});

	$("#nav_global").superfish({
		delay:0,
		speed:'fast',
		autoArrows:false,
		dropShadows:false
	});

	$("#language").superfish({
		delay:0,
		speed:'fast',
		autoArrows:false,
		dropShadows:false
	});

	$("#meetus_form select").change(function(){
		window.location = $(this).val();
	});

	/*
	$('ul#featured_employees .description').hide();
	$('ul#featured_employees li').click(function(){
		$(this).find('div.description:first').slideDown(400);
	},
	function(){
		$(this).find('div.description:first').slideUp(400);
	});
	*/

	$('ul#featured_employees .description').hide();
	$("#featured_employees li").click(function(){
		if($(this).is('.active')){
			$(this).removeClass('active');
			$(this).find('.description:first').slideUp(400);
			return false;
		}
		else{
			$(this).addClass('active');
			$(this).find('.description:first').slideDown(400);
			return false;
		}
	});

	$('#country_list .description').hide();
	$("#country_list li").click(function(){	
		if($(this).is('.active')){
			$(this).removeClass('active');
			$("#country_list li h2 a").removeClass('hide');
			$(this).find('div.description:first').slideToggle();
			return false;
		}
		else{
			$(this).addClass('active');
			$("#country_list li h2 a").addClass('hide');
			$(this).find('div.description:first').slideToggle();
			return false;
		}
	});

	$('#worldwide_flash').flash({
		src: '/interface/flash/map.swf',
		width: 960,
		height: 500,
		wmode: "opaque",
		version: '10'
	});

	$('.kronology #timeline_flash').flash({
		src: '/interface/flash/kronology.swf',
		width: 960,
		height: 266,
		wmode: "opaque"
	});

	$('.investing-in-the-environment #timeline_flash').flash({
		src: '/interface/flash/environment.swf',
		width: 960,
		height: 266,
		wmode: "opaque"
	});

	$('.our-journey-to-low-emission-products #timeline_flash').flash({
		src: '/interface/flash/lowemission.swf',
		width: 960,
		height: 266,
		wmode: "opaque"
	});
	
	// external urls
    $('a').click(function(){
	    if(this.href.match(/^http/i) && !this.href.match(location.host)){
		    window.open(this.href,'_');
		    return false;
	    }
	});
	
});
