/* File Create Date: 10/30/2007
   File Created By: Dave Nagrocki -- rjjj016
   
   To Implement this js file:
   
   1) Add the following within the <head></head> section to every page this script is needed: 
   
      <script type="text/javascript" language="javascript" src="DropDownHandler.js"></script>
   
   2) Add the following to the search button in the html depending upon PartA or PartB searches:
   
          onclick="doSubmitPartA();"
          onclick="doSubmitPartB();"
          
      So the search button will look like this: 
          <input type="submit" name="btnG" value="Search" onclick="doSubmitPartA();"/> --OR--
          <input type="submit" name="btnG" value="Search" onclick="doSubmitPartB();"/>
   
   3) Make sure the name of the dropdown in the html matches the value below, or change it to whatever you want.
      If the name is modified, you must change the following code in BOTH methods below:
        
      document.forms[0].FAQs.selectedIndex (Where the name of the dropdown is 'FAQs')
   
   4) Within the page, make sure the following hidden values are present with no value as indicated.  Add
      this to every page in which the search is needed:
   
        <input type="hidden" name="site" value=""/>
        <input type="hidden" name="client" value=""/>
        <input type="hidden" name="proxystylesheet" value=""/>
        
   5) Add the proper values to the siteValue, clientValue, and proxyStyleSheetValue arrays in the same indexed
      order they appear in the dropdown list for both methods below.

*/

//--------------------------------------------------------------------------------------------------------------


/*
Below is the method for PartA.  Add all items necessary for PartA Processing here.
*/
function doSubmitPartA(){

    /*Set up the sites, clients, and stylesheets and index them based on the order in the dropdown list, 
      ie, the dropdown item for 'full site' is index 0 in the dropdown list, therefore all 0 indexes below
      should reference the 'full site' values.
    */
    
    //Index of array will correspond with dropdown index
    var siteValue = new Array()
        siteValue[0] = "Medicare_PartA_All"
        siteValue[1] = "Medicare_PartA_Business"
        siteValue[2] = "Medicare_PartA_Education"
        siteValue[3] = "Medicare_PartA_Fees"
        siteValue[4] = "Medicare_PartA_Policy"
        siteValue[5] = "Medicare_PartA_Publications"
        siteValue[6] = "Medicare_PartA_SelfService"

    //Index of array will correspond with dropdown index
    var clientValue = new Array()
        clientValue[0] = "MedicarePartA_frontend"
        clientValue[1] = "MedicarePartA_frontend"
        clientValue[2] = "MedicarePartA_frontend"
        clientValue[3] = "MedicarePartA_frontend"
        clientValue[4] = "MedicarePartA_frontend"
        clientValue[5] = "MedicarePartA_frontend"
        clientValue[6] = "MedicarePartA_frontend"

    //Index of array will correspond with dropdown index 
    var proxyStyleSheetValue = new Array()
        proxyStyleSheetValue[0] = "MedicarePartA_frontend"
        proxyStyleSheetValue[1] = "MedicarePartA_frontend"
        proxyStyleSheetValue[2] = "MedicarePartA_frontend"
        proxyStyleSheetValue[3] = "MedicarePartA_frontend"
        proxyStyleSheetValue[4] = "MedicarePartA_frontend"
        proxyStyleSheetValue[5] = "MedicarePartA_frontend"
        proxyStyleSheetValue[6] = "MedicarePartA_frontend"

   
    //Get the selected dropdown value
    var ddIndex  = document.forms["parta"].PartA.selectedIndex
	
    //Set the hidden values based on the index selected and their corresponding array index values
	document.forms["parta"].site.value = siteValue[ddIndex]
	document.forms["parta"].client.value = clientValue[ddIndex]
	document.forms["parta"].proxystylesheet.value = proxyStyleSheetValue[ddIndex]

  //This passes the selected search list to the Googlemini frontend 
	document.forms["parta"].selectedListValue.value = ddIndex

}


/*
Below is the method for PartB.  Add all items necessary for PartB Processing here.
*/
function doSubmitPartB(){

    /*Set up the sites, clients, and stylesheets and index them based on the order in the dropdown list, 
      ie, the dropdown item for 'full site' is index 0 in the dropdown list, therefore all 0 indexes below
      should reference the 'full site' value.
    */
    
    //Index of array will correspond with dropdown index
    var siteValue = new Array()
        siteValue[0] = "Medicare_PartB_All"
        siteValue[1] = "Medicare_PartB_Business"
        siteValue[2] = "Medicare_PartB_Education"
        siteValue[3] = "Medicare_PartB_FAQ"
        siteValue[4] = "Medicare_PartB_Fees"
        siteValue[5] = "Medicare_PartB_Policy"
        siteValue[6] = "Medicare_PartB_Publications"
        siteValue[7] = "Medicare_PartB_SelfService"

    //Index of array will correspond with dropdown index
    var clientValue = new Array()
        clientValue[0] = "MedicarePartB_frontend"
        clientValue[1] = "MedicarePartB_frontend"
        clientValue[2] = "MedicarePartB_frontend"
        clientValue[3] = "MedicarePartB_frontend"
        clientValue[4] = "MedicarePartB_frontend"
        clientValue[5] = "MedicarePartB_frontend"
        clientValue[6] = "MedicarePartB_frontend"
        clientValue[7] = "MedicarePartB_frontend"

    //Index of array will correspond with dropdown index 
    var proxyStyleSheetValue = new Array()
        proxyStyleSheetValue[0] = "MedicarePartB_frontend"
        proxyStyleSheetValue[1] = "MedicarePartB_frontend"
        proxyStyleSheetValue[2] = "MedicarePartB_frontend"
        proxyStyleSheetValue[3] = "MedicarePartB_frontend"
        proxyStyleSheetValue[4] = "MedicarePartB_frontend"
        proxyStyleSheetValue[5] = "MedicarePartB_frontend"
        proxyStyleSheetValue[6] = "MedicarePartB_frontend"
        proxyStyleSheetValue[7] = "MedicarePartB_frontend"

   
    //Get the selected dropdown value
    var ddIndex  = document.forms["partb"].PartB.selectedIndex
	
    //Set the hidden values based on the index selected and their corresponding array index values
	document.forms["partb"].site.value = siteValue[ddIndex]
	document.forms["partb"].client.value = clientValue[ddIndex]
	document.forms["partb"].proxystylesheet.value = proxyStyleSheetValue[ddIndex]

  //This passes the selected search list to the Googlemini frontend 
	document.forms["partb"].selectedListValue.value = ddIndex
	
}


/*
Below is the method for MAC.  Add all items necessary for MAC Processing here.
*/
//function doSubmitMAC(){

    /*Set up the sites, clients, and stylesheets and index them based on the order in the dropdown list,
      ie, the dropdown item for 'full site' is index 0 in the dropdown list, therefore all 0 indexes below
      should reference the 'full site' value.
    */

    //Index of array will correspond with dropdown index
/*    var siteValue = new Array()
        siteValue[0] = "Medicare_MAC"
        siteValue[1] = "Medicare_MAC_Business"
        siteValue[2] = "Medicare_MAC_Education"
        siteValue[3] = "Medicare_MAC_Fees"
        siteValue[4] = "Medicare_MAC_Policy"
        siteValue[5] = "Medicare_MAC_Publications"
        siteValue[6] = "Medicare_MAC_SelfService"

    //Index of array will correspond with dropdown index
    var clientValue = new Array()
        clientValue[0] = "MedicareMAC_frontend"
        clientValue[1] = "MedicareDefault_frontend"
        clientValue[2] = "MedicareDefault_frontend"
        clientValue[3] = "MedicareDefault_frontend"
        clientValue[4] = "MedicareDefault_frontend"
        clientValue[5] = "MedicareDefault_frontend"
        clientValue[6] = "MedicareDefault_frontend"

    //Index of array will correspond with dropdown index
    var proxyStyleSheetValue = new Array()
        proxyStyleSheetValue[0] = "MedicareMAC_frontend"
        proxyStyleSheetValue[1] = "MedicareDefault_frontend"
        proxyStyleSheetValue[2] = "MedicareDefault_frontend"
        proxyStyleSheetValue[3] = "MedicareDefault_frontend"
        proxyStyleSheetValue[4] = "MedicareDefault_frontend"
        proxyStyleSheetValue[5] = "MedicareDefault_frontend"
        proxyStyleSheetValue[6] = "MedicareDefault_frontend"


    //Get the selected dropdown value
    var ddIndex  = document.forms["mac"].MAC.selectedIndex

    //Set the hidden values based on the index selected and their corresponding array index values
	document.forms["mac"].site.value = siteValue[ddIndex]
	document.forms["mac"].client.value = clientValue[ddIndex]
	document.forms["mac"].proxystylesheet.value = proxyStyleSheetValue[ddIndex]

}
*/
// ==========================================================================
// =============  NEW MAC PART A & B SPLIT SEARCH BELOW  ====================
// ==========================================================================
/*
Below is the method for MAC PART A.  Add all items necessary for MAC PART A Processing here.
*/
function doSubmitMACPartA(){

    /*Set up the sites, clients, and stylesheets and index them based on the order in the dropdown list,
      ie, the dropdown item for 'full site' is index 0 in the dropdown list, therefore all 0 indexes below
      should reference the 'full site' value.
    */

    //Index of array will correspond with dropdown index
    var siteValue = new Array()
        siteValue[0] = "Medicare_MAC_A"
        siteValue[1] = "Medicare_MAC_A_Policy"
        siteValue[2] = "Medicare_MAC_A_Fees"
        siteValue[3] = "Medicare_MAC_A_Training"
        siteValue[4] = "Medicare_MAC_A_Departments"
        siteValue[5] = "Medicare_MAC_A_Publications"
        siteValue[6] = "Medicare_MAC_A_SelfService"
        siteValue[7] = "Medicare_MAC_A_FAQ"
        siteValue[8] = "Medicare_MAC_A_Forms"

    //Index of array will correspond with dropdown index
    var clientValue = new Array()
        clientValue[0] = "MedicareMAC_A_frontend"
        clientValue[1] = "MedicareMAC_A_frontend"
        clientValue[2] = "MedicareMAC_A_frontend"
        clientValue[3] = "MedicareMAC_A_frontend"
        clientValue[4] = "MedicareMAC_A_frontend"
        clientValue[5] = "MedicareMAC_A_frontend"
        clientValue[6] = "MedicareMAC_A_frontend"
        clientValue[7] = "MedicareMAC_A_frontend"
        clientValue[8] = "MedicareMAC_A_frontend"

    //Index of array will correspond with dropdown index
    var proxyStyleSheetValue = new Array()
        proxyStyleSheetValue[0] = "MedicareMAC_A_frontend"
        proxyStyleSheetValue[1] = "MedicareMAC_A_frontend"
        proxyStyleSheetValue[2] = "MedicareMAC_A_frontend"
        proxyStyleSheetValue[3] = "MedicareMAC_A_frontend"
        proxyStyleSheetValue[4] = "MedicareMAC_A_frontend"
        proxyStyleSheetValue[5] = "MedicareMAC_A_frontend"
        proxyStyleSheetValue[6] = "MedicareMAC_A_frontend"
        proxyStyleSheetValue[7] = "MedicareMAC_A_frontend"
        proxyStyleSheetValue[8] = "MedicareMAC_A_frontend"


    //Get the selected dropdown value
    var ddIndex  = document.forms["maca"].MACA.selectedIndex

    //Set the hidden values based on the index selected and their corresponding array index values
	document.forms["maca"].site.value = siteValue[ddIndex]
	document.forms["maca"].client.value = clientValue[ddIndex]
	document.forms["maca"].proxystylesheet.value = proxyStyleSheetValue[ddIndex]

  //This passes the selected search list to the Googlemini frontend 
	document.forms["maca"].selectedListValue.value = ddIndex

}
/*
Below is the method for MAC PART A.  Add all items necessary for MAC PART A Processing here.
*/
function doSubmitMACPartB(){

    /*Set up the sites, clients, and stylesheets and index them based on the order in the dropdown list,
      ie, the dropdown item for 'full site' is index 0 in the dropdown list, therefore all 0 indexes below
      should reference the 'full site' value.
    */

    //Index of array will correspond with dropdown index
    var siteValue = new Array()
        siteValue[0] = "Medicare_MAC_B"
        siteValue[1] = "Medicare_MAC_B_Policy"
        siteValue[2] = "Medicare_MAC_B_Fees"
        siteValue[3] = "Medicare_MAC_B_Training"
        siteValue[4] = "Medicare_MAC_B_Departments"
        siteValue[5] = "Medicare_MAC_B_Publications"
        siteValue[6] = "Medicare_MAC_B_SelfService"
        siteValue[7] = "Medicare_MAC_B_FAQ"
        siteValue[8] = "Medicare_MAC_B_Forms"

    //Index of array will correspond with dropdown index
    var clientValue = new Array()
        clientValue[0] = "MedicareMAC_B_frontend"
        clientValue[1] = "MedicareMAC_B_frontend"
        clientValue[2] = "MedicareMAC_B_frontend"
        clientValue[3] = "MedicareMAC_B_frontend"
        clientValue[4] = "MedicareMAC_B_frontend"
        clientValue[5] = "MedicareMAC_B_frontend"
        clientValue[6] = "MedicareMAC_B_frontend"
        clientValue[7] = "MedicareMAC_B_frontend"
        clientValue[8] = "MedicareMAC_B_frontend"

    //Index of array will correspond with dropdown index
    var proxyStyleSheetValue = new Array()
        proxyStyleSheetValue[0] = "MedicareMAC_B_frontend"
        proxyStyleSheetValue[1] = "MedicareMAC_B_frontend"
        proxyStyleSheetValue[2] = "MedicareMAC_B_frontend"
        proxyStyleSheetValue[3] = "MedicareMAC_B_frontend"
        proxyStyleSheetValue[4] = "MedicareMAC_B_frontend"
        proxyStyleSheetValue[5] = "MedicareMAC_B_frontend"
        proxyStyleSheetValue[6] = "MedicareMAC_B_frontend"
        proxyStyleSheetValue[7] = "MedicareMAC_B_frontend"
        proxyStyleSheetValue[8] = "MedicareMAC_B_frontend"


    //Get the selected dropdown value
    var ddIndex  = document.forms["macb"].MACB.selectedIndex
    
    //Set the hidden values based on the index selected and their corresponding array index values
	document.forms["macb"].site.value = siteValue[ddIndex]
	document.forms["macb"].client.value = clientValue[ddIndex]
	document.forms["macb"].proxystylesheet.value = proxyStyleSheetValue[ddIndex]
  //This passes the selected search list to the Googlemini frontend 
	document.forms["macb"].selectedListValue.value = ddIndex

}

