﻿// JavaScript Document


/*--------------------------------*/



/* FORM SELECTOR CODE */
var formArray = new Array ();   /* define the array of forms you will have in the page the name in the array will  		                                   correspond to the div ID   */
formArray[0] = null;
formArray[1] = "enfoidiomas";
formArray[2] = "enfolang";
formArray[3] = "noform";



function showForm( formName ){  /* sets the display value of all the objects of the array to "hidden", then sets                                   visible the object called with formName (assigned when you call the function ) */

var max= formArray.length 
for ( var i = 1;i < max;i++)
{ var forms = formArray[i];
document.getElementById(forms).style.display = "none";  
};

var active = formName
document.getElementById(active).style.display = "";          // show the form
};



function formChange(){                           /* calls the showForm function with a different attribute,                                                 depending on the value of the "fselector" element inside the page */
var selectedForm = document.getElementById("fselector").value;	
showForm(selectedForm);
};














