// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function next_step(num){
	num_steps=6;
	for(i=1;i<num_steps;i++){
		$('step_'+i).hide();
	}
	$('step_'+num).show();
	//	$('home_lead_container').setStyle({
		//	  backgroundImage: 'url(/images/home_content_bg_homeleads_2.jpg)'
		//	});

	}
	function display_purchase(new_old){
		$('home_lead_estimated_closing_date').value='';$('home_lead_time_lived').value='';
		$('new_purchase_yes').hide();$('new_purchase_no').hide();
		$('new_purchase_'+new_old).show();
	}
	function single_display(tr,show_hide){
		show_hide=="show" ? $(tr).show() : $(tr).hide();

	}
	function show_other(id,val){
		my_el=$(id);
		my_el.down().value="";
		if(id=='other_deductible') 	{
			$('other_deductible_deductible').value='';
			$('home_lead_deductible_percent').value=false;
		}
		
		if(id=='other_roof_type')  $('other_roof_roof_type').value='';
		(val=="Other") ? my_el.show() : my_el.hide();
	}

	function show_garage_capacity(id,val){
		
	}


	function toggle_carrier_update_list(myvar){	

		my_ins = ["home","auto","life"];
		for(i=0;i<my_ins.length;i++){
			if(myvar=="edit"){
				$(my_ins[i]+'_carrier_show').hide();
				$(my_ins[i]+'_carrier_edit').show();
				$('carrier_submit').show();
			}else{
				$(my_ins[i]+'_carrier_show').show();
				$(my_ins[i]+'_carrier_edit').hide();
				$('carrier_submit').hide();

			}

		}
	}
	
	function toggle_vacation_update_list(myvar){	
		if(myvar=="edit"){
			$('vacation_show').hide();
			if($('past_days_error')!=null) $('past_days_error').hide();
			$('vacation_form').show();
		}else{
			$('vacation_show').show();
			$('vacation_form').hide();
			if($('past_days_error')!=null) $('past_days_error').hide();
		}
	}