function show_hide_box(id)
{
	var box_bot = document.getElementById("bot"+id);
	var box_top = document.getElementById("top"+id);
	var arrow_image = document.getElementById("arrow_image"+id);
	var class_name = "site_admin_box_bot";
	var title = "Click to hide";
	var arrow_image_link = "../images/site/arrow_hide.gif";
	var id_field1 = document.getElementById("id_field1")
	var id_field2 = document.getElementById("id_field2")
	
	if (box_bot.className == "site_admin_box_bot")
	{
		class_name = "hide";
		title = "Click to display";
		arrow_image_link = "../images/site/arrow_display.gif";
	}
	
	box_bot.className = class_name;
	box_top.title = title;
	arrow_image.src = arrow_image_link;
	
	if (id_field1)
		if (id_field2)
			id_field2.value = id_field1.value;
}

function print_page(url)
{
    window.open(url,"index","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=760,height=600");
}

function open_window(url)
{
	window.open(url);
}

function set_link(id)
{
	var link = document.getElementById(id);
	var url = link.href;
	
	if (!url.match("netherlands-embassy.org.uk"))
		link.href = "javascript:open_window('"+url+"')";
}

function set_rollover_menu(id,action)
{
	var i;
	
	for (i=2; i<7; i++)
	{
		if (document.getElementById("rollover_menu_"+i))
			document.getElementById("rollover_menu_"+i).className = "hide";
	}
	
	if (action == "on" && document.getElementById("rollover_menu_"+id))
            document.getElementById("rollover_menu_"+id).className = "rollover_menu";
}

function set_booking_type()
{
	var booking_type = document.getElementById("booking_type").value;
	var id_name;
	
	document.getElementById("declarations_fields").className = "hide";
	document.getElementById("passports_fields").className = "hide";
	document.getElementById("application_for").className = "hide";
	document.getElementById("application_for_title").className = "hide";
	
	if (booking_type == "consular declarations")
	{
		document.getElementById("declarations_fields").className = "";
	}
	else if (booking_type == "passports & id cards")
	{
		document.getElementById("passports_fields").className = "";
		document.getElementById("passports_fields").className = "";
		document.getElementById("application_for").className = "textbox_lg";
		document.getElementById("application_for_title").className = "";
	}
}

function set_recurring_fields()
{
	var field = document.getElementById("recurrences");
	var label = document.getElementById("recurrences_label");
	
	if (document.getElementById("recurring").value == "none")
	{
		field.className = "hide";
		label.className = "hide";
	}
	else
	{
		field.className = "textbox_lg";
		label.className = "";
	}
}

function display_other_box(question, answer)
{
	var other_box = document.getElementById(question+"otherBox");
	other_box.style.display = "none";
	document.getElementById(question+"other").value = "";
	
	if (answer == "other")
	{
		other_box.style.display = "block";
		other_box.style.marginTop = "10px";
	}
}

function display_question(question, hide)
{
	var qu = document.getElementById(question);
	var qu2 = document.getElementById("question15");
	qu.style.display = "block";
	if (question == "question14") qu2.style.display = "block";
	
	if (hide == "y")
	{
		qu.style.display = "none";
		if (question == "question14") qu2.style.display = "none";
	}
}