function check_num_waybills(lang)
{

	if (document.content.Sa_waybill_ref_radio[0].checked)
	{
		str_waybills=document.content.Sa_waybill_list.value;
		str_waybills=str_waybills + "";
		var ary_waybills=str_waybills.split(",");

		if( document.content.Sa_waybill_list.value == "" )
		{
			alert("Please enter DHL Express Waybill Number")
			document.content.Sa_waybill_list.focus()
		}
		else if (ary_waybills.length>25)
		{
			if(lang=="fr")
			{
				alert("N'a pas pu entrer plus de 25 connaissement.");
				document.content.Sa_waybill_list.focus();
			}
			else
			{
				alert("Could not input more than 25 waybills.");
				document.content.Sa_waybill_list.focus();
			}
		}
		else
		{
			document.content.submit ();
		}
	}
	else
	{
		str_refs=document.content.Sa_waybill_list.value;
		str_refs=str_refs + "";
		var ary_refs=str_refs.split(",");


		if( document.content.Sa_waybill_list.value == "" )
		{
			alert("Please enter a Customer Reference Number ")
			document.content.Sa_waybill_list.focus()
		}
		else if (ary_refs.length>1)
		{
			alert("Could not input more than 1 Customer Reference Number.");
			document.content.Sa_waybill_list.focus()
		}
		else
		{
			document.content.submit ();
		}
	}
}


function view_wyawill()
{
	if (document.content.Sa_waybill_ref_radio[0].checked)
	{
		str_waybills=document.content.Sa_waybill_list.value;
		str_waybills=str_waybills + "";
		var ary_waybills=str_waybills.split(",");

		if( document.content.Sa_waybill_list.value == "" )
		{
			alert("Please enter DHL Express Waybill Number")
			document.content.Sa_waybill_list.focus()
		}
		else if (ary_waybills.length>1)
		{
			alert("Could not input more than 1 Waybill while viewing waybill.");
			document.content.Sa_waybill_list.focus()
		}
		else
		{
			document.forms[0].act.value="src"
			document.forms[0].action = "/img_wb/index.asp"
			document.forms[0].submit()
		}
	}
	else
	{
		alert("Please select the option for DHL Express Waybill Number")
	}
}

