// JavaScript Document

var is_bom=0;
var is_pmi=0;
var is_meta=0;
var is_tree=0;
var is_3d_window=0;
var is_playerpro="";
function init_template(topbar, bottombar, topmagnetbar, bomtable, viewtable, pmilist, detail_view,web_tree,meta_block) {

///////// checks the Playe rPro licence availibilty //////////////
is_playerpro=document._ComposerPlayerActiveX.IsPlayerPro()

//initiate the variables first, before launching the modules
if (bomtable == true){is_bom=1;}
if (pmilist == true){is_pmi=1;}
if (meta_block == true){is_meta=1;}
if (web_tree == true){is_tree=1;}
if (detail_view == true){is_3d_window=1;}

               $('#dialogs').load('resources\\modules\\m_prop\\index.html');
               
               if(is_3d_window==1){document.getElementById('detail_view_prop_container').style.display="block"}              
               
               
               if (topbar == true && is_playerpro==true){
                // load Top Bar
               $('#top_bar').load('resources\\sys\\topbar.html');
               $('#top_bar').removeClass('top_cell_close');
               $('#top_bar').addClass('top_cell_open');
               }
              
                if (bottombar == true && is_playerpro==true){
                // load Bottom Bar
                $('#bottom_loading').fadeIn();
                $('#bottom_bar').load('resources\\sys\\bottombar.html');
                $('#bottom_bar').removeClass('bottom_cell_close');
                $('#bottom_bar').addClass('bottom_cell_open');
               }     

               if (topmagnetbar == true){
               // load magnet Bar
               $('#magnet_bar').load('resources\\sys\\topmagnetbar.html');
               $('#magnet_bar').removeClass('top_cell_close');
               $('#magnet_bar').addClass('top_magnetcell_open');
                if(is_playerpro==false)
                {
                  $('#digger_command').fadeOut();
                  $('#showall_command').fadeOut();
                }
               }

                if (web_tree == true && is_playerpro==true){
                //loads the web assembly tree Window
                $('#leftbloc').fadeIn();
                $('#Tree_area').fadeIn();
                $('#Tree_area').load('resources\\modules\\m_tree\\index.html');
                }

                if (bomtable == true && is_playerpro==true){
                //loads the BOM table
                $('#Bom_area').fadeIn();
                $('#Bom_area').load('resources\\modules\\m_bom\\index.html');     
                }     

                if (viewtable == true && is_playerpro==true){
                //loads the View table
                $('#View_area').fadeIn();
                $('#View_area').load('resources\\modules\\m_views\\index.html');     
                }  
                if (pmilist == true && is_playerpro==true){
                //loads the PMI table
                $('#PMI_area').fadeIn();
                $('#PMI_area').load('resources\\modules\\m_pmi\\index.html');     
                }  

                if (detail_view == true && is_playerpro==true){
                //loads the detail_view Window
                $('#dialog_detail_view').fadeIn();
                $('#dialog_detail_view').load('resources\\modules\\m_3dwindow\\index.html');

                /*****************loads the ActiveX1 model in ActiveX2*******************/
                var model1=document._ComposerPlayerActiveX.FileName()
                document._ComposerPlayerActiveX2.FileName(model1)
                /************************************************************************/    
                                           
                } 
                
               
                /*if (prop_win == true){
                //loads the BOM table
                $('#Prop_area').load('modules\\m_prop\\index.html');
                if(is_pmi==1)
                  {document.getElementById('PMI_colors_option').style.display='block';}     
                } */
                
                if (meta_block == true){
                //loads the BOM table
                $('#Meta_area').fadeIn();
                $('#Meta_area').load('resources\\modules\\m_meta\\index.html');     
                }                                   
                
                
                $('#bottom_loading').fadeOut();

}
