// JavaScript Document
function doLogout(language){
	var v_question = '';
	
	switch (language){
		case 1: v_question = "Wollen Sie sich wirklich abmelden?";
								break;
		
		case 2: v_question = "Voulez-vous vous déconnecter?";
								break;
		
		default: v_question = "Wollen Sie sich wirklich abmelden?";
	}
	
	var fsubmit = confirm(v_question);
	var formobj = document.getElementById("logoutform");
	
	if (fsubmit == true) {
		formobj.submit();
	}
}

function calendarShowdetail(str){
	var cal = document.getElementById('calendardetail');
	cal.innerHTML = str;
	cal.style.display='';
	
}

function calendarHidedetail(){
	var cal = document.getElementById('calendardetail');
	cal.innerHTML = '';
	cal.style.display='none';			

}
function showcomment(id){
	var com = document.getElementById(id);
	var items = document.getElementsByTagName('div');
	for(var x=0; x < items.length;x++){
		if(items[x].className == 'comment'){
			if(items[x].id != id){
				var imageid = items[x].id +'_image';
				document.getElementById(imageid).src='admin/adminmedia/plus.gif';
				items[x].style.display = 'none';
			}
		}
	}
	if(com.style.display == 'none'){
		com.style.display = '';
		document.getElementById(id+'_image').src='admin/adminmedia/minus.gif';
	}else{
		com.style.display = 'none';	
		document.getElementById(id+'_image').src='admin/adminmedia/plus.gif';
	}
}

function checkblogform(e){
	errmsg = "";
	var msglenght = 50;
    var editorcontent = CKEDITOR.instances['description'].getData().replace(/<[^>]*>/gi, ''); 
	
	if(e.title.value == ""){
		errmsg = "Titel muss ausgefuellt werden.\n";
	}
	if (editorcontent.length < msglenght){
		errmsg += "Kommentar muss ausgefuellt werden und mind. " + msglenght + " Zeichen lang sein.\n";
		//return true;
	}
	if(errmsg == ""){
		e.submit();
	}else{
		alert(errmsg);
	}
}

