// div height setting to butt to bottom

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function checkRule() {
	if (isw3c) {
	var windowHeight = getWindowHeight();
	var ruleDiv = gObj('ruleDiv');
	var ruleDivHeight = ruleDiv.offsetHeight;
	var ruleDivTop = ruleDiv.offsetTop;
	var textDiv = gObj('textDiv');
	var textDivHeight = textDiv.offsetHeight;
	var textDivTop = textDiv.offsetTop;
	var photoDiv = gObj('photoDiv');
	var photoDivHeight = photoDiv.offsetHeight;
	var photoDivTop = photoDiv.offsetTop;
	
	var aa = ((textDivHeight + textDivTop) > (photoDivHeight + photoDivTop)) ? "0" : "1";
	var controlDivHeight = (aa == "0") ? textDivHeight : photoDivHeight;
	var controlDivTop = (aa == "0") ? textDivTop : photoDivTop;

		if ((windowHeight - controlDivTop - controlDivHeight) > 3) {
			var ruleHt = windowHeight - ruleDivTop -1;
		}
		else {
			var ruleHt = controlDivHeight + 65;
		}
	ruleDiv.style.height = (ruleHt) + 'px';
		if (isExplorer && isMac) {
		ruleDiv.style.marginBottom = "-15px";
		}
	}
}

// end div height setting to butt to bottom


window.onload = function() {
	checkRule();
}

window.onresize = function() {
	checkRule();
}

window.onscroll = function() {
	checkRule();
}
