
var cache = "_geral.js12804617691280461769128046176912804617691";

function sendWindowForm( divForm, _form ){
	divResp = 'emailResponse'+divForm;
	
	var valid = new Validation( _form ,{onSubmit:false});
	if(valid.validate()){
			
		if($(divForm).firstDescendant().id != divResp)
			$(divForm).insert({'top' : '<div id="'+divResp+'" class="emailResponse"><div id="emailResponseMsg"></div></div>'});
		
		$('emailResponseMsg').show().update('Enviando...').addClassName('emailResponseEnviando');
		
		new Ajax.Request('http://www.lotisa.com.br/_Request/',{
						
					  parameters: $(_form).serialize(),
					  onComplete: function(resposta) {
					  	if(resposta.responseText.isJSON()){
							var res = resposta.responseText.evalJSON();
							if(res.status == 'ok'){
								$('emailResponseMsg').update(res.mensagem).addClassName('emailResponseEnviada');
								//$('emailResponseMsg').update(res.mensagem).removeClassName('emailResponseEnviando').removeClassName('emailResponseErro').addClassName('emailResponseEnviada');
							}else{
								$('emailResponseMsg').update(res.mensagem).removeClassName('emailResponseEnviando').addClassName('emailResponseErro');
							}
						}else{
							$('emailResponseMsg').update('Não foi possível executar esta função neste momento. Tente novamente, por favor ou envie e-mail para <a href="contato@mazaya.com.br">contato@mazaya.com.br</a>.').removeClassName('emailResponseEnviando').addClassName('emailResponseErro');
						}
					  }
		
		
		});
	}
	return false;
}
function blog_focus(){
	this.addClassName('inputFocus');
	if(this.value == this.previous('label').innerHTML){
		this.value = '';
	}
	this.previous('label').addClassName('labelFocus');		
}
function blog_blur(){
	this.removeClassName('inputFocus');
	if(this.value == ''){
		//this.value = this.previous('label').innerHTML;
	}
	this.previous('label').removeClassName('labelFocus');	
}




var latinaires = {
  src: 'http://www.lotisa.com.br/_imagens/latinaires.swf'
};
sIFR.activate(latinaires);

var latinairescaps = {
  src: 'http://www.lotisa.com.br/_imagens/latinaires-caps.swf'
};
sIFR.activate(latinairescaps);

function sifrReplace(){
	
	sIFR.replace(latinairescaps, {
				 selector: 'h2',
				 wmode: 'transparent',
				 css: [ '.sIFR-root {leading: -20; color:#000000; }' ]
			});
	sIFR.replace(latinaires, {
				 selector: 'h3',
				 wmode: 'transparent',
				 css: [ '.sIFR-root { color:#000000; }, a { color:#000000; text-decoration:none;}, a:hover { color:#EE9121}' ]
			});
	sIFR.replace(latinaires, {
				 selector: 'h4',
				 wmode: 'transparent',
				 css: [ '.sIFR-root {leading: -20; color:#000000; }' ]
			});
}


 
	var Slideshow = Class.create({
		 initialize: function(delay, elmtName) {
			this.delay = delay;
			this.totalElmt = $(elmtName).childElements().size();
			this.elmtName = $(elmtName);
			this.paused = false;
			this.curElmtNum = this.totalElmt - 1;
			
			this.arrayElm = $(elmtName).childElements();
			
			this.elmtName.observe('mouseover', function() { this.paused = 1 }.bind(this));
			this.elmtName.observe('mouseout', function() { this.paused = 0 }.bind(this));
			
			
			/*
			$$('img.arrow').each(function(node) {  //looks for all arrows (pointing right) and handles click event
				node.observe('click', function(s){
					this.arrSlideElmt[this.curElmtNum].setStyle({
					  display: 'none'
					});
					this.checkSlide();
					this.arrSlideElmt[this.curElmtNum].setStyle({
					  display: 'block'
					});
					s.stop();
				}.bind(this));
			}.bind(this));		*/
		 },
		start: function() {
			this.update();
			this.executor = new PeriodicalExecuter(function() { 
				this.next(); //start slidehow
			}.bind(this), this.delay);		
		},
 
		next: function(){
			if (!this.paused) {
				this.update();
			}
		},
		update: function() {
				//new Effect.Parallel([
								this.arrayElm[(this.curElmtNum + 0) % this.totalElmt].fade()
								//,
								this.arrayElm[(this.curElmtNum + 1) % this.totalElmt].appear()
								//]);
			this.checkSlide()
		},
		checkSlide: function() {
			if (this.curElmtNum == this.totalElmt) { this.curElmtNum = 1; }
			else { this.curElmtNum ++; }		
		}
	});
 
	var slideshow;
	
function init() {
	$$(".inputField").each(function(_ele){
		Event.observe(_ele, 'focus', blog_focus.bindAsEventListener(_ele));
		Event.observe(_ele, 'blur', blog_blur.bindAsEventListener(_ele));
	});
	
	
	$$('.flashReplace').each(function ( _ele ){
				attr = _ele.readAttribute('swf')
				_width = _ele.getWidth();
				_height = _ele.getHeight();
				
				var flashvars = {};
				var params = {
				  menu: "false",
				  scale: "scale",
				  quality: "high",
				  wmode: "transparent",
				  salign: "t"
				};
				var attributes = {};
				
				swfobject.embedSWF(attr, _ele.id, _width, _height, "9","http://www.lotisa.com.br/_shared/_swf/expressInstall.swf", flashvars, params, attributes);
	});
	sifrReplace();
}

document.observe("dom:loaded",init);



hs.align = 'center';
hs.graphicsDir = 'http://www.lotisa.com.br/_shared/images/highslide/';
hs.outlineType = 'rounded-white';
hs.cacheAjax = false;
hs.closeText = 'Fechar';
hs.loadingText = 'Carregando...';
hs.showCredits = false;

hs.dimmingOpacity = '0.95';

hs.transitions = ['expand', 'crossfade'];

	hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .75,
			position: 'bottom center',
			hideOnMouseOut: false
		}
	});




