function tooHeight() {
	var _block1 = document.getElementById('main');
	var _tag = document.getElementsByTagName('div');
	var _class = 'sidebar-text';
	for (var i = 0; i < _tag.length; i++) {
		if (_tag[i].className.indexOf(_class) != -1) {
			_tag[i].style.height = 'auto';
			if (_block1.offsetHeight > (_tag[i].offsetHeight+5)) {
				_tag[i].style.height = _block1.offsetHeight+'px';
			}
		}
	}
}

function autoHeight(){
	var _class = 'boxes';
	var _holder = document.getElementsByTagName('div');
	for (var i = 0; i < _holder.length; i++) {
		if (_holder[i].className.indexOf(_class) != -1) {
			footer2Height(_holder[i]);
		}
	}
	function footer2Height(_boxes){
		var t_box = _boxes.getElementsByTagName('div');
		var box_class = ['box','item'];
		var _box = [];
		var _h = 0;
		for(var i = 0; i < t_box.length; i++){
			for(var j = 0; j < box_class.length; j++){
				if(t_box[i].className.indexOf(box_class[j]) != -1){
					_box.push(t_box[i]);
					t_box[i]._h = t_box[i].offsetHeight;
					if(_h < t_box[i]._h) _h = t_box[i]._h;
				}
			}
		}
		for(var i = 0; i < _box.length; i++){
			if(_box[i]._h < _h) _box[i].style.height = _h + 'px';
			if(_box[i].offsetHeight > _h){
				_box[i].style.height = _h - (_box[i].offsetHeight - _h) + 'px';
			}
		}
	}
}

function initPage(){
	tooHeight();
	autoHeight();

}
if (window.addEventListener){
	window.addEventListener("load", initPage, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initPage);
}

