link = document.getElementById('termo-widget');
link_data_theme = link.getAttribute("data-theme");
if(link_data_theme == null) {
  link_data_theme = "";
}
link_data_skin = link.getAttribute("data-skin");
if(link_data_skin == null) {
  link_data_skin = "";
}
link_data_width = link.getAttribute("data-width");
if(link_data_width == null) {
  link_data_width = 260;
}
link_data_height = link.getAttribute("data-height");
if(link_data_height == null) {
  link_data_height = 160;
}
link_data_border_color = link.getAttribute("data-border-color");
if(link_data_border_color == null) {
  link_data_border_color = "";
}
link_data_border_round = link.getAttribute("data-border-round");
if(link_data_border_round == null) {
  link_data_border_round = "";
}
link_data_links_color = link.getAttribute("data-links-color");
if(link_data_links_color == null) {
  link_data_links_color = "";
}
link_data_place_id = link.getAttribute("data-place");
if(link_data_place_id == null) {
  link_data_place_id = "";
}
iframe = document.createElement("iframe");
src_attribute  = "http://termo.bg/tools/widget?";
//src_attribute  = "http://localhost:8080/tools/widget?";
src_attribute += "theme="+encodeURIComponent(link_data_theme);
src_attribute += "&skin="+encodeURIComponent(link_data_skin);
src_attribute += "&width="+encodeURIComponent(link_data_width);
src_attribute += "&height="+encodeURIComponent(link_data_height);
src_attribute += "&border_color="+encodeURIComponent(link_data_border_color);
src_attribute += "&border_round="+encodeURIComponent(link_data_border_round);
src_attribute += "&links_color="+encodeURIComponent(link_data_links_color);
src_attribute += "&place_id="+encodeURIComponent(link_data_place_id);
src_attribute += "&host="+encodeURIComponent(window.location.hostname);
iframe.setAttribute("src", src_attribute);
iframe.setAttribute("width", link_data_width);
iframe.setAttribute("height", link_data_height);
iframe.setAttribute("style", "width:"+link_data_width+"px; height:"+link_data_height+"px; border:0; overflow:hidden;");
iframe.setAttribute("allowtransparency", "true");
iframe.setAttribute("frameBorder", "0");
iframe.setAttribute("border", "0");
iframe.setAttribute("scrolling", "no");
iframe.setAttribute("tabindex", "0");
link.parentNode.replaceChild(iframe, link);
