














var frame
var left
var nav
var inited
function init() {
	window.onresize=moveNav;
	if (!document.createElement) return //begone, old browser
	frame=document.getElementById('frame')
	left=document.getElementById('left')
	nav=document.createElement("DIV")
	nav.style.position="absolute";
	nav.style.lineHeight=left.style.lineHeight
	nav.style.fontSize=left.style.fontSize
	nav.style.padding=left.style.padding
	nav.style.width=left.style.width
	nav.style.height=getMyProperty(left,'height')
	nav.style.textAlign=left.style.textAlign
	
	inited = true
	moveNav()
	nav.innerHTML=left.innerHTML;
	document.body.appendChild(nav)
	left.style.visibility='hidden';
	watchForScroll()
	}
	
function getMyProperty(obj,prop) {
	if (document.all) {
		if (prop=='top') return obj.offsetTop+document.body.scrollTop+'px';
		if (prop=='left') return obj.offsetLeft+'px';
		if (prop=='height') return obj.offsetHeight+'px';
	} else {
		if (prop=='top') return (window.pageYOffset+parseInt(document.defaultView.getComputedStyle(obj,'').getPropertyValue('top')))+'px';
		if (prop=='left') return document.defaultView.getComputedStyle(obj,'').getPropertyValue('left');
		if (prop=='height') return document.defaultView.getComputedStyle(obj,'').getPropertyValue('height');
		}
	}

function moveNav() {
	if (!inited) return false;
	newLeft=getMyProperty(frame,'left');
	newTop=getMyProperty(left,'top');
	if (parseInt(newTop)+parseInt(getMyProperty(left,'height')) > parseInt(getMyProperty(frame,'height'))-30){
		newTop=(parseInt(getMyProperty(frame,'height'))-30-parseInt(nav.style.height))+'px'
		}
	nav.style.left=newLeft
	nav.style.top=newTop
	}

lastS = 0
thisS = 0
function watchForScroll() {
	thisS=(document.body.scrollTop)?document.body.scrollTop:window.pageYOffset
	if (thisS!=lastS) {
		lastS=thisS
		moveNav()
	}
	setTimeout('watchForScroll()',50)
	}
	


