function getAbsPosition(elem) {
	var pos={x:0,y:0}
	while (elem!=null) {
		pos.x+=elem.offsetLeft
		pos.y+=elem.offsetTop
		elem=elem.offsetParent
	}
	return pos
}

function setDocSize(bottom) {
	doc.height=document.body.clientHeight-getAbsPosition(doc).y-bottom
}

function AddBookMark(url, title) {
	if (window.sidebar) window.sidebar.addPanel(title, url,"");	
		else if( window.external ) window.external.AddFavorite( url, title); 
}
