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, t, cls) {
  var ac=c.split(":");
  var s="";
  var nc=n.split(":");
  var ns="";
  var tc=t.split(":");
  var ts="";
  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])));}
  for(i=1;i<tc.length;++i){ts+=String.fromCharCode(Number(tc[i])/Math.sqrt(Number(tc[0])));}
  document.write('<a href="' + refs +':' + s + '" class="'+ cls +'" title="' + ts + '">' + 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 mailpage() {
  mail_str = "mailto:?subject=Linkempfehlung: " + document.title;
  mail_str += "&body=... zu finden unter " + location.href;
  location.href = mail_str;

}


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.");
}


function HideRolloverImage() {
   if (document.originalImages != null)
      for(var i=0;i < (document.originalImages.length-1);i+=2)
         document.originalImages[i].src = document.originalImages[i+1];
}

function ShowRolloverImage() {
   var i,j=0,objStr,obj,imgList=new Array,oldList=document.originalImages;
   for (i=0;i < (ShowRolloverImage.arguments.length-2);i+=3) {
      objStr = ShowRolloverImage.arguments[(navigator.appName=='Netscape')?i:i+1];
      if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
          (objStr.indexOf('document.all[')==0 && document.all==null))
         objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
      obj = eval(objStr);
      if (obj != null) {
         imgList[j++] = obj;
         imgList[j++] = (oldList==null || oldList[j-1]!=obj)?obj.src:oldList[j];
         obj.src = ShowRolloverImage.arguments[i+2];
      }
   }
   document.originalImages = imgList;
}

