// JavaScript Document

function getHeight() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	//window.alert( 'Width = ' + myWidth );
	//window.alert( 'Height = ' + myHeight );
	return myHeight;
}

function getScrollHeight(){				
	if (document.all){ 
		return (document.body.offsetHeight);
	}
	else{
		return (document.body.scrollHeight);
	}
}

function check(){
	try{
			//document.getElementById('debug').innerHTML = "T1";
		var h1 = getHeight();
			//document.getElementById('debug').innerHTML = "T2";
		var h2 = getScrollHeight();
			//document.getElementById('debug').innerHTML = "T3";
		if(h1 == h2){
			//document.getElementById('debug').innerHTML = "HERE h1:" + h1 +"  h2:"+h2;
			document.getElementById('bottom').style.top = null;
			document.getElementById('bottom').style.bottom = 10;
		}
		else if(h1 < h2){
			//document.getElementById('debug').innerHTML = h2;
			h2-=55; //image height
			document.getElementById('bottom').style.bottom = null;
			document.getElementById('bottom').style.top = h2;
		}
		else{
			//Error
			//document.getElementById('debug').innerHTML = "OOPS h1:" + h1 +"  h2:"+h2;
		}
	}
	catch(e){
		alert(e.string);	
	}
}
window.onresize = check;