/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - imoveis.js - */
var $j = jQuery.noConflict();

$j(document).ready(function(){

	$j('.thumb').bind('mouseenter mouseleave',function(event){
		//Criando tag da nova imagem
		img = '<img width="426" height="325"  alt="*ALT*" src="*SRC*" title="*TITLE*" />'
		img = img.replace('*ALT*',this.alt);
		img = img.replace('*SRC*',this.src);
		img = img.replace('*TITLE*',this.title);
          
                 // Criando legenda dinâmica
                    alt = $j(this).attr('alt');
                    $j('span#txt01').html(alt,this.alt);

		//Substituindo conteudo HTML do div img-destaque
		div = $j('#img-destaque');		
		div.html(img);

		//Lendo o valor do campo hidden total_fotos, que me diz o numero total de fotos
		total_fotos = $j('#total_fotos')[0].value;
		
		//Pegando o numero da foto clicada
		id_thumb = this.id;
		id_thumb = '#'+id_thumb;
		numero = $j(id_thumb).attr('numero');
		
		//Criando o texto do marcador
		texto = '*FOTO*/*TOTAL*'
		texto = texto.replace('*FOTO*',numero)
		texto = texto.replace('*TOTAL*',total_fotos)
				
		//Substituindo conteudo HTML do span marcador-imagens
		div = $j('#marcador-imagens');
		div.html(texto);		
		
		
	});
	
	$j('#cidade').bind('change',function(event){
		
		cidade = $j('#cidade')[0].value;
		url = $j('#portal_url')[0].value + "/listaBairros"; 
		$j.get(url,{ cidade: cidade }, function(data){
				$j('#bairro').html(data);
			});

	});
		
});



/* - removelink.js - */
// http://www.coemi.com.br/portal_javascripts/removelink.js?original=1
var $j=jQuery.noConflict();$j(document).ready(function(){$j('#portaltab-a-coemi a:first').click(function(e){e.preventDefault()});$j('#portaltab-dicas a:first').click(function(e){e.preventDefault()});$j('#portaltab-fale a:first').click(function(e){e.preventDefault()});$j('div#portal-breadcrumbs span a').click(function(e){e.preventDefault()})});
