// JavaScript Document for EiMOVIL.com.br */

// troca o background do menu, de acordo com onmouseover/onmouseout

function hover(x) {
	img = 'url(images/bg_menu_hover'+x+'.gif)';
	document.getElementById('menu').style.background = img;
}

function hoverOut() {
	document.getElementById('menu').style.background = 'url(images/bg_menu_hover00.gif)';
}

// image preload

function imgPreload()
{ 
  var args = imgPreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=1; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

// abre pop-up

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

// escreve mailto via client-side javascript (anti-spam)

antes_info="info";
depois_info="mlbellotto.com";
antes_site="marco";
depois_site="fontaneti.com";
arroba="@";

function monta_mailto_info(){
	return antes_info + arroba + depois_info;
}

function abre_mailto_info(){ 
	window.location = "mailto:" + monta_mailto_info();
}

function monta_mailto_site(){
	return antes_site + arroba + depois_site;
}

function escreve_mailto_site(){
	document.write("<a class='credito' href='mailto:" + monta_mailto_site() + "'>" + "Marco Fontaneti" + "</a>");
}


// mostra filho, ou seja, exibe uma div que estava oculta

function mostra(nome){
	obj=document.getElementById(nome);
	disp="block";
	if (obj.style.display=="block") disp="none";
	obj.style.display=disp;
	return false;
}

// funcionamento dos form fields

function atualiza_campo(campo,valor) {
	if (campo.value == '') { 
		campo.value = valor;
	} else if (campo.value == valor) {
		campo.value = '';
	}
}