var mds_vc_ErrorController;
mds_vc_ErrorController=new mds_vc_ErrorController();
function mds_vc_ErrorController(){var F=null;
var I=null;
var K=true;
var H=mrm.$;
var L="mds-vc-timeout-layer";
var M="mds-vc-error-layer";
var B="mds_vc_";
var J="ui-helper-hidden-accessible";
var E="ui-no-titlebar ui-vc-dialog-01";
var D="mds-vc-error-code";
this.init=function(){var P=H("#"+M);
F=P.dialog({bgiframe:true,resizable:false,width:"auto",position:"center",minWidth:P.width(),minHeight:P.height(),zIndex:5999,draggable:false,modal:true,closeOnEscape:false,autoOpen:false,dialogClass:E});
F.removeClass(J);
var Q=H("#"+L);
I=Q.dialog({bgiframe:true,resizable:false,width:"auto",position:"center",minWidth:Q.width(),minHeight:Q.height(),zIndex:4999,draggable:false,modal:true,closeOnEscape:false,autoOpen:false,dialogClass:E});
I.removeClass(J);
};
this.error=function(R,Q,P){if(K==true){if(P!=undefined&&P!="undefined"&&P!=null){Q+=" ["+P.name+" in line "+P.line+", "+P.sourceURL+", "+P.number+"]";
this.log(P,true);
}if(R==503){this.log(Q);
return N((mrm.conf.app.vc.log.console==true)?R:null);
}else{if((R==0||R==504||R.toString().substr(0,1)==4)&&mds_vc_startURL!=undefined&&mds_vc_startURL!="undefined"&&mds_vc_startURL!=null){this.log(Q);
return O();
}else{if(R==999||R.toString().substr(0,1)==5){this.log(Q);
return C((mrm.conf.app.vc.log.console==true)?R:null);
}else{this.log("ERROR: Undefined error was thrown to ErrorController.");
return false;
}}}}else{this.log("ERROR: Sorry, ErrorController does not accept further errors.");
return true;
}};
this.log=function(S,Q){var R=S;
if(Q!=true){R="["+B+"] "+S;
}if(mrm.conf.app.vc.log.console==true){try{if(mrm.util!=undefined){mrm.util.log(R);
}else{if(console!=undefined){try{console.log(R);
}catch(P){}}}}catch(P){}}};
function G(){K=false;
if(mds_vc_ViewController!=undefined){mds_vc_ViewController=null;
}return true;
}function C(P){var Q=G();
if(P!=null&&P!=undefined&&P!=""){H("."+D,F).append("<span>&nbsp;(Code "+P+")</span>");
}F.dialog("open");
A(F);
return Q;
}function O(){location.replace(mds_vc_startURL.replace(/&amp;/g,"&"));
}function N(P){var Q=G();
if(P!=null&&P!=undefined&&P!=""){H("."+D,I).append("<span>&nbsp;(Code "+P+")</span>");
}I.dialog("open");
A(I);
return Q;
}function A(P){P.dialog("option","position",P.dialog("option","position"));
}}
mrm.app.mds=mrm.app.mds||{};
mrm.app.mds.vc=mrm.app.mds.vc||{};
(function(A){mrm.app.mds.vc.ViewController=function(){var T=new Object();
var Q=new Object();
var E=0;
var O="";
var C=false;
var I="";
var K="mds-vc-cmp-";
var F="mds-vc-sel-cfg-ev";
var H="mds-vc-sel-ssn-ev";
var V="mds-vc-sel-cfg-in";
var P="mds-vc-disabled";
var D=mds_vc_baseURL;
var S="updateSelection";
var L="updateView";
var J="updatePriceCalculation";
var M=300;
var R=(180*1000)/M;
var W="mds-app-byo";
var N="mds-vc-step-";
var U=null;
var B="mds-vc-cfg-ctr";
var G=false;
this.init=function(){U=A("#"+W);
_disableSelections();
U.bind("VC_CMP_DataRefresh",A.proxy(this.onCmpDataRefresh,this));
U.bind("VC_CMP_UpdateComplete",A.proxy(this.onCmpUpdateComplete,this));
U.bind("VC_CMP_ConfigChange",A.proxy(this.onCmpConfigChange,this));
U.bind("VC_UI_Refresh",_refreshOnConfigurationChange);
A("#"+B).bind("submit",function(X){X.preventDefault();
});
_bindConfigurationChangeEvents();
this.initView();
};
this.initView=function(){var X=window.mds_vc_curViewId;
var Y=mds_vc_DeeplinkController.get();
if(X){this.activateViews(X);
if(Y&&Y!=X&&this.viewIsAccessible(Y)){X=Y;
_pushViewChange(X,true);
}else{_setActive();
G=true;
_setStepClass(X);
_refreshOnInit(X);
}mds_vc_ProgressBar.init(X);
mds_vc_DeeplinkController.init(X);
}else{mds_vc_ErrorController.error(999,"EXCEPTION: Current viewId unknown.");
mds_vc_ErrorController.log("ERROR: ViewController: Application could not be initialized while current viewId is missing.");
}};
this.activateViews=function(X){var a=window.mds_vc_latViewId;
var Y=mrm.conf.app.vc.view;
if(Y){if(!a){window.mds_vc_latViewId=X;
}var Z=Y[a];
if(Z){A.each(Y,function(){if(this.orderNo<=Z.orderNo){this.active=true;
}});
}}};
this.onCmpConfigChange=function(X,Y){if(Y!=undefined&&Y!=null&&Y!="undefined"&&Y!=""){_pushConfigurationChange(true,Y);
}};
this.changeView=function(X){_pushViewChange(X,false);
};
this.registerComponent=function(Z,Y){if(typeof (Y)!="object"){throw"Component must be an object";
}var a=_getDomIdOfComponent(Z);
var X=_getProviderUrlOfComponent(Z);
Y.setDomId(a);
Y.setCmpId(Z);
Y.setContext(A("#"+a));
if(X!==null){Y.setProviderUrl(X);
}_pushCmpStack(Z,Y);
};
this.onCmpDataRefresh=function(d,c){if(c.isViewChange!=true){try{Q[c.cmpId].data=c;
Q[c.cmpId].event=d;
var f=0;
var Y=false;
A.each(Q,function(){if(this.updated==undefined){if(this.prio>f){f=this.prio;
Y=false;
}if(f==this.prio&&Q[this.id].data==null){Y=true;
}}});
var b=f;
A.each(Q,function(){if(this.updated==undefined){if(this.prio<f&&this.prio<=b&&Q[this.id].data!=null){b=this.prio;
}if(this.prio>=b&&Q[this.id].data==null){b=f;
}}});
var X=this;
if(f>0&&!Y){var Z,c,a;
A.each(Q,function(){c=Q[this.id].data;
a=Q[this.id].event;
if(this.prio<=f&&this.prio>=b&&this.data!=null&&Q[this.id].updated==undefined){Q[this.id].updated=true;
Z=_componentFromRegister(c.cmpId);
if(!c.error&&!c.notModified){mds_vc_ErrorController.log("INFO: ViewController: Trigger component["+c.cmpId+"] to update["+this.prio+"] ...");
Z.update(c.isViewChange);
}else{X.onCmpUpdateComplete(a,c);
if(c.notModified){mds_vc_ErrorController.log("WARNING: ViewController: Updating component "+c.cmpId+" ("+this.prio+") skipped because not modified.");
}else{mds_vc_ErrorController.log("WARNING: ViewController: Updating component "+c.cmpId+" ("+this.prio+") skipped because of error.");
}}}else{mds_vc_ErrorController.log("INFO: ViewController: The component "+this.id+" ("+this.prio+") must wait on components with higher priorities ("+b+":"+f+").");
}});
}else{mds_vc_ErrorController.log("INFO: ViewController: Current component "+c.cmpId+" ("+Q[c.cmpId].prio+") must wait on components with same priority.");
}}catch(d){mds_vc_ErrorController.error(999,"EXCEPTION: ViewController.onCmpDataRefresh: Probably a competing access to prioStack caused an error.",d);
}}else{if(!c.error&&!c.notModified){mds_vc_ErrorController.log("INFO: ViewController: Component ["+c.cmpId+"] triggered to update with isViewChange.");
Z=_componentFromRegister(c.cmpId);
Z.update(true);
}else{this.onCmpUpdateComplete(a,c);
if(c.notModified){mds_vc_ErrorController.log("WARNING: ViewController: Updating component "+c.cmpId+" skipped because not modified.");
}else{mds_vc_ErrorController.log("WARNING: ViewController: Updating component "+c.cmpId+" skipped because of error.");
}}}};
this.onCmpUpdateComplete=function(d,c){mds_vc_ErrorController.log("INFO: ViewController: Receive component["+c.cmpId+"] updated message.");
if(c.isViewChange==true){E--;
if(E<=0&&mrm.conf.app.vc&&window.mds_vc_curViewId){try{var Y=mrm.conf.app.vc.view[O];
var X=mrm.conf.app.vc.view[window.mds_vc_curViewId];
var a;
A.each(Y.component,function(e,f){if(!_isCmpIncludedInView(X,e)){mds_vc_ErrorController.log("INFO: ViewController: Try to hide Component "+e+".");
a=_componentFromRegister(e);
a.showComponent(false);
}});
A.each(X.component,function(e,f){if(!_isCmpIncludedInView(Y,e)){mds_vc_ErrorController.log("INFO: ViewController: Try to show Component "+e+".");
a=_componentFromRegister(e);
a.showComponent(true);
}});
E=0;
_enableSelections();
mds_vc_ProgressBar.update(window.mds_vc_curViewId);
mds_vc_DeeplinkController.set(window.mds_vc_curViewId);
}catch(d){mds_vc_ErrorController.error(999,"EXCEPTION: Probably concurring access to lastView.",d);
}}}else{try{delete Q[c.cmpId];
if(A.isEmptyObject(Q)){if(G){G=false;
_checkCmpVisibility(window.mds_vc_curViewId);
}mds_vc_ProgressBar.updateNextSteps(window.mds_vc_curViewId);
_setInactive();
var b=0;
function Z(){if(E<=0){_enableSelections();
}else{window.setTimeout(function(){if(b<R){Z();
mds_vc_ErrorController.log("INFO: ViewController: Waited "+(M*b)+"ms on other components (updating after view change) before re-enabling selections.");
}b++;
},M);
}}Z();
}}catch(d){mds_vc_ErrorController.error(999,"EXCEPTION: ViewController: Probably a competing access to prioStack caused an error.",d);
}}};
this.viewIsAccessible=function(X){var Y=mrm.conf.app.vc.view;
var Z=false;
if(Y[X]!=undefined&&Y[X]!=null){if(Y[X].active){Z=true;
}else{var b=0;
var a=999;
A.each(Y,function(){if(this.active){if(this.orderNo>b){b=this.orderNo;
}}if(!this.active){if(this.orderNo<a){a=this.orderNo;
}}});
if(Y[X].orderNo<=b||Y[X].orderNo==a){Z=true;
}}}return Z;
};
this.getFirstViewId=function(a){var Y=mrm.conf.app.vc.view;
var X=null;
if(Y!=undefined&&Y!=null){var Z=null;
A.each(Y,function(){if(this.orderNo<Z||Z==null){if(a!=true||(a==true&&A("#"+this.button.domId).length>0)){Z=this.orderNo;
X=this.viewId;
}}});
}return X;
};
this.getLastViewId=function(){var Y=mrm.conf.app.vc.view;
var X=null;
if(Y!=undefined&&Y!=null){var Z=null;
A.each(Y,function(){if(this.orderNo>Z||firstNo==null){Z=this.orderNo;
X=this.viewId;
}});
}return X;
};
_configurationChangeHandler=function(Y){var X=A(Y.target);
var Z=!(X.is(":checkbox")&&!X.is(":checked"));
var a=X.val();
_pushConfigurationChange(Z,a);
};
_sessionChangeHandler=function(Y){var X=A(Y.target);
var a=X.is(":checkbox")?X.is(":checked"):X.val();
var Z=X.attr("name");
_pushSessionChange(Z,a);
};
_setView=function(X,c){try{var Y=mrm.conf.app.vc.view[window.mds_vc_curViewId];
var Z=mrm.conf.app.vc.view[X];
if(Y&&Z){var b=false;
_updateViewState(X);
if(c){_refreshOnInit(X);
}else{_refreshOnViewChange(X);
b=_mustCmpCacheBeFlushed(Y,Z);
}_insertCmpsOnViewChange(Z,Y,b);
if(E<=0){mds_vc_ProgressBar.update(X);
mds_vc_DeeplinkController.set(X);
}}}catch(a){mds_vc_ErrorController.error(999,"EXCEPTION: Probably concurring access to lastView in _setView.",a);
}};
_updateViewState=function(X){O=window.mds_vc_curViewId;
window.mds_vc_curViewId=X;
var Z=mrm.conf.app.vc.view[X];
var Y=mrm.conf.app.vc.view[window.mds_vc_latViewId];
if(Y){if(Y.orderNo<Z.orderNo){window.mds_vc_latViewId=X;
}}if(!Z.active){mrm.conf.app.vc.view[X].active=true;
}};
_mustCmpCacheBeFlushed=function(X,Y){var c=false;
if(X.orderNo<Y.orderNo){c=true;
var Z=new Object();
var b=0;
A.each(mrm.conf.app.vc.view,function(e,d){if(d.orderNo>X.orderNo&&d.orderNo<=Y.orderNo){A.each(d.component,function(f,g){if(typeof (Z[f])!="undefined"){Z[f].cnt++;
}else{Z[f]={cnt:1,id:f};
}});
b++;
}});
A.each(Y.component,function(d,e){if(!_isCmpIncludedInView(X,d)){delete Z[d];
}});
var a;
A.each(Z,function(){if(this.cnt<b){a=_componentFromRegister(this.id);
a.flushCache();
}});
}return c;
};
_isCmpIncludedInView=function(X,Y){return Boolean(X.component[Y]);
};
_checkCmpVisibility=function(X){var Y=_getCmpsOfView(X);
if(Y!=null){A.each(T,function(Z,a){if(A.inArray(this.getCmpId(),Y)>=0){a.showComponent(true);
}else{a.showComponent(false);
}});
}else{mds_vc_ErrorController.error(999,"EXCEPTION: Current viewId or configuration unknown.");
}};
_getCmpsOfView=function(Y){var Z=null;
try{var X=mrm.conf.app.vc.view[Y];
Z=[];
A.each(X.component,function(b,c){Z.push(b);
});
}catch(a){mds_vc_ErrorController.error(999,"EXCEPTION: viewId or configuration unknown.",a);
}return Z;
};
_bindConfigurationChangeEvents=function(c){var a="change.vc_configurationChangeHandler";
var Z="change.vc_sessionChangeHandler";
U.delegate("."+F,a,_configurationChangeHandler).delegate("."+H,Z,_sessionChangeHandler);
if(A.browser.msie){var b,X;
var Y=(c!=undefined)?A("#"+_getDomIdOfComponent(c)):"";
b=A("input."+F+", select."+F,Y);
X=A("input."+H+", select."+H,Y);
A.each(A.merge(A.makeArray(X),A.makeArray(b)),function(){var e=A(this);
if(this.tagName=="SELECT"){e=A(this).children();
}var d="click.vc_blurFix";
e.unbind(d).bind(d,function(){this.blur();
});
});
}};
_pushConfigurationChange=function(Y,X){var Z=_disableSelections();
if(A.browser.msie&&Z!=0||!A.browser.msie){_setActive();
_ajaxDefault();
var a={"featureSelection":X};
if(!Y){a={"featureDeselection":X};
}A.ajax({url:D+S,data:JSON.stringify(a),success:function(){_configurationChangeCallback();
},error:function(b,d,c){_requestError(b,d);
}});
}};
_configurationChangeCallback=function(){mds_vc_ErrorController.log("INFO: ViewController: _configurationChangeCallback finished.");
_refreshOnConfigurationChange();
};
_pushSessionChange=function(X,Z){_disableSelections();
_setActive();
_ajaxDefault();
var Y="{'"+X+"': '"+Z+"'}";
A.ajax({url:D+J,data:Y,success:function(){_sessionChangeCallback();
},error:function(a,c,b){_requestError(a,c);
}});
};
_sessionChangeCallback=function(){mds_vc_ErrorController.log("INFO: ViewController: _sessionChangeCallback finished.");
_refreshOnConfigurationChange();
};
_pushViewChange=function(X,d){_setStepClass(X);
var Z=0;
var Y=false;
var c=Math.floor(Math.random()*101*Math.random());
I=c;
mds_vc_ErrorController.log("INFO: ViewController: View change triggered ("+X+", "+c+")");
function b(){if((c!=I||Z>=R)&&!Y){Y=true;
b();
}else{if((_isActive()||_getViewChangeCmpCount()>0)&&!Y){Z++;
window.setTimeout(function(){mds_vc_ErrorController.log("INFO: ViewController: View change request ("+c+") waited "+(M*Z)+"ms while others are in progress.");
b();
},M);
}else{a(Y);
}}}b();
function a(e){if(!e){_doViewChangeCall(X,d);
}else{mds_vc_ErrorController.log("WARNING: ViewController: Old request was killed while new started (or waiting timed out).");
}}};
_doViewChangeCall=function(X,b){_disableSelections();
var Z=mrm.conf.app.vc.view;
if(window.mds_vc_latViewId&&X&&Z){var Y=Z[window.mds_vc_latViewId];
var a=Z[X];
if(Y&&a){window.mds_vc_latViewId=X;
_ajaxDefault();
A.ajax({url:D+L,data:JSON.stringify({"viewId":window.mds_vc_latViewId}),success:function(){_viewChangeCallback(X,b);
},error:function(d,f,e){var c=d.status;
if(f=="parsererror"||c==undefined||c=="undefined"||c==null){c=999;
}else{if(f=="timeout"){c=408;
}}mds_vc_ErrorController.error(c,"ERROR: ViewController: Got HTTP response with "+f+" (Error "+c+")");
mds_vc_ErrorController.log("ERROR: ViewController: _pushViewChange failed with "+f+".");
}});
}}};
_viewChangeCallback=function(X,Y){mds_vc_ErrorController.log("INFO: ViewController: _viewChangeCallback finished.");
_setView(X,Y);
};
_refreshOnConfigurationChange=function(){var X=mrm.conf.app.vc.view[window.mds_vc_curViewId];
var Y;
if(X){try{Q=new Object();
A.each(X.component,function(a,b){if(b.priority>0){Y=_componentFromRegister(a);
Q[a]={prio:b.priority,id:a,data:null,event:null};
mds_vc_ErrorController.log("INFO: ViewController: Component "+a+" was triggered to refresh.");
Y.refresh();
}});
if(A.isEmptyObject(Q)){_setInactive();
_enableSelections();
}}catch(Z){mds_vc_ErrorController.error(EXCEPTION,"ERROR: Probably a competing access to prioStack generated an error.",Z);
}}};
_refreshOnViewChange=function(X){var Y=mrm.conf.app.vc.view[X];
try{Q=new Object();
var Z;
A.each(Y.component,function(b,c){if(c.onViewChange!=true){return true;
}Z=_componentFromRegister(b);
Q[b]={prio:1,id:b,data:null,event:null};
mds_vc_ErrorController.log("INFO: ViewController: Component ["+b+"] was triggered to change view.");
Z.refresh();
});
}catch(a){mds_vc_ErrorController.error(EXCEPTION,"ERROR: Probably a competing access to prioStack generated an error.",a);
}};
_refreshOnInit=function(X){var Y=mrm.conf.app.vc.view[X];
var Z;
Q=new Object();
A.each(Y.component,function(a,b){if(b.onInit!=true){return true;
}Z=_componentFromRegister(a);
Q[a]={prio:1,id:a,data:null,event:null};
mds_vc_ErrorController.log("INFO: ViewController: Component "+a+" was triggered to init");
Z.init();
});
if(A.isEmptyObject(Q)){_setInactive();
_enableSelections();
}};
_insertCmpsOnViewChange=function(Y,X,Z){E=0;
A.each(Y.component,function(b,c){if(!_isCmpIncludedInView(X,b)){mds_vc_ErrorController.log("INFO: ViewController: Try to insert Component ["+b+"] in _setView.");
var a=_componentFromRegister(b);
a.insert(Z);
E++;
}});
};
_pushCmpStack=function(Y,X){if(typeof (Y)!="undefined"&&typeof (X)!="undefined"&&typeof (T[Y])=="undefined"){T[Y]=X;
}};
_requestError=function(Z,Y){var X=Z.status;
if(Y=="parsererror"||X==undefined||X=="undefined"||X==null){X=999;
}else{if(Y=="timeout"){X=408;
}}mds_vc_ErrorController.error(X,"EXCEPTION: Got HTTP response with "+Y+" (Error "+X+")");
mds_vc_ErrorController.log("ERROR: ViewController: Request failed with "+Y);
};
_setStepClass=function(X){mrm.util.removeClassRegex(U,RegExp(N+".*"));
U.addClass(N+X);
};
_getDomIdOfComponent=function(Y){var Z=null;
var X=mrm.conf.app.vc.components;
if(X[Y]&&X[Y].domId){Z=X[Y].domId;
}return Z;
};
_getProviderUrlOfComponent=function(Z){var X=null;
var Y=mrm.conf.app.vc.components;
if(Y[Z]&&Y[Z].providerUrl){X=Y[Z].providerUrl;
}return X;
};
_componentFromRegister=function(Y){var X=T[Y];
if(typeof (X)=="object"){return X;
}else{mds_vc_ErrorController.log("WARNING: ViewController: can not find component "+Y+" to hide in _setView.");
mds_vc_ErrorController.error(999,"EXCEPTION: ViewContoller could not find component "+Y);
}};
_ajaxDefault=function(){A.ajaxSetup({global:false,type:"POST",contentType:"application/json; charset=utf-8"});
};
_isActive=function(){return C;
};
_setActive=function(){C=true;
};
_setInactive=function(){C=false;
};
_getViewChangeCmpCount=function(){return E;
};
_disableSelections=function(){mds_vc_ErrorController.log("INFO: ViewController: Disabling all selections for current view ("+window.mds_vc_curViewId+").");
var Y=0;
var X=_getCmpsOfView(window.mds_vc_curViewId);
U.addClass(P);
var a,Z;
A.each(X,function(){a=_getDomIdOfComponent(this);
if(a!=null){Z=A("input."+F+":not([disabled]), select."+F+":not([disabled])",A("#"+a));
Y+=Z.length;
Z.prop("disabled",true);
Z=A("."+V+":not([disabled])",A("#"+a));
Y+=Z.length;
Z.prop("disabled",true).addClass(P);
Z=A("input."+H+":not([disabled]), select."+H+":not([disabled])",A("#"+a));
Y+=Z.length;
Z.prop("disabled",true).addClass(P);
}});
mds_vc_ErrorController.log("INFO: ViewController: Disabled "+Y+" selections.");
return Y;
};
_enableSelections=function(){mds_vc_ErrorController.log("INFO: ViewController: Enabling all selections available with special disabled state.");
var X=0;
U.removeClass(P);
var Y=A("."+H+"."+P+"[disabled]");
X+=Y.length;
Y.prop("disabled",false).removeClass(P);
Y=A("."+V+"."+P+"[disabled]");
X+=Y.length;
Y.prop("disabled",false).removeClass(P);
Y=A("."+F+"."+P+", ."+H+"."+P+", ."+V+"."+P);
X+=Y.length;
Y.removeClass(P);
if(mrm.util.ie()){window.focus();
}mds_vc_ErrorController.log("INFO: ViewController: Enabled "+X+" selections available with special disabled state.");
};
};
})(jQuery);

var mds_vc_ProgressBar;
mds_vc_ProgressBar=new mds_vc_ProgressBar();
function mds_vc_ProgressBar(){var J="mds-vc-btn-nextstep";
var B="#/{s}/";
var E="{s}";
var L="ui-state-active";
var C="ui-state-highlight";
var K="ui-state-disabled";
var I="ui-helper-hidden";
var G=mrm.$;
this.init=function(M){H();
D(M);
A(M);
};
this.update=function(M){D(M);
A(M);
};
this.updateNextSteps=function(M){A(M);
};
function H(){var N=mrm.conf.app.vc.view;
var M=mrm.conf.app.vc.view[mds_vc_curViewId];
var O;
if(N&&M){G.each(N,function(){O=G("#"+this.button.domId);
O.removeAttr("onclick").unbind("click").click(function(){return false;
});
var P=B.replace(E,this.viewId);
if(P!=O.attr("href")){O.attr("href",P);
}});
}G("."+J).removeAttr("onclick").unbind("click").click(function(){return false;
});
}function D(Q){var N=mrm.conf.app.vc.view;
var M=mrm.conf.app.vc.view[Q];
var P=0;
if(N&&M){var O;
G.each(N,function(){O=G("#"+this.button.domId);
if(O.length>0){if((this.orderNo<M.orderNo)||(M.orderNo<this.orderNo&&this.active)){var R=this.viewId;
O.unbind("click").click(function(){F(R);
return false;
});
O.removeClass(C+" "+L+" "+K);
mds_vc_ErrorController.log("INFO: ProgressBarController: Button "+this.button.domId+" gets clickable.");
if(this.orderNo>=P){P=this.orderNo;
}}if(this==M){O.unbind("click").click(function(){return false;
});
O.removeClass(C+" "+K).addClass(L);
mds_vc_ErrorController.log("INFO: ProgressBarController: Button "+this.button.domId+" gets highlighted.");
P=this.orderNo;
}}else{mds_vc_ErrorController.log("INFO: ProgressBarController: Update skipped for "+this.viewId+", no button found.");
}});
G.each(N,function(){O=G("#"+this.button.domId);
if(O.length>0){if(P<this.orderNo&&!this.active){var R=this.viewId;
O.unbind("click").click(function(){F(R);
return false;
});
O.removeClass(C+" "+K).addClass(C);
mds_vc_ErrorController.log("INFO: ProgressBarController: Button "+this.button.domId+" gets next clickable.");
return false;
}}else{mds_vc_ErrorController.log("INFO: ProgressBarController: Update skipped for "+this.viewId+", no button found.");
}});
}else{mds_vc_ErrorController.log("ERROR: ProgressBarController: Configuration and/or current viewId not available.");
}}function A(Q){var O=Q;
var N=mrm.conf.app.vc.view;
var M=N[Q].orderNo;
var P=999;
if(M&&N){G.each(N,function(){if(this.orderNo>M&&this.orderNo<=P){P=this.orderNo;
}});
G.each(N,function(){if(this.orderNo==P){O=this.viewId;
return false;
}});
}G.each(G("."+J),function(){if(O!=Q){G(this).removeClass(I);
G(this).attr("href",B.replace(E,O));
G(this).unbind("click").click(function(){F(O);
return false;
});
}else{G(this).addClass(I);
}});
}function F(M){if(mds_vc_ViewController!=null&&mds_vc_ViewController!=undefined){mds_vc_ViewController.changeView(M);
}}}
var mds_vc_DeeplinkController;
mds_vc_DeeplinkController=new mds_vc_DeeplinkController();
function mds_vc_DeeplinkController(){var B=mrm.$;
var A=false;
var C="";
this.init=function(D){if(!A&&B.address.pathNames()[0]==undefined){this.set(D);
C=D;
}var E=D;
var F=this;
B.address.change(function(H){var I=B.address.pathNames()[0];
var J=mds_vc_curViewId;
if(J){if(E!=""&&E!=null){J=E;
}if(C!=""&&C!=null&&B.address.pathNames()[0]==undefined){I=C;
}if(mds_vc_ViewController!=null&mds_vc_ViewController!=undefined){var G=mds_vc_ViewController.viewIsAccessible(I);
if(!A&&I!=undefined&&I!=J&&G){mds_vc_ViewController.changeView(I);
}else{if(!G){F.set(J);
}}}}A=false;
E=null;
});
};
this.set=function(D){A=true;
B.address.value(D);
A=false;
};
this.get=function(){var E=B.address.pathNames()[0];
var D=mds_vc_curViewId;
if(E!=undefined&&E!="undefined"&&E!=""&&E!=null){return E;
}else{if(D){return D;
}else{return null;
}}};
}
var AbstractComponent;
(function(A){AbstractComponent=A.inherit({PROVIDER_BASE_URL:mds_vc_baseURL,PROVIDER_URL:"",INSERT_CACHE:false,HIDE_CSS_CLASS:"ui-helper-hidden",HIDE_ACC_CLASS:"ui-helper-hidden-accessible",EVENT_CSS_CLASS:"mds-vc-sel-cfg-ev",OPTION_CTR_CLASS:"mds-vc-sel-cfg-ctr",PARENT_CTR_CLASS:"mds-vc-sel-par",OPTION_GRP_CLASS:"mds-vc-sel-cfg-grp",OPTION_SCOPE_CLASS:"mds-vc-sel-cfg-scp",DISABLED_ID_CLASS:"mds-vc-disabled",PROTOTYPE_ID_CLASS:"mds-vc-prototype",IMG_PRELOAD_ANI_PROTO:"mds-vc-img-preload-proto",IMG_PRELOAD_ANI_CLASS:"mds-app-vc_imgzoom_loader",FILTER_SEL_CLASS:"mds-vc-flt-sel",FILTER_CNT_CLASS:"mds-vc-flt-cnt",FILTER_DEFAULT_INDEX:"-1",TOGGLE_CNT_CLASS:"mds-vc-sel-toggle-cnt",TOGGLE_LNK_CLASS:"mds-vc-sel-toggle",TOGGLE_CTR_CLASS:"mds-vc-sel-toggle-ctr",INFO_CNT_CLASS:"mds-vc-info-ctr",INFO_CNT_ID_PREFIX:"mds-vc-info-",TAB_ROW_CLASS:"mds-vc-tab-row",TAB_CTR_CLASS:"mds-vc-tab-ctr",TAB_ITM_CLASS:"mds-vc-tab-itm",TAB_CNT_CLASS:"mds-vc-tab-cnt",IMG_ZOOM_DLG_CLASS:"mds-vc-img-zoom-dlg",IMG_ZOOM_LNK_CLASS:"mds-vc-img-zoom-lnk",IMG_ZOOM_CLS_CLASS:"mds-vc-img-zoom-cls",SELECTED_STATE:"SELECTED",FORCED_STATE:"SELECTED_FORCED",FIXED_STATE:"SELECTED_FIX",DEFAULT_STATE:"SELECTED_DEFAULT",DISABLED_STATE:"DISABLED",DISABLED_DEFAULT_STATE:"DEFAULT_NOT_SELECTABLE",REPLACED_STATE:"DEFAULT_REPLACED",REMOVED_STATE:"REMOVED",SELECTED_CLASS:"ui-state-highlight",HOVER_CLASS:"ui-state-hover",ACTIVE_CLASS:"ui-state-active",DISABLED_CLASS:"ui-state-disabled blocked",REPLACED_CLASS:"ui-state-disabled replaced",INCLUDED_CLASS:"ui-state-disabled included",PRICE_VALUE_CLASS:"mds-vc-price-value",SUB_PRICE_VALUE_CLASS:"mds-vc-price-sub-value",CONFLICT_TTL_SEPARATOR:"##",TITLE_TOOLTIP_REPLACED:"ui-title-replaced",DIALOG_NO_TITLE:"ui-no-titlebar",APPEND_DELAY:200,VC_STATE_CLASS_PREFIX:"mds-vc-state-",VC_DOM_ID:"mds-app-byo",_dataObject:null,_domId:"",_cmpId:"",_zoomDialogs:null,_htmlCached:false,_$ctx:null,__constructor:function(){this.__construct();
},__construct:function(){},showComponent:function(B){if(B){this._$ctx.removeClass(this.HIDE_CSS_CLASS);
this._$ctx.trigger("VC_CMP_Show");
}else{this._removeLoadAnis();
this._$ctx.addClass(this.HIDE_CSS_CLASS);
}},update:function(B){if(this._dataObject!=null){if(this._dataObject.type=="json"){this._updateJSON(B);
}else{this._updateHTML(B);
}}},refresh:function(){this._requestProvider(true,false,null);
},insert:function(B){if(B==true&&this.INSERT_CACHE){this.flushCache();
}if(this._htmlCached&&this.INSERT_CACHE){this._requestProvider(true,false,true);
}else{this._requestProvider(false,true,true);
}},init:function(){this._requestProvider(true,false,null);
},setDomId:function(B){this._domId=B;
},getDomId:function(){return this._domId;
},setCmpId:function(B){this._cmpId=B;
},getCmpId:function(B){return this._cmpId;
},setProviderUrl:function(B){this.PROVIDER_URL=B;
},setContext:function(B){this._$ctx=B;
},onOptionChange:function(D){var B;
var C=this;
if(A("."+this.OPTION_GRP_CLASS,this._$ctx).length>0){B=A("."+this.OPTION_GRP_CLASS,this._$ctx);
}else{B=A(D).parents("."+this.OPTION_CTR_CLASS).parent();
}A.each(A("."+this.OPTION_CTR_CLASS,B),function(){A(this).removeClass(C.SELECTED_CLASS);
});
A(D).parents("."+this.OPTION_CTR_CLASS).addClass(this.SELECTED_CLASS);
},onOptionHover:function(C,B){if(B==true){A(C).addClass(this.HOVER_CLASS);
}else{A(C).removeClass(this.HOVER_CLASS);
}},filter:function(E,C,D){if(E!="undefined"&&E!=undefined&&E!=null){C=A(this._getEventTarget(E)).find("option:selected").val();
}if(C==null||C==undefined||C=="undefined"||C==""){C=this.FILTER_DEFAULT_INDEX;
}var B=this;
if(D==undefined||D=="undefined"||D==null){if(E!="undefined"&&E!=undefined&&E!=null&&A("."+this.OPTION_SCOPE_CLASS,this._$ctx).length>0){D=A(this._getEventTarget(E)).parents("."+this.OPTION_SCOPE_CLASS);
}else{D=this._$ctx;
}}A.each(A("."+this.FILTER_CNT_CLASS,D),function(F){if(F==C||C==B.FILTER_DEFAULT_INDEX){if(A(this).hasClass(B.HIDE_CSS_CLASS)){A(this).removeClass(B.HIDE_CSS_CLASS);
}if(C!=B.FILTER_DEFAULT_INDEX&&A("."+B.EVENT_CSS_CLASS+"[checked]",A(this)).length==0){A("."+B.EVENT_CSS_CLASS+":first",A(this)).prop("checked",true).trigger("change");
}}else{if(!A(this).hasClass(B.HIDE_CSS_CLASS)){A(this).addClass(B.HIDE_CSS_CLASS);
}}});
},information:function(B){A("#"+this.INFO_CNT_ID_PREFIX+A(B).attr("id")).removeClass(this.HIDE_CSS_CLASS).siblings("."+this.INFO_CNT_CLASS).addClass(this.HIDE_CSS_CLASS);
},updateTabs:function(C){var B=this;
var D=null;
A.each(A("."+B.TAB_ROW_CLASS,this._$ctx),function(){A.each(A("."+B.TAB_ITM_CLASS,A(this)),function(E){if(!A(this).not(A(B._getEventTarget(C))).length){D=E;
return false;
}});
});
A("."+this.TAB_ITM_CLASS,A("."+this.TAB_ROW_CLASS,this._$ctx)).parents("."+this.TAB_CTR_CLASS).removeClass(this.ACTIVE_CLASS);
A("."+this.TAB_ITM_CLASS+":eq("+D+")",A("."+this.TAB_ROW_CLASS,this._$ctx)).parents("."+this.TAB_CTR_CLASS).addClass(this.ACTIVE_CLASS);
if(A("."+this.TAB_CNT_CLASS+":eq("+D+")",this._$ctx).length==0){A("."+this.TAB_CNT_CLASS,this._$ctx).removeClass(B.HIDE_CSS_CLASS);
}else{A("."+this.TAB_CNT_CLASS+":lt("+D+")",this._$ctx).addClass(this.HIDE_CSS_CLASS);
A("."+this.TAB_CNT_CLASS+":eq("+D+")",this._$ctx).removeClass(this.HIDE_CSS_CLASS);
A("."+this.TAB_CNT_CLASS+":gt("+D+")",this._$ctx).addClass(this.HIDE_CSS_CLASS);
}},toggleDetails:function(B){var C=A(this._getEventTarget(B)).parents("."+this.TOGGLE_CTR_CLASS);
if(C.length>0){C.toggleClass(this.ACTIVE_CLASS);
}},zoomImage:function(C){var D=this._zoomDialogs[A("."+this.EVENT_CSS_CLASS,A(this._getEventTarget(C)).parents("."+this.OPTION_CTR_CLASS)).attr("id")];
if(D!=undefined&&D!=null){D.dialog("open");
var B=A("img",D);
B.preload(this._getLoadAniClone(),this.HIDE_ACC_CLASS).attr("src",B.attr("rel")).removeAttr("rel");
}},closeZoom:function(C){var B=this._zoomDialogs[C];
if(B!=undefined&&B!="undefined"&&B!=null){A(B).dialog("close");
}},flushCache:function(){this._htmlCached=false;
mds_vc_ErrorController.log("INFO: Component: Cache flushed for component "+this._cmpId);
},_updateJSON:function(B){},_updateHTML:function(E){var B=false;
if(this._dataObject.payload){this._$ctx.after("<div></div>");
var D=this._$ctx.next("div").addClass(this.HIDE_CSS_CLASS).append(this._dataObject.payload);
var C=D.children("div[id]");
if(C.length==1){this._hookHTML(E,C);
this._$ctx.empty().append(C.children());
D.remove();
this._afterUpdate(E,true);
this._sendUpdatedMessage(E);
}else{B=true;
D.remove();
}}else{B=true;
}if(B){this._sendUpdatedMessage(E);
mds_vc_ErrorController.error(999,"EXCEPTION: Components HTML payload is corrupt.");
}},_hookHTML:function(C,B){},_afterUpdate:function(C,B){if(B==true){this._addLocalEvents();
}},_updateOptionJSON:function(G){if(this._dataObject.payload){if(this._dataObject.payload.featureSelectionSet!=null&&this._dataObject.payload.featureSelectionSet!=undefined){var B=this;
var C,F,E,D;
A.each(this._dataObject.payload.featureSelectionSet.featureSelection,function(){C=this["selection-control-id"];
F=this["selection-state"];
E=this["selection-conflict"];
D=this.formatted_price;
var H=null;
if(E!=null&&E!=undefined&&E!="undefined"){H="";
if(E.conflictDescription!=undefined&&E.conflictDescription!=null){H=E.conflictDescription;
}else{A.each(E,function(I){if(I>0){H+=B.CONFLICT_TTL_SEPARATOR;
}H+=this.conflictDescription;
});
}}B._updateOption(C,F,D,H);
if(this.subFeatureSelection!=null&&this.subFeatureSelection!="undefined"&&this.subFeatureSelection!=undefined){A.each(this.subFeatureSelection,function(){C=this["selection-control-id"];
F=this["selection-state"];
E=this["selection-conflict"];
D=this.formatted_price;
var I=null;
if(E!=null&&E!=undefined&&E!="undefined"){I="";
if(E.conflictDescription!=undefined&&E.conflictDescription!=null){I=E.conflictDescription;
}else{A.each(E,function(J){if(J>0){I+=B.CONFLICT_TTL_SEPARATOR;
}I+=this.conflictDescription;
});
}}B._updateOption(C,F,D,I,null,true);
});
}});
}else{mds_vc_ErrorController.error(999,"EXCEPTION: Components payload corrupt.");
}}else{mds_vc_ErrorController.error(999,"EXCEPTION: Components payload corrupt.");
}this._sendUpdatedMessage(G);
},_updateSelectionJSON:function(F){if(this._dataObject.payload){if(this._dataObject.payload.featureSelectionSet!=null&&this._dataObject.payload.featureSelectionSet!=undefined){var B=this;
var C,E,D;
A.each(this._dataObject.payload.featureSelectionSet.featureSelection,function(){C=this["selection-control-id"];
E=this["selection-state"];
D=this.formatted_price;
B._updateSelection(C,E,D);
if(this.subFeatureSelection!=null&&this.subFeatureSelection!=undefined){A.each(this.subFeatureSelection,function(){C=this["selection-control-id"];
E=this["selection-state"];
D=this.formatted_price;
B._updateSelection(C,E,D);
});
}});
}else{mds_vc_ErrorController.error(999,"EXCEPTION: Components payload corrupt.");
}}else{mds_vc_ErrorController.error(999,"EXCEPTION: Components payload corrupt.");
}this._sendUpdatedMessage(F);
},_updateOption:function(G,C,H,I,D,B){var F=null;
if(typeof (G)=="object"){F=G;
}else{F=A("#"+G);
}if(F.length){var J=null;
if(D!=null&&D!=undefined){J=F.parents("."+D+":eq(0)");
}else{J=F.parents("."+this.OPTION_CTR_CLASS+":eq(0)");
}if(I==undefined||I==null){I="";
}J.removeClass(this.DISABLED_CLASS+" "+this.REPLACED_CLASS+" "+this.INCLUDED_CLASS+" "+this.SELECTED_CLASS);
switch(C){case this.SELECTED_STATE:J.addClass(this.SELECTED_CLASS);
F.removeAttr("title").prop("checked",true).prop("disabled",false);
break;
case this.DISABLED_STATE:case this.DISABLED_DEFAULT_STATE:J.addClass(this.DISABLED_CLASS);
F.attr("title",I).prop("checked",false).prop("disabled",true);
break;
case this.REPLACED_STATE:J.addClass(this.REPLACED_CLASS);
F.removeAttr("title").prop("checked",false).prop("disabled",true);
break;
case this.FORCED_STATE:case this.FIXED_STATE:case this.DEFAULT_STATE:J.addClass(this.INCLUDED_CLASS);
F.removeAttr("title").prop("checked",true).prop("disabled",true);
break;
case this.REMOVED_STATE:F.removeAttr("title").prop("checked",false).prop("disabled",true);
break;
default:F.removeAttr("title").prop("checked",false).prop("disabled",false);
break;
}if(C!=this.FIXED_STATE&&C!=this.DEFAULT_STATE&&C!=this.DISABLED_DEFAULT_STATE&&C!=this.REPLACED_STATE){var E=(B==true)?this.SUB_PRICE_VALUE_CLASS:this.PRICE_VALUE_CLASS;
this._updatePrice(A("."+E,J),H);
}}},_updateSelection:function(C,F,E,B){var G=(typeof (C)=="object")?C:this._$ctx.find("#"+C);
if(G.length){var D=null;
if(B!=null&&B!=undefined){D=G.parents("."+B+":eq(0)");
}else{D=G.parents("."+this.OPTION_CTR_CLASS+":eq(0)");
}switch(F){case this.SELECTED_STATE:case this.FORCED_STATE:case this.FIXED_STATE:case this.DEFAULT_STATE:D.removeClass(this.DISABLED_CLASS+" "+this.REPLACED_CLASS+" "+this.INCLUDED_CLASS).addClass(this.SELECTED_CLASS);
G.removeAttr("title").prop("checked",true).prop("disabled",false);
break;
case this.DISABLED_STATE:case this.DISABLED_DEFAULT_STATE:D.removeClass(this.SELECTED_CLASS+" "+this.REPLACED_CLASS+" "+this.INCLUDED_CLASS).addClass(this.DISABLED_CLASS);
G.attr("title",title).prop("checked",false).prop("disabled",true);
break;
case this.REPLACED_STATE:D.removeClass(this.DISABLED_CLASS+" "+this.SELECTED_CLASS+" "+this.INCLUDED_CLASS).addClass(this.REPLACED_CLASS);
G.removeAttr("title").prop("checked",false).prop("disabled",true);
break;
default:D.removeClass(this.DISABLED_CLASS+" "+this.SELECTED_CLASS+" "+this.REPLACED_CLASS+" "+this.INCLUDED_CLASS);
G.removeAttr("title").prop("checked",false).prop("disabled",false);
break;
}this._updatePrice(A("."+this.PRICE_VALUE_CLASS,D),E);
}},_updatePrice:function(B,C){if(B.length==1){if(C!=undefined&&C!="undefined"&&C!=null){if(B.text()!=C){B.text(C);
}}else{B.text("");
}}},_requestProvider:function(G,F,I){var H,B;
var C=this;
var E=false;
if(F){H="html";
B={"outputType":"xhtml"};
}else{if(G){H="json";
B={"outputType":"json"};
}else{E=true;
}}var D=JSON.stringify(B);
if(!E){A.ajax({global:false,type:"POST",url:this.PROVIDER_BASE_URL+this.PROVIDER_URL,dataType:H,contentType:"application/json; charset=utf-8",data:D,success:function(J,K){J={"payload":J,"type":H};
C._requestCallback(J,I,false,false);
},error:function(K,N,M){var L=false;
if(N=="notmodified"){L=true;
}C._requestCallback(null,I,true,L);
var J=K.status;
if(N=="parsererror"||J==undefined||J=="undefined"||J==null){J=999;
}else{if(N=="timeout"){J=408;
}}if(!L){mds_vc_ErrorController.error(J,"EXCEPTION: Got HTTP response with "+N+" (Error "+J+")");
}mds_vc_ErrorController.log("ERROR: Component: "+C._cmpId+"._requestProvider throws 'error' with "+N);
}});
}else{mds_vc_ErrorController.log("ERROR: Application state is crashed, change view!");
mds_vc_ErrorController.error(999,"EXCEPTION: Invalid response type requested by a component.");
}},_requestCallback:function(D,E,B,C){if(!B){this._dataObject=D;
if(D.type=="html"){this._htmlCached=true;
}}mds_vc_ErrorController.log("INFO: Component: "+this._cmpId+"._requestCallback finished with isViewChange=="+E+" and error=="+B);
this._$ctx.trigger("VC_CMP_DataRefresh",{"cmpId":this._cmpId,"isViewChange":E,"error":B,"notModified":C});
},_sendUpdatedMessage:function(B){this._$ctx.trigger("VC_CMP_UpdateComplete",{"cmpId":this._cmpId,"isViewChange":B});
},_addLocalEvents:function(){var B=this;
A("."+this.EVENT_CSS_CLASS,this._$ctx).unbind("change").change(function(){B.onOptionChange(this);
});
},_getEventTarget:function(C){if(!C){return false;
}var B=C.target||C.srcElement;
return B;
},_setCmpState:function(C){var B=A("#"+this.VC_DOM_ID);
mrm.util.removeClassRegex(B,RegExp(this.VC_STATE_CLASS_PREFIX+this._cmpId+"-.*"));
if(C!=""){B.addClass(this.VC_STATE_CLASS_PREFIX+this._cmpId+"-"+C);
}},_toggleDetails:function(E,H){var G=A(E).parents("."+this.TOGGLE_CTR_CLASS);
var B=A("."+this.TOGGLE_CTR_CLASS,this._$ctx);
var C=-1;
var F=false;
A.each(B,function(I){if(!A(this).not(G).length){C=I;
return false;
}});
if(C>=0){var D=A("."+this.TOGGLE_CNT_CLASS+":eq("+C+")",this._$ctx);
if(G.hasClass(this.ACTIVE_CLASS)&&H!=true){if(!D.hasClass(this.ACTIVE_CLASS)){D.addClass(this.ACTIVE_CLASS);
}}else{if(D.hasClass(this.ACTIVE_CLASS)||H==true){D.removeClass(this.ACTIVE_CLASS);
}}}},_initFilter:function(B,D){if(D==null||D==undefined||D=="undefined"){D=this._$ctx;
}var F=A("."+this.FILTER_SEL_CLASS,D);
var E=null;
if(B!=null){E=B;
A("option[value="+B+"]",F).prop("selected",true);
}else{if(F.length>0){var C=F.find("option:selected");
if(C.length>0){if(C.val()!=E){E=C.val();
}}}if(E==null){E=this.FILTER_DEFAULT_INDEX;
}}this.filter(null,E,D);
},_initZooms:function(){var B=this;
var E,C,D;
this._zoomDialogs={};
A.each(A("."+this.EVENT_CSS_CLASS,this._$ctx),function(){D=A("."+B.IMG_ZOOM_DLG_CLASS,A(this).parents("."+B.OPTION_CTR_CLASS));
if(D.length>0){E=A(this).attr("id");
C=D.dialog({bgiframe:true,resizable:false,zIndex:3999,draggable:false,modal:true,width:"auto",autoOpen:false,dialogClass:B.DIALOG_NO_TITLE});
B._zoomDialogs[E]=C;
var F=E;
A("."+B.IMG_ZOOM_CLS_CLASS,C).click(function(){return false;
}).click(function(){B.closeZoom(F);
});
}});
},_killZooms:function(){if(this._zoomDialogs!=undefined&&this._zoomDialogs!="undefined"&&this._zoomDialogs!=null){A.each(this._zoomDialogs,function(){A(this).dialog("destroy").remove();
});
this._zoomDialogs=null;
}},_getSelectedOption:function(B){return A(B).find("option:selected").html();
},_getSelectedIndex:function(B){return A(B).prop("selectedIndex");
},_getLoadAniClone:function(){return A("#"+this.IMG_PRELOAD_ANI_PROTO).clone().removeAttr("id");
},_removeLoadAnis:function(B){var C=A(document.body);
if(B!=undefined&&B!=null){if(B.jquery){C=B;
}}A("."+this.IMG_PRELOAD_ANI_CLASS+":not([id="+this.IMG_PRELOAD_ANI_PROTO+"])",C).remove();
},_checkScope:function(B){if(B==undefined||B=="undefined"||B==null){B=this._$ctx;
}return B;
}},{});
})(jQuery);

var AbstractCompareComponent;
(function(A){AbstractCompareComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"",CFG_CONTAINER:"mds-vc-cfg-ctr",VFILTER_TBL_CLASS:"mds-vc-vflt-tbl",VFILTER_TBL_ID_PREFIX:"mds-vc-vflt-tbl-",VFILTER_THEAD_CLASS:"mds-vc-vflt-thead",VFILTER_SELECT_ROW_CLASS:"mds-vc-vflt-row",_lockChanges:true,_dataSetArray:new Array(),_footPrice:new Array(),_footLinks:new Array(),_maxCount:4,_dataSetNames:new Array(),_setChangedAfterKeyDown:false,init:function(){this._requestProvider(false,true,null);
},showComponent:function(B){var C=A("#"+this._domId);
if(B){this._lockChanges=false;
C.removeClass(this.HIDE_CSS_CLASS);
A("#"+this.CFG_CONTAINER).addClass(this.HIDE_CSS_CLASS);
}else{A("#"+this.CFG_CONTAINER).removeClass(this.HIDE_CSS_CLASS);
C.addClass(this.HIDE_CSS_CLASS);
}},selectContinue:function(C){if(this._lockChanges!=true){var D=A(this._getEventTarget(C)).attr("rel");
if(D!=undefined&&D!="undefined"&&D!=null&&D!=""){D=D.substring(0,D.length-1);
this._lockChanges=true;
this._$ctx.trigger("VC_CMP_ConfigChange",D);
}var B=A(this._getEventTarget(C)).attr("href");
if(B!=undefined&&B!="undefined"&&B!=null&&B!=""){window.setTimeout(function(){location.href=B;
},200);
}}},_afterUpdate:function(F,E){this.__base(F,E);
if(E==true){var C=this;
var D=A("#"+this._domId);
var B;
A("."+this.VFILTER_TBL_CLASS,D).each(function(G){A(this).attr("id",C.VFILTER_TBL_ID_PREFIX+G);
B=A(this).find("tbody:first").find("tr:first").children("th").length-1;
if(B>C._maxCount){C._startFilter(A(this));
}});
this._bindSelectContinue();
}},_bindSelectContinue:function(){var B=this;
var C=A("#"+this._domId);
A("a."+this.EVENT_CSS_CLASS,C).unbind("click").click(function(){return false;
}).click(function(D){B.selectContinue(D);
});
},_addLocalEvents:function(){this.__base();
var B=this;
A("."+this.FILTER_SEL_CLASS,A("#"+this._domId)).unbind("change").change(function(C){B.filter(C);
});
},_startFilter:function(B){try{this._buildTrims(B);
this._setDropdown(B);
this._checkTrimCount(B);
}catch(C){mds_vc_ErrorController.error(999,"EXCEPTION: AbstractCompareComponent: Possibly mrm.util not available.");
}},_buildTrims:function(C){var B=this;
this._dataSetArray[C.attr("id")]=new Array();
C.find("tbody").each(function(E){var D=0;
B._dataSetArray[C.attr("id")][E]=new Array();
A(this).find("tr:first").find("th").each(function(F){if(F>0){B._dataSetArray[C.attr("id")][E][D]=new Array();
D++;
}});
});
C.find("tbody").each(function(D){A(this).children("tr").not("."+B.VFILTER_THEAD_CLASS).each(function(E){A(this).find("td").each(function(F){B._dataSetArray[C.attr("id")][D][F][E]=A(this).html();
});
});
});
},_setDropdown:function(B){if(B.find("tbody").find("tr:first").children("th").length-1>this._maxCount){if(B.find("table:first").find("thead").length<=0){B.find("table:first").children().eq(0).before("<thead></thead>");
}A("."+this.VFILTER_SELECT_ROW_CLASS,B).removeClass(this.HIDE_CSS_CLASS);
var C=this._getTrimNames(B);
mrm.util.fillSelect(B.find("."+this.VFILTER_SELECT_ROW_CLASS+" select"),C);
}this._setDropdownFunctionality(B);
},_checkTrimCount:function(D){var C=this;
var B=D.find("tbody:first ."+C.VFILTER_THEAD_CLASS).children("th").length-1;
if(B>this._maxCount){this._showOnly(D,"thead",3);
this._showOnly(D,"tbody",3);
this._showOnly(D,"tfoot",3);
this._emptyCol(D,3);
this._setDefaultTrims(D);
}},_getTrimNames:function(E){var C=this;
var B=new Array();
this._footPrice[E.attr("id")]=new Array();
this._footLinks[E.attr("id")]=new Array();
B.push("&nbsp;");
this._dataSetNames[E.attr("id")]=new Array();
var D=0;
E.find("tbody:first ."+C.VFILTER_THEAD_CLASS+":first th").each(function(F){if(F!=0){if((F<E.find("tbody:first ."+C.VFILTER_THEAD_CLASS+":first th").length)&&(E.find("tfoot").find("tr").length>0)){C._footPrice[E.attr("id")][E.find("tbody:first ."+C.VFILTER_THEAD_CLASS+":first th:eq("+(D+1)+")").text()]=E.find("tfoot").find("tr:eq(0)").find("td:eq("+D+")").html();
C._footLinks[E.attr("id")][E.find("tbody:first ."+C.VFILTER_THEAD_CLASS+":first th:eq("+(D+1)+")").text()]=E.find("tfoot").find("tr:eq(1)").find("td:eq("+D+")").html();
}if(D>=0){B.push(A(this).text());
C._dataSetNames[E.attr("id")][E.find("tbody:first ."+C.VFILTER_THEAD_CLASS+":first th:eq("+(D+1)+")").text()]=A(this).html();
}D++;
}});
return B;
},_setDropdownFunctionality:function(C){var B=this;
C.find("select").each(function(D){A(this).bind("change",function(F){var E=A(F.target).find("option[selected]").attr("value");
B._fillAfterChange(C,E,D);
});
});
},_emptyCol:function(D,C){var B=this;
D.find("tbody").find("tr").each(function(){if((!A(this).find("td:eq("+(C-1)+")").attr("colspan"))||(A(this).find("td:eq("+(C-1)+")").attr("colspan")==1)){A(this).find("td:eq("+(C-1)+")").html("");
}});
D.find("tbody").each(function(){A(this).find("."+B.VFILTER_THEAD_CLASS).each(function(){A(this).children().each(function(E){if(E==C){A(this).html("");
}});
});
});
D.find("tfoot").find("tr").each(function(){A(this).find("td").each(function(E){if(E==C-1){A(this).html("");
}});
});
},_showOnly:function(E,B,D){var C=this;
E.find(B).find("tr").each(function(F){A(this).children().each(function(G){if(G>D){A(this).addClass(C.HIDE_CSS_CLASS);
}});
});
},_setDefaultTrims:function(D){var C=this;
var B=1;
var E=1;
D.find("select").each(function(F){if(F==0){A(this).find("option:eq("+B+")").prop("selected",true);
}if(F==1){A(this).find("option:eq(2)").prop("selected",true);
}});
D.find("."+C.VFILTER_THEAD_CLASS).find("th:eq(1)").html(C._dataSetNames[D.attr("id")][C._getSelected(D,1)]);
D.find("."+C.VFILTER_THEAD_CLASS).find("th:eq(2)").html(C._dataSetNames[D.attr("id")][C._getSelected(D,2)]);
if(D.find("tfoot").find("tr").length>0){D.find("tfoot").find("tr:first").find("td:eq(0)").html("");
D.find("tfoot").find("tr:last").find("td:eq(0)").html("");
D.find("tfoot").find("tr:first").find("td:eq(0)").html(this._footPrice[D.attr("id")][C._getSelected(D,1)]);
D.find("tfoot").find("tr:last").find("td:eq(0)").html(this._footLinks[D.attr("id")][C._getSelected(D,1)]);
D.find("tfoot").find("tr:first").find("td:eq(1)").html("");
D.find("tfoot").find("tr:last").find("td:eq(1)").html("");
D.find("tfoot").find("tr:first").find("td:eq(1)").html(this._footPrice[D.attr("id")][C._getSelected(D,2)]);
D.find("tfoot").find("tr:last").find("td:eq(1)").html(this._footLinks[D.attr("id")][C._getSelected(D,2)]);
}C._fillTrim(D,1,B,false);
C._fillTrim(D,2,2,false);
C._resetDropdownValue(D,0);
C._resetDropdownValue(D,1);
},_getSelected:function(D,C){C--;
var B="";
D.find("select:eq("+C+")").children().each(function(){if(A(this).prop("selected")){B=A(this).text();
}});
return B;
},_fillTrim:function(E,D,B,F){var C=this;
E.find("tbody").each(function(G){A(this).find("tr").not("."+C.VFILTER_THEAD_CLASS).each(function(H){A(this).children("td").each(function(I){if(I==D-1){if(B>0){if(F){C._fadeout(A(this),C._dataSetArray[E.attr("id")][B-1][G]);
}else{A(this).html(C._dataSetArray[E.attr("id")][G][B-1][H]);
}}else{if((!A(this).attr("colspan"))||(A(this).attr("colspan")==1)){A(this).html("");
}}}});
});
});
},_resetDropdownValue:function(E,B){var D=this;
var C=null;
E.find("select:eq("+B+")").children().each(function(F){if(A(this).prop("selected")){E.find(".selectedTxt:eq("+B+")").html(D._dataSetNames[E.attr("id")][D._getSelected(E,F)]);
C=A(this).text();
}});
},_fillAfterChange:function(E,D,C){var B=this;
this._fillTrim(E,C+1,this._getSelectedValue(E,C),false);
if(this._dataSetNames[E.attr("id")][this._getSelected(E,C+1)]){E.find("."+B.VFILTER_THEAD_CLASS).find("th:eq("+(C+1)+")").html(this._dataSetNames[E.attr("id")][this._getSelected(E,C+1)]);
E.find("tfoot").find("tr").each(function(F){if(F==0){A(this).find("td:eq("+C+")").html("");
A(this).find("td:eq("+C+")").html(B._footPrice[E.attr("id")][B._getSelected(E,C+1)]);
}else{A(this).find("td:eq("+C+")").html("");
A(this).find("td:eq("+C+")").html(B._footLinks[E.attr("id")][B._getSelected(E,C+1)]);
}});
}else{B._emptyCol(E,C+1);
}this._bindSelectContinue();
},_getSelectedValue:function(D,C){var B="";
D.find("select:eq("+C+")").children().each(function(){if(A(this).prop("selected")){B=A(this).attr("value");
}});
return B;
},_renewTrimAfterKeyDown:function(D,C,B){if(this._setChangedAfterKeyDown){this._fillAfterChange(D,C,B);
this._setChangedAfterKeyDown=false;
}else{window.setTimeout(function(){this._renewTrimAfterKeyDown(D,C,B);
},100);
}},_setTrimVarAfterKeyDown:function(){this._setChangedAfterKeyDown=true;
}});
})(jQuery);

var TrackingComponent;
(function(A){TrackingComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"omniture",TRACKING_DART_IFRAME:"mds-vc-cmp-dart-iframe",TRACKING_FLOODLIGHT_IFRAME:"mds-vc-cmp-floodlight-iframe",TRACKING_PRINT_EVENT_NAME:"event25",TRACKING_PRINT_EVENT_SPACE:"omniturePrint",PRINT_LINK_ID:"mds-vc-print-lnk",_firstViewId:null,_lastViewId:null,init:function(){this._requestProvider(false,true,null);
},refresh:function(){this._requestProvider(false,true,null);
},_afterUpdate:function(D,C){this._initViewIds();
this._updateDart();
this._updateFloodlight();
var B=this;
A("#"+this.PRINT_LINK_ID).live("click."+B.TRACKING_PRINT_EVENT_SPACE,function(){B._printButtonPressed();
});
this.__base(D,C);
},_printButtonPressed:function(){if(typeof (window.Omniture_s)=="object"){Omniture_s.events=this.TRACKING_PRINT_EVENT_NAME;
Omniture_s.t();
}},_updateDart:function(){if(typeof mds_vc_curViewId!="undefined"&&mds_vc_curViewId!=null&&mds_vc_curViewId!=""){var B=Math.random()*10000000000000;
if(mds_vc_curViewId==this._firstViewId&&mds_vc_dart_start!="dartStartUrl"){A("#"+this.TRACKING_DART_IFRAME).attr("src",mds_vc_dart_start+"num="+B+"?");
}else{if(mds_vc_curViewId==this._lastViewId&&mds_vc_dart_end!="dartEndUrl"){A("#"+this.TRACKING_DART_IFRAME).attr("src",mds_vc_dart_end+"num="+B+"?");
}}}},_updateFloodlight:function(){if(typeof mds_vc_curViewId!="undefined"&&mds_vc_curViewId!=null&&mds_vc_curViewId!=""){var B=Math.random()*10000000000000;
if(mds_vc_curViewId==this._firstViewId&&typeof mds_vc_floodLightEvent!="undefined"&&mds_vc_floodLightEvent!=null){A("#"+this.TRACKING_FLOODLIGHT_IFRAME).attr("src",mds_vc_floodLightEvent+";ord="+B+"?");
mds_vc_floodLightEvent=null;
}else{if(mds_vc_curViewId==this._lastViewId&&typeof mds_vc_floodLightEvent!="undefined"&&mds_vc_floodLightEvent!=null){A("#"+this.TRACKING_FLOODLIGHT_IFRAME).attr("src",mds_vc_floodLightEvent+";ord="+B+"?");
mds_vc_floodLightEvent=null;
}}}},_initViewIds:function(){try{if(this._firstViewId==null){this._firstViewId=mds_vc_ViewController.getFirstViewId(true);
}if(this._lastViewId==null){this._lastViewId=mds_vc_ViewController.getLastViewId();
}}catch(B){mds_vc_ErrorController.log("WARNING: TrackingComponent: ViewController called but not available.");
mds_vc_ErrorController.log(B,true);
}}});
})(jQuery);

var AccessoriesComponent;
(function(A){AccessoriesComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"accessorySelection",INSERT_CACHE:true,init:function(){this._requestProvider(false,true,null);
},insert:function(B){this._killZooms();
this.__base(B);
},onOptionChange:function(B){},_updateJSON:function(B){this._updateOptionJSON(B);
},_addLocalEvents:function(){var C=A("#"+this._domId);
var B=this;
this.__base();
A("."+this.TAB_ITM_CLASS,A("#"+this._domId)).click(function(){return false;
}).click(function(D){B.updateTabs(D);
});
A("."+this.TOGGLE_LNK_CLASS,C).unbind("click").click(function(){return false;
}).click(function(D){B.toggleDetails(D);
});
this._initZooms();
A("."+this.IMG_ZOOM_LNK_CLASS,C).unbind("click").click(function(){return false;
}).click(function(D){B.zoomImage(D);
});
}});
})(jQuery);

var ColourFabricComponent;
(function(A){ColourFabricComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"colorTrimSelection",INSERT_CACHE:true,DISIMG_PROTO_ID:"mds-vc-sel-disimg-proto",DISIMG_INST_CLASS:"mds-vc-sel-disimg-inst",TOOLTIP_CLASS:"mds-vc-color-tt",THUMBNAIL_CLASS:"mds-vc-color-thumb",TT_DELAY:500,TT_TOP_OFFSET:20,_ttTimeout:null,_ttClone:null,showComponent:function(B){if(!B){this._hideAllDetails();
}this.__base(B);
},onOptionHover:function(C,B){this.__base(C,B);
if(B==true){this.showDetail(C);
}else{this.hideDetail(C);
}},showDetail:function(G){var L=this;
this._removeTtClone();
this._hideAllDetails();
var G=A(G);
var D=A("."+this.THUMBNAIL_CLASS,G);
this._ttClone=A("."+this.TOOLTIP_CLASS,G).clone().css({left:"-9999px",top:0});
if(this._ttClone!=null&&A(this._ttClone).length==1){A("body").append(this._ttClone);
var K=this._ttClone.height();
var H=this._ttClone.width();
var C=G.offset().top;
var I=D.offset().left;
var J=D.width();
var B=I+(J/2)-(H/2);
var F=0;
if(B>0){F=B;
}var E={left:F,top:(C-K)};
this._ttTimeout=window.setTimeout(function(){if(A(L._ttClone).length==1){A(L._ttClone).css(E).removeClass(L.HIDE_ACC_CLASS);
}},this.TT_DELAY);
}},hideDetail:function(B){window.clearTimeout(this._ttTimeout);
this._removeTtClone();
},_hideAllDetails:function(){var B=this;
A.each("."+this.TOOLTIP_CLASS,function(C){if(!A(C).hasClass(B.HIDE_ACC_CLASS)){A(C).addClass(B.HIDE_ACC_CLASS);
}});
},_removeTtClone:function(){if(this._ttClone!=null&&A(this._ttClone).length==1){var B=A(this._ttClone);
if(B.length>0){B.remove();
this._ttClone=null;
}}},_updateJSON:function(G){if(this._dataObject.payload){this._removeTtClone();
this._hideAllDetails();
var K=A("#"+this._domId);
var L=this;
var D,J,B,E,I,C,F,H,M;
A.each(this._dataObject.payload.featureSelectionSetList.featureSelectionSet,function(){A.each(this.featureSelection,function(){J=this.feature.featureId;
D=this["selection-control-id"];
B=this["selection-state"];
F=this.formatted_price;
C=A("#"+D);
if(C.length>0){I=C.parents("."+L.OPTION_CTR_CLASS);
if(B==L.SELECTED_STATE||B==L.DEFAULT_STATE){I.removeClass(L.DISABLED_CLASS).addClass(L.SELECTED_CLASS);
C.prop("disabled",false);
C.prop("checked",true);
}else{if(B==L.DISABLED_STATE){I.removeClass(L.SELECTED_CLASS).addClass(L.DISABLED_CLASS);
C.prop("disabled",false);
if(A("."+L.DISIMG_INST_CLASS,I).length==0){E=A("#"+L.DISIMG_PROTO_ID).clone().removeAttr("id").addClass(L.DISIMG_INST_CLASS);
I.prepend(E);
}A("."+L.DISIMG_INST_CLASS,I).removeClass(L.HIDE_CSS_CLASS);
C.prop("checked",false);
}else{I.removeClass(L.SELECTED_CLASS+" "+L.DISABLED_CLASS);
C.prop("disabled",false);
C.prop("checked",false);
}}if(B!=L.DISABLED_STATE){A("."+L.DISIMG_INST_CLASS,I).addClass(L.HIDE_CSS_CLASS);
}H=C.parents("."+L.PARENT_CTR_CLASS);
M=A("."+L.PRICE_VALUE_CLASS,H);
A.each(M,function(){if(F!=undefined&&F!="undefined"&&F!=null){if(A(this).text()!=F){A(this).text(F);
}}else{A(this).text("");
}});
}});
});
}this._sendUpdatedMessage(G);
},_addLocalEvents:function(){var C=A("#"+this._domId);
var B=this;
A("."+this.EVENT_CSS_CLASS,C).parents("."+this.OPTION_CTR_CLASS).unbind("hover").hover(function(){B.onOptionHover(this,true);
},function(){B.onOptionHover(this,false);
});
}});
})(jQuery);

var CompareEngineComponent;
(function(A){CompareEngineComponent=A.inherit(AbstractCompareComponent,{PROVIDER_URL:"packageCompare"});
})(jQuery);

var CompareTrimComponent;
(function(A){CompareTrimComponent=A.inherit(AbstractCompareComponent,{PROVIDER_URL:"seriesCompare",toggleDetails:function(B){var C=A(this._getEventTarget(B)).parents("."+this.TOGGLE_CTR_CLASS);
C.toggleClass(this.ACTIVE_CLASS);
this._toggleDetails(this._getEventTarget(B));
},_addLocalEvents:function(){this.__base();
var B=this;
A("."+this.TOGGLE_LNK_CLASS,A("#"+this._domId)).unbind("click").click(function(){return false;
}).click(function(C){B.toggleDetails(C);
});
}});
})(jQuery);

var DetailPriceComponent;
(function(A){DetailPriceComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"priceDetail",TRIM_CLASS:"trim",DIMENSION_CLASS:"dimension",ENGINE_CLASS:"engine-transmission",ENGINE_DISCLAIMER_CLASS:"engine-disclaimer",COLOUR_CLASS:"colour",FABRIC_CLASS:"fabric",WHEEL_CLASS:"wheel",PRICE_TOTAL_CLASS:"mds-vc-price-total",PRICE_SUBTOTAL_CLASS:"mds-vc-price-subtotal",PRICE_OPTSUBTOTAL_CLASS:"mds-vc-price-optsubtotal",PRICE_TOTAL_PROTO_ID:"mds-vc-price-total-proto",PRICE_SUBTOTAL_PROTO_ID:"mds-vc-price-subtotal-proto",PRICE_OPTSUBTOTAL_PROTO_ID:"mds-vc-price-optsubtotal-proto",PRICE_LINK_CLASS:"mds-vc-price-link",LABEL_ID_PREFIX:"lb-",ITEM_ALL_CLASS:"mds-vc-price-all",ITEM_ROW_CLASS:"mds-vc-price-item",ADDED_ROW_CLASS:"mds-vc-price-added",REMOVED_ROW_CLASS:"mds-vc-price-removed",ITEM_PROTO_ID:"mds-vc-price-item-proto",ADDED_PROTO_ID:"mds-vc-price-added-proto",REMOVED_PROTO_ID:"mds-vc-price-removed-proto",OPTIONS_SCP_CLASS:"options",ACCESSORIES_SCP_CLASS:"accessories",GRP_ITEM_COUNT_CLASS:"mds-vc-item-count",GRP_TOTAL_ROW_CLASS:"total",TOGGLE_CTR_CLASS:"mds-vc-toggle-ctr",TOGGLE_LNK_CLASS:"mds-vc-toggle-lnk",ADDED_HEADER_CLASS:"mds-vc-added-header",REMOVED_HEADER_CLASS:"mds-vc-removed-header",ADDED_HEADER_SUFFIX:"-added",REMOVED_HEADER_SUFFIX:"-removed",LAST_ADDED_CLASS:"item-change",STANDARD_ADDED_CLASS:"item",REGION_SELECT_CLASS:"mds-vc-price-region",CALC_OPTION_CLASS:"mds-vc-price-calc-option",PAYMENT_ESTIMATOR_CLASS:"payment-estimator",ENERGY_LABEL_CLASS:"energy-class",CALC_OPTION_DEFAULT_VALUE:"false",TOTAL_TYPE:"total",SUBTOTAL_TYPE:"subtotal",OPTSUBTOTAL_TYPE:"optional_subtotal",SCROLL_CTR_ID:"mds-vc-ptr",SCROLL_INNER_ID:"mds-vc-ptr-inner",SCROLL_REF_ID:"mds-vc-config-area",SCROLL_FLOAT_CLASS:"floating",SCROLL_BOTTOM_CLASS:"bottom",LABEL_CLASS:"mds-vc-price-label",TYPE_OPTIONS:"options",TYPE_ACCESSORIES:"accessories",UNHIDE_DELAY:500,TO_DELETE_CLASS:"mds-vc-to-delete",_lastPayload:null,_initialized:false,_optionsFolded:true,_accessoriesFolded:true,_hasPaymentEstimator:false,_paymentEstimatorInitialized:false,_paymentEstimator:{details:{$engineTransmission:null,$rate:null,$month:null,$cashPrice:null,$depositAllowance:null,$customerDeposit:null,$credit:null,$rate:null,$duration:null,$total:null,$apr:null},fda:null,terms:0,$engineTransmission:null,$deposit:null,$terms:null,$monthlyPayment:null,$apr:null},_protoAdded:null,_protoRemoved:null,_protoItem:null,init:function(){this._requestProvider(false,true,null);
},toggle:function(C){var B,D;
if(C==this.TYPE_OPTIONS){B=A("."+this.OPTIONS_SCP_CLASS,A("#"+this._domId));
D=this._optionsFolded;
}else{if(C==this.TYPE_ACCESSORIES){B=A("."+this.ACCESSORIES_SCP_CLASS,A("#"+this._domId));
D=this._accessoriesFolded;
}}if(D){A("."+this.TOGGLE_CTR_CLASS,B).addClass(this.ACTIVE_CLASS);
}else{A("."+this.TOGGLE_CTR_CLASS,B).removeClass(this.ACTIVE_CLASS);
}this._initToggleStates();
},scroll:function(){var D=A(window).scrollTop(),B=A("#"+this.SCROLL_CTR_ID).offset().top,E=A("#"+this.SCROLL_REF_ID).height(),C=A("#"+this.SCROLL_INNER_ID).height();
if(D>B&&E>C&&A(window).height()>C){if(D<E+A("#"+this.SCROLL_REF_ID).offset().top-C){A("#"+this.SCROLL_CTR_ID).addClass(this.SCROLL_FLOAT_CLASS).removeClass(this.SCROLL_BOTTOM_CLASS);
}else{A("#"+this.SCROLL_CTR_ID).addClass(this.SCROLL_BOTTOM_CLASS).removeClass(this.SCROLL_FLOAT_CLASS);
}}else{A("#"+this.SCROLL_CTR_ID).removeClass(this.SCROLL_FLOAT_CLASS+" "+this.SCROLL_BOTTOM_CLASS);
}},_init:function(){if(!this._initialized){this._protoAdded=A("#"+this.ADDED_PROTO_ID);
this._protoRemoved=A("#"+this.REMOVED_PROTO_ID);
this._protoItem=A("#"+this.ITEM_PROTO_ID);
this._initToggleStates();
this._addEvents();
this._initialized=true;
}else{this._initToggleStates();
}},_afterUpdate:function(C,B){this.__base(C,B);
if(B==true){this._initialized=false;
this._init();
}},_updateJSON:function(M){if(this._dataObject.payload!=undefined&&this._dataObject.payload!="undefined"&&this._dataObject.payload!=null){var Q=A("#"+this._domId);
var R=this;
var O=this._dataObject.payload.priceDetailBean;
this._updatePriceSimple(this.TRIM_CLASS,O.seriesSelection.feature.label,O.seriesSelection.formatted_price,null);
if(O.dimensionSelection!=null&&O.dimensionSelection!=undefined){this._updatePriceSimple(this.DIMENSION_CLASS,O.dimensionSelection.feature.label,null,null);
}this._updatePriceSimple(this.ENGINE_CLASS,O.packageSelection.feature.label,null,null);
if(O.engineDisclaimer!=null&&O.engineDisclaimer!=undefined){var E="<ul>";
A.each(O.engineDisclaimer,function(){E+="<li>"+this+"</li>";
});
E+="</ul>";
this._updatePriceSimple(this.ENGINE_DISCLAIMER_CLASS,E,null,null);
}this._updatePriceSimple(this.COLOUR_CLASS,O.colorSelection.feature.label,O.colorSelection.formatted_price,null);
this._updatePriceSimple(this.FABRIC_CLASS,O.trimSelection.feature.label,O.trimSelection.formatted_price,null);
if(O.wheelSelection!=null&&O.wheelSelection!=undefined){this._updatePriceSimple(this.WHEEL_CLASS,O.wheelSelection.feature.label,O.wheelSelection.formatted_price,null);
}this._updatePriceGroup(A("."+this.OPTIONS_SCP_CLASS,Q),this.TYPE_OPTIONS);
this._updatePriceGroup(A("."+this.ACCESSORIES_SCP_CLASS,Q),this.TYPE_ACCESSORIES);
if(this._hasPaymentEstimator){if(O.paymentEstimator&&O.paymentEstimator.priceAmount){this._paymentEstimator.totalprice=parseInt(O.paymentEstimator.priceAmount);
this._paymentEstimator.fda=parseInt(O.paymentEstimator.financeDepositAllowance);
if(!this._paymentEstimatorInitialized){this._paymentEstimatorInit();
}if(null!=this._paymentEstimator.$engineTransmission){this._paymentEstimator.$engineTransmission.text(O.paymentEstimator.mpvDescription);
this._paymentEstimator.details.$engineTransmission.text(O.paymentEstimator.mpvDescription);
}this._paymentEstimatorUpdateValues();
A("div.payment-estimator",Q).removeClass(this.HIDE_CSS_CLASS);
this._setCmpState("pe-active");
}else{A("div.payment-estimator",Q).addClass(this.HIDE_CSS_CLASS);
this._setCmpState("");
}}if(O.financePlan){var C=this._$ctx.find("#"+O.financePlan.diplayedFinancePlan);
this._$ctx.find("#mds-cmp-finance_component > div").addClass(this.HIDE_CSS_CLASS);
C.removeClass(this.HIDE_CSS_CLASS);
var P=C.find("dl");
var R=this;
P.each(function(T,U){var S=A(U).attr("class");
R._updatePriceSimple(S,null,O.financePlan[S],C);
});
}else{this._$ctx.find("#mds-cmp-finance_component > div").addClass(this.HIDE_CSS_CLASS);
this._$ctx.find("#mds-cmp-finance_component > #finance_component_no-data").removeClass(this.HIDE_CSS_CLASS);
}if(O.energyLabel!=null&&O.energyLabel!=undefined){this._updatePriceSimple(this.ENERGY_LABEL_CLASS,null,O.energyLabel.labelClass,null);
A.event.trigger("energyLabelUpdate",[O.energyLabel]);
}var I=1;
var N=1;
var G=1;
var D=0;
var B=[];
var F,K,H,J;
var L;
A.each(O.configurationTotalPrice,function(){J=A("."+R.PRICE_TOTAL_CLASS+":not(."+R.PROTOTYPE_ID_CLASS+"), ."+R.PRICE_SUBTOTAL_CLASS+":not(."+R.PROTOTYPE_ID_CLASS+"), ."+R.PRICE_OPTSUBTOTAL_CLASS+":not(."+R.PROTOTYPE_ID_CLASS+")",Q);
if(this.name==R.TOTAL_TYPE){I++;
F=A("."+R.PRICE_TOTAL_CLASS+":eq("+(I-1)+")");
if(F.length==0){F=A("#"+R.PRICE_TOTAL_PROTO_ID).clone().removeClass(R.PROTOTYPE_ID_CLASS).removeAttr("id");
if(D>0){J.eq(D-1).after(F);
}else{J.eq(0).before(F);
}B.push(F);
}R._updateLabelTitle(F,this.advice);
R._updatePriceSimple(R.PRICE_TOTAL_CLASS,this.label,this["$"],null,I);
D++;
}if(this.name==R.SUBTOTAL_TYPE){N++;
F=A("."+R.PRICE_SUBTOTAL_CLASS+":eq("+(N-1)+")",Q);
if(F.length==0){F=A("#"+R.PRICE_SUBTOTAL_PROTO_ID).clone().removeClass(R.PROTOTYPE_ID_CLASS).removeAttr("id");
if(D>0){J.eq(D-1).after(F);
}else{J.eq(0).before(F);
}B.push(F);
}R._updateLabelTitle(F,this.advice);
R._updatePriceSimple(R.PRICE_SUBTOTAL_CLASS,this.label,this["$"],null,N);
D++;
}if(this.name==R.OPTSUBTOTAL_TYPE){G++;
K=null;
F=A("."+R.PRICE_OPTSUBTOTAL_CLASS+":eq("+(G-1)+")",Q);
if(F.length==0){F=A("#"+R.PRICE_OPTSUBTOTAL_PROTO_ID).clone().removeClass(R.PROTOTYPE_ID_CLASS).removeAttr("id");
K=A("."+R.CALC_OPTION_CLASS,F).removeClass(R.PROTOTYPE_ID_CLASS);
if(D>0){J.eq(D-1).after(F);
}else{J.eq(0).before(F);
}B.push(F);
}R._updateLabelTitle(F,this.advice);
if(K==null){K=A("."+R.CALC_OPTION_CLASS,A("."+R.PRICE_OPTSUBTOTAL_CLASS+":eq("+(G-1)+")",Q));
}K.attr("name",this.priceCalculationAttributeName);
K.attr("value",(this.priceCalculationAttributeValue!=null&&this.priceCalculationAttributeValue!=undefined)?this.priceCalculationAttributeValue:R.CALC_OPTION_DEFAULT_VALUE);
K.prop("checked",(K.attr("value")==R.CALC_OPTION_DEFAULT_VALUE)?false:true);
H=A("."+R.PRICE_LINK_CLASS,F);
L=null;
if(H.length>0){if(this.labelLink!=undefined&&this.labelLink!=null){H.attr("href",this.labelLink).removeClass(R.HIDE_CSS_CLASS).html(this.label);
H.siblings().remove();
}else{A("."+R.LABEL_CLASS,F).append(this.label);
if(!H.hasClass(R.HIDE_CSS_CLASS)){H.addClass(R.HIDE_CSS_CLASS);
}}}else{L=this.label;
}R._updatePriceSimple(R.PRICE_OPTSUBTOTAL_CLASS,L,this["$"],null,G,true);
D++;
}});
if(B.length>0){window.setTimeout(function(){A("."+R.PRICE_TOTAL_CLASS+":gt("+(I-1)+")",Q).remove();
A("."+R.PRICE_SUBTOTAL_CLASS+":gt("+(N-1)+")",Q).remove();
A("."+R.PRICE_OPTSUBTOTAL_CLASS+":gt("+(G-1)+")",Q).remove();
A.each(B,function(){A(this).removeClass(R.HIDE_CSS_CLASS);
});
},this.UNHIDE_DELAY);
}else{A("."+R.PRICE_TOTAL_CLASS+":gt("+(I-1)+")",Q).remove();
A("."+R.PRICE_SUBTOTAL_CLASS+":gt("+(N-1)+")",Q).remove();
A("."+R.PRICE_OPTSUBTOTAL_CLASS+":gt("+(G-1)+")",Q).remove();
}this._lastPayload=O;
}this._sendUpdatedMessage(M);
this._init();
},_updateHTML:function(C){this.__base(C);
var B=this._$ctx.find("div.payment-estimator");
if(B.length){this._hasPaymentEstimator=true;
if(!B.hasClass(this.HIDE_CSS_CLASS)){this._paymentEstimator.fda=parseInt(this._$ctx.find("#payment-estimator-fda-prefill").val());
this._paymentEstimator.totalprice=parseInt(this._$ctx.find("#payment-estimator-price-total-prefill").val());
this._paymentEstimatorInit();
}}A.event.trigger("energyLabelUpdate");
},_paymentEstimatorInit:function(){var C=A("#"+this._domId);
var B=this;
this._paymentEstimatorInitialized=true;
this._setCmpState("pe-active");
if(isNaN(this._paymentEstimator.fda)){A(".pe-fda",C).addClass(this.HIDE_CSS_CLASS);
}var D=A("#payment-estimator-terms_slider .slider").slider({min:parseInt(A("#payment-estimator-range").attr("min")),max:parseInt(A("#payment-estimator-range").attr("max")),value:parseInt(A("#payment-estimator-range").attr("value")),range:"min",create:function(E,F){var G=A(E.target);
G.find("a").append("<span/>").find("span").text(G.slider("value"));
},slide:function(E,F){A(E.target).find("a span").text(F.value);
A("#payment-estimator-terms span").text(F.value);
B._paymentEstimator.terms=F.value;
B._paymentEstimatorUpdateValues();
}});
this._paymentEstimator.terms=D.slider("value");
this._paymentEstimator.$engineTransmission=A("#payment-estimator-engine_transmission",C);
this._paymentEstimator.$deposit=A("#payment-estimator-desposit",C);
this._paymentEstimator.$fda=A("#payment-estimator-fda span",C);
this._paymentEstimator.$terms=A("#payment-estimator-terms span",C);
this._paymentEstimator.$monthlyPayment=A("#payment-estimator-monthly_payment span",C);
this._paymentEstimator.details.$engineTransmission=A("#payment-estimator-quote_detail-engine_transmission",C);
this._paymentEstimator.details.$month=A(".payment-estimator-quote_detail-month",C);
this._paymentEstimator.details.$monthlyPayment=A("#payment-estimator-quote_detail-month span",C);
this._paymentEstimator.details.$rate=A("#payment-estimator-quote_detail-rate span",C);
this._paymentEstimator.details.$cashPrice=A("#payment-estimator-quote_detail-cash_price span",C);
this._paymentEstimator.details.$fda=A("#payment-estimator-quote_detail-desposit_allowance span",C);
this._paymentEstimator.details.$customerDeposit=A("#payment-estimator-quote_detail-customer_desposit span",C);
this._paymentEstimator.details.$credit=A("#payment-estimator-quote_detail-credit span",C);
this._paymentEstimator.details.$total=A("#payment-estimator-quote_detail-total span",C);
this._paymentEstimator.$deposit.val(this._paymentEstimator.totalprice*0.2);
this._paymentEstimator.$deposit.keyup(A.proxy(this._paymentEstimatorUpdateValues,this));
this._paymentEstimatorUpdateValues();
},_paymentEstimatorUpdateValues:function(){var C=isNaN(this._paymentEstimator.fda)?0:this._paymentEstimator.fda;
var G=this._paymentEstimator.totalprice-C;
var B=this._paymentEstimator.$deposit.val();
if(B>G){this._paymentEstimator.$deposit.val(G);
B=G;
}if(B<0){this._paymentEstimator.$deposit.val(0);
B=0;
}var F=this._paymentEstimator.totalprice-C-B;
var D=F/this._paymentEstimator.terms;
F=this._paymentEstimatorFormatPrice(F);
D=this._paymentEstimatorFormatPrice(this._paymentEstimatorRoundNumber(D,2));
C=this._paymentEstimatorFormatPrice(C);
var E=this._paymentEstimatorFormatPrice(this._paymentEstimator.totalprice);
this._paymentEstimator.$fda.text(C);
this._paymentEstimator.$monthlyPayment.text(D);
this._paymentEstimator.details.$rate.text(D);
this._paymentEstimator.details.$fda.text(C);
this._paymentEstimator.details.$cashPrice.text(E);
this._paymentEstimator.details.$total.text(E);
this._paymentEstimator.details.$month.text(this._paymentEstimator.terms);
this._paymentEstimator.details.$monthlyPayment.text(D);
this._paymentEstimator.details.$customerDeposit.text(this._paymentEstimatorFormatPrice(B));
this._paymentEstimator.details.$credit.text(F);
},_paymentEstimatorFormatPrice:function(F){F=Number(F).toFixed(2);
var B=String(F).split(".");
var E=B[0];
var C=B.length>1?"."+B[1]:"";
var D=/(\d+)(\d{3})/;
while(D.test(E)){E=E.replace(D,"$1,$2");
}F=E+C;
return F;
},_paymentEstimatorRoundNumber:function(C,D){var B=String(Math.ceil(C*Math.pow(10,D))/Math.pow(10,D));
if(B.indexOf(".")<0){B+=".";
}while(B.length-B.indexOf(".")<=D){B+="0";
}return B;
},_updateLabelTitle:function(B,D){var C=A("."+this.LABEL_CLASS,B);
if(C.length>0){if(D!=null&&D!=undefined){if(C.attr("title")!=D){C.removeAttr("title");
C.attr("title",D);
}}else{C.removeAttr("title");
if(C.hasClass(this.TITLE_TOOLTIP_REPLACED)){C.removeClass(this.TITLE_TOOLTIP_REPLACED);
}}}},_updatePriceGroup:function(B,C){var M=this;
var T,L;
var F=0;
var E=0;
var S=0;
var N=[];
var P=[];
var U=[];
var O=null;
if(this._dataObject.payload!=null&&this._dataObject.payload!=undefined){if(C==this.TYPE_OPTIONS){O=this._dataObject.payload.priceDetailBean.optionSelection;
}else{O=this._dataObject.payload.priceDetailBean.accessorySelection;
}}var I=null;
if(this._lastPayload!=null&&this._lastPayload!=undefined){if(C==this.TYPE_OPTIONS){I=this._lastPayload.optionSelection;
}else{I=this._lastPayload.accessorySelection;
}}if(I==null){I=[];
var R=null;
var Q=null;
A.each(A("."+M.ITEM_ROW_CLASS,B),function(){R=new Object();
Q=new Object();
Q["featureId"]=A("."+M.EVENT_CSS_CLASS,A(this)).attr("value");
Q["label"]=A("."+M.LABEL_CLASS,A(this)).html();
R["selection-control-id"]=A("."+M.EVENT_CSS_CLASS,A(this)).attr("id");
R["formatted_price"]=A("."+M.PRICE_VALUE_CLASS,A(this)).text();
R["feature"]=Q;
I.push(R);
});
}if((O!=null&&O!=undefined)||(I!=null&&I!=undefined)){var K=A("."+this.GRP_TOTAL_ROW_CLASS,B).parent();
var H=A("."+this.ADDED_HEADER_CLASS,B);
var G=A("."+this.REMOVED_HEADER_CLASS,B);
var J;
if(C==this.TYPE_OPTIONS){J=M.OPTIONS_SCP_CLASS;
}else{J=M.ACCESSORIES_SCP_CLASS;
}var V=null;
if(this._dataObject.payload!=null&&this._dataObject.payload!=undefined){if(C==this.TYPE_OPTIONS){V=this._dataObject.payload.priceDetailBean.optionTotalPrice;
}else{V=this._dataObject.payload.priceDetailBean.accessoryTotalPrice;
}}if(V!=null&&V!=undefined){if(V["$"]!=undefined){if(V.label!=undefined){M._updatePriceSimple(M.GRP_TOTAL_ROW_CLASS,V.label,V["$"],B);
}else{M._updatePriceSimple(M.GRP_TOTAL_ROW_CLASS,null,V["$"],B);
}}}A("."+this.EVENT_CSS_CLASS,A("."+this.REMOVED_ROW_CLASS,B)).addClass(this.TO_DELETE_CLASS).removeAttr("id");
if(I!=null&&I!=undefined){A.each(I,function(){A("."+M.EVENT_CSS_CLASS+"[value='"+this.feature.featureId+"']",A("."+M.ADDED_ROW_CLASS,B)).addClass(M.TO_DELETE_CLASS).removeAttr("id");
previous=A("."+M.EVENT_CSS_CLASS+"[value='"+this.feature.featureId+"']:not('."+M.TO_DELETE_CLASS+"')",A("."+M.ITEM_ROW_CLASS,B));
if(previous.length==0){T=M._protoItem.clone().removeClass(M.PROTOTYPE_ID_CLASS).removeAttr("id");
A("."+M.EVENT_CSS_CLASS,T).removeClass(M.PROTOTYPE_ID_CLASS).attr("value",this.feature.featureId).attr("id",this["selection-control-id"]).attr("name",J).prop("disabled",false);
A("."+M.LABEL_CLASS,T).html(this.feature.label).attr("id",M.LABEL_ID_PREFIX+this["selection-control-id"]).attr("for",this["selection-control-id"]);
N.push(this.feature.featureId);
M._updateOption(A("."+M.EVENT_CSS_CLASS,T),this["selection-state"],this.formatted_price,null,M.ITEM_ALL_CLASS);
K.append(T);
P.push(T);
}else{M._updateOption(previous,this["selection-state"],this.formatted_price,null,M.ITEM_ALL_CLASS);
N.push(this.feature.featureId);
}});
}if(O!=null&&O!=undefined){A.each(O,function(){arrPos=A.inArray(this.feature.featureId,N);
if(arrPos>=0){T=A("."+M.EVENT_CSS_CLASS+"[value='"+this.feature.featureId+"']",A("."+M.ITEM_ROW_CLASS,B));
M._updateOption(T,this["selection-state"],this.formatted_price,null,M.ITEM_ALL_CLASS);
N[arrPos]=null;
}else{T=M._protoAdded.clone().removeClass(M.PROTOTYPE_ID_CLASS).removeAttr("id");
A("."+M.EVENT_CSS_CLASS,T).removeClass(M.PROTOTYPE_ID_CLASS).attr("value",this.feature.featureId).attr("id",this["selection-control-id"]).attr("name",J+M.ADDED_HEADER_SUFFIX).prop("disabled",false);
A("."+M.LABEL_CLASS,T).html(this.feature.label).attr("id",M.LABEL_ID_PREFIX+this["selection-control-id"]).attr("for",this["selection-control-id"]);
M._updateOption(A("."+M.EVENT_CSS_CLASS,T),this["selection-state"],this.formatted_price,null,M.ITEM_ALL_CLASS);
H.after(T);
P.push(T);
E++;
}F++;
});
}if(I!=null&&I!=undefined){var D;
A.each(I,function(){D=A.inArray(this.feature.featureId,N);
if(D>=0){if(N[D]!=null){A("."+M.EVENT_CSS_CLASS+"[value='"+this.feature.featureId+"']",B).addClass(M.TO_DELETE_CLASS).removeAttr("id");
T=M._protoRemoved.clone().removeClass(M.PROTOTYPE_ID_CLASS).removeAttr("id");
A("."+M.EVENT_CSS_CLASS,T).removeClass(M.PROTOTYPE_ID_CLASS).attr("value",this.feature.featureId).attr("id",this["selection-control-id"]).attr("name",J+M.REMOVED_HEADER_SUFFIX).prop("disabled",true);
A("."+M.LABEL_CLASS,T).html(this.feature.label).attr("id",M.LABEL_ID_PREFIX+this["selection-control-id"]).attr("for",this["selection-control-id"]);
M._updateOption(A("."+M.EVENT_CSS_CLASS,T),M.REMOVED_STATE,this.formatted_price,null,M.ITEM_ALL_CLASS);
G.after(T);
P.push(T);
S++;
}}});
}window.setTimeout(function(){A("."+M.GRP_ITEM_COUNT_CLASS,B).html(F);
A("."+M.TO_DELETE_CLASS,B).parents("."+M.ITEM_ALL_CLASS).remove();
A.each(P,function(){A(this).removeClass(M.HIDE_CSS_CLASS);
});
if(E>0&&(F-E)>0){A("."+M.ADDED_ROW_CLASS+":last",B).attr("class",M.LAST_ADDED_CLASS+" "+A("."+M.ADDED_ROW_CLASS+":last",B).removeClass(M.STANDARD_ADDED_CLASS).attr("class"));
}else{if(S>0&&F>0){A("."+M.REMOVED_ROW_CLASS+":last",B).attr("class",M.LAST_ADDED_CLASS+" "+A("."+M.REMOVED_ROW_CLASS+":last",B).removeClass(M.STANDARD_ADDED_CLASS).attr("class"));
}}if(E==0){H.addClass(M.HIDE_CSS_CLASS);
}else{H.removeClass(M.HIDE_CSS_CLASS);
}if(S==0){G.addClass(M.HIDE_CSS_CLASS);
}else{G.removeClass(M.HIDE_CSS_CLASS);
}if(F>0||S>0){B.removeClass(M.HIDE_CSS_CLASS);
}else{if(F==0){B.addClass(M.HIDE_CSS_CLASS);
}}if(F>0&&N.length==0&&(M.TYPE_OPTIONS?M._optionsFolded:M._accessoriesFolded)){M.toggle(C);
}},this.UNHIDE_DELAY);
}},_updatePriceSimple:function(D,F,G,H,E,C){if(H==null||H==undefined){H=this._$ctx;
}var I=0;
var J="."+D;
if(E!=null&&E!=undefined){J=J+":eq("+(E-1)+")";
}var B=A(J,H);
if(B.length==1){if(F!=""&&F!=null&&F!="null"&&F!=undefined){A("."+this.LABEL_CLASS,B).html(F);
I++;
}if(G!=""&&G!=null&&G!="null"&&G!=undefined){A("."+this.PRICE_VALUE_CLASS,B).html(G);
I++;
}if(I>0&&B.hasClass(this.HIDE_CSS_CLASS)&&!C){B.removeClass(this.HIDE_CSS_CLASS);
}else{if(I==0&&!B.hasClass(this.HIDE_CSS_CLASS)){B.addClass(this.HIDE_CSS_CLASS);
}}}},_initToggleStates:function(){if(A("."+this.TOGGLE_CTR_CLASS,A("."+this.OPTIONS_SCP_CLASS,A("#"+this._domId))).hasClass(this.ACTIVE_CLASS)){this._optionsFolded=false;
}else{this._optionsFolded=true;
}if(A("."+this.TOGGLE_CTR_CLASS,A("."+this.ACCESSORIES_SCP_CLASS,A("#"+this._domId))).hasClass(this.ACTIVE_CLASS)){this._accessoriesFolded=false;
}else{this._accessoriesFolded=true;
}},_addEvents:function(){var C=this;
A("."+this.TOGGLE_LNK_CLASS,A("."+this.OPTIONS_SCP_CLASS,A("#"+this._domId))).unbind("click").click(function(){return false;
}).click(function(){C.toggle(C.TYPE_OPTIONS);
});
A("."+this.TOGGLE_LNK_CLASS,A("."+this.ACCESSORIES_SCP_CLASS,A("#"+this._domId))).unbind("click").click(function(){return false;
}).click(function(){C.toggle(C.TYPE_ACCESSORIES);
});
var D=A("."+this.TAB_ITM_CLASS,A("#"+this._domId));
D.click(function(){if(A(this).tagName=="A"){return false;
}});
var B=(A.browser.webkit&&D.is("input"))?"change":"click";
D.bind(B,function(E){C.updateTabs(E);
});
if(A("#"+this.SCROLL_CTR_ID).length>0){A(window).scroll(function(){C.scroll();
});
}}});
})(jQuery);

var EngineTransmissionComponent;
(function(A){EngineTransmissionComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"packageSelection",INSERT_CACHE:true,TRANS_FILTER_SEL_CLASS:"mds-vc-trans-sel",TRANS_FILTER_REF_ATTR:"abbr",PRICE_HEADER_LABEL:"mds-vc-price-label-head",_initialized:false,_transmission:null,_engineFilter:null,init:function(){this._requestProvider(false,true,null);
},toggleDetails:function(B,E){var D=A(this._getEventTarget(B));
if(this._getEventTarget(B)==undefined||this._getEventTarget(B)==null){D=A(B);
}var C=D.parents("."+this.TOGGLE_CTR_CLASS);
if(C.length>0){if(E!=undefined&&E==true){C.toggleClass(this.ACTIVE_CLASS,false);
}else{C.toggleClass(this.ACTIVE_CLASS);
}}this._toggleDetails(D,E);
},filter:function(R,E,L,B){var J=false;
var O=false;
B=this._checkScope(B);
var M,C;
if(R!=null&R!=undefined&&R!="undefined"){var G=A(this._getEventTarget(R));
var T=G.find("option:selected").val();
if(G.hasClass(this.FILTER_SEL_CLASS)){M=T;
if(this._transmission!=null){C=this._transmission;
}else{C=L;
}}else{if(this._engineFilter!=null){M=this._engineFilter;
}else{M=E;
}C=T;
}}else{M=E;
C=L;
}if(M==null||M==undefined||M=="undefined"||M==""){J=true;
}if(C==null||C==undefined||C=="undefined"||C==""){O=true;
}if(!J){this._engineFilter=M;
}if(!O){this._transmission=C;
}var I=this;
var N=null;
if(!J){A.each(A("."+this.FILTER_CNT_CLASS,B),function(U){if(U==M||M==I.FILTER_DEFAULT_INDEX){if(A(this).hasClass(I.HIDE_CSS_CLASS)){A(this).removeClass(I.HIDE_CSS_CLASS);
}}else{if(!A(this).hasClass(I.HIDE_CSS_CLASS)){A(this).addClass(I.HIDE_CSS_CLASS);
}var V=A("."+I.EVENT_CSS_CLASS+"[checked]",A(this));
if(V.length==1){N=V;
}}});
}if(!O){var D,P,Q;
A.each(A("."+this.EVENT_CSS_CLASS,B),function(){P=A(this);
Q=P.parents("."+I.OPTION_CTR_CLASS);
D=P.attr(I.TRANS_FILTER_REF_ATTR);
if(D==C||C==I.FILTER_DEFAULT_INDEX){if(Q.hasClass(I.HIDE_CSS_CLASS)){Q.removeClass(I.HIDE_CSS_CLASS);
}}else{if(!Q.hasClass(I.HIDE_CSS_CLASS)){Q.addClass(I.HIDE_CSS_CLASS);
}if(P.prop("checked")==true){N=P;
}I.toggleDetails(this,true);
}});
}var H;
A.each(A("."+this.FILTER_CNT_CLASS,B),function(){H=false;
if(!A(this).hasClass(I.HIDE_CSS_CLASS)){H=true;
A.each(A("."+I.EVENT_CSS_CLASS,this).parents("."+I.TOGGLE_CTR_CLASS),function(){if(!A(this).hasClass(I.HIDE_CSS_CLASS)){H=false;
return false;
}});
if(H==true){A(this).addClass(I.HIDE_CSS_CLASS);
}else{A(this).removeClass(I.HIDE_CSS_CLASS);
}}});
if(N!=null){var F=null;
var K=null;
var Q;
var S;
A.each(A("."+this.FILTER_CNT_CLASS,B),function(){var U=A(this);
if(!U.hasClass(I.HIDE_CSS_CLASS)){A.each(A("."+I.EVENT_CSS_CLASS,U),function(){S=A(this);
Q=S.parents("."+I.OPTION_CTR_CLASS);
if(!Q.hasClass(I.HIDE_CSS_CLASS)){if(F==null){F=S;
}if(!Q.not(N.parents("."+I.OPTION_CTR_CLASS)).length&&K==null){K==S;
}}});
}});
if(K!=null){F=K;
}if(F!=null){F.prop("checked",true).trigger("change");
}else{mds_vc_ErrorController.log("INFO: No selectable option found after filter applied in EngineTransmissionComponent.");
}}},_updateJSON:function(D){this._updateSelectionJSON(D);
if(this._dataObject.payload){var B=A("."+this.PRICE_HEADER_LABEL,A("#"+this._domId));
var C=this._dataObject.payload.featureSelectionSet;
if(B.length>0&&C.featureSetPriceLabel!=null&&C.featureSetPriceLabel!=undefined){var E=C.featureSetPriceLabel;
if(B.text()!=E){B.text(E);
}}}},_init:function(B){if(!this._initialized){this._clearFilterStates();
this._initialized=true;
}this._initFilter(B);
},_initFilter:function(E){var D=null;
var B=null;
var C=false;
var H=false;
var F=A("."+this.FILTER_SEL_CLASS,E).val();
var G=A("."+this.TRANS_FILTER_SEL_CLASS,E).val();
if(F==this.FILTER_DEFAULT_INDEX&&this._engineFilter!=undefined&&this._engineFilter!="undefined"&&this._engineFilter!=null){B=this._engineFilter;
C=true;
}else{B=G;
}if(G==this.FILTER_DEFAULT_INDEX&&this._transmission!=undefined&&this._transmission!="undefined"&&this._transmission!=null){D=this._transmission;
H=true;
}else{D=G;
}if(D==null){D=this.FILTER_DEFAULT_INDEX;
H=true;
}if(B==null){B=this.FILTER_DEFAULT_INDEX;
C=true;
}if(C){A("option[value='"+B+"']",A("."+this.FILTER_SEL_CLASS,E)).prop("selected",true);
}if(H){A("option[value='"+D+"']",A("."+this.TRANS_FILTER_SEL_CLASS,E)).prop("selected",true);
}this.filter(null,B,D,E);
},_hookHTML:function(C,B){this.__base(C,B);
this._initialized=false;
this._init(B);
},_addLocalEvents:function(){var C=A("#"+this._domId);
var B=this;
this.__base();
A("."+this.TOGGLE_LNK_CLASS,C).unbind("click").click(function(){return false;
}).click(function(D){B.toggleDetails(D);
});
A("."+this.FILTER_SEL_CLASS+", ."+this.TRANS_FILTER_SEL_CLASS,C).unbind("change").change(function(D){B.filter(D);
});
},_clearFilterStates:function(){this._transmission=null;
this._engineFilter=null;
}});
})(jQuery);

var ManagedContentComponent;
(function(A){ManagedContentComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"managedContent",managed_content_list:null,COPIED_CONTAINER_PREFIX:"src_cop_",knownTargetContainer:[],insert:function(B){this._requestProvider(true,false,true);
},_updateJSON:function(C){try{this.managed_content_list=this._dataObject.payload.managedContentList;
this._moveCmsContent(this.managed_content_list);
}catch(B){mds_vc_ErrorController.log("WARNING: Component "+this._cmpId+" could not fetch manage content list.");
}this._sendUpdatedMessage(C);
},_moveCmsContent:function(C){var B=this;
if(C){A.each(C.managedContent,function(J,K){if(A.inArray(K.target_id,B.knownTargetContainer)<0){B.knownTargetContainer.push(K.target_id);
}var M=A("#"+K.source_id);
if(M.length){var L=A("#"+K.source_id).children();
if(L.length){var E=A("#"+K.target_id);
var F=E.attr("class");
var N=false;
if(F&&F.length){var D=F.split(" ");
for(var H=0;
H<D.length;
H++){var G=D[H];
if(G.indexOf(B.COPIED_CONTAINER_PREFIX)>-1){N=true;
var I=G.split(B.COPIED_CONTAINER_PREFIX)[1];
}}}if(N){if(I==K.source_id){}else{A("#"+I).append(E.children());
E.children().remove();
B._addParamToShoppingLink(K);
E.append(L);
E.removeClass(B.COPIED_CONTAINER_PREFIX+I);
E.addClass(B.COPIED_CONTAINER_PREFIX+K.source_id);
}}else{B._addParamToShoppingLink(K);
E.append(L);
E.addClass(B.COPIED_CONTAINER_PREFIX+K.source_id);
}}}else{mds_vc_ErrorController.log("WARNING: Managed Content CMS source '"+K.source_id+"' not found and not moved.");
}});
}this._checkContainerVisibility(C);
},_checkContainerVisibility:function(C){var B=this;
A.each(B.knownTargetContainer,function(E,D){var F=false;
if(C){A.each(C.managedContent,function(H,G){if(D==G.target_id){F=true;
}});
}if(F){A("#"+D).removeClass(B.HIDE_CSS_CLASS);
}else{A("#"+D).addClass(B.HIDE_CSS_CLASS);
}});
},_addParamToShoppingLink:function(B){if(B.addParamToShoppingLink){for(var F=0;
F<B.addParamToShoppingLink.length;
F++){var D=window.getGmdsInAppContent().getContent(B.source_id).getShoppingLink(B.addParamToShoppingLink[F].shoppingLinkKey);
if(D){var E=B.addParamToShoppingLink[F].paramValue;
if("vcBackLink"==E){var C=B.addParamToShoppingLink[F].backLinkAnchor||"";
E=window.mds_vc_startURL+C;
}D.addParam(B.addParamToShoppingLink[F].paramKey,E);
}}}}});
})(jQuery);

var ImageComponent;
(function(A){ImageComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"imageComponent",TYPE_EXT:"ext",TYPE_INT:"int",TYPE_EXT_RTT:"Exterior",TYPE_INT_RTT:"Interior",IMAGE_SMALL_ID:"mds-vc-img-small",IMAGE_LARGE_ID:"mds-vc-img-large",VIEW_CTR_CLASS:"mds-vc-sel-view-ctr",VIEW_EXT_ID:"mds-vc-sel-img-ext",VIEW_INT_ID:"mds-vc-sel-img-int",PERSP_PROTO_ID:"mds-vc-sel-persp-proto",PRESP_CTR_ID:"mds-vc-sel-persp-row-ctr",PERSP_NAME_PREFIX:"mds-vc-sel-persp-",PERSP_NAME_CTR_CLASS:"mds-vc-sel-persp-ctr",PERSP_NAME_LNK_CLASS:"mds-vc-sel-persp-lnk",ZOOM_LNK_LARGE_ID:"mds-vc-lnk-360-large",ZOOM_LNK_SMALL_ID:"mds-vc-lnk-360-small",VIEW_ACTIVE_CLASS:"ui-state-highlight",PERSP_ACTIVE_CLASS:"ui-state-highlight",ZOOM_ACTIVE_CLASS:"ui-state-active",ZOOM_EXT_ID:"mds-vc-sel-zoom-ext",ZOOM_INT_ID:"mds-vc-sel-zoom-int",ZOOM_CNT_CLASS:"mds-vc-zoom-cnt",ZOOM_CLOSE_LNK_CLASS:"mds-vc-zoom-close",ZOOM_LIGHTBOX_ID:"mds-vc-cmp-360flash-zoom",ZOOM_FLASH_EXTERIOR:"mds-vc-zoom-flash-exterior",ZOOM_FLASH_INTERIOR:"mds-vc-zoom-flash-interior",ZOOM_FLASH_MMG_NG:"mds-vc-zoom-flash-mmgng",ZOOM_FLASH_EXTERIOR_CONTENT:"mds-vc-zoom-flash-exterior-content",ZOOM_FLASH_INTERIOR_CONTENT:"mds-vc-zoom-flash-interior-content",ZOOM_FLASH_MMG_NG_CONTENT:"mds-vc-zoom-flash-mmgng-content",NEXT_LNK_ID:"mds-vc-img-next-lnk",TOGGLE_LNK_ID:"mds-vc-img-toggle-lnk",LEGAL_TEXT_ID:"mds-vc-img-legal",FLASH_EXTERIOR_URL:null,FLASH_EXTERIOR_WIDTH:null,FLASH_EXTERIOR_HEIGHT:null,FLASH_INTERIOR_URL:null,FLASH_INTERIOR_WIDTH:null,FLASH_INTERIOR_HEIGHT:null,ZOOM_LAYER_EXTERIOR_WIDTH:null,ZOOM_LAYER_EXTERIOR_HEIGHT:null,ZOOM_LAYER_INTERIOR_WIDTH:null,ZOOM_LAYER_INTERIOR_HEIGHT:null,FLASH_MMG_NG_SWF_PATH:null,FLASH_MMG_NG_WIDTH:null,FLASH_MMG_NG_HEIGHT:null,ZOOM_LAYER_MMG_NG_WIDTH:null,ZOOM_LAYER_MMG_NG_HEIGHT:null,ZOOM_LAYER_YPOSITION:null,_extZoomURL:"",_extZoomBackgroundURL:"",_intZoomURL:"",_zoomSourceView:"",_extZoomNgBean:null,_intZoomNgBean:null,_mmgNgBean:null,_mmgNgId:null,mmgNgFlashInstance:null,_typeOfLargeImg:"",_curPerspName:null,_myDialog:null,_zoomLayerExteriorHTML:null,_zoomLayerInteriorHTML:null,_zoomLayerMmgNgHTML:null,__construct:function(){try{var B=mds.apps.vc.config.component.image;
this.FLASH_EXTERIOR_URL=B.zoom.flash.exteriorUrl;
this.FLASH_EXTERIOR_WIDTH=B.zoom.flash.exteriorWidth;
this.FLASH_EXTERIOR_HEIGHT=B.zoom.flash.exteriorHeight;
this.FLASH_INTERIOR_URL=B.zoom.flash.interiorUrl;
this.FLASH_INTERIOR_WIDTH=B.zoom.flash.interiorWidth;
this.FLASH_INTERIOR_HEIGHT=B.zoom.flash.interiorHeight;
this.FLASH_MMG_NG_SWF_PATH=B.zoom.flash.mmg_ng_swf_path;
this.FLASH_MMG_NG_WIDTH=B.zoom.flash.mmgngWidth;
this.FLASH_MMG_NG_HEIGHT=B.zoom.flash.mmgngHeight;
this.ZOOM_LAYER_EXTERIOR_WIDTH=B.zoom.layer.exteriorWidth;
this.ZOOM_LAYER_EXTERIOR_HEIGHT=B.zoom.layer.exteriorHeight;
this.ZOOM_LAYER_INTERIOR_WIDTH=B.zoom.layer.interiorWidth;
this.ZOOM_LAYER_INTERIOR_HEIGHT=B.zoom.layer.interiorHeight;
this.ZOOM_LAYER_MMG_NG_WIDTH=B.zoom.layer.mmgngWidth;
this.ZOOM_LAYER_MMG_NG_HEIGHT=B.zoom.layer.mmgngHeight;
this.ZOOM_LAYER_YPOSITION=B.zoom.layer.yOffset;
}catch(C){mds_vc_ErrorController.error(999,"EXCEPTION: Global configuration is corrupt.",C);
}},init:function(){this._typeOfLargeImg=this.TYPE_EXT;
this._addEvents();
this._addLoadAni();
this._rewriteRef();
this.__base();
this._zoomLayerExteriorHTML=A("#"+this.ZOOM_FLASH_EXTERIOR).html();
this._zoomLayerInteriorHTML=A("#"+this.ZOOM_FLASH_INTERIOR).html();
this._zoomLayerMmgNgHTML=A("#"+this.ZOOM_FLASH_MMG_NG).html();
},openZoom:function(E){var B,C;
var D=this;
this._removeLoadAnis();
if(this._myDialog==null){this._myDialog=A("#"+this.ZOOM_LIGHTBOX_ID).dialog({bgiframe:true,resizable:false,zIndex:3999,draggable:false,modal:true,position:["center",this.ZOOM_LAYER_YPOSITION],autoOpen:false,dialogClass:D.DIALOG_NO_TITLE});
}swfobject.switchOffAutoHideShow();
this.changeZoom(E);
},changeZoom:function(C,B){this.resetFlashMovies();
if(!this._myDialog.dialog("isOpen")){this._myDialog.dialog("open");
}if((C==1&&B==true)||(C==1&&this._typeOfLargeImg==this.TYPE_EXT&&B!=true)||(C==0&&this._typeOfLargeImg==this.TYPE_INT&&B!=true)){if(this._intZoomNgBean!=null){this._mmgNgBean=this._intZoomNgBean;
this.openRttView(this.TYPE_INT_RTT);
}else{this.openInteriorView();
}}else{if(this._extZoomNgBean!=null){this._mmgNgBean=this._extZoomNgBean;
this.openRttView(this.TYPE_EXT_RTT);
}else{this.openExteriorView();
}}this._myDialog.dialog("option","position",["center",this.ZOOM_LAYER_YPOSITION]);
},openInteriorView:function(){var B={segmentsLow:"16",segmentsHigh:"24",width:this.FLASH_EXTERIOR_WIDTH,height:this.FLASH_EXTERIOR_HEIGHT};
var F={menu:"false",scale:"noScale",allowscriptaccess:"always"};
var C={};
var D=A("#"+this.ZOOM_FLASH_INTERIOR_CONTENT).html();
if(D==""||D==null){mrm.util.log("[mds-vc-cmp-image.embedInterior]");
if(A.browser.msie){var E=document.title;
}swfobject.embedSWF(mds_vc_baseURL+this.FLASH_INTERIOR_URL,this.ZOOM_FLASH_INTERIOR_CONTENT,this.FLASH_EXTERIOR_WIDTH,this.FLASH_EXTERIOR_HEIGHT,"8.0.0",null,B,F,C);
if(A.browser.msie){document.title=E;
}}this.startinterior();
this._myDialog.dialog("option","width",this.ZOOM_LAYER_INTERIOR_WIDTH);
this._myDialog.dialog("option","height",this.ZOOM_LAYER_INTERIOR_HEIGHT);
A("#"+this.ZOOM_FLASH_EXTERIOR).addClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_FLASH_INTERIOR).removeClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_FLASH_MMG_NG).addClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_LIGHTBOX_ID).removeClass(this.HIDE_CSS_CLASS).children("ul.view-perspective").removeClass(this.HIDE_ACC_CLASS);
if(this._isBothZoom()){A("#"+this.ZOOM_EXT_ID).removeClass(this.VIEW_ACTIVE_CLASS);
A("#"+this.ZOOM_INT_ID).addClass(this.VIEW_ACTIVE_CLASS);
}},openExteriorView:function(){var B=A("#"+this.ZOOM_FLASH_EXTERIOR_CONTENT).html();
if(B==""||B==null){if(A.browser.msie){var C=document.title;
}swfobject.embedSWF(mds_vc_baseURL+this.FLASH_EXTERIOR_URL,this.ZOOM_FLASH_EXTERIOR_CONTENT,this.FLASH_INTERIOR_WIDTH,this.FLASH_INTERIOR_HEIGHT,"8.0.0",null,{backgroundImage:this._extZoomBackgroundURL,mmgUrl:escape(this._extZoomURL),XOffset:0,YOffset:0});
if(A.browser.msie){document.title=C;
}}this._myDialog.dialog("option","width",this.ZOOM_LAYER_EXTERIOR_WIDTH);
this._myDialog.dialog("option","height",this.ZOOM_LAYER_EXTERIOR_HEIGHT);
A("#"+this.ZOOM_FLASH_EXTERIOR).removeClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_FLASH_INTERIOR).addClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_FLASH_MMG_NG).addClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_LIGHTBOX_ID).removeClass(this.HIDE_CSS_CLASS).children("ul.view-perspective").removeClass(this.HIDE_ACC_CLASS);
if(this._isBothZoom()){A("#"+this.ZOOM_EXT_ID).addClass(this.VIEW_ACTIVE_CLASS);
A("#"+this.ZOOM_INT_ID).removeClass(this.VIEW_ACTIVE_CLASS);
}},openRttView:function(B){if(this.mmgNgFlashInstance!=null){var E=(this._extZoomNgBean)?this._extZoomNgBean.configuration:null;
this.mmgNgFlashInstance.setExtConf(E);
var D=(this._intZoomNgBean)?this._intZoomNgBean.configuration:null;
this.mmgNgFlashInstance.setIntConf(D);
this.mmgNgFlashInstance.setViewType(B);
this.mmgNgFlashInstance.embedSWF();
}else{var C={layout:"POPUP",company:mds_vc_brand.toUpperCase(),version:"1.5.1",enginePath:mds_vc_baseURL+this.FLASH_MMG_NG_SWF_PATH,rttPath:mds_vc_baseURL+this.FLASH_MMG_NG_SWF_PATH,assetPath:this._mmgNgBean.assetPath,guiPath:this._mmgNgBean.assetPath,bgCode:this._mmgNgBean.backgroundCode,language:mds_vc_language,market:mds_vc_country,driverPosition:this._mmgNgBean.driverPosition,flashId:this.ZOOM_FLASH_MMG_NG_CONTENT,viewType:B,XMLUrl:this._mmgNgBean.assetPath+"/"+this._mmgNgBean.metaDataXml,width:this.FLASH_MMG_NG_WIDTH,height:this.FLASH_MMG_NG_HEIGHT,extConf:(this._extZoomNgBean)?this._extZoomNgBean.configuration:null,intConf:(this._intZoomNgBean)?this._intZoomNgBean.configuration:null};
A("#"+this.ZOOM_FLASH_MMG_NG).bind("viewUndefined.rtt",A.proxy(this.rttViewUndefined,this));
this.mmgNgFlashInstance=new mrm.cmp.rtt(C);
}this._myDialog.dialog("option","width",this.ZOOM_LAYER_MMG_NG_WIDTH);
this._myDialog.dialog("option","height",this.ZOOM_LAYER_MMG_NG_HEIGHT);
A("#"+this.ZOOM_FLASH_EXTERIOR).addClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_FLASH_INTERIOR).addClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_FLASH_MMG_NG).removeClass(this.HIDE_ACC_CLASS);
A("#"+this.ZOOM_LIGHTBOX_ID).removeClass(this.HIDE_CSS_CLASS).children("ul.view-perspective").addClass(this.HIDE_ACC_CLASS);
if(this._isBothZoom()){A("#"+this.ZOOM_EXT_ID).removeClass(this.VIEW_ACTIVE_CLASS);
A("#"+this.ZOOM_INT_ID).addClass(this.VIEW_ACTIVE_CLASS);
}},rttViewUndefined:function(C,B){if(B==this.TYPE_INT_RTT&&this._typeOfLargeImg==this.TYPE_INT){this.changeZoom(0);
}else{if(B==this.TYPE_INT_RTT&&this._typeOfLargeImg==this.TYPE_EXT){this.changeZoom(1);
}else{if(B==this.TYPE_EXT_RTT&&this._typeOfLargeImg==this.TYPE_EXT){this.changeZoom(0);
}else{this.changeZoom(1);
}}}},startinterior:function(){mrm.util.log("[mds-vc-cmp-image.startinterior]");
var B=swfobject.getObjectById(this.ZOOM_FLASH_INTERIOR_CONTENT);
if(B!=undefined&&B.cleanUp!=undefined&&B.start!=undefined){mrm.util.log("[flashobject_interior]");
B.cleanUp();
B.start("14","24");
this.changeinterior(this._intZoomURL);
}else{if(B==undefined){mrm.util.log("[mds-vc-cmp-image] flashobject_interior undefined - will try again");
}else{if(B.cleanUp==undefined){mrm.util.log("[mds-vc-cmp-image] flashobject_interior.cleanUp undefined - will try again");
}else{if(B.start==undefined){mrm.util.log("[mds-vc-cmp-image] flashobject_interior.start undefined - will try again");
}else{if(_componentFromRegister("image")==undefined){mrm.util.error('[mds-vc-cmp-image] mds_vc_ViewController._componentFromRegister("image") undefined');
}else{if(_componentFromRegister("image").startinterior()==undefined){mrm.util.error('[mds-vc-cmp-image] mds_vc_ViewController._componentFromRegister("image").startinterior() undefined');
}}}}}setTimeout('_componentFromRegister("image").startinterior()',500);
}},changeinterior:function(B){mrm.util.log("[mds-vc-cmp-image.changeinterior] - URL: "+B);
if(B!=undefined){var C=swfobject.getObjectById(this.ZOOM_FLASH_INTERIOR_CONTENT);
if(C!=undefined&&C.changeConfiguration!=undefined&&C.canChange()){mrm.util.log("[mds-vc-cmp-image.startinterior.changeConfiguration]");
C.changeConfiguration(B);
}else{if(C==undefined){mrm.util.log("[mds-vc-cmp-image] flashobject_interior undefined");
}if(C.changeConfiguration==undefined){mrm.util.log("[mds-vc-cmp-image] flashobject_interior.changeConfiguration undefined");
}if(_componentFromRegister("image")==undefined){mrm.util.error('[mds-vc-cmp-image] mds_vc_ViewController._componentFromRegister("image") undefined');
}if(_componentFromRegister("image").changeinterior()==undefined){mrm.util.error('[mds-vc-cmp-image] mds_vc_ViewController._componentFromRegister("image").changeinterior() undefined');
}setTimeout('_componentFromRegister("image").changeinterior("'+B+'")',500);
}}},resetFlashMovies:function(){if(swfobject.getObjectById(this.ZOOM_FLASH_EXTERIOR_CONTENT)){swfobject.removeSWF(this.ZOOM_FLASH_EXTERIOR_CONTENT);
}if(swfobject.getObjectById(this.ZOOM_FLASH_INTERIOR_CONTENT)){swfobject.removeSWF(this.ZOOM_FLASH_INTERIOR_CONTENT);
}if(swfobject.getObjectById(this.ZOOM_FLASH_MMG_NG_CONTENT)){swfobject.getObjectById(this.ZOOM_FLASH_MMG_NG_CONTENT).rtt_mmg_ng_swf_close();
rtt_mmg_ng_loaded=false;
swfobject.removeSWF(this.ZOOM_FLASH_MMG_NG_CONTENT);
}A("#"+this.ZOOM_FLASH_EXTERIOR).html(this._zoomLayerExteriorHTML);
A("#"+this.ZOOM_FLASH_INTERIOR).html(this._zoomLayerInteriorHTML);
A("#"+this.ZOOM_FLASH_MMG_NG).html(this._zoomLayerMmgNgHTML);
},closeZoom:function(){this.resetFlashMovies();
this._myDialog.dialog("close");
},changeView:function(B){this._curPerspName=null;
this._typeOfLargeImg=B;
this._checkLinks();
this._changeViewLinks();
this._changePerspLinks();
this._changeActivePerspLink();
this._changeImages();
},changePersp:function(C){if(C==null||C==undefined||C==""){var E,D;
if(this._typeOfLargeImg==this.TYPE_EXT){E=this._dataObject.payload.configurationResult.exteriorImageViewSet.viewSet.namedView;
}else{E=this._dataObject.payload.configurationResult.interiorImageViewSet.viewSet.namedView;
}var F=false;
var B=this;
C=null;
A.each(E,function(){if(F==true){C=B._typeOfLargeImg+this.name;
return false;
}if(B._curPerspName==B._typeOfLargeImg+this.name||B._curPerspName==null){F=true;
}});
if(F==true&&C==null){C=this._typeOfLargeImg+E[0].name;
}this._changePerspLinks();
}this._curPerspName=C;
this._changeActivePerspLink();
this._changeImages();
},toggle:function(){if(this._typeOfLargeImg==this.TYPE_EXT){this.changeView(this.TYPE_INT);
}else{this.changeView(this.TYPE_EXT);
}},_updateJSON:function(B){this._init360();
this._checkLinks();
this._changePerspLinks();
this._changeActivePerspLink();
this._changeImages();
this._updateDisclaimer();
this._sendUpdatedMessage(B);
},_addEvents:function(){var B=this;
A("#"+this.ZOOM_LNK_LARGE_ID).unbind("click").click(function(){return false;
}).click(function(){B.openZoom(0);
});
A("#"+this.ZOOM_LNK_SMALL_ID).unbind("click").click(function(){return false;
}).click(function(){B.openZoom(1);
});
A("."+this.ZOOM_CLOSE_LNK_CLASS).unbind("click").click(function(){return false;
}).click(function(){B.closeZoom();
});
A("#"+this.ZOOM_EXT_ID).unbind("click").click(function(){return false;
}).click(function(){B.changeZoom(0,true);
});
A("#"+this.ZOOM_INT_ID).unbind("click").click(function(){return false;
}).click(function(){B.changeZoom(1,true);
});
A("#"+this.VIEW_EXT_ID).unbind("click").click(function(){return false;
}).click(function(){B.changeView(B.TYPE_EXT);
});
A("#"+this.VIEW_INT_ID).unbind("click").click(function(){return false;
}).click(function(){B.changeView(B.TYPE_INT);
});
A("#"+this.TOGGLE_LNK_ID).unbind("click").click(function(){return false;
}).click(function(){B.toggle();
});
A("#"+this.NEXT_LNK_ID).unbind("click").click(function(){return false;
}).click(function(){B.changePersp(null);
});
},_rewriteRef:function(B){if(B==null||B==undefined){B=A("#"+this._domId);
}var C=A("#"+this.IMAGE_LARGE_ID);
var D=A("#"+this.IMAGE_SMALL_ID);
if(C.attr("rel")!=null&&C.attr("rel")!=undefined&&C.attr("rel")!=""){C.attr("src",C.attr("rel"));
}if(D.attr("rel")!=null&&D.attr("rel")!=undefined&&D.attr("rel")!=""){D.attr("src",D.attr("rel"));
}},_updateDisclaimer:function(){var B=this._dataObject.payload.configurationResult.exteriorImageViewSet.disclaimer;
if(B!=undefined&&B!=null){A("#"+this.LEGAL_TEXT_ID).text(B);
}else{A("#"+this.LEGAL_TEXT_ID).text("");
}},_changeViewLinks:function(){if(this._typeOfLargeImg==this.TYPE_EXT){A("#"+this.VIEW_EXT_ID).parents("."+this.VIEW_CTR_CLASS).addClass(this.VIEW_ACTIVE_CLASS);
A("#"+this.VIEW_INT_ID).parents("."+this.VIEW_CTR_CLASS).removeClass(this.VIEW_ACTIVE_CLASS);
}else{A("#"+this.VIEW_EXT_ID).parents("."+this.VIEW_CTR_CLASS).removeClass(this.VIEW_ACTIVE_CLASS);
A("#"+this.VIEW_INT_ID).parents("."+this.VIEW_CTR_CLASS).addClass(this.VIEW_ACTIVE_CLASS);
}},_changePerspLinks:function(){if(this._dataObject.payload!=null&&this._dataObject.payload!=undefined){var E=this;
var F;
var C;
if(this._typeOfLargeImg==this.TYPE_EXT){F=this._dataObject.payload.configurationResult.exteriorImageViewSet.viewSet.namedView;
C=this.TYPE_EXT;
}else{F=this._dataObject.payload.configurationResult.interiorImageViewSet.viewSet.namedView;
C=this.TYPE_INT;
}var B=[];
var D=0;
A.each(F,function(){D++;
});
if(D>1){var H=true;
A.each(F,function(){B.push(E.PERSP_NAME_PREFIX+C+this.name);
var J=A("#"+E.PERSP_NAME_PREFIX+C+this.name);
if(J.attr("id")){J.removeClass(E.HIDE_CSS_CLASS);
}else{J=A("#"+E.PERSP_PROTO_ID).clone().removeAttr("id").attr("id",E.PERSP_NAME_PREFIX+C+this.name);
A("."+E.PERSP_NAME_LNK_CLASS,J).text(this.label);
J.removeClass(E.HIDE_CSS_CLASS);
A("#"+E.PRESP_CTR_ID).append(J);
}var I=this;
A("."+E.PERSP_NAME_LNK_CLASS,J).unbind("click").click(function(){return false;
}).click(function(){E.changePersp(C+I.name);
});
});
if(A("#"+E.PRESP_CTR_ID).hasClass(E.HIDE_CSS_CLASS)){A("#"+E.PRESP_CTR_ID).removeClass(E.HIDE_CSS_CLASS);
}}else{if(!A("#"+E.PRESP_CTR_ID).hasClass(E.HIDE_CSS_CLASS)){A("#"+E.PRESP_CTR_ID).addClass(E.HIDE_CSS_CLASS);
}}var G;
A.each(A("."+E.PERSP_NAME_CTR_CLASS),function(){if(A.inArray(this.id,B)<0){G=A(this);
G.parent().append(G);
G.addClass(E.HIDE_CSS_CLASS);
}});
}},_changeActivePerspLink:function(){var B=this;
var C=false;
A.each(A("."+this.PERSP_NAME_CTR_CLASS+":visible"),function(){if(A(this).attr("id")==B.PERSP_NAME_PREFIX+B._curPerspName){C=true;
A(this).addClass(B.PERSP_ACTIVE_CLASS);
}else{A(this).removeClass(B.PERSP_ACTIVE_CLASS);
}});
if(!C||this._curPerspName==""||this._curPerspName==null){A("."+this.PERSP_NAME_CTR_CLASS+":visible:first").addClass(this.PERSP_ACTIVE_CLASS);
}},_init360:function(){this._intZoomURL=null;
this._extZoomURL=null;
this._intZoomNgBean=null;
this._extZoomNgBean=null;
if(this._dataObject.payload!=null&&this._dataObject.payload!=undefined){var C=this;
var B=this._dataObject.payload.configurationResult.interiorImageViewSet.namedView;
A.each(B,function(){if(this.name=="zoom_360"){C._intZoomURL=this["$"];
}if(this.name=="zoom_ng_360"){C._intZoomNgBean=this;
}});
B=this._dataObject.payload.configurationResult.exteriorImageViewSet.namedView;
A.each(B,function(){if(this.name=="zoom_360"){C._extZoomURL=this["$"];
}if(this.name=="zoom_ng_360"){C._extZoomNgBean=this;
}});
A.each(B,function(){if(this.name=="zoom_360_background"){C._extZoomBackgroundURL=this["$"];
}});
}},_changeImages:function(){if(this._dataObject.payload!=null&&this._dataObject.payload!=undefined){var J,H,E;
var D=null;
if(this._typeOfLargeImg==this.TYPE_EXT){J=this._dataObject.payload.configurationResult.exteriorImageViewSet.viewSet;
E=this._dataObject.payload.configurationResult.interiorImageViewSet.namedView;
if(E!=null&&E!=undefined){A.each(E,function(){if(this.name=="small"){D=this["$"];
}});
}H=this.TYPE_EXT;
}else{J=this._dataObject.payload.configurationResult.interiorImageViewSet.viewSet;
E=this._dataObject.payload.configurationResult.exteriorImageViewSet.namedView;
if(E!=null&&E!=undefined){A.each(E,function(){if(this.name=="small"){D=this["$"];
}});
}H=this.TYPE_INT;
}var G;
var I=this;
var B;
A.each(J.namedView,function(){B=H+this.name;
if(I._curPerspName==null||I._curPerspName==B){G=this;
return false;
}});
var C=A("#"+this.IMAGE_LARGE_ID);
var F=A("#"+this.IMAGE_SMALL_ID);
if(C.length>0&&F.length>0){if(C.attr("src")!=G["$"]||(F.attr("src")!=D&&D!=null)){this._removeLoadAnis();
}if(C.attr("src")!=G["$"]){C.preload(this._getLoadAniClone(),this.HIDE_ACC_CLASS).attr("src",G["$"]);
}if(F.attr("src")!=D&&D!=null){F.preload(this._getLoadAniClone(),this.HIDE_ACC_CLASS).attr("src",D);
}}}},_addLoadAni:function(){var B=A("#"+this.IMAGE_LARGE_ID);
if(B.length>0){B.preload(this._getLoadAniClone(),this.HIDE_ACC_CLASS,true);
}var C=A("#"+this.IMAGE_SMALL_ID);
if(C.length>0){C.preload(this._getLoadAniClone(),this.HIDE_ACC_CLASS,true);
}},_checkLinks:function(){var H=A("#"+this.VIEW_EXT_ID).parents("."+this.VIEW_CTR_CLASS);
var J=A("#"+this.VIEW_INT_ID).parents("."+this.VIEW_CTR_CLASS);
var G=this._dataObject.payload.configurationResult;
var B=false;
var F=0;
if(G.interiorImageViewSet!=null&&G.interiorImageViewSet!=undefined){var I=G.interiorImageViewSet.viewSet;
if(I!=null&&I!=undefined){if(I.namedView!=null&&I.namedView!=undefined){A.each(I.namedView,function(){F++;
});
if(F>0){B=true;
}}}}var E=0;
if(G.exteriorImageViewSet!=null&&G.exteriorImageViewSet!=undefined){I=G.exteriorImageViewSet.viewSet;
if(I!=null&&I!=undefined){if(I.namedView!=null&&I.namedView!=undefined){A.each(I.namedView,function(){E++;
});
}}}if(B&&H.length>0&&J.length>0){if(H.hasClass(this.HIDE_CSS_CLASS)){H.removeClass(this.HIDE_CSS_CLASS);
}if(J.hasClass(this.HIDE_CSS_CLASS)){J.removeClass(this.HIDE_CSS_CLASS);
}}else{if(H.length>0&&J.length>0){if(!H.hasClass(this.HIDE_CSS_CLASS)){H.addClass(this.HIDE_CSS_CLASS);
}if(!J.hasClass(this.HIDE_CSS_CLASS)){J.addClass(this.HIDE_CSS_CLASS);
}}}if(H.hasClass(this.HIDE_CSS_CLASS)&&J.hasClass(this.HIDE_CSS_CLASS)){H.parent("ul").addClass(this.HIDE_CSS_CLASS);
}var D=A("#"+this.TOGGLE_LNK_ID);
var C=A("#"+this.IMAGE_SMALL_ID);
if(D.length>0&&C.length>0){if(B){if(D.hasClass(this.HIDE_CSS_CLASS)){D.removeClass(this.HIDE_CSS_CLASS);
}if(C.parents("#"+this.TOGGLE_LNK_ID).length==0){D.append(C);
}}else{if(C.parents("#"+this.TOGGLE_LNK_ID).length>=0){D.before(C);
}if(!D.hasClass(this.HIDE_CSS_CLASS)){D.addClass(this.HIDE_CSS_CLASS);
}}}D=A("#"+this.NEXT_LNK_ID);
C=A("#"+this.IMAGE_LARGE_ID);
if(D.length>0&&C.length>0){if(F>1&&this._typeOfLargeImg==this.TYPE_INT||this._typeOfLargeImg==this.TYPE_EXT&&E>1){if(D.hasClass(this.HIDE_CSS_CLASS)){D.removeClass(this.HIDE_CSS_CLASS);
}if(C.parents("#"+this.NEXT_LNK_ID).length==0){D.append(C);
}}else{if(C.parents("#"+this.NEXT_LNK_ID).length>=0){D.before(C);
}if(!D.hasClass(this.HIDE_CSS_CLASS)){D.addClass(this.HIDE_CSS_CLASS);
}}}this._check360links();
},_check360links:function(){var D=A("#"+this.ZOOM_LNK_LARGE_ID);
var C=A("#"+this.ZOOM_LNK_SMALL_ID);
if((this._isIntZoom()&&this._typeOfLargeImg==this.TYPE_EXT)||(this._typeOfLargeImg==this.TYPE_INT&&this._isExtZoom())){if(C.hasClass(this.HIDE_CSS_CLASS)){C.removeClass(this.HIDE_CSS_CLASS);
}}else{if(!C.hasClass(this.HIDE_CSS_CLASS)){C.addClass(this.HIDE_CSS_CLASS);
}}if((this._isExtZoom()&&this._typeOfLargeImg==this.TYPE_EXT)||(this._typeOfLargeImg==this.TYPE_INT&&this._isIntZoom())){if(D.hasClass(this.HIDE_CSS_CLASS)){D.removeClass(this.HIDE_CSS_CLASS);
}}else{if(!D.hasClass(this.HIDE_CSS_CLASS)){D.addClass(this.HIDE_CSS_CLASS);
}}var B=A("#"+this.ZOOM_EXT_ID);
var E=A("#"+this.ZOOM_INT_ID);
if(this._isBothZoom()){if(B.hasClass(this.HIDE_CSS_CLASS)){B.removeClass(this.HIDE_CSS_CLASS);
}if(E.hasClass(this.HIDE_CSS_CLASS)){E.removeClass(this.HIDE_CSS_CLASS);
}}else{if(!B.hasClass(this.HIDE_CSS_CLASS)){B.addClass(this.HIDE_CSS_CLASS);
}if(!E.hasClass(this.HIDE_CSS_CLASS)){E.addClass(this.HIDE_CSS_CLASS);
}}},_isExtZoom:function(){return this._extZoomURL!=null||this._extZoomNgBean!=null;
},_isIntZoom:function(){return this._intZoomURL!=null||this._intZoomNgBean!=null;
},_isBothZoom:function(){return this._isExtZoom()&&this._isIntZoom();
},_getStandardView:function(){if(this._typeOfLargeImg==this.TYPE_INT){return"Interior";
}else{return"Exterior";
}},_getThumbnailView:function(){if(this._typeOfLargeImg==this.TYPE_INT){return"Exterior";
}else{return"Interior";
}}});
})(jQuery);

var LegalInformationComponent;
(function(A){LegalInformationComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"legalDisclaimer",INSERT_CACHE:true,init:function(){this._requestProvider(false,true,null);
},refresh:function(){this._requestProvider(false,true,null);
},_requestProvider:function(C,B,D){if(B==true){this.__base(C,B,D);
}else{this._requestCallback({"payload":"dummy","type":"json"},D,false,false);
}},_updateJSON:function(B){this._sendUpdatedMessage(B);
}});
})(jQuery);

var LocateNewVehicleComponent;
(function(A){LocateNewVehicleComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"lnvComponent",DEFAULT_ELEMENTS_CLASS:"mds-vc-cmp-lnv-default",FALLBACK_ELEMENTS_CLASS:"mds-vc-cmp-lnv-fallback",FOREIGN_ELEMENTS_CLASS:"mds-vc-cmp-lnv-foreign",_serviceQuery:null,insert:function(B){this._requestProvider(true,false,true);
},_updateJSON:function(F){var D=null;
try{D=this._dataObject.payload.lnv_component.lnv_request_uri;
}catch(E){mds_vc_ErrorController.log("WARNING: Component "+this._cmpId+" could not fetch the service URI from the components payload.");
}if(D!=this._serviceQuery&&D!=null&&typeof (D)=="string"){var C=A("#"+this._domId);
A("."+this.FOREIGN_ELEMENTS_CLASS,C).remove();
var B=this;
A.each(A("."+this.DEFAULT_ELEMENTS_CLASS,C),function(){if(A(this).hasClass(B.HIDE_CSS_CLASS)){A(this).removeClass(B.HIDE_CSS_CLASS);
}});
this._serviceQuery=D;
this._afterUpdate(F,false);
}else{if(D!=this._serviceQuery||D==null){this._reset();
}}this._sendUpdatedMessage(F);
},_afterUpdate:function(F,D){var C=false;
if(this._serviceQuery!=null){var B=this;
try{A.ajax({global:false,type:"GET",url:B._serviceQuery,dataType:"html",success:function(G,H){B._callback(G);
},error:function(G,I,H){B._fallback();
}});
}catch(E){mds_vc_ErrorController.error(999,"EXCEPTION: XmlHttpRequest in component "+B._cmpId+" failed.",E);
}}else{this._fallback();
}this.__base(F,D);
},_callback:function(G){var F=A("#"+this._domId);
var C=this;
var B=A("."+this.DEFAULT_ELEMENTS_CLASS,F);
F.after("<div>");
var E=F.next("div:eq(0)").addClass(this.HIDE_CSS_CLASS).append(G);
var D=E.children().addClass(this.FOREIGN_ELEMENTS_CLASS);
F.prepend(D);
A.each(B,function(){if(!A(this).hasClass(C.HIDE_CSS_CLASS)){A(this).addClass(C.HIDE_CSS_CLASS);
}});
D.removeClass(this.HIDE_CSS_CLASS);
E.remove();
},_fallback:function(){var C=A("#"+this._domId);
var B=this;
A.each(A("."+this.DEFAULT_ELEMENTS_CLASS,C),function(){if(!A(this).hasClass(B.HIDE_CSS_CLASS)){A(this).addClass(B.HIDE_CSS_CLASS);
}});
A.each(A("."+this.FALLBACK_ELEMENTS_CLASS,C),function(){if(A(this).hasClass(B.HIDE_CSS_CLASS)){A(this).removeClass(B.HIDE_CSS_CLASS);
}});
},_reset:function(){var C=A("#"+this._domId);
var B=this;
A.each(A("."+this.FALLBACK_ELEMENTS_CLASS,C),function(){if(!A(this).hasClass(B.HIDE_CSS_CLASS)){A(this).addClass(B.HIDE_CSS_CLASS);
}});
A.each(A("."+this.DEFAULT_ELEMENTS_CLASS,C),function(){if(!A(this).hasClass(B.HIDE_CSS_CLASS)){A(this).addClass(B.HIDE_CSS_CLASS);
}});
A("."+this.FOREIGN_ELEMENTS_CLASS,C).remove();
}});
})(jQuery);

var CompareLegalComponent;
(function(A){CompareLegalComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"legalDisclaimer",INSERT_CACHE:true,init:function(){this._requestProvider(false,true,null);
},refresh:function(){this._requestProvider(false,true,null);
},_requestProvider:function(C,B,D){if(B==true){this.__base(C,B,D);
}else{this._requestCallback({"payload":"dummy","type":"json"},D,false,false);
}},_updateJSON:function(B){this._sendUpdatedMessage(B);
}});
})(jQuery);

var OptionsComponent;
(function(A){OptionsComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"optionSelection",INSERT_CACHE:true,init:function(){this._requestProvider(false,true,null);
},insert:function(B){this._killZooms();
this.__base(B);
},onOptionChange:function(B){},_updateJSON:function(B){this._updateOptionJSON(B);
},_addLocalEvents:function(){var C=A("#"+this._domId);
var B=this;
this.__base();
A("."+this.TAB_ITM_CLASS,A("#"+this._domId)).click(function(){return false;
}).click(function(D){B.updateTabs(D);
});
A("."+this.TOGGLE_LNK_CLASS,C).unbind("click").click(function(){return false;
}).click(function(D){B.toggleDetails(D);
});
this._initZooms();
A("."+this.IMG_ZOOM_LNK_CLASS,C).unbind("click").click(function(){return false;
}).click(function(D){B.zoomImage(D);
});
}});
})(jQuery);

var SummaryComponent;
(function(A){SummaryComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"summary",ADDTHIS_LNK_ID:"mds-vc-addthis-lnk",PRINT_LINK_ID:"mds-vc-print-lnk",init:function(){this._requestProvider(false,true,null);
},refresh:function(){this._requestProvider(false,true,null);
},showComponent:function(B){this.__base(B);
if(B){this._initAddthis();
}},_addLocalEvents:function(){var C=A("#"+this._domId);
var B=this;
A("."+this.OPTION_CTR_CLASS,C).unbind("hover").hover(function(){B.onOptionHover(this,true);
},function(){B.onOptionHover(this,false);
});
A("."+this.TOGGLE_LNK_CLASS,C).unbind("click").click(function(){return false;
}).click(function(D){B.toggleDetails(D);
});
},_initAddthis:function(){try{if(A("#"+this.ADDTHIS_LNK_ID).length>0){var C=A("#"+this.ADDTHIS_LNK_ID);
if(C.attr("addthis:url").substr(0,4)!="http"){C.attr("addthis:url",document.location.protocol+"//"+document.location.host+C.attr("addthis:url"));
}addthis.button("#"+this.ADDTHIS_LNK_ID);
}}catch(D){var B=this;
window.setTimeout(function(){B._initAddthis();
},2500);
}},toggleDetails:function(B){var C=A(this._getEventTarget(B)).parents("."+this.TOGGLE_CTR_CLASS);
if(C.length<=0){return ;
}C.toggleClass(this.ACTIVE_CLASS);
if(!C.is("tr")){return ;
}if(C.hasClass(this.ACTIVE_CLASS)){C.nextUntil(':not(tr[class^="item"])').addClass(this.ACTIVE_CLASS);
C.nextAll("tr.total:first").addClass(this.ACTIVE_CLASS);
}else{C.nextUntil(':not(tr[class^="item"])').removeClass(this.ACTIVE_CLASS);
C.nextAll("tr.total:first").removeClass(this.ACTIVE_CLASS);
}}});
})(jQuery);

var TotalPriceComponent;
(function(A){TotalPriceComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"priceTotal",init:function(){this._requestProvider(false,true,null);
},refresh:function(){this._requestProvider(false,true,null);
}});
})(jQuery);

var TrimsSeriesComponent;
(function(A){TrimsSeriesComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"seriesSelection",INSERT_CACHE:true,_initialized:false,_infoFilter:null,init:function(){this._requestProvider(false,true,null);
},filter:function(D,B,C){this.__base(D,B,C);
if(D!="undefined"&&D!=undefined&&D!=null){this._infoFilter=A(this._getEventTarget(D)).find("option:selected").val();
}},onOptionChange:function(B){this.__base(B);
this._infoFilter=null;
this.information(B);
},_updateJSON:function(B){this._updateSelectionJSON(B);
},_hookHTML:function(C,B){this.__base(C,B);
this._initialized=false;
this._init(B);
},_init:function(B){B=this._checkScope(B);
if(!this._initialized){this._infoFilter=null;
this._initialized=true;
}var C=null;
A.each(A("."+this.EVENT_CSS_CLASS,B),function(D){if(A(this).prop("checked")==true){C=D;
return false;
}});
if(C!=null){B=A("."+this.INFO_CNT_CLASS+":eq("+C+")",B);
}this._initFilter(this._infoFilter,B);
},_addLocalEvents:function(){this.__base();
var B=this;
A("."+this.FILTER_SEL_CLASS,A("#"+this._domId)).unbind("change").change(function(C){B.filter(C);
});
}});
})(jQuery);

var PaymentEstimatorComponent;
(function(A){PaymentEstimatorComponent=A.inherit(AbstractComponent,{PROVIDER_URL:"financeCalculator",init:function(){A("#"+this.VC_DOM_ID).delegate("a.gmac-pe-layer","click",A.proxy(this.onLayerTriggerClicked,this));
this._$ctx.delegate("button.recalc","click",A.proxy(this.onRecalculateClicked,this)).delegate("button.confirm","click",A.proxy(this.onConfirmClicked,this)).delegate("input#leasingModelParameter-advance","keyup",A.proxy(this.validateAdvanceValue,this)).delegate("input#smartBuyModelParameter-advance","keyup",A.proxy(this.validateAdvanceValue,this)).bind("submit",function(B){B.preventDefault();
});
this._$ctx.trigger("VC_CMP_DataRefresh",{cmpId:this._cmpId,isViewChange:false,error:false,notModified:false});
},insert:function(B){this._$ctx.trigger("VC_CMP_DataRefresh",{cmpId:this._cmpId,isViewChange:true,error:false,notModified:false});
},update:function(B){this._sendUpdatedMessage(B);
},refresh:function(){this._$ctx.trigger("VC_CMP_DataRefresh",{cmpId:this._cmpId,isViewChange:false,error:false,notModified:true});
},onLayerTriggerClicked:function(C){C.preventDefault();
var B=this;
this._$ctx.load(this.PROVIDER_BASE_URL+this.PROVIDER_URL,function(E,F,D){if(F=="error"){mds_vc_ErrorController.error(999,"EXCEPTION: Server answered with error state");
}else{B.initLayerContent();
B._$ctx.removeClass(B.HIDE_CSS_CLASS).dialog({modal:true,width:"auto"});
}});
},onRecalculateClicked:function(C){var B=this;
this.updateLayerContent(C,function(E,F,D){B._$ctx.empty().append(A(E).filter("div:first"));
B.initLayerContent();
});
},onConfirmClicked:function(C){var B=this;
this.updateLayerContent(C,function(E,F,D){B._$ctx.addClass(B.HIDE_CSS_CLASS).dialog("close");
A("#"+B.VC_DOM_ID).trigger("VC_UI_Refresh");
});
},updateLayerContent:function(E,G){var D=this;
var F=A(E.currentTarget);
var C=F.closest("form");
var B=C.serializeArray();
B.push({name:F.attr("name"),value:F.val()});
A.ajax({url:this.PROVIDER_BASE_URL+this.PROVIDER_URL,contentType:"application/x-www-form-urlencoded",dataType:"html",data:B,type:"POST",success:G,error:function(I,J,H){mds_vc_ErrorController.error(999,"EXCEPTION: Server answered with error state");
}});
},initLayerContent:function(){this._$ctx.find(":input").bind("invalid",function(F){F.preventDefault();
});
var E=this;
var D=this._$ctx.find(".nav_tablay_1");
var C=A("#"+E._$ctx.find("#pe-active_tab").val());
var B=D.children("fieldset").index(C);
D.tabs({selected:B,show:function(F,G){E._$ctx.find("#pe-active_tab").val(A(G.panel).attr("id"));
}});
},validateAdvanceValue:function(E){var B=A(E.target);
var C=String(B.val()).replace(/\D/,"");
B.val("").val(C);
var F=parseInt(B.val());
var D=parseInt(this._$ctx.find("#pe-totalprice").val());
if(F<0){B.val(0);
}else{if(F>D){B.val(D);
}}}});
})(jQuery);


