function fnShowProps(obj, objName){
        var result = "";
        for (var i in obj) // обращение к свойствам объекта по индексу
                try { result += objName + "." + i + " = " + obj[i] + "<br />\n"; } catch(e) {}
        document.write(result);
}

/* (c) 2007, Павел Зотов */
function init_usertables() {
        firstrowheader = 1;
        $$('.user_content table').each(function(table){
                if( table.className ) return;
                table.className = 'usertable';
//              table.border = 0;
                table.cellPadding=0;
                table.cellSpacing=0;
                var trs = table.getElements('tr');
                var start_row = 0;
                for( i=0; i<trs.length; i++ ) {
                        if( firstrowheader && i==0) { trs[0].className = 'headerrow'; start_row=1;}
                        else { 
                                trs[i].className='row' + ((i-start_row)%2); 
                                trs[i].onmouseover = function( ){ this.className += ' hovered'; }
                                trs[i].onmouseout = function( ){ this.className = this.className.replace(/hovered/img, ""); }
                        }
                        var tds = trs[i].getElements('td');
                        for( k=0; k<tds.length; k++ ) {
                                text = tds[k].innerHTML;
                                text = text.replace(/&nbsp;/g, " ");
//                              text = text.replace(/\A\s+|\s+\z/img, "");
                                text = text.replace(/<\/?div.*?>/img, "");
                                text = text.replace(/<\/?p.*?>/img, "");
                                text = text.replace(/<\/?span.*?>/img, "");
                                tds[k].innerHTML = text;
                                tds[k].width = null;
                                tds[k].height = null;
                                tds[k].xStr = null;
                                if( !k ) { tds[k].className='left'; }
                                else if( k==tds.length-1 ) { tds[k].className='right'; }
                                else { tds[k].className='center'; }
                                tds[k].className += ' td'+k;
                        }
                }
        });
}

function changePhoto( obj ) {
        $$('#photobox img').each( function(im) {
                im.src=obj.href;
        });
        $$('#photolinks a').each( function(a) {
                a.className = '';
        });
        obj.className = 'curphoto';
        return false;
}

function changeTab( a, t ) {
        $$('#tabhead a').each( function(a) {
                a.className = '';
        });
        a.className = 'opentab';
        a.blur();
        $$('div.tab').each( function(t) {
                t.className = 'tab hidden';
        });
        $(t).className = 'tab';
        return false;
}

function writeTime(){
        var ru_monthes = new Array("января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря");
        var wd = new Array( "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" );
        var d = new Date( );
        
        var hours = ( d.getUTCHours()+4 )%24;
        var days = d.getUTCDate() + Math.floor( ( d.getUTCHours()+2 )/24 );
        var hours2 = ( d.getUTCHours()+6 )%24;
        var days2 = d.getUTCDate() + Math.floor( ( d.getUTCHours()+4 )/24 );
        var minutes = d.getUTCMinutes();
        if( minutes < 10 ) minutes = '0' + minutes;
        var secundes = d.getUTCSeconds();
        if( secundes < 10 ) secundes = '0' + secundes;
        $('chasiki').innerHTML =  days + ' ' + ru_monthes[ d.getUTCMonth() ] + ' ' + d.getUTCFullYear() + ' ' + wd[d.getUTCDay()] + ' ' + hours + ':' + minutes + ':' + secundes;
        $('chasiki2').innerHTML =  days2 + ' ' + ru_monthes[ d.getUTCMonth() ] + ' ' + d.getUTCFullYear() + ' ' + wd[d.getUTCDay()] + ' ' + hours2 + ':' + minutes + ':' + secundes;
        setTimeout( 'writeTime();',1000 );
}


