/* POPUP SEND EMAIL */
Str_Popup = '';
Str_Popup += '<table id="Content_Table_Email_Area" style="display:none;" cellpadding=0 cellspacing=0 border=0><tr>';
Str_Popup += '<td nowrap colspan=2 align=right><img src="../img/s.gif" style="cursor:pointer" alt="' +  _t("Close") + '" width=24 height=22 onclick="Show_Moveable_Popup(false, \'PopEmail\', After_Close_ClientArea);"></td>	';
Str_Popup += '</tr><tr height=40px>';
Str_Popup += '<td nowrap class="ContactElementPlus" align=right>' +  _t("Email") + ' :&nbsp;</td>';
Str_Popup += '<td><input type="text" name="Email_Email" size="15" style="width:244px" class="text_Email" value="" ID="Email_Email"></td></tr>';
Str_Popup += '<tr height=30px>';
Str_Popup += '<td class="ContactElementPlus" nowrap align=right>' +  _t("Informations") + ' :&nbsp;</td>';
Str_Popup += '<td><Select name="Email_MessageTo" style="width:213px;" class="text_Email" ID="Email_MessageTo">';
Str_Popup += '<option value="SALES">' +  _t("Sales Informations") + '</option>';
Str_Popup += '<option value="TECHNICALS">' +  _t("Technical Request") + '</option>';
Str_Popup += '<option value="PARTNERS">' +  _t("Partners program") + '</option></select></td></tr>';
Str_Popup += '<tr height=30px><td class="ContactElementPlus" nowrap align=right>' +  _t("Message") + ' :&nbsp;</td>';
Str_Popup += '<td><textarea class=text_Email style="width:450px;height:100px" name="Email_Message" size="15" ID="Email_Message"></textarea></td>';
Str_Popup += '</tr>';
Str_Popup += '<tr><td align=right colspan=2 height=40px><A href="javascript:void(0);" class="link_OK2" onclick="Post_Email();">' +  _t("SEND") + '</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>';
Str_Popup += '</tr></table>';
document.write(Str_Popup);

function Post_Email() 
{
var Error_Mes = '';
if (document.getElementById("Email_Email").value=='') 
{
Error_Mes = 'Missing Email address.';
}
else
{
var reg_Email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
if (!document.getElementById("Email_Email").value.match(reg_Email) ) 
{
Error_Mes += '<br>Incorrect Email address.';
}
}
if (document.getElementById("Email_Message").value=='')
{
Error_Mes += '<br>Missing Message.';
}
if (Error_Mes!='') 
{
Alert(Error_Mes);
return;
}
var xmlhttp = Wsjavascript_getXmlHttp();
xmlhttp.open("POST","/HANDLER/Site_Exchange.asmx",false);
xmlhttp.onreadystatechange= function(e)
{
if (xmlhttp.readyState==4)
{
Result_Post_Email(xmlhttp.responseXML);xmlhttp = null;
}
};
xmlhttp.setRequestHeader("Content-Type", "text/xml");
xmlhttp.setRequestHeader("SOAPAction" , "http://www.vocalcom/SITE_2007/Site_Exchange/Post_Email")
var entete = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
entete += "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
entete += "<soap:Body>"
entete += "<Post_Email xmlns=\"http://www.vocalcom/SITE_2007/Site_Exchange\">"
entete += "<Email>" + XMLEncode(document.getElementById("Email_Email").value)  + "</Email>"
entete += "<To_To>" + XMLEncode(document.getElementById("Email_MessageTo").value)  + "</To_To>"
entete += "<Message>" + XMLEncode(document.getElementById("Email_Message").value)  + "</Message>"
entete += "<Country>" + From_Country + "</Country>"
entete += "</Post_Email>"
entete += "</soap:Body></soap:Envelope>"
xmlhttp.send(entete);

entete = null;
}

function Check_Mail(v)
{
if (v!="")
{
var reg_Email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
if (!v.match(reg_Email) ) 
return 2;
else
return 1;
}
else
return 0;
}

function Result_Post_Email(res)
{
if (res)
{
if (res.text.substr(0,5) =='ERROR' ) 
{
Alert('Sorry, but this action has been canceled... Please Try later');
setTimeout(function() { Show_Moveable_Popup(false,'PopEmail',null); },5);
}
else
{
Alert('Your email has been sent.');
}
}
setTimeout(function() { Show_Moveable_Popup(false,'PopEmail',null); },5);
}
