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

/*
 * ================  HOME config  =======================
 */
var start = {
	id:'start-panel',
	layout:'anchor',
	defaults: {bodyStyle: 'padding:15px'},
	autoScroll: true,
	items: [{
        	height: 180,
		anchor: '0',
		contentEl: 'home-div1'
	},{
		title: 'NEWS',
		anchor: '0',
		contentEl: 'home-div2'
	},{
		anchor: '0',
		contentEl: 'home-div3'
	},{
		anchor: '0',
		contentEl: 'home-div4'
	}]
};

/*
 * ================  LABORATORY config  =======================
 */
var accordion = {
    	id:'accordion-panel',
    	layout:'anchor',
	defaults: {bodyStyle: 'padding:15px'},
	autoScroll: true,
    items: [{
        title: 'Introduction',
		anchor: '0',
		contentEl: 'lab-div1'
    },{
        title: 'Fields of research',
		anchor: '0',
		contentEl: 'lab-div2'
    }]
};


var column = {
	id:'column-panel',
	title: 'Members',
	layout:'column',
	bodyStyle:'padding:5px',
	defaults: {bodyStyle:'padding:5px'},
	autoScroll: true,
	items: [{
		title: 'Image evaluation team',
		columnWidth: .34,
		contentEl: 'lab-div3'
	},{
		title: 'Web image application team',
		columnWidth: .33,
		contentEl: 'lab-div4'
	},{
		title: 'ITS team',
		columnWidth: .33,
		contentEl: 'lab-div5'
	}]
};


var anchor = {
	id:'anchor-panel',
	layout:'anchor',
	defaults: {bodyStyle: 'padding:15px'},
	autoScroll: true,
	items: [{
		title: 'To students',
		anchor: '0',
		contentEl: 'lab-div6'
	}]
};

/*
 * ================  RESEARCH TOPICS config  =======================
 */
var border = {
	id:'border-panel',
      	layout:'anchor',
	defaults: {bodyStyle: 'padding:15px'},
	autoScroll: true,
    items: [{
        title: 'Intelligent Transport Systems',
		anchor: '0',
		contentEl: 'research-div1'
    },{
        title: 'Snow hazardmap',
		anchor: '0',
		contentEl: 'research-div2'
    },{
        title: 'All-around lens',
		anchor: '0',
		contentEl: 'research-div3'
    },{
        title: 'Analysis of road',
		anchor: '0',
		contentEl: 'research-div4'
    }]
};


var cardTabs = {
	id: 'card-tabs-panel',
      	layout:'anchor',
	defaults: {bodyStyle: 'padding:15px'},
	autoScroll: true,
    items: [{
        title: 'Web image application',
		anchor: '0',
		contentEl: 'research-div5'
    },{
        title: 'TBA',
		anchor: '0',
		contentEl: 'research-div6'
    },{
        title: 'TBA',
		anchor: '0',
		contentEl: 'research-div7'
    },{
        title: 'TBA',
		anchor: '0',
		contentEl: 'research-div8'
    }]
};


var cardWizard = {
	id:'card-wizard-panel',
      	layout:'anchor',
	defaults: {bodyStyle: 'padding:15px'},
	autoScroll: true,
    items: [{
        title: 'Image and Video Quality Evaluation',
		anchor: '0',
		contentEl: 'research-div9'
    },{
        title: 'Perceptual Characteristic',
		anchor: '0',
		contentEl: 'research-div10'
    },{
        title: 'TBA',
		anchor: '0',
		contentEl: 'research-div11'
    },{
        title: 'TBA',
		anchor: '0',
		contentEl: 'research-div12'
    }]
};

/*
 * ================  MICT DATABASE config  =======================
 */
var fit = {
	id:'fit-panel',
    	layout:'ux.center',
	autoScroll: true,
    	items: {
	        title: 'Image Database',
	        layout: 'ux.center',
	        autoScroll: true,
	        width: '100%',
	        bodyStyle: 'padding:20px 0;',
		//html: '<p><img src="./images/experiment/free.gif" alt="Self-planned Experiments" width=250 align=center /></p>',
	        items: [{
	        	title: 'MICT Image Quality Evaluation Database',
			contentEl: 'database-div1',
	        	width: '70%',
	        	frame: true,
	        	autoHeight: true,
	        	bodyStyle: 'padding:10px 20px;'
	        }]
    }
};

/*
 * ================  STUDY config  =======================
 */
var rowLayout = {
	id: 'row-panel',
	xtype: 'tabpanel',
	plain: true,  //remove the header border
	activeItem: 0,
	autoScroll: true,
	defaults: {bodyStyle: 'padding:15px'},
	items:[{
		title: 'EXP1',
		contentEl: 'teaching-div1'
	},{
		title: 'EXP2',
		contentEl: 'teaching-div2'
	},{
		title: 'EXP3',
		contentEl: 'teaching-div3'
	}]
};

var absolute = {
	id: 'absolute-panel',
	xtype: 'tabpanel',
	autoScroll: true,
	activeTab: 0,
	items:[{
		title: 'Workshops',
		layout: 'border',
		items: [{
			region: 'north',
			title: 'Introduction of Workshops',
			height: 88,
			maxSize: 150,
			margins: '5 5 0 5',
			bodyStyle: 'padding:10px;',
			split: true,
			html: '<div id="start-div"><div style="float:left;" ><img src="./images/result/society.jpg" alt="Workshop" width=100 /></div><div style="margin-left:120px;">This page presents `.</div></div>'
		},{
			xtype: 'tabpanel',
			plain: true,
			region: 'center',
			margins: '0 5 5 5',
			activeTab: 2,
			items: [{
				title: '`2006',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'workshop-div1'
			},{
				title: '2007',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'workshop-div2'
			},{
				title: '2008',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'workshop-div3'
			}]
		}]
	},{
		title: 'Conferences',
		layout: 'border',
		items: [{
			region: 'north',
			title: 'Introduction of Conferences',
			height: 114,
			maxSize: 150,
			margins: '5 5 0 5',
			bodyStyle: 'padding:10px;',
			split: true,
			html: '<div id="start-div"><div style="float:left;" ><img src="./images/result/graduate.jpg" alt="Introduction of master thesis" width=100 /></div><div style="margin-left:120px;">This page presents `.</div></div>'
		},{
			xtype: 'tabpanel',
			plain: true,
			region: 'center',
			margins: '0 5 5 5',
			activeTab: 2,
			items: [{
				title: '`2006',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'conference-div1'
			},{
				title: '2007',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'conference-div2'
			},{
				title: '2008',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'conference-div3'
			}]
		}]
	}]
};

/*
 * ================  PUBLICATIONS config  =======================
 */
var form = {
	id: 'form-panel',
	xtype: 'tabpanel',
	autoScroll: true,
	activeTab: 0,
	items:[{
		title: 'Workshop',
		layout: 'border',
		items: [{
			region: 'north',
			title: 'Introduction of Workshop',
			height: 88,
			maxSize: 150,
			margins: '5 5 0 5',
			bodyStyle: 'padding:10px;',
			split: true,
			html: '<div id="start-div"><div style="float:left;" ><img src="./images/result/society.jpg" alt="Workshop" width=100 /></div><div style="margin-left:120px;">This page presents oral presentation by Prof., lecture, research associate and students.</div></div>'
		},{
			xtype: 'tabpanel',
			plain: true,
			region: 'center',
			margins: '0 5 5 5',
			activeTab: 2,
			items: [{
				title: '`2006',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div2'
			},{
				title: '2007',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div3'
			},{
				title: '2008',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div4'
			}]
		}]
	},{
		title: 'Master thesis',
		layout: 'border',
		items: [{
			region: 'north',
			title: 'Introduction of master thesis',
			height: 114,
			maxSize: 150,
			margins: '5 5 0 5',
			bodyStyle: 'padding:10px;',
			split: true,
			html: '<div id="start-div"><div style="float:left;" ><img src="./images/result/graduate.jpg" alt="Introduction of master thesis" width=100 /></div><div style="margin-left:120px;">This page presents master thesis.</div></div>'
		},{
			xtype: 'tabpanel',
			plain: true,
			region: 'center',
			margins: '0 5 5 5',
			activeTab: 2,
			items: [{
				title: '`2005',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div8'
			},{
				title: '2006',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div9'
			},{
				title: '2007',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div10'
			}]
		}]
	},{
		title: 'Graduation thesis',
		layout: 'border',
		items: [{
			region: 'north',
			title: 'Introduction graduation thesis',
			height: 114,
			maxSize: 150,
			margins: '5 5 0 5',
			bodyStyle: 'padding:10px;',
			split: true,
			html: '<div id="start-div"><div style="float:left;" ><img src="./images/result/graduate.jpg" alt="Introduction graduation thesis" width=100 /></div><div style="margin-left:120px;">This page presents graduation thesis.</div></div>'
		},{
			xtype: 'tabpanel',
			plain: true,
			region: 'center',
			margins: '0 5 5 5',
			activeTab: 2,
			items: [{
				title: '`2005',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div5'
			},{
				title: '2006',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div6'
			},{
				title: '2007',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div7'
			}]
		}]
	},{
		title: 'Books',
		layout: 'border',
		items: [{
			region: 'north',
			title: 'Introduction of books',
			height: 114,
			maxSize: 150,
			margins: '5 5 0 5',
			bodyStyle: 'padding:10px;',
			split: true,
			html: '<div id="start-div"><div style="float:left;" ><img src="./images/result/book.jpg" alt="Introduction of books" width=100 /></div><div style="margin-left:120px;">This page presents books wrriten by Prof..</div></div>'
		},{
			xtype: 'tabpanel',
			plain: true,
			region: 'center',
			margins: '0 5 5 5',
			activeTab: 0,
			items: [{
				title: '`2008',
				bodyStyle: 'padding:10px;',
				autoScroll: true,
				contentEl: 'result-div11'
			}]
		}]
	}]
};


var table = {
	id:'table-panel',
	title: 'Schedule',
	defaults: {bodyStyle: 'padding:15px'},
	autoScroll: true,
    items: [{
        title: 'MICT Lab. Events',
		anchor: '0',
		contentEl: 'event-div1'
    }]
};

/*
 * ================  LINKS config  =======================
 */
var centerLayout = {
	id: 'center-panel',
    	layout:'anchor',
	defaults: {bodyStyle: 'padding:15px'},
	autoScroll: true,
    items: [{
        title: 'Toyama Univ-related',
		anchor: '0',
		contentEl: 'link-div1'
    },{
        title: 'image processing-related',
		anchor: '0',
		contentEl: 'link-div2'
    },{
        title: 'Others',
		anchor: '0',
		contentEl: 'link-div3'
    }]
};

/*
 * ================  CONTACT config  =======================
 */
var tabsNestedLayouts = {
	id: 'tabs-nested-layouts-panel',
	xtype: 'tabpanel',
	title: 'Access',
	autoScroll: true,
	activeTab: 0,
	items:[{
		title: 'Access',
		layout: 'border',
		items: [{
			region: 'north',
			title: 'Means of transportation',
			height: 75,
			maxSize: 150,
			margins: '5 5 0 5',
			bodyStyle: 'padding:10px;',
			split: true,
			html: 'Please use the following means of transportation when you come to Toyama University.'
		},{
			xtype: 'tabpanel',
			plain: true,
			region: 'center',
			margins: '0 5 5 5',
			activeTab: 0,
			items: [{
				title: 'From Toyama city',
				autoScroll: true,
				bodyStyle: 'padding:10px;',
				contentEl: 'contact-div1'
			},{
				title: 'From outside the prefecture ',
				autoScroll: true,
				bodyStyle: 'padding:10px;',
				contentEl: 'contact-div2'
			},{
				title: 'From the foreign countries',
				autoScroll: true,
				bodyStyle: 'padding:10px;',
				contentEl: 'contact-div3'
			}]
		}]
	},{
		title: 'Google MAP',
		bodyStyle: 'padding:10px;',
		contentEl: 'contact-div4'
	}]
};

var absform = new Ext.form.FormPanel({
    baseCls: 'x-plain',
    layout:'absolute',
    url:'save-form.php',
    border: true,
    defaultType: 'textfield',

    items: [{
        x: 0,
        y: 5,
        xtype: 'label',
        text: 'From:'
    },{
        x: 55,
        y: 0,
        name: 'from',
        anchor:'100%'  // anchor width by %
    },{
        x: 0,
        y: 32,
        xtype: 'label',
        text: 'To:'
    },{
    	// The button is not a Field subclass, so it must be 
    	// wrapped in a panel for proper positioning to work
    	xtype: 'panel',
    	x: 55,
    	y: 27,
    	items: {
	    	xtype: 'button',
	    	text: 'Contacts...'
    	}
    },{
        x: 135,
        y: 27,
        name: 'to',
        anchor: '100%'  // anchor width by %
    },{
        x: 0,
        y: 59,
        xtype: 'label',
        text: 'Subject:'
    },{
        x: 55,
        y: 54,
        name: 'subject',
        anchor: '100%'  // anchor width by %
    },{
        x:0,
        y: 81,
        xtype: 'textarea',
        name: 'msg',
        anchor: '100% 100%'  // anchor width and height
    }]
});

var absoluteForm = {
    title: 'EMail form',
    id: 'abs-form-panel',
    layout: 'fit',
    bodyStyle: 'padding:15px;',
    items: {
    	title: 'New Email',
    	cls: 'email-form',
	    layout: 'fit',
	    frame: true,
	    bodyStyle: 'padding:10px 5px 5px;',
	    items: absform,
	    
	    tbar: [{
	    	text: 'Send',
	    	iconCls: 'icon-send'
	    },'-',{
	    	text: 'Save',
	    	iconCls: 'icon-save'
	    },{
	    	text: 'Check Spelling',
	    	iconCls: 'icon-spell'
	    },'-',{
	    	text: 'Print',
	    	iconCls: 'icon-print'
	    },'->',{
	    	text: 'Attach a File',
	    	iconCls: 'icon-attach'
	    }]
    }
};