// JavaScript Document
var gCurrentArticle='';
var gBaseURL='';
function translate(ol,l){
	window.location = gBaseURL+"/?language="+l+(gCurrentArticle != '' ? '&curart='+gCurrentArticle : '')+
	('&ol='+ol);
}

function showExcrept(id) {

	if($('post_button_'+id).innerHTML == 'MORE' || $('post_button_'+id).innerHTML == '<a>MORE</a>') {
		$('post_button_'+id).update(' <span class="red">X</span> ');
		$('post_content_'+id).show();
	} else {
		$('post_button_'+id).update('MORE');
		$('post_content_'+id).hide();
	}
	
}

function OpenArticle(id) {

	if($('post_button_'+id).innerHTML == 'MORE' || $('post_button_'+id).innerHTML == '<a>MORE</a>') {
		$('post_button_'+id).update(' <span class="red">X</span> ');
		$('post_content_'+id).show();
	} 
	getArticle(id);
	
}

var gBulletinURL;
function openNewsletter() {
	window.open(gBulletinURL,'bulletin');
}

function showNewsletter() {
	/*if ($('cnewsletter').visible()) {
		$('cnewsletter').hide();
	} else {
		$('cnewsletter').show();
	}*/
}

function showAdvancedSearch() {
	if ($('cadvancedsearch').visible()) {
		$('cadvancedsearch').hide();
	} else {
		$('cadvancedsearch').show();
	}
}
function showPrintImage() {
	if ($('cprintimage').visible()) {
		$('cprintimage').hide();
	} else {
		$('cprintimage').show();
	}
}

function searchIt(){
	$('searchbox').value += "|"+$('adv-search-nr').value+"|"+$('adv-search-period').value+"|";
	for(var i=0;i<20;i++){
		var o = document.getElementById('adv-search-cat-'+i);
		if (o != null && o.checked){
			$('searchbox').value += i+",";
		}
	}
	$('searchform').submit();
}

function showHide(id) {
	if($('post_button_'+id).innerHTML == 'MORE' || $('post_button_'+id).innerHTML == '<a>MORE</a>') {
		$('post_button_'+id).update(' <span class="red">X</span> ');
		$('item_'+id).show();
	} else {
		$('post_button_'+id).update('MORE');
		$('item_'+id).hide();
	}
}

function hideItem(id) {

	$(id).hide();

}

function showItem(id) {

	$(id).show();

}

function getArticle(id) {
	var url = './?p='+id;
	gCurrentArticle = id;
	new Ajax.Request(url, {
		method: 'get',
		onSuccess: function(t) {
			$('post_content_content_'+id).show();
			$('post_content_excrept_'+id).hide();
			$('post_content_content_'+id).update(t.responseText);
		}
	});
}

function hideArticle(id){
	$('post_content_content_'+id).hide();
	$('post_content_excrept_'+id).show();
}

function getThematicGuide(id) {
	var url = './?thema=1&p='+id;
	new Ajax.Request(url, {
		method: 'get',
		onSuccess: function(t) {
			$('content').update(t.responseText);
		}
	});
}




