Run custom function when clicking on a select option

i have added 2 lines in the adjustTimes: function(times) which calculates the 2 times for 2 specifiek pray times differently. The function is working properly with the added line of code which are:

times.fajr = times.sunrise- this.eval(params.fajr)/ 60;
times.isha = times.sunset+ this.eval(params.isha)/ 60;

But i only want this part to be active to a particular option method that has been selected from the dropdown menu, other options other than method 2 that are selected should use the standard calculating times without the added lines.

my html drowpdown menu:

<select id="method" size="1" style="font-size: 12px;" onchange="update()">	
 <option value="method1" selected="selected">Method-1)</option>	
 <option value="method2">Method-2</option>	
 <option value="method3">Method-3</option>	
 <option value="method4">Method-4</option>	
 <option value="method5">Method-5</option>	
 <option value="method6">Method-6</option>	
 <option value="method7">Method-7</option>
</select>

This is the js function which again is part of a javascript file that contains the whole code:

	// adjust times 
	adjustTimes: function(times) {
		var params = setting;
		for (var i in times)
			times[i] += timeZone- lng/ 15;
			
		if (params.highLats != 'None')
			times = this.adjustHighLats(times);

			
		if (this.isMin(params.imsak))
			times.imsak = times.fajr- this.eval(params.imsak)/ 60;
		if (this.isMin(params.maghrib))
			times.maghrib = times.sunset+ this.eval(params.maghrib)/ 60;
		if (this.isMin(params.isha))
			times.isha = times.sunset+ this.eval(params.isha)/ 60;
		times.dhuhr += this.eval(params.dhuhr)/ 60;
	

			// my added lines
			// times.fajr = times.sunrise- this.eval(params.fajr)/ 60;
			// times.isha = times.sunset+ this.eval(params.isha)/ 60;

		return times;
	}

So basicly if someone selects any method other than method 2 will get the the standard calculating times. But if you select method 2 they should get the caculated times with the modified times.

the whole js file can be seen on this Jsfiddle
my added lines are on line #347 in the js file

Any help will be appreciated, thanks in advance

I track at least 3 different coding styles in this fiddle…

Get the value of the select element, and compare it to the string “method2”. If it matches, apply your lines.