function floatButton () {
	if (document.all) {
		document.all.topButton.style.pixelTop = document.body.scrollTop+87;
	}
	else if (document.layers) {
		document.topButton.top = window.pageYOffset + 87;
	}
	else if (document.getElementById) {
		document.getElementById('topButton').style.top = window.pageYOffset + 87 + 'px';
	}
}

if (document.all)
	window.onscroll = floatButton;
else
	setInterval ('floatButton()', 100);

function initButton () {
	if (document.all) {
		if (document.body.clientWidth - document.all.topButton.offsetWidth-10<750) {
			document.all.topButton.style.pixelLeft = 750
		} else {
			document.all.topButton.style.pixelLeft = document.body.clientWidth - document.all.topButton.offsetWidth-10;
		}
		document.all.topButton.style.top = 87;
		document.all.topButton.style.visibility = 'visible';
	}
	else if (document.layers) {
		document.topButton.left = window.innerWidth - document.topButton.clip.width - 15;
		document.topButton.visibility = 'show';
	}
	else if (document.getElementById) {
		document.getElementById('topButton').style.top = 87;
		if (window.innerWidth - document.getElementById('topButton').style.left<850) {
			document.getElementById('topButton').style.left = 765;
		} else {
			document.getElementById('topButton').style.left = (window.innerWidth - 185) + 'px';
		}
		document.getElementById('topButton').style.visibility = 'visible';
	}
}

var isNN = ( navigator.appName.indexOf( "Netscape" ) != -1 ); 
 
function autoTab( input,len, e ) { 
	var keyCode	= ( isNN ) ? e.which : e.keyCode; 
	var filter	= ( isNN ) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; 
	if( input.value.length >= len && !containsElement( filter, keyCode )) { 
	input.value = input.value.slice( 0, len ); 
	input.form[( getIndex( input ) + 1 ) % input.form.length].focus(); 
	} 
	return true; 
} 
 
function containsElement( arr, ele ) { 
	var found = false, index = 0; 
	while( !found && index < arr.length ) 
	if( arr[index] == ele ) { 
		found = true; 
	} else { 
		index++; 
	} 
	return found; 
} 
 
function getIndex( input ) { 
	var index = -1, i = 0, found = false; 
	while ( i < input.form.length && index == -1 ) 
	if ( input.form[i] == input ) { 
		index = i; 
	} else { 
		i++; 
	} 
	return index; 
} 
 