$(document).ready(function(){

		$(".properties #search input:checked").each(function(){ //targets checks and radios
			$("label[for="+$(this).attr("id")+"]").addClass("active"); 
		});
		
		$(".properties #search input").hide();
		$(".properties #search input[type='submit']").show();
		$(".properties #search label").addClass("javascript");

			
		$(".properties #search .checkbox label").toggle(function(){ //checkboxes
				if($(this).hasClass("active")){
					thefor=$(this).attr("for");
					$(this).removeClass("active");
					$("input#"+thefor).attr("checked",false); 
				}
				else{
					thefor=$(this).attr("for");
					$(this).addClass("active"); 
					$("input#"+thefor).attr("checked",true);
				}
			},function(){
				if($(this).hasClass("active")){
					thefor=$(this).attr("for");
					$(this).removeClass("active"); 
					$("input#"+thefor).attr("checked",false);
				}
				else{
					thefor=$(this).attr("for");
					$(this).addClass("active"); 
					$("input#"+thefor).attr("checked",true);
				}
		});
			
			
		$(".properties #search .radio label").click(function(){ //radios
					$(this).parent().find("label").removeClass("active"); 
					$(this).addClass("active"); 
					$("input#"+$(this).attr("for")).attr("checked",true); 
		});
			
			
		$(".andup").each(function(){
			$(this).parent().find("span").eq(0).find("label").append('<span class="plus" style="display:none;margin-right:0px;">+</span>');
		});
		
		$(".andup input:checked").each(function(){ 
			$(this).parent().parent().find(".plus").show();
		});
		
		$(".andup label").toggle(function(){		
			labels=$(this).parent().parent().find("span").eq(0).find("label");
			if($(this).hasClass("active")){
					labels.find(".plus").show();
				}
			else{
				    labels.find(".plus").hide();
				} 	
			},function(){

			labels=$(this).parent().parent().find("span").eq(0).find("label");
			if($(this).hasClass("active")){
					labels.find(".plus").show();
				}
			else{
				    labels.find(".plus").hide();
				
				} 	
		});
		
});