var __intervall = 0;
function createFunction(e, n) {
	var f = 'function __' + n + '() {' +
		'	var wl = window.location.href.split("#");' +
		'	window.location.href = wl[0] + "#' + n + '";' + 
		'	onload()' + 
		'};' + 
		'e.onclick = __' + n + ';';
	eval(f);
};
function getElement(id) {
	var r;
	if(document.getElementById)
		r = document.getElementById(id);
	else
		r = document.all[id];
	return r;
};
function color_manager(v, a, c1, c2) {
	var e,b = a.length;
	if(b > 0) {
		do {
			e = getElement(a[--b]);
			e.style.background = (v == a[b]) ? c2 : c1;
			e.style.cursor = 'pointer';
			createFunction(e, a[b]);
		}while(b);
	};
};
function callH(who) {
	getElement(who).onclick();
	return false;
};
function moveMenu() {
	var m = Math;
	var ly = 0;
	var z,y = 0;
	var r = getElement('rightmenu');
	r.style.position = 'relative';
	function followPage() {
		if (self.pageYOffset)
			y = self.pageYOffset;
		else if (document.documentElement && document.documentElement.scrollTop)
			y = document.documentElement.scrollTop;
		else if (document.body)
			y = document.body.scrollTop;
		if(y > ly)
			z = .05;
		else
			z = .2;
		ly += (y - ly) * z;
		r.style.top = m.floor(ly) + 'px';
	}
	__intervall = setInterval(followPage, 10);
};
onload = function() {
	var h = ['what','why','features','changes','credits','faq','downloads'];
	var wl = window.location.href.split('#');
	if(wl.length == 1)
		wl[1] = null;
	color_manager(wl[1], h, '#FFF', '#EFEFEF');
	if(__intervall === 0)
		moveMenu();
};