function clock() {
    var digital = new Date();
    var hours = digital.getHours();
    var minutes = digital.getMinutes();
    var seconds = digital.getSeconds();
	var today = digital.getDay();
    var date = digital.getDate();
    var month = digital.getMonth() + 1;
    var year = digital.getUTCFullYear();
    
    if (minutes < 10)
        minutes = "0" + minutes;
      
    if (date < 10)
        date = "0" + date;
    
    if (month < 10)
        month = "0" + month;
      
    if (seconds < 10)
        seconds = "0" + seconds;
		
	if (today == 0)
		today = "воскресенье,";
	else if (today == 1)
		today = "понедельник,";
	else if (today == 2)
		today = "вторник,";
	else if (today == 3)
		today = "среда,";
	else if (today == 4)
		today = "четверг,";
	else if (today == 5)
		today = "пятница,";
	else if (today == 6)
		today = "суббота,";
    
    dispTime = hours + ":" + minutes + '&nbsp;' + '&nbsp;'
        + today + '&nbsp;' + date + '.' + month + '.' + year;

    document.getElementById('time').innerHTML = dispTime;
    setTimeout("clock()", 1000);
}

function replace() {
    var els = document.getElementsByTagName("div");
    var el;
    
    for (var i = 0; i < els.length; i++){
        el = els[i];
        
        if(el.className == "jot-message"){
            el.innerHTML = el.innerHTML.replace(/\*\*(.*?)\*\*/, "<strong>$1</strong>");
        }
    }
}

function RunOnLoad() {
	clock();
    replace();
}

window.onload = RunOnLoad;

/**
* script by Lloyd http://agyuku.net/2009/05/back-to-top-link-using-jquery/
* adapted to elkipalki.net on 2011-03-15 by jen http://jenweb.info/
* Opera fix: DynamicDrive script ::jQuery Scroll to Top Control v1.1
* http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm
*/

jQuery.noConflict();
jQuery(function($) {
/*	$('#toTop').hide();
	$(window).scroll(function() {
		if($(this).scrollTop() >= 160) { // could and should! be changed
			$('#toTop').fadeIn();
			$('#toTop').click(function() {
				$(this).addClass('toTop-click');
			});
		} else {
			if($(window).scrollTop() == 0) {
				$('#toTop').removeClass('toTop-click');
			}
			$('#toTop').fadeOut();
		}
	});
*/	var mode = (window.opera) ? ((document.compatMode == "CSS1Compat") ? $('html') : $('body')) : $('html,body');
	$('#toTop').click(function() {
		mode.animate({scrollTop:0},800);
		return false;
	});
});

