/**
 * Copyright (c) 2008 by Marco Egli and Felix Nyffenegger
 */
	var Dom = YAHOO.util.Dom;
	var Event = YAHOO.util.Event;
	var Json = YAHOO.lang.JSON;

//////////////////////////////////////////////////////////////
// Namespace

if (NOVA == undefined) {
    var NOVA = {}
};

//////////////////////////////////////////////////////////////
// Main Application Class 

NOVA.Index = function(){

    // Prepare for Member Variables
    var that = this;
    var layout;

    
    // Constructor 
    YAHOO.util.Event.onDOMReady(function(){
        
        //Init Contolls and Layout
        initializeControls();
        //layout.render();
        
    });
    
    // Initialize all controls and gui elements   
    function initializeControls(){
        
		// Main Navigation
		var tvMain = new YAHOO.widget.TabView('navmain'); 
		
		tvMain.addTab( new YAHOO.widget.Tab({ 
		    label: 'Our Company', 
		    dataSrc: 'content/ourcompany.html', 
		    cacheData: true, 
		    active: true 
		})); 
		tvMain.addTab( new YAHOO.widget.Tab({ 
		    label: 'Products', 
		    dataSrc: 'content/products.html', 
		    cacheData: true
		}));
		/*tvMain.addTab( new YAHOO.widget.Tab({ 
		    label: 'Projects', 
		    dataSrc: 'content/projects.html', 
		    cacheData: true
		}));*/
		tvMain.addTab( new YAHOO.widget.Tab({ 
		    label: 'Contact us', 
		    dataSrc: 'content/contactus.html', 
		    cacheData: true
		}));
	
		var tabView = new YAHOO.widget.TabView('mProducts', {orientation:'left'}); 
			
		// Layout
        /*layout = new YAHOO.widget.Layout('doc1', {
            height: YAHOO.util.Dom.getClientHeight(), //Height of the viewport 
            width: 1000, //Width of the outer element 
            minHeight: 400, //So it doesn't get too small 
            units: [{
                position: 'top',
                height: 80,
                body: 'hd',
                scroll: null,
                zIndex: 2
            } ,
			{
                position: 'bottom',
                height: 50,
                body: 'ft',
                scroll: null,
                zIndex: 100
				
            }
			, {
                position: 'center',
                body: 'bd',                
                zIndex: 1
            }
			]
        });
		layout.on('afterResize', function(){
            YAHOO.util.Dom.setStyle('doc1', 'height', YAHOO.util.Dom.getClientHeight() + 'px');
        });*/
         initializeImagePanels();        
    }
    
    //////////////////////////////////////////////////////////////
    // Public methods	
    
    //////////////////////////////////////////////////////////////
    // Private methods
	function initializeImagePanels(){
	
		var panelConfig = {
			visible: false,
			fixedcenter: true,
			modal: true,
			draggable: false,
			close: true
		};
		
		//Elvan Screenshot
		var panelElstr = new YAHOO.widget.Panel("panelElvan", panelConfig);
		panelElstr.render();
		YAHOO.util.Event.addListener("imgElvanSmall", "click", panelElstr.show, panelElstr, true);
		YAHOO.util.Event.addListener("imgElvanBig", "click", panelElstr.hide, panelElstr, true);
		
		//rfViz Logo
		var panelRFViz = new YAHOO.widget.Panel("panelRFViz", panelConfig);
		panelRFViz.render();
		YAHOO.util.Event.addListener("imgRFVizSmall", "click", panelRFViz.show, panelRFViz, true);
		YAHOO.util.Event.addListener("imgRFVizBig", "click", panelRFViz.hide, panelRFViz, true);

		//WMM Logo
		var panelWmm = new YAHOO.widget.Panel("panelWmm", panelConfig);
		panelWmm.render();
		YAHOO.util.Event.addListener("imgWmmSmall", "click", panelWmm.show, panelWmm, true);
		YAHOO.util.Event.addListener("imgWmmBig", "click", panelWmm.hide, panelWmm, true);

	}
};

//////////////////////////////////////////////////////////////
// Start the application here and add main Object to Namespace

NOVA.myindex = new NOVA.Index();

