function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}


function checkEmail(refer) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.refer.fromEmail.value)){
ekf=3;return (true)
}
ekf=1;
return (false)
}
function checkEmail2(refer) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.refer.sendTo.value)){
bekf=3;return (true)
}
bekf=2;
return (false)
}
var ekf=3
var bekf=3
function SubmitMe() { 
   if (document.refer.fromEmail.value=='') {alert('Please enter Your Email Address'); document.refer.fromEmail.focus(); return; }
 
checkEmail(this);
checkEmail2(this);

if (ekf == 1) {alert('Please enter a valid Email Address'); ekf=3;document.refer.fromEmail.focus(); return; }
if (bekf == 2) {alert('Please enter a valid Email Address (Recipient)'); bekf=3;document.refer.sendTo.focus(); return; }

if (ekf == 3 && bekf==3) {
 document.refer.submit();}
  }
  
  function SubmitMe2() { 
   if (document.refer.fromEmail.value=='') {alert('Please enter Your Email Address'); document.refer.fromEmail.focus(); return; }
 
checkEmail(this);

if (ekf == 1) {alert('Please enter a valid Email Address'); ekf=3;document.refer.fromEmail.focus(); return; }
if (ekf == 3) {
 document.refer.submit();}
  }
  
  
    function SubmitMe2b() { 
   if (document.refer.fromEmail.value=='') {alert('Please enter Your Email Address'); document.refer.fromEmail.focus(); return; }
 
checkEmail(this);

if (ekf == 1) {alert('Please enter a valid Email Address'); ekf=3;document.refer.fromEmail.focus(); return; }
if (ekf == 3) { document.refer.frmaction.value="valcode";
 document.refer.submit();}
  }
  
  
function reloadCAPTCHA() {
document.getElementById('imgCaptcha').src='../cgi/zxcaptcha.asp?'+Date();
}
  
  
 

 



function BCCheck(frmname) 
{
if(window.XMLHttpRequest)
{
oRequest = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
oRequest = new ActiveXObject("Microsoft.XMLHTTP");
}

oRequest.open("POST", "ajax.asp", true);
oRequest.onreadystatechange = UpdateCatchaResp;

oRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
oRequest.send("strCmd=availability&catcha=" + document.getElementById('captchacode').value);
}



function BCCheck2(frmname) 
{   
if(window.XMLHttpRequest)
{
oRequest = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
oRequest = new ActiveXObject("Microsoft.XMLHTTP");
}

oRequest.open("POST", "ajax.asp", true);
oRequest.onreadystatechange = UpdateCatchaResp;

oRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
oRequest.send("strCmd=availability&catcha=" + document.getElementById('captchacode').value);
}

 

function reloadCAPTCHA() {
if (document.getElementById('imgCaptcha')) document.getElementById('imgCaptcha').src='../cgi/zxcaptcha.asp?'+Date();}


function UpdateCatchaResp()
{
if(oRequest.readyState == 4)
{ 
if(oRequest.status == 200)
{
var respval=oRequest.responseText;


if (respval=="error") {alert("Wrong Code!");reloadCAPTCHA();

if (document.getElementById('cdtext')) document.getElementById('cdtext').innerHTML="<span class=\"Body11RD2\">Invalid code, please type the characters you see in the picture below:</span>"

document.getElementById('captchacode').focus();return;}  else {document.getElementById('frmaction').value="valcode"; 
var frmval="";
if (document.getElementById('frmname')) frmval=document.getElementById('frmname').value;

if (frmval!="") {document.getElementById(frmval).submit()  }  else {

frm = document.forms[1];

frm.submit(); }}

}
else
{
alert("Asychronous Error");
}
}
}
  
function SubmitMe2c(frmname) {  
	  
   if (document.refer.fromEmail.value=='') {alert('Please enter Your Email Address'); document.refer.fromEmail.focus(); return; }
 
checkEmail(this);

if (ekf == 1) {alert('Please enter a valid Email Address'); ekf=3;document.refer.fromEmail.focus(); return; }
if (ekf == 3) { BCCheck(frmname); 
}
  }
  
  
  function SubmitMe3(frmname){MM_validateForm('Name','','R','Address','','R','City','','R','Zip','','R','Phone','','R','Email','','RisEmail','Model','','R','Finish','','R','Serial','','R','Caliber','','R','Date of Purchase','','R','Dealer Name','','R');
  if (document.MM_returnValue == true) { 

 document.warranty.submit();}
  }
  
  
    function askDoug(){MM_validateForm('QuestionForDoug','','R','FirstName','','R','LastName','','R','Email','','RisEmail');
  if (document.MM_returnValue == true) { 
  BCCheck('refer');} }
  
  
    function SubmitMe3b(frmname){MM_validateForm('Name','','R','Address','','R','City','','R','Zip','','R','Phone','','R','Email','','RisEmail','Model','','R','Finish','','R','Serial','','R','Caliber','','R','Date of Purchase','','R','Dealer Name','','R');
  if (document.MM_returnValue == true) {BCCheck(frmname); }
  }
  
  
   function SubmitMe4(frmname){MM_validateForm('FirstName','','R','LastName','','R','EmailAddress','','RisEmail','SiteURL','','R','SiteTitle','','R','SiteDescription','','R','LinkBackUrl','','R');
  if (document.MM_returnValue == true) {BCCheck(frmname); }
  }
  
     function SubmitMe5(){MM_validateForm('FirstName','','R','LastName','','R','BusinessName','','R','EmailAddress','','RisEmail','Phone','','R','Address','','R','City','','R','Zip','','R','Sales','','R','Employees','','R');
  if (document.MM_returnValue == true) {

 document.register.submit();}
  }
  
  
       function SubmitMe5b(frmname){MM_validateForm('FirstName','','R','LastName','','R','BusinessName','','R','EmailAddress','','RisEmail','Phone','','R','Address','','R','City','','R','Zip','','R','Sales','','R','Employees','','R');
  if (document.MM_returnValue == true) { BCCheck(frmname); }
  }
  
  
    
    function SubmitMe6() { 
   if (document.pass.PASSWORD.value=='') {alert('Please enter Your Access Code'); document.pass.PASSWORD.focus(); return; }
 

 document.pass.submit();
  }
  
     function PassDoug() { 
   if (document.pass.PASSWORD.value=='') {alert('Please enter Your Access Code'); document.pass.PASSWORD.focus(); return; }
 document.pass.submit();
  }
  
  
       function SubmitMe7(frmname){MM_validateForm('FirstName','','R','LastName','','R','EmailAddress','','RisEmail','Phone','','R','Model','','R','Finish','','R','Caliber','','R','SerialNum','','R','Year','','R');
  if (document.MM_returnValue == true)  {BCCheck(frmname); }
  }
  
  
         function SubmitMe8(frmname){MM_validateForm('FirstName','','R','LastName','','R','Street','','R','City','','R','State','','R','Zip','','R','EmailAddress','','RisEmail','Phone','','R');
		  if (document.MM_returnValue == true) {
 document.form1.submit();}  }
 
    function SubmitMe9(frmname){MM_validateForm('FirstName','','R','LastName','','R','Street','','R','City','','R','State','','R','Zip','','R','EmailAddress','','RisEmail','Phone','','R');
	if (document.MM_returnValue == true) {
 document.form1.submit();}  }
	
	
	    function SubmitMe10(frmname){MM_validateForm('FirstName','','R','LastName','','R','Email','','RisEmail','Phone','','R','City','','R','Zip','','R');
  if (document.MM_returnValue == true) {BCCheck(frmname); }
  }
  
  	    function SubmitMe11(frmname){MM_validateForm('FirstName','','R','LastName','','R','City','','R','State','','R','Zip','','R','EmailAddress','','RisEmail','Phone','','R');
  if (document.MM_returnValue == true) {BCCheck(frmname); }
  }


		 
 
  function Register2(frmname)  {  
 MM_validateForm('EmailAddress','','RisEmail','FullName','','R','StreetAddress','','R','City','','R','State','','R','Zip','','R','Phone','','R'); 
if (document.errorvalue)  alert('The following error(s) occurred:\n'+document.errorvalue);
 document.MM_returnValue = (document.errorvalue== '');
if (document.MM_returnValue!=false)  {BCCheck(frmname); }
}

  function Register3(frmname)  {  
 MM_validateForm('EmailAddress','','RisEmail','FullName','','R','StreetAddress','','R','City','','R','State','','R','Zip','','R','Phone','','R'); 
if (document.errorvalue)  alert('The following error(s) occurred:\n'+document.errorvalue);
 document.MM_returnValue = (document.errorvalue== '');
if (document.MM_returnValue!=false)  {BCCheck2(frmname); }
}



function RegisterAR()  {  
 MM_validateForm('EmailAddrAR','','RisEmail'); 
 if (document.errorvalue)  alert('The following error(s) occurred:\n - Email Address is required (already registered).');
if (document.MM_returnValue!=false) {
document.form1.formaction.value="existing";
document.form1.submit();}}

function RegisterAR2()  {  
 MM_validateForm('EmailAddrAR','','RisEmail'); 
 if (document.errorvalue)  alert('The following error(s) occurred:\n - Email Address is required (already registered).');
if (document.MM_returnValue!=false) {
document.form1.frmaction.value="existing";
document.form1.submit();}}

  function SubmitForum(frmname)  {  
 //MM_validateForm('Email','','RisEmail','Email3','','RisEmail','Name','','R','Password','','R','Password2','','R'); 
//if (document.errorvalue)  alert('The following error(s) occurred:\n'+document.errorvalue);
 //document.MM_returnValue = (document.errorvalue== '');
//if (document.MM_returnValue!=false)  {
	alert(frmname);BCCheck2(frmname); 
	//}
}

  
  

  

