if(document.images) {
	var buffer_button = '';	//из-за выпадающих менюшек вознюкают кое-какие глюки. навароты с buffer_button принудительно возвращают исходный img застоявшейся кнопке
	b1 = new Image; b1.src = "/_tpl/img/b1_.gif";
	b2 = new Image; b2.src = "/_tpl/img/b2_.gif";
	b3 = new Image; b3.src = "/_tpl/img/b3_.gif";
	b4 = new Image; b4.src = "/_tpl/img/b4_.gif";
	b5 = new Image; b5.src = "/_tpl/img/b5_.gif";
}

function roll(iName, iPath) {
	if(buffer_button != '' && (iName.charAt(0)=='b')) {
		document.images[buffer_button].src = '/_tpl/img/'+buffer_button+'.gif';
		buffer_button = '';
	}
	document.images[iName].src = iPath;
	if((iPath.charAt(iPath.length - 5)=='_') && (iName.charAt(0)=='b')) buffer_button = iName;
	else buffer_button = '';
} 

function roll_begin(iName){
	if (iName != "a1")
		document.images[iName].src = "/_tpl/img/arr_.gif";
	else
		document.images[iName].src = "/_tpl/img/arr1_.gif";
}

function roll_end(iName){
	if (iName != "a1")
		document.images[iName].src = "/_tpl/img/arr.gif";
	else
		document.images[iName].src = "/_tpl/img/arr1.gif";
}

