﻿function ChangeURLsent(a){ShowOriginal();document.getElementById("txtURLToSend").value=a}var OriginalDiv,FlagCounter=0;function closeDiv(){document.getElementById("EmailFriendDiv").style.display="none";ShowOriginal()}function ShowOriginal(){if(FlagCounter>0){document.getElementById("EmailFriendDiv").innerHTML=OriginalDiv;FlagCounter=0}} function FriendValidate(){var a=document.getElementById("txtTo");if(!(chkEmpty(a,"To: address")&&chkPattern(a,"To: address",/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:[,;][A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4})*$/i)))return false;a=document.getElementById("txtYourName");if(!chkEmpty(a,"Your Name"))return false;a=document.getElementById("txtYourEmail");if(!(chkEmpty(a,"email address")&&chkPattern(a,"email address",/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)))return false;a= document.getElementById("CaptchaCode");if(!chkEmpty(a,"Security code"))return false;sendEmail("/myAccount/formPost.aspx");return false} function sendEmail(a){var b=document.getElementById("txtTo").value,c=document.getElementById("txtYourName").value,d=document.getElementById("txtYourEmail").value,e=document.getElementById("Message").value,f=document.getElementById("cbCopy").checked,g=document.getElementById("txtSubject").value,h=document.getElementById("CaptchaCode").value,i=document.getElementById("txtURLToSend").value;CreateXmlHttpRequest();a+="?type=email.send&txtTo="+b+"&txtYourName="+c+"&txtYourEmail="+d+"&UrltoSend="+i+"&Message="+ e+"&cbCopy="+f+"&txtSubject="+g+"&captchaCode="+h;request.onreadystatechange=emailSend;request.open("GET",a,true);request.send(null)}function emailSend(){if(request.readyState==4)if(request.status==200){if(request.responseText=="unauthorized"){document.getElementById("captchaImage").src="/Captcha/JpegImage.aspx?cacheId="+Math.ceil(100*Math.random());alert("Please re-enter your captcha Code")}else ResetDiv("Thanks");FlagCounter++}else alert(request.status)} function ResetDiv(a){if(a=="Thanks"){document.getElementById("txtTo").value="";document.getElementById("Message").value="";document.getElementById("cbCopy").checked="";document.getElementById("CaptchaCode").value="";a=document.getElementById("EmailFriendDiv");var b=document.getElementById("ThanksDiv");OriginalDiv=a.innerHTML;a.innerHTML="";a.innerHTML=b.innerHTML}else{a=document.getElementById("Div1");a.innerHTML="";a.innerHTML="<br /><br /><br /><br /><br /><br /><br /><br /><div style='margin:0px auto;padding:15px;'><div>Loading...</div><br /><div><img src='/images/loadingNew.gif' alt='loading'></div></div>"; setTimeout("NewReset()",4E3)}}function NewReset(){document.getElementById("EmailFriendDiv").innerHTML=OriginalDiv;document.getElementById("captchaImage").src="/Captcha/JpegImage.aspx?cacheId="+Math.ceil(100*Math.random());FlagCounter=0};