
//---- Formular check ----------------

function vp(id1){
      ff = window.open("viewpic.php?id1="+id1,"galerie",'resizable=no,location=no,scrollbars=no,menubar=no,titlebar=no,toolbar=no,width=500,height=333');
      if (ff.closed==false) ff.focus();
}

function alle_felder(felder){
  with(document.namecheck){
   if(alle.checked==true)  $rr='true';
   else                    $rr='false';
   for (var i=1; i<felder; i++)
      eval('tld'+i).checked=eval($rr);
  }
}
function opwin(pfad,breite,hoehe,scroll) {
      if(pfad!=''){
        fenster=window.open(pfad,"whoisdata_sixgroup","resizable=yes,location=no,menubar=no,titlebar=no,toolbar=no,scrollbars="+scroll+",width="+breite+",height="+hoehe);
        if (fenster.closed==false) fenster.focus();
      }
}
function opcam(pfad,breite,hoehe,scroll,resize,dest) {
      if(pfad!=''){
        ff=window.open("index.php?"+pfad,"webcam_sixgroup","resizable="+resize+",location=no,menubar=no,titlebar=no,toolbar=no,scrollbars="+scroll+",width="+breite+",height="+hoehe);
        if (ff.closed==false) ff.focus();
      }
}

function EMail(s){
 var a = false;
 var res = false;
 if(typeof(RegExp) == 'function') {
  var b = new RegExp('abc');
  if(b.test('abc') == true){a = true;}
 }
 if(a == true) {
   reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
   res = (reg.test(s));
 }
 else{
  res = (s.search('@') >= 1 &&
         s.lastIndexOf('.') > s.search('@') &&
         s.lastIndexOf('.') >= s.length-5)
 }
 return(res);
}
function checkform(lng){
  var fehler = "";
  if(lng=='it') {
     var nam='nome'; var vnam='cognome'; var str='via'; var ot='città'; var lnd='paese'; var priv='dichiarazione privacy'; var eml='email';
     var txt1 = 'prego verificare seguenti caselle';
  }
  else {
     var nam='vorname'; var vnam='name'; var str='strasse'; var ot='ort'; var lnd='land'; var priv='privacy erklärung'; var eml='email';
     var txt1 = 'bitte folgende felder überprüfen';
  }
  with(document.form1){
    if(vorname.value == "") fehler += "- "+vnam+" \n";
    if(name.value == "")    fehler += "- "+nam+" \n";
    if(strasse.value == "") fehler += "- "+str+" \n";
    if(ort.value == "")     fehler += "- "+ot+" \n";
    if(land.value == "")    fehler += "- "+lnd+"  \n";
    if(email.value == "" || !EMail(email.value))   fehler += "- "+eml+" \n";
    if(privacy.checked == false)    fehler += "- "+priv+"  \n";
    if(fehler != "") {
      alert(txt1+":\n\n"+fehler);
      return false;
    }
    return true;
  }
}
function checkform2(){
  with(document.namecheck){
    if(q.value == "")     return false;
    return true;
  }
}

function pan_rot(r) {
        document.ptviewer.startAutoPan(r,0.0,1.0);
}
function pan_stop() {
        document.ptviewer.stopAutoPan();
}
function zoom(r) {
        document.ptviewer.startAutoPan(0,0,r);
        setTimeout('pan_stop()',500);
}
function pan_tilt(r) {
        document.ptviewer.startAutoPan(0,r,1);
        setTimeout('pan_stop()',1400);
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function gall(id1,id2,id3,voll){
      if(voll==1) { breite=screen.width; hoehe=screen.height; }
      else        { breite=500; hoehe=550; }
      fenster = window.open("gallerie/gallerie_view.php?id1="+id1+"&id2="+id2+"&id3="+id3,"galerie","resizable=yes,location=no,scrollbars=yes,menubar=no,titlebar=no,toolbar=no,width="+breite+",height="+hoehe+'"');
      if (fenster.closed==false) fenster.focus();
}
function msg_nachr(nam,dom,srv)
{
  var g='mai';
  document.write('<a href="'+g+'lto:'+nam+'@'+srv+'.'+dom+'">');
}

