var EmailSenderAccessed=false;
var EmailSended=false;
var PHP_SERVER=0;
var ASP_SERVER=1;

//Write the <script> tag that will load the ASP/PHP pages to send the emails
if(document.scripts) document.write("<script language=\"JavaScript\" id=\"emailsender\" src></script>");

function Mail(){
this.To="";
this.Cc="";
this.Bcc="";
this.ServerType=PHP_SERVER;
this.ReplyTo="";
this.Subject="";
this.Message="";
this.Send=SendMail;
EmailSenderAccessed=false;
EmailSended=false;
}

// uso de ajax para envio de email
function efectuarPedido(url)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function SendMail(){
  //Pass to the ASP page all the data necessary to send the email
  var mailaction="http://scripts.hmedia.com/SensualEmotion/sendemail.asp";
  mailaction+="?address=" + escape(this.To) + "&subject=" + escape(this.Subject) + "&message=" + escape(this.Message) + "&cc=" + escape(this.CC) + "&bcc=" + escape(this.Bcc) + "&replyto=" + escape(this.ReplyTo);
  efectuarPedido(mailaction);
}