Request a Test drive
');radioBtn.appendTo('#_newtestdriveaction_WAR_NewTestDriveportlet_fuelTypeDiv');}if('' != null || '' != ""){$("input[value='']").attr('checked', true);}}else{console.log("Since Model Id is 40, hence don't show Fuel Type !!");$("#fuel-box").hide();}},error: function(){console.log("Error Occured in fetching Fuel Information on change of Models");}});}/* Called on onChange of State Field */function _newtestdriveaction_WAR_NewTestDriveportlet_getCities(){console.log("In get Cities");AUI().use('aui-io-request-deprecated', function(A) {var carId = $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar").val();var carName= $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar option:selected").text();var variantId = $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectVariant").val();var stateId = $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").val();console.log("Model Id is : "+carId);console.log("Variant Id is : "+variantId);console.log("State Id : "+stateId);var dealerCode = 'S5240';console.log("Dealer Code : "+dealerCode);var i;var dealerCode = "S5240";if(stateId == null){A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_state").val("");var statusDiv = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity");statusDiv.empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").empty();if(dealerCode!="" && dealerCode!=null){A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}else{A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}}if(stateId!=null){// If Variant selected is Signature if(variantId == 760) { console.log("Variant selected is Signature !!");AUI().use('aui-io-request-deprecated', function(A) {var statusDiv = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity");statusDiv.empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_state-error").hide();A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_stateId: stateId,_newtestdriveaction_WAR_NewTestDriveportlet_action: "getSignatureCity",},on : {success : function() {console.log("In Success of getSignatureCity");var cityName = this.get('responseData');console.log("City ::::: " + cityName);$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").empty();$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append("
" );if(false) {$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val('');if($("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!= null && $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!=""){_newtestdriveaction_WAR_NewTestDriveportlet_getLocations();}}},failure: function() {console.log("In Error of getSignatureCity");}}});});}// If Variant selected is Premium or Prestige or No Variant Scenerioelse if(variantId == 761 || variantId == 762 || variantId == "0") {console.log("Variant selected is Premium or Prestige or No Variant Scenerio !!");// same code which was Implemented earlier for Kona and Non-Kona Casesif(carId==19 || carName=="Kona Electric"){var statusDiv = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity");statusDiv.empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_state-error").hide();A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_stateId: stateId,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: "Showroom",_newtestdriveaction_WAR_NewTestDriveportlet_action: "cityValuesForKona",},on : {success : function() {console.log("In Success of getCities (for KONA) Method");$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").empty();$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');var cityNameCode = this.get('responseData');var cityName = JSON.parse(cityNameCode);for(i in cityName){A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append("
" );}if(false) {$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val('');if($("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!= null && $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!=""){_newtestdriveaction_WAR_NewTestDriveportlet_getLocations();}}},failure: function() {console.log("Error in fetching Cities Values for KONA");}}});}else if(carId==41 || carName=="i20 N Line"){var statusDiv = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity");statusDiv.empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_state-error").hide();A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_stateId: stateId,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: "Showroom",_newtestdriveaction_WAR_NewTestDriveportlet_action: "cityValuesForNLine",},on : {success : function() {console.log("In Success of getCities (for NLine) Method");$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").empty();$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');var cityName = this.get('responseData');console.log("City ::::: " + cityName);$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append("
" );if(false) {$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val('');if($("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!= null && $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!=""){_newtestdriveaction_WAR_NewTestDriveportlet_getLocations();}}},failure: function() {console.log("Error in fetching Cities Values for i20 N Line");}}});}else if(carId==42 || carName=="New Tucson"){var statusDiv = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity");statusDiv.empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_state-error").hide();A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_stateId: stateId,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: "Showroom",_newtestdriveaction_WAR_NewTestDriveportlet_action: "cityForTucson",},on : {success : function() {console.log("In Success of getCities cityForTucson");$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").empty();$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');var cityName = this.get('responseData');console.log("City ::::: " + cityName);$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append("
" );if(false) {$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val('');if($("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!= null && $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!=""){_newtestdriveaction_WAR_NewTestDriveportlet_getLocations();}}},failure: function() {console.log("Error in fetching Cities Values for cityForTucson");}}});}else if(carId==43 || carName=="Venue N Line"){var statusDiv = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity");statusDiv.empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_state-error").hide();A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_stateId: stateId,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: "Showroom",_newtestdriveaction_WAR_NewTestDriveportlet_action: "cityForVenueNLine",},on : {success : function() {console.log("In Success of getCities cityForVenueNLine");$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").empty();$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');var cityName = this.get('responseData');console.log("City ::::: " + cityName);$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append("
" );if(false) {$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val('');if($("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!= null && $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!=""){_newtestdriveaction_WAR_NewTestDriveportlet_getLocations();}}},failure: function() {console.log("Error in fetching Cities Values for cityForVenueNLine");}}});}else{var stateName = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").val();console.log("stateName is:" +stateName);A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").val(stateName);var statusDiv = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity");statusDiv.empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_state-error").hide();A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_stateId: stateId,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: "Showroom",_newtestdriveaction_WAR_NewTestDriveportlet_action: "cityValues",_newtestdriveaction_WAR_NewTestDriveportlet_dealerCode : dealerCode,},on : {success : function() {console.log("In Success of getCities Method");$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").empty();$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');var cityNameCode = this.get('responseData');var cityName = JSON.parse(cityNameCode);for(i in cityName){var temp = cityName[i]; A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append("
" );}if(false) {$("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val('');if($("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!= null && $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val()!=""){_newtestdriveaction_WAR_NewTestDriveportlet_getLocations();}}},failure: function() {console.log("Error Occured in fetching Cities Values on change of State");}}}); }}}});}/* getElectricCar Method */ // vini2function _newtestdriveaction_WAR_NewTestDriveportlet_getElectricCar(URL_model) {var konaModelName="Kona Electric";var konaModelId = 19;var URL_model_flag = URL_model;console.log("URL Model Flag passed inside getElectricCar() Method is " + URL_model_flag);console.log("Case 3 of getElectricCar Method (No Query Parameters)");AUI().use('aui-io-request-deprecated', function(A) {A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {data: {"_newtestdriveaction_WAR_NewTestDriveportlet_action":"getElectricCar",},on : {success : function() {console.log("In Success of getElectricCar Method of Case 3");var data = this.get('responseData');var isElectricCarAvailable = data;if(isElectricCarAvailable=="true"){ $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar").append("
" );}},error: function(jqXHR, textStatus, error){console.log("Error Occured in fetching Electric Cars" + error);}}});});}/* Called on onChange of City Field */function _newtestdriveaction_WAR_NewTestDriveportlet_getLocations(){AUI().use('aui.io.request', function(A){var dealerCode = "S5240";var carId = $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar").val();var carName= $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar option:selected").text();var stateId = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").val();var cityId = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val();var displayType = "Showroom";if(cityId == null){//A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_city").val("");var statusDiv = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location");statusDiv.empty();if(dealerCode!="" && dealerCode!=null){A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}else{A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}}if(cityId!= null){if(carId==19 || carName=="Kona Electric"){var cityName = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val();//A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_city").val(cityName);A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_city-error").hide();A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_cityId: cityId,_newtestdriveaction_WAR_NewTestDriveportlet_stateId: stateId,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: displayType,_newtestdriveaction_WAR_NewTestDriveportlet_action: "locationValuesForKona",},on : {success : function() {console.log("In Success of getLocations (for KONA) Method");A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").empty();var showroomLocation = this.get('responseData');var showroomLocations=JSON.parse(showroomLocation);var coords=[]; if(dealerCode!="" && dealerCode!=null){A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}else{A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}for(i in showroomLocations){var temp = showroomLocations[i]; A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}var marker;var addrs;var address = [];if(false) {$("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val('0');if($("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val()!="" && $("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val()!=0){} }},failure: function() {console.log("Error in fetching Locations Values for KONA");}}});}else{var cityName = A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").val();//A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_city").val(cityName); A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").empty();A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_city-error").hide();A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_stateId: stateId,_newtestdriveaction_WAR_NewTestDriveportlet_cityId: cityId,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: displayType,_newtestdriveaction_WAR_NewTestDriveportlet_action: "locations",_newtestdriveaction_WAR_NewTestDriveportlet_dealerCode: dealerCode,},on : {success : function() {console.log("In Success of getLocations Method");A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").empty();var showroomLocation = this.get('responseData');var showroomLocations = JSON.parse(showroomLocation);var coords=[]; if(dealerCode!="" && dealerCode!=null){A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}else{A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}for(i in showroomLocations){var temp = showroomLocations[i]; A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}var marker;var addrs;var address = [];if(false) {$("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val('0');if($("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val()!="" && $("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val()!=0){} }},failure: function() {console.log("Error Occured in fetching Locations Values on change of City");}}});}}});}/* Called on onChange of Dealer Location Field */function _newtestdriveaction_WAR_NewTestDriveportlet_getLocationMap(){jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_location-error").hide();var selectedLoc = jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_location").find(":selected");if(false) {jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_dealerLocation").val(jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val());}if(jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val() == 0){_newtestdriveaction_WAR_NewTestDriveportlet_getLocations();}else{}}jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_captchaText").attr("tabindex","12");jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_captchaText").attr("maxlength","4");function _newtestdriveaction_WAR_NewTestDriveportlet_getCarImg(){var carName = jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar :selected").text();if(carName != "Select Car"){//jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_carImgDiv").html('');$("#_newtestdriveaction_WAR_NewTestDriveportlet_fuelVariant").css("visibility", "visible");$("#_newtestdriveaction_WAR_NewTestDriveportlet_fuelType-error").css("display", "none"); $("#_newtestdriveaction_WAR_NewTestDriveportlet_fuelTypeDiv").empty();}else{//jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_carImg").remove();}if(carName == "Select Car"){$("#_newtestdriveaction_WAR_NewTestDriveportlet_fuelVariant").css("visibility", "hidden");$("#_newtestdriveaction_WAR_NewTestDriveportlet_fuelType-error").css("display", "none"); $("#_newtestdriveaction_WAR_NewTestDriveportlet_fuelTypeDiv").empty();}_newtestdriveaction_WAR_NewTestDriveportlet_getFuelType();}jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_location").on('change', function(){var location = jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_location").val();jQuery("#_newtestdriveaction_WAR_NewTestDriveportlet_dealerLocation").val(location); }); /* Campaign Code *//* Called on document.ready */function getURLFuelType() //vini1{console.log("Inside getURLFuelType Method");var serviceDomain='https://api.hyundai.co.in';var modelId = $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar :selected").val();var modelName= $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar option:selected").text();console.log("URL Model Id is: " + modelId);console.log("URL Model Name is: " + modelName);if(modelId != 0){$.ajax({url : serviceDomain+"/service/common/getFuelByModelId",type: 'GET',dataType: 'json',data: {"modelId" : modelId,},success: function(data){console.log("In Success of getURLFuelType Method");var url_ft_value = $("#_newtestdriveaction_WAR_NewTestDriveportlet_url-ft").val(); $('#_newtestdriveaction_WAR_NewTestDriveportlet_fuelTypeDiv').html("");for (i in data) {x = data[i];var radioBtn = $('
');radioBtn.appendTo('#_newtestdriveaction_WAR_NewTestDriveportlet_fuelTypeDiv');if((x.description == "Petrol") && ((url_ft_value == "p") || (url_ft_value == "P"))){console.log("Fuel Value from Service and URL Fuel Value is Matched and it is PETROL");$("#_newtestdriveaction_WAR_NewTestDriveportlet_" + x.description).attr('checked', true);}else if((x.description == "Diesel") && ((url_ft_value == "d") || (url_ft_value == "D"))){console.log("Fuel Value from Service and URL Fuel Value is Matched and it is DIESEL");$("#_newtestdriveaction_WAR_NewTestDriveportlet_" + x.description).attr('checked', true);}else if((x.description == "Electric") && ((url_ft_value == "e") || (url_ft_value == "E"))){console.log("Fuel Value from Service and URL Fuel Value is Matched and it is ELECTRIC");$("#_newtestdriveaction_WAR_NewTestDriveportlet_" + x.description).attr('checked', true);}else{console.log("Wrong URL Fuel Type Entered");}}$("#_newtestdriveaction_WAR_NewTestDriveportlet_fuelVariant").show();},error: function(){console.log("Error Occured in fetching URL Fuel Information");}});}else{console.log("Wrong Model entered in URL");}}/* Called on document.ready */function getStateAndCityFromURLLocation(){AUI().use('aui.io.request', function(A){var dealerCode = "S5240";var displayType = "Showroom";var url_locid_value = $("#_newtestdriveaction_WAR_NewTestDriveportlet_url-locid").val();console.log("URL LOCID is " + url_locid_value);console.log("Dealer Code is " + dealerCode);if(url_locid_value != null){A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_dealerCode: dealerCode,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: displayType,_newtestdriveaction_WAR_NewTestDriveportlet_url_locid_value: url_locid_value,_newtestdriveaction_WAR_NewTestDriveportlet_action: "stateAndCityFromLocation",},on : {success : function() {console.log("In Success of getStateAndCityFromURLLocation Method");A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").empty(); A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").empty(); A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").empty(); var showroomLocation = this.get('responseData');var showroomLocations = JSON.parse(showroomLocation);if(dealerCode!="" && dealerCode!=null) {A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").append('
');A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}else{A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}for(i in showroomLocations){var temp = showroomLocations[i]; A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").append("
" );A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append("
" );A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}},failure: function() {console.log("Error Occured in fetching State, City and Dealer Location from URL Location");}}});}});}/* Called on document.ready */function getURLHiddenFuelType() {console.log("Inside getURLHiddenFuelType Method");var serviceDomain='https://api.hyundai.co.in';var modelId = $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar :selected").val();var modelName = $("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCar option:selected").text();console.log("URL Hidden Model Id is: " + modelId);console.log("URL Hidden Model Name is: " + modelName);if(modelId != 0){$.ajax({url : serviceDomain+"/service/common/getFuelByModelId",type: 'GET',dataType: 'json',data: {"modelId" : modelId,},success: function(data){console.log("In Success of getURLHiddenFuelType Method");var url_hidden_ft_value = $("#_newtestdriveaction_WAR_NewTestDriveportlet_url-hidden-ft").val(); $('#_newtestdriveaction_WAR_NewTestDriveportlet_fuelTypeDiv').html("");for (i in data) {x = data[i];var radioBtn = $('
');radioBtn.appendTo('#_newtestdriveaction_WAR_NewTestDriveportlet_fuelTypeDiv');if((x.description == "Petrol") && ((url_hidden_ft_value == "p") || (url_hidden_ft_value == "P"))){console.log("Fuel Value from Service and URL Hidden Fuel Value is Matched and it is PETROL");$("#_newtestdriveaction_WAR_NewTestDriveportlet_" + x.description).attr('checked', true);}else if((x.description == "Diesel") && ((url_hidden_ft_value == "d") || (url_hidden_ft_value == "D"))){console.log("Fuel Value from Service and URL Hidden Fuel Value is Matched and it is DIESEL");$("#_newtestdriveaction_WAR_NewTestDriveportlet_" + x.description).attr('checked', true);}else if((x.description == "Electric") && ((url_hidden_ft_value == "e") || (url_hidden_ft_value == "E"))){console.log("Fuel Value from Service and URL Hidden Fuel Value is Matched and it is ELECTRIC");$("#_newtestdriveaction_WAR_NewTestDriveportlet_" + x.description).attr('checked', true);}else{console.log("Wrong URL Hidden Fuel Type Entered");}}$("#_newtestdriveaction_WAR_NewTestDriveportlet_fuelVariant").show();},error: function(){console.log("Error Occured in fetching URL Hidden Fuel Information");}});}else{console.log("Wrong Hidden Model entered in URL");}}/* Called on document.ready */ function getStateAndCityFromURLHiddenLocation() {AUI().use('aui.io.request', function(A){var dealerCode = "S5240";var displayType = "Showroom";var url_hidden_locid_value = $("#_newtestdriveaction_WAR_NewTestDriveportlet_url-hidden-locid").val();console.log("URL Hidden LOCID is " + url_hidden_locid_value);console.log("Dealer Code is " + dealerCode);if(url_hidden_locid_value != null){A.io.request('https://jsp.hyundaimotor.in/find-a-car/i20-n-line/highlights?p_p_id=newtestdriveaction_WAR_NewTestDriveportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=10&p_p_col_count=12', {method : 'POST',dataType : 'text json', data: {_newtestdriveaction_WAR_NewTestDriveportlet_dealerCode: dealerCode,_newtestdriveaction_WAR_NewTestDriveportlet_displayType: displayType,_newtestdriveaction_WAR_NewTestDriveportlet_url_hidden_locid_value: url_hidden_locid_value,_newtestdriveaction_WAR_NewTestDriveportlet_action: "stateAndCityFromHiddenLocation",},on : {success : function() {console.log("In Success of getStateAndCityFromURLHiddenLocation Method");A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").empty(); A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").empty(); A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").empty(); var showroomLocation = this.get('responseData');var showroomLocations = JSON.parse(showroomLocation);if(dealerCode!="" && dealerCode!=null) {A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").append('
');A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append('
');A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}else{A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}for(i in showroomLocations){var temp = showroomLocations[i]; A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectState").append("
" );A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_selectCity").append("
" );A.one("#_newtestdriveaction_WAR_NewTestDriveportlet_location").append("
");}},failure: function() {console.log("Error Occured in fetching State, City and Dealer Location from URL Hidden Location");}}});}});}/* Campaign Code Ends */