/**
 * Setting value artibutes from title attributes to form elements with class labels
 *
 * @author: ProgWeb (http://progweb.com.pl/)
 * @version: 1.0
 */
$(document).ready(function() {
    $(".labels").each(function(i) {
        if($(this).val() == '') {
            $(this).val($(this).attr('title'));
        }
    });

    $(".labels").focusin(function(){
        if($(this).val() == $(this).attr('title')) {
            $(this).val('');

        } else {
            $(this).select();
        }
    })
    
    $(".labels").focusout(function(){
        if($(this).val() == '') {
            $(this).val($(this).attr('title'));
        }
    })
});
