(function(){ var this_script = document.currentScript; var s = this_script.getAttribute('data-sub'); var t = this_script.getAttribute('data-title'); var i = this_script.getAttribute('data-img'); var b = this_script.getAttribute('data-btn'); var l = this_script.getAttribute('data-btl'); var o = this_script.getAttribute('data-or'); var f = this_script.getAttribute('data-pos'); var c = this_script.getAttribute('data-id'); var ctaW; var ctaH; if(o=="big"){ ctaW="100%"; ctaH="300px"; ctaFs="20px"; ctaLh="30px"; ctaL="30px"; ctaF="none"; ctaMr="0px"; ctaMl="0px"; }else if (o=="small"){ ctaW="300px"; ctaH="250px"; ctaFs="16px"; ctaLh="30px"; ctaL="15px"; ctaF=f; if(f=="left"){ctaMr="10px";ctaMl="0px";}else{ctaMr="0px";ctaMl="10px";}; } if(!document.getElementById('cta_css')){ var style = document.createElement('style'); style.type = 'text/css'; style.media="screen"; style.id="cta_css"; style.innerHTML = ` .cta{ //background:url(\"`+i+`\") top center no-repeat; background-size:cover !important; width:`+ctaW+`; height:`+ctaH+`; position:relative; padding:0px; margin-left:`+ctaMl+`; margin-right:`+ctaMr+`; float:`+ctaF+`; } .cta_over{ font-size:`+ctaFs+`; line-height:`+ctaLh+`; padding: 3px 4px; top:80px; position:relative; font-family: lato,sans-serif; font-weight: bold; text-align:center; color:white; text-transform: uppercase; filter: drop-shadow(1px 1px 1px black); } .cta_btn{ position:absolute; bottom:40px; margin-left:-100px; left:50%; width:200px; height:40px; color:white; background-color:#F93; border:none; font-weight: bold; font-size: 14px; cursor:pointer; font-family: lato,sans-serif; text-transform: uppercase; } .cta_btn:hover{ background-color:#f60; } .cta_span{ text-align:center; width:100%; bottom:0px; position:absolute; } .cta_logo{ position:absolute; right:30px; bottom:10px; } @media screen and (max-width : 350px) { .cta{ min-width:300px; height:250px; float:none; margin-left:0px; margin-right:0px; } .cta_over{ font-size:16px; line-height:30px; } } @media screen and (min-width : 700px) { .cta_over{ } } `; document.getElementsByTagName('head')[0].appendChild(style); } var styleCta = document.createElement('style'); styleCta.media="screen"; styleCta.innerHTML = ` #cta_`+c+`{ background:url(\"`+i+`\") top center no-repeat; } `; document.getElementsByTagName('head')[0].appendChild(styleCta); var div = document.createElement('div'); div.id="cta_"+c; div.className="cta"; document.getElementById(c).parentNode.insertBefore(div, document.getElementById(c).nextSibling); if(t){ var ttl = document.createElement('div'); ttl.className="cta_over"; ttl.innerHTML=t; ttl.id="cta_ttl"; document.getElementById('cta_'+c).appendChild(ttl); } if(s){ var stl = document.createElement('div'); stl.className="cta_over"; stl.innerHTML=s; document.getElementById('cta_'+c).appendChild(stl); }else{ document.getElementById('cta_ttl').style.top="35px"; } var btn = document.createElement('button'); btn.className="cta_btn"; btn.innerHTML=b; btn.addEventListener('click', function(){ window.location.href= l }); document.getElementById('cta_'+c).appendChild(btn); })();