/*
 * Remove all children from requested parent.
 */
function removeAllChildren( el ) {
	while ( el.hasChildNodes() ) {
		el.removeChild(el.firstChild);
	}
}

/*
 * Creates one element
 * elType = The element type.
 * elAttrsName = An array of attributes.
 * elAttsValues = An array of values associated to the array of attributes.
 * elValue = The value contained in the created element.
 */
function createOneElement( elType, elAttrsNames, elAttrsValues, elValue ) {
	var elContainer = "";
	var attrsLen = elAttrsNames.length;
	
	// Create div element
	elContainer = document.createElement( elType );
	// Set its attributes
	for ( var i=0; i < attrsLen; i++ ) {
		if (elAttrsNames[i] == "class") {
			elContainer.className = elAttrsValues[i];
		} else {
			elContainer.setAttribute( elAttrsNames[i],elAttrsValues[i] );
		}
	}
	// Add text
	if (elValue != null) { elContainer.innerHTML = elValue; }

	return elContainer;
}
