/* incFzClient.js */

/* Funzione di cambio colore scritte nella HomePage al passaggio del mouse */
function Fz_ChangeColor(objthis)
{
	if(objthis.style.color == "yellow")
	{
		objthis.style.color = "Navy"
	}
	else
	{
		objthis.style.color = "yellow"
	}
}

/* Funzione di cambio colore sfondi nei Menù al passaggio del mouse */
function Fz_ChangeBGColor_Over(objthis)
{
	if(objthis.style.backgroundColor == "aqua")
	{
		objthis.style.backgroundColor = "#bdc6ff"
	}
}

/* Funzione di cambio colore sfondi nei Menù al passaggio del mouse */
function Fz_ChangeBGColor_Out(objthis)
{
	if(objthis.style.Selezionato == "false")
	{
		objthis.style.backgroundColor = "aqua"
	}
}

/* Funzion unica di cambio colore sfondi nei Menù al passaggio del mouse */
function Fz_ChangeBGColor(objthis)
{
	if(objthis.style.backgroundColor == "aqua")
	{
		objthis.style.backgroundColor = "#bdc6ff"
	}
	else
	{
	   objthis.style.backgroundColor = "aqua"
	}
}

function Fz_OpenDetail(sFile, sCodice){
	window.showModalDialog('Prodotti/Pr_Dettaglio.aspx?File=' + sFile + '&Codice=' + sCodice, 'Dettaglio', 'dialogWidth=600px;dialogHeight=300px;center=yes;status=no')
	//window.open('Prodotti/Pr_Dettaglio.aspx?File=' + sFile + '&Codice=' + sCodice, 'Dettaglio', 'Width=600px,Height=270px;')
}

function Fz_OpenConfig(sFile, sCodice){
	window.showModalDialog('Listini/Listini_Configura.aspx?File=' + sFile + '&Codice=' + sCodice, 'Dettaglio', 'dialogWidth=600px;dialogHeight=300px;center=yes;status=no')
	//window.open('Listini/Listini_Configura.aspx?File=' + sFile + '&Codice=' + sCodice, 'Dettaglio', 'Width=600px,Height=270px;')
}

function Fz_OpenMail(sFile, sCodice){
	window.showModalDialog('Listini/Listini_Mail.aspx?File=' + sFile + '&Codice=' + sCodice, 'Dettaglio', 'dialogWidth=520px;dialogHeight=500px;center=yes;status=no')
	//window.open('Listini/Listini_Configura.aspx?File=' + sFile + '&Codice=' + sCodice, 'Dettaglio', 'Width=600px,Height=270px;')
}

function Fz_OpenMap(){
	window.showModalDialog('DoveSiamo/Mappa.aspx', 'Mappa', 'dialogWidth=800px;dialogHeight=700px;center=yes;status=no')
	//window.open('DoveSiamo/Mappa.aspx', 'Mappa', 'Width=800px,Height=700px,status=yes')
}

function Fz_OpenMapMichelin(sLink, sIndirizzo, sCap, sCitta, sNazione){
	sIndirizzo = sIndirizzo.replace(" ", "+")
	sCap = sCap.replace(" ", "+")
	sCitta = sCitta.replace(" ", "+")
	sNazione = sNazione.replace(" ", "+")
	var sPercorso = sLink + '&strStartAddress=' + sIndirizzo + '&strStartCP' + sCap + '=&strStartCity=' + sCitta + '&strStartCityCountry=&strDestAddress=Via+Paletti+4/A&strDestCP=41051&strDestCity=Castelnuovo+Rangone&strDestCityCountry=612'
	window.showModalDialog(sPercorso, 'Mappa', 'dialogWidth=790px;dialogHeight=700px;center=yes;status=no')
	//window.open('DoveSiamo/Mappa.aspx', 'Dettaglio', 'Width=790px,Height=700px;')
}

function Fz_OpenSelectionImages(sImmagine){
	//window.showModalDialog('GestioneTesti/SelezioneImmagine.aspx', 'Immagini', 'dialogWidth=700px;dialogHeight=400px;center=yes;status=no')
	window.open('GestioneTesti/SelezioneImmagine.aspx?pImmagine=' + sImmagine, 'Immagini', 'Width=700px,Height=400px,')
}

function Fz_OpenTruck(){
	window.showModalDialog('Listini/Listini_Carrello.aspx', 'Dettaglio', 'dialogWidth=500px;dialogHeight=500px;center=yes;status=no')
	//window.open('Listini/Listini_Configura.aspx?File=' + sFile + '&Codice=' + sCodice, 'Dettaglio', 'Width=600px,Height=270px;')
}

function Fz_OpenModality(){
	window.showModalDialog('Listini/Listini_Modalita.aspx', 'Dettaglio', 'dialogWidth=500px;dialogHeight=500px;center=yes;status=no')
	//window.open('Listini/Listini_Configura.aspx?File=' + sFile + '&Codice=' + sCodice, 'Dettaglio', 'Width=600px,Height=270px;')
}

function Fz_QS_Pagina(sQueryString){
   var sAction = new String()
   var sChar = new String()
   var nStart, nPos, nDiff
   sAction = sQueryString;
   if(sAction.indexOf("?") == -1)
      return sAction
   else
      return sAction.substr(0, sAction.indexOf("?"))
}

function Fz_QS_ValPar(sQueryString, sNomePar){
   var sAction = new String()
   var sChar = new String()
   var nStart, nPos, nDiff
   sAction = sQueryString;
   if(sAction.indexOf("?") == -1)
      sChar = "?"
   else
      sChar = "&"
   nStart = sAction.indexOf(sNomePar)
   if(nStart == -1){
      return ""
   }
   else{
      nPos = sAction.indexOf("&", nStart)
      if(nPos == -1)
         nPos = sAction.length
      var sTest = new String()
      sTest = sNomePar
      nDiff = nPos - (nStart + sTest.length + 1)
      return sAction.substr(sAction.indexOf(sNomePar) + sTest.length + 1, nDiff)
      }
}
function Fz_QS_Estrai(sAction, sNomePar, sQueryString){
   var sPar = new String()
   sPar = Fz_QS_ValPar(sQueryString, sNomePar)
   if(sPar == '')
      return sAction
   else{
      var sChar = new String()
      if(sAction.indexOf("?") == -1)
         sChar = "?"
      else
         sChar = "&"
      return sAction += sChar + sNomePar + '=' + sPar
   }
}
function Fz_QS_Componi(sAction, sNomePar, sValorePar){
   if(sValorePar == '')
      return sAction
   else{
      var sChar = new String()
      if(sAction.indexOf("?") == -1)
         sChar = "?"
      else
         sChar = "&"
      return sAction += sChar + sNomePar + '=' + sValorePar
   }
}
function IsInteger(number)
{
	var Pattern = /[^0-9]/g;
	var matchArray = number.match(Pattern);
	
	if (matchArray == null)
	{
		return true;
	}
	else
	{
		return false;
	}
}