function setMediaFile(id, src, hideimage){
src = src.replace("//", "/");
document.getElementById(id).value = src;
if(hideimage == null || hideimage == 0 || hideimage == false){
document.getElementById(id + '_span').innerHTML = "
" +
"
" + src + "";
}else
document.getElementById(id + '_span').innerHTML = "
" + src.replace(/\n/g, "
");
}
function image_popup(url,breite){
if(breite != null){
var width=breite;
var height=breite;
var l = (screen.availWidth - width) / 2;
var t = (screen.availHeight - height) / 4;
newwindow = window.open("https://www.eucal.org/modules/system/cmd_image_popup.php?src="+url+"&width="+width,"newwindow",
"width=" +breite+",height=" +height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=0,resizable=0,menubar=no");
newwindow.focus();
}else{
var breite=screen.availWidth-8;
var width=breite;
var height=screen.availHeight;
var l = (screen.availWidth - width) / 2;
var t = (screen.availHeight - height) / 4;
newwindow = window.open("https://www.eucal.org/modules/system/cmd_image_popup.php?src="+url+"&width="+width,"newwindow",
"width=" +breite+",height=" +height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=0,resizable=0,menubar=no");
newwindow.focus();
}
}
function popup(url,breite,hoehe){
var url;
var width=breite;
var height=hoehe;
var l = (screen.availWidth - width) / 2;
var t = (screen.availHeight - height) / 2;
newwindow = window.open(url,"newwindow",
"width=" +breite+",height=" +hoehe+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=yes,resizable=0,menubar=no");
newwindow.focus();
}
function confirm_delete(url, type){
if(type == null){
if(confirm('Are you sure?') == true)
window.location = url;
}else if(type == "cat"){
if(confirm('Kategorie wirklich löschen?\n\nEinträge, die nur in dieser Kategorie sind, \nwerden komplett gelöscht!') == true)
window.location = url;
}else if(type == "main_cat"){
if(confirm('Kategorie wirklich löschen?\nAlle Unterkategorien werden gelöscht und Einträge die in keinen anderen Kategorien sind werden ebenfalls gelöscht!') == true)
window.location = url;
}else if(type == "survey_question"){
if(confirm('Frage wirklich löschen?\nZugehörige Antworten ebenfalls gelöscht!') == true)
window.location = url;
}else if(type == "survey_main"){
if(confirm('Kategorie wirklich löschen?\nAlle enthaltenen Fragen sowie zugehörige Antworten werden ebenfalls gelöscht!') == true)
window.location = url;
}else if(type == "comments"){
if(confirm('Eintrag wirklich löschen?\nAlle zugehörigen Kommentare werden ebenfalls gelöscht!') == true)
window.location = url;
}
}
function show_layer(id, show){
if(show){
document.getElementById(id).style.display = "";
document.getElementById(id).style.visibility = "visible";
}
else{
document.getElementById(id).style.display = "none";
document.getElementById(id).style.visibility = "hidden";
}
}
function layer_visible(id){
var vis = document.getElementById(id).style.visibility;
return ((vis == "visible") || (vis == ""));
}
function toggle_layer(id){
show_layer(id, !layer_visible(id));
}
function goto_url(url){
window.location = url;
}
function showWMTT(id) {
wmtt = document.getElementById(id);
wmtt.style.display = "block";
}
function hideWMTT() {
wmtt.style.display = "none";
}