/**
 * @copyright SilverBiology
 * @author Michael Giddens
 * @website http://www.silverbiology.com
*/
Ext.ns('Config', 'Config.Default', 'Config.Default.Grid', 'Config.Default.Specimen', 'Config.Default.Checklist', 'Config.Default.Images', 'Config.Default.Image');

// This will prompt a confirm box when leaving the application
// 1 = Enabled; 0 = Disabled
Config.Unload = 1;  

Config.Distribution = {
	custom_map_list: [
		{id:"CSE" ,title:"South East",swf:"FCMap_Southeast_County.swf",width:1000,height:600}
	]
}

Config.URL = "http://www.herbarium.lsu.edu/plants/";
//Config.recaptcha = { publickey: '6LcLzAEAAAAAAIaTeQnKjOKF-InrzAVQXFOErXhg' }

//Config.URL = "http://localhost/www.herbarium.lsu.edu/collection/";
Config.recaptcha = { publickey: '6LfmcgIAAAAAAC8LMN4hYK_c5L7H6venZwJC_g96 ' } // www.herbarium.lsu.edu

Config.key = '48d73d487a0752b59d95788a818525c1'; // 'Localhost'

Config.Default.Images = {
		originals_location: 'http://www.herbarium.lsu.edu/plants/images/'
	,	pageSize: 50
	,	view_tpl:	'<tpl for=".">' +
						'<div class="thumb-wrap" id="{id}">' +
						'<div class="thumb"><img onerror=\'this.src="images/no-image.gif"\'; src="../images/archive/{filename}_s.{extension}" title="{family} {genus} {species}"></div>' +
						'<span class="x-editable">{family} {genus} {species}</span></div>' +
					'</tpl>' +
					'<div class="x-clear"></div>'
}

/*----------------
// Hints
*/
Config.Hint = {
		show: true
	,	delay: 7000
	,	msgs: [
			{text: 'Double clicking on records opens up the details.'}
		,	{text: 'Right click gives you more options for certain things.'}
		]
}


Config.Default.Image = {
	image_tpl: '<img id="image_{file}" onerror="this.src=\'images/no-image.gif\'" title="{family} {genus} {species}" src="../images/archive/{file}_l.jpg" />'
}

Config.Default.Filter = {
	filters: [{
			xtype: 'xtwincombo'
		, fieldLabel: 'Category'
		, name: 'Phylum'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"Phylum"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: false
		, triggerAction: 'all'
		,	editable: false
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Family'
		, name: 'Family'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"Family"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Genus'
		, name: 'Genus'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"Genus"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Species'
		, name: 'SpecificEpithet'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"SpecificEpithet"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Common Name'
		, name: 'common_name'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {type:'common_name', table:'dwc_extra'}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Country'
		, name: 'Country'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"Country"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: false
		, triggerAction: 'all'
		,	editable: false
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'State'
		, name: 'StateProvince'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"StateProvince"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: false
		, triggerAction: 'all'
		,	editable: false
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Parish/County'
		, name: 'County'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"County"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Locality'
		, name: 'Locality'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"Locality"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Catalog #'
		, name: 'CatalogNumber'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"CatalogNumber"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Collector'
		, name: 'Collector'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"Collector"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombo'
		, fieldLabel: 'Collector #'
		, name: 'CollectorNumber'
		,	queryParam: 'filter'		
		,	store: new Ext.data.Store({
					proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
				,	baseParams: {"type":"CollectorNumber"}
				, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
			})
		,	displayField: 'name'
		,	typeAhead: false
		,	hideTrigger2: true
		,	minChars: 2
		,	value:''
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {		
			xtype: 'xtwincombodate'
		, fieldLabel: 'Collected Start'
		, name: 'EarliestStartDate'
		,	readOnly: true
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}, {
			xtype: 'xtwincombodate'
		, fieldLabel: 'Collected End'
		, name: 'EarliestEndDate'
		,	readOnly: true
		, listeners: {
					'select': function() { this.ownerCt.grid.store.load(); }
				,	'clear': function() { this.ownerCt.grid.store.load(); }
			}		
	}]
}

//================================================================================

Config.Default.Checklist = {	

		Grid: {
			extensions: [ 
					SilverCollection.plugins.Download
				,	SilverCollection.plugins.Email
			]		
		}
		
		// required. Note: empty setting would be "cm: []"
	,	cm: [{
						 header: "State",
						 dataIndex: 'StateProvince',
						 sortable: true,
						 width: 80
					},{
						 header: "Parish/County",
						 dataIndex: 'County',
						 sortable: true,
						 width: 120
					},{
						 header: "Locality",
						 dataIndex: 'Locality',
						 sortable: true,
						 width: 120
					},{
						 header: "Category",
						 dataIndex: 'Phylum',
						 sortable: true,
						 width: 90
					},{
						 header: "Family",
						 dataIndex: 'Family',
						 sortable: true,
						 width: 90
					}	,{
						 header: "Genus",
						 dataIndex: 'Genus',
						 sortable: true,
						 width: 80
					}	,{
						 header: "Species",
						 dataIndex: 'SpecificEpithet',
						 sortable: true,
						 width: 120
					}	,{
						 header: "Specimens",
						 dataIndex: 'specimen_count',
						 width: 80,
						 sortable: false
			}]

		// required. Note: empty setting would be ", recordType: []"
	,	recordType: [
				{name: 'StateProvince'}
			,	{name: 'County'}
			,	{name: 'Locality'}
			,	{name: 'Phylum'}
			,	{name: 'Family'}
			,	{name: 'Genus'}
			,	{name: 'SpecificEpithet'}
			,	{name: 'specimen_count'}						
		]

	,	sortInfo: {
				field: 'Family'
			, direction: 'ASC'
		}

	,	groupField: 'Family'
	
	, Filter: {
			filters: [{
					xtype: 'xtwincombo'
				, fieldLabel: 'Category'
				, name: 'Phylum'
				,	queryParam: 'filter'		
				,	store: new Ext.data.Store({
							proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
						,	baseParams: {"type":"Phylum"}
						, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
					})
				,	displayField: 'name'
				,	typeAhead: false
				,	hideTrigger2: false
				, triggerAction: 'all'
				,	editable: false
				,	value:''
				, listeners: {
							'select': function() { this.ownerCt.grid.store.load(); }
						,	'clear': function() { this.ownerCt.grid.store.load(); }
					}		
			}, {
					xtype: 'xtwincombo'
				, fieldLabel: 'Family'
				, name: 'Family'
				,	queryParam: 'filter'		
				,	store: new Ext.data.Store({
							proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
						,	baseParams: {"type":"Family"}
						, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
					})
				,	displayField: 'name'
				,	typeAhead: false
				,	hideTrigger2: true
				,	minChars: 2
				,	value:''
				, listeners: {
							'select': function() { this.ownerCt.grid.store.load(); }
						,	'clear': function() { this.ownerCt.grid.store.load(); }
					}
			}, {
					xtype: 'xtwincombo'
				, fieldLabel: 'Genus'
				, name: 'Genus'
				,	queryParam: 'filter'		
				,	store: new Ext.data.Store({
							proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
						,	baseParams: {"type":"Genus"}
						, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
					})
				,	displayField: 'name'
				,	typeAhead: false
				,	hideTrigger2: true
				,	minChars: 2
				,	value:''
				, listeners: {
							'select': function() { this.ownerCt.grid.store.load(); }
						,	'clear': function() { this.ownerCt.grid.store.load(); }
					}		
			}, {
					xtype: 'xtwincombo'
				, fieldLabel: 'Species'
				, name: 'Species'
				,	queryParam: 'filter'		
				,	store: new Ext.data.Store({
							proxy: new Ext.data.HttpProxy({url: 'server/form_lists.php'})
						,	baseParams: {"type":"Species"}
						, reader: new Ext.data.JsonReader({root: 'nodes',	id: 'name'}, [ {name: 'name', mapping: 'name'} ])
					})
				,	displayField: 'name'
				,	typeAhead: false
				,	hideTrigger2: true
				,	minChars: 2
				,	value:''
				, listeners: {
							'select': function() { this.ownerCt.grid.store.load(); }
						,	'clear': function() { this.ownerCt.grid.store.load(); }
					}		
			}]
		}

	,	biodiversity_cm: [{
				header: "Category"
			,	dataIndex: 'Phylum'
			,	sortable: true
			,	width: 100
		}, {
				header: "Family"
			,	dataIndex: 'Family'
			,	sortable: true
			,	width: 95
		}, {
				header: "Genus"
			,	dataIndex: 'Genus'
			,	sortable: true
			,	width: 90
		}, {
				header: "Species"
			,	dataIndex: 'SpecificEpithet'
			,	sortable: true
			,	width: 80
		}]

	,	biodiversity_recordType: [
				{name: 'Phylum'}
			,	{name: 'Family'}
			,	{name: 'Genus'}
			,	{name: 'SpecificEpithet'}
			,	{name: 'R0'}
			,	{name: 'R1'}
			,	{name: 'R2'}
			,	{name: 'R3'}
			,	{name: 'R4'}
			,	{name: 'R5'}
			,	{name: 'R6'}
			,	{name: 'R7'}
			,	{name: 'R8'}
			,	{name: 'R9'}
			,	{name: 'R10'}
			,	{name: 'R11'}
			,	{name: 'R12'}
			,	{name: 'R13'}
			,	{name: 'R14'}
			,	{name: 'R15'}
			,	{name: 'R16'}
			,	{name: 'R17'}
			,	{name: 'R18'}
			,	{name: 'R19'}
			,	{name: 'R20'}
		]
}

/*
            new Ext.menu.CheckItem({
                text: 'Dicot',
                id: 'dicot',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Fern',
                id: 'fern',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Fungi',
                id: 'fungi',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Gymnosperm',
                id: 'gymnosperm',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Hornwort',
                id: 'hornwort',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Horsetail',
                id: 'horstail',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Lichen',
                id: 'lichen',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Liverwort',
                id: 'liverwort',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Lycopod',
                id: 'lycopod',
                checked: true,
               checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Monocot',
                id: 'monocot',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Moss',
                id: 'moss',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Quillwort',
                id: 'quillwort',
                checked: true,
                checkHandler: loadData
            }),
            new Ext.menu.CheckItem({
                text: 'Whiskfern',
                id: 'whiskfern',
                checked: true,
                checkHandler: loadData
            })]
*/
//================================================================================

Config.Default.Modules = [{
	  	module: SilverCollection.ExternalLink
		, config: {
					text: 'LSU Herbarium Website'
				,	iconCls: 'icon_home'
				,	link: 'http://www.herbarium.lsu.edu/home.html'
				,	target: '_self'
			}
	}, {
			module: SilverCollection.Browse
	}, {
			module: SilverCollection.Search
	}, {
	  	module: SilverCollection.Checklist
	}, {
	  	module: SilverCollection.Images
	}, {
	  	module: SilverCollection.ExternalLink
		, config: {
					text: 'Interactive Map'
				,	iconCls: 'icon_distribution'
				,	link: 'http://www.herbarium.lsu.edu/map'
			}
	}, {
	  	module: SilverCollection.ExternalLink
		, config: {
					text: 'FactSheets'
				,	iconCls: 'icon_factsheets'
				,	link: 'http://www.herbarium.lsu.edu/factsheets'
			}
	}, {
	  	module: SilverCollection.ExternalLink
		, config: {
					text: 'Interactive Keys'
				, xtype: 'splitbutton'
				,	iconCls: 'icon_factsheets'
				,	link: 'http://www.herbarium.lsu.edu/keys'
//				,	tooltip: 'Click drop down for specific keys'
				,	menu: new Ext.menu.Menu({
							items: [{ 
									text: 'Interactive Keys Homepage'
								,	handler: function() {
										SilverCollection.stats.log('External/Interactive Keys/Index' );
										window.open( 'http://www.herbarium.lsu.edu/keys', '_blank' );
									}									
							}, {											
									text: 'Carex Interactive Identification Key'
								,	iconCls: 'icon_lucid3'
								,	handler: function() {
										SilverCollection.stats.log('External/Interactive Keys/Carex' );
										window.open( 'http://www.herbarium.lsu.edu/keys/carex/carex.html', '_blank' );
									}
							}, {
									text: 'Rhynchospora Interactive Identification Key'
								,	iconCls: 'icon_lucid3'
								,	handler: function() {
										SilverCollection.stats.log('External/Interactive Keys/Rhynchospora' );
										window.open( 'http://www.herbarium.lsu.edu/keys/rhy/rhynchospora.html', '_blank' );
									}									
							}, {
									text: 'Cyperus Interactive Identification Key'
								,	iconCls: 'icon_lucid3'
								,	handler: function() {
										SilverCollection.stats.log('External/Interactive Keys/Cyperus' );
										window.open( 'http://www.herbarium.lsu.edu/keys/cyperus/cyperus.html', '_blank' );
									}									
							}, {
									text: 'Scleria Interactive Identification Key'
								,	iconCls: 'icon_lucid3'
								,	handler: function() {
										SilverCollection.stats.log('External/Interactive Keys/Scleria' );
										window.open( 'http://www.herbarium.lsu.edu/keys/scleria/scleria.html', '_blank' );
									}									
							}, {
									text: 'Glossary'
								,	handler: function() {
										SilverCollection.stats.log('External/Interactive Keys/Glossary' );
										window.open( 'http://www.herbarium.lsu.edu/keys/gloss/glossary.html', '_blank' );
									}									
							}]
					})				
			}
	}
]

Config.Default.Grid.Specimens = {	

		// required. Note: empty setting would be "cm: []"
		cm: [{
					sortable: false
				, dataIndex: 'specimen_sheet_image'
				, renderer: 'this.renderImageAvail'
				, width: 26
				,	menuDisabled: true
				, resizable: false
				,	tooltip: 'Specimen Sheet Available'
			}, {
					sortable: false
				,	dataIndex: 'llAvail'
				, renderer: 'this.renderllAvail'
				, width: 26
				,	menuDisabled: true
				, resizable: false
				,	tooltip: 'Coordinates Available'
			}, {
					header: Lang.Get('Core','grid_specimens','CatalogNumber')
				,	dataIndex: 'CatalogNumber'
				,	width: 82
			}, {
				 	header: Lang.Get('Core','grid_specimens','Family')
				,	dataIndex: 'Family'
				,	width: 80
			}, {
					header: Lang.Get('Core','grid_specimens','Genus')
				,	dataIndex: 'Genus'
				,	width: 70
			}, {
					header: Lang.Get('Core','grid_specimens','Epithet')
				,	dataIndex: 'SpecificEpithet'
				,	width: 120
				,	renderer: function(value, p, r) {
						return String.format('{0} {1} {2}', value, r.data.InfraspecificRank, r.data.InfraspecificEpithet);
					}
			},{
					header: Lang.Get('Core','grid_specimens','StateProvince')
				,	dataIndex: 'StateProvince'
				,	width: 75
			},{
					header: Lang.Get('Core','grid_specimens','County')
				,	dataIndex: 'County'
				,	width: 120
			},{
					header: Lang.Get('Core','grid_specimens','Locality')
				,	dataIndex: 'Locality'
				,	width: 120
			}	,{
					header: "Collector"
				,	dataIndex: 'Collector'
				,	width: 120
			}]

		// required. Note: empty setting would be ", recordType: []"
	,	recordType: [
				{name: 'specimen_sheet_image'}
			,	{name: 'llAvail'}
			, {name: 'iucn_redlist_type'}
			,	{name: 'CatalogNumber'}
			,	{name: 'Family'}
			,	{name: 'Genus'}
			,	{name: 'SpecificEpithet'}
			,	{name: 'InfraspecificRank'}
			,	{name: 'InfraspecificEpithet'}
			,	{name: 'StateProvince'}
			,	{name: 'County'}
			,	{name: 'Locality'}
			,	{name: 'Collector'}
			,	{name: 'collected', mapping: 'collected', type: 'date', dateFormat: 'timestamp'}
		]

	,	sortInfo: {
				field: 'Family'
			, direction: 'ASC'
		}

	,	groupField: 'Family'
	
	,	extensions: [ 
				SilverCollection.plugins.Download
			,	SilverCollection.plugins.Email
			,	SilverCollection.plugins.Distribution
		]		
}

Config.Default.Specimen.Window = {
		title: Lang.Get('Core', 'specimen', 'title')
	,	width: 700
	, height: 400
	, extensions: [{ 
			module: SilverCollection.plugins.SpecimenInfo	// Record Information
		}, {
			module: SilverCollection.plugins.SpecimenSheet	// Specimen Sheet Module
//		}, {
//			module: SilverCollection.plugins.SpecimenClimate	// Specimen Sheet Module
		}, {
			module: SilverCollection.plugins.Coordinates	// Specimen Sheet Module			
/*			
		}, {
			module: SilverCollection.plugins.SpecimenFNA	// Specimen Sheet Module
		}, {
			module: SilverCollection.plugins.SpecimenUSDA	// Specimen Sheet Module
*/			
		}, {
			module: SilverCollection.plugins.SpecimenAnnotation	// Annotations
		}]
};

Config.Default.Specimen.Info = {
		title: 'Specimen Record'
	,	width: 500
	, height: 300
};

Config.Default.Specimen.FNA_tpl = new Ext.XTemplate(
	'<div style="padding:15px">' +
	'<b>SAMPLE TEXT FROM eFlora</b><br><br>' +
	'<span id="lblTaxonDesc">' + 
	'1. <b>Carphochaete bigelovii</b> A. Gray, Smithsonian Contr. Knowl.  3(5): 89.  1852.  ' +
	'<p>Bristlehead' +
	'<P>' +
	'<b>Stems</b> usually stiff, erect. <b>Leaves</b> often fascicled on older growth; blades 535 mm. <b>Heads</b> terminal (± pedunculate) or in leaf axils (sessile). <b>Involucres</b> 1220 mm. <b>Phyllaries:</b> gland-dotted, sometimes puberulent as well, margins narrowly hyaline, apices acute. <b>Corollas</b> 1520 mm, throats usually purplish, lobes creamy white. <b>Cypselae</b> yellow-green to golden brown, 1114 mm; <b>pappus scales</b> mostly brownish to purplish with colorless, hyaline margins, aristae of the longer 13+ mm, scabrous. <b>2<i>n</i></b> = 22.<p>' +
	'<p>' +
	'Flowering JanJun. Sandy soils, rock outcrops in grasslands, chaparral, pine-oak woodlands; 9002200 m; Ariz., N.Mex., Tex.; Mexico (Chihuahua, Coahuila, Sonora). <p>' +
	'<p>' +
	'</span>' +
	'Flora of North America Editorial Committee, eds.  1993+.  Flora of North America North of Mexico.  12+ vols.  New York and Oxford.' +
	'</div>'
);

Config.Default.Specimen.USDA_tpl = new Ext.XTemplate(
	'<div style="padding:20px">Feature Not Available.</div>'
);

Config.Default.Specimen.Coordinates_tpl = new Ext.XTemplate(
	'<img src="images/gmap.jpg">'
);

Config.Default.Specimen.SpecimenSheet_tpl = new Ext.XTemplate(
	'<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="{specimen_sheet_width}" HEIGHT="{specimen_sheet_height}">' +
		'<PARAM NAME="FlashVars" VALUE="zoomifyImagePath=' + Config.URL + '{specimen_sheet_path}/">' +
		'<PARAM NAME="MENU" VALUE="FALSE">' +
		'<PARAM NAME="SRC" VALUE="zoomifyViewer.swf">' +
		'<EMBED FlashVars="zoomifyImagePath=' + Config.URL + '{specimen_sheet_path}/" SRC="zoomifyViewer.swf\" MENU="false" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"  WIDTH="{specimen_sheet_width}" HEIGHT="{specimen_sheet_height}"></EMBED>' + 
	'</OBJECT>'
);

Config.Default.Specimen.Info_tpl = new Ext.XTemplate(
	'<div class="specimen-detail">',

		'<div class="taxontree">',
			'<div class="taxontree-header"></div>',
			'<span class="taxontree-label">Classification :: Taxonomy</span>',
			'<ul style="padding-top:10px;">',
				'<li>{Phylum}</li>',
					'<ul>',
					'<li>{Family}</li>',
							'<ul>',			
							'<li>{Genus}</li>',
								'<ul>',			
								'<li>{SpecificEpithet}</li>',
									'<ul>',			
									'<li>{InfraspecificRank} {InfraspecificEpithet}</li>',
									'</ul>',
								'</ul>',
							'</ul>',
					'</ul>',
			'</ul>',
			'<p><label>Author:</label> {AuthorYearOfScientificName}</p>',		
			'<p><label>USDA Plants Symbol:</label> <a href="http://plants.usda.gov/java/profile?symbol={usda_plants_symbol}" target="_blank">{usda_plants_symbol}</a></p>',
		'</div>',

		'<div class="taxontree">',
			'<div class="taxontree-header"></div>',
			'<span class="taxontree-label">Locality</span>',
			'<ul style="padding-top:10px;">',
			'<li><label>Country:</label> {Country}</li>',
				'<ul>',
				'<li><label>State:</label> {StateProvince}</li>',
					'<ul>',
					'<li><label>Parish/County:</label> {County}</li>',
						'<ul>',
						'<li><label>Locality:</label> {Locality}</li>',
						'<li><label>Specific Locality:</label> {text_4}',
						'</ul>',
					'</ul>',
				'</ul>',
			'</ul>',
			'<p>&nbsp;</p>',
			'<tpl if="DecimalLatitude != 0">',
				'<p><label>Latitude:</label>&nbsp;&nbsp;&nbsp; {DecimalLatitude} ({DecimalLatitude:this.convLatLon})</p>',
			'</tpl>',
			'<tpl if="DecimalLongitude != 0">',
				'<p><label>Longitude:</label> {DecimalLongitude} ({DecimalLongitude:this.convLatLon})</p>',
			'</tpl>',
			'<tpl if="MaximumElevationInMeters &gt; 0">',
				'<p><label>Altitude:</label> {MaximumElevationInMeters} Meters ({MaximumElevationInMeters:this.convFeet})</p>',
			'</tpl>',
			'<p><label>Township Range Section:</label> {text_1}</p>',		
			'<p><label>Habitat Description:</label> {FieldNotes}</p>',			
			'<p><label>Collector Name:</label> {Collector}</p>',		
			'<p><label>Collector Number:</label> {CollectorNumber}</p>',		
			'<p><label>Collection Date:</label> {EarliestDateCollected}</p>',		
		'</div>',

		'<div class="taxontree">',
			'<div class="taxontree-header"></div>',
			'<span class="taxontree-label">Other</span>',
			'<p style="padding-top:10px;"><label>Remarks:</label> {text_3}</p>',			
			'<p><label></label> {text_2}</p>',
		'</div>',

		'<div class="taxontree">',
			'<div class="taxontree-header"></div>',
			'<span class="taxontree-label">Record Info</span>',
			'<p style="padding-top:10px;"><label>Global Unique Id:</label> {GlobalUniqueIdentifier}</p>',
			'<p><label>Date Last Modified:</label> {DateLastModified}</p>',
			'<p><label>Basis of Record:</label> {BasisOfRecord}</p>',
			'<p><label>Institution Code:</label> {InstitutionCode}</p>',
			'<p><label>Collection Code:</label> {CollectionCode}</p>',
			'<p><label>Catalog Number:</label> {CatalogNumber}</p>',						
			'<p><label>Accession Number:</label> {accession}</p>',						
//			'<p><label>LSID:</label> urn:lsid:www.herbarium.lsu.edu:plants:{CatalogNumber}</p>',						
		'</div>',

	'</div>', {
			convLatLon: function(dec) {
				var signlat = 1;
				if(dec < 0) { signlat = -1; }
				latAbs = Math.abs( Math.round(dec * 1000000.));
				return ((Math.floor(latAbs / 1000000) * signlat) + '&deg; ' + Math.floor( ((latAbs/1000000) - Math.floor(latAbs/1000000)) * 60) + '\' ' + ( Math.floor(((((latAbs/1000000) - Math.floor(latAbs/1000000)) * 60) - Math.floor(((latAbs/1000000) - Math.floor(latAbs/1000000)) * 60)) * 100000) *60/100000 ) + '&quot;');
			}						
		,	convFeet: function( meters ) {

				function round ( val, precision ) {
						return parseFloat(parseFloat(val).toFixed(precision));
				}
				
				return ( round( (meters * 3.2808399), 3 ) + ' Feet' );
			}						
	}
);
