	function setNameValues() {
    	oName = document.getElementById('name');
    	oNameElements = oName.value.split(" ");
    	
    	oFirstName = document.getElementById('firstname');
    	oFirstName.value = oNameElements[0];
    	
    	cLastName = '';
    	for (i=1;i<oNameElements.length;i++) {
    		cSpace = " ";
    		if (i==1) {
    			cSpace = '';
    		}
        	cLastName = cLastName + cSpace + oNameElements[i];
    	}
    	oLastName = document.getElementById('lastname');
    	oLastName.value = cLastName;
	}
	function submitFunction(){
		var allright = true;
		setNameValues();
		if($('promoCode')){
			allright = ajaxPromo();	
		}
		if(allright){
			stepAll('captureForm', 1);	
		}
	}
    function ajaxPromo(){
		var postVars = "promoCode="+$('promoCode').value;
		ajaxValidate = new AjaxCon();
	    ajaxValidate.connect("/plugins/3minutePromo.php", "POST", postVars, promoUpdateComplete);
	}   
	function promoUpdateComplete(XML){
		try {
	        //certain browsers
	        var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
	        xmldoc.loadXML(XML.responseText);
	    } catch(ex) {
	        //every other browser on the planet
	        var xmldoc = (new DOMParser()).parseFromString(XML.responseText, "text/xml");
	    }
	    if (xmldoc.getElementsByTagName('error')[0]){
	        var error = xmldoc.getElementsByTagName('error')[0].firstChild.nodeValue;
	        alert(error);
	  		return false;
	    } else {
	        //we didnt get an <error>, lets assume that it is ok.
	        okay = 1;
	        //alert(xmldoc.getElementsByTagName('cRepID')[0].firstChild.nodeValue);
	        $('cRepID').value = xmldoc.getElementsByTagName('cRepID')[0].firstChild.nodeValue;
	        //alert(xmldoc.getElementsByTagName('replicatedDomain')[0].firstChild.nodeValue);
	        $('replicatedDomain').value = xmldoc.getElementsByTagName('replicatedDomain')[0].firstChild.nodeValue;
	        stepAll('captureForm', 1);	
	    }
	}
