
var cache = "script.js";

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.guigui.com.br/_Request/enviarDados',{
						
					  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 diavlo_book_ii_37 = {
  src: 'http://www.guigui.com.br/_imagens/diavlo_book_ii_37.swf'
};
sIFR.activate(diavlo_book_ii_37);

var diavlo_black_ii_37 = {
  src: 'http://www.guigui.com.br/_imagens/diavlo_black_ii_37.swf'
};
sIFR.activate(diavlo_black_ii_37);

var fromage_condensed = {
  src: 'http://www.guigui.com.br/_imagens/fromage_condensed.swf'
};
sIFR.activate(fromage_condensed);

function sifrReplace(){
	
	sIFR.replace(diavlo_black_ii_37, {
				 selector: 'h2',
				 wmode: 'transparent',
				 css: [ '.sIFR-root {leading: 0; letter-spacing: -2; color:#000000; text-align:right; }' ]
			});
	sIFR.replace(diavlo_book_ii_37, {
				 selector: 'h3, h4',
				 wmode: 'transparent',
				 css: [ '.sIFR-root {leading: 0;letter-spacing: -1; color:#000000; text-align:right; }' ]
			});
	sIFR.replace(diavlo_book_ii_37, {
				 selector: 'label,#ulTextos',
				 wmode: 'transparent',
				 css: [ '.sIFR-root {leading: 0; color:#000000; }, a { color:#000000; font-size: 20px; text-decoration:none;}, a:hover { color:#EE9121;}' ]
			});
}


 

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();
				_scale = _ele.hasClassName('_flashScale') ? "scale" : "noscale" ;
				
				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.guigui.com.br/_shared/_swf/expressInstall.swf", flashvars, params, attributes);
	});
	sifrReplace();
}

document.observe("dom:loaded",init);


hs.align = 'center';
hs.graphicsDir = 'http://www.guigui.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,
		overlayOptions: {
			opacity: .9,
			position: 'bottom center',
			hideOnMouseOut: false
		}
	});



