/*
* Promo Action by Eltera.bg
*
* @author Ing. Nikolay Peychovski
* @copyright (c) 2009, by eltera.bg
* @date 31.01.2011
* @version $Id: promoaction.js 001 2011-01-31 11:00:00Z jozo $
*
* @license promoaction.js is licensed under the terms of the Open Source
* LGPL 3.0 license. Commercial use is permitted to the extent that the
* code/component(s) do NOT become part of another Open Source or Commercially
* licensed development library or toolkit without explicit permission.
*
* License details: http://www.gnu.org/licenses/lgpl.html
*/

//function latterMe(id){
/*
var mfo=new Ext.FormPanel({
title:'',
width:320,
height:290,
id:'mfo',
frame: true,
defaults:{
flex: 1,
width: 250
},
items:[{
		xtype:'textfield',
		name:'mdo_name',
	    fieldLabel:'Име <b style="color:#ff0000">&nbsp;*&nbsp;</b>',
		id:'mdo_name',
		allowBlank: true
		},{
		xtype:'textfield',
		name:'mdo_name',
	    fieldLabel:'Име',
		id:'mdo_company'
		},{
		xtype:'textfield',
		name:'mdo_name',
	    fieldLabel:'Име',
		id:'mdo_name'
		},{
		xtype:'textfield',
		name:'mdo_name',
	    fieldLabel:'Име',
		id:'mdo_name'
		}


]




});


var infoPanel= new Ext.Panel({
title:'',
width:250,
height: 250,
bodyStyle: 'background:#000000',
items:[{

xtype: 'box',
html: '<div style="width:250px; height:250px: color">Моля, свържете се с нас...</div><div style="margin-top: 20px; width:250px; height:250px; padding: 5 5 5 5"><table width="250" align="center" cellpadding="0" cellspacing="0"><tr><td colspan="2"><b>Централен Офис - Бургас</b></td></tr><tr><td width="50px">тел.:</td><td>056 845 105</td></tr><tr><td width="50px">факс:</td><td>056 845 104</td></tr><tr><td width="50px">e-mail:</td><td>info@eltera.bg</td></tr></table></div>'



}]


})

var wiM= new Ext.Window({
title: '<b style="background:#000000; color:yellow">Запитване за '+id+'</b>',
width: 250,
height: 250,
y:300,
bodyStyle: 'background:#000000',
items:[
infoPanel
],
bbar:[
'->',{
	xtype:'button',
	text:'Затвори или Esc',
	handler: function(){
		wiM.close();
	}

} 

]


});
wiM.show();


}




 function showPromos(){ 
var myData = [
				['<a href="http://eltera.bg/index.php?option=com_content&view=article&id=526:thermo-shot-f30-&catid=52:2008-11-12-11-00-44&Itemid=53" target="_blank"><b style="color: #000000">H2640D Thermo Tracer</b></a>','<i style="color: #000000">Frame Rate: 7.5Hz (Newly introduced recently,<br>so the data sheet is for 30Hz version) 640 x 480 UFPA Detector</i>','<a href="http://eltera.bg/data.php?pd=Nec/h2640_NE_DS_EN_E_201101.pdf&pn=&acc=100" target="_blank" title="Техническа информация"><img src="/images/stories/pdficon.png" width="24px" height="24px"></a>','<a href="#" onClick="latterMe(\'H2640D Thermo Tracer\')"><img src="/images/stories/email.png" width="24" height="24"]/></a>'],
				['<a href="http://eltera.bg/index.php?option=com_content&view=article&id=527:h2630d-thermotracer-&catid=52:2008-11-12-11-00-44&Itemid=53" target="_blank"><b style="color: #000000">H2630D Thermo Tracer</b></a>','<i style="color: #000000">Frame Rate: 7.5Hz (Newly introduced recently,<br> so the data sheet is for 30Hz version) 640 x 480 UFPA Detector</i>','<a href="http://eltera.bg/data.php?pd=Nec/h2640_NE_DS_EN_E_201101.pdf&pn=&acc=100" target="_blank" title="Техническа информация"><img src="/images/stories/pdficon.png" width="24px" height="24px"></a>','<a href="#" onClick="latterMe(\'H2630D Thermo Tracer\')"><img src="/images/stories/email.png" width="24" height="24"]/></a>'],
				['<a href="http://eltera.bg/index.php?option=com_content&view=article&id=528:r300d-thermotracer-&catid=52:2008-11-12-11-00-44&Itemid=53" target="_blank"><b style="color: #000000">R300D</b></a>', '<i style="color: #000000">Frame Rate: 8.5Hz 320 x 240 UFPA Detector</i>','<a href="http://eltera.bg/data.php?pd=Nec/InfRec R300D NE DS EN B 201101.pdf&pn=&acc=100" target="_blank" title="Техническа информация"><img src="/images/stories/pdficon.png" width="24px" height="24px"></a>','<a href="#" onClick="latterMe(\'R300D\')"><img src="/images/stories/email.png" width="24" height="24"]/></a>'],
				['<a href="http://eltera.bg/index.php?option=com_content&view=article&id=456:g120g100-&catid=52:2008-11-12-11-00-44&Itemid=53" target="_blank"><b style="color: #000000">G120D Thermo GEAR</b></a>','<i style="color: #000000">Frame Rate: 8.5Hz 320 x 240 UFPA Detector</i>','<a href="http://eltera.bg/data.php?pd=Nec/g120-g100_NE_DS_EN_E_201101.pdf&pn=&acc=100" target="_blank" title="Техническа информация"><img src="/images/stories/pdficon.png" width="24px" height="24px"></a>','<a href="#" onClick="latterMe(\'G120 Thermo GEAR\')"><img src="/images/stories/email.png" width="24" height="24"]/></a>'],
				['<a href="http://eltera.bg/index.php?option=com_content&view=article&id=456:g120g100-&catid=52:2008-11-12-11-00-44&Itemid=53" target="_blank"><b style="color: #000000">G100D Thermo GEAR</b></a>','<i style="color: #000000">Frame Rate: 8.5Hz 320 x 240 UFPA Detector</i>','<a href="http://eltera.bg/data.php?pd=Nec/g120-g100_NE_DS_EN_E_201101.pdf&pn=&acc=100" target="_blank" title="Техническа информация"><img src="/images/stories/pdficon.png" width="24px" height="24px"></a>','<a href="#" onClick="latterMe(\'G100 Thermo GEAR\')"><img src="/images/stories/email.png" width="24" height="24"]/></a>'],
				['<a href="http://eltera.bg/index.php?option=com_content&view=article&id=488:g30-&catid=52:2008-11-12-11-00-44&Itemid=53" target="_blank"><b style="color: #000000">G30D Thermo GEAR</b></a>','<i style="color: #000000">Frame Rate: 8.5Hz 160 x 120 UFPA Detector</i>','<a href="http://eltera.bg/data.php?pd=Nec/g30_NE_DS_EN_E_201101.pdf&pn=&acc=100" target="_blank" title="Техническа информация"><img src="/images/stories/pdficon.png" width="24px" height="24px"></a>','<a href="#" onClick="latterMe(\'G30 Thermo GEAR\')"><img src="/images/stories/email.png" width="24" height="24"]/></a>'],
				['<a href="http://eltera.bg/index.php?option=com_content&view=article&id=309:f30ws&catid=52:2008-11-12-11-00-44&Itemid=53" target="_blank"><b style="color: #000000">F30/W/S Thermo GEAR</b></a>','<i style="color: #000000">Frame Rate: 8.5Hz 160 x 120 UFPA Detector</i>','<a href="http://eltera.bg/data.php?pd=Nec/F30-series_NE_DS_EN_E_201101.pdf&pn=&acc=100" target="_blank" title="Техническа информация"><img src="/images/stories/pdficon.png" width="24px" height="24px"></a>','<a href="#" onClick="latterMe(\'F30W/S Thermo Shot\')"><img src="/images/stories/email.png" width="24" height="24"]/></a>']
				
			];

			var store = new Ext.data.ArrayStore({
        fields: [
           {name: 'model'},
           {name: 'description'},
           {name: 'dslink'},
		   {name: 'postme'}
        ]
    });


store.loadData(myData);

var gridPromo= new Ext.grid.GridPanel({
autoWidth: true,
height: 350,
store: store,
columns: [
	{
		header:'<b style="color:#000000">Модел</b>',
		width: 190,
		sortable: true,
		dataIndex: 'model'
    },{
		header:'<b style="color:#000000">Описание</b>',
		width: 350,
		sortable: true,
		dataIndex: 'description'
	},{
		header:'<b style="color:#000000">Техническа информация</b>',
		width: 150,
		sortable: true,
		dataIndex: 'dslink'
    },{
		header:'<b style="color:#000000">---</b>',
		width: 40,
		sortable: true,
		dataIndex: 'postme'
    }
]
});

var winPromo = new Ext.Window({
title:'',
y:200,
width: 750,
height: 360,
 bodyStyle:'backround: #000000',
cloaseAction: 'close',
items:[
	gridPromo
	/*{
	 xtype: 'box',
	 html: 'Table'
	
	}
], 
tbar:['<b style="color:yellow">ПРОМОЦИЯ - ИНФРАЧЕРВЕНИ ТЕРМОКАМЕРИ</b>','->',{
	xtype:'button',
    text: '<b style="color: #ff0000">X</b>',
	handler: function(){
	
	winPromo.close();
	}
}
]
});


winPromo.show(); 
var reklama= Ext.getCmp('reklama');
reklama.close();
}
*/
Ext.onReady(function(){});


/*
var reklama = new Ext.Window({
id:'reklama',
title:'',
width: 760,
frame: true,
height:225,
closeAction:'close',
items:[
{
xtype:'box',
html:'<a href="#" onClick="showPromos()"><img src="/images/stories/infraredcamera.png"  width="750" height="175"></a>'
}


],
tbar:[
'->',{
	xtype:'button',
	text:'<b style="color: #ff0000">X</b>',
	handler: function(){
		reklama.close();
	}

} 

]

});
*/

function showSaleBoard(){
	var winSale= new Ext.Window({
	id:'saleboard',
	bodyStyle:'padding: 15px; font-weight: bold;',
	title: 'Разпродажба',
	closeAction: 'close', 
	width: 350,
	height: 300,
	bbar:[
		'->',{
			xtype:'button',
			text:'Затвори',
			handler: function(){
				winSale.close();
			}
		}

	],
	items:[{
		xtype:'box',
		html:'<div id="saleField" align="left"><p><u>Изберете група прибори от разпродажбата:</u></p><br><br><ul style="list-style: none;"><li><img src="images/stories/fleche4_sous_menu.gif" align="top" hspace="3px" ><a href="http://www.eltera.bg/data.php?pd=forsale/2011_05_06_Conditions.pdf&pn=Условия на разпродажбата&acc=75" target="_blank">Условия на разпродажбата</a><li><li><img src="images/stories/fleche4_sous_menu.gif" align="top" hspace="3px" ><a href="http://www.eltera.bg/data.php?pd=forsale/2011_10_03_Pollmann.pdf&pn=Арматура за ел. табла&acc=75" target="_blank">Арматура за ел. табла</a><li><li><img src="images/stories/fleche4_sous_menu.gif" align="top" hspace="3px" ><a href="http://www.eltera.bg/data.php?pd=forsale/2011_10_25_LSIS.pdf&pn=Комутационна апаратура&acc=75" target="_blank">Комутационна апаратура</a><li><li><img src="images/stories/fleche4_sous_menu.gif" align="top" hspace="3px" ><a href="http://www.eltera.bg/data.php?pd=forsale/2011_10_03_MSchneider.pdf&pn=Мултиблокове и предпазители&acc=75" target="_blank">Мултиблокове и предпазители</a><li><li><img src="images/stories/fleche4_sous_menu.gif" align="top" hspace="3px" ><a href="http://www.eltera.bg/data.php?pd=forsale/2011_10_03_GLW.pdf&pn=Кабелни накрайници&acc=75" target="_blank">Кабелни накрайници</a><li><li><img src="images/stories/fleche4_sous_menu.gif" align="top" hspace="3px" ><a href="http://www.eltera.bg/data.php?pd=forsale/2011_10_03_Hilpress.pdf&pn=Кабелни обувки и кабелни превръзки&acc=75" target="_blank">Кабелни обувки и кабелни превръзки</a><li><li><img src="images/stories/fleche4_sous_menu.gif" align="top" hspace="3px" ><a href="http://www.eltera.bg/data.php?pd=forsale/2011_10_03_Rema.pdf&pn=Биметални кабелни обувки&acc=75" target="_blank">Биметални кабелни обувки</a><li></ul></div>'
	}]
	});

	winSale.show();
	}






