/*------------------------------------------------------------------------------------------------------27/05/2008
Ag. Dotes - Otimizando seus dons - http://www.dotes.com.br - +55(62)3514.1227 | url: http://www.novonorteimoveis.com.br  
Criado por : Luiz Jr. Fernandes | email: contato@dotes.com.br / luizbox@msn.com
---------------------------------------------------------------------------------------------------------------*/

window.addEvent("domready",function(){
	var itens_menu = $$("#menu ul li");
	var links_menu = $$("#menu ul li a");
	itens_menu.each(function(li){
		li.addEvent("mouseenter",function(){
				var fx = new Fx.Morph(this.getChildren().getLast(), {duration: 200, wait:false});
				itens_menu.each(function(li){li.fade(.7);});
				//fx.start({'font-weight':'bold'});
				this.fade(1)
		})
		li.addEvent("mouseleave",function(){
			if (this.getChildren().getLast().get("class") != "selected" ){
				var fx = new Fx.Morph(this.getChildren().getLast(), {duration: 200, wait:false});
				itens_menu.each(function(li){li.fade(1)});
		//		fx.start({'font-weight':'none'})								 
			}
		});
	});
	

	//Definindo morphs	
	var fxmsg = new Fx.Morph($("mensagem"), {duration: 700, wait:false});
	var fxcontainer = new Fx.Morph($("container"), {duration: 700, wait:true, 'unit':'%'});
	var fxcontent = new Fx.Morph($("content"), {duration: 700, wait:true, 'unit':'%'});
	var fxilustra = new Fx.Morph($("ilustra"), {duration: 700, wait:false});
	var fxmsgcontent = new Fx.Morph($("msgscontent"), {duration: 700, wait:false,'unit':'%'});
	var fxheader = new Fx.Morph($("header"), {duration: 700, wait:false});
	var fxplacas = new Fx.Morph($("placas"), {duration: 700, wait:false});
	var fxmenu = new Fx.Morph($("menu"), {duration: 700, wait:false});
	
	$("container").setStyle("opacity",0);
	fxcontent.start({'opacity':0});
	fxcontainer.start({'opacity':0});
	fxmsgcontent.start({'opacity':0});
	fxheader.start({'opacity':0});
	
	//Starting links
	$("inicio").addEvent("click",function(){
			if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
			this.addClass("selected");	fxcontent.start({'opacity':0});
			itens_menu.each(function(li){li.removeClass("selected");});this.getParent().set("class","selected");
			links_menu.each(function(a){if (a.id != "inicio"){var fx = new Fx.Morph(a, {duration: 200, wait:false});a.removeClass("selected");	 }});
			fxcontainer.start({'opacity':0}).chain(	function(){fxmsg.start({'opacity':1});fxplacas.start({'opacity':1});	});
			fxilustra.start({'opacity':0}).chain( function(){
			$("ilustra").src="";
				var imgtmp = new Asset.images("images/avoeneto.png", {
					onComplete: function(){
						$("ilustra").setStyles({'width':450,'height':358}).setProperties({"src":"images/avoeneto.png","width":450,"height":358});
						fxilustra.start({'opacity':1});	
					}
				});
			});
			fxmsgcontent.start({'opacity':0}).chain(function(){
				$("msgscontent").set("html","");
			});
			$("header").set("html","");		fxheader.start({'opacity':0});
	});
	
	$("novo_norte").addEvent("click",function(){
		if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
		fxmenu.start({'opacity':0}).chain(	function(){	fxmenu.start({'display':'none'})	});

		if (!$("content").getLast()){return false;}//prevent more 2 clicks before content loaded
		this.addClass("selected");fxplacas.start({'opacity':0});	
		itens_menu.each(function(li){li.removeClass("selected");});$("novo_norte").getParent().set("class","selected");
		links_menu.each(function(a){ if (a.id != "novo_norte"){	 var fx = new Fx.Morph(a, {duration: 200, wait:false});
																					 //  fx.start({'margin-top':17});
																					   a.removeClass("selected");}});
		fxmsgcontent.start({'opacity':[0]});
		var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});
		fxChildContent.start({'opacity':[0]}).chain( function(){
			$("content").set("html","");  $("msgscontent").set("html","");  
			fxheader.start({'opacity':0,'top':[5]}).chain( function(){	$("header").set("html","<h2>Novo Norte</h2>");		fxheader.start({'opacity':1});	});	
			fxmsgcontent.start({'opacity':0,'top':[0,30],'width':15, 'height':25}).chain(function(){		$("msgscontent").set("html","<div> Conhe&ccedil;a melhor nossa institui&ccedil;&atilde;o e nossos empreendimentos.<br /> Entre em contato conosco!<br /><br />Telefone: (62)3511-1551<br /><br />Pra&ccedil;a Belarmino Essado 178 <br />Centro | Inhumas | Goi&aacute;s | Brasil <br /><a href='mailto:contato@novonorteimoveis.com.br'>contato@novonorteimoveis.com.br</a></div>");	fxmsgcontent.start({'opacity':1});	});
					if (Browser.Engine.trident){
						fxcontainer.start({'height':[60],'width':[60], 'right':[16], 'top':[0,8],'opacity':[.3] });
						fxcontent.start({'height':[60],'width':[60], 'right':[16], 'top':[0,8], 'opacity':[0]  });
					}else{
						fxcontainer.start({'height':[60],'width':[60], 'right':[16], 'top':[8],'opacity':[.3] });
						fxcontent.start({'height':[60],'width':[60], 'right':[16], 'top':[8], 'opacity':[0]  });
					}
			fxmsg.start({'opacity':0}).chain(	function(){		fxcontainer.start({'opacity':.3});		});
			fxilustra.start({'opacity':0}).chain( function(){	
				$("ilustra").src="";
					var imgtmp = new Asset.images("images/maefilho.png", {
						onComplete: function(){
							fxilustra.start({'opacity':1});	
							$("ilustra").setStyles({'width':408,'height':285}).setProperties({"src":"images/maefilho.png","width":408,"height":285});
						}
					});
				//$("ilustra").addEvent("load",function(){ 
				//		  fxilustra.start({'opacity':1});
				//	  });		
			new Request({
				url: 'site/empresa.php', 
				method: 'get', 
				onRequest:waitingResponse(),
				onSuccess:function(resp){
					$("content").set("html",resp).fade(1);
					new ScrollBar('empresacontent', 'track', 'thumb');
					fxmenu.start({'display':'block'}).chain(	function(){	fxmenu.start({'opacity':1})	});
					new fxGallery({	
						list:"fotos",		//lista das imagens
						overcolor:"#5CA536",	//cor da overlay
						overopacity:.8,			//opacidade da overlay
						titles:true,
						alts:true,
						counter:true
					});
					if (Browser.Engine.trident4){	 
								//IE 6 PNG FIX
								var img = $("ilustra");
								var imgName = img.src.toUpperCase();
								var imgID = (img.id) ? "id='" + img.id + "' " : "";
								var imgClass = (img.className) ? "class='" + img.className + "' " : "";
								var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
								var imgStyle = "position:absolute;bottom:0;right:0;z-index:9999;" + img.style.cssText ;
								if (img.align == "left") imgStyle = "float:left;" + imgStyle;
								if (img.align == "right") imgStyle = "float:right;" + imgStyle;
								if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
								var strNewHTML = "<div " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></div>"; 
								img.outerHTML = strNewHTML;
						}
				}
			}).send();
		});
		});
	});//end novo norte 
	$("placalink").addEvent("click",function(){empreendimentos();});	
  	$("empreendimentos").addEvent("click",function(){empreendimentos();});			
		var empreendimentos = function(){
			if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
			fxmenu.start({'opacity':0}).chain(	function(){	fxmenu.start({'display':'none'})	});
		   if (!$("content").getLast()){return false;}//prevent more 2 clicks before content loaded
			$("empreendimentos").addClass("selected");   fxplacas.start({'opacity':0});													  
			itens_menu.each(function(li){li.removeClass("selected");});$("empreendimentos").getParent().set("class","selected");
			links_menu.each(function(a){	if (a.id != "empreendimentos"){	var fx = new Fx.Morph(a, {duration: 200, wait:false});
																								//  fx.start({'margin-top':17});
																								  a.removeClass("selected");}});
			fxmsgcontent.start({'opacity':[0]});
			var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});
			fxChildContent.start({'opacity':[0]}).chain( function(){ 
					$("content").set("html","");  $("msgscontent").set("html","");
					
					if (Browser.Engine.trident){
							fxcontainer.start({'height':[58],'width':[75], 'right':[1], 'top':[0,8],'opacity':[.3] });
							fxcontent.start({'height':[58],'width':[75], 'right':[1], 'top':[0,8], 'opacity':[0] });
					}else{
							fxcontainer.start({'height':[58],'width':[75], 'right':[1], 'top':[8],'opacity':[.3] });
							fxcontent.start({'height':[58],'width':[75], 'right':[1], 'top':[8], 'opacity':[0] });
					}

					fxmsg.start({'opacity':0}).chain(	function(){		fxcontainer.start({'opacity':.3});		});
					fxilustra.start({'opacity':0}).chain( function(){	

						
						
						var imgtmp = new Asset.images("images/familia.png", {
							onComplete: function(){
								$("ilustra").src="";
								$("ilustra").setStyles({'width':386,'height':301}).setProperties({"src":"images/familia.png","width":386,"height":301});
								fxilustra.start({'opacity':1});	
							}
						});
						
						
					fxmsgcontent.start({'opacity':0,'top':[0,30],'width':15, 'height':25}).chain(function(){	$("msgscontent").set("html","<div>Se voc&ecirc; est&aacute; procurando um local para <strong>MORAR</strong> ou para <strong>INVESTIR</strong>, temos o neg&oacute;cio certo para voc&ecirc;.<br /> Possu&iacute;mos diversos empreendimentos, e com certeza um deles ir&aacute; atender suas necessidades.</div>");	fxmsgcontent.start({'opacity':1});	});
					new Request({
						url: 'site/empreendimentos.php', 
						method: 'get',
						onRequest:function(){
							waitingResponse();
						},
						onSuccess:function(resp){
						fxmenu.start({'display':'block'}).chain(	function(){	fxmenu.start({'opacity':1})	});
						$("content").set("html",resp).fade(1);
						
		if (!$("abas")){
			new Element('div', 	{    'id': 'abas',    'styles': {'display': 'block','opacity':0 ,'top':-36   }}).inject("content");
			new Element('a', 	{    'id': 'aba_atuais', 'class':'sel',    'html': 'Atuais', 'title':'Empreendimentos Atuais'}).inject("abas");
			new Element('a', 	{    'id': 'aba_antigos',    'html': 'Antigos', 'title':'Empreendimentos Conclu&iacute;dos'}).inject("abas");
			$("content").setStyle("overflow","visible");
			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false,unit:'%'});			fxabas.start({'opacity':[.8]})
			var fxnovos = new Fx.Morph("novos", {duration: 700, wait:true});
			var fxantigos = new Fx.Morph("antigos", {duration: 700, wait:true});					
			$("aba_atuais").addEvent("click",function(){
				$("aba_antigos").set("class","");	this.set("class","sel");
				fxantigos.start({'opacity':[0]}).chain( function(){ $("antigos").setStyle("display","none");	fxnovos.start({'opacity':[1]}).chain( function(){	$("novos").setStyle("display","block");	})		})			  
			})
			$("aba_antigos").addEvent("click",function(){
				$("aba_atuais").set("class","");this.set("class","sel");
				fxnovos.start({'opacity':[0]}).chain( function(){ $("novos").setStyle("display","none");	fxantigos.start({'opacity':[1]}).chain( function(){ $("antigos").setStyle("display","block");	})			})							  
			})
	
		}
						if (Browser.Engine.trident4){	 
									//IE 6 PNG FIX
									var img = $("ilustra");
									var imgName = img.src.toUpperCase();
									var imgID = (img.id) ? "id='" + img.id + "' " : "";
									var imgClass = (img.className) ? "class='" + img.className + "' " : "";
									var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
									var imgStyle = "position:absolute;bottom:0;right:0;z-index:9999;" + img.style.cssText ;
									if (img.align == "left") imgStyle = "float:left;" + imgStyle;
									if (img.align == "right") imgStyle = "float:right;" + imgStyle;
									if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
									var strNewHTML = "<div " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></div>"; 
									img.outerHTML = strNewHTML;
							}

							
							$("cps").addEvent("click",function(){cps();});
							var cps = function(){
									if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
									fxilustra.start({'opacity':0});
									var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});$("content").fade(0);
									fxChildContent.start({'opacity':[0]}).chain( function(){
										new Request({url:"site/loteamentos/cps.php",method: 'get',onRequest:function(){$("content").fade(0);},onSuccess:function(resp){
											$("content").set("html",resp).fade(1);
											new fxGallery({	
												list:"fotoslotes",		//lista das imagens
												overcolor:"#5CA536",	//cor da overlay
												overopacity:.8,			//opacidade da overlay
												titles:true,
												alts:true,
												counter:true
											});
											new ScrollBar('empreende', 'track', 'thumb');
										} }).send();
										fxmsgcontent.start({'opacity':0,'top':40,'width':18, 'height':25}).chain(function(){	
										new Request({url:"site/loteamentos.html",method: 'get',onSuccess:function(resp){
											$("msgscontent").set("html",resp).fade(1);
											$("cps").addEvent("click",function(){cps()});
											$("rps").addEvent("click",function(){rps()});
											$("sn").addEvent("click",function(){sn()});
											$("vg").addEvent("click",function(){vg()});
											$("al").addEvent("click",function(){al()});
											$("il").addEvent("click",function(){il()});	
											$("paraiso").addEvent("click",function(){paraiso()});	
											$("bancarios").addEvent("click",function(){bancarios()})											
											$("cps").setStyles({"font-weight":"bold"});
											if ($$(".tip").length>0){					$$(".tip").destroy(this)						}
											
											var myTips = new Tips('.tipp',{	showDelay: 100,hideDelay: 0,offsets: {'x': -50, 'y': 20}});								
											fxmsgcontent.start({'opacity':1});	
										} }).send();									
										
										});
									});
							}
							$("il").addEvent("click",function(){il();});
							var il = function(){
								if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
									fxilustra.start({'opacity':0});
									var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});$("content").fade(0);
									fxChildContent.start({'opacity':[0]}).chain( function(){
										new Request({url:"site/loteamentos/il.php",method: 'get',onSuccess:function(resp){
											$("content").set("html",resp).fade(1);
											new fxGallery({	
												list:"fotoslotes",		//lista das imagens
												overcolor:"#5CA536",	//cor da overlay
												overopacity:.8,			//opacidade da overlay
												titles:true,
												alts:true,
												counter:true
											});
											new ScrollBar('empreende', 'track', 'thumb'); 										 
										} }).send();
										fxmsgcontent.start({'opacity':0,'top':40,'width':18, 'height':25}).chain(function(){	
										new Request({url:"site/loteamentos.html",method: 'get',onSuccess:function(resp){
											$("msgscontent").set("html",resp).fade(1);
											$("cps").addEvent("click",function(){cps()});
											$("rps").addEvent("click",function(){rps()});
											$("sn").addEvent("click",function(){sn()});
											$("vg").addEvent("click",function(){vg()});
											$("al").addEvent("click",function(){al()});
											$("il").addEvent("click",function(){il()});
											$("paraiso").addEvent("click",function(){paraiso()});	
											$("bancarios").addEvent("click",function(){bancarios()})											
											$("il").setStyles({"font-weight":"bold"});
											if ($$(".tip").length>0){					$$(".tip").destroy(this)						}
											var myTips = new Tips('.tipp',{	showDelay: 100,hideDelay: 0,offsets: {'x': -50, 'y': 20}});								
											fxmsgcontent.start({'opacity':1});	
										} }).send();									
										
										});
									});
							}
							
							$("rps").addEvent("click",function(){rps();});
							var rps = function(){
									if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
									fxilustra.start({'opacity':0});
									var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});$("content").fade(0);
									fxChildContent.start({'opacity':[0]}).chain( function(){
										new Request({url:"site/loteamentos/rps.php",method: 'get',onSuccess:function(resp){
											$("content").set("html",resp).fade(1);
											new fxGallery({	
												list:"fotoslotes",		//lista das imagens
												overcolor:"#5CA536",	//cor da overlay
												overopacity:.8,			//opacidade da overlay
												titles:true,
												alts:true,
												counter:true
											});
											new ScrollBar('empreende', 'track', 'thumb'); 
										} }).send();
										fxmsgcontent.start({'opacity':0,'top':40,'width':18, 'height':25}).chain(function(){	
										new Request({url:"site/loteamentos.html",method: 'get',onSuccess:function(resp){
											$("msgscontent").set("html",resp).fade(1);
											$("cps").addEvent("click",function(){cps()});
											$("rps").addEvent("click",function(){rps()});
											$("sn").addEvent("click",function(){sn()});
											$("vg").addEvent("click",function(){vg()});
											$("al").addEvent("click",function(){al()});
											$("il").addEvent("click",function(){il()});	
											$("paraiso").addEvent("click",function(){paraiso()});	
											$("bancarios").addEvent("click",function(){bancarios()})											
											$("rps").setStyles({"font-weight":"bold"});
											if ($$(".tip").length>0){					$$(".tip").destroy(this)						}
											var myTips = new Tips('.tipp',{	showDelay: 100,hideDelay: 0,offsets: {'x': -50, 'y': 20}});								
											fxmsgcontent.start({'opacity':1});	
										} }).send();									
										
										});
									});
							}
							$("sn").addEvent("click",function(){sn();});
							var sn = function(){
									if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
									fxilustra.start({'opacity':0});
									var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});$("content").fade(0);
									fxChildContent.start({'opacity':[0]}).chain( function(){
										new Request({url:"site/loteamentos/sn.php",method: 'get',onSuccess:function(resp){
											$("content").set("html",resp).fade(1);
											new fxGallery({	
												list:"fotoslotes",		//lista das imagens
												overcolor:"#5CA536",	//cor da overlay
												overopacity:.8,			//opacidade da overlay
												titles:true,
												alts:true,
												counter:true
											});
											new ScrollBar('empreende', 'track', 'thumb');
										} }).send();
										fxmsgcontent.start({'opacity':0,'top':40,'width':18, 'height':25}).chain(function(){	
										new Request({url:"site/loteamentos.html",method: 'get',onSuccess:function(resp){
											$("msgscontent").set("html",resp).fade(1);
											$("cps").addEvent("click",function(){cps()});
											$("rps").addEvent("click",function(){rps()});
											$("sn").addEvent("click",function(){sn()});
											$("vg").addEvent("click",function(){vg()});
											$("al").addEvent("click",function(){al()});
											$("il").addEvent("click",function(){il()});
											$("paraiso").addEvent("click",function(){paraiso()});	
											$("bancarios").addEvent("click",function(){bancarios()})											
											$("sn").setStyles({"font-weight":"bold"});
											if ($$(".tip").length>0){					$$(".tip").destroy(this)						}
											var myTips = new Tips('.tipp',{	showDelay: 100,hideDelay: 0,offsets: {'x': -50, 'y': 20}});								
											fxmsgcontent.start({'opacity':1});	
										} }).send();									
										
										});
									});
							}
							$("vg").addEvent("click",function(){vg();});
							var vg = function(){	
									if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
									fxilustra.start({'opacity':0});
									fxmsgcontent.start({'opacity':[0]});
									var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});$("content").fade(0);
									fxChildContent.start({'opacity':[0]}).chain( function(){
										new Request({url:"site/loteamentos/vg.php",method: 'get',onSuccess:function(resp){
										$("content").set("html",resp).fade(1);
											new fxGallery({	
												list:"fotoslotes",		//lista das imagens
												overcolor:"#5CA536",	//cor da overlay
												overopacity:.8,			//opacidade da overlay
												titles:true,
												alts:true,
												counter:true
											});
											new ScrollBar('empreende', 'track', 'thumb');
										} }).send();
										
										fxmsgcontent.start({'opacity':0,'top':40,'width':18, 'height':25}).chain(function(){	
										new Request({url:"site/loteamentos.html",method: 'get',onSuccess:function(resp){
											$("msgscontent").set("html",resp).fade(1);
											$("cps").addEvent("click",function(){cps()});
											$("rps").addEvent("click",function(){rps()});
											$("sn").addEvent("click",function(){sn()});
											$("vg").addEvent("click",function(){vg()});
											$("al").addEvent("click",function(){al()});
											$("il").addEvent("click",function(){il()});
											$("paraiso").addEvent("click",function(){paraiso()});	
											$("bancarios").addEvent("click",function(){bancarios()})											
											$("vg").setStyles({"font-weight":"bold"});
											if ($$(".tip").length>0){					$$(".tip").destroy(this)						}
											var myTips = new Tips('.tipp',{	showDelay: 100,hideDelay: 0,offsets: {'x': -50, 'y': 20}});								
											fxmsgcontent.start({'opacity':1});	
										} }).send();									
										
										});
									});
							}
							$("al").addEvent("click",function(){al();});
							var al = function(){
									if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}								
									fxilustra.start({'opacity':0});
									fxmsgcontent.start({'opacity':[0]});
									var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});$("content").fade(0);
									fxChildContent.start({'opacity':[0]}).chain( function(){
										new Request({url:"site/loteamentos/al.php",method: 'get',onSuccess:function(resp){
											$("content").set("html",resp).fade(1);
											new fxGallery({	
												list:"fotoslotes",		//lista das imagens
												overcolor:"#5CA536",	//cor da overlay
												overopacity:.8,			//opacidade da overlay
												titles:true,
												alts:true,
												counter:true
											});
											new ScrollBar('empreende', 'track', 'thumb');
										} }).send();
										fxmsgcontent.start({'opacity':0,'top':40,'width':18, 'height':25}).chain(function(){	
											new Request({url:"site/loteamentos.html",method: 'get',onSuccess:function(resp){
												$("msgscontent").set("html",resp).fade(1);
												$("cps").addEvent("click",function(){cps()});
												$("rps").addEvent("click",function(){rps()});
												$("sn").addEvent("click",function(){sn()});
												$("vg").addEvent("click",function(){vg()});
												$("al").addEvent("click",function(){al()});
												$("il").addEvent("click",function(){il()});
												$("paraiso").addEvent("click",function(){paraiso()});	
												$("bancarios").addEvent("click",function(){bancarios()});												
												$("al").setStyles({"font-weight":"bold"});
												if ($$(".tip").length>0){					$$(".tip").destroy(this)						}
												var myTips = new Tips('.tipp',{	showDelay: 100,hideDelay: 0,offsets: {'x': -50, 'y': 20}});								
												fxmsgcontent.start({'opacity':1});	
											} }).send();									
										});
									});
							}

						$("bancarios").addEvent("click",function(){bancarios()});
							var bancarios = function(){	
									if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
									fxilustra.start({'opacity':0});
									fxmsgcontent.start({'opacity':[0]});
									var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});$("content").fade(0);
									fxChildContent.start({'opacity':[0]}).chain( function(){
										new Request({url:"site/loteamentos/bancarios.php",method: 'get',onSuccess:function(resp){
										$("content").set("html",resp).fade(1);
											new fxGallery({	
												list:"fotoslotes",		//lista das imagens
												overcolor:"#5CA536",	//cor da overlay
												overopacity:.8,			//opacidade da overlay
												titles:true,
												alts:true,
												counter:true
											});
											new ScrollBar('empreende', 'track', 'thumb');
										} }).send();
										
										fxmsgcontent.start({'opacity':0,'top':40,'width':18, 'height':25}).chain(function(){	
										new Request({url:"site/loteamentos.html",method: 'get',onSuccess:function(resp){
											$("msgscontent").set("html",resp).fade(1);
											$("cps").addEvent("click",function(){cps()});
											$("rps").addEvent("click",function(){rps()});
											$("sn").addEvent("click",function(){sn()});
											$("vg").addEvent("click",function(){vg()});
											$("al").addEvent("click",function(){al()});
											$("il").addEvent("click",function(){il()});	
											$("paraiso").addEvent("click",function(){paraiso()});	
											$("bancarios").addEvent("click",function(){bancarios()});	
											$("bancarios").setStyles({"font-weight":"bold"});
											if ($$(".tip").length>0){					$$(".tip").destroy(this)						}
											var myTips = new Tips('.tipp',{	showDelay: 100,hideDelay: 0,offsets: {'x': -50, 'y': 20}});								
											fxmsgcontent.start({'opacity':1});	
										} }).send();									
										
										});
									});
							}
						$("paraiso").addEvent("click",function(){paraiso();});
							var paraiso = function(){	
									if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
									fxilustra.start({'opacity':0});
									fxmsgcontent.start({'opacity':[0]});
									var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});$("content").fade(0);
									fxChildContent.start({'opacity':[0]}).chain( function(){
										new Request({url:"site/loteamentos/paraiso.php",method: 'get',onSuccess:function(resp){
										$("content").set("html",resp).fade(1);
											new fxGallery({	
												list:"fotoslotes",		//lista das imagens
												overcolor:"#5CA536",	//cor da overlay
												overopacity:.8,			//opacidade da overlay
												titles:true,
												alts:true,
												counter:true
											});
											new ScrollBar('empreende', 'track', 'thumb');
										} }).send();
										
										fxmsgcontent.start({'opacity':0,'top':40,'width':18, 'height':25}).chain(function(){	
										new Request({url:"site/loteamentos.html",method: 'get',onSuccess:function(resp){
											$("msgscontent").set("html",resp).fade(1);
											$("cps").addEvent("click",function(){cps()});
											$("rps").addEvent("click",function(){rps()});
											$("sn").addEvent("click",function(){sn()});
											$("vg").addEvent("click",function(){vg()});
											$("al").addEvent("click",function(){al()});
											$("il").addEvent("click",function(){il()});	
											$("paraiso").addEvent("click",function(){paraiso()});	
											$("bancarios").addEvent("click",function(){bancarios()});	
											$("paraiso").setStyles({"font-weight":"bold"});
											if ($$(".tip").length>0){					$$(".tip").destroy(this)						}
											var myTips = new Tips('.tipp',{	showDelay: 100,hideDelay: 0,offsets: {'x': -50, 'y': 20}});								
											fxmsgcontent.start({'opacity':1});	
										} }).send();									
										
										});
									});
							}
													}
					}).send();
					});
		});

		fxheader.start({'opacity':0,'top':[5]}).chain( function(){	$("header").set("html","<h2>Empreendimentos</h2>");	fxheader.start({'opacity':1});	});	
			
	};//end empreendimentos
	
	$("contato").addEvent("click",function(){
		if ($("abas")){			var fxabas = new Fx.Morph("abas", {duration: 700, wait:false});			fxabas.start({'opacity':0}).chain(function(){			$("abas").destroy(this)								   			});		}
		fxmenu.start({'opacity':0}).chain(	function(){	fxmenu.start({'display':'none'})	});
		this.addClass("selected");fxplacas.start({'opacity':0});
		itens_menu.each(function(li){li.removeClass("selected");});$("contato").getParent().set("class","selected");
		links_menu.each(function(a){if (a.id != "contato"){var fx = new Fx.Morph(a, {duration: 200, wait:false});
																				// fx.start({'margin-top':17});
																				 a.removeClass("selected");}});
		if (!$("content").getLast()){return false;}//prevent more 2 clicks before content loaded
		var fxChildContent = new Fx.Morph($("content").getLast(), {duration: 700, wait:true});
		fxmsgcontent.start({'opacity':[0]});
		fxChildContent.start({'opacity':[0]}).chain( function(){
		$("content").set("html","");  $("msgscontent").set("html",""); 
		
		fxheader.start({'opacity':0,'top':[35]}).chain( function(){	$("header").set("html","<h2>Contato</h2>");		fxheader.start({'opacity':1});	});		
		fxmsgcontent.start({'opacity':0,'top':30,'width':15, 'height':25}).chain(function(){	$("msgscontent").set("html","<div>Atrav&eacute;s deste formul&aacute;rio voc&ecirc; poder&aacute; enviar sugest&otilde;es, esclarecer suas d&uacute;vidas ou solicitar mais informa&ccedil;&otilde;es sobre nossos empreendimentos.</div>");	fxmsgcontent.start({'opacity':1});	});

		if (Browser.Engine.trident){
				fxcontainer.start({'height':[42],'width':[60], 'right':[16],'top':[0,15], 'opacity':[.3] })
				fxcontent.start({'height':[42],'width':[60], 'right':[16],'top':[0,15], 'opacity':[0]  })
		}else{
				fxcontainer.start({'height':[42],'width':[60], 'right':[16],'top':[15], 'opacity':[.3] })
				fxcontent.start({'height':[42],'width':[60], 'right':[16],'top':[15], 'opacity':[0]  })
		}
		fxmsg.start({'opacity':0}).chain(	function(){	fxcontainer.start({'opacity':.3})	});
			fxilustra.start({'opacity':0}).chain( function(){	
					$("ilustra").src="";
					var imgtmp = new Asset.images("images/gravida.png", {
						onComplete: function(){
							$("ilustra").setStyles({'width':169,'height':370,'opacity':1,'display':'block'}).setProperties({"src":"images/gravida.png","width":169,"height":370});
							fxilustra.start({'opacity':1});
						}
					});
	
				new Request({
					url: 'site/contatos.php', 
					method: 'get',
					onRequest:waitingResponse(),
					onSuccess:function(resp){
						$("content").set("html",resp).fade(1);
						fxmenu.start({'display':'block'}).chain(	function(){	fxmenu.start({'opacity':1})	});
						$$("#form input").each(function(el){
							el.addEvent("click",function(){
								$("results").set("html","");
							});
						});
						if (Browser.Engine.trident4){	 
								//IE 6 PNG FIX
								var img = $("ilustra");
								var imgName = img.src.toUpperCase();
								var imgID = (img.id) ? "id='" + img.id + "' " : "";
								var imgClass = (img.className) ? "class='" + img.className + "' " : "";
								var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
								var imgStyle = "position:absolute;bottom:0;right:0;z-index:9999;" + img.style.cssText ;
								if (img.align == "left") imgStyle = "float:left;" + imgStyle;
								if (img.align == "right") imgStyle = "float:right;" + imgStyle;
								if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
								var strNewHTML = "<div " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></div>"; 
								img.outerHTML = strNewHTML;
						}
					}
				}).send();	
			});
		});
		
	});//end contato
	
})//end domready

function waitingResponse(){}

//Validating and send contact
function contato(){

	var stats = true;
	
	var fx1 = new Fx.Morph("nome", {duration: 500});
	if ($("nome").value.length<6){			stats = false;			fx1.start({'color': ["#FF0000"],'border-color': ["#FF0000"]});	$("v_nome").set('html',' (Insira um nome v&aacute;lido)')	}else{			fx1.start({'color': ["#FFFFFF"],'border-color': ["#003300"]});	$("v_nome").set('html',' ')	}
	
	var fx2 = new Fx.Morph("endereco", {duration: 500});
	if ($("endereco").value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1){			stats = false;fx2.start({'color': ["#FF0000"],'border-color': ["#FF0000"]});	$("v_email").set('html',' (Insira um email v&aacute;lido) ')	}else{			fx2.start({'color': ["#FFFFFF"],'border-color': ["#003300"]});	$("v_email").set('html','');}		
	
	var fx3 = new Fx.Morph("DDD", {duration: 500});
	if ($("DDD").value.length<2){			stats = false;fx3.start({'color': ["#FF0000"],'border-color': ["#FF0000"]});	$("v_telefone").set('html',' (Campo inv&aacute;lido)');	}else{		fx3.start({'color': ["#FFFFFF"],'border-color': ["#003300"]});		$("v_telefone").set('html','  ');	}		
	
	var fx4 = new Fx.Morph("telefone", {duration: 500});
	if ($("telefone").value.length<8){			stats = false;fx4.start({'color': ["#FF0000"],'border-color': ["#FF0000"]});	$("v_telefone").set('html',' (Inv&aacute;lido)');	}else{		fx4.start({'color': ["#FFFFFF"],'border-color': ["#003300"]});	$("v_telefone").set('html','  ');	}		
	
	var fx5 = new Fx.Morph("desc", {duration: 500});
	if ($("desc").value.length<15){		$("desc").set("style","border:1px solid #FF0000 !important ");	stats = false;fx5.start({'color': ["#FF0000"]});		}else{		fx5.start({'color': ["#FFFFFF"],'border-color': ["#003300"]});	$("desc").set("style","border:1px solid #003300 !important ");	}		
	
	var fx6 = new Fx.Morph("titulo", {duration: 500});
	if ($("titulo").value.length<6){			stats = false;			fx6.start({'color': ["#FF0000"],'border-color': ["#FF0000"]});	$("v_titulo").set('html',' (Inv&aacute;lido)')	}else{			fx6.start({'color': ["#FFFFFF"],'border-color': ["#003300"]});	$("v_titulo").set('html',' ')	}
	
	if (stats){		
		$("results").set('html',"Aguarde...");
		querysearch = $('form').toQueryString();
		new Request({
					url: 'functions/contatos.php', 
					method: 'get',
					onSuccess:function(resp){
						$('form').reset();
						$("results").set('html',"Enviado com sucesso. Entraremos em contato em breve!");
					}
				}).send(querysearch);	
		
	}
}


//Block Letters in the contact form
function blockLetters(e)
{	var key;
	var keychar;
	var reg;
	if(window.event) {		key = e.keyCode; 	}
	else if(e.which) {		key = e.which; 		}
	else {		return true;	}
  if((key>=48 && key<=57) || (key==8) || (key==66) ) return true;
  return false;
}

function Abrir(sUrl, iWidth, iHeight){
	var newWin = window.open( sUrl, 'popup', 'scrollbars=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, copyhistory=no, height='+iHeight+', width='+iWidth+', top='+(screen.height - iHeight)/2+', left='+(screen.width - iWidth)/2);
}
/*--------------------------------------------*/
/*------|Formatacao de Campos numericos|------*/
function txtBoxFormat(objeto, sMask, evtKeyPress) {

var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;
if(document.all){nTecla = evtKeyPress.keyCode;} 
else if(document.layers) {nTecla = evtKeyPress.which;} 
else {
	nTecla = evtKeyPress.which;
    if (nTecla == 8) {return true;}
}
sValue = objeto.value;
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( ":", "" );
sValue = sValue.toString().replace( ":", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( " ", "" );
sValue = sValue.toString().replace( " ", "" );
fldLen = sValue.length;  
mskLen = sMask.length;
i = 0;
nCount = 0;
sCod = "";
mskLen = fldLen;
while (i <= mskLen) {
  bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/") || (sMask.charAt(i) == ":"))
  bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))
  if (bolMask) {sCod += sMask.charAt(i); mskLen++; }
  else {sCod += sValue.charAt(nCount);nCount++;}
  i++;
}
objeto.value = sCod;
if (nTecla != 8) {
	 if (nTecla==0){return true;}
  if (sMask.charAt(i-1) == "9") { return ((nTecla > 47) && (nTecla < 58)); }
  else { return true;  }
}
else {  return true;}
}

/*--------------------------------*/
/*------|Bloqueio de letras|------*/
function blockLetters(e)
{	var key;
	var keychar;
	var reg;
	if(window.event) {		key = e.keyCode; 	}
	else if(e.which) {		key = e.which; 		}
	else {		return true;	}
  if((key>=48 && key<=57) || (key==8) || (key==66) ) return true;
  return false;
}
/*-----------------------------------------------*/
/*------|Mascara de preenchimento de moeda|------*/