
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}

function showHide(div,nest){
	bw=new checkBrowser()
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	//obj = document.getElementById(div).style;

	if(obj.visibility=='visible' || obj.visibility=='show') obj.visibility='hidden'
	else obj.visibility='visible'

	if(obj.display=='block' || obj.display=='block') obj.display='none'
	else obj.display='block'
}

//Shows the div
function show(div,nest){
	bw=new checkBrowser()
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	obj.visibility='visible';
	obj.display='inline';
         
}

function showBlock(div,nest){
	bw=new checkBrowser()
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	obj.display='block'
	
}

//Hides the div
function hideBlock(div,nest){
	bw=new checkBrowser()
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	obj.display='none'

}

function hide(div,nest){
	bw=new checkBrowser()
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	obj.visibility='hidden'
}

function DelTaskVerify() {
  var verify = window.confirm("Task delete! Confirm?");
  return (verify);
}

function AufgabenLoeschen() {
  var verify = window.confirm("Aufgabe loschen! Bestotigen?");
  return (verify);
}

function delTopicVerify() {
  var verify = window.confirm("$forum_administration[46] Confirm?");
  return (verify);
}

function delReplyVerify() {
  var verify = window.confirm("Delete reply! Confirm?");
  return (verify);
}

function delCatVerify() {
  var verify = window.confirm("Delete this Category! Confirm?");
  return (verify);
}

function delThreadVerify() {
  var verify = window.confirm("Delete this Thread! Confirm?");
  return (verify);
}

function KategorieLoeschen() {
  var verify = window.confirm("Kategorie loeschen?");
  return (verify);
}

function KonferenzLoeschen() {
  var verify = window.confirm("Konferenz loeschen?");
  return (verify);
}

function delUserVerify() {
  var verify = window.confirm("Delete user! Confirm?");
  return (verify);
}

function delThreadVerify() {
  var verify = window.confirm("Delete thread! Confirm?");
  return (verify);
}

function delGroupVerify() {
  var verify = window.confirm("Delete group! Confirm?");
  return (verify);
}

function delVerify() {
  var verify = window.confirm("Delete! Confirm?");
  return (verify);
}

function delEventVerify() {
  var verify = window.confirm("Delete event! Confirm?");
  return (verify);
}

function delComGroupVerify() {
  var verify = window.confirm("Delete community group! Confirm?");
  return (verify);
}

function delJobVerify() {
  var verify = window.confirm("Delete job! Confirm?");
  return (verify);
}

function delMediaVerify() {
  var verify = window.confirm("Delete media! Confirm?");
  return (verify);
}

function delInfoVerify() {
  var verify = window.confirm("Delete info English and German! Confirm?");
  return (verify);
}

function delPostVerify() {
  var verify = window.confirm("Are you sure you want to delete the post and all its replies?");
  return (verify);
}
function delThreadVerify() {
  var verify = window.confirm("Are you sure you want to delete the thread and all its posts?");
  return (verify);
}
function delCategoryVerify() {
  var verify = window.confirm("Are you sure you want to delete the category and all its threads and posts?");
  return (verify);
}


function BenuterLoeschen() {
  var verify = window.confirm("Benutzer loschen! Bestotigen?");
  return (verify);
}

function KonferenzLoeschen() {
  var verify = window.confirm("Konferenz loschen! Bestotigen?");
  return (verify);
}

function GruppeLoeschen() {
  var verify = window.confirm("Gruppe loschen! Bestotigen?");
  return (verify);
}

function VeranstatungLoeschen() {
  var verify = window.confirm("Veranstaltung loschen! Bestotigen?");
  return (verify);
}

function GemeinschaftsgruppeLoeschen() {
  var verify = window.confirm("Gemeinschaftsgruppe loschen! Bestotigen?");
  return (verify);
}

function JobLoeschen() {
  var verify = window.confirm("Job loeschen! Bestotigen?");
  return (verify);
}

function SetChecked(form, val,chkName) {
	dml=document.forms[form];
	len = dml.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) {
		if (dml.elements[i].name==chkName) {
			dml.elements[i].checked=val;
		}
	}
}

function applyDisplay(value,id,id1,value1,id2,value2){
 document.getElementById(id).style.display = value;
 document.getElementById(id1).style.display = value1;
 document.getElementById(id2).style.display = value2;
}


function delContentVerify(msg) {
  var verify = window.confirm(msg);
  return (verify);
}


function addslashes (str) {
    // Escapes single quote, double quotes and backslash characters in a string with backslashes  
    // 
    // version: 908.406
    // discuss at: http://phpjs.org/functions/addslashes
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Ates Goral (http://magnetiq.com)
    // +   improved by: marrtins
    // +   improved by: Nate
    // +   improved by: Onno Marsman
    // +   input by: Denny Wardhana
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // *     example 1: addslashes("kevin's birthday");
    // *     returns 1: 'kevin\'s birthday'
 
    return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\u0000/g, "\\0");
}


function stripslashes(str) {
   str=str.replace(/\\'/g,'\'');
   str=str.replace(/\\"/g,'"');
   str=str.replace(/\\\\/g,'\\');
   str=str.replace(/\\0/g,'\0');
   return str;
}