var seconds = 0;
	var secondsCounter = null;
	var answer = false;

		
		document.querySelector('.js-decline').addEventListener('click', function () {
			decline();
		});

		document.querySelector('.js-accept').addEventListener('click', function () {
			accept();
		});

	function decline () {
		"use strict";
		document.querySelector('.js-card').classList.add('declineCall');
		clearInterval(secondsCounter);

		if (answer == true) {
			document.querySelector('.js-callDetail').innerHTML = 'Finished';
			document.querySelector('.js-callInfo').innerHTML = seconds + 's';
		} else {
			document.querySelector('.js-callDetail').innerHTML = 'Rejected';
			document.querySelector('.js-callInfo').innerHTML = 'Finished';
		}
	}

	function accept () {
		"use strict";
		document.querySelector('.js-card').classList.add('onCall');
		document.querySelector('.js-callDetail').innerHTML = 'On call';
		answer = true;
		counter();
	}

	function counter () {
		"use strict";
		var _this = this;
		document.querySelector('.js-callInfo').innerHTML = '0s';

		secondsCounter = setInterval(function () {
			++seconds;
			document.querySelector('.js-callInfo').innerHTML = seconds % 60 + 's';
		}, 1000);
	}