function init(params){
	var div, k;
	if(typeof(params.key) != 'undefined'){
		k = params.key;
		div = document.getElementById('tm_'+k);
	} else if(typeof(params.lat) != 'undefined' && typeof(params.lng) != 'undefined' && typeof(params.zoom) != 'undefined'){
		k = Math.floor(Math.abs(params.lat))+'_'+Math.floor(Math.abs(params.lng))+'_'+params.zoom;
		div = document.getElementById('tm_'+k);
	} else {
		alert(gettext('Invalid parameters for Timemap Widget. Please embed the HTML code again or visit http://www.timemory.com/widget/timemap/getcode/ .'));
		return false;
	}
	var i = document.createElement('iframe');
	i.setAttribute('id', 'if_tm_'+k);
	i.style.width = '100%';
	i.setAttribute('height', 120+params.width);
	i.setAttribute('frameBorder', '0');
	i.setAttribute('scrolling', 'no');
	div.appendChild(i);
	if(typeof(params.key) != 'undefined'){
		document.getElementById('if_tm_'+k).src = 'http://'+params.host+'/widget/timemap/?width='+params.width+'&url='+location.href+'&key='+params.key+'&title='+encodeURI(document.getElementsByTagName('title')[0].innerHTML);
	} else if(typeof(params.lat) != 'undefined' && typeof(params.lng) != 'undefined' && typeof(params.zoom) != 'undefined'){
		document.getElementById('if_tm_'+k).src = 'http://'+params.host+'/widget/timemap/?width='+params.width+'&url='+location.href+'&lat='+params.lat+'&lng='+params.lng+'&zoom='+params.zoom;
	} else {
		alert(gettext('Invalid parameters for Timemap Widget. Please embed the HTML code again or visit http://www.timemory.com/widget/getcode/timemap/ .'));
		return false;
	}
}
