function showEdWindow(specid,admin,userid,userlogin) {
	if (userlogin!='') {
		userlogin = ' for '+userlogin;
	}
	var edvalue = new Ext.form.TextField({
		xtype: 'textfield',
		maxLength: 5,
		style: 'margin-left: 10px; margin-top:5px;',
		width: 130,
		maskRe: /^[0-9]{0,}$/
	});
        var edvalue_u = new Ext.form.TextField({
                xtype: 'textfield',
                maxLength: 5,
                style: 'margin-left: 10px; margin-top:5px;',
                width: 130,
                maskRe: /^[0-9]{0,}$/
        });

        var edcoll = new Ext.form.TextField({
                xtype: 'textfield',
                maxLength: 5,
                style: 'margin-left: 10px; margin-top:5px;',
                width: 130
        });
        var edcoll_u = new Ext.form.TextField({
                xtype: 'textfield',
                maxLength: 5,
                style: 'margin-left: 10px; margin-top:5px;',
                width: 130
        });

	var edsearch = new Ext.form.TextField({
		xtype: 'textfield',
		maxLength: 5,
		style: 'margin-left: 10px; margin-top:5px;',
		width: 130
	});
        var edsearch_u = new Ext.form.TextField({
                xtype: 'textfield',
                maxLength: 5,
                style: 'margin-left: 10px; margin-top:5px;',
                width: 130
        });
	var edoffer = new Ext.form.TextField({
		xtype: 'textfield',
		maxLength: 5,
		style: 'margin-left: 10px; margin-top:5px;',
		width: 130
	});
        var edoffer_u = new Ext.form.TextField({
                xtype: 'textfield',
                maxLength: 5,
                style: 'margin-left: 10px; margin-top:5px;',
                width: 130
        });

	var lavalue = new Ext.form.Label({
		xtype: 'label',
		text: 'Value',
		style: 'margin-left: 10px;font-size: 10px'
	});
        var lavalue_u = new Ext.form.Label({
                xtype: 'label',
                text: 'Value_u',
                style: 'margin-left: 10px;font-size: 10px'
        });

	var specimg = new Ext.form.Label({
                width: 100,
                height: 171,
                region: 'west',
                html: '<img src="/images/test.png" width="100" height="171">',
                margins: '5 5 5 5'
	});
	var edwin = new Ext.Window({
		width:420,
		height: 270,
		title: 'Edit Search/Offer Values'+userlogin,
		layout: 'border',
		items: [
			specimg,
		{
			margins: '5 5 5 5',
			region: 'center',
			layout: 'table',
			layoutConfig: {columns: 2},
			items: [
				edvalue,	edvalue_u,
				lavalue,	lavalue_u,
				edcoll,		edcoll_u,
			{
				xtype: 'label',
                                text:  'Collection',
                                style: 'margin-left: 10px;font-size: 10px'
			},{
                                xtype: 'label',
                                text:  'Collection 2',
                                style: 'margin-left: 10px;font-size: 10px'
                        },
				edsearch,	edsearch_u,
			{
				xtype: 'label',
				text: 'Search',
				style: 'margin-left: 10px;font-size: 10px'
			},{
                                xtype: 'label',
                                text: 'Search_u',
                                style: 'margin-left: 10px;font-size: 10px'
                        },
				edoffer,	edoffer_u,
			{
				xtype: 'label',
				text: 'Offer',
				style: 'margin-left: 10px;font-size: 10px'
			},{
                                xtype: 'label',
                                text: 'Offer_u',
                                style: 'margin-left: 10px;font-size: 10px'
                        }]
		}, {
			region: 'south',
			layout: 'table',
			layoutConfig: {columns:3},
			margins: '5 5 5 5',
			width: 400,
			height: 40,
			items: [{
				xtype: 'button',
				text: 'Abort',
				width: 170,
				listeners: {
					click: function() {
								edwin.close();
							}
				}
			}, {
				width: 55,
				height: 40,
				border: false
			}, {
				xtype: 'button',
				text: 'Save',
				width: 170,
				listeners: {
					click: function() {
							var vals = edsearch.getValue();
							var valo = edoffer.getValue();
							var valv = edvalue.getValue();
							var coll = edcoll.getValue();
                                                        var vals_u = edsearch_u.getValue();
                                                        var valo_u = edoffer_u.getValue();
                                                        var valv_u = edvalue_u.getValue();
                                                        var coll_u = edcoll_u.getValue();
							if (edvalue.isValid() && edoffer.isValid() && edcoll.isValid() && edsearch.isValid() &&
								edvalue_u.isValid() && edoffer_u.isValid() && edcoll_u.isValid() && edsearch_u.isValid()) {
								Ext.Ajax.request({
									url: '/ajax/exchangelist_edit/'+specid+'/',
									params: {'vals': vals,'valo': valo,'valv': valv,'coll': coll,'admin': admin,'userid': userid,
										 'vals_u': vals_u,'valo_u': valo_u,'valv_u': valv_u,'coll_u': coll_u
										},
									success: function(response,opts) {
													edwin.close();
												},
									failure: function(response,opts) {
													alert('error, writing data!');
												}
								});
							}
							else {
								alert('dataerror!');
							}
					}
				}
			}]
		}]
	});
	if (admin==0) {
		edvalue.hide();
		lavalue.hide();
		edvalue_u.hide();
		lavalue_u.hide();
	}

	Ext.Ajax.request({
		url: '/ajax/exchangelist_edit_read/'+specid+'/'+userid+'/',
		success: function(response,opts) {
						var obj = Ext.decode(response.responseText);
						edvalue.setValue(obj['valv']);
						edsearch.setValue(obj['vals']);
						edoffer.setValue(obj['valo']);
						edcoll.setValue(obj['coll']);
                                                edvalue_u.setValue(obj['valv_u']);
                                                edsearch_u.setValue(obj['vals_u']);
                                                edoffer_u.setValue(obj['valo_u']);
                                                edcoll_u.setValue(obj['coll_u']);
						specimg.update('<img src="/images/'+obj['photo']+'">');
					},
		failure: function(response,opts) {
					}
	});
	edwin.show();
};

