function removeDisc(){
		
	if(_offers.length == 0 && $('incentive_disclaimers') && current_state != "/ForceZip"){
		$('incentive_disclaimers').remove();
	} else if($('incentive_disclaimers') && current_state != "/ForceZip"){
		$('incentive_disclaimers').remove();
	}
		
}


function homedisclaimer(){
	showDisclaimers();
	if(current_state == "/ForceZip"){
	var div = new Element('div');
	var def = new Element('dl');
	var yourprice = "[10] A different model may be shown.  Total price reflects eligibility of Government rebate program.  Residency restrictions apply.  See participating dealer for details.";
	var gov = "[11] The CARS program is a government run program and its rules are subject to change. Program runs through November 1, 2009 or when funds are exhausted, whichever comes first. You do not need a voucher, dealer will apply credit at time of purchase. The vehicle that you trade-in is required to be recycled and/or destroyed. Therefore, the value you negotiate with the dealer for your trade-in is not likely to exceed its scrap value. The law requires the dealer to disclose to you an estimate of the scrap value of your trade-in vehicle. Please see cars.gov for full rules and qualifications. Images shown may not represent actual vehicle and its options. Please see your local dealer for details regarding program eligibility.";
	def.clone().setProperty('id','incentive_disclaimers').injectInside('disclaimers').setHTML('<dt>&nbsp;</dt><dd>'+yourprice+'</dd><dt>&nbsp;</dt><dd>'+gov+'</dd>');
	}
}

//onload_register("homedisclaimer()")

window.addEvent('domready', function(){
	
	showDisclaimers();
	
	if(_selectedOffer || _offers.length == 0){
	// Run remove disc to check if no offers are available or if new vehicle was chosen
		removeDisc.periodical(3000);
	}
	if(_zip){
		populate_dealerInfo()
	}
	

	
		
			

	
	/*
	if(campaign.text != ""){
		if(current_state == "/ForceZip" && daaOffers.dma != "508" ){
			var div = new Element('div');	
			var def = new Element('dl');
			def.clone().setProperty('id','incentive_disclaimers').injectInside('disclaimers').setHTML('<dt>&nbsp;</dt><dd id="disc_list">[11] Based on MSRP less cash allowances and a dealer contribution which affect final price. Percentage off varies with model and equipment. Excludes all other offers. Financing for well-qualified buyers through Chrysler Financial. Not all buyers will qualify. See your participating dealer for details. Residency restrictions apply. Must take retail delivery by 9/30/2008.</dd>');
			//div.clone().setProperty('id','incentive_disclaimers').injectAfter('disclaimer_msrp').setHTML('<dd>[11] Based on MSRP less cash allowances and a dealer contribution which affect final price. Percentage off varies with model and equipment. Excludes all other offers. Financing for well-qualified buyers through Chrysler Financial. Not all buyers will qualify. See your participating dealer for details. Residency restrictions apply. Must take retail delivery by 9/30/2008.</dd>');
		}
	}
	*/
	
});



function offerDisc(){

	if($('incentive_disclaimers')){
		$('incentive_disclaimers').remove();		
	}
	
	// Display general disclaimer
	var disclaimer = "PLEASE REVIEW THESE IMPORTANT PRICING DISCLOSURES. <br /> The estimates provided are for informational purposes only and are not an offer to sell. Each estimate is based on the variables you have entered, on the Manufacturer's Suggested Retail Price, excluding tax  for the vehicle you have selected and on the available finance programs. All product illustrations, specifications and competitive comparisons are based upon current information at the time of publication approval.  Although descriptions are believed correct, complete accuracy cannot be guaranteed.  Chrysler Group LLC reserves the right to make changes at any time, without notice or obligation, in prices, specifications, equipment, colors and materials, and to change or discontinue models.  Some of the equipment shown or described throughout this website is available at extra cost and/or may be subject to late availability.  See your dealer for the latest information.";	
	var div = new Element('div');
	var def = new Element('dl');
	def.clone().setProperty('id','incentive_disclaimers').injectInside('disclaimers').setHTML('<dt>&nbsp;</dt><dd id="disc_list">'+disclaimer+'</dd>');	
		
	var disclaimers = "";	
	
	// APR Table 
	var aprTable = '<table cellspacing="0" cellpadding="2" id="apr_table"><tbody><tr><td class="title">APR RATE</td><td class="title">36 Months</td><td class="title">48 Months</td><td class="title">60 Months</td><td class="title">72 Months</td></tr><tr><td>0.0%</td><td>$27.78</td><td>$20.83</td><td>$16.67</td><td>$13.89</td></tr><tr class="highlight"><td>1.9%</td><td>$28.60</td><td>$21.65</td><td>$17.48</td><td>$14.71</td></tr><tr><td>2.9%</td><td>$29.04</td><td>$22.09</td><td>$17.92</td><td>$15.15</td></tr><tr class="highlight"><td>3.9%</td><td>$29.48</td><td>$22.53</td><td>$18.37</td><td>$15.60</td></tr><tr><td>4.9%</td><td>$29.93</td><td>$22.98</td><td>$18.83</td><td>$16.06</td></tr><tr class="highlight"><td>5.9%</td><td>$30.38</td><td>$23.44</td><td>$19.29</td><td>$16.53</td></tr><tr><td>6.9%</td><td>$30.83</td><td>$23.90</td><td>$19.75</td><td>$17.00</td></tr></tbody></table>';
	
	if(_selectedOffer != null || _offers != null){	
	
	if(_selectedOffer.disclaimers){
		for(d = 0; d < _selectedOffer.disclaimers.length; d++){
			disclaimers += _selectedOffer.disclaimers[d] + "<br />";
		}
	}
	
	
		if(_tab == "purchase"){	
			
			// Switch based on what the selected offer is at the highest level
			
			if(_selectedOffer.sentence){
				if(_selectedOffer.sentence.contains('Gas') == true){
					disclaimers += "<br />[1] Buy or lease a new, eligible vehicle and pay $2.99 per gallon for a maximum number of gallons (which varies depending on model) for up to 12,000 miles in each of the next 3 years. VISA/MASTERCARD credit card required. 87 octane gas or diesel fuel only.  Allow 6 weeks for activation. Excludes Wrangler, Wrangler Unlimited, SRT and all other offers.";
				}		
			}
			
			
			if(_selectedOffer instanceof CustomOffer){
				
				var customDisclaimer = _selectedOffer.disclaimer;
				
				disclaimers += customDisclaimer;
				
			} else if (_selectedOffer instanceof Offer) {
				
				var otherCashes = _selectedOffer.incentives.incentive;			
			
				if(_selectedOffer.savingsTotal == 0){
			 	
					var names = otherCashes.$name;
					//var value = otherCashes[i].$value;
					// For individual cashes that require a disclaimer, add individual
				
					switch(names){					
						case 'lease_loyalty':
								disclaimers += "<br />[4] Customer must be current lessee of Chrysler group product to qualify.  Residency restrictions apply.  See dealer for details.";
						break;
						case 'owner_loyalty_cash':
								disclaimers += "<br />[4] Customer must be current owner/lessee of Chrysler group product to qualify.  Residency restrictions apply.  See dealer for details.";
						break;						
						case 'gmac_bonus_cash':
							disclaimers += "<br />[6] GMAC bonus cash when financed or leased through GMAC. Not all buyers will qualify.  Residency restrictions apply.  See dealer for details.";
						break;	
						case 'conquest_cash':
							disclaimers += "<br />&para; When financed through Chrysler Financial. See dealer for details.";		
						break;
					}
				
				
				} else {			
			
					for(i=0; i < otherCashes.length; i++){
				
						var names = otherCashes[i].$name;
						//var value = otherCashes[i].$value;
						// Lease tab disclaimers
					
						switch(names){						
							case 'lease_loyalty':
								disclaimers += "<br />[4] Customer must be current lessee of Chrysler group product to qualify.  Residency restrictions apply.  See dealer for details.";
						break;
						case 'owner_loyalty_cash':
								disclaimers += "<br />[4] Customer must be current owner/lessee of Chrysler group product to qualify.  Residency restrictions apply.  See dealer for details.";
						break;
							case 'gmac_bonus_cash':
							disclaimers += "<br />[6] GMAC bonus cash when financed or leased through GMAC. Not all buyers will qualify.  Residency restrictions apply.  See dealer for details.";
						break;	
							case 'conquest_cash':
								disclaimers += "<br />&para; When financed through Chrysler Financial. See dealer for details.";		
							break;						
						}
					
					}
			
				}
				
			}
			
			switch (_selectedOffer.kind){
				case 'Cash_Allowance':
					disclaimers += "";
				break;
				case 'Standard_APR':				
				case 'Combo':				
				case 'Combo_APR':
					disclaimers += "<br />[5] For well-qualified buyers. Not all Buyers will qualify for the lowest rates. Must receive financing through GMAC.  See dealer for details.  Monthly charge per $1000 financed. Example down payment is 10%:";
					disclaimers += "<br /><br />" + aprTable;
				break;
			}		
			
			
					
		
		} else {	
		
		if(_selectedOffer.sentence){
			if(_selectedOffer.sentence.contains('Gas') == true){
				disclaimers += "<br />[1] Buy or lease a new, eligible vehicle and pay $2.99 per gallon for a maximum number of gallons (which varies depending on model) for up to 12,000 miles in each of the next 3 years. VISA/MASTERCARD credit card required. 87 octane gas or diesel fuel only.  Allow 6 weeks for activation. Excludes Wrangler, Wrangler Unlimited, SRT and all other offers.";
			}		
		}
		
			if (_selectedOffer instanceof Offer) {
		
				var otherCashes = _selectedOffer.incentives.incentive;			
			
				if(_selectedOffer.savingsTotal == 0){
			 	
					var names = otherCashes.$name;
					//var value = otherCashes[i].$value;
					// If there is not an array of cashes 
				
					switch(names){					
						case 'lease_loyalty':
								disclaimers += "<br />[4] Customer must be current lessee of Chrysler group product to qualify.  Residency restrictions apply.  See dealer for details.";
							break;
							case 'owner_loyalty_cash':
								disclaimers += "<br />[4] Customer must be current owner/lessee of Chrysler group product to qualify.  Residency restrictions apply.  See dealer for details.";
							break;
						case 'gmac_bonus_cash':
							disclaimers += "<br />[6] GMAC bonus cash when financed or leased through GMAC. Not all buyers will qualify.  Residency restrictions apply.  See dealer for details.";
						break;	
						case 'conquest_cash':
							disclaimers += "<br />&para; When financed through Chrysler Financial. See dealer for details.";		
						break;						
					}
				
				
				} else {			
			
					for(i=0; i < otherCashes.length; i++){
				
						var names = otherCashes[i].$name;
						//var value = otherCashes[i].$value;
						// If array of cashes is found
					
						switch(names){
							case 'lease_loyalty':
								disclaimers += "<br />[4] Customer must be current lessee of Chrysler group product to qualify.  Residency restrictions apply.  See dealer for details.";
							break;
							case 'owner_loyalty_cash':
								disclaimers += "<br />[4] Customer must be current owner/lessee of Chrysler group product to qualify.  Residency restrictions apply.  See dealer for details.";
							break;
							case 'gmac_bonus_cash':
							disclaimers += "<br />[6] GMAC bonus cash when financed or leased through GMAC. Not all buyers will qualify.  Residency restrictions apply.  See dealer for details.";
						break;
							case 'conquest_cash':
								disclaimers += "<br />&para; When financed through Chrysler Financial. See dealer for details.";		
							break;					
						}
					
					}
			
				}
			
			}
		
		}
		
		var disc = new Element('dd').setProperty('id','unique_disc').injectInside('incentive_disclaimers').setHTML(disclaimers);		
	
	} else {
	
		if($('incentive_disclaimers')){
			$('incentive_disclaimers').remove();
				
		}
	
	}

}
	
	
	
	
		
