var o=w=d=0;

function startTime() {

if(!o || Math.random()>.5) o=45+Math.floor(Math.random()*90);

if(!w || Math.random()>.5) w=15+Math.floor(Math.random()*45);

if(!d || Math.random()>.5) d=15+Math.floor(Math.random()*45);

document.getElementById('txt').innerHTML="На сайте онлайн: "+o+"<br />Смотрят новости: "+w+"<br />Скачивают файлы: "+d;

setTimeout('startTime()',3000);

}


function addLink() {
    var body_element = document.getElementsByTagName('body')[0];
    var selection;
    selection = window.getSelection();
    var pagelink = "<br /><br /> Источник: <a href='"+document.location.href+"'>"+document.location.href+"</a><br />RazN.Ru"; 
    var copytext = selection + pagelink;
    var newdiv = document.createElement('div');
    newdiv.style.position='absolute';
    newdiv.style.left='-99999px';
    body_element.appendChild(newdiv);
    newdiv.innerHTML = copytext;
    selection.selectAllChildren(newdiv);
    window.setTimeout(function() {
        body_element.removeChild(newdiv);
    },0);
}
document.oncopy = addLink;

function ShowOpenID() {
    $('#OpenID').dialog({
        autoOpen: true,
        show: 'fade',
        hide: 'fade',
        width: 500,
        buttons: {
            "Отмена" : function() {
                $(this).dialog("close");
            }
        }
    });
}
