/*
 * Ext JS Library 1.1 RC 1
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */

var TabsExample = {
    init : function(){
        // basic tabs 1, built from existing content
//        var tabs = new Ext.TabPanel('tabs1');
//        tabs.addTab('script', "View Script");
//        tabs.addTab('markup', "View Markup");
//        tabs.activate('script');
    
        // second tabs built from JS
        var jtabs = new Ext.TabPanel('jtabs');

		var tab1 = jtabs.addTab('jtabs-1', "Marjal de Rafalell","<iframe src='marjal.html' width='100%' height='100%' frameborder=0></iframe>");//iframe porque carga mal galeria.html directamente
		tab1.on('activate',function(){
           this.bodyEl.setWidth('100%');this.bodyEl.setHeight('900px');
        });

		var tab2 = jtabs.addTab('jtabs-2', "Bíoética","<iframe src='bioetica.html' width='100%' height='100%' frameborder=0></iframe>");//iframe porque carga mal galeria.html directamente
		tab2.on('activate',function(){
           this.bodyEl.setWidth('100%');this.bodyEl.setHeight('900px');
        });

/*        var tab2 = jtabs.addTab('jtabs-2', "Bioética");
        var updater = tab2.getUpdateManager();
        updater.setDefaultUrl('bioetica.html');
        tab2.on('activate', updater.refresh, updater, true);*/
		//jtabs.syncHeight(800);//necesario para pdf

		var tab3 = jtabs.addTab('jtabs-3', "Impacto de la energía","<iframe src='impacto.html' width='100%' height='100%' frameborder=0></iframe>");//iframe porque carga mal galeria.html directamente
		tab3.on('activate',function(){
           this.bodyEl.setWidth('100%');this.bodyEl.setHeight('900px');
        });
		
		var tab4 = jtabs.addTab('jtabs-4', "Ética y Vida","<iframe src='vida_etica.html' width='100%' height='100%' frameborder=0></iframe>");//iframe porque carga mal galeria.html directamente
		tab4.on('activate',function(){
           this.bodyEl.setWidth('100%');this.bodyEl.setHeight('900px');
        });
		
    
        jtabs.activate('jtabs-1');
    }
}
Ext.EventManager.onDocumentReady(TabsExample.init, TabsExample, true);