

$().ready(function() {
$("body").ajaxError(function(x,e, settings, exception) {
	//$(this).html("Message engine:<br> "+x.type+" "+e.status+": "+e.responseText);
	//$("#ajaxError").fadeIn(100);
	
	        $.blockUI({ 
            message: "Ошибка "+e.status+": "+e.responseText, 
            fadeIn: 100, 
            centerY: true,
            css: {
		textAlign:      'left',
                left: '', 
                //right: '0',
		 top: '0', 
               // width: '100px', 
                border: 'none', 
                padding: '10px',
                backgroundColor: '#ff0000', 
                opacity: .8, 
                color: '#fff' ,
'border-radius': '0 0 6px 0',
'-moz-border-radius':'0 0 6px 0',
'-khtml-border-radius': '0 0 6px 0'
            },
	    showOverlay: false
	   
			/*overlayCSS:  {
				backgroundColor: '#000',
				opacity:          .3
			}*/
        
        }); 
	
});
});

    function getSiteCounter(vId, cookName, setTimer, randPlus)
    {
	$(document).ready(function(){
		
      $('#counter_'+vId).each(function(){
        $(this).text($.cookie('counter_'+cookName));
      });
      
    $(document).everyTime(setTimer, 'timer_stat', function() {
	$('#counter_'+vId).each(function(){
		var cntr=parseInt($(this).text()) + $.random(randPlus);
		$.cookie('counter_'+cookName, cntr, {path: "/"});
		$(this).text(cntr);
      });
    });
     });
    }
