
function choose_domain(domain_name)
{
	var e;

	try {
		var order_form_flag = parseInt(window.opener.document.getElementById('order_form_flag').value, 10);
		if(order_form_flag) {
			window.opener.document.getElementById('domain_name').value = domain_name;
			alert('Vybraná doména byla úspěšně vyplněna do objednávkového formuláře. Toto okno bude automaticky uzavřeno (po stisknutí tlačitka OK).');
			window.close();
		} else {
			throw 1;
		}
	}
	catch(e) {
		alert('Objednávkový formulář, z kterého bylo otevřeno toto okno, se v původním okně prohlížeče již nenachází, proto nelze vybrat doménu.');
	}
	finally {
	}
}

function show_domain_win()
{
	document.getElementById('domain_win').style.visibility='visible';
}

function hide_domain_win()
{
	document.getElementById('domain_win').style.visibility='hidden';
}

function lookup_row_mouse_over(i, error, domain_name, popup_flag)
{
	error = parseInt(error, 10);
	document.getElementById('lookup_cell_'+i+'_0').style.backgroundColor='#aeb9ce';
	document.getElementById('lookup_cell_'+i+'_1').style.backgroundColor='#aeb9ce';
	document.getElementById('lookup_cell_'+i+'_2').style.backgroundColor='#aeb9ce';
	if(domain_name.length > 0) {
		if(!error) {
			if(popup_flag) {
				window.status='Vybrat doménu ' + domain_name;
			} else {
				window.status='Objednat doménu ' + domain_name;
			}
			document.getElementById('lookup_cell_'+i+'_3').style.backgroundColor='#cf0000';
			document.getElementById('lookup_cell_'+i+'_3').style.color='#ffffff';
		}
	} else {
		if(!error) {
			document.getElementById('lookup_cell_'+i+'_3').style.backgroundColor='#aeb9ce';
		}
	}
	if(!error) document.getElementById('lookup_cell_'+i+'_4').style.backgroundColor='#aeb9ce';
}

function lookup_row_mouse_out(i, error)
{
	error = parseInt(error, 10);
	window.status='';
	document.getElementById('lookup_cell_'+i+'_0').style.backgroundColor='#ffffff';
	document.getElementById('lookup_cell_'+i+'_1').style.backgroundColor='#ffffff';
	document.getElementById('lookup_cell_'+i+'_2').style.backgroundColor='#ffffff';
	if(!error) {
		document.getElementById('lookup_cell_'+i+'_3').style.backgroundColor='#ffffff';
		document.getElementById('lookup_cell_'+i+'_4').style.backgroundColor='#ffffff';
		document.getElementById('lookup_cell_'+i+'_3').style.color='#38566a';
	}
}

