﻿/*
 * Ext JS Library 3.0 Pre-alpha
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

Ext.onReady(function() {
	Ext.QuickTips.init();

	// create some portlet tools using built in Ext tool ids
	var tools = [{
		id:'gear',
		handler: function(){
			Ext.Msg.alert('Message', 'The Settings tool was clicked.');
		}
	},{
		id:'close',
		handler: function(e, target, panel){
			panel.ownerCt.remove(panel, true);
		}
	}];

	var viewport = new Ext.Viewport({
		layout:'fit',
		items:[{
			xtype: 'grouptabpanel',
			tabWidth: 130,
			activeGroup: 0,
			items: [{
				items: [{
					title: 'nTI | FACCAT',
					style: 'padding: 10px;',
					autoLoad: {url:'nti.html',scripts:true}
				},{
					title: 'O que é?',
					iconCls: 'x-expand-icon',
					style: 'padding: 10px;',
					autoScroll: true,
					autoLoad: {url:'oquee.html'}
				},{
					title: 'Objetivos',
					iconCls: 'x-expand-icon',
					style: 'padding: 10px;',
					autoScroll: true,
					autoLoad: {url:'objetivos.html'}
				},{
					title: 'Projetos',
					iconCls: 'x-expand-icon',
					style: 'padding: 10px;',
					autoLoad: {url:'projetos.html',scripts:true}
				},{
					title: 'Parceiros',
					iconCls: 'x-expand-icon',
					style: 'padding: 10px;',
					autoScroll: true,
					autoLoad: {url:'parceiros.html'}
				}]
			},{
				items: [{
					title: 'Ext JS',
					style: 'padding: 5px;',
					autoLoad: {url:'extjs.html',scripts:true}
				},{
					title: 'História',
					iconCls: 'x-expand-icon',
					style: 'padding: 5px;',
					autoScroll: true,
					autoLoad: {url:'historia.html',scripts:true}
				},{
					title: 'Diagrama',
					iconCls: 'x-expand-icon',
					style: 'padding: 5px;',
					html: '<img src="extjs-11-baselibs.png" style="width:100%">'
				},{
					title: 'Versões',
					iconCls: 'x-expand-icon',
					style: 'padding: 5px;',
					autoLoad: {url:'versoes.html',scripts:true}
				}]
			},{
				expanded: true,
				items: [{
					title: 'Exemplos',
					tabTip: 'Configuration tabtip',
					style: 'padding: 5px;',
					autoLoad: {url:'exemplos.html',scripts:true}
				},{
					title: 'Window',
					iconCls: 'x-expand-icon',
					tabTip: 'Exemplo de janela',
					style: 'padding: 5px;',
					autoScroll: true,
					autoLoad: {url:'exemplos/window.html',scripts:true}
				},{
					title: 'Grid',
					iconCls: 'x-expand-icon',
					tabTip: 'Exemplo de grid',
					style: 'padding: 5px;',
					autoScroll: true,
					autoLoad: {url:'exemplos/grid.html',scripts:true}
				},{
					title: 'Form',
					iconCls: 'x-expand-icon',
					tabTip: 'Exemplo de formulário',
					style: 'padding: 5px;',
					autoScroll: true,
					autoLoad: {url:'exemplos/form.html',scripts:true}
				},{
					title: 'Layout',
					iconCls: 'x-expand-icon',
					tabTip: 'Exemplo de layout',
					style: 'padding: 5px;',
					autoScroll: true,
					autoLoad: {url:'exemplos/layout.html',scripts:true}
				},{
					title: 'Portal',
					xtype: 'portal',
					iconCls: 'x-expand-icon',
					tabTip: 'Exemplo de layout com grids, tabs, forms e janelas',
					style: 'padding: 5px;',
					items:[{
						columnWidth:.33,
						style:'padding:10px 0 10px 10px',
						items:[{
							title: 'Grid in a Portlet',
							layout:'fit',
							tools: tools,
							items: new SampleGrid([0, 2, 3])
						},{
							title: 'Another Panel 1',
							tools: tools,
							html: Ext.example.shortBogusMarkup
						}]
					},{
						columnWidth:.33,
						style:'padding:10px 0 10px 10px',
						items:[{
							title: 'Panel 2',
							tools: tools,
							html: Ext.example.shortBogusMarkup
						},{
							title: 'Another Panel 2',
							tools: tools,
							html: Ext.example.shortBogusMarkup
						}]
					},{
						columnWidth:.33,
						style:'padding:10px',
						items:[{
							title: 'Panel 3',
							tools: tools,
							html: Ext.example.shortBogusMarkup
						},{
							title: 'Another Panel 3',
							tools: tools,
							html: Ext.example.shortBogusMarkup
						}]
					}] 
				}]
			},{
				expanded: true,
				items: [{
					title: 'Fim',
					tabTip: 'Configuration tabtip',
					style: 'padding: 5px;',
					autoLoad: {url:'fim.html',scripts:true}
				},{
					title: 'Links',
					iconCls: 'x-expand-icon',
					tabTip: 'Exemplo de janela',
					style: 'padding: 5px;',
					autoLoad: {url:'links.html',scripts:true}
				},{
					title: 'Perguntas',
					iconCls: 'x-expand-icon',
					tabTip: 'Exemplo de grid',
					style: 'padding: 5px;',
					autoLoad: {url:'perguntas.html',scripts:true}
				}]
			}]
		}]
	});
	setTimeout(function(){
		Ext.get('Ploading').remove();
		Ext.get('Ploading-mask').fadeOut({
			easing: 'easeOut',
			duration: .7,
			remove: true
		});
	}, 250);
});
