


// Scriptaculous Part
var unternehmenVis  = false;



// EXT Part

var ems = null;

Ext.onReady(function() {
    Ext.QuickTips.init();
    Ext.BLANK_IMAGE_URL = "Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';";     
    ems = new EMS();
    ems.loadCnt('unternehmen');    

    // try { 
       // GSearch.setOnLoadCallback(LoadMapSearchControl); 
    //}
     // catch(e) { 
      //  alert(e); 
   //} 
});


EMS = function(config) {
    Ext.apply(this, config);  


    this.cnt = new Ext.Panel({
        layout:'fit',
        renderTo: 'content-reg',
        id: 'mainPanel',
        cls: 'no-title',
        bodyStyle: 'background: transparent; border-color: white;',
        bodyBorder: false,
        border: false,
        defaults: {
            bodyStyle: 'padding: 0px'           
        },
        listeners:{
            afterlayout: {
                fn: this.panelAvail,
                scope: this
            }
        }
    });
    
    
};

EMS.prototype = {
    loadCnt: function(e){
        document.getElementById('content-reg').style.display   = 'block'; 
        if (e == 'unternehmen'){
            if (!unternehmenVis){
                Effect.BlindDown('unternehmen_hidden', { duration: 1.5 });
                unternehmenVis = true;                     
            }    
        } else  {
            if (e != 'ansprechpartner' && e != 'qualifikationen') {
                if (unternehmenVis){
                    Effect.BlindUp('unternehmen_hidden', { duration: 1.5 });
                    unternehmenVis = false;                     
                }                  
            }
        }
        this.cnt.render();
        this.cnt.load({url: 'action/controller.php?load='+e, text: "Loading...", callback: this.cntLoaded(e)});
        
    },
    cntLoaded: function(e){
        if (e == 'kontakt'){
            document.getElementById('mapsearch').style.visibility = 'visible';
        } else {
            document.getElementById('mapsearch').style.visibility = 'hidden';

        }
        
    }, panelAvail: function(e){
        // For later
    },
    slide: function(){
    },
    accChange: function(e){
        // var ss01 = new Slideshow(actIt, {duration:3, uri : ['http://farm3.static.flickr.com/2246/2366763499_59db929db1_m.jpg','http://farm4.static.flickr.com/3116/2357956432_02208dab62_m.jpg']});
    }
};





   
