function updatePreview(source, ID, art) {
	c = source.value;
	elem = document.getElementById(ID);
	elem.src = "img/racecolors/" + art + "/" + c + ".png";
}

function remove2(id) {
	tr = document.getElementById(id);
	tr.style.display = 'none';
}
function show2(id) {
	tr = document.getElementById(id);
	tr.style.display = 'block';
}
function remove(id) {
	tr = document.getElementById(id);
	tr.style.visibility = 'hidden';
}
function show(id) {
	tr = document.getElementById(id);
	tr.style.visibility = 'visible';
}
function toggle_nav(id) {
	tr 		= document.getElementById(id);
	value 	= tr.style.display;
	if(value == 'none') {
		tr.style.display = 'block';
		MM_swapImage('nav_img_nachrichten','','/img/nav/arrow_down.gif',1);
	} else {
		tr.style.display = 'none';
		MM_swapImgRestore();
	}
}
function ismaxlength(obj) {
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
	if (obj.getAttribute && obj.value.length>mlength)
	obj.value=obj.value.substring(0,mlength)
}
function confirmLink(dalink, text) {
  stat= confirm(text);
	if(stat) {
		window.location.href = dalink;
	}
}


function evalKeyForSubmit(event, frm) {
	//alert(event.keyCode);
	if (event && (event.which == 13 || event.keyCode == 13)) {
		// IE: ...event.keyCode...
      	// ENTER gedrückt, also Formular abschicken
      	frm.user_username.value=escape(frm.user_username.value);
      	frm.user_password.value=escape(frm.user_password.value);
      	frm.submit();
	} else {
      return true;
	}
}


function popupcenter(mylink, myname, w, h) {
		//window.open(mylink, myname, 'width='+w+',height='+h+',left=100,top=100');
		win = window.open(mylink, "DKMRACING", "width="+w+",height="+h+",left=100,top=100");
		win.focus();
}

function display_info ( var1, var2, var3, pw ) {
	popupcenter('/pop/hvd_show.php?what='+var1+'&name='+var2+'&hid='+var3+'&pw='+pw,'DKM RACING MANAGER','1000', '700');
}
function display_info_all ( var1, pw ) {
	popupcenter('/pop/hvd_show_all.php?hid='+var1+'&what=all&pw='+pw,'DKM RACING MANAGER','1000', '700');
}
