function LoadIFrame(context, iframeName) {

var iframe = Xrm.Page.ui.controls.get(iframeName);
var thisTabState= context.getEventSource().getDisplayState();

    if(thisTabState == "expanded") {
         // tab has been opened, need to call the function inside the Iframe that loads Consults
       alert("The tab has been expanded.");
        
       alert("i can access this from the frame:" + iframe.contentWindow.document.body.innerHTML);

   }

}
