var altura_site = 768;

var largura_site = 408;

var numero_menus = 4;

var m_amarelo = 4;


function soma_alinha()
{
 try
 {
 	numero_menus = numero_menus + 1;
 	m_amarelo = m_amarelo + 1;

 }
 catch(e)
 {
 	return false;
 }
}

soma_alinha();

// funções para o alinhamento do menu pop up -------------------------
function alinhamento()
{

try
{

	//opera Netscape 6 Netscape 4x Mozilla 
	if (window.innerWidth || window.innerHeight)
	{ 
		largura = window.innerWidth;
		altura =  window.innerHeight;
	} 
	//IE Mozilla 
	if (document.body.clientWidth || document.body.clientHeight)
	{ 
		largura = document.body.clientWidth; 
		altura = document.body.clientHeight; 
	} 

	// considerações sobre a largura da tela
	if (largura < altura_site)
	{
		p_lat = 60;
			
		document.getElementById('menu1').style.left = p_lat;
		document.getElementById('menu2').style.left = p_lat + 95;
		document.getElementById('menu3').style.left = p_lat + 189;
		document.getElementById('menu4').style.left = p_lat + 75;

	}
	else
	{
	  
	  	var p_lat = largura;
	
	  	p_lat = p_lat - altura_site;
	
	  	p_lat = p_lat/2 + 60;

		document.getElementById('menu1').style.left = p_lat;
		document.getElementById('menu2').style.left = p_lat + 98;
		document.getElementById('menu3').style.left = p_lat + 193;
		document.getElementById('menu4').style.left = p_lat + 47;
	}

	  	p_alt = 160;
	
		for ( i = 1; i < numero_menus; i++ )
		{
				document.getElementById('menu' + i).style.top = p_alt;
		}

}
catch(e)
{
}

}

// alinhamento do menu amarelo
function alinha_amarelo()
{

try
{
	//opera Netscape 6 Netscape 4x Mozilla 
	if (window.innerWidth || window.innerHeight)
	{ 
		largura = window.innerWidth;
		altura =  window.innerHeight;
	} 
	//IE Mozilla 
	if (document.body.clientWidth || document.body.clientHeight)
	{ 
		largura = document.body.clientWidth; 
		altura = document.body.clientHeight; 
	} 

	// considerações sobre a largura da tela
	if (largura < altura_site)
	{
	  	p_lat = 400;
	
		for ( i = 1; i < m_amarelo; i++ )
		{
			document.getElementById('amarelo' + i).style.left = p_lat;
		}
	}
	else
	{
	  
	  	var p_lat = largura;
	
	  	p_lat = p_lat - altura_site;
	
	  	p_lat = p_lat/2 + 400;
	
		for ( i = 1; i < m_amarelo; i++ )
		{
			document.getElementById('amarelo' + i).style.left = p_lat;
		}
		
	}

	  	p_alt = 35;
	
		for ( i = 1; i < m_amarelo; i++ )
		{
				document.getElementById('amarelo' + i).style.top = p_alt;
				p_alt = 	p_alt + 22;
		}

}
catch(e)
{
}


}


// funções para o menu pop up -------------------------
function sumir()
{
	try
	{
		menu_pp('2','1');
		menu_pp('2','2');
		menu_pp('2','3');
		menu_pp('2','4');
		menu_amarelo('2','1');
		menu_amarelo('2','2');
		menu_amarelo('2','3');
		menu_amarelo('2','4');
	}
	catch(e)
	{
	}
}


function menu_pp(acao , opcao)
{

		
	if (acao == '1' || acao == '2')
	{
		//selecionar opção e aparecer menu
		if (acao == '1')
		{
			sumir();
			document.getElementById('op' + opcao).className = 'caixa_select';
			document.getElementById('menu' + opcao).style.display= '';			
		}
	
		//deselecionar opção e sumir menu
		if (acao == '2')
		{
			document.getElementById('op' + opcao).className = 'caixa_deselect';
			document.getElementById('menu' + opcao).style.display= 'none';
		}
	}
	else
	{
		alert('Parametrôs de menu errados, \n comunique o desenvolvedor.')
	}
}

function menu_amarelo(acao , opcao)
{
	
	if (acao == '1' || acao == '2')
	{
		//selecionar opção e aparecer menu
		if (acao == '1')
		{
			//sumir();
			document.getElementById('op_am' + opcao).className = 'amarelo-02';
			document.getElementById('amarelo' + opcao).style.display= '';
			
		}
	
		//deselecionar opção e sumir menu
		if (acao == '2')
		{

			document.getElementById('op_am' + opcao).className = 'amarelo-01';
			document.getElementById('amarelo' + opcao).style.display= 'none';
		}
	}
	else
	{
		alert('Parametrôs de menu errados, \n comunique o desenvolvedor.')
	}
}

var manipualdo;

function selecionado(opcao, objeto)
{
	try
	{
		document.getElementById(manipulado).className = 'item-01'; 
	}
	catch(e)
	{
	
	}
	
	manipulado = objeto.id;

	if (opcao == '1' || opcao == '2' || opcao == '3')
	{
		if (opcao == '1')
		{
			document.getElementById(manipulado).className = 'item-02'; 
		}
		if (opcao == '2')
		{
			document.getElementById(manipulado).className = 'item-01'; 
		}
		if (opcao == '3')
		{
			document.getElementById(manipulado).className = 'item-03'; 
		}
	}
	else
	{
		alert('Parametrôs de menu errados, \n comunique o desenvolvedor.')
	}

}

function m_solo(opcao, objeto)
{
	if (opcao == '1' || opcao == '2' || opcao == '3')
	{
		if (opcao == '1')
		{
			objeto.className = 'item-05'; 
		}
		if (opcao == '2')
		{
			objeto.className = 'item-04'; 
		}
		if (opcao == '3')
		{
			objeto.className = 'item-05'; 
		}
	}
	else
	{
		alert('Parametrôs de menu errados, \n comunique o desenvolvedor.')
	}

}

function amarelo_solo(opcao, objeto)
{
	if (opcao == '1' || opcao == '2' || opcao == '3')
	{
		if (opcao == '1')
		{
			objeto.className = 'amarelo-02'; 
		}
		if (opcao == '2')
		{
			objeto.className = 'amarelo-01'; 
		}
		if (opcao == '3')
		{
			objeto.className = 'amarelo-02'; 
		}
	}
	else
	{
		alert('Parametrôs de menu errados, \n comunique o desenvolvedor.')
	}

}


// global inicial -------------------------

function conteudo(endereco)
{
	location = endereco;	
}

function amigo(){

window.open('amigo.htm','amigo','width=300,height=250');

}

function fotos(){

window.open('fotos.htm','fotos','width=440,height=550,scrollbars=yes');

}

function imovel( endereco )
{
	self.location = endereco;
}