function getParameterMap(form) {
    var p; 
    var map = new Object();
    if (document.forms[form]!=null){
       p = document.forms[form].elements;
    }else {
       p =  document.getElementById(form).elements;
    }
    for(var x=0; x < p.length; x++) {
        var key = p[x].name;
        var val = p[x].value;
        
        //Check if this field name is unique.
        //If the field name is repeated more than once
        //add it to the current array.
        var curVal = map[key]; 
        if (curVal) { // more than one field so append value to array
        	curVal[curVal.length] = val;
        } else { // add field and value
        	map[key]= [val];
        }
    }
    return map;
}

function setFormAction(form, action, method) {
	if (action) {
		if (document.forms[form]!=null){
       		document.forms[form].setAttribute('action', action);
    	}else {
      		document.getElementById(form).setAttribute('action', action);
    	}
	}
	
	if (method) {
		if (document.forms[form]!=null){
       		document.forms[form].setAttribute('method', method);
    	}else {
      		document.getElementById(form).setAttribute('method', method);
    	}
	}
	
	if (document.forms[form]!=null) { 
		document.forms[form].ec_eti.value='';
	}else {
	   document.getElementById(form).ec_eti.value='';
	}
}


