$(function(){
$('#content input[type="button"]').addClass('input-button');
$('#content input[type="submit"]').addClass('input-button');
$('#content input[type="reset"]').addClass('input-button');
    $('#fadress').tabs({selected:0});
    $('#phones .con span').hover(function(){
        $(this).prepend('<div class="bubble"><b>'+$(this).attr('title')+'</b></div>');
        $('.bubble').fadeIn();
    },function(){
        $('.bubble').remove();
    });
$('.catlist li a').addClass('first-level');
$('.catlist li ul li a').removeClass('first-level');
    $('.first-level').click(function(){
        var par = $(this).parent();
        if(par.attr('id') !== 'opened'){
            if($(this).next().is('ul')){
                $('#opened ul').hide('fast');
                $('#opened').removeAttr('id');
            }
            par.attr('id','opened');
            $(this).next('ul').show('fast');
        } else {
            par.removeAttr('id');
            $(this).next('ul').hide('fast');
        }
        if($(this).next().is('ul')){
            return (par.attr('id') == 'opened');
        }
    });
})
function elfocus(el){
    if (el.value == el.defaultValue) el.value = '';
}
function elblur(el){
    if (el.value == '') el.value = el.defaultValue;
}
function check(){
    if ($('#q')[0].value == $('#q')[0].defaultValue){
        $('#q')[0].value = '';
    }
    return $('#q')[0].value != '' || $('#s')[0].value != '0';
}

