// JavaScript Document

//window.onload = footer;

function footer() {
	foot = $('footCont');
	footPos = getPosY(foot);
	footHeight = foot.offsetHeight;
	pageHeight = window.innerHeight;
	if ( footPos < (pageHeight-footHeight) ) {
		foot.style.position = 'absolute';
		maringTop = 17;
		foot.style.top = (pageHeight-footHeight-maringTop)+'px';
	}	
}

function getPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
	curtop += obj.y;
	return curtop;
}

function resize(div) {
	DIV = $('moveIntern'+div);
	divHeight = DIV.offsetHeight;
	BoxHeight = $('moveContainer').offsetHeight;
	new Effect.Morph('moveContainer', { style: 'height:'+divHeight+'px;', duration: 2 });

}

function moveby(id) { 
	movebigleft = $('moveBig').style.left;
	if ( id == 1 ) {
		if ( movebigleft != 0 && movebigleft != '0px' ) {
			new Effect.MoveBy('moveBig', 0, 837);
			resize(1);
		}
	}
	else {
		if ( movebigleft == 0 || movebigleft == '0px' ) {
			new Effect.MoveBy('moveBig', 0, -837);
			resize(2);
		}
	}
}
