var dataCatAdv = [
  	['Advertising, Promotion & Publishing','Advertising, Promotion & Publishing'],
	['Agriculture, Forestry & Fishing','Agriculture, Forestry & Fishing'],
	['Amusement & Recreation','Amusement & Recreation'],
	['Arts & Gifts','Arts & Gifts'],
	['Association, Organization & Club','Association, Organization & Club'],
	['Automotive','Automotive'],
	['Books & Literature','Books & Literature'],
	['Chemicals','Chemicals'],
	['Cooperative Buying Service','Cooperative Buying Service'],
	['Courses','Courses'],
	['Educational Aids & Supplies','Educational Aids & Supplies'],
	['Educational Services','Educational Services'],
	['Electric & Electronic','Electric & Electronic'],
	['Fashion','Fashion'],
	['Finance','Finance'],
	['Food, Beverages, Cigar, Cigarette & Tobacco','Food, Beverages, Cigar, Cigarette & Tobacco'],
	['Health & Beauty','Health & Beauty'],
	['Health & Care','Health & Care'],
	['Home & Office','Home & Office'],
	['Hotel & Motel Consultant & Equipment','Hotel & Motel Consultant & Equipment'],
	['Hotel & Travelling','Hotel & Travelling'],
	['Industry','Industry'],
	['Information Technology','Information Technology'],
	['Market & Shopping','Market & Shopping'],
	['Mining','Mining'],
	['Other Automotive','Other Automotive'],
	['Other Finance','Other Finance'],
	['Other Products','Other Products'],
	['Property & Building Materials','Property & Building Materials'],
	['Religious','Religious'],
	['Restaurant & Cafe','Restaurant & Cafe'],
	['School','School'],
	['Services','Services'],
	['Social Services','Social Services'],
	['Sports','Sports'],
	['Tourism & Amusement','Tourism & Amusement'],
	['Transportation','Transportation'],
	['Transportation & Communications','Transportation & Communications']
];

var advStore1 = new Ext.data.ArrayStore({
    fields: ['id', 'cName'], data:dataCatAdv
});
var advStore2 = new Ext.data.JsonStore({
	url:myurl()+'/control/Data.php', baseParams:{step:2}, root:'cat', fields:['id', 'name']
});

var advStore3 = new Ext.data.JsonStore({
	url:myurl()+'/control/Data.php', baseParams:{step:3}, root:'cat', fields:['id', 'name']
});

var advCat1 = {
	xtype:'combo', id:'advCat1', store:advStore1, displayField:'cName', valueField:'id', typeAhead:true, editable:false, mode:'local',
	forceSelection:true, triggerAction:'all', fieldLabel:'Categorie', emptyText:'Select info', selectOnFocus:true,
	listeners:{
		'select':function(){
			Ext.getCmp('ns').setValue('kat1');
			Ext.getCmp('nv').setValue(this.getValue());
			var strAdv2 = Ext.getCmp('mdAdv2'); 
			strAdv2.clearValue(); 
			strAdv2.store.load({params:{'cat':this.value}});
			strAdv2.enable();
		}//function
	}//listener
};

var advCat2 = {
	xtype:'combo', id:'mdAdv2', store:advStore2, displayField:'name', valueField:'id', typeAhead:true, editable:false, mode:'local',
	forceSelection:true, triggerAction:'all', hideLabel:true, emptyText:'Select info', selectOnFocus:true, disabled:true,
	listeners:{
		'select':function(){
			Ext.getCmp('ns').setValue('kat2');
			Ext.getCmp('nv').setValue(this.getValue());
			strAdv3 = Ext.getCmp('mdAdv3'); 
			strAdv3.clearValue(); 
			strAdv3.store.load({params:{step:3, cat:this.getValue()}});
			strAdv3.enable();
		}//function
	}//listener
};

var advCat3 = {
	xtype:'combo', id:'mdAdv3', store:advStore3, displayField:'name', valueField:'id', typeAhead:true, editable:false, mode:'local',
	forceSelection:true, triggerAction:'all', hideLabel:true, emptyText:'Select info', selectOnFocus:true, disabled:true,
	listeners:{
		'select':function(){
			Ext.getCmp('ns').setValue('kat3');
			Ext.getCmp('nv').setValue(this.getValue());
		}//function
	}//listener
};
