var openEmpfehlungsWindow = null;

function doopenEmpfehlungsWindow(emailadr,softwarename,softwarebeschr,url)
{
  if (openEmpfehlungsWindow&& !openEmpfehlungsWindow.closed)
  {
    openEmpfehlungsWindow.close();
  }

  // Die Position des Fensters wird über die Auflösung 
  // des Bildschirm ermittelt - daraus berechnet sich dann
  // die XY-Position der linken oberen Ecke.
  properties = "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,";
  openEmpfehlungsWindow = window.open('','openEmpfehlungsWindow','width=630,height=490',properties);
  openEmpfehlungsWindow.document.open();

  openEmpfehlungsWindow.document.write('<html><head><title>Programm weiterempfehlen: '+softwarename+'</title><script language="JavaScript" src="click_EmpfehlungsWindow.js" type="text/javascript"></script></head>');
  openEmpfehlungsWindow.document.write('<body bgcolor="#E0E0E0"><!-><center>');
  openEmpfehlungsWindow.document.write('<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" HEIGHT="90%"><tr><td><!->');
  openEmpfehlungsWindow.document.write('<center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="600"><tr><td COLSPAN="2" WIDTH="271"><img SRC="images2/topleft.gif" height=106 width=271></td><td WIDTH="329"><img SRC="images2/mainlogo.gif" BORDER=0 height=106 width=329></td></tr></table></center>');
  openEmpfehlungsWindow.document.write('<!-><center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="600" BGCOLOR="#FFFFFF"><tr><td COLSPAN="2" WIDTH="3%">&nbsp;</td><td WIDTH="93%"><center><img SRC="images/transparent.gif" height=15 width=15></center><center><table BORDER=0 CELLSPACING=0 WIDTH="470"><tr>');
  openEmpfehlungsWindow.document.write('<td ALIGN=CENTER VALIGN=TOP COLSPAN="2"><form NAME="Empfehlung" ACTION="http://www.formany.com/scripts/formany/formany_v22.pl" METHOD="POST"><input TYPE="HIDDEN" NAME="Beschreibung" VALUE="'+softwarebeschr+'"><input TYPE="HIDDEN" NAME="Anm" VALUE="kostenlose Demo"><input TYPE="HIDDEN" NAME="Adresse" VALUE="'+url+'"><input TYPE="HIDDEN" NAME="X" VALUE="-----------------------------------"><b><font face="Arial,Helvetica"><font size=-1></font>'+softwarename+' weiterempfehlen:</font></b><br><img SRC="images/transparent.gif" height=4 width=5></td></tr>');
  openEmpfehlungsWindow.document.write('<input type="hidden" name="p_formtag" value="superform"><input type="hidden" name="email_sender" value="-$Email-"><input type="hidden" name="admin_email_to" value="'+emailadr+'"><input type="hidden" name="admin_email_subject" value="Meine Empfehlung: '+softwarename+'"><input type="hidden" name="admin_email_template" value="'+softwarebeschr+' - kostenlose Demo unter  '+url+'                                                                                                                                                 -$Kommentar-">');
  openEmpfehlungsWindow.document.write('<input type="hidden" name="client_email_to" value="t@test.com"><input type="hidden" name="client_email_subject" value="Thanks"><input type="hidden" name="client_email_template" value="Thank you for your form submission.">');
  openEmpfehlungsWindow.document.write('<input type="hidden" name="client_html_template" value="http://www.softaix.de/vielendank.html">');
  openEmpfehlungsWindow.document.write('<input type="hidden" name="formany_id" value="id_985229225">');
  openEmpfehlungsWindow.document.write('<input type="hidden" name="_sys_source" value="http://www.formany.com">');
  openEmpfehlungsWindow.document.write('<input type="hidden" name="_sys_abuse_detect" value="x-345-aHMw">');
  openEmpfehlungsWindow.document.write('<tr><td COLSPAN="2" BGCOLOR="#000000"></td></tr>');
  openEmpfehlungsWindow.document.write('<tr><td ALIGN=LEFT VALIGN=CENTER><font face="Arial,Helvetica">Ihr Name:&nbsp;</font></td><td ALIGN=LEFT VALIGN=CENTER><input TYPE="TEXT" NAME="Name" MAXLENGTH="50" SIZE="30" VALUE=""></td></tr>');
  openEmpfehlungsWindow.document.write('<tr><td ALIGN=LEFT VALIGN=CENTER><font face="Arial,Helvetica">Ihre E-Mail-Adresse:&nbsp;</font></td><td ALIGN=LEFT VALIGN=CENTER><input TYPE="TEXT" NAME="Email" MAXLENGTH="50" SIZE="30" VALUE="@"></td></tr>');
  openEmpfehlungsWindow.document.write('<tr><td ALIGN=LEFT VALIGN=TOP><font face="Arial,Helvetica">Ihr Kommentar:&nbsp;</font></td><td ALIGN=LEFT VALIGN=TOP><textarea NAME="Kommentar" MAXLENGTH="50" COLS="28" ROWS="5" WRAP="virtual">Hallo,</textarea></td></tr>');
  openEmpfehlungsWindow.document.write('<tr><td COLSPAN="2" BGCOLOR="#000000"></td></tr>');
  openEmpfehlungsWindow.document.write('<tr><td ALIGN=LEFT VALIGN=CENTER><font face="Arial,Helvetica">E-Mail des Empf&auml;ngers:&nbsp;</font></td><td ALIGN=LEFT VALIGN=CENTER><b><font face="Arial,Helvetica">'+emailadr+'</font></b></td></tr>');
  openEmpfehlungsWindow.document.write('<tr><td COLSPAN="2" BGCOLOR="#000000"></td></tr>');
  openEmpfehlungsWindow.document.write('<tr><td><font face="Arial,Helvetica">&nbsp;</font></td><td ALIGN=LEFT VALIGN=CENTER><img SRC="images/transparent.gif" height=5 width=5><BR><input TYPE="SUBMIT" VALUE="Empfehlung jetzt versenden" SIZE="30"></form></td></tr>');
  openEmpfehlungsWindow.document.write('</table><img SRC="images/transparent.gif" height=5 width=5><br><font face="Arial,Helvetica"><font size=-1>Bitte warten Sie nach dem Versenden, bis Sie eine Bestätigung erhalten.</b></font></font><P><img SRC="images/transparent.gif" height=15 width=15>');
  openEmpfehlungsWindow.document.write('<font face="Arial,Helvetica"><font size=-2>Copyright &copy; Soft<font color="#FF0000">AiX</font>- Softwareentwicklung - EDV-Beratung - Service</font></font><br><font face="Arial,Helvetica"><font size=-2>Dipl.-Inf. Patrick Krott&nbsp;-&nbsp; <b>Kommentare an: <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#109;&#97;&#105;&#108;&#64;&#115;&#111;&#102;&#116;&#97;&#105;&#120;&#46;&#100;&#101;?subject=Kommentar zur Weiterempfehlung">&#109;&#97;&#105;&#108;&#64;&#115;&#111;&#102;&#116;&#97;&#105;&#120;&#46;&#100;&#101;</a></b></font></font></center></td><td WIDTH="4%">&nbsp;</td></tr></table></center>');
  openEmpfehlungsWindow.document.write('<!-><center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="600"><tr><td COLSPAN="2"><img SRC="images2/mainbottomleft.gif" height=19 width=271></td><td WIDTH="307"><img SRC="images2/mainbottomright.gif" BORDER=0 height=19 width=329></td></tr></table></center>');
  openEmpfehlungsWindow.document.write('</td></tr></table></center></body></html>');

  openEmpfehlungsWindow.document.close()
  openEmpfehlungsWindow.focus();
}

function emailCheck(theForm,softwarename,softwarebeschr,url) {
  email=theForm.Email.value;
  if (email.indexOf("@")<3) {
    alert("Die angegebene Email-Adresse scheint nicht korrekt zu sein. \nBitte prüfen Sie die Schreibweise und das '@'-Symbol. \n\nBeispiel:  hans@t-online.de");
    theForm.Email.focus();
    return false;
  }
  if (email.indexOf(" ")>0) {
    alert("Die angegebene Email-Adresse scheint nicht korrekt zu sein. \nBitte prüfen Sie die Schreibweise. \n\nEmail-Adressen dürfen keine Leerzeichen enthalten. \n\nBeispiel:  hans@t-online.de");
    theForm.Email.focus();
    return false;
  }
  if (email.indexOf(".")<1) {
    alert("Die angegebene Email-Adresse scheint nicht korrekt zu sein. \nBitte prüfen Sie die Schreibweise. \n\nBeispiel:  hans@t-online.de");
    theForm.Email.focus();
    return false;
  }
  doopenEmpfehlungsWindow(email,softwarename,softwarebeschr,url);
  return true;
}
