// ---- for msie ---- //if (typeof console === 'undefined') { // var console = {log: function( arg ) { /* alert(arg); */ }}; //} /** * FatLocationFieldset and FatLocationManager: JS classes for location validation * 11/24/08 - Rich Clingman * * Supports: Mootools, JQuery, prototype * * By using the autoLoad function, this class will attach itself to location field sets it finds in the current document. * FieldSet elements are designated by class * CLASS PURPOSE * FatLocation encapsulates one field set -- can exist multiple times * FatCity, FatState, FatZip city, state, zip fields * FatValid hidden "is valid" value (should be set to "1" if prepopulated values are valid) * FatMetro visible metro area auto-filled when setting location * FatClear anchor that will clear the field set * FatSpinner spinner image that is shown/hidden with ajax call processing * FatSuggestions hidden div that will display suggestions -- ONE ONLY per document (extras will be ignored) * * OPTION EXTRA PROPERTY * id="Text version of fieldset" FatCity id is passed in validation response. This can be used to say "fill in [id] location" * validationGroup="[1...9999]" FatCity uses this property to group fieldsets to call a function when all in the group are valid. * CD uses this to prefetch zip-to-zip distance and pricing once both orig & dest are valid. * Any number of fieldsets can be in the validationGroup * * FatLocationFieldset JS class groups all entry, validation and setting functionality * Fieldsets do not know about other fieldsets. * * FatLocationManager JS class handles the small amount of inter-fieldset functionality * (Object is generally auto-instantiated by autoLoad functions defined below.) * When a fieldset gains focus, the prior-focused set is blurred * Suggestions are displayed and hidden through the manager * When a fieldset is valid, if in a group, other sets in the group are checked. If all valid the callback is executed. * The form onSubmit should be written to utilize a validation queueing that will wait for all ajax validation to complete * before executing the form validation function. *