function urlencode(str) {
    str = str.replace(/\+/g, '%2B');
    str = str.replace(/&amp;/g,'%26');
    str = str.replace(/&/g , '%26');
    str = encodeURIComponent(str);
    str = str.replace(/%2F/g,'/');
    return str
}

function tblwidget() {
tblstr = ""

if (window.col1) tblstr+="&col1="+col1;
if (window.blog_id) blog_id = parseInt(window.blog_id); else blog_id=0;
if (window.url) url = urlencode(window.url); else return;
if (!window.btntype) btntype = 1;
switch (btntype) {
	case 1:
	case 2:
		btnwidth = 65;
		btnheight = 34;
		break;
	case 3:
		btnwidth = 53;
		btnheight = 27; 
		break;
	case 4:
		btnwidth = 108;
		btnheight = 16;
		break;
	default:
		btnwidth = 65;
		btnheight = 34;
		btntype = 1;
}

tblstr = tblstr.replace(/#/g,'');
document.write("<iframe src='http://topbloglog.com/vote-button.php?type="+btntype+"&blog_id=" + blog_id + tblstr + "&url="+url+"' height='"+ btnheight +"' width='"+btnwidth +
        "' frameborder='0' scrolling='no'></iframe>");
}

tblwidget();
