﻿// JScript File

SNETabs={
    mouseOver:function(tabHeader)
    {
        if (tabHeader.className == "")
       { 
            tabHeader.className = "ajax__tab_hover";
            tabHeader.setAttribute("class","ajax__tab_hover");
       } 
    },
   
    mouseOut:function(tabHeader)
    {
        if (tabHeader.className == "ajax__tab_hover")
       { 
            tabHeader.className = "";
            tabHeader.setAttribute("class","");
       } 
    },
   
    selectTab:function(tabHeader, selectedTabName)  
    {
        var bodyPanel;
        var tabHeaderSiblings; 
         
        tabHeaderSiblings = DOMhelp.firstSibling(tabHeader);
        do 
        {
            if (tabHeaderSiblings.className == "ajax__tab_active")
            {
                tabHeaderSiblings.className = "";
                tabHeaderSiblings.setAttribute("class","");
            }
            tabHeaderSiblings = DOMhelp.closestSibling(tabHeaderSiblings, 1);
        } while (tabHeaderSiblings);

        if (tabHeader.className != "ajax__tab_active")
        { 
            tabHeader.className = "ajax__tab_active";
            tabHeader.setAttribute("class","ajax__tab_active");
        } 
       
        bodyPanel = document.getElementById("Body_" + selectedTabName);
        if (bodyPanel) 
        { 
             bodyPanel = DOMhelp.firstSibling(bodyPanel);
            do
            {
                bodyPanel.style.visibility = "hidden";
                bodyPanel.style.display = "none"; 
                bodyPanel = DOMhelp.closestSibling(bodyPanel, 1);
            } while (bodyPanel);
            
            bodyPanel = document.getElementById("Body_" + selectedTabName);
            bodyPanel.style.visibility = "visible";
            bodyPanel.style.display = "block";
        }
      }, 
    selected:function(frameName)
    {
       //debugger
//       var myField;
//       var myFields;
//       var myLayoutControl;
//       var myIframe = document.getElementById(frameName);
//       if  (document.getElementById(frameName).contentDocument)
//       {
//            myLayoutControl = myIframe.contentDocument.getElementById('controlLayout');
//            if (myLayoutControl)
//            {
//                myFields = myLayoutControl.getElementsByTagName('input');
//                if (myFields)
//                {
//                    myField = myFields[0];
//                }
//            }
//            if (myIframe.focus()) {} 
//        }
//        else {
//            myIframe = document.frames[frameName];
//            myLayoutControl = document.frames[frameName].document.getElementById('controlLayout');
//            if (myLayoutControl) 
//            {
//                myFields = myLayoutControl.getElementsByTagName('input');
//                if (myFields)
//                {  
//                    myField = myFields[0];
//                } 
//            }
//        }
//        
//        if (myField)
//        {  
//            myField.focus();
//        }
    }
}
