String.prototype.leftTrim = function () {
 return (this.replace(/^\s+/,""));
};
String.prototype.rightTrim = function () {
 return (this.replace(/\s+$/,""));
};
//kombiniert "leftTrim" und "rightTrim";
String.prototype.trim = function () {
 return (this.replace(/\s+$/,"").replace(/^\s+/,""));
};
//dampft leerzeichen(-sequenzen) innerhalb einer zeichenkette auf ein einzelnes "space" ein;
String.prototype.superTrim = function () {
 return(this.replace(/\s+/g," ").replace(/\s+$/,"").replace(/^\s+/,""));
};
//zugabe: entfernt alle leerzeichen aus einer zeichenkette;
String.prototype.removeWhiteSpaces = function () {
 return (this.replace(/\s+/g,""));
};

function inArray(array,value) {
 for(i=0; i<array.length; ++i) if(array[i]==value) return true;
 return false;
}

function checkRadio(field){
 for (var i=0; i<field.length; i++) {
  if(field[i].checked==true) return field[i].value;
 }
 return false
}

function mergeAlternateString(s1,s2) {
 num=s1.length;
 text="";
 for(i=0;i<num;i++) {
  if(typeof s1[i]!='undefined') text+=s1[i];
  if(typeof s2[i]!='undefined') text+=s2[i];
 }
 return text;
}

function AutoTab(check,input) {
 if(check.value.length == check.getAttribute("maxlength"))
 input.focus();
}

function sendDay(date,field,form) {
 if(form!=null) { //if(sendDay.arguments.length==3)
  eval("document.form."+field+"_minute.value='"+date.substr(10,2)+"'");
  eval("document.form."+field+"_stunde.value='"+date.substr(8,2)+"'");
  eval("document.form."+field+"_tag.value='"+date.substr(6,2)+"'");
  eval("document.form."+field+"_monat.value='"+date.substr(4,2)+"'");
  eval("document.form."+field+"_jahr.value='"+date.substr(0,4)+"'");
 }
 else {
  eval("document.forms[0]."+field+"_minute.value='"+date.substr(10,2)+"'");
  eval("document.forms[0]."+field+"_stunde.value='"+date.substr(8,2)+"'");
  eval("document.forms[0]."+field+"_tag.value='"+date.substr(6,2)+"'");
  eval("document.forms[0]."+field+"_monat.value='"+date.substr(4,2)+"'");
  eval("document.forms[0]."+field+"_jahr.value='"+date.substr(0,4)+"'");
 }
}

function openFrame(e,divid,frameid,src,param) {
  getMouseXY(e);
  //alert(x+" - "+y);
  document.getElementById(divid).style.display="";
  document.getElementById(divid).style.position="absolute";
  document.getElementById(divid).style.top=y-40;
  document.getElementById(divid).style.left=50;
  document.getElementById(frameid).src=src+"?divid="+divid+"&"+param;
}

function info(typ,id,parent,struktur,medium) {
	var objektinfo=window.open("../content/info.php?typ="+typ+"&medium="+medium+"&id="+id+"&parent="+parent+"&struktur="+struktur,"info","width=380,height=350,locationbar=no,resizable=no,scrollbars=yes,dependent=no,statusbar=no");
	objektinfo.focus();
}

function zeige(a,verein) { //../../vereine/info/
 if(verein>0) var objektinfo=window.open("http://vereine.landkreis-harburg.de/info/index.php?id="+a,"detail","width=690,height=630,locationbar=no,resizable=yes,dependent=yes,scrollbars=yes,statusbar=no");
 else var objektinfo=window.open("../content/locals_details.php?id="+a,"detail","width=440,height=400,locationbar=no,resizable=yes,dependent=yes,scrollbars=yes,statusbar=no");
 objektinfo.focus();
}

