/*
* CallONW(typ,URL,form)
*	typ: 1 - normales ONW fuer Kontaktformular... Parameter: URL, [form]
*		 2 - kleines Fenster fuer Empfangsbestaetigung von mailform.pl... 		Parameter: URL="", form: Formular
*		 3 - kleines Fenster fuer Eintrag in Mailingsliste von mailsub.pl... 	Parameter: URL, form
*/


    function clearSearch(searchTerm) {
      var search = document.forms['search'].elements['text'].value;
      if(search==searchTerm) {
        document.forms['search'].elements['text'].value='';
      }
    }




function Oeffne(ziel)

{
  if(opener) {
    if(opener.closed) self.location.href = ziel;
    else opener.location.href = ziel;
  }
  else zielfenster = self.location.href = ziel;
}

function CallONW(typ,URL,form, ret){
self.focus();
if(self.name==""){
  self.name=Math.random();
}

var win, wi, he, le, to, name, opt, d, action="";
var optONW=",menubar=yes,scrollbars=yes,toolbar=yes,status=yes,resizable=yes";
var optSUBFORM=",location=no,menubar=no,resizeable=no,scrollbars=no,status=no,toolbar=no";

if(URL=="") URL="about:blank";
else if(URL!="" && form!=null){
	action=URL;
	URL="about:blank";
}

switch(typ){
case 1:
	le=10; to=0; wi=650; he=(screen.height-150); name="klein"; opt=optONW;
	break;
case "P":
	le=10; to=0; wi=650; he=(screen.height-150); name="druck"; opt=optONW;
	break;
case 2: case 3:
	wi=(typ==2)?250:400; he=(typ==2)?150:250;
	name="popup"; opt=optSUBFORM;
	d=self.document;
	le=d.all? self.screenLeft+( (d.documentElement?d.documentElement.clientWidth:d.body.clientWidth)-wi)/2 : self.screenX+(self.outerWidth-wi)/2;
	to=d.all? self.screenTop+ ( (d.documentElement?d.documentElement.clientHeight:d.body.clientHeight)-he)/2 : self.screenY+(self.outerHeight-he)/2;
	break;
}

win=window.open(URL, name, "top="+to+",left="+le+",width="+wi+",height="+he+opt);
win.focus();

if(URL=="about:blank" && form!=null){
	if(action != "") form.action=action;
  if(form.opener){
    form.opener.value = self.name;
  }
	form.target=(typ==1)?"klein":"popup";
	if(ret != "return") form.submit();
}
}
function removeChar(str,delim){
	arr = str.split(delim);
	return arr[0];
}
