var def_id = 0;

function getById (id) {
	return document.getElementById(id);
}

function setArrowForLeft(id) {
	if (getById('lm_' + id) && getById('lmtd_' + id)) {
		removeDefArrow(def_id);
		getById('lm_' + id).style.backgroundImage = 'url(/img/m-str.gif)';
		getById('lmtd_' + id).style.backgroundColor = '#8d2671';
		getById('lmtda_' + id).style.color = '#FFFFFF';
	}
}

function removeArrowForLeft(id) {
	if (getById('lm_' + id) && getById('lmtd_' + id)) {
		getById('lm_' + id).style.backgroundImage = 'url(/img/m-bg-1.gif)';
		getById('lmtd_' + id).style.backgroundColor = '#963571';
		getById('lmtda_' + id).style.color = '#fff';
		if (id != def_id) {setDefaultArrow(def_id);}
	}
}

function setArrowForRight(id) {
	if (getById('rm_' + id) && getById('rmtd_' + id)) {
		removeDefArrow(def_id);
		getById('rm_' + id).style.backgroundImage = 'url(/img/r-str.gif)';
		getById('rm_' + id).style.backgroundRepeat = 'no-repeat'
		getById('rm_' + id).style.backgroundPosition = 'center center';
		getById('rm_' + id).style.backgroundColor = '#d9dde0';
		getById('rmtd_' + id).style.backgroundColor = '#d9dde0';
	}
}

function removeArrowForRight(id) {
	if (getById('rm_' + id) && getById('rmtd_' + id)) {
		getById('rm_' + id).style.backgroundImage = '';
		getById('rm_' + id).style.backgroundColor = '#f2f2f4';
		getById('rmtd_' + id).style.backgroundColor = '#f2f2f4';
		if (id != def_id) {setDefaultArrow(def_id);}
	}
}

function setDefaultArrow(id) {
	removeArrowForLeft(def_id);
	removeArrowForRight(def_id);
	setArrowForLeft(id);
	setArrowForRight(id);
}

function removeDefArrow(id) {
	removeArrowForLeft(def_id);
	removeArrowForRight(def_id);
}

