I am looking for some feedback on my code, it is not done but most of the functionality is already there however the code seems to be long and wanted to see how I could improve and shorten it.

Code JavaScript:
function oc(a){
	var o = {};
	for(var i=0;i<a.length;i++){
		o[a[i]]='';
		}
	return o;
	}
var fields_array = new Array();
var fields_array_counter = 0;
var input_a = new Array('button', 'checkbox', 'file', 'hidden', 'password', 'radio', 'reset', 'submit', 'text')
var last_created_1 = '';
var last_created_2 = '';
var last_created_3 = '';
var last_created_4 = '';
var last_created_5 = '';
var last_created_counter = null;
var groupname_a = new Array();
var groupname_counter = 0;
var form_id = 'form_preview';
var form_action = '(No action has been set)';
var form_method = '(no method has been set)';
function form_create_input(){
	var label = document.getElementById('label').value;
	var label_loc = document.getElementById('label_loc').value;
	var groupname = document.getElementById('groupname').value;
	var groupnamelegend = document.getElementById('groupnamelegend').value;
	var field_name = document.getElementById('field_name').value;
	var type = document.getElementById('type').value;
	var text_value = document.getElementById('text_value').value;
	var text_rows = document.getElementById('text_rows').value;
	var text_cols = document.getElementById('text_cols').value;
	var showinfo = document.getElementById('showinfo').value;
	var sel_check_opt = document.getElementById('sel_check_opt').value.split(', ');
	var sel_check_opt_counter = sel_check_opt.length - 1;
	var form_preview = document.getElementById(form_id).innerHTML;	
	//var button_remover = '<a id="' + field_name + 'button_remove" class="button_remove buttons" href="#" onclick="remove_field(' + "'" + field_name + "'" + ')" ><span >Remove field</span></a>';
	var button_remover = '<a class="button_remove buttons" href="#" onclick="remove_field(this);return false;" ><span >Remove field</span></a>';
	var button_up = '<a class="button_up buttons" href="#" onclick="move_field(this, ' + "'previous'" + ');return false;" ><span >Move up</span></a>';
	var button_down = '<a class="button_down buttons" href="#" onclick="move_field(this, ' + "'next'" + ');return false;" ><span >Move down</span></a>';
	last_created_5 = last_created_4;
	last_created_4 = last_created_3;
	last_created_3 = last_created_2;
	last_created_2 = last_created_1;
	last_created_1 = form_preview;
	if (showinfo != ''){
		showinfo = '<span>' + showinfo + '</span>';
		}
	if (groupname != ''){
		if (groupname in (oc(groupname_a))){}
		else{
			groupname_a[groupname_counter] = document.getElementById('groupname').value;
			groupname_counter ++;
			}
		}
	var newlabel = '<label id="' + field_name + 'l" >';
	if (type in (oc(input_a))){
		var newfield = '<input type="' + type + '" id="' + field_name + '" name="' + field_name + '" value="' + text_value + '" />';
		if (label_loc == '1'){
			newfield = newlabel + label + showinfo + newfield + button_remover + button_up + button_down + '</label>';
			}
		else {newfield = newlabel + newfield + label + showinfo + button_remover + button_up + button_down + '</label>';}
		}
	else if(type == 'textarea'){
		var newfield = '<textarea id="' + field_name + '" rows="' + text_rows + '" cols="' + text_cols + '">' + text_value + '</textarea>';
		if (newlabel != ''){
			if (label_loc == 1){
				newfield = newlabel + newfield;
				}
			}
		}
	else if(type == 'select'){
		var newfield = '<select id="' + field_name + '" >';
		var count_opt = 0;
		var options = '';
		while (sel_check_opt_counter >= count_opt){
			options = options + '<option value="' + sel_check_opt[count_opt] + '">' + sel_check_opt[count_opt] + '</option>';
			count_opt ++;
			}
		newfield = newfield + options + '</select>';
		if (newlabel != ''){
			if (label_loc == 1){
				newfield = newlabel + newfield;
				}
			}
		}
	fields_array[fields_array_counter] = new Array(groupname, groupnamelegend, newfield);
	fields_array.sort();
	fields_array_counter ++;
	last_created_counter = 1;
	this_fieldset = '';
	document.getElementById(form_id).innerHTML = form_preview + newfield;
	}	
function revert_change(){
	if(last_created_counter == null){
		alert('Sorry canīt undo, you have not done any changes.');
		}
	else if (last_created_counter == 1){
		document.getElementById(form_id).innerHTML = last_created_1;
		last_created_counter ++;
		}
	else if (last_created_counter == 2){
		document.getElementById(form_id).innerHTML = last_created_2;
		last_created_counter ++;
		}
	else if (last_created_counter == 3){
		document.getElementById(form_id).innerHTML = last_created_3;
		last_created_counter ++;
		}
	else if (last_created_counter == 4){
		document.getElementById(form_id).innerHTML = last_created_4;
		last_created_counter ++;
		}
	else if (last_created_counter == 5){
		document.getElementById(form_id).innerHTML = last_created_5;
		last_created_counter ++;
		}
	else {
		alert('Sorry canīt undo, use the red x on the field that you like to delete.');
		}
	}
function remove_field(id){
	var nodetoremove = id.parentNode;
	var parent = document.getElementById(form_id);
	parent.removeChild(nodetoremove);
	}
function form_configurator(form_option){
	var new_value = document.getElementById(form_option).value;
	var the_form = document.getElementById(form_id);
	if (form_option == 'form_id'){
		the_form.id = new_value;
		form_id = new_value;
		}
	else if (form_option == 'form_action'){
		the_form.action = new_value;
		form_action = new_value;
		}
	else if (form_option == 'form_method'){
		the_form.method = new_value;
		form_method = new_value;
		}
	var the_info = 'Current form id is "' + form_id + '" current action is "' + form_action + '", current method is "' + form_method + '"';
	document.getElementById('form_info').innerHTML = the_info;
	}
var warningsent = '1';
function move_field(node, direction) {
	var nodetomove = node.parentNode;
	if (direction == 'previous'){
		if (nodetomove.previousSibling.id == null){
			if(warningsent == '2'){}
			else{alert('Nowhere to move!');warningsent = '2';}
			}
		else {
			var thenode = nodetomove.previousSibling;
			document.getElementById(form_id).insertBefore(nodetomove, thenode);
			warningsent = '1';
			}
		}
	else{
		if (nodetomove.nextSibling == null){
			if(warningsent == '2'){}
			else{alert('Nowhere to move!');warningsent = '2';}
			}
		else{
			var thenode = nodetomove.nextSibling;
			thenode = thenode.nextSibling;
			document.getElementById(form_id).insertBefore(nodetomove, thenode);
			warningsent = '1';
			}
		}
	}