var countCurso = 1;

function createCurso() {
	var field, ul, li, label, inp, p;
	
	field = document.createElement("fieldset");
	ul = document.createElement("ul");
	ul.className = "form";
	
	/*Cria o título*/
	p = document.createElement("p");
	p.className = "titulo-curso";
	p.appendChild(document.createTextNode("Curso Aperfeiçoamento:"));
	field.appendChild(p);
	
	
	/*primeiro campo formulario*/
	li = document.createElement("li");
	label = document.createElement("label");
	label.setAttribute("for", "curso_aperfeicoamento_"+countCurso);
	inp = document.createElement("input");
	inp.setAttribute("id", "curso_aperfeicoamento_"+countCurso);
	inp.setAttribute("name", "curso_aperfeicoamento|multiple["+countCurso+"]");
	inp.setAttribute("type", "text");
	inp.setAttribute("size", "20");
	label.appendChild(document.createTextNode("Curso:"));
	li.appendChild(label);
	li.appendChild(inp);
	ul.appendChild(li);
	
	/*segundo campo formulario*/
	li = document.createElement("li");
	label = document.createElement("label");
	label.setAttribute("for", "instituicao_aperfeicoamento_"+countCurso);
	inp = document.createElement("input");
	inp.setAttribute("id", "instituicao_aperfeicoamento_"+countCurso);
	inp.setAttribute("name", "instituicao_aperfeicoamento|multiple["+countCurso+"]");
	inp.setAttribute("type", "text");
	inp.setAttribute("size", "20");
	label.appendChild(document.createTextNode("Instituição:"));
	li.appendChild(label);
	li.appendChild(inp);
	ul.appendChild(li);
	
	/*Terceiro campo do formulário*/
	li = document.createElement("li");
	label = document.createElement("label");
	label.setAttribute("for", "periodo_aperfeicoamento_"+countCurso);
	inp = document.createElement("input");
	inp.setAttribute("id", "periodo_aperfeicoamento_"+countCurso);
	inp.setAttribute("name", "periodo_aperfeicoamento|multiple["+countCurso+"]");
	inp.setAttribute("type", "text");
	inp.setAttribute("size", "20");
	label.appendChild(document.createTextNode("Período:"));
	li.appendChild(label);
	li.appendChild(inp);
	ul.appendChild(li);
	
	/*Quarto campo do formulário*/
	li = document.createElement("li");
	label = document.createElement("label");
	label.setAttribute("for", "carga_horaria_"+countCurso);
	inp = document.createElement("input");
	inp.setAttribute("id", "carga_horaria_"+countCurso);
	inp.setAttribute("name", "carga_horaria|multiple["+countCurso+"]");
	inp.setAttribute("type", "text");
	inp.setAttribute("size", "20");
	label.appendChild(document.createTextNode("Carga Horária:"));
	li.appendChild(label);
	li.appendChild(inp);
	
	ul.appendChild(li);
	field.appendChild(ul);
		
	if ((inp = document.getElementById("cursos_aper")))inp.appendChild(field);
	
	countCurso++;
}

