Ext.onReady(function(){

    Ext.QuickTips.init();
    
    var xg = Ext.grid;

    // shared reader
    var reader = new Ext.data.ArrayReader({}, [
       {name: 'Business Sector'},
       {name: 'Search Term (s)'},
       {name: 'Position on Google'},
       {name: 'Time Taken'},
       {name: 'desc'}
    ]);

    var grid = new xg.GridPanel({
        store: new Ext.data.GroupingStore({
            reader: reader,
            data: xg.dummyData,
            sortInfo:{field: 'Business Sector', direction: "ASC"},
            groupField:'Business Sector'
        }),

        columns: [
            {id:'Business Sector'
	    ,header: "Business Sector", width: 40, sortable: true, dataIndex: 'Business Sector'},
            {header: "Search Term (s)", width: 50, sortable: true, dataIndex: 'Search Term (s)'},
            {header: "Position on Google", width: 20, sortable: true, dataIndex: 'Position on Google'},
            {header: "Time Taken", width: 20, sortable: true, dataIndex: 'Time Taken'}

        ],

        view: new Ext.grid.GroupingView({
            forceFit:true,
            groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Keywords" : "Keyword"]})'
        }),

        frame:true,
        width: 670,
        height: 542,
        collapsible: true,
        animCollapse: false,
        title: 'Our Clients SEO Results',
        iconCls: 'icon-grid',
        renderTo: 'seo_main_fullpage_text'
    });
});



// Array data for the grids
Ext.grid.dummyData = [
['Electrical Retail',		'hotpoint norwich',					1,	'2 months'],
['Electrical Retail',		'sn550sidlwh',						6,	'2 months'],
['Electrical Retail',		'ovens norwich',			4,	'2 months'],
['Electrical Retail',		'televisions for sale norwich',			6,	'2 months'],

['Aviation Engineering',	'hilifts',							1,	'5 months'],
['Aviation Engineering',	'ground support equipment',8,	'3 months'],
['Aviation Engineering',	'ambulance lifts',					5,	'3 months'],
['Aviation Engineering',	'catering lifts',					4,	'3 months'],

['Car MOT & Servicing',		'mot test centre norwich',			9,	'3 weeks'],
['Car MOT & Servicing',		'norwich mot and service',			4,	'3 weeks'],
['Car MOT & Servicing',		'mot inspections norwich',			1,	'3 weeks'],

['Marine Upholstery',		'marine upholstery norfolk',		1,	'2 months'],

['Landscape Gardeners',		'garden creations',					7,	'2 months'],
['Landscape Gardeners',		'hard landscapers norwich',			2,	'6 weeks'],
['Landscape Gardeners',		'landscapers norwich',				2,	'6 weeks'],
['Landscape Gardeners',		'landscape gardeners norfolk',		11,	'2 months'],
['Landscape Gardeners',		'landscaping norfolk',		7,	'6 months'],

['Drain Services',		'blocked drains norwich',				2,	'1 month'],
['Drain Services',		'blocked drains norfolk',				9,	'1 month'],
['Drain Services',		'drain blockage service',				7,	'1 month'],
['Drain Services',		'drainage service',				3,	'5 months'],

['Accident Repairs ',		'alloy wheel refurbishment norwich',4,	'2 months'],
['Accident Repairs ',		'vehicle body care norwich',		1,	'2 months'],
['Accident Repairs ',		'vehicle bodycare norfolk ',		'1 & 2',	'4 months'],

[' Decorators ',		'commercial decorator norfolk',			3,	' 1 month '],
[' Decorators ',		'domestic decorator norfolk ',			1,	' 1 month '],


[' Equity Release Blog ',		' debt free equity release and joint tenants ',	4,	' 2 months '],
[' Equity Release Blog ',		' debt free equity release and joint tenants ',	4,	' 2 months '],
[' Equity Release Blog ',		' equity release london ',	3,	' 5 months '],

[' Photocopier and IT Services ',		' panasonic norwich ',						1,	' 5 weeks '],
[' Photocopier and IT Services ',		' photocopiers norfolk ',					6,	' 5 weeks '],
[' Photocopier and IT Services ',		' it cabling services norwich ',			4,	' 5 weeks '],

[' Plastic Bottle Manufacturers  ',		' oval hdpe bottle ',						5,	' 2 months '],
[' Plastic Bottle Manufacturers  ',		' quality plastic bottles ',				4,' 2 months '],
[' Plastic Bottle Manufacturers  ',		' plastic closures ',				9,' 2 months '],

[' Boiler Manufacturers ',		' oil fired boilers ',					2,	' 3 months '],
[' Boiler Manufacturers ',		' oil boilers ',						4,	' 3 months '],

[' Oil Pipeline Parts Manufacturer ',		' hastelloy pipe ',						7,			' 5 months '],
[' Oil Pipeline Parts Manufacturer ',		' quality pipeline fittings ',			'1 & 2',	' 2 months '],
[' Oil Pipeline Parts Manufacturer ',		' socket weld fitting manufacturer ',	'1 & 2',	' 2 months '],
[' Oil Pipeline Parts Manufacturer ',		' titanium fittings ',	'9',	' 5 months '],

[' Property Development ',		' akbuk holiday home ',						4,	' 1 month '],
[' Property Development ',		' turkish homes ',							4,	' 1 month '],
[' Property Development ',		' holiday home kusadasi ',					11,	' 1 month '],

[' Web Development, SEO ',		' graphic design services  ',				6,	' 7 months '],
[' Web Development, SEO ',		' graphic design norwich ',				8,	' 2 months '],
[' Web Development, SEO ',		' seo norwich ',				5,	' 6 months '],
[' Web Development, SEO ',		' graphic design norwich ',				7,	' 4 months '],

[' Equity Release Advice ',		' equity release solicitor kent  ',			6,	' 2 months '],
[' Equity Release Advice ',		' equity release adviser manchester  ',		7,	' 2 months '],
[' Equity Release Advice ',		' equity release provider cardiff  ',		5,	' 2 months '],
[' Equity Release Advice ',		' equity release adviser ',				2,	' 8 months '],

[' Special Needs School ',		' adhd club  ',						7,	' 1 month '],
[' Special Needs School ',		' reepham social groups ',			7,	' 1 month '],


[' Executive Inflight Catering ',		' vip airline catering ',						5,	' 2 months '],
[' Executive Inflight Catering ',		' executive airline catering ',					2,	' 2 months '],

[' Marquee Hire / Event Planner ',		' marquees norwich  ',					2,	' 6 months '],
[' Marquee Hire / Event Planner ',		' event hire norwich ',					3,	' 3 months '],
[' Marquee Hire / Event Planner ',		' event planner norwich ',				4,	' 3 months '],

[' Garden Designer ',		' garden designer norfolk ',				2,	' 2 months '],
[' Garden Designer ',		' design me a garden ',						1,	' 4 months '],
[' Garden Designer ',		' modern garden planters ',					7,	' 4 months '],


[' Online Wedding Shop / Retail ',		' wedding accessories ',			6,	' 8 months '],
[' Online Wedding Shop / Retail ',		' dew drops ',						3,	' 4 months '],
[' Online Wedding Shop / Retail ',		' male wedding favours ',			7,	' 4 months '],


[' Wrought Iron Products  ',		' iron craft ',						5,	' 3 months '],
[' Wrought Iron Products  ',		' balustrades norfolk ',			3,	' 3 months '],
[' Wrought Iron Products  ',		' iron gates norfolk ',				9,	' 3 months '],

[' Beauty Treatment -Retail  ',		' painless hair removal norwich  ',	1,	' 2 months '],
[' Beauty Treatment -Retail  ',		' beauty salon newport pagnell  ',	6,	' 2 months '],

[' Car Body Repairs ',		' vehicle repair norwich ',					8,	' 8 months '],
[' Car Body Repairs ',		' vehicle paint specialists norfolk ',		3,	' 8 months '],
[' Car Body Repairs ',		' accident damage repair norfolk ',			5,	' 8 months '],

[' Lorry Parts ',		' truck parts ',							6,	' 3 months '],
[' Lorry Parts ',		' find a truck part ',						6,	' 1 months '],
[' Lorry Parts ',		' parts for truck ',						5,	' 2 months '],

[' PVC Door Manufacturer  ',		' hyaline fast doors ',				1,	' 4 weeks '],
[' Financial Consultants  ',		' financial consultants norwich ',	1,	' 2 months '],
[' Cleaning Tissues ',		' disposable tissues ',						2,	' 3 months '],

[' Independent Financial Adviser ',		' tax advice norwich ',						9,	' 3 months '],
[' Independent Financial Adviser ',		' tax advice norfolk ',						9,	' 3 months '],

[' Event Management ',		' event management norwich ',						4,	' 4 weeks '],
[' Marquee Hire ',		' wedding marquee hire norfolk ',						9,	' 3 months '],

[' Equestrian Directory ',		' tack for sale ',						6,	' 3 weeks '],

[' Equestrian Directory ',		' tack for sale ',						6,	' 3 weeks ']

//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
//[' Accident ',		' vehicle ',						1,	' 5 months '],
					
						
			


];




/*
Ext.onReady(function() {

Ext.QuickTips.init();

	var myData = [
		['Electrical Retail','hotpoint norwich',1,'2 months'],
		['Electrical Retail','sn550sidlwh',6,'2 months'],
		['Electrical Retail','electrical store norwich',4,'2 months'],
		['Aviation Engineering','aviation ground support equipment',6,'1 Year'],
		['Aviation Engineering','hilifts',1,'1 Year'],
		['Aviation Engineering','hilifts',1,'1 Year']
	];
 
	var myReader = new Ext.data.ArrayReader({}, [
		{name: 'Business Sector'},
		{name: 'Search Term (s)'},
		{name: 'Position on Google'},
		{name: 'Time Taken'}
	]);
 
	var grid = new Ext.grid.GridPanel({
		store: new Ext.data.Store({
			data: myData,
			reader: myReader,
			autoSizeColumns: true,
			autoSizeHeaders: false,
			trackMouseOver: true,

		}),
		columns: [
			{header: 'Business Sector', width: 120, sortable: true, dataIndex: 'Business Sector'},
			{header: 'Search Term (s)', width: 190, sortable: true, dataIndex: 'Search Term (s)'},
			{header: 'Position on Google', width: 120, sortable: true, dataIndex: 'Position on Google'},
			{header: 'Time Taken', width: 120, sortable: true, dataIndex: 'Time Taken'},
		],
		viewConfig: {
			forceFit: true
		},
		renderTo: 'content',
		title: 'Metalfrog',
autoScroll : true,

width: 600,
        height:300,
        minWidth: 300,
        minHeight: 200,
        layout: 'fit',
        plain:true





	
		
	});
 
	grid.getSelectionModel().selectFirstRow();
	
});
*/