var isinit=0;
var yinit=0;

function findPosY(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 getObj(name) {
	if (document.getElementById) {
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	} else if (document.all) {
		this.obj = document.all[name];
		this.style = document.all[name].style;
	} else if (document.layers) {
		if (document.layers[name]) {
			this.obj = document.layers[name];
			this.style = document.layers[name];
		} else {
			this.obj = document.layers.testP.layers[name];
			this.style = document.layers.testP.layers[name];
		}
	}
}

function getWinHeight() {
		if (document.all) {
			if (document.all.home) {
				return window.document.all.home.offsetHeight;
			}else{
				return window.document.all.sub.offsetHeight;
			}
		} else {
			return window.innerHeight;
		}
}


function init() {
	isinit=1;
	i=new getObj("container_footer")
	yinit = findPosY(i.obj);
	checkpos();
}

function checkpos() {
	if (isinit) {
		h=61;
		i=new getObj("container_footer")
		wh=getWinHeight();
		mt=wh-h-yinit;
		if (mt<0) mt=0
		i.style.top=mt+"px";
	}
}

window.onresize = checkpos;