//Script per il lampeggio del testo
//*************************************************************************************************************
var Indice=0;
var IndiceGlobale=0;
var IndiceGlobale1=0;

TestoLampeggiante=new Array();
function LampON()
{

	var i;
	for (i=0;i<Indice;i++)
	{
		eval("document.getElementById('Testo"+i+"').innerHTML='<font size=2 face=Tahoma style=font-size: 14pt; color=#ff0000><b>"+TestoLampeggiante[i]+"</b></font>';");
	}
	
	window.setTimeout("LampOFF()",700);
}

function LampOFF()

{

	var i;
	for (i=0;i<Indice;i++)
	{
		eval("document.getElementById('Testo"+i+"').innerHTML='';");
	}
	window.setTimeout("LampON()",500);
}

function Scrivi(TestoLampeggianteTemp){
	scritta="<span style='margin-top: 0; margin-bottom: 0' id='Testo"+Indice+"'></span>";
	document.write(scritta);
	TestoLampeggiante[Indice]=TestoLampeggianteTemp;
	Indice++;	
	LampON();
}
//**************************************************** fine lampeggio testo **************************************

function ApriFinestra(Testo){
	var i;
	finestra= window.open('News.htm','News')
	if (window.screen) {
		for (i=0;i<Testo.length;i++){
		Testo=Testo.replace("//()/","'");
		Testo=Testo.replace("/!()/","&rsquo;");
		}
		finestra.window.moveTo(0,0);
		finestra.window.resizeTo(640,480);
		finestra.focus();
	}
	finestra.document.write('<html><title>'+"News"+'</title><body>' + Testo +' </body></html>')
	finestra.document.close()
}



//Funzione che controlla se è stato premuto il tasto Enter, ed in caso affermativo, avvia la ricerca della parola inserita
function ControllaTasto(Tasto){ 
	var Codice;
	
	if (window.event)
	   Codice=(window.event.keyCode);
	else if (Tasto)
	   Codice=(Tasto.which);
	else
	   Codice=("null");
	
	if (Codice==13){
		Ricerca();
	}
}


//Ritorna la lingua della pagina attuale
function Lingua()
{


	var LunghezzaStringa=window.location.pathname.length;
	if (LunghezzaStringa>1)
	{
		/*
		var PosizioneCarattere=window.location.href.indexOf("?");
		if (PosizioneCarattere!=-1)
		{
			return window.location.href.substring(PosizioneCarattere-6,PosizioneCarattere-4);
		}
		else
		{
			PosizioneCarattere=window.location.href.indexOf("#");
			if (PosizioneCarattere!=-1)
			{
				return window.location.href.substring(LunghezzaStringa-7,LunghezzaStringa-5);
			}
			else
			{
				return window.location.href.substring(LunghezzaStringa-6,LunghezzaStringa-4);
			}
		}*/

		return window.location.pathname.substring(LunghezzaStringa-6,LunghezzaStringa-4);
	}
	else
	{
		return "IT";
	}
}



function Ricerca(){
	var ValoreH;
	var ValoreW;
	var Colori;
	var Browser;
	var ValoreRicerca;
	var TestoRicerca;
	var TestoAttesa;
	var RU;
	TestoRicerca="<br><br><br>Searching ...<br>";
	TestoAttesa="<br>Please wait&nbsp;&nbsp;";
	
	
	if (document.getElementById("Keyword").value==""){
		alert("Inserire un testo da cercare");
	}
	else
	{
		ValoreRicerca=document.getElementById("Keyword").value;
		ValoreH=window.screen.height;
		ValoreW=window.screen.width;
		Colori=window.screen.colorDepth;
		BrowserNome=navigator.appName;
		BrowserVersione=navigator.appVersion;
		Browser=BrowserVersione.split(" ");
		BrowserVersione=Browser[0];
		if (navigator.userAgent.indexOf('IRIX') != -1) {var SO = "Irix" } 
		else if ((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('98') != -1)) {var SO= "Windows 98"} 
		else if ((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('95') != -1)) {var SO= "Windows 95"} 
		else if (navigator.appVersion.indexOf("16") !=-1) {var SO= "Windows 3.1"} 
		else if (navigator.userAgent.indexOf("NT 5.1") !=-1) {var SO= "Windows XP"} 
		else if (navigator.appVersion.indexOf("NT") !=-1) {var SO= "Windows NT"} 
		else if (navigator.appVersion.indexOf("SunOS") !=-1) {var SO= "SunOS"} 
		else if (navigator.appVersion.indexOf("Linux") !=-1) {var SO= "Linux"} 
		else if (navigator.userAgent.indexOf('Mac') != -1) {var SO= "Macintosh"} 
		else if (navigator.appName=="WebTV Internet Terminal") {var SO="WebTV"} 
		else if (navigator.appVersion.indexOf("HP") !=-1) {var SO="HP-UX"} 
		else {var SO= "Indefinito"} 
		//document.all.Nascosto.src="/ScriviLogRicerca.asp?RICERCA="+ValoreRicerca+"&BROWSERNOME="+BrowserNome+"&BROWSERVERSIONE="+BrowserVersione+"&SO="+SO+"&RISOLUZIONE="+ValoreW+"x"+ValoreH+"&COLORI="+Colori;
		//window.open("/cgi-bin/htsearchIT?config=htdig&restrict=&exclude=&method=and&format=builtin-long&sort=score&words="+document.getElementById("Keyword").value);
		StopLamp();
		StopLampeggia();
		document.getElementById("Pagina").innerHTML="<div align='center'><b><font style='font-size: 40pt' face='Arial' color='#FF0000'>"+TestoRicerca+"</font><font style='font-size: 40pt' face='Arial' color='#8A8A8A'>"+TestoAttesa+"</font></b></div>";
	    
	    if (Lingua()=="RU")
	    {
	        location.href="/RicercaTemp_"+Lingua()+".asp?keyword="+escape(ValoreRicerca);
	    }
	    else location.href="/Ricerca_"+Lingua()+".asp?keyword="+ValoreRicerca;
	 }
	    
	    
		
   }


function Lampeggia(){
	
	if (IndiceGlobale1==0)
	{
		if (document.getElementById("FunzioneLampeggio1").style.display!="none")
		{
			document.getElementById("FunzioneLampeggio1").style.display="none";
			document.getElementById("FunzioneLampeggio2").style.display="none";
	
		}
		else
		{
			document.getElementById("FunzioneLampeggio1").style.display="block";
			document.getElementById("FunzioneLampeggio2").style.display="block";
	
		}
		
		 setTimeout('Lampeggia()', 500);
	}
}

function StopLampeggia()
{
	IndiceGlobale1=1;
}
function AttivaMenuCertificazioni()
{
	document.getElementById("MenuQualita").style.display="block";


}

function DisattivaMenuCertificazioni()
{
	document.getElementById("MenuQualita").style.display="none";

}


function CambiaImmagine() {
    if (document.getElementById("RicercaRivenditoriLamp").style.backgroundImage == "url(/Immagini/ImmaginiNuovaHome/RicercaRivenditoriChiara1.jpg)") document.getElementById("RicercaRivenditoriLamp").style.backgroundImage = "url(/Immagini/ImmaginiNuovaHome/RicercaRivenditori_new.jpg)";
    else document.getElementById("RicercaRivenditoriLamp").style.backgroundImage = "url(/Immagini/ImmaginiNuovaHome/RicercaRivenditoriChiara1.jpg)";
}
function StopLamp() {
    IndiceGlobale = 1;
 }
 function StartLamp() {
     IndiceGlobale = 0;
 }
function LampeggiaRicerca() {
    if (IndiceGlobale == 0) {
        CambiaImmagine();
	}
	setTimeout('LampeggiaRicerca()', 1000);
}

document.getElementById("Certificazioni").onmouseover=function() {AttivaMenuCertificazioni();}
document.getElementById("Certificazioni").onmouseout=function() {DisattivaMenuCertificazioni();}
document.getElementById("MenuQualita").onmouseover=function() {AttivaMenuCertificazioni();}
document.getElementById("MenuQualita").onmouseout=function() {DisattivaMenuCertificazioni();}
document.getElementById("MenuQualita").style.display="none";


//document.getElementById('Prova').style.filter = 'alpha(opacity = 30)';

lista=new Array("<img src='/AllegatiQualita/QualitaIT.jpg'>","<img src= '/AllegatiQualita/QualitaEN.jpg'>")
function apri(conta) {
	finestra= window.open('Qualita.htm','Qualita')
	if (window.screen) {
		finestra.window.moveTo(0,0);
		finestra.window.resizeTo(screen.availWidth,screen.availHeight);
		finestra.focus();
	}
	finestra.document.write('<html><title>'+"Certificazioni Sistema Qualità"+'</title><body>' + lista[conta] +' </body></html>')
	finestra.document.close()
}


//***************DISABILITA IL TASTO DESTRO DEL MOUSE***************************
	var messaggio="www.viro.it, images protect from copyright";
	function clickIE(){
	if (event.button==2){
	alert(messaggio);
	return false;
	}
	}
	
	function clickNS(e){
	if (document.layers||document.getElementById&&!document.all){
	if (e.which==2||e.which==3){
	alert(messaggio);
	return false;
	}
	}
	}
	
	if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS;
	}
	else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE;
	}
	
	document.oncontextmenu=new Function("alert(messaggio);return false")
	//**********************************************************************************
	
	
document.write("<script type='text/javascript' src='ScriviLog.js'></script>")

