(function(){
	var src, permalink, title, mode, leading, tiny;
	var _mp_href, _href_hash_index;

	_mp_href = window.location.href;
	_href_hash_index = _mp_href.indexOf('#');
	if (_href_hash_index != -1){
		_mp_href = _mp_href.substring(0, _href_hash_index)
	}

	permalink = (typeof mp_permalink=='string')?escape(mp_permalink):escape(_mp_href);
	title = (typeof mp_title=='string')?escape(mp_title):false;
	mode = (typeof mp_mode=='string')?escape(mp_mode):false;
	leading = (typeof mp_leading=='string')?escape(mp_leading):false;
	attribution = (typeof mp_attribution=='boolean')?mp_attribution:true;

	var src = "http://api.microplaza.com/button?url=" + permalink;

	if (title != false) {
		src += "&title="+title;
	}
	if (mode != false) {
		src += "&mode="+mode;
	}
	if (leading != false) {
		src += "&leading="+leading;
	}
	if (attribution != false) {
		src += "&attribution=true";
	}
	if (mode != false && mode == "horizontal") {
		document.write('<iframe scrolling="no" src="' + src + '"width=120 height=23 frameborder=0></iframe>');
	} else {
		document.write('<iframe scrolling="no" src="' + src + '"width=54 height=40 frameborder=0></iframe>');
	}
})();
