<!--script language="JavaScript"-->
//<SCRIPT LANGUAGE="Javascript"><!--
// ***********************************************
	// this function used the select the multiple checkboxes
	// listed in the list
	function SelectAll()
	{
		var MaxChks = parseInt(document.Form1.chk_id.length);
		if ( isNaN(MaxChks) )		// if there is only one record in a page
									// then chk_airline_id doesnt become a array
									// so returns NaN
		{
			MaxChks = 0;			// then put zero in it
		}

		if ( document.Form1.chk_top.checked )
		{
			for ( i = 0; i < MaxChks; i++)				// make all the check boxes checked
			{
				document.Form1.chk_id[i].checked = true;
			}
			if ( MaxChks == 0 )			// if MaxChks is 0 then chk_airline_id is not an array
				document.Form1.chk_id.checked = true;
		}
		else
		{
			for ( i = 0; i < MaxChks; i++)			// make all the check boxes unchecked
			{
				document.Form1.chk_id[i].checked = false;
			}
			if ( MaxChks == 0 )
				document.Form1.chk_id.checked = false;
		}
	}
	function MakeString(mTitle)
	{
		var MaxChks = parseInt(document.Form1.chk_id.length);
		var ret = "" ;
		if ( isNaN(MaxChks) )
		{
			MaxChks = 0;
		}
		var count_chks = 0;		
		if ( MaxChks == 0 )			// if MaxChks is 0 then ImgSr is not an array
		{
			if (document.Form1.chk_id.checked )
			{
				ret = document.Form1.chk_id.value + ",";
				count_chks++;
			}
		}
		else
		{
			for ( i = 0; i < MaxChks; i++)
			{
				if (document.Form1.chk_id[i].checked )
				{
					ret = ret + document.Form1.chk_id[i].value + ",";
					count_chks++;
				}
			}
		}
		if ( count_chks == 0 )
		{
			alert("Please select a " + mTitle + " From " + mTitle + " List and proceed");
			return false;
		}
		return ret;
	}
	function SubmitForm(str, Search, txt_search, mTitle, mAction )
	{
		//alert(mAction);
//alert("the parameteres are :: str="+str+", search="+ Search + ", txt_search-3=="+txt_search+", mTitle="+mTitle+", mAction="+mAction);
		var get = MakeString(mTitle);
		alert(get);
		if ( ! get )
		{
			return false;
		}

						// submits the form with some query string data
		document.Form1.action = mAction +  "?command_string=" + str + "&chk_ids=" + get + "&search=" + Search + "&txt_search=" + txt_search ;
//alert("the form  action :: " + document.Form1.action + "===");
		document.Form1.submit();
	}

