
	// ================================================================================================
	// === Crea un blocco di news in base al parent selezionato
	// ================================================================================================
	// Per la visualizzazione
	tbls = new blockProperties();
	
	function newsBlock(divName, chSel, recs) {

		nbTable = new ajaxTable(divName);

		tbls.add(divName, nbTable);

		nbTable.setAjaxURL("console/_stuff/Ajaxpage.asp");
		nbTable.setPaginator("", recs, 10);
		nbTable.setPaginatorPosition(0);
		nbTable.setTableStyle(2);
	
		nbTable.setProperty('RowHeader', '');
		nbTable.setProperty('RowFooter', '');
		nbTable.setProperty('Cell1Header', '<h1>');
		nbTable.setProperty('Cell1Footer', '</h1>');
		nbTable.setProperty('Cell2Header', '<h2><a href="index.asp?P=114&CH=' + chSel + '&AR=@@ID@@" title="');
		nbTable.setProperty('Cell2Footer', '">');
		nbTable.setProperty('Cell3Header', '');
		nbTable.setProperty('Cell3Footer', '</a></h2>');

		nbTable.AjaxCall("EleNews", "&chsel=" + chSel + "&front_line=0" + "&fromDIV=" + divName,
			function() {
				if (this.readyState == 4) {
				
					// Recupera il DIV name di questa risposta
					var strRes=this.responseText;
					strRes=strRes.replace('<complete>','');
					strRes=strRes.replace('<script>','');
					strRes=strRes.replace('<\/script>','');
					strRes=strRes.replace('<\/complete>','');
				    jsonData = YAHOO.lang.JSON.parse(strRes);
				    reqDivName = jsonData.fromDIV;
				    
				    // Usa il DIV name per trovare la corrispondente classe
					for (i=0; i<tbls.propertieslist.length; i++) {
						tbl = tbls.propertieslist[i].value;
						if (tbl.getDIV() == reqDivName) {
							tbl.setJSON(tbl.getResponseArray());
							tbl.displayTable();
							if (tbl.jsonData.debug_text != "") alert(tbl.jsonData.debug_text);
							break;
						}
					}

				}
			}
		);
	}

