﻿var defHeight = "10px";
var delta = (typeof clientDelta!="undefined"? clientDelta: 0);
try { if(BrowserUtils.IsMozilla==true && BrowserUtils.IsFirefox==true){delta = 0;}} catch(e){}
function ifrPgW() { var ifrmePg = null; try { ifrmePg = this.frameElement; } catch (e) { } if (ifrmePg != null) { try { if (parseInt(document.body.scrollWidth) > 0) { if (ifrmePg.style) { var newWidth = parseInt(document.body.scrollWidth) > parseInt(document.body.clientWidth) ? parseInt(document.body.scrollWidth) : parseInt(document.body.clientWidth); ifrmePg.style.width = newWidth + "px"; } } } catch (e) { } } }
function ifrPgH() { var ifrmePg = null; try { ifrmePg = this.frameElement; } catch (e) { } if (ifrmePg != null) { try { if (parseInt(document.body.scrollHeight) > 0) { if (ifrmePg.style) {var sh=isNaN(parseInt(document.body.scrollHeight))?0:parseInt(document.body.scrollHeight); ifrmePg.style.height=sh+"px"; var ch = isNaN(parseInt(document.body.clientHeight))?0:parseInt(document.body.clientHeight); var newHeight = sh > ch ? sh : ch; if(BrowserUtils.IsSafari) { newHeight=ch; } ifrmePg.style.height = newHeight + delta + "px"; } } } catch (e) { } } }
function parentIfrPgH() { var ifrmePg = null; try { ifrmePg = parent.frameElement; } catch (e) { } if (ifrmePg != null) { try { if (parseInt(parent.document.body.scrollHeight) > 0) { if (ifrmePg.style) { var newHeight = parseInt(parent.document.body.scrollHeight) > parseInt(parent.document.body.clientHeight) ? parseInt(parent.document.body.scrollHeight) : parseInt(parent.document.body.clientHeight); ifrmePg.style.height = newHeight + delta + "px"; } } } catch (e) { } } }
function ifrPgWI(obj){try{if(parseInt(obj.scrollWidth)>0){var nw=parseInt(obj.scrollWidth);obj.style.width=nw+"px";}}catch(e){}}
function ifrPgHI(obj){try{if(parseInt(obj.scrollHeight)>0){var nh=parseInt(obj.scrollHeight);obj.style.height=nh+"px";}}catch(e){}}
function ifrPgCaller(){try{if(typeof frameElement.style.height!="undefined"){frameElement.style.height=defHeight;}}catch(e){}ifrPgH();ifrPgW();ifrPgH();ifrPgW();}
function ifrPgICaller(obj){ifrPgHI(obj);ifrPgWI(obj);ifrPgHI(obj);ifrPgWI(obj);}
function ifrPgCallerAuto(){var aIframe = document.getElementsByTagName('iframe');for(var r=0; r<aIframe.length; r++){try{if(typeof aIframe[r].style.height!="undefined"){aIframe[r].style.height=defHeight;aIframe[r].style.height=parseInt(aIframe[r].contentWindow.document.body.scrollHeight)+"px";}}catch(e){} ifrPgICaller(aIframe[r]);}ifrPgCaller();}
function parentSize(){try{if(typeof parent.frameElement.style.height!="undefined"){parent.frameElement.style.height=defHeight;}}catch(e){}try{if(typeof parent.ifrPgCaller!="undefined"){parent.ifrPgCaller();}}catch(e){}}
function addEventListener(d,c,f){var g=f;if(d.addEventListener){d.addEventListener(c,g,false);}else if(d.attachEvent){g=function(){f(window.event);};d.attachEvent("on"+c,g);}else{throw new Error("Event registration not supported");}return{d:d,name:c,f:g};}; 
function addIfrResize(){var aIframe = document.getElementsByTagName('iframe');for(var r=0; r<aIframe.length; r++){addEventListener(aIframe[r], "load", ifrPgCallerAuto);}}
function LoadResize(){if(loadResize){if(typeof autoWH!='undefined'){switch(autoWH){case "10":ifrPgW();break;case "01":ifrPgH();if(typeof callResizeBack!="undefined" && callResizeBack){parent.ifrPgH();} break;case "11":ifrPgCaller();if(typeof callResizeBack!="undefined" && callResizeBack){parentSize();}break;}}};}