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


// gera-escreve emails

function monta_mailto(antes,depois){
	var arroba="@";
	return (antes + arroba + depois);
}

function escreve_mailto_postit(){
	document.write("<area shape='poly' coords='27,69,28,86,183,80,182,63' href='mailto:vendas@ortegadistribuidora.com.br' alt='Envie-nos um email' title='Envie-nos um email' />");
}

function escreve_mailto(antes,depois){
	document.write("<a class='txt' href='mailto:" + monta_mailto(antes,depois) + "'>" + monta_mailto(antes,depois) + "</a>");
}

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

// 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];
  }
}

// switch images

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

// navegação entre imagens

var imgNow;

function switchImageIndex(imgName) 
{
  document.getElementById('foto_img').style.background = 'url(images/fotos/' + imgName + '.jpg) top center no-repeat';
  imgNow = imgName;
}
function switchImagePrevious(now) 
{
  var imgName = Number(now) - 1;
  imgName = '0' + String(imgName);
  document.getElementById('foto_img').style.background = 'url(images/fotos/' + imgName + '.jpg) top center no-repeat';
  imgNow = imgName;
}
function switchImageNext(now) 
{
  var imgName = Number(now) + 1;
  imgName = '0' + String(imgName);
  document.getElementById('foto_img').style.background = 'url(images/fotos/' + imgName + '.jpg) top center no-repeat';
  imgNow = imgName;
}


// exibe-oculta uma div

var esconde;

function mostra(mostra){

	if (document.getElementById(esconde)) {
		
	obj=document.getElementById(esconde);
	disp="none";
	if (obj.style.display=="none") disp="block";
	obj.style.display=disp;	

	}
	
	obj=document.getElementById(mostra);
	disp="block";
	if (obj.style.display=="block") disp="none";
	obj.style.display=disp;
	
	esconde = mostra;

	return false;

}

// exibe uma div sem ocultar outra


function extra(mostra){

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

}
