﻿$(document).ready(function() {
		
	//$("body").bind("contextmenu", function() { return false; });

	/*se for ie6, carrega menu por js e roda o pngfix
	if($.browser.msie && $.browser.version=="6.0") {
		$.getScript("inc/js/jquery.pngfix.js",function(xhr){
			var aplicar_pngfix = "";
			try {
				$(aplicar_pngfix).pngfix();
			} catch(err) {
				eval(xhr);
				$(aplicar_pngfix).pngfix();
			}
		});
	}*/

	/*labelify
	$.getScript("inc/js/jquery.labelify.js",function(xhr){
		var aplicar_labelify = "#busca .codigo";
		try {
			$(aplicar_labelify).labelify();
		} catch(err) {
			eval(xhr);
			$(aplicar_labelify).labelify();
		}
	});*/
	
	//menu
	$("#menu").lavaLamp({
		fx: "backout",
		speed: 700,
		//click: function(event, menuItem) { return false; }
	});	
	
	//animacao
	if ($("#animacao").length>0) {
		$('#animacao').loopedSlider({
			autoStart: 10000,
			restart: 10000,
			containerClick: false,
			addPagination: true
		});
	}

	//tooltips
	if ($(".tooltip").length>0) {
		$(".tooltip").tooltip({ 
			track: true, 
			delay: 0, 
			showURL: false, 
			showBody: " - ", 
			fade: 250 
		});
	}
	
	//portfolio
	$('.work').hover(function(){
		$(".work-label", this).stop().animate({top:'-60px'},{queue:false,duration:200});
	}, function() {
		$(".work-label", this).stop().animate({top:'60px'},{queue:false,duration:200});
	});
	

	//rolagem
	$('.subir').click(function(){
		$('html, body').animate({scrollTop:0}, 1000);
	});
	
	$('.voltar').click(function(){
		//history.go(-1);
		window.location='./';
	});	
	
	//tabelas no orçamento
	if ($(".orcamento").length>0) {
		$(".tbl td a.ec").click(function(){
			var desc = $(this).parents("td").find(".desc");
			if (desc.length>0) {
				if (desc.is(":hidden")) {
					desc.slideDown(700);
					$(this).addClass("open");
				} else {
					desc.slideUp(700);
					$(this).removeClass("open");
				}
			}
			return false;
		});
		$(".tbl td .check").click(function(){
			var $input = $(this).find("input[type=checkbox]");
			if ($input.is(":checked")) {
				$input.attr("checked",false);
				$(this).removeClass("checked");
			} else {
				$input.attr("checked",true);
				$(this).addClass("checked");
			}
		    Soma();
			//orcamento
			//if ($("select#usuarios").val()!='') { Soma(); }else{ alert("É necessário selecionar a quantidade de usuários para o Vista.Imobi."); }
			
		});
	}
	
	//orcamento
	$(".tbl td select").change(function() { Soma(); });
		
	
});



