"use strict";if("undefined"===typeof(com)){var com}com=com||{};com.chevroleteurope=com.chevroleteurope||{};com.chevroleteurope.template=com.chevroleteurope.template||{};com.chevroleteurope.template.ModelGalleryColorizer=com.chevroleteurope.template.ModelGalleryColorizer||(function(){function a(c,b){if("string"===typeof(c)){this.url=c}if("string"===typeof(b)){this.name=b}return this}a.data=null;a.colorizerId="colorizer";a.colorizer=null;a.add=function(c,b){if(!(a.data instanceof Array)){a.data=[]}a.data.push(new a(c,b))};a.handleColorizerCall=function(d){var c=jQuery(this),b=c.data("model");jQuery("#boxColorThumbnailsContainer a.colours360Btn").removeClass("imgActive");c.addClass("imgActive");if(b instanceof a){b.handleColorizerCall()}d.returnValue=false;if(d.preventDefault){d.preventDefault()}return false};a.handleColorInit=function(c){var b=a.data[c];b.jThumb=jQuery(this).data("model",b).click(a.handleColorizerCall)};a.initColorizer=function(){a.colorizer=jQuery("#"+a.colorizerId).get(0);jQuery("#boxColorThumbnailsContainer a.colours360Btn:first").click()};a.initData=function(){jQuery("#boxColorThumbnailsContainer a.colours360Btn").each(a.handleColorInit);jQuery(window).bind("load",a.initColorizer)};a.prototype.url=null;a.prototype.name=null;a.prototype.jThumb=null;a.prototype.toString=function(){return"[object com.chevroleteurope.template.ModelGalleryColorizer]"};a.prototype.showColorName=function(){if(!(this.jThumb instanceof jQuery)){return}if("string"!==typeof(this.name)){return}var b=this.jThumb.position(),c=this.jThumb.offsetParent(),d=c.css("padding-left");c.css("float","left");d=d.split("px")[0];b.left-=d;if(0>b.left){b.left=0}jQuery("#colorsDescriptor").text(this.name).css("padding-left",(b.left+"px"))};a.prototype.showColor=function(){if("string"!==typeof(this.url)){return}a.colorizer.SetVariable("javaVar",this.url)};a.prototype.handleColorizerCall=function(){if("string"!==typeof(this.url)){return}if("string"!==typeof(this.name)){return}this.showColorName();this.showColor()};return a}());