//  Date: 03/01/2012 Name: srl_npms.js//  Copyright 1994 - 2012 Scorpion Research Limited All Rights Reserved Worldwide//  eMail: Support@ScorpionResearch.com http://www.ScorpionResearch.com////  This document and its usage is protected under various Copyrights on behalf//  of its respective owners. No part of this document may be reproduced//  in whole or in part without the written consent of Scorpion Research Ltd.////  For further details, please send a message to Scorpion Research Ltd via eMail//  addressed to Support@ScorpionResearch.com specifying your particular//  requirements.function PaymentFormCheck(){if (document.paymentform.PaymentTotal.value == "")  {  alert("Please enter the payment value!");  document.paymentform.PaymentTotal.focus();  return false;  }if (isNaN(Number(document.paymentform.PaymentTotal.value)) == true)  {  document.paymentform.PaymentTotal.value='';  alert("Sorry, the Payment must be a number more than 0.00 to proceed!");  document.paymentform.PaymentTotal.focus();  return false;  }if (Number(document.paymentform.PaymentTotal.value) <= 0.00)  {  alert("Sorry, the Payment must be more than 0.00 to proceed!");  document.paymentform.PaymentTotal.focus();  return false;  }if (document.paymentform.FullName.value == "")  {  alert("Please enter your Full Name!");  document.paymentform.FullName.focus();  return false;  }if (document.paymentform.Tel.value == "")  {  alert("Please enter your Telephone number!");  document.paymentform.Tel.focus();  return false;  }if (document.paymentform.eMailAddress.value == "")  {  alert("Please include your eMailAddress address!");  document.paymentform.eMailAddress.focus();  return false;  }if (document.paymentform.eMailAddress.value.indexOf("@") == -1 || document.paymentform.eMailAddress.value.length <= 5)  {  alert("Please include a proper Internet eMail address!");  document.paymentform.eMailAddress.focus();  return false;  }if (document.paymentform.PmtRef.value == "")  {  alert("Please enter your Payment Reference information!");  document.paymentform.PmtRef.focus();  return false;  }CardNumber=document.paymentform.CCNumber.value;if (VerifyCardNum(CardNumber) != true)  {  alert("Your Card Number does not appear to be correct!");  document.paymentform.CCNumber.focus();  return false;  }if (document.paymentform.CCExpDate.value == "")  {  alert("Please enter the Expiry Date of your card!");  document.paymentform.CCExpDate.focus();  return false;  }if (document.paymentform.CCExpDtYr.options[document.paymentform.CCExpDtYr.selectedIndex].value == "") {  alert("Please enter the Expiry Year of your card!");  document.paymentform.CCExpDtYr.focus();  return false;}if (document.paymentform.CCExpDtMn.options[document.paymentform.CCExpDtMn.selectedIndex].value == "") {  alert("Please enter the Expiry Month of your card!");  document.paymentform.CCExpDtMn.focus();  return false;  }if (document.paymentform.CCSecCC.value != "") {  if (document.paymentform.CCSecCC.value.length < 3 || document.paymentform.CCSecCC.value.length > 4) {    alert("Please enter your Security Code exactly as it appears on your card!");    document.paymentform.CCSecCC.focus();    return false;  }  if ((document.paymentform.CCCreditCard.options[document.paymentform.CCCreditCard.selectedIndex].value == "Amex") && (document.paymentform.CCSecCC.value.length != 4)) {    alert("American Express Cards have a 4 digit Security Code printed on the front of the card.");    document.paymentform.CCSecCC.focus();    return false;  }  if ((document.paymentform.CCCreditCard.options[document.paymentform.CCCreditCard.selectedIndex].value != "Amex") && (document.paymentform.CCSecCC.value.length != 3)) {    alert("Enter the 3 digits (Visa MasterCard) from the rear of the card, or the 4 digits (American Express) from the front of the card!");    document.paymentform.CCSecCC.focus();    return false;  }} else {  alert("Please enter your Security Code exactly as it appears on your card!");  document.paymentform.CCSecCC.focus();  return false;}if (document.paymentform.CCName.value == "")  {  alert("Please enter your Name exactly as it appears on your card!");  document.paymentform.CCName.focus();  return false;  }TransferProtocol=self.location.protocol.toLowerCase();if (TransferProtocol.indexOf('http') == -1)  {  alert('Sorry, you do not appear to be connected to the Server and the payment system cannot operate in an Offline mode!');  return false;  }}function VerifyCardNum(CardNumber){CardData='';for (i = 0; i < CardNumber.length; i++)  {  TestChar = CardNumber.charAt(i);  if ((TestChar >= "0") && (TestChar <= "9"))    {    CardData += CardNumber.charAt(i);    }  }if (CardData.length > 9)  {  CheckDigit=0;  for (i = 1; i <= CardData.length; i++)    {    CharPosition=CardData.length-i;    TestChar = CardData.charAt(CharPosition);    Mod2Result=(i-((parseInt(i/2))*2));    if (Mod2Result == 0)      {      MultiplierValue=2*eval(TestChar);      if (MultiplierValue > 9)        {        MultiplierValue=MultiplierValue-9;        }      }    else      {      MultiplierValue=eval(TestChar);      }    CheckDigit=CheckDigit+MultiplierValue;    }  }else  {  CheckDigit=1;  }Mod10Result=(CheckDigit-((parseInt(CheckDigit/10))*10));if (Mod10Result != 0)  {  return false;  }else  {  return true;  }}
