
	function check_code(region){
	    var rep=check_code_verify(region);
	    if (rep!='true'){
	        RefreshImage('imgCode');
	        return false;
	    }
	}

    function RefreshImage(valImageId) {
        var objImage = document.images[valImageId];
        if (objImage == undefined) {
            return;
        }
        var now = new Date();
        objImage.src = objImage.src + '?x=' + now.toUTCString();
    }

	function check_code_verify(region){
	var xmlhttpProduct;
	if (window.XMLHttpRequest)
		xmlhttpProduct = new XMLHttpRequest();
	// code for IE
	else if (window.ActiveXObject)
		xmlhttpProduct = new ActiveXObject("Microsoft.XMLHTTP");  
	if (xmlhttpProduct!=null){
		 xmlhttpProduct.open("POST","/"+ region +"/cms/client/drawAttributes.asp",false);  
		 xmlhttpProduct.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
		 var pData='';  
		 pData=pData+'check_code_verify'+'='+'Y'+'&';  
		 var n='CodeVerify';var v=document.getElementById(n).value;  
		 pData=pData+n+'='+escape(v);  
		 xmlhttpProduct.send(pData);
		 return xmlhttpProduct.responseText;
	}
	}

    function check_email_exists(region){
	var xmlhttpProduct;
	if (window.XMLHttpRequest)
		xmlhttpProduct = new XMLHttpRequest();
	// code for IE
	else if (window.ActiveXObject)
		xmlhttpProduct = new ActiveXObject("Microsoft.XMLHTTP");  
	if (xmlhttpProduct!=null){
		 xmlhttpProduct.open("POST","/"+ region +"/cms/client/drawAttributes.asp",false);  
		 xmlhttpProduct.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
		 var pData='';  
		 pData=pData+'check_email_exists'+'='+'Y'+'&';  
		 var n='VM_Email';var v=document.getElementById(n).value;  
		 pData=pData+n+'='+escape(v);  
		 xmlhttpProduct.send(pData);
		 return xmlhttpProduct.responseText;
	}
	}
	
	function check_reg_email(region){
	var xmlhttpProduct;
	if (window.XMLHttpRequest)
		xmlhttpProduct = new XMLHttpRequest();
	// code for IE
	else if (window.ActiveXObject)
		xmlhttpProduct = new ActiveXObject("Microsoft.XMLHTTP");  
	if (xmlhttpProduct!=null){
		 xmlhttpProduct.open("POST","/"+ region +"/cms/client/drawAttributes.asp",false);  
		 xmlhttpProduct.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
		 var pData='';  
		 pData=pData+'check_reg_email'+'='+'Y'+'&';  
		 var n='UID';var v=document.getElementById(n).value;  
		 pData=pData+n+'='+escape(v);  
		 xmlhttpProduct.send(pData);
		 return xmlhttpProduct.responseText;
	}
	}

	 function send_data(region){
	 //var userid = 1;
	 var thisForm = document.PaymentForm;
	 var DataToSend='userid='+userid+'&';  
	 
	 var n='CardName';var v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  

	 n='LastName';
	 if(document.getElementById(n) != null){
	 v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';
	 }	 
	 n='Company';
	 if(document.getElementById(n) != null){
	 v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 }
	 n='Position';
	 if(document.getElementById(n) != null){
	 v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 }
	 n='Email';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='Address';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='Street';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='Town';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='County';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='PostCode';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='Country';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='Tel';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&'; 
	 n='Mobile';
	 if(document.getElementById(n) != null){
	 v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 }
	 n='Fax';
	 if(document.getElementById(n) != null){
	 v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';
	 }
	 n='User_PO';
	 if(document.getElementById(n) != null){
	 v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 }
	 
	 n='DelName';var v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='DelCompany';
	 if(document.getElementById(n) != null){
	 v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 }
	 n='DelPosition';
	 if(document.getElementById(n) != null){
	 v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 }
	 n='DelAddress';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='DelStreet';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='DelTown';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='DelCounty';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='DelPostCode';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='DelCountry';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
	 n='DelTel';v=document.getElementById(n).value;  
	 DataToSend=DataToSend+n+'='+escape(v)+'&';  
 
	 XMLHTTPSend(DataToSend,region);
	 }  
	  
	 function XMLHTTPSend(pData,region){   
	var xmlhttpProduct;
	if (window.XMLHttpRequest)
		xmlhttpProduct = new XMLHttpRequest();
	// code for IE
	else if (window.ActiveXObject)
		xmlhttpProduct = new ActiveXObject("Microsoft.XMLHTTP");  
	if (xmlhttpProduct!=null){
	 xmlhttpProduct.open("POST","/"+ region +"/cms/client/update_reg_details_HTTP.asp",false);  
	 xmlhttpProduct.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
	 if (pData.charAt(pData.length - 1)=='&')  
	 pData= pData.substring(0, pData.length - 1);  
	 //alert(pData);  
	 xmlhttpProduct.send(pData);  
	 //alert(xmlhttpProduct.responseText);
	 }}
		