uniform = function(settings) {
  settings = jQuery.extend({
    valid_class    : 'valid',
    invalid_class  : 'invalid',
    focused_class  : 'focused',
    holder_class   : 'field',
    field_selector : 'input, select, textarea'
  }, settings);
  
  return this.each(function() {
    var form = jQuery(this);
   
    // Focus specific control holder
    var focusControlHolder = function(element) {
      var parent = element.parent().parent();
      
      while(typeof(parent) == 'object') {
        if(parent) {
          if(parent[0] && (parent[0].className.indexOf(settings.holder_class) >= 0)) {
            parent.addClass(settings.focused_class);
            return;
          } // if
        } // if
     
        parent = jQuery(parent.parent());
      } // while
    };
    
    // Select form fields and attach them higlighter functionality
    form.find(settings.field_selector).focus(function() {
      form.find('.' + settings.focused_class).removeClass(settings.focused_class);
      focusControlHolder(jQuery(this));
    }).blur(function() {
      form.find('.' + settings.focused_class).removeClass(settings.focused_class);
    });
  });
};

// Auto set on page load...
$(function() {
   
   var a=$('.form-style').attr('class');
   

  if(a!=undefined)
  {
  
      
     

     
      $('.form-style input:text,.form-style textarea,').focus(function(){
     RemoveHighLightedClass();
     
        $(this).parent().parent().parent().addClass('focused')
     }).blur(function()
     {
         RemoveHighLightedClass();
        $(this).parent().parent().parent().addClass('focused')
     
     });
     
     
      $('.form-style input,.form-style select,').not('input:text').focus(function(){
     
             RemoveHighLightedClass();
                $(this).parent().parent().addClass('focused')
       })
     
     

     
      
  }



 
});


function RemoveHighLightedClass()
{

 var a=$('.form-style').attr('class');
   

  if(a!=undefined)
  {
           $('.form-style input:text,.form-style textarea,').each(function(){
           
               $(this).parent().parent().parent().removeClass('focused');
           });
             
          $('.form-style input,.form-style select,').not('input:text').each(function(){
            
                 $(this).parent().parent().removeClass('focused')
           });
  }
}