function getBrand(){return window.location.href.match(/chrysler/)?"c":(window.location.href.match(/dodge/)?"d":(window.location.href.match(/jeep/)?"j":"u"));}var brand=getBrand();function getYearOptList(g){var e=g.length;var h="";if(g.length>0){for(var f=0;f<e;f++){h+='<option value="'+f+'">'+g[f].uYear+"</option>";}}return h;}function getVehicleOptList(i,h,g){var k=i.length;var j="";if(i.length>0){for(var l=0;l<k;l++){if(h==i[l].uYear&&g==i[l].uBrand){j+='<option value="'+l+'">'+i[l].uModel+"</option>";}}}return j;}function getVendorURL(g){var h="";var j=UConnectVendors.length;var i="";if(g){h=g;}else{h=getUconnectCookie("uconnect");}if(UConnectVendors.length>0){for(var f=0;f<j;f++){if(h==UConnectVendors[f].uVendor){i=UConnectVendors[f].uActionUrl;}}}return i;}function doYearAction(argYear){var yearIndx=getE("selectYear").value;var rtn="";var actionStr="";writeH("formModelSelect","");hideE("formModelSelect");writeH("formNavSelect","");hideE("formNavSelect");if(UConnectYears.length>0&&yearIndx!=""){actionStr=UConnectYears[yearIndx].uAction.replace(/argYear/g,UConnectYears[yearIndx].uYear);eval(actionStr);return true;}else{hideE("formGoButton");}return false;}function doModelAction(g){var e=UConnectVehicles.length;var h="";var f="";if(UConnectVehicles[g]){if(UConnectVehicles[g].isNavRadio){chkStr='<input id="ntg4Nav" type="checkbox"> I have a Navigation Radio</input>';writeH("formNavSelect",chkStr);showE("formNavSelect");}else{writeH("formNavSelect","");hideE("formNavSelect");}showE("formGoButton");return true;}else{hideE("formGoButton");}return false;}function selectModel(d){var c="";hideE("formGoButton");hideE("mainNavDiv");hideE("homeInstructDiv");c='<select id="selectModel" class="form" onchange="doModelAction(this.value)"><option value="" selected>Vehicle</option>';c+=getVehicleOptList(UConnectVehicles,d,brand);c+="</select>";writeH("formModelSelect",c);showE("formModelSelect");writeH("formNavSelect","");hideE("formNavSelect");}function goJCI(){writeH("formModelSelect","");hideE("formModelSelect");showE("formGoButton");}function goUconnect(){var d="";if(getE("selectModel")){modelIndx=getE("selectModel").value;if(UConnectVehicles[modelIndx].isNavRadio&&getE("ntg4Nav")&&getE("ntg4Nav").checked){d=UConnectVehicles[modelIndx].uNavVendor;}else{d=UConnectVehicles[modelIndx].uVendor;}}else{var c=getE("selectYear").value;d=UConnectYears[c].uVendor;}setUconnectCookie(d);hideE("vehicleSelect");hideE("formModelSelect");hideE("formNavSelect");hideE("formGoButton");showE("mainNavDiv");showE("homeInstructDiv");}function getUconnectCookie(g){var k=" "+document.cookie;var l=" "+g+"=";var j=null;var i=0;var h=0;if(k.length>0){i=k.indexOf(l);if(i!=-1){i+=l.length;h=k.indexOf(";",i);if(h==-1){h=k.length;}j=unescape(k.substring(i,h));}}return(j);}function setUconnectCookie(k){var h="uconnect";var m=unescape(k);var l="/";var j=new String(window.location);var n=j.substring(7,j.indexOf(".com/"));n=n.substring(n.lastIndexOf(".")+1,n.length)+".com";var i=j.substring(7,j.indexOf(".com/"))+".com";document.cookie=h+"="+m+";path="+l+";host="+i+";false";}
