function statter(theURL) {
  window.setTimeout("weiter('"+theURL+"')",1000);
}
function weiter(theURL) {
  window.open(theURL,'Statistik','width=1,height=1,menubar=no,scrollbars=no').focus();
}

function c() { 
  if ((x=document.k.nav.value)!="") document.location.href=x;
}

function setmail(c, n, cls) {
  var ac=c.split(":");
  var s="";
  var nc=n.split(":");
  var ns="";
  var refs='mailto';
  if (cls=="sms") refs="sms";
  for(i=1;i<ac.length;++i){s+=String.fromCharCode(Number(ac[i])/Math.sqrt(Number(ac[0])));}
  for(i=1;i<nc.length;++i){ns+=String.fromCharCode(Number(nc[i])/Math.sqrt(Number(nc[0])));}
  document.write('<a href="' + refs +':' + s + '" class="'+ cls +'">' + ns + '</a>');
}

function openWindow(theURL,winName,features) { //v2.0
  thiswin=window.open(theURL,winName,features);
  thiswin.focus();
}
movewindow = null;


function openMove(theURL,winName,features) { //v2.0
  if (movewindow != null)
    if (!movewindow.closed)
      movewindow.close();
  movewindow=window.open(theURL,winName,features);
}

function openSlide(theURL) { //v2.0
  winName='';
  features='toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=0,resizable=0,width=400,height=300';
  pos = theURL.lastIndexOf('/');
  theURL = theURL.substring(pos+1,theURL.length);
  theURL='bilder.php3?img='+theURL;
  window.open(theURL,winName,features);
}

function makeArray() {
  this.length = makeArray.arguments.length
  for (var i = 0; i < this.length; i++) this[i+1] = makeArray.arguments[i]
}

function wechsle(anzahl) {
  document.image.src = "img/galerie/"+pix[nummer];
  nummer += 1;
  if (nummer == anzahl+1) nummer = 1;
  setTimeout("wechsle("+anzahl+")", 4000);
}

function tourlink(link, width, height) {
height = height + 55;
link = link + "&width=" + width + "&height=" + height;
movewindow = window.open("leer.php?link="+link,"movewindow","scrollbar=no,toolbar=no,status=no,menubar=no,resizeable=0");
movewindow.resizeTo(width,height);
movewindow.moveTo(20,20);
movewindow.focus();
}

function checkFieldsIn () {
  var checkOK=true;
  for (var i=0; i<cfi.length; i++) {
    var cfObj=document.getElementById(cfi[i]);
    if (cfObj!=null) {
      if (cfObj.type.toLowerCase()=="text") {
        if (cfObj.value.match(/^s*$/)) checkOK=false;
      } else if (cfObj.type.toLowerCase()=="radio" || cfObj.type.toLowerCase()=="checkbox") {
        var tmpObj=document.getElementsByName(cfObj.name);
        var tmpCheck=false;
        for (var j=0; j<tmpObj.length; j++) {
          if (tmpObj[j].checked==true) {
            tmpCheck=true;
            break;
          }
        }
        checkOK=tmpCheck;
      } else if (cfObj.type.toLowerCase().indexOf("select")>=0) {
        if (cfObj.selectedIndex==0) checkOK=false;
      } else if (cfObj.type.toLowerCase().indexOf("textarea")>=0) {
        if (cfObj.value.match(/^s*$/)) checkOK=false;
      }
    }
    if (!checkOK) break;
  }
  if (checkOK) document.getElementById('subscribe').submit();
  else window.alert("Bitte füllen Sie alle mit einem * markierten Felder aus.");
}
