/** * Copy the value of an input field's title attribute to its value attribute. * Clear the input field on focus if its value is the same as its title. * Repopulate the input field on blur if it is empty. * Hide the input field's associated label if it has one. */ var autoPopulate = { sInputClass:'populate', // Class name for input elements to autopopulate /** * Main function */ init:function() { // Check for DOM support if (!document.getElementById || !document.createTextNode) {return;} // Find all input elements with the given className var arrInputs = autoPopulate.getElementsByClassName(document, 'input', autoPopulate.sInputClass); var iInputs = arrInputs.length; var oInput; for (var i=0; i