var Vehicles={brand:"fiatusa",division:"X",model_years:{"2012":{fiat_500:{display:"FIAT 500",description:"2012 FIAT 500",active:1,myc:"CUX201201",base:"pop",trims:["pop","sport","lounge","gucci"],models:{pop:{ccode:"CUX201201FFFL24A",llp:"2DA",description:"2012 500 POP  ",display:"500 POP  ",trim:"pop",trim_display:"Pop",mpg:{hwy:"38",city:"30",disclaimer:"2012 EPA estimates w/ 1.4L engine, premium gasoline and 5-speed manual."},msrp:"15500",image_src:"http://images.ascchus.com/?IMG=EAL_IMAGES/2012\\images\\CC\\CC12_FFFL24_2DA_PYF_APA_XXX_XXX_XXX.png"},sport:{ccode:"CUX201201FFFH24A",llp:"2DD",description:"2012 500 SPORT ",display:"500 SPORT ",trim:"sport",trim_display:"Sport",mpg:{hwy:"38",city:"30",disclaimer:""},msrp:"17500",image_src:"http://images.ascchus.com/?IMG=EAL_IMAGES/2012\\images\\CC\\CC12_FFFH24_2DD_PR1_APA_XXX_XXX_XXX.png"},lounge:{ccode:"CUX201201FFFP24A",llp:"2DJ",description:"2012 500 LOUNGE  ",display:"500 LOUNGE  ",trim:"lounge",trim_display:"Lounge",mpg:{hwy:"34",city:"27",disclaimer:""},msrp:"19500",image_src:"http://images.ascchus.com/?IMG=EAL_IMAGES/2012\\images\\CC\\CC12_FFFP24_2DJ_PS2_APA_XXX_XXX_XXX.png"},gucci:{ccode:"CUX201201FFFP24B",llp:"2DK",description:"2012 500 GUCCI",display:"500 GUCCI",trim:"gucci",trim_display:"Gucci",mpg:{hwy:"34",city:"27",disclaimer:""},msrp:"23500",image_src:"http://images.ascchus.com/?IMG=EAL_IMAGES/2012\\images\\CC\\CC12_FFFP24_2DK_PXJ_APA_XXX_XXX_XXX.png"}}},fiat_500c:{display:"FIAT 500c",description:"2012 FIAT 500c",active:1,myc:"CUX201202",base:"pop",trims:["pop","lounge","gucci"],models:{pop:{ccode:"CUX201202FFFL27A",llp:"2DA",description:"2012 500c POP ",display:"500c POP ",trim:"pop",trim_display:"Pop",mpg:{hwy:"38",city:"30",disclaimer:"2012 EPA estimates w/ 1.4L engine, premium gasoline and 5-speed manual."},msrp:"19500",image_src:"http://images.ascchus.com/?IMG=EAL_IMAGES/2012\\images\\CC\\CC12_FFFL27_2DA_PYF_APA_XXX_M3A_XXX.png"},lounge:{ccode:"CUX201202FFFP27A",llp:"2DJ",description:"2012 500c LOUNGE ",display:"500c LOUNGE ",trim:"lounge",trim_display:"Lounge",mpg:{hwy:"32",city:"27",disclaimer:""},msrp:"23500",image_src:"http://images.ascchus.com/?IMG=EAL_IMAGES/2012\\images\\CC\\CC12_FFFP27_2DJ_PS2_APA_XXX_M3A_XXX.png"},gucci:{ccode:"CUX201202FFFP27B",llp:"2DK",description:"2012 500c GUCCI",display:"500c GUCCI",trim:"gucci",trim_display:"Gucci",mpg:{hwy:"32",city:"27",disclaimer:""},msrp:"27500",image_src:"http://images.ascchus.com/?IMG=EAL_IMAGES/2012\\images\\CC\\CC12_FFFP27_2DK_PXJ_APA_XXX_M3A_XXX.png"}}}}},getBaseModel:function(c){var a="";if(typeof(c.trim)!="undefined"&&c.trim!=""){var b=this.getAvailableModels(c);a=b[0];}else{a=this.model_years[c.year][c.vehicle].base;}return a;},getHighestModel:function(b){var a=this.getAvailableModels(b);return a[a.length-1];},getMSRP:function(b,a){if(typeof(b.model)=="undefined"||b.model==""){var c=this.model_years[b.year][b.vehicle].models[this.getBaseModel(b)].msrp;}else{var c=this.model_years[b.year][b.vehicle].models[b.model].msrp;}if(typeof(a)=="undefined"||a==""){if(c.length<=5){c="$"+c.replace(/(\d{2})/,"$1,");}else{c="$"+c.replace(/(\d{3})/,"$1,");}}return c;},getMPG:function(b,a){if(typeof(a)=="undefined"||a==""){a="hwy";}if(typeof(b.model)=="undefined"||b.model==""){return this.model_years[b.year][b.vehicle].models[this.getBaseModel(b)].mpg[a];}else{return this.model_years[b.year][b.vehicle].models[b.model].mpg[a];}},getImg:function(d,c,a){if(typeof(d.model)=="undefined"||d.model==""){d.model=this.getBaseModel(d);}var b=this.model_years[d.year][d.vehicle].models[d.model].image_src;if(typeof(a)!="undefined"||a!=""){b+="&HEIGHT="+a;}if(typeof(c)=="undefined"||c==""||c=="jpg"){return b;}else{if(c=="png"||c=="gif"||c=="bmp"){return b.replace(".jpg","."+c);}else{return"/shared/images/blank.gif";}}},getDescription:function(a){if(typeof(a.model)=="undefined"||a.model==""){return this.model_years[a.year][a.vehicle].description;}else{return this.model_years[a.year][a.vehicle].models[a.model].description;}},getDisplay:function(a){if(typeof(a.model)=="undefined"||a.model==""){return this.model_years[a.year][a.vehicle].display;}else{return this.model_years[a.year][a.vehicle].models[a.model].display;}},getTrimDisplay:function(c){var b="";if(typeof(c.model)!="undefined"&&c.model!=""){b=this.model_years[c.year][c.vehicle].models[c.model].trim_display;}else{for(var a in this.model_years[c.year][c.vehicle].models){if(this.model_years[c.year][c.vehicle].models[a].trim==c.trim){b=this.model_years[c.year][c.vehicle].models[a].trim_display;break;}}}return b;},getTrim:function(c){var a="";if(typeof(c.model)!="undefined"&&c.model!=""){a=this.model_years[c.year][c.vehicle].models[c.model].trim;}else{for(var b in this.model_years[c.year][c.vehicle].models){if(this.model_years[c.year][c.vehicle].models[b].trim==c.trim){a=this.model_years[c.year][c.vehicle].models[b].trim;break;}}}return a;},getCcode:function(a){return this.model_years[a.year][a.vehicle].models[a.model].ccode;},getLLP:function(a){return this.model_years[a.year][a.vehicle].models[a.model].llp;},getModelYearCode:function(a){return this.model_years[a.year][a.vehicle].myc;},getInventoryCode:function(b){if(typeof(b.model)=="undefined"||b.model==""){var a=this.model_years[b.year][b.vehicle].myc;}else{var a=this.model_years[b.year][b.vehicle].models[b.model].ccode;}return a.replace(/\bCU/,"IU");},getAvailableModels:function(c){var b=[];if(typeof(c.trim)!="undefined"&&c.trim!=""){for(var a in this.model_years[c.year][c.vehicle].models){if(this.model_years[c.year][c.vehicle].models[a].trim==c.trim){b.push(a);}}}else{for(var a in this.model_years[c.year][c.vehicle].models){b.push(a);}}return b;},getAvailableTrims:function(a){return this.model_years[a.year][a.vehicle].trims;},getAvailableYears:function(){var a=[];if((this.division=="T"||this.division=="J")&&/m\.[a-z]*\.com/.test(location.hostname)){a.push("2012");}else{for(var b in this.model_years){if(a.length>=2){break;}else{a.push(b);}}}return a;},getAvailableVehicles:function(b){var c=[];for(var a in this.model_years[b.year]){if(this.model_years[b.year][a].active==1){c.push(a);}}return c;},getDivision:function(){return this.division;},getBrand:function(){return this.brand;},getFamilyFromMYC:function(b){var a=this.model_years[b.substr(3,4)];var d="";for(var c in a){if(a[c].myc.substr(1)==b.substr(1)){d=c;break;}}return d;},getModelFromCcode:function(d){var c=this.getFamilyFromMYC(d.substr(0,9));var e=this.model_years[d.substr(3,4)][c].models;var b="";for(var a in e){if(e[a].ccode.substr(1)==d.substr(1)){b=a;break;}}return b;},getTrimFromCcode:function(c){var b=this.getFamilyFromMYC(c.substr(0,9));var a=this.getModelFromCcode(c);return this.model_years[c.substr(3,4)][b].models[a].trim;},getYearFromMYC:function(a){return a.substr(3,4);}};
