function weblog_c(){document.getElementById('weblog_i').innerHTML='<img src="http://c.weblog.com.ua/'+id+'|'+document.referrer+'|'+weblog_visitor+'|'+rand+'">';}
var id=1;
var color="";
var name="";
var rand=1;
var weblog_visitor=1;
function getCookie(name) 
{
        var prefix = name + "="
        var cookieStartIndex = document.cookie.indexOf(prefix)
        if (cookieStartIndex == -1)
                return null
        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
        if (cookieEndIndex == -1)
                cookieEndIndex = document.cookie.length
        return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}
function weblog(wb_id,wb_color,wb_name,but)
{
	if(document.getElementById('weblg_link')!=null)
		document.getElementById('weblg_link').style.display='none';
	id=parseInt(wb_id);
	color=wb_color;
	name=wb_name;
	var c=getCookie('weblog');
	if(c!=1)
	{
		var d = new Date();var e= d.getTime();e+=86400000;d.setTime(e);
		var d1 = new Date(d.getFullYear(), d.getMonth(), d.getDate());
		weblog_visitor=1;
		var cook=getCookie("weblog_"+id);
		
		if(cook==1)
			weblog_visitor=0;
		else   	
			document.cookie="weblog_"+id+"=1; path=/; expires="+d1+";";
		document.cookie="weblog=1; path="+document.location.pathname+"; expires="+d+";";
		rand = Math.round((Math.random() * (10000000 - 1)));
		document.write('<span id="weblog_i" style="position:absolute"></span>');
		setTimeout("weblog_c()",2000);
	}
	if(but)
		document.write('<a href="http://www.weblog.com.ua/" target="_blank"><img style="background-color:'+color+'; border:none;" width="88" height="31" alt="WEBLOG - Mass-media rating" src="http://www.weblog.com.ua/img/cnt/blackbtn.gif" /></a>');
}