function pollFragment() { if (location.hash.indexOf("GUID=") !== -1) { var guid = location.hash.substring(location.hash.indexOf("GUID=") + 5); location.hash = "#"; var contentNode = document.getElementById("content"); var height = contentNode.clientHeight ? contentNode.clientHeight : (contentNode.offsetHeight ? contentNode.offsetHeight : 0); if (height !== 0) { sendHeight(height, guid, 0); } } if (location.hash.indexOf("SHOW_SCROLL") !== -1) { document.getElementById("container").style.overflow = "auto"; location.hash = "#"; } else { setTimeout(pollFragment, 100); } } function sendHeight(height, guid, retryCount) { if (retryCount < 10) { var setHeightImage = new Image(); setHeightImage.onerror = function() { setTimeout(function() { sendHeight(height, guid, retryCount + 1); }, 100); }; setHeightImage.src = "http://mte.apple.kuluvalley.com/scripts/setIframeHeight?height=" + height + "&guid=" + guid + "&cacheKiller=" + Math.random().toString().substring(2); } } if (window.addEventListener) { window.addEventListener("load", pollFragment, false); } else if (document.addEventListener) { document.addEventListener("load", pollFragment, false); } else if (window.attachEvent) { window.attachEvent("onload", pollFragment); }