function showHide(id) {
	var element = document.getElementById(id);
	if ( element.style.display == 'block' )
		element.style.display = 'none';
	else
		element.style.display = 'block';
}
function showHideLogin (id) {
	_$(id).className = (_$(id).className == 'fieldset_closed'
		? 'fieldset_open' : 'fieldset_closed' );
}
function gotoForum() {
	window.open('http://tracklog.ch/phpBB','TrackLog Bulletin Board');
}
//--------------------------------------------------------------------------
// loginKeypress
//..........................................................................
var iPhoneID;
function loginKeypress( id_input, evt ) {
	var keynum = ((window.event) ? evt.keyCode : evt.which);
	var key = String.fromCharCode(keynum);
	var key_string = id_input.value.length > 30 ? key : id_input.value + key;
	if ( key_string.length > 2 )
		ajax("download.php",
			 "job=web_login&format=jason&id=" + key_string, 
			 function ( reply ) {
				var obj = eval ( '(' + reply + ')' );
				iPhoneID = obj.uniqueID;
				if ( obj.uniqueID == 0 ) {
					var element = document.getElementById('betatester');
					element.style.display = 'none';
					alert ( _s("Diese ID ist nicht bekannt.") );
				}
				else if ( obj.uniqueID.length > 30 ) {
			 		var element = document.getElementById('iPhoneID');
					element.value = obj.uniqueID;
					element = document.getElementById('betatester');
					if ( obj.tester )
						element.style.display = 'block';
					else
						element.style.display = 'none';
					return false;
				}
			});
	return true;
}
