function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function preloadImages() {
	if (document.images)
    {
      preload_image_object = new Image();      
      image_url = new Array();
      image_url[0] = "imagens/idiomas_en_over.gif";
      image_url[1] = "imagens/idiomas_pt_over.gif";
	  image_url[2] = "imagens/idiomas_ww_over.gif";
	  
      /*image_url[3] = "imagens/menu_produtos_content_on.gif";
      image_url[4] = "imagens/menu_produtos_hwa_on.gif";
	  image_url[5] = "imagens/menu_produtos_phonnia_on.gif";
	  image_url[6] = "imagens/menu_produtos_servicos_on.gif";
	  image_url[7] = "imagens/nav_bottom_back_on.gif";
	  image_url[8] = "imagens/nav_bottom_print_on.gif";
	  image_url[9] = "imagens/bg_menu_int_on.gif";
	  */
	  

      var i = 0;
      for(i=0; i<=9; i++) 
         preload_image_object.src = image_url[i];
    }
	
}

/* função que adiciona eventos ao menu */
function mudaMenu(id){
	document.getElementById(id).onmouseover = function(){
		this.className='FundoAzul linhaMenu';
	}
	document.getElementById(id).onmouseout = function(){
		this.className='FundoNada linhaMenu';
	}
}

/* funções imprimir, voltar, barra de países */

function Imprimir() {
	if (document.getElementById("Imprimir")){
		document.getElementById("Imprimir").onmouseover = function() {
			MM_swapImage('Image2','','imagens/nav_bottom_print_on.gif',0);
		}
		document.getElementById("Imprimir").onmouseout = function() {
			MM_swapImgRestore();
		}
		document.getElementById("Imprimir").onclick = function() {
			window.print();			
		}
	}
}

function Voltar() {	
	if (document.getElementById("Voltar")){
		document.getElementById("Voltar").onmouseover = function() {
			MM_swapImage('Image2','','imagens/nav_bottom_back_on.gif',0);
		}
		document.getElementById("Voltar").onmouseout = function() {
			MM_swapImgRestore();
		}
		document.getElementById("Voltar").onclick = function() {
			history.back();				
		}
	}//end if
}

function Brasil() {
	if (document.getElementById("Brasil")){
	document.getElementById("Brasil").onmouseover = function() {
		MM_swapImage('Image1','','imagens/idiomas_br_over.gif',0);
	}
	document.getElementById("Brasil").onmouseout = function() {
		MM_swapImgRestore();
	}
	}//end if
}

function Portugal() {
	if (document.getElementById("Portugal")){
	document.getElementById("Portugal").onmouseover = function() {
		MM_swapImage('Image1','','imagens/idiomas_pt_over.gif',0);
	}
	document.getElementById("Portugal").onmouseout = function() {
		MM_swapImgRestore();
	}
	}//end if
}

function WorldWide() {
	if (document.getElementById("WorldWide")){
	document.getElementById("WorldWide").onmouseover = function() {
		MM_swapImage('Image1','','imagens/idiomas_ww_over.gif',0);
	}
	document.getElementById("WorldWide").onmouseout = function() {
		MM_swapImgRestore();
	}
	}//end if
}

function carregaEventos(){
	mudaMenu("linkQuemSomos");
	mudaMenu("linkQueFazemos");
	mudaMenu("linkComoFazemos");
	mudaMenu("linkClientes");
	mudaMenu("linkFaleConosco");
	mudaMenu("linkJunteseNos");
	mudaMenu("linkBlog");
	//Imprimir();
	//Voltar();
	Brasil();
	Portugal();
	WorldWide();
}

// inicializa os eventos 
!(window.addEventListener) ? window.attachEvent("onload", carregaEventos) : window.addEventListener("load", carregaEventos, false);