// Funzioni per il Menu Principale Italiano

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

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

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

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

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

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

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

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

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

function fOpenReteVendReg(r)
{	fOpenWindow('index.php?id_sezione=10&r='+r,'_self');
}

function fPagPubblicazione(pag)
{	fOpenWindow('index.php?id_sezione=14&paginaAttuale='+pag,'_self');
}

function fOpenPubblicazione(r)
{	var sTxDirUrl="offerta.php?id_offerta=" + r
	fOpenWindowDialog(sTxDirUrl,600,500)
}

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

function fOpenError(r)
{	var sTxDirUrl="index.php?id_sezione=99&id_error=" + r
	fOpenWindowDialog(sTxDirUrl,600,500)
}

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

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

// Funzioni per il Menu Principale Inglese

function fOpenHomePageEng()
{	fOpenWindow('index_eng.php','_self');
}

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

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

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

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

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

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

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

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

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

function fOpenReteVendRegEng(r)
{	fOpenWindow('index_eng.php?id_sezione=10&r='+r,'_self');
}

function fOpenPubblicazioneEng(r)
{	var sTxDirUrl="offerta_eng.php?id_offerta=" + r
	fOpenWindowDialog(sTxDirUrl,600,500)
}

function fPagPubblicazioneEng(pag)
{	fOpenWindow('index_eng.php?id_sezione=14&paginaAttuale='+pag,'_self');
}

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

function fOpenErrorEng(r)
{	var sTxDirUrl="index_eng.php?id_sezione=99&id_error=" + r
	fOpenWindowDialog(sTxDirUrl,600,500)
}

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

function fOpenAreaRiservata()
{	fOpenWindow('http://b2b.cdmitalia.it/B2B/modbas/login.aspx','_self');
}

function fOpenAreaRiservataEng()
{	fOpenWindow('http://b2b.cdmitalia.it/B2B/modbas/login.aspx','_self');
}

// Funzioni per il Footer

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

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

function fOpenPrivacyEng()
{	fOpenWindow('index_eng.php?id_sezione=12','_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=yes")
	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!!!');
}

