(function() { var func = 'trace_id' + Math.floor(Math.random() * 9999999999); ref = document.getElementsByTagName('script'); for (i = 0, len = ref.length; i < len; i++) { script = ref[i]; src = script.getAttribute('src'); if (src) { matches = src.match(/promo_id=1655/); } if (src && !script.getAttribute('script-initialized') && matches) { //{%powered_by_wrapper%}// function getParams() { var params = {}; script.src.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { params[key] = value; }); return params; } var widget_src = src; script.setAttribute('script-initialized', true); var url_params = getParams(); widget_wrapper = document.createElement("div"); widget_wrapper.id = "tuturu_widget_wrapper"+ func; script.parentElement.insertBefore(widget_wrapper, script); var js = document.createElement('script'); js.id = func + 'script'; js.type = "text/javascript"; js.charset = "utf-8"; js.dataset.uxie = "true"; js.setAttribute("role", "uxie_widget_tutu"); var shcemes = { dark: { color_icons: "%23b3c2d1", color_background: "%23383c4a", color_text: "%23ffffff", color_border: "%23383c4a", color_button: "%23f1d600", color_button_text: "%232e366e", color_input_border: "%232b2e3a", color_button_border: false, color_input: "%232b2e3a", color_input_text: "%23ffffff", color_focused: "%23f1d600", }, bright: { color_icons: "%23b3c2d1", color_background: "%23FFFFFF", color_text: "%232e363e", color_border: "%233dc0c4", color_button: "%233dc0c4", color_button_text: "%23FFFFFF", color_input_border: "%23b3c2d1", color_button_border: false, color_input: "%23FFFFFF", color_input_text: "%23000000", color_focused: "%235ad3d7", }, green: { color_icons: "%23b3c2d1", color_background: "%23FFFFFF", color_text: "%232e363e", color_border: "%2396c21d", color_button: "%2396c21d", color_button_text: "%23FFFFFF", color_input_border: "%23b3c2d1", color_button_border: false, color_input: "%23FFFFFF", color_input_text: "%23000000", color_focused: "%23acd835", }, yellow: { color_icons: "%23b3c2d1", color_background: "%23FFFFFF", color_text: "%232e363e", color_border: "%23f1d600", color_button: "%23f1d600", color_button_text: "%232e366e", color_input_border: "%23b3c2d1", color_button_border: false, color_input: "%23FFFFFF", color_input_text: "%23000000", color_focused: "%23f1d600", }, pink: { color_icons: "%23b3c2d1", color_background: "%23FFFFFF", color_text: "%232e363e", color_border: "%23ef2d5a", color_button: "%23ef2d5a", color_button_text: "%23FFFFFF", color_input_border: "%23b3c2d1", color_button_border: false, color_input: "%23FFFFFF", color_input_text: "%23000000", color_focused: "%23ef2d5a", }, blue: { color_icons: "%23b3c2d1", color_background: "%230077dd", color_text: "%23FFFFFF", color_border: "%230077dd", color_button: "%23f1d600", color_button_text: "%232e366e", color_input_border: "%23b3c2d1", color_button_border: false, color_input: "%23FFFFFF", color_input_text: "%23000000", color_focused: "%23f1d600", }, transparent: { color_icons: "%23b3c2d1", color_background: "transparent", color_text: "%23FFFFFF", color_border: "transparent", color_button: "%23f1d600", color_button_text: "%232e366e", color_input_border: "%23b3c2d1", color_button_border: false, color_input: "%23FFFFFF", color_input_text: "%23000000", color_focused: "%23f1d600", }, }; function mapSchemeParams(shceme) { insert_storage = '' for (param in shceme) { insert_storage = insert_storage + '&' + param + '=' + shceme[param] } return insert_storage } js.src = '//tp.media/content?promo_id=2694&campaign_id=45' + '&locale='+ (!url_params["locale"] ? 'ru' : decodeURIComponent(url_params["locale"])) + '&shmarker='+ (!url_params["shmarker"] ? '' : decodeURIComponent(url_params["shmarker"])) + (!url_params["color_scheme"] ? mapSchemeParams(shcemes['bright']) : mapSchemeParams(shcemes[decodeURIComponent(url_params["color_scheme"])])) + (!url_params["button_text_color"] ? '' : '&color_button_text=' + decodeURIComponent(url_params["button_text_color"])) + (!url_params["button_color"] ? '' : '&color_button=' + decodeURIComponent(url_params["button_color"])) + (!url_params["button_text_color"] ? '' : '&color_button_text=' + decodeURIComponent(url_params["button_text_color"])) + '&show_logo='+ (url_params["logo"] === 'true') + (!url_params["background_color"] ? '' : '&color_background=' + decodeURIComponent(url_params["background_color"])) + (!url_params["origin"] ? '' : '&default_origin='+ decodeURIComponent(url_params["origin"])) + (!url_params["destination"] ? '' : '&default_destination=' + decodeURIComponent(url_params["destination"])) + '&border_radius='+ (!url_params["border_radius"] ? '0' : decodeURIComponent(url_params["border_radius"].slice(0,-2))) + (url_params["hide_header"] === 'true' ? '&plain=true' : '') + (url_params["tborder"] === 'true' ? '&color_border=transparent' : '') + (!url_params["powered_by"] ? '' : '&powered_by=' + url_params["powered_by"]); script.parentNode.insertBefore(js, script); break; } } })();