
$(document).ready( function() {
	
	$('#flash').flash(
		{ src: 'swf/homepage_flash.swf?id=893457987', width: 786, height: 210, wmode: 'transparent' }, 
		{ expressInstall: true }
	);	
	
	if (bLang) { tb_show("Country selector", "#TB_inline?height=200&width=450&inlineId=languagepopup", false); }

	$(".remember_lang").click( function() { 
		var href = $(this).attr("href");
		$.cookie('HomeUrl', href, {expires: 365 });
		console.log($.cookie('HomeUrl'));
		location.href=href;
		return false;
	});
	
	$("#CountrySelector").change( function() { location.href='/en/locations/?type=export'; });
	
	$("#panel2 ul li .accord_content:last").show();
	$("#panel2 ul li .accord_title:last").addClass("accord_title_on");
	
	
	var lasttab = 4;
	var currenttab;
	
	$("#panel2 ul li .accord_title").click(function() {
		
		currenttab = $(this).find("a").attr("rel");
		
		if(lasttab!=currenttab) {
			
			$("#panel2 ul li .accord_title").removeClass("accord_title_on");
			$(this).addClass("accord_title_on");
			
			$("#accord_tab" + lasttab + " div.accord_content").animate({width:0}, 100).hide("fast");
			
			$(this).parent().find(".accord_content").show().animate({width:255}, 100);			
			
			
			lasttab = currenttab;
		}
		
		
	});

});

