questo è il codice:
codice:
<script language="javascript">
<!--
window.name="madre";
window.zIndex=5;
function abilita() {
if(document.checka.bottone.disabled==true)
document.checka.bottone.disabled=false;
}
function controlla(oForm,win){
if ((oForm.oggettomail.value == "") || (oForm.oggettomail.value == "undefined")) {
if(confirm("Inviare la mail senza oggetto?")){
if ((oForm.testomail.value == "") || (oForm.testomail.value == "undefined")) {
alert("Testo vuoto");
return false;
}
else{
oForm.submit();
win.close();
}
}
else
return false;
}
else if ((oForm.testomail.value == "") || (oForm.testomail.value == "undefined")) {
alert("Testo vuoto");
return false;
}
else{
oForm.submit();
win.close();
}
}
function inviaemail(e,nome,id) {
if(!e) e = window.event;
var x=e.pageX;
var y=e.pageY;
var data = new Date();
var mywindow=window.open("","help","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400,height=400,screenX="+x+",screenY="+y);
mywindow.zIndex=10;
mywindow.document.write("<HTML><HEAD>");
mywindow.document.write("<TITLE>Invia Email a "+nome+"</TITLE>");
mywindow.document.write("<style type=\"text/css\"> @import url(\"reserved.css\"); </style>");
mywindow.document.write("</HEAD><BODY style='overflow-x: hidden;overflow-y: hidden;'>");
mywindow.document.write("<form action='reserved.php' method='post' target='madre'><div id='container_2'><h2>Oggetto:</h2>\n<input type='text' name='oggettomail'>
");
mywindow.document.write("<h2>Testo:</h2>\n<textarea name='testomail' cols='42' rows=16' wrap='virtual' </textarea>
");
mywindow.document.write("<input type='hidden' name='idinvioemail' value='"+id+"' />");
mywindow.document.write("<input type='hidden' name='sez' value='10' />");
mywindow.document.write("<input type='button' value='Invia' onclick='window.opener.controlla(document.forms[0],window)'></form></div>");
mywindow.document.write("</BODY></HTML>");
}