// JavaScript Document

$(function() {
	Cufon.replace('h1', { fontFamily: "Calibri" });
	Cufon.replace('h2', { fontFamily: "Calibri" });
	Cufon.replace('h3', { fontFamily: "Calibri" });
	Cufon.replace('ul#menu > li > a', { fontFamily: "Calibri", hover:true });
});

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

(function($) {
	$.fn.customFadeIn = function(speed, callback) {
		$(this).fadeIn(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeOut = function(speed, callback) {
		$(this).fadeOut(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
})(jQuery);

/* dropdown */
jQuery(document).ready(function() {
	$('ul#menu > li.dropdown').hover(
		function () {
			$('a', this).addClass('ativo');
	 		$('ul', this).slideDown({
				duration: 'normal'
				/*easing: 'easeOutBounce'*/
			});
		},
		function () {
			$('a', this).removeClass('ativo');
			Cufon.refresh('ul#menu > li > a');
	 		$('ul', this).slideUp({
				duration: 'normal'
				/*easing: 'easeOutBounce'*/
			});
		}
	);
});

jQuery(document).ready(function() {
	$('ul#menu > li > a').corner( 'cc:#E2D9CB' );
	$('ul#menu > li > ul').corner( 'bottom 12px' );
	$('#conteudo_internas .item').corner();
});

/* CARROSSEL REVESTIMENTOS HOME */
jQuery(document).ready(function() {
	$('#carrossel_revestimentos_home').jcarousel({
		easing: 'easeOutQuad',
		animation: 700
	});
});

/* ANIMAÇÃO DAS ÂNCORAS NA PÁG. SERVIÇOS */
jQuery(document).ready(function($){
	$('a.topo').click(function() {
		$('html, body').animate({ scrollTop: 0 }, 1200)
	});
	$('#tradicional').click(function() {
		$('html, body').animate({ scrollTop: $('a.tradicional').offset().top }, 1200)
	});
	$('#acrilico').click(function() {
		$('html, body').animate({ scrollTop: $('a.acrilico').offset().top }, 1200)
	});
	$('#pisos').click(function() {
		$('html, body').animate({ scrollTop: $('a.pisos').offset().top }, 1200)
	});
	$('#reformas').click(function() {
		$('html, body').animate({ scrollTop: $('a.reformas').offset().top }, 1200)
	});
});

/* ANIMAÇÃO DAS ÂNCORAS NA PÁG. DE FAQ */
jQuery(document).ready(function($){
	$('#question1').click(function() {
		$('html, body').animate({ scrollTop: $('.answer1').offset().top }, 1200)
	});
		$('#question2').click(function() {
		$('html, body').animate({ scrollTop: $('.answer2').offset().top }, 1200)
	});
		$('#question3').click(function() {
		$('html, body').animate({ scrollTop: $('.answer3').offset().top }, 1200)
	});
		$('#question4').click(function() {
		$('html, body').animate({ scrollTop: $('.answer4').offset().top }, 1200)
	});
		$('#question5').click(function() {
		$('html, body').animate({ scrollTop: $('.answer5').offset().top }, 1200)
	});
		$('#question6').click(function() {
		$('html, body').animate({ scrollTop: $('.answer6').offset().top }, 1200)
	});
		$('#question7').click(function() {
		$('html, body').animate({ scrollTop: $('.answer7').offset().top }, 1200)
	});
		$('#question8').click(function() {
		$('html, body').animate({ scrollTop: $('.answer8').offset().top }, 1200)
	});
		$('#question9').click(function() {
		$('html, body').animate({ scrollTop: $('.answer9').offset().top }, 1200)
	});
		$('#question10').click(function() {
		$('html, body').animate({ scrollTop: $('.answer10').offset().top }, 1200)
	});
		$('#question11').click(function() {
		$('html, body').animate({ scrollTop: $('.answer11').offset().top }, 1200)
	});
		$('#question12').click(function() {
		$('html, body').animate({ scrollTop: $('.answer12').offset().top }, 1200)
	});
		$('#question13').click(function() {
		$('html, body').animate({ scrollTop: $('.answer13').offset().top }, 1200)
	});
		$('#question14').click(function() {
		$('html, body').animate({ scrollTop: $('.answer14').offset().top }, 1200)
	});
		$('#question15').click(function() {
		$('html, body').animate({ scrollTop: $('.answer15').offset().top }, 1200)
	});
		$('#question16').click(function() {
		$('html, body').animate({ scrollTop: $('.answer16').offset().top }, 1200)
	});
		$('#question17').click(function() {
		$('html, body').animate({ scrollTop: $('.answer17').offset().top }, 1200)
	});
		$('#question18').click(function() {
		$('html, body').animate({ scrollTop: $('.answer18').offset().top }, 1200)
	});
});

/* captions thumbs */
$(document).ready(function () {
	$('#galeria_revestimentos > a').hover(
		function() {
			$(this).find('span.legenda_thumb').stop(false,true).slideToggle(200);
		},
		function() {
			$(this).find('span.legenda_thumb').stop(false,true).slideToggle(100);
		}
	);
	$('#galeria_obras > a').hover(
		function() {
			$(this).find('span.legenda_thumb').stop(false,true).slideToggle(200);
		},
		function() {
			$(this).find('span.legenda_thumb').stop(false,true).slideToggle(100);
		}
	);
	$('.galeria > a').hover(
		function() {
			$(this).find('span.legenda_thumb').stop(false,true).slideToggle(200);
		},
		function() {
			$(this).find('span.legenda_thumb').stop(false,true).slideToggle(100);
		}
	);
});

/* TOOLTIPS */
$(document).ready(function() {
	$('#selo_alafia').tooltip({
		effect: 'slide'
	});
});







