$(function(){

   	$("#submit_timetobuy").bind("click", function(){
   	
		form = $('#form-timetobuy').formToArray();
	   		
		url = "/action/externallead/?";
		$.getJSON(url, form, function(data){
			
			if (data.responsecode >= 200) {
				// b.removeAttr('disabled').val('Try Again').blur().parent('p').before('<p class="error-message">Oops, there was an error sending your message. Want to try again?</p>');
			} 
			else {
				window.location = '/timetobuy/thankyou/';
			}		
		});
	});
});


