
function onloadActions()
{
    createBlocks();
    return;
    document.getElementById('counters-div').innerHTML = '<script type="text/javascript">' +
'<!-- Nnv=navigator;Nna=Nnv.appName;Nd=document;Nd.cookie="b=b";Nc=0;if(Nd.cookie)Nc=1;' +
'Nn=(Nna.substring(0,2)=="Mi")?0:1;Ns=screen;Npx=(Nn==0)?Ns.colorDepth:Ns.pixelDepth;' +
'str=\'<img src="http://cnt.nov.ru/3442;\'+Ns.width+\'x\'+Ns.height+\';\'+Npx+\';\'+Nc+\';\';' +
'str=str+escape(Nd.referrer)+\';\'+Math.random()+\'" width="88" height="31" border="0">\'\;' +
'document.write("<a href=http://top.novgorod.ru/c/cshow>"+str+"</a>");' +
'// -->' +
'</script>' +
'<script type="text/javascript"><!--' +
'document.write("<a href=\'http://www.liveinternet.ru/click\' "+' +
'"target=_blank><img src=\'http://counter.yadro.ru/hit?t26.1;r"+' +
'escape(document.referrer)+((typeof(screen)=="undefined")?"":' +
'";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?' +
'screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+' +
'";"+Math.random()+' +
'"\' alt=\'\' title=\'LiveInternet: показано число посетителей за"+' +
'" сегодня\' "+' +
'"border=0 width=88 height=15><\/a>")//--></script>';
;
}

function createBlocks()
{
    var blocks = $("div.block");
    var block = null;
    for (var i = 0; i < blocks.length; i++) {
        block = blocks[i];
        var side = block.parentNode.className
        var blockInner = block.childNodes[0];
        block.style.backgroundImage = 'url(/templates/images/block_top_' + side + '.png)';
        var classes = block.className.split(' ');
        block.style.backgroundImage = 'url(/templates/images/block_top_' + side + '.png)';
        blockInner.style.backgroundImage = 'url(/templates/images/block_bottom_' + side + '.png)';
        if (classes.length == 3) {
            if (classes[2] == 'bp-first') {
                block.style.backgroundImage = 'url(/templates/images/block_top_' + side + '_f.png)';
            }
            if (classes[2] == 'bp-last') {
                blockInner.style.backgroundImage = 'url(/templates/images/block_bottom_' + side + '_l.png)';
            }
        } else {
            block.style.backgroundImage = 'url(/templates/images/block_top_' + side + '.png)';
            blockInner.style.backgroundImage = 'url(/templates/images/block_bottom_' + side + '.png)';
        }
        block.className += ' png';
        blockInner.className += ' png';
        //block.style.behavior = 'url(/css/pngfix.htc)';
        //blockInner.style.behavior = 'url(/css/pngfix.htc)';
    }
}

function showHide(id)
{
    obj = $('div#' + id)[0];
    if (obj.style.display == 'block')  {
        $('div#' + id).hide('fast')
    } else {
        $('div#' + id).show('fast')
    }
    return true;
}

function showComments(newsId)
{
    id = 'comments-content';
    obj = $('div#' + id)[0];
    if (obj.style.display == 'block')  {
        //$('div#' + id).hide('fast')
        obj.style.display = 'none';
    } else {
        //$('div#' + id).show('fast');
        obj.style.display = 'block';
        getComments(newsId);
    }
    //showHide('comments-content');    
}


/** Placeholder */

function ge()
{
  var ea;
  for( var i = 0; i < arguments.length; i++ ) {
    var e = arguments[i];
    if( typeof e == 'string' )
      e = document.getElementById(e);
    if( arguments.length == 1 )
      return e;
    if( !ea )
      ea = new Array();
    ea[ea.length] = e;
  }
  return ea;
}

function placeholderSetup(id) {
    var el = ge(id);
    if(!el) return;
    if(el.type != 'text') return;
    if(el.type != 'text') return;
    var ph = el.getAttribute("placeholder");
    if( ph && ph != "" ) {
        el.value = ph;
        el.style.color = '#c1c1c4';
        el.is_focused = 0;
        el.onfocus = placeholderFocus;
        el.onblur = placeholderBlur;
    }
}

function placeholderFocus() {
  if(!this.is_focused) {
    this.is_focused = 1;
    this.value = '';
    this.style.color = '#777';
    var rs = this.getAttribute("radioselect");
    if( rs && rs != "" ) {
      var re = document.getElementById(rs);
      if(!re) { return; }
      if(re.type != 'radio') return;
      re.checked=true;
    }
  }
}



function placeholderBlur() {
  var ph = this.getAttribute("placeholder")
  if( this.is_focused && ph && this.value == "" ) {
        this.is_focused = 0;
    this.value = ph;
    this.style.color = '#c1c1c4';
  }
}