/**
 * (C) KAYAC Inc. <http://www.kayac.com/>
 * License: MIT License <http://www.opensource.org/licenses/mit-license.php>
 */

new function() {
	var s = document.getElementsByTagName('script');
	var self = s[s.length - 1];
	var uid = new Date().getTime();

	var flashvars = param({
		loc: location.href,
		ref: document.referrer
	});
	var container = document.createElement('div');
	container.style.width  = '300px';
	container.style.height = '170px';
	self.parentNode.insertBefore(container, self);
	container.innerHTML = [
		'<object id="cubaclock-swf-'+uid+'" data="http://10th.kayac.com/swf/movie/cubaclock/blogparts_big.swf" type="application/x-shockwave-flash" width="300" height="170">',
		'<param name="movie" value="http://10th.kayac.com/swf/movie/cubaclock/blogparts_big.swf"/>',
		'<param name="wmode" value="transparent"/>',
		'<param name="flashvars" value="'+flashvars+'"/>',
		'</object>'
	].join('');

	document.createElement('img').src = 'http://log.kayac.com/cl/?rs=i&cm=blogdeco00071&ln=1';

	function param(obj) {
		var ret = [];
		for (var v in obj)
			ret.push(encodeURIComponent(v)+'='+encodeURIComponent(obj[v])); 
		return ret.join('&');
	}
};
