function showSoluzione(soluzione) {
	if (document.all)
		{
			document.all.soluzione.innerHTML = "<B><U>Soluzione</U></B><BR><BR>" + soluzione ;
			if (document.all.aiuto)
				{
				document.all.aiuto.innerHTML = '';
				document.all.aiuto.style.display = 'none';
				document.all.soluzione.style.display = 'block';
				}
		}
	else
		{ 
//			alert ("Soluzione:\n" + soluzione.replace(/<[^>]*>/gi,''));

		newWin = window.open("", "tinyWindow", 'resizable,width=450,height=200') 
		newWin.document.writeln('<html><head><title>Soluzione</title><link rel=stylesheet href=/include/styles.css>');
		newWin.document.writeln('<style type=text/css>');
		newWin.document.writeln('.solcalcolo { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;}');
		newWin.document.writeln('.testosoluzione { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;}');
		newWin.document.writeln('</style></head><body><b>');
		newWin.document.writeln(soluzione);
		newWin.document.write('</b></body>');
		newWin.document.close();
		}
	}
	
function showAiuto(aiuto) {
	if (document.all)
		{
			document.all.aiuto.innerHTML = "<B><U>Aiuto</U></B><BR><BR>" + aiuto ;
			if (document.all.soluzione)
				{
				document.all.soluzione.innerHTML = '';				
				document.all.soluzione.style.display = 'none';
				document.all.aiuto.style.display = 'block';				
				}
			
		}
	else
		{ 
		newWin = window.open("", "tinyWindow", 'resizable,width=450,height=200');
		newWin.document.writeln('<html><head><title>Aiuto</title><link rel=stylesheet href=/include/styles.css>');
		newWin.document.writeln('<style type=text/css>');
		newWin.document.writeln('.solcalcolo { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;}');
		newWin.document.writeln('.testoaiuto { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;}');
		newWin.document.writeln('</style></head><body><b>');
		newWin.document.writeln(aiuto);
		newWin.document.write('</b></body>');
		newWin.document.close();
		}
	}

function popupWin(html,text)
	{
	if(html==1)
		{
		newWin = window.open(text, "popup", "resizable,width=450,height=250,scrollbars=auto");
		}
		else
		{
		newWin = window.open("", "popup", "resizable,width=450,height=250,scrollbars=auto");
		newWin.document.writeln(text);
		newWin.document.close();
		}
	}

function getContent(tipodigioco, object_id, manuale, sezione, staticpage, staticbar, extra)
	{
//	document.nextWin.tipodigioco.value=tipodigioco;
	targetForm=document.nextWin;
	targetForm.id.value=object_id;
	targetForm.man.value=manuale;
	if(sezione)
			{ 
			targetForm.sezione.value=sezione;
			}
			else
			{
			targetForm.sezione.value='';
			}
	if(staticbar)
			{
			targetForm.static_bar.value=staticbar;
			}
			else
			{
			targetForm.static_bar.value='';
			}
	if(staticpage)
			{
			targetForm.static_page.value=staticpage;
			}
			else
			{
			targetForm.static_page.value='';
			}
	if(extra)
			{
			targetForm.extra.value=extra;
			}
			else
			{
			targetForm.extra.value='';
			}
//alert('Id:'+object_id+'\nManuale:'+manuale+'\nSezione:'+sezione+'\nStatics:'+staticpage+' '+staticbar+'\nExtra:'+extra);
	if(targetForm.submit())
		{
		return true;
		}
		else
		{
		return false;
		}
	}

function storeData(obj)
	{
	var output='';
	for(i=0;i<obj.length;i++)
		{
		output+='&'+obj[i].name+'='+obj[i].value;
		}
	return output.substr(1);
	}

function swapClass(obj, base_class, swap_class)
	{
	if(obj.className==base_class)
		{
		obj.className=swap_class;
		}
		else
		{
		obj.className=base_class;
		}
	}

function swapBG(obj, base_color, swap_color, base_fg, swap_fg)
	{
	if(obj.style.backgroundColor==base_color)
		{
		obj.style.backgroundColor=swap_color;
		}
		else
		{
		obj.style.backgroundColor=base_color;
		}
	if(base_fg)
		{
		if(obj.style.color==base_fg)
			{
			obj.style.color=swap_fg;
			}
			else
			{
			obj.style.color=base_fg;
			}
		}
	}


var risposta_generata = false;
function getRispostaGenerata()
	{
	if(document.applets['xword_applet'])
		{
		risposta_generata = getResult();
		}
	if(risposta_generata) {
		return escape(risposta_generata);
	} else {
		return '';
	}
	
//	return risposta_generata;
	}