function getparent(node, tags) {
	var _this = node;
	do{
		_this = _this.parentNode;
	}while(_this.nodeName.toLowerCase() != tags.toLowerCase());
	return _this;
}

window.onload = function() {
	var ulTags = document.getElementById('brand-list');
	var imgTags = ulTags.getElementsByTagName('img');
	var h = 0;
	var top = 0;
	
	for(var i = 0; i < 5; i++) {
		var liTags = getparent(imgTags[i], 'li');
		h = liTags.offsetHeight - imgTags[i].clientHeight;
		top = parseInt(h / 2);
		anchorTags = getparent(imgTags[i], 'a');
		anchorTags.style.top = top + 'px';
	}
};
