function popMapa(){
		w = window.open("http://www.guilhermeimoveis.com.br/mapa.php","produto","top=0,scrollbars=yes,left=0,resizable=yes,width=500,height=430");
		w.focus();
}
function popBanner(){
	popAtendimento();
}
function fecharBanner(){
	$('bannerTempo').hide();
}
function popAtendimento(){
		w = window.open('http://www.guilhermeimoveis.com.br/online/request_email.php?l=admin&x=1&deptid=0',"atendimento","width=500,height=450,scrollbars=yes,left=0,resizable=yes");
		w.focus();
								pageTracker._trackPageview('Atendimento Online');
				}
function imprimir( _id ){
		window.print();
								pageTracker._trackPageview('Imprimir/'+ _id);
				}


var imgC = 0;
var valid;
function sendWindowForm( divForm, _form ){
	//$$(".inputField").each(function(_ele){
			//if(_ele.value == _ele.readAttribute('myvalue'))
				//_ele.value = '';
		//});
	divResp = 'emailResponse'+divForm;
		
		
	valid = new Validation( _form ,{onSubmit:false});
	if(valid.validate()){
				
		if($(divForm).firstDescendant().id != divResp)
			$(divForm).insert({'top' : '<div id="'+divResp+'" style=" display: none; padding:20px; color: black;"></div>'});
			
		new Effect.Appear($(divResp),{duration: 1});
		$(divResp).update('Enviando...').setStyle({ background: '#FFFF99' });
		
		new Ajax.Request('http://www.guilhermeimoveis.com.br/_ajax.php?acao=enviaDados&'+$(_form).serialize(),{
						
					  onComplete: function(transport) {
						if(transport.responseText == 'ok'){
							$(divForm).update('A mensagem foi enviada com sucesso').setStyle({ background: '#dfd' });
						}else{
							$(divResp).update('Não foi possível enviar a mensagem neste momento. Tente novamente, por favor.').setStyle({ background: '#fdd' });
						}
					  }
		
		
		});
	}
	//$$(".inputField").each(function(_ele){
			//if(_ele.value == '')
				//_ele.value = _ele.readAttribute('myvalue');
		//});
	return false;
}


function flashPutHref( _v ){
}
function trocaMes( _d, _id){
	new Ajax.Updater($(_id),'http://www.guilhermeimoveis.com.br/_ajax.php?acao=atualizaCalendario&mes='+_d+'&id='+_id,{evalScripts:true});

}
function marcaDia(d, _td, campo){
	
	td = campo+"_"+_td;
	
	$$('.td_simples').each(function (e){e.removeClassName(campo)});
	
	$(td).addClassName(campo)
	
	$(campo).value = d;
}
function prosseguirReserva(){
	new Ajax.Updater($('emailContentInner'),'http://www.guilhermeimoveis.com.br/_ajax.php?acao=prosseguirReserva&calInicial='+$F('calInicial')+'&calFinal='+$F('calFinal'),{evalScripts:true});
}


function blog_focus(){
	this.addClassName('inputFocus');
	if(this.value == this.readAttribute('myvalue')){
		this.value = '';
	}		
}
function blog_blur(){
	if(this.value == ''){
		this.removeClassName('inputFocus');
		this.value = this.readAttribute('myvalue');	
	}
}

function init() {
	$$(".inputField").each(function(_ele){
		_ele.value = _ele.readAttribute('myvalue');
		_ele.onfocus = blog_focus;
		_ele.onblur = blog_blur;
		});
	
	
}

document.observe("load",init);

	hs.align = 'center';
	hs.graphicsDir = 'http://www.guilhermeimoveis.com.br/_shared/images/highslide/';
	hs.outlineType = 'rounded-white';
	hs.cacheAjax = false;
	hs.closeText = 'Fechar';
	hs.loadingText = 'Carregando...';
	hs.showCredits = false;
	hs.dimmingOpacity = '0.5';


hs.Expander.prototype.onAfterExpand = function (sender){
	init();
}


hs.transitions = ['expand', 'crossfade'];

	hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .85,
			position: 'bottom center',
			hideOnMouseOut: false
		}
	});


