/*
	Ciro Bernini aka CiBer
	c.bernini <at> analisiemercati.it
	3/2007
*/
if (kLang == 1){
	var aMsgShowp=['CiBer','Quali','I Prossimi','I Passati','Anno','Tipologia','Tutti','Pubblici','In House','Titolo','Aree Tematiche di interesse','Qualunque','','data','Effettua Ricerca','Descrizione del seminario non ancora disponibile...','','','','',''];
}else{
	var aMsgShowp=['CiBer','Search for','Upcoming','Past','Year','Topic','Anyone','ita','ita','Title','Topic','Anyone','','Date','Search','Seminar Description not yet available...','','','','',''];
}
var t='<form action="incroot.cfm?kLang='+kLang+'&ns=1&tmp=eve_rullop&tipo='+kTipo+'" id="profiltro" name="profiltro" target="appo" method="post">'
	+'<fieldset><legend>'+aMsgShowp[1]+'</legend><select name="tiporic" onchange="veriAnni(this.value)">'
	+'<option value=1>'+aMsgShowp[2]+'<option value=2>'+aMsgShowp[3]
+'</select></fieldset>';
t+='<input type="Hidden" name="nvoci" value=50>';
/*
t+='<fieldset><legend>Numero Max occorrenze</legend>', k, x, i, aNvoci=[25,50,100,9999], nn=aNvoci.length;
for (i=0;i <nn;i++){
	t+='<input type="Radio" name="nvoci" value="'+aNvoci[i]+'" id="nvoci_'+aNvoci[i]+'"><label for="nvoci_'+aNvoci[i]+'">'+aNvoci[i]+'</label>';
}
t+='</fieldset>';<option value="0">Qualunque
*/
t+='<fieldset><legend>'+aMsgShowp[4]+'</legend><select name="annoEve">';
nn=aEleAnni.length;
for (i=1;i<nn;i++){t+='<option value="'+aEleAnni[i]+'">'+aEleAnni[i];}
t+='</select></fieldset>';
if (kTipo==1){
	if (subTipoCrs!=-1){
		t+='<input type="Hidden" name="tipocrs" value="'+subTipoCrs+'">';
	}else{
		t+='<fieldset><legend>'+aMsgShowp[5]+'</legend><select name="tipocrs">'
			+'<option value=2>'+aMsgShowp[6]+'<option value=0>'+aMsgShowp[7]+'<option value=1>'+aMsgShowp[8]
		+'</select></fieldset>';
	}
}
t+='<fieldset><legend>'+aMsgShowp[9]+'</legend><input type="Text" name="nome" size=15></fieldset>'
+'<fieldset><legend>'+aMsgShowp[10]+'</legend><select name="aree" style="width:218px;"><option value="">'+aMsgShowp[11];
nn=aTmpAree.length;
for (i=1;i<nn;i++){
	x=aTmpAree[i].split("|"); t+='<option value="'+x[0]+'">'+x[1];
}
t+='</select></fieldset>'
+'<fieldset title="'+aMsgShowp[12]+'"><legend>&nbsp;</legend>'
	+'<a href="Javascript:veriDtFFiltro()"><img src="img/cerca.gif" alt="" border=0 hspace=4></a>'
t+='</fieldset></form>';

document.getElementById('proFiltro').innerHTML=t; t='';
// document.getElementById('nvoci_25').checked=true;

var i, t='', nn=aTmpSedi.length, x, aSedi=new Array();
for(i=1;i<nn;i++){x=aTmpSedi[i].split("|");aSedi[x[0]]=[x[1],x[2],x[3]];}

setTimeout("document.forms['profiltro'].submit()",850);

var aTpEve=(kLang==1)?['CiBer','Corsi','Seminari']:['CiBer','Corsi','Seminars'];

function veriAnni(k){if(k==1){document.profiltro.annoEve.options[0].selected=true;}}

function veriDtFFiltro(){
	var dpf=document.profiltro;
	if(dpf.tiporic.value==1){dpf.annoEve.options[0].selected=true;}
	dpf.submit();
}



function drawRullo(aCrs){
	var nn=aCrs.length, y, z, m, k, n, dpl, perEve, t='<table cellpadding=1 cellspacing=1>', curYr=0, curMm=-1;
	if (kTipo==1){
		var percoDep='docs/deplCorsi/';
		for(i=1;i<nn;i++){
			x=aCrs[i];//.split("|")
			aDt=x[3].split("/");
			if(aDt[2]!=curYr){
				//t+='<tr><th colspan=3><h3><i>Calendario '+aTpEve[kTipo]+' '+aDt[2]+'</i></h3></th></tr>';
				curYr=aDt[2];
			}
			if(aDt[1]!=curMm){
				t+='<tr><th colspan=3 align="left"><br><h4>'+aMesi[aDt[1]]+' '+aDt[2]+'</h4></th></tr>'
				+'<tr><td><b><i>Titolo</i></b></td><td><b><i>Data</i></b></td><td> </td></tr>';
				curMm=aDt[1];
			}
			y=x[4].split("/");
			if (aDt[0]==y[0]){
				perEve=aDt[0];
			}else{
				perEve=(y[1]!=curMm)?aDt[0]+ ' ' + aMesi[aDt[1]].substr(0,3) + '-' + y[0] + ' ' + aMesi[y[1]].substr(0,3): aDt[0]+ '-' +y[0];
			}
			dpl=(x[2]!='')?'<a href="'+percoDep+x[2]+'" target="_blank"><img src="img/FileManager/fileIco/pdf.gif" alt="visualizza Depliant" border=0 width=24></a>':'&nbsp;';
			t+='<tr valign="top"><td><a href="?kLang='+kLang+'&cis='+kC1+';1;1&rec='+x[0]+'" title="Visualizza '+x[1]+'">'+x[1]+'</a></td><td align="center" nowrap>'+perEve+'</td><td>'+dpl+'</td></tr>';
		}
	}else{
		var percoDep=(kLang==1)?'docs/deplIta/':'docs/deplEng/', kLnkSpk=(kLang==1)?3:9;
		for(i=1;i<nn;i++){
			x=aCrs[i];//.split("|")
			aDt=x[3].split("/");
			if(aDt[2]!=curYr){
				//t+='<tr><th colspan=4><h3><i>'+aTpEve[kTipo]+' '+aDt[2]+'</i></h3></th></tr>';
				curYr=aDt[2];
			}
			if(aDt[1]!=curMm){
				t+='<tr><th colspan=5 align="left"><br><h4>'+aMesi[aDt[1]]+' '+aDt[2]+'</h4></th></tr>'
				+'<tr><td><b><i>Speaker</i></b></td><td></td><td><b><i>'+aMsgShowp[9]+'</i></b></td><td align="center"><b><i>'+aMsgShowp[13]+'</i></b></td><td>&nbsp;</td></tr>';
				curMm=aDt[1];
			}
			y=x[4].split("/");
			if (aDt[0]==y[0]){
				perEve=aDt[0];
			}else{
				perEve=(y[1]!=curMm)?aDt[0]+ ' ' + aMesi[aDt[1]].substr(0,3) + '-' + y[0] + ' ' + aMesi[y[1]].substr(0,3): aDt[0]+ '-' +y[0];
			}
			dpl=(x[2]!='')?'<a href="'+percoDep+x[2]+'" target="_blank"><img src="img/pdf.gif" alt="visualizza Depliant" border=0></a>':'&nbsp;';
			t+='<tr valign="top"><td>';
			aDocs=x[5];//.split("§")
			n=aDocs.length;
			for (z=1;z<n;z++){
				k=aDocs[z];//.split("{")
				if(k[0]==-1){
					t+=k[1]+'<br>';
				}else{
					t+='<a href="?kLang='+kLang+'&cis='+kLnkSpk+'&rec='+k[0]+'">'+k[1]+'</a><br>';
				}
			}
			t+='</td><td>&nbsp;</td><td>';
			if (x[6]==0){
				t+='<a href="?kLang='+kLang+'&cis='+kC1+';1;1&rec='+x[0]+'" title="Visualizza '+x[1]+'">'+x[1]+'</a>';
			}else{
				t+=x[1]+'<img src="img/inlav.gif" align="absbottom" title="'+aMsgShowp[15]+'" hspace=6>';
			}
			t+='</td><td align="center" nowrap>'+perEve+'</td><td>'+dpl+'</td></tr>';
		}
	}
	document.getElementById('proRullo').innerHTML=t+'</table>';
}
