﻿(function(){fabric.Object.prototype.originX=fabric.Object.prototype.originY='center';var canvas=this.__canvas=new fabric.Canvas('c',{hoverCursor:'pointer',selection:false,perPixelTargetFind:true,targetFindTolerance:5,backgroundColor:null,});var mapImgUrl="/images/carframe.jpg"
fabric.Image.fromURL(mapImgUrl,function(currentImg){currentImg.set({scaleX:(canvas.width/815),scaleY:(canvas.height/606),top:0,left:0,originX:'left',originY:'top',opacity:1,width:815,height:606});canvas.setBackgroundImage(currentImg,canvas.renderAll.bind(canvas));});function AddRightLabelText(cityStar,cityName,gap,textColor,url){if($(window).width()>=768){cityStar.on('mousedown',function(){if(typeof cityText!=='undefined'){canvas.remove(cityText);}
cityText=new fabric.Text(cityName,{top:cityStar.top+2,left:cityStar.left+gap,fill:textColor,fontSize:18,fontWeight:'bold',fontStyle:'italic',fontFamily:'Roboto',selectable:false});canvas.add(cityText).renderAll();});cityStar.on('mouseover',function(){if(typeof cityText!=='undefined'){canvas.remove(cityText);}
cityText=new fabric.Text(cityName,{top:cityStar.top+2,left:cityStar.left+gap,fill:textColor,fontSize:18,fontWeight:'bold',fontStyle:'italic',fontFamily:'Roboto',selectable:false});canvas.add(cityText).renderAll();});}else{cityText=new fabric.Text(cityName,{top:cityStar.top+2,left:cityStar.left+gap,fill:textColor,fontSize:18,fontWeight:'bold',fontStyle:'italic',fontFamily:'Roboto',selectable:false});canvas.add(cityText).renderAll();}
canvas.add(cityStar).renderAll();}
function AddLeftLabelText(cityStar,cityName,gap,textColor,url){if($(window).width()>=768){cityStar.on('mousedown',function(){if(typeof cityText!=='undefined'){canvas.remove(cityText);}
cityText=new fabric.Text(cityName,{top:cityStar.top+2,left:cityStar.left-gap,fill:textColor,fontSize:18,fontWeight:'bold',fontStyle:'italic',fontFamily:'Roboto',selectable:false});canvas.add(cityText).renderAll();});cityStar.on('mouseover',function(){if(typeof cityText!=='undefined'){canvas.remove(cityText);}
cityText=new fabric.Text(cityName,{top:cityStar.top+2,left:cityStar.left-gap,fill:textColor,fontSize:18,fontWeight:'bold',fontStyle:'italic',fontFamily:'Roboto',selectable:false});canvas.add(cityText).renderAll();});}else{cityText=new fabric.Text(cityName,{top:cityStar.top+2,left:cityStar.left-gap,fill:textColor,fontSize:18,fontWeight:'bold',fontStyle:'italic',fontFamily:'Roboto',selectable:false});canvas.add(cityText).renderAll();}
canvas.add(cityStar).renderAll();}
fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"ACOUSTIC, THERMAL, AND ELECTRICAL INSULATION",243,"#0b2441","/");},{left:200,top:20,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:90});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"THERMAL MANAGEMENT",130,"#0b2441","/");},{left:160,top:60,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:90});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddLeftLabelText(star,"WINDOW SEAL ASSIST",113,"#0b2441","/");},{left:370,top:100,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"SUNGLASS HOLDER INSERTS",140,"#0b2441","/");},{left:500,top:100,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:180});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddLeftLabelText(star,"HOOD SHIELDS",82,"#0b2441","/");},{left:270,top:180,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddLeftLabelText(star,"TAIL LAMP SEALS",95,"#0b2441","/");},{left:750,top:145,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddLeftLabelText(star,"UNDER DASH NOISE CONTROL",144,"#0b2441","/");},{left:370,top:225,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"CUP HOLDER INSERTS",112,"#0b2441","/");},{left:500,top:210,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:180});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddLeftLabelText(star,"HVAC SEALS",72,"#0b2441","/");},{left:300,top:265,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"CONSOLE BIN MATS",102,"#0b2441","/");},{left:500,top:265,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:180});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"HEADLIGHT SEALS",98,"#0b2441","/");},{left:85,top:310,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:180});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddLeftLabelText(star,"UNDER BODY HEAT SHIELDS",135,"#0b2441","/");},{left:615,top:320,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"BINDING TAPE",80,"#0b2441","/");},{left:55,top:375,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:180});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddLeftLabelText(star,"FENDER TRIM TAPE",102,"#0b2441","/");},{left:510,top:365,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddLeftLabelText(star,"BATTERY SHIELDING",110,"#0b2441","/");},{left:215,top:405,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"ACRYLIC FOAM TAPE FASTENERS, PROTECTIVE FILMS",245,"#0b2441","/");},{left:340,top:455,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:180});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"BATTERY CELL SEPARATORS",140,"#0b2441","/");},{left:205,top:430,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:180});fabric.Image.fromURL('/images/arrow-icon.svg',function(star){AddRightLabelText(star,"BUZZ, SQUEAK, AND RATTLE",140,"#0b2441","/");},{left:400,top:565,selectable:false,hasControls:false,hasRotatingPoint:false,lockMovementX:true,lockMovementY:true,width:24,height:24,angle:270});var factor=$('#car-graphic').innerWidth()/canvas.width;if(factor<1){$('.car-canvas-wrapper').css("transform","scale("+factor+")");$('.graphic-canvas').height($('.car-canvas-wrapper').height()*factor);}
$(window).on('resize',function(){var factor=$('#car-graphic').innerWidth()/canvas.width;if(factor<1){$('.car-canvas-wrapper').css("transform","scale("+factor+")");$('.graphic-canvas').height($('.car-canvas-wrapper').height()*factor);}
else{$('.car-canvas-wrapper').css("transform","scale("+1+")");$('.graphic-canvas').height='auto';}});})();
;;;