function plusmoins(header,div) {
	if ($(header).style.backgroundImage == 'url(images/icon_plus.gif)')
	{
		$(header).style.backgroundImage = 'url(images/icon_moins.gif)';
		onOffDiv(div);
	}
	else
	{
		$(header).style.backgroundImage = 'url(images/icon_plus.gif)';
		onOffDiv(div);
	}
}

function contactpopup(person)
{
	if (person != null)
	{
		$('contact_subject').value = person;
	}
	
	if ($('clearsite').style.display == "none")
	{
		$('title').style.display = "none";
		$('title_clear').style.height = "68px";
		if (document.getElementById('president'))
		{
			$('president').style.display = "none";
		}
		if (document.getElementById('audio'))
		{
			$('audio').style.display = "none";
		}
		if (document.getElementById('annual_years'))
		{
			$('annual_years').style.display = "none";
		}
		if (document.getElementById('quarterly_year'))
		{
			$('quarterly_year').style.display = "none";
		}
		$('clearsite').style.display = "block";
		$('clearsite').style.width = document.documentElement.scrollWidth + "px";
		$('clearsite').style.height = document.documentElement.scrollHeight + "px";
		center('contact_popup', '510', '400');
		$('contact_popup').style.display = "block";
	}
	else
	{
		$('clearsite').style.display = "none";
		$('contact_popup').style.display = "none";
		$('title').style.display = "block";
		$('title_clear').style.height = "0px";
		if (document.getElementById('president'))
		{
			$('president').style.display = "block";
		}
		if (document.getElementById('audio'))
		{
			$('audio').style.display = "block";
		}
		if (document.getElementById('annual_years'))
		{
			$('annual_years').style.display = "block";
		}
		if (document.getElementById('quarterly_year'))
		{
			$('quarterly_year').style.display = "block";
		}
		$('clearsite').style.width = "0px";
		$('clearsite').style.height = "0px";
	}
}

function popupform()
{
	if ($('form_popup').style.display == "none")
	{
		$('title').style.display = "none";
		$('title_clear').style.height = "68px";
		if (document.getElementById('president'))
		{
			$('president').style.display = "none";
		}
		if (document.getElementById('audio'))
		{
			$('audio').style.display = "none";
		}
		$('clearsite').style.display = "block";
		$('clearsite').style.width = document.documentElement.scrollWidth + "px";
		$('clearsite').style.height = document.documentElement.scrollHeight + "px";
		center('form_popup', '450', '400');
		if (document.getElementById('annual_years'))
		{
			$('annual_years').style.display = "none";
		}
		if (document.getElementById('quarterly_year'))
		{
			$('quarterly_year').style.display = "none";
		}
		$('form_popup').style.display = "block";
	}
	else
	{
		$('clearsite').style.display = "none";
		$('form_popup').style.display = "none";
		$('title').style.display = "block";
		$('title_clear').style.height = "0px";
		if (document.getElementById('president'))
		{
			$('president').style.display = "block";
		}
		if (document.getElementById('audio'))
		{
			$('audio').style.display = "block";
		}
		$('clearsite').style.width = "0px";
		$('clearsite').style.height = "0px";
		if (document.getElementById('annual_years'))
		{
			$('annual_years').style.display = "block";
		}
		if (document.getElementById('quarterly_year'))
		{
			$('quarterly_year').style.display = "block";
		}
	}
}

function leavingpopup(url)
{
	if ($('clearsite').style.display == "none")
	{
		$('title').style.display = "none";
		$('title_clear').style.height = "68px";
		if (document.getElementById('audio'))
		{
			$('audio').style.display = "none";
		}
		$('clearsite').style.display = "block";
		$('clearsite').style.width = document.documentElement.scrollWidth + "px";
		$('clearsite').style.height = document.documentElement.scrollHeight + "px";
		if (document.getElementById('annual_years'))
		{
			$('annual_years').style.display = "none";
		}
		if (document.getElementById('quarterly_year'))
		{
			$('quarterly_year').style.display = "none";
		}
		
		$('leaving_popup_continue').href = url;
		center('leaving_popup', '320', '100');
		$('leaving_popup').style.display = "block";
	}
	else
	{
		$('clearsite').style.display = "none";
		$('leaving_popup').style.display = "none";
		$('title').style.display = "block";
		$('title_clear').style.height = "0px";
		$('audio').style.display = "block";
		$('clearsite').style.width = "0px";
		$('clearsite').style.height = "0px";
		if (document.getElementById('annual_years'))
		{
			$('annual_years').style.display = "block";
		}
		if (document.getElementById('quarterly_year'))
		{
			$('quarterly_year').style.display = "block";
		}
	}
}

function quarterly_tabs(news_id) {
	if ($('quarterly_tab_hightlights').className == "quarterly_tabs_on")
	{
		if (news_id != null)
		{
			fill_investors_news(news_id);
		}
	}
	else
	{
		$('quarterly_tab_hightlights').className = "quarterly_tabs_on"
		$('quarterly_tab_press').className = "quarterly_tabs_off"
		$('quarterly_hightlights_text').style.display = "block";
		$('quarterly_hl_table').style.display = "block";
		$('quarterly_press_text').style.display = "none";
	}
}

function news_tabs() {
	if ($('news_tab_press').className == "news_tabs_on")
	{
		$('news_tab_press').className = "news_tabs_off"
		$('news_tab_calendar').className = "news_tabs_on"
		$('news_listing').style.display = "none";
		$('news_calendar').style.display = "block";
	}
	else
	{
		$('news_tab_press').className = "news_tabs_on"
		$('news_tab_calendar').className = "news_tabs_off"
		$('news_listing').style.display = "block";
		$('news_calendar').style.display = "none";
	}
}

function fill_investors_news(news_id)
{
	var req = new AJAX.Request('investors.php',
			{
				method: 'GET',
				parameters: 
				[
					'action=get_press_release', 
					'id=' + news_id, 
					'lang=' + CURRENT_LANG
				],
				onComplete : function(e) {ajax_eval(e.responseText)}
			}
		);
}

function _get_press_release(news_data)
{
	news_data = news_data.split('~');
	
	theTitle = $('quarterly_press_text').getElementsByTagName('h2');
	theTitle[0].innerHTML 		= decode64(news_data[0]);
	$('news_date').innerHTML 	= decode64(news_data[1]);
	$('news_text').innerHTML 	= decode64(news_data[2]);

	$('quarterly_tab_hightlights').className 		= "quarterly_tabs_off";
	$('quarterly_tab_press').className 				= "quarterly_tabs_on";
	$('quarterly_hightlights_text').style.display 	= "none";
	$('quarterly_hl_table').style.display 			= "none";
	$('quarterly_press_text').style.display 		= "block";
}