// Funzioni per il Menu Principale

function fOpenHomePage()
{	fOpenWindow('index.php','_self');
}

function fOpenChiSiamo()
{	fOpenWindow('index.php?id_sezione=1','_self');
}

function fOpenStruttura()
{	fOpenWindow('index.php?id_sezione=2','_self');
}

function fOpenFinanziamo()
{	fOpenWindow('index.php?id_sezione=3','_self');
}

function fOpenDona()
{	fOpenWindow('index.php?id_sezione=4','_self');
}

function fOpenRiceviamo()
{	fOpenWindow('index.php?id_sezione=5','_self');
}

function fOpenRaccolta()
{	fOpenWindow('index.php?id_sezione=6','_self');
}

function fOpenRete()
{	fOpenWindow('index.php?id_sezione=7','_self');
}

function fOpenBilancio()
{	fOpenWindow('index.php?id_sezione=8','_self');
}

function fOpenEnti()
{	fOpenWindow('index.php?id_sezione=9','_self');
}

function fOpenAppuntamenti()
{	fOpenWindow('index.php?id_sezione=10','_self');
}

function fOpenFoglietto()
{	fOpenWindow('index.php?id_sezione=11','_self');
}

function fOpenCambiaPwd()
{	fOpenWindow('index.php?id_sezione=12','_self');
}

function fOpenArApp()
{	fOpenWindow('index.php?id_sezione=13','_self');
}

function fOpenArBolle()
{	fOpenWindow('index.php?id_sezione=14','_self');
}

function fOpenGuida()
{	fOpenWindow('index.php?id_sezione=15','_self');
}

// Funzioni interno de raccolta

function fOpenRaccoltaCosa()
{	fOpenWindow('index.php?id_sezione=6&id_sub_sez=1','_self');
}

function fOpenRaccoltaSupe()
{	fOpenWindow('index.php?id_sezione=6&id_sub_sez=2','_self');
}

function fOpenRaccoltaRisu()
{	fOpenWindow('index.php?id_sezione=6&id_sub_sez=3','_self');
}

function fOpenRaccoltaGraf()
{	fOpenWindow('index.php?id_sezione=6&id_sub_sez=4','_self');
}

function fOpenRaccoltaHist()
{	fOpenWindow('index.php?id_sezione=6&id_sub_sez=5','_self');
}

// Funzioni per il Footer

function fOpenCondizioni()
{	fOpenWindow('condizioni.php','_self');
}

function fOpenPrivacy()
{	fOpenWindow('privacy.php','_self');
}

function fOpenKey4()
{	fOpenWindow('http://www.key4.it','new');
}


// Funzioni Generali

function isNumeric(sText)
{	var ValidChars = "0123456789."; 
	var IsNumber=true; 
	var Char; 
	for (i = 0; i < sText.length && IsNumber == true; i++)
	{	Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1)
		{	IsNumber = false; 
		}
	} 
	return IsNumber; 
} 

function isEmail(string)
{	if (string.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) != -1)
	{	return 1;
	}
	else
	{	return 0;
	}
}

function fPressKey(e,sNomeFrame)
{	if(window.event) // IE
	{	keystr = e.keyCode;
	}
	else if(e.which) // Netscape/Firefox/Opera
	{	keystr = e.which;
	}
	if (keystr==13)
	{	document.frames[sNomeFrame].submit();
	}
}

function setStatus(msg)
{	if(msg == undefined)
	{	window.status = "";
	} 
	else 
	{	window.status = msg;
	}
}

function fPreferity()
{	window.external.AddFavorite('http://www.isatismedica.it','ISATIS Medica');
}

function fOpenWindow(sTxDirUrl,sTarget)
{	window.open(sTxDirUrl,sTarget);
}

function fOpenIframe(sNomeFrame,sTxDirUrl)
{	//document.frames[sNomeFrame].location.replace(sTxDirUrl);
	setTimeout("document.frames['" + sNomeFrame + "'].location.replace('" + sTxDirUrl + "');",500);
}

function fOpenWindowDialog(sTxDirUrl,nWidth,nHeight)
{	newwin = window.open(sTxDirUrl,"","width=" + nWidth + ",height=" + nHeight + ",resizable=no,scrollbars=no")
	return newwin;
}

function fOpenShowModal(sTxDirUrl,nWidth,nHeight)
{	window.showModalDialog(sTxDirUrl,'','dialogWidth:' + nWidth + 'px;dialogHeight:'+ nHeight + 'px');
}

function fCancel()
{	window.close();
}

function fBack()
{	history.go(-1);
}

function fOpenHomePage()
{	fOpenWindow('index.php','_parent');
}

function fInCostruzione()
{	alert('In Costruzione!!!');
}
