var iddd = false; if (typeof(window.sc__get_random_string) != "function") { function sc__get_random_string() { var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; var randomstring = ""; for (var i = 0, rnum = 0; i < 10; i++) { rnum = Math.floor(Math.random() * chars.length); randomstring += chars.substring(rnum, rnum + 1); } return randomstring; } } if (typeof(window.sc__waitForHeight) != "function") { function sc__waitForHeight(iddd) { return false; var div = document.getElementById(iddd); var ifr = div.getElementsByTagName("iframe"); if (ifr.length < 1) { return false; } console.log(ifr[0].src); if (ifr[0].src.indexOf("#mYh") == -1) { var h = ifr[0].src.substr(ifr[0].src.indexOf("#mYh") + 1, ifr[0].src.length - (ifr[0].src.indexOf("#mYh") + 1)); sc__resize_calendar_iFrame(iddd, 0, h); //console.log(h); return false; } /*setTimeout (function () { console.log(iddd); sc__waitForHeight(iddd); }, 500);*/ } } if (typeof(window.sc__findPlaceToLive) != "function") { function sc__findPlaceToLive(lin, dest) { var s = document.getElementsByTagName("script"); for(var x = 0, hid = newdiv = topTag = null, len = s.length; x < len; x++) { if (s[x].src.substr((s[x].src.length - lin.length), lin.length) != lin) { continue; } while (document.getElementById((hid = sc__get_random_string())) != null) {} topTag = s[x].parentNode; newdiv = document.createElement("div"); iddd = newdiv.id = hid; topTag.insertBefore(newdiv,s[x]); x = len; newdiv = document.getElementById(hid); var f = document.createElement("iframe"); f.setAttribute("frameborder","0"); f.setAttribute("scrolling","no"); f.setAttribute("height","250px"); f.setAttribute("width","100%"); newdiv.appendChild(f); f.setAttribute("src",dest + "&hid=" + hid + "#mYh"); f.style.marginBottom = "10px"; //sc__waitForHeight(iddd); } } } if (typeof(window.sc__resize_calendar_iFrame) != "function") { function sc__resize_calendar_iFrame(ids, iWidth, iHeight) { var d = document.getElementById(ids).getElementsByTagName("iframe")[0]; if (iWidth) { d.style.width = iWidth + "px"; } if (iHeight) { d.style.height = iHeight + "px"; } if (iHeight < 10) { //document.getElementById(ids).innerHTML = ""; } } } sc__findPlaceToLive("/export/calendar/block/", "http://sportacentrs.com/export/calendar/block/?content=1");