$(function(){
    var loginInp = $('input[name="USER_LOGIN"]'),
    passwordInp = $('input[name="USER_PASSWORD"]'), txt;

    loginInp.click(function(){
        if ($(this).attr('value') == "логин") $(this).attr('value','');
    });
    passwordInp.click(function(){
        if ($(this).attr('value') == "пароль") $(this).attr('value','');
    });
    loginInp.blur(function(){
        if ($(this).attr('value') == "") $(this).attr('value','логин');
    });
    passwordInp.blur(function(){
        if ($(this).attr('value') == "") $(this).attr('value','пароль');
    });
    /*$('#articles-collumns .coll').each(function(n,element){
        txt = trim($(element).find('.descr').text());
        if (txt.length < 5) {
            $(element).hide();
        }            
    });*/
})

function trim( str, charlist ) {
	charlist = !charlist ? ' \s\xA0' : charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '\$1');
	var re = new RegExp('^[' + charlist + ']+|[' + charlist + ']+$', 'g');
	return str.replace(re, '');
}
