	function ajax_users(szformname,szevent){
		oform = document.getElementById(szformname);
		if (!oform) return false;
		lvseed = document.getElementById('seed');

		if (!validatecode())
			return false;
		//Lets make sure they entered an author code before we send the check
//		if (szevent == 'authcode' && lvseed.value == ''){
//			if (bshowmsg){
//				alert('Please enter The author Code');
//			}	
//			return false;
//		}

		if (!oform.heid) return false;
		oform.heid.value = szevent;

		lvhashimg = document.getElementById('imgvalid');
		if (lvhashimg)
			lvhashimg.src= 'images/loading-please-wait.gif';
		
		
	    http( 'POST' , 'include/ajax/ajax_users_server.cfm', ajax_userscb,oform);
	    
	}

	function ajax_userscb(obj) {
  	 	var imsgshown = 0;
  	 	var bshowerror = 0;
		lvimgname = document.getElementById('imgname');
		lvhashimg = document.getElementById('hashimg');
		lvauthorok = document.getElementById('authcodeok');

		if (!lvhashimg || !lvhashimg) return false;

		//Now put the image back
		if (lvimgvalid)
			lvimgvalid.src= 'images/no_star.gif';

		if (obj && obj.error == 2 && obj.buyerid && obj.auth != 0){
			//New Code
			if (obj.heid == 'newact'){
				//alert('being redirected');
				//account created
				//lets redirect them to see if it bypasses system now they should login.
				//location.href="index2.cfm?pg=search";
				if (lvauthorok)
					lvauthorok.value = '1';
				var ocontact = document.getElementById("contact");
				ocontact.submit();
				return true;
			}	

		}

		if (obj.auth == 0){
			validauthorcode();
		}
			
		//Keep hash image same as in form.
		lvhashimg.src = lvimgname.value;

		if (obj && obj.error == 1){
		  	bshowerror = 0;
		}
		else if (obj && obj.error == 0){
		 	bshowerror = 1;
		}

		if (bshowerror){
			alert(obj.errormsg);
		}

		return false;
	}
	
