/* general */

function openWnd(fil, width, height)
{
	window.open(fil,'popup','left='+((screen.availWidth-width)/2)+',top='+((screen.availHeight-height)/2)+',width='+width+',height='+height+',directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes').focus();
}

function openDisclaimer()
{
	openWnd('Disclaimer.aspx', 400, 400);
}

function openHelp()
{
	openWnd('Help.aspx', 500, 600);
}

function openAcrobat()
{
	openWnd('http://www.adobe.com/products/acrobat/readstep2.html', 800, 600);
}

/* calc */

function selFelgeUserDef(wheel, txt)
{
	selUserDefOption(wheel+':drpFelgeTyp');
	clearOptions(wheel+':drpFelgeName',txt);
	removeTotal(wheel);
}

function selNabeUserDef(wheel, txt)
{
	selUserDefOption(wheel+':drpNabeTyp');
	clearOptions(wheel+':drpNabeName',txt);
	removeTotal(wheel);
}

function removeTotal(wheel)
{
	document.getElementById(wheel+'_lblLaengeLinksExakt').innerHTML = '---';
	document.getElementById(wheel+'_lblLaengeRechtsExakt').innerHTML = '---';
	document.getElementById(wheel+'_lblLaengeLinks').innerHTML = '---';
	document.getElementById(wheel+'_lblLaengeRechts').innerHTML = '---';
	document.getElementById(wheel+'_lblTotalGew').innerHTML = 'n/a';
	document.getElementById('lblGewBoth').innerHTML = 'n/a';
}

function selUserDefOption(name)
{
	if(document.getElementById(name).options.length==1)
		document.getElementById(name).selectedIndex = 0;
	else
		document.getElementById(name).selectedIndex = 1;
}

function clearOptions(name,txt)
{
	var drp = document.getElementById(name);
	for(i=drp.options.length-1; i>=0; i--)
		drp.options[i] = null;
	
	var userDefOpt = new Option(txt,'-',true,true);
	drp.options[0] = userDefOpt;
}



