var param;
var idFirstNews;
var idhiddenText;

function ShowWin(par){
	
	param=par;
	if (win2.isVisible()) {
		win2.hide();
	}
	
	win2.show();
}
	
Ext.onReady(function(){

	var confirmPanel = new Ext.Panel({
		autoScroll : true,
		html: '111',
		bodyStyle: 'background: #ffffff; padding: 7px;'		
    });


	win2 = new Ext.Window({
				layout      : 'fit',
                width       : wwidth,
                height      : wheight,
                closeAction :'hide',
                plain       : true,
				closable	: true, 
				items: confirmPanel,
				buttonAlign: 'left',
				listeners: {
					'show': {
						fn:function(e) {
							var mgr = confirmPanel.getUpdater();
								mgr.update({
	        						url: "/abccosm/farpost/shownews.php",
   		     						params: {
   	        							action: param
	        						}
								});
							}
						}
					}
				
    });
	
	if (idFirstNews>0) {
	  Ext.Ajax.request({
   		url: '/abccosm/farpost/shownews.php',
   		success: function(r){
					//alert('bad: '+);
					load_news.innerHTML = r.responseText;
    				},
	    //failure: otherFn,
		headers: {
       		'my-header': 'foo'
   		},
   		params: {
   	        action: idFirstNews,
			first: '1',
			tp: '1'
	     }
	  });
	}
	
	if (idhiddenText>0) {
	  Ext.Ajax.request({
   		url: '/abccosm/farpost/shownews.php',
   		success: function(r){
					load_hidden_doc.innerHTML = r.responseText;
    				},
		headers: {
       		'my-header': 'foo'
   		},
   		params: {
   	        action: idhiddenText,
			tp: '2'
	     }
	  });
	 }
});

//alert();
	
	
