// JavaScript Document
function iframeAutoFit() {
    try {
        if(window!=parent) {
            var a = parent.document.getElementsByTagName("IFRAME");
            for(var i=0; i<a.length; i++) {
                if(a[i].contentWindow==window) {
                    var h1=0, h2=0, w1=0, w2=0;
                    a[i].parentNode.style.height = a[i].offsetHeight +"px";
                    a[i].parentNode.style.width = a[i].offsetWidth +"px";
                    
                    a[i].style.height = "10px";
                    a[i].style.width = "10px";
                    
                    if(document.documentElement&&document.documentElement.scrollHeight) {
                       h1=document.documentElement.scrollHeight;
                       w1=document.documentElement.scrollWidth;
                    }
                    if(document.body) {
                        h2=document.body.scrollHeight;
                        w2=document.body.scrollWidth;
                    }
                    var h=Math.max(h1, h2);
                    var w=Math.max(w1, w2);
                    
                    if(document.all) {h += 4; w += 4;}
                    if(window.opera) {h += 1; w += 1;}
                    
                    a[i].style.height = a[i].parentNode.style.height = h +"px";
                    a[i].style.width = a[i].parentNode.style.width = w +"px";
                }
            }
        }
    }
    catch (ex){}
}
if (typeof(parent.DontAutoFit)!='undefined' && parent.DontAutoFit==false)
{
}else{

	if(window.attachEvent) {
	   window.attachEvent("onload",iframeAutoFit);
	} else if(window.addEventListener) {
		 window.addEventListener('load',   iframeAutoFit,   false);
	}
}
