function input_check(name,value){
	if (eval("document.getElementById('"+name+"').value == '"+value+"';")){
		eval("document.getElementById('"+name+"').value = '';");
	}
}

function input_check_out(name,value){
	if (eval("document.getElementById('"+name+"').value == '';")){
		eval("document.getElementById('"+name+"').value = '"+value+"';");
	}
}

function show_submenu(name){
	document.getElementById('div_hide').style.display = '';
	eval("document.getElementById('menu"+name+"').style.display = '';");
	for (i=1; i<5; i++){
		if (i != name){
			eval("document.getElementById('menu"+i+"').style.display = 'none';");
		}	
	}
}

function hide_submenu(){
	for (i=1; i<5; i++){
		eval("document.getElementById('menu"+i+"').style.display = 'none';");
	}
	document.getElementById('div_hide').style.display = 'none';
}

function newWindow (url,xwidth,yheight){
	eval("window.open('"+url+"','','width="+xwidth+",height="+yheight+",location=no,toolbars=no,statusbar=no,scrollbars=yes,resizable=no')");
}

function newWindowRes (url,xwidth,yheight){
	eval("window.open('"+url+"','','width="+xwidth+",height="+yheight+",location=no,toolbars=no,statusbar=no,scrollbars=yes,resizable=yes')");
}

function change_bg (idcko,background){
	eval("document.getElementById('submenu_div_"+idcko+"').style.backgroundColor='"+background+"'");
}

function change_bg_back (idcko,background){
	eval("document.getElementById('submenu_div_"+idcko+"').style.backgroundColor='"+background+"'");
}

function change_img (name,path){
	eval("document.getElementById('"+name+"').src='"+path+"'");
}

function delete_confirm(idcko,section){
	if (confirm("Opravdu chcete smazat tento záznam?")){
		document.getElementById("id").value = idcko;
		document.getElementById("sectionid").value = section;
		document.getElementById("form0").submit();
	}
}

function diskuseIlustracni(id_image, id_sekce){
	//opener.location.href = 'diskuse_cat.php?sectionid='+id_sekce+'&new=1&imageId='+id_image;
	opener.document.forms['forumForm'].notSave.value = '1';
	opener.document.forms['forumForm'].imageId.value = id_image;
	opener.document.forms['forumForm'].submit();
	window.close();
}


function initEditors() {
	var editorbody = new HTMLArea("body");
	var cfg = editorbody.config; // this is the default configuration
	cfg.pageStyle="body {font-family: \"Arial CE\", Arial, helvetica, sans-serif; font-size: 12px; margin: 5px; padding:0px; background-color:#BAD3F0;border-color:#5A98DB;border-width:1px;border-style:solid;} p {margin: 0; padding: 0 0 0 0;}";
	cfg.width = "350";
	cfg.statusBar = false;
	  
	editorbody._customUndo=true;
	
	cfg.toolbar = [
	[ "bold", "italic", "underline", "forecolor", "separator", 
	  "copy", "cut", "paste", "space", "undo", "redo", "space", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
	  "createlink"]
	];
	
	editorbody.generate();
	
	return false;
} 
