<!--

var RV=true;
var SelectSize=0;
var msg

        function RefreshImage(valImageId) {                     <!-- Get new Captcha Image    -->
	var objImage = document.images[valImageId];
	if (objImage == undefined) return;
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();    
        }


   function Catalog_Check(){
                 var subStr = "";
                 if (document.Form2.Catalog1.checked) subStr="ok"
                 if (document.Form2.Catalog2.checked) subStr="ok"
                 if (document.Form2.Catalog3.checked) subStr="ok"
                 if (document.Form2.Catalog4.checked) subStr="ok"
                 if (document.Form2.Catalog5.checked) subStr="ok"
                 if (document.Form2.Catalog6.checked) subStr="ok"
                 if (document.Form2.Catalog7.checked) subStr="ok"
                 if (document.Form2.Catalog8.checked) subStr="ok"
				 if (document.Form2.Catalog9.checked) subStr="ok"
                 if (document.Form2.Catalog10.checked) subStr="ok"
				 if (document.Form2.Catalog11.checked) subStr="ok"
                

                 if ( subStr == "")
                   { 
                      subStr =  "No Catalog Selected  "; 
                      alert(subStr);
                      return false;     
       		}
                  return true;
                 }
 
                function Main_Check() {
                var K=AjaxRequest('Captcha/Captcha.asp?Opt=Verify') ;
                if (RV==false) return false; 
                if(Catalog_Check() == false) return false; 
                if(CheckForm() == false) return false; 
         	    
           country=document.Form2.Country.value;
           if (country=="United States" || country=="Canada" || country=="Mexico") return true; 
                     document.Form2.action="https://sdp-si.com/CreditCard.asp";
                     document.Form2.submit(); 
                     return false;
        	
                }
                
                     

               function CheckForm(){
                var subStr = "";
               
                if (document.Form2.elements["First_Name"].value == ""){
                        subStr = subStr + "First Name, ";
                }

                if (document.Form2.elements["Last_Name"].value == ""){
                        subStr = subStr + "Last Name, ";
                }

              if (document.Form2.elements["email"].value == ""){
                        subStr = subStr + "Email, ";
                }
             if (document.Form2.elements["Phone_Number"].value == ""){
                        subStr = subStr + "Phone, ";
                }
                if (document.Form2.elements["Address"].value == ""){
                        subStr = subStr + "Address, ";
                }

                if (document.Form2.elements["City"].value == ""){
                        subStr = subStr + "City, ";
                }

                if (document.Form2.elements["State"].selectedIndex == 0){
                             subStr = subStr + "State, ";
                }

                if (document.Form2.elements["Zip_Code"].value == ""){
                        subStr = subStr + "Zip, ";
                }

                if (document.Form2.elements["Country"].value == ""){
                        subStr = subStr + "Country  ";
                }



		if (subStr != "") {

                        messStr="The following fields are required:\n ";
                        endStr="\n Please enter the requested information.";
                        alert(messStr + subStr + endStr);
                        location.href="#Info";
                        return false;

                     	}
		
	          
               
			return true;

                }

function badEmail(theEmail) 
{
 var sEmail = "" + theEmail;
 if (sEmail.indexOf('@') == -1) return true;
 if (sEmail.indexOf('.') == -1) return true; 
}

//Ajax  Script for Comparing Captcha Code

 var http_request = false;
 
    function AjaxRequest(url) { 
       window.status="Getting data from Server";
       http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        
        //http_request.onreadystatechange = alertContents;
        http_request.open('GET', url, false);                 <!-- Synchronous (use false)  ASynchronous  (use true)    -->
        http_request.send(null);

            if (http_request.readyState == 4) {
            if (http_request.status == 200) {
            var R=http_request.responseText;
            
            var e = document.getElementById("captchacode");
            var captcha=e.value; 
            if (R==captcha) RV=true;                <!-- Security Code OK   -->
            else
                       
            {
            alert("Security Code Mis-Match!\n Please try again");
            RefreshImage('imgCaptcha');
            RV=false;                             <!-- Security Code Mis-Match    -->
            e.value="";
            }
               } else {
                alert('There was a problem with the request.' );
            }
        }
window.status="";
    }
// -->



