function add_load_event(f) {
	var old = window.onload;
	if (typeof old != 'function') {
		window.onload = f;
	} else {
		window.onload = function() { if (old) old(); f(); }
	}
}

function add_resize_event(f) {
	var old = window.onresize;
	if (typeof old != 'function') {
		window.onresize = f;
	} else {
		window.onresize = function() { if (old) old(); f(); }
	}
}

function window_height() {
	var h=0;
	if (typeof(window.innerHeight)=='number'){h=window.innerHeight;}
	else{if(document.documentElement&&document.documentElement.clientHeight){
	h=document.documentElement.clientHeight;}
	else{if(document.body&&document.body.clientHeight){h=document.body.clientHeight;}}}
	return h;
}

function move_footer(f)
{
	if (document&&document.getElementById) {
		var h=window_height();
		var i=document.getElementById('wrap_inner');
		var o=document.getElementById('wrap_outer');
		if (i&&i.offsetHeight+121<h){
			if (o){o.style.minHeight='';o.style.height=(h-121)+'px';}
		} else {
			if (f&&o){o.style.minHeight='';o.style.height='';}
		}
	}
}
