function replaceAnchorLinks()
{
	var anchors, i, targ, targarr;
	if (!document.getElementById)
		return;
	initfooterheight();
	// get all anchors
	anchors = document.getElementsByTagName("a");
	for (i=0;i<anchors.length;i++)
	{
		// check if href links to an anchor on this page
		if ( anchors[i].href.indexOf("#") != -1 && anchors[i].href.indexOf( document.URL ) != -1 )
		{
			// get name of target anchor
			targ = anchors[i].href.substring( anchors[i].href.indexOf("#")+1 );
			// find target anchor
			targarr = document.getElementsByName( targ );
			if (targarr.length)
			{
				anchors[i].href = "javascript:ScrollWin.scroll("+"'"+(i+1)+"'"+")";			// rewrite href
				anchors[i].onfocus = function(){this.blur()};
			}
		}
	}
}

function initfooterheight()
{
	if (document.getElementById)
	{
		var winHeight = ScrollWin.getWindowHeight(this);
		var nodeObj = document.getElementById('footer');
		nodeObj.style.height = winHeight+'px';
	}
}

if (navigator.appVersion.indexOf("MSIE")==-1) {
	window.onload = replaceAnchorLinks;
	window.onresize = initfooterheight;
}
