window.IDICommon=window.IDICommon||{getHash:function(a){var b=a.indexOf("#")+1;return b?a.substr(b):""},htmlEscape:function(a){return/[&<>\"]/.test(a)?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;"):a},makeIframeTag:function(a){var b="<iframe",d;for(d in a)b+=" "+d+'="'+IDICommon.htmlEscape(a[d])+'"';return b+"></iframe>"},getIframe:function(a,b){try{return a.frames[b]}catch(d){return null}},makeIframeNode:function(a){var b=document.createElement("iframe"),
d;for(d in a)b.setAttribute(d,a[d]);return b},appendHiddenIframe:function(a,b){setTimeout(function(){document.body.appendChild(IDICommon.makeIframeNode({id:a,name:a,src:b,width:0,height:0,frameBorder:0}))},0)},writeHiddenIframe:function(a,b){document.write(IDICommon.makeIframeTag({id:a,name:a,src:b,width:0,height:0,frameBorder:0}))},splitURIComponent:function(a,b){for(var d=[],k=a.length,g=0;g<k;){var e=a.substr(g,b),h=e.length;if(g+h<k)for(var f=1;f<3;++f)e.charAt(h-f)=="%"&&(e=e.substr(0,h-=f));
d.push(e);g+=h}return d},MAX_URL_LENGTH:4095,IDI_DEFAULT_POLLING_INTERVAL:1E3};window.IDIModule=window.IDIModule||function(){function a(a){if(window.parent!=window){for(var c;c=IDICommon.getIframe(window.parent,window.name+"_"+l);){try{if(c.location.href=="about:blank")break}catch(b){break}m+=IDICommon.getHash(c.location.href);++l}c=m.split("$");var d=c.length-1;if(d>0){m=c[d];for(var e=0;e<d;++e)a(decodeURIComponent(c[e]))}}}function b(){var a=window.location.href,c=IDICommon.getHash(a);if(!c&&a.charAt(a.length-1)=="#"&&window.parent!=window){for(;a=IDICommon.getIframe(window.parent,
window.name+"_"+l);)if(c+=IDICommon.getHash(a.location.href),++l,c.charAt(c.length-1)=="$")break;c.charAt(c.length-1)=="$"&&(c=c.substr(0,c.length-1))}if(c){c=c.split("&");for(a=0;a<c.length;++a){var b=c[a].split("=");if(b.length==2){var d=decodeURIComponent(b[0]),b=decodeURIComponent(b[1]);d.indexOf("up_")==0||d.indexOf("msg_")==0?n[d]=b:d=="idi_hr"&&(i=b)}}}}function d(){return n}function k(a){i=a}function g(a){if(i){for(var a=encodeURIComponent(a)+"$",c=IDICommon.MAX_URL_LENGTH-1-i.length,a=IDICommon.splitURIComponent(a,
c),c=a.length,b=0;b<c;++b)IDICommon.appendHiddenIframe(window.name+"_"+(f+b),i+"#"+a[b]);f+=c}}function e(b,c){j&&window.clearInterval(j);j=window.setInterval(function(){a(b)},typeof c=="object"&&c.pollingInterval||IDICommon.IDI_DEFAULT_POLLING_INTERVAL)}function h(){window.clearInterval(j);j=0}var f=0,l=0,m="",j=0,i="",n={};b();return{getPrefs:d,setHostRelayUrl:k,postMessageToHost:g,registerListener:e,unregisterListener:h}}();

