//This function is for childbrowse.xsl
function HandleFt()
{
   if (document.ft.pm_SC.value == 'FT' ) {
      document.ft.pm_FT.value = document.ft.pm_SA.value;
      document.ft.pm_OPC.value = document.ft.pm_OPC.value;
      document.ft.pm_MH_value = document.ft.pm_MH.value;
      document.ft.pm_CL=document.ft.pm_CL;
   }
}

//HandleFT();
function GetChecked()
{
   dml=document.querybox;
   //check to make sure at least one checkbox is selected in body
   rb = false //assume no collections are selected
   if (dml.pm_CL == null) //assume that no collections exist
   {
	//Check local OPAC
	if(dml.pm_OPC.checked){
		rb = true;//as long as one is chosen this is set to true
	}
        if(rb==false){
	   alert("Please select a collection");
	   return false;
	}
   }
   else
   {
      for(i = 0; i < dml.pm_CL.length; i++){

	 if(dml.pm_CL[i].checked){
		rb = true;//as long as one is chosen this is set to true
	 }
      }
      //Check local OPAC
      if(dml.pm_OPC.checked){
		rb = true;//as long as one is chosen this is set to true
      }
      if(rb==false){
	 alert("Please select a collection");
	 return false;
      }
   }
}
//This function is for childbrowseadvanced.xsl
function GetCheckedAdvanced()
{
   dml=document.fake;
   //check to make sure at least one checkbox is selected in body
   rb = false //assume no collections are selected
   if (dml.pm_CL == null) //assume that no collections exist
   {
	//Check local OPAC
      if(dml.pm_OPC.checked){
		rb = true;//as long as one is chosen this is set to true
      }
      if(rb==false){
	 alert("Please select a collection");
	 return false;
      }
      finish()//Use this to call the querybox form to validate if anything is in the search box
   }

   else
   {
      for(i = 0; i < dml.pm_CL.length; i++){

	 if(dml.pm_CL[i].checked){
		rb = true;//as long as one is chosen this is set to true
	 }
      }
      //Check local OPAC
      if(dml.pm_OPC.checked){
		rb = true;//as long as one is chosen this is set to true
      }
      if(rb==false){
	 alert("Please select a collection");
	 return false;
      }
      finish()//Use this to call the querybox form to validate if anything is in the search box
   }
}

function finish()
{
validate_form_advanced(document.querybox)
}
//}
