function EGCumulusAnywhere(EGCAparams)
{
	//EGCA versione 0.1
	//EGCA version 0.1	

	//conf EGW Cumulus
	//baseDestURL = "";
	cloudSwfURL = "tagcloud.swf";
	cloudWidth = 340;
	cloudHeight = 300;
	cloudSpeed = 80;

	colTxt01 = "421C07";
	colTxt02 = "B15E23";
	colHover = "1B8ECD";
	colBack = "";
	
	IdDivTagsDefault = "CumAnywhere=0";

	//elements must be this format "element name|element size|element link"
	//gli elementi devono rispettare questo formato "nome elemento|dimensione elemento|link elemento"
	arrTags = new Array()
	arrTags[0] = "Jacuzzi SpA|19|/www.jacuzzi.eu/eu/it-IT"
	arrTags[1] = "Far SpA|15|/www.farframe.com"
	arrTags[2] = "Baumit SpA|15|/www.baumit.it"
	arrTags[3] = "Galgano Group|18|/www.galganogroup.it"
	arrTags[4] = "Santagostino Friuli|14|/www.s-f.it"
	arrTags[5] = "EuroConsulting|13|/www.ecgroup.it"
	arrTags[6] = "FriuliShop|10|/www.friulishop.com"
	arrTags[7] = "Studio Comunica|16|/www.comunicaformazione.it"
	arrTags[8] = "Mappamondo Lingue|8|/www.mappamondolingue.com"
	arrTags[9] = "ENAIP FVG|12|/www.enaip.fvg.it"
	arrTags[10] = "IAL FVG|14|/www.ialweb.it"
	arrTags[11] = "ARSAP|7|/www.arsap.com"
	arrTags[12] = "ESMEPS|15|/www.formedil.it/formedil_new/index.php?p=scuole&regione=6&scuola_id=28"
	arrTags[13] = "Forcoop C.o.r.a. Venezia|12|/www.hotfrog.it/Societa/Forcoop-C-o-r-a-Venezia"
	arrTags[14] = "Zlogic Computer|14|/www.zlogic.it"
	arrTags[15] = "Comune di Orsago|10|/www.comune.orsago.tv.it"
	arrTags[16] = "Comune di Casarsa|12|/www.comune.casarsadelladelizia.pn.it"
	arrTags[17] = "Ortotecnica Service|14|/www.ortotecnicaservice.com"
	arrTags[18] = "Fattoria del vino|12|/www.fattoriadelvino.com"
	arrTags[19] = "Maella pusiol vini|11|/www.maellapusiolvini.com"
	arrTags[20] = "Astra Arte|8|/www.astra-arte.com"
	arrTags[21] = "Cantine Buoso|12|/www.cantinebuoso.it"
	arrTags[22] = "BuosoWine Srl|14|/www.buosowine.com"
	arrTags[23] = "Officine Duende|10|/www.officineduende.it"
	arrTags[24] = "Ass. ONLUS Rufino Turranio|7|/www.rufinoturranio.it"
	arrTags[25] = "STUDIO AesseWeb Design|9|/www.aessewebdesign.com"
	arrTags[26] = "Setten Genesio SpA|15|/www.settengenesio.it"

	hSize = new Array(6)
	hSize[0] = 20; //h1 size
	hSize[1] = 18; //h2 size
	hSize[2] = 16; //h3 size
	hSize[3] = 14; //h4 size
	hSize[4] = 12; //h5 size
	hSize[5] = 10; //h6 size
	hSize[6] = 8; //h7 size

	//fine conf EGW cumulus



	document.write("<object type=\"application/x-shockwave-flash\" data=\""+cloudSwfURL+"\" width=\""+cloudWidth+"\" height=\""+cloudHeight+"\">");


	document.write("<param name=\"movie\" value=\""+cloudSwfURL+"\" >");
	document.write("<param name=\"bgcolor\" value=\"#"+colBack+"\" >");
	document.write("<param name=\"AllowScriptAccess\" value=\"always\" >");
	document.write("<param name=\"wmode\" value=\"transparent\" >");



	document.write("<param name=\"flashvars\" "); 
	document.write("value=\"tcolor=0x"+colTxt01+"&amp;tcolor2=0x"+colTxt02+"&amp;hicolor=0x"+colHover+"&amp;tspeed="+cloudSpeed+"&amp;mode=tags&amp;distr=true&amp;tagcloud=");
	document.write("%3Ctags%3E");

	//display tags from Array
	if (arrTags.length > 0)
	{
		for (i=0;i<arrTags.length;i++)
		{
			tagData = arrTags[i].split("|");
			document.write("%3Ca+href%3D%27%2F"+escape(tagData[2])+"%2F%27+style%3D%27font-size%3A+"+escape(tagData[1])+"pt%3B%27%3E"+escape(tagData[0])+"%3C%2Fa%3E%0A");
		}
	}
	
	//check if script has params. If not try to handle default DIV element
	//controlla se lo script ha parametri. In caso contrario prova a usare l'elemento di default
	if (EGCAparams == undefined)
	{
		IdDivTags = IdDivTagsDefault;
	}
	else
	{
		IdDivTags = EGCAparams;
	}
	//display tags from Div element
	//mostra tag recuperati dall'elemento DIV
	divToHandle = IdDivTags.split(",");
	for (cDiv = 0;cDiv < divToHandle.length;cDiv++)
	{
		divSetup = divToHandle[cDiv].split("=");
		if (document.getElementById(divSetup[0]) != null)
		{
			
			//tags to remove from cumulus param (CSV)
			//tag da rimuovere dai parametri di cumulus (CSV)
			codeToClean = "<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<h7>,</h1>,</h2>,</h3>,</h4>,</h5>,</h6>,</h7>,<ul>,</ul>,<li>,</li>,<ol>,</ol>";
			
			//hide element if set to 0
			//nasconde l'elemento se il parametro è 0
			if (divSetup[1] == "0")
			{
				document.getElementById(divSetup[0]).style.display = "none";
			}
			
			EGCADivContent = document.getElementById(divSetup[0]).innerHTML;
			elDIV = EGCADivContent.split("\n");
			encodedTags = ""; 
			for (i=0;i<elDIV.length;i++)
			{
				
				//check il current line has Hx or li and a
				//controlla se la linea corrente ha Hx o li e a
				if ((elDIV[i].indexOf("<h") > -1 || elDIV[i].indexOf("<li") > -1) && elDIV[i].indexOf("<a") > -1)
				{			
				
					elDIV[i] = elDIV[i].split("<a ").join("<a style='font-size:+"+hSize[6]+"pt' ");
				
				
					//assign right size to Hx tags
					//assegna la dimensione giusta ai tag Hx
					for (t=1;t<7;t++)
					{
						if (elDIV[i].indexOf("<h"+t+">") > -1)
						{
							elDIV[i] = elDIV[i].split("+"+hSize[6]+"pt").join("+"+hSize[t-1]+"pt");
						}
						
						if (elDIV[i].indexOf("size=\""+t) > -1)
						{
							elDIV[i] = elDIV[i].split("+0.0pt").join("+"+hSize[t-1]+"pt");
						}
					}
				
				
					encodedTags = encodedTags + elDIV[i];
				
				}	
			}
		
			
			//remove unneeded code
			//elimina codice indesiderato
			elCodeToClean = codeToClean.split(",");
			for (i=0;i<elCodeToClean.length;i++)
			{
				encodedTags = encodedTags.split(elCodeToClean[i]).join("");
			}
			
			document.write(escape(encodedTags));
		}	

	}



	document.write("%3C%2Ftags%3E\"");
	document.write("></object>");
	
}

function startEGCA(sUpOption)
{
	document.onload = EGCumulusAnywhere(sUpOption);
}

