    var last=-1; //guarda o valor da ultima posição do menu serviços
	function suap(quem,indexx)
         {

                         textos= new Array(6);
                          textos[0]="txtcaixa";
                         textos[1]="txtcaixa2";
                         textos[2]="txtcaixa3";
                        textos[3]="txtcaixa4";
                         textos[4]="txtcaixa5";
						 textos[5]="txtcaixa6";
                         imagens= new Array(6);
                         imagens[0]="imgcaixa";
                         imagens[1]="imgcaixa1";
                         imagens[2]="imgcaixa2";
                         imagens[3]="imgcaixa3";
                         imagens[4]="imgcaixa4";
						 imagens[5]="imgcaixa5";
						 servico=new Array(6);
						 servico[0]="bgm1";
						 servico[1]="bgm2";
						 servico[2]="bgm3";
						 servico[3]="bgm4";
						 servico[4]="bgm5";
						 servico[5]="bgm6";
						 
                          if(navigator.userAgent.toLowerCase().indexOf('msie') != -1)
                           {
                                  // alert("ie");         
								 /* document.getElementById("bgm1").style.background="background-image: url('img/menu_serv.png')";
								   document.getElementById("bgm2").style.background="background-image: url('img/menu_serv.png')";
								   document.getElementById("bgm3").style.background="background-image: url('img/menu_serv.png')";
									document.getElementById("bgm4").style.background="background-image: url('img/menu_serv.png')";
									document.getElementById("bgm5").style.background="background-image: url('img/menu_serv.png')";
									document.getElementById("bgm6").style.background="background-image: url('img/menu_serv.png')";
									*/
									if(last>-1)
									{
								 document.getElementById(servico[last]).style.background="background-image: url('img/menu_serv.png') no-repeat";									}
		 document.getElementById(servico[indexx]).style.background="background-image: url('img/menu_serv_on.png') no-repeat"; 
									 last=indexx;
							
			                      }
                                 else
                                 {
							 /*document.getElementById("bgm1").style.background="url('img/menu_serv.png')no-repeat";
							 document.getElementById("bgm2").style.background="url('img/menu_serv.png')no-repeat";
							 document.getElementById("bgm3").style.background="url('img/menu_serv.png')no-repeat";
							 document.getElementById("bgm4").style.background="url('img/menu_serv.png')no-repeat";
							 document.getElementById("bgm5").style.background="url('img/menu_serv.png')no-repeat";
							 document.getElementById("bgm6").style.background="url('img/menu_serv.png')no-repeat";
							 */
							 if(last>-1)
									{
										document.getElementById(servico[last]).style.background="url('img/menu_serv.png')no-repeat";
								 	}
         document.getElementById(servico[indexx]).style.background="url('img/menu_serv_on.png')no-repeat";
		                          last=indexx;
                                 }
 							
                             document.getElementById(textos[0]).style.display='none';
                          document.getElementById(textos[1]).style.display='none';
                          document.getElementById(textos[2]).style.display='none';
                          document.getElementById(textos[3]).style.display='none';
                          document.getElementById(textos[4]).style.display='none';
						  document.getElementById(textos[5]).style.display='none';
                          document.getElementById(textos[indexx]).style.display='block';
                           document.getElementById(imagens[0]).style.display='none';
                           document.getElementById(imagens[1]).style.display='none';
                           document.getElementById(imagens[2]).style.display='none';
                           document.getElementById(imagens[3]).style.display='none';
                           document.getElementById(imagens[4]).style.display='none';
						   document.getElementById(imagens[5]).style.display='none';
                           document.getElementById(imagens[indexx]).style.display='block';
           }
        

var w=1
var h=1

if (document.getElementById || document.all)
document.write('<div id="trailimageid" style="position:absolute;visibility:hidden;left:0px;top:-1000px;width:1px;height:1px;border:0px solid #888888;background:#FFF;"><img id="ttimg" src="../img/icone1.png" /></div>')

function gettrailobj()
{
    if (document.getElementById) return document.getElementById("trailimageid").style
    else if (document.all) return document.all.trailimagid.style
}

function truebody()
{
    return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail()
{
    document.onmousemove=""
    document.getElementById('ttimg').src='../img/icone1.png'
    gettrailobj().visibility="hidden"
    gettrailobj().left=-1000
    gettrailobj().top=0
}


function showtrail(width,height,file)
{
    if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
    {
        w=width
        h=height

        // followmouse()

        document.getElementById('ttimg').src=file
        document.onmousemove=followmouse
        gettrailobj().visibility="visible"
        gettrailobj().width=w+"px"
        gettrailobj().height=h+"px"

    }
}



function followmouse(e)
{

    if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
    {

        var xcoord=-270
        var ycoord=10

        if (typeof e != "undefined")
        {
            xcoord+=e.pageX
            ycoord+=e.pageY
        }
        else if (typeof window.event !="undefined")
        {
            xcoord+=truebody().scrollLeft+event.clientX
            ycoord+=truebody().scrollTop+event.clientY
        }

        var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
        var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

        if (xcoord+w+3>docwidth)
        xcoord=xcoord-w-(20*2)

        if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
        ycoord=ycoord-h-20;

        gettrailobj().left=xcoord+"px"
        gettrailobj().top=ycoord+"px"

    }

}






// funcção valida o formulario de contato
function Trim(strTexto)
        {
            // Substitúi os espaços vazios no inicio e no fim da string por vazio.
            return strTexto.replace(/^\s+|\s+$/g, '');
        }
 function validacampo(formm,i)
 {
//----------valida o campo
        if (Trim(formm.elements[i].value).length== 0)
         {
                 formm.elements[i].style.background="#bc0019";
                 formm.elements[i].focus();
                 hitc=0;
                return false;

                }
                  else
                {
                 formm.elements[i].style.background="#ffffff";
                 hitc=1;
                }//fim do else
//------------fim valida o campo
        }

function validaemail(formm,i)
{
        //-- valida e-mail ---
if (formm.email.value.length == 0)
 {
  formm.email.style.background="#bc0019";
  formm.email.focus();
   hitc=0;
    return false;
  }
else
 {
   if (formm.email.value.indexOf("@")==-1 || formm.email.value.indexOf(".")==-1 || formm.email.value.indexOf(" ")!=-1 || formm.email.value.length<6)
     {
       formm.email.style.background="#bc0019";
           formm.email.focus();
           hitc=0;
            return false;
      }
    else
    {
          formm.email.style.background="#ffffff";
           hitc=1;
          // alert("hiii"+hitc);
    }
  }
}
//-- fim valida e-mail
function valida(formm)
{
        //alert(formm.name);
        hitc=0;
 var formm=formm;
         for(i=0; i<=4;i++)
   {
  switch(i)
          {
                case 0: //valida o nome
                 if(validacampo(formm,i)==false)
                {
                        return false
                }

                break
                case 1: //valida o campo email
                 if(validacampo(formm,i)==false)
                {
                        return false
                }

                break
                case 2://valida e assunto
                if(validaemail(formm,i)==false)
                {
                        return false
                }
                break
                        case 3: //valida o mensagem
                 if(validacampo(formm,i)==false)
                {
                        return false
                }
                break
          }//fim do switch
    }//fim do for
  if(hitc==1)
   {
         return true
        // return false;
   }
   else
   {
         return false;
   }
 }//fim da função


// fim funcção valida o formulario de contato

      //FUNÇÃO para pop up do suporte online
 var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
	//alert("w= "+screen.availWidth+" h= "+screen.availHeight);
       if(screen.availHeight>600){
        top=parseInt((screen.availHeight-height)/2);
        }
         if(screen.availWidth>800){
        left=parseInt((screen.availWidth-width)/2);
        }

  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
//---------------adicionar aos favoritos  ----


function addFav(){
    var url      =document.location;
    var title    = "Grupo Ettori";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}
