﻿function SetIframeHeight()
{
    var Iframe=document.getElementById("Iframe");
    if (document.getElementById)
    {

        if (Iframe && !window.opera)
        {
            if (Iframe.contentDocument && Iframe.contentDocument.body.offsetHeight)
                {
                    Iframe.height = Iframe.contentDocument.body.offsetHeight;
                }
            else if(Iframe.Document && Iframe.Document.body.scrollHeight)
                {
                    Iframe.height = Iframe.Document.body.scrollHeight;
                }
        }
     }
 }

 function SetParentIframeSrc(url) {

     parent.document.getElementById('Content').innerHTML = "<iframe width='590px' src='" + url + "'  id='Iframe' name='Iframe' onload='Javascript:SetIframeHeight()' frameborder='no' border='0' marginwidth='0' marginheight='0'  scrolling='no'></iframe>";
 }


 //页签控制
 function SetBar(PrefixID, CurrentNo, Count, AClassName1, AClassName2) {

     for (i = 1; i <= Count; i++) {
         var DivName = PrefixID + i;
         var CtlName = PrefixID + "A" + i;
         var obj = document.getElementById(DivName);
         if (i == CurrentNo) {
             //obj.className=DivClassName;
             obj.style.display = "";
             document.getElementById(CtlName).className = AClassName1;

         }
         else {
             //obj.className="";
             document.getElementById(CtlName).className = AClassName2;
             obj.style.display = "none";
         }
     }
 }