$(document).ready(function() {
    /*var email = $("#reg_text");
    if (email.length > 0) {
        email.focus(function(){
            var obj = $(this);
            if (obj.val() == '- email -') {
                obj.val('');
            }
        });
        
        email.blur(function() {
            var obj = $(this);
            if (obj.val() == '- email -' || obj.val() == '') {
                obj.val('- email -');
            }
        });
    }
    
    var pwd = $("#reg_pas");
    if (pwd.length > 0) {
        pwd.attr('type', 'text').val('- пароль -');
        
        pwd.focus(function() {
            var obj = $(this);
            obj.attr('type', 'password');
            if (obj.val() == '- пароль -') {
                obj.val('');
            }
        });
        
        pwd.blur(function() {
            var obj = $(this);
            obj.attr('type', 'text');
            if (obj.val() == '- пароль -') {
                obj.val('- пароль -');
            }
        });
    }
    */
   
   $('#loading').ajaxStart(function() {$(this).show();});
   $('#loading').ajaxStop(function() {$(this).fadeOut();});
});


ghtml = {
    options: function(list, selected, first) {
        var code = '';
        if (first && first !== undefined) {
            code += '<option value="">'+first+'</option>';
        }
        $.each(list, function(i, n) {
            code += '<option value="'+i+'" ';
            if (selected && selected !== undefined && selected == i) {
                code += 'selected = "selected"';
            }
            code += '>'+n+'</option>';
        });
        return code;
    }
}

