/**************************************************************************
  Search Region Utility Functions
  Reusable functions for any task connected to region search.

  Created by Bjørn Viggo Andersen

**************************************************************************/


/**
* This method should be called with a onclick event on the <A> html tag.
* It checks if any of the region checkboxes are checked and it so, adds
* them to the hRef of the <A> tag.
*
* Parameters:
* oATag - a javascript object of type <A> html tag.
*/
function addSearchRegionParameters(oATag) {
    if (document.transferForm.searchRegionAa.checked)
        oATag.href = oATag.href + "&searchRegionAa=true";
    if (document.transferForm.searchRegionBt.checked)
        oATag.href = oATag.href + "&searchRegionBt=true";
    if (document.transferForm.searchRegionFv.checked)
        oATag.href = oATag.href + "&searchRegionFv=true";
    if (document.transferForm.searchRegionSa.checked)
        oATag.href = oATag.href + "&searchRegionSa=true";
}


/**
* This method should be called with a onclick event on the <SPAN> html tag.
* It checks if any of the region checkboxes are checked and it so, adds
* them to the location variable. It then changes the location of the document.
*
* Parameters:
* sLocation - a string containg the location to set on the document.
*/
function addSearchRegionParametersAndChangeLocation(sLocation) {
    if (document.transferForm.searchRegionAa.checked)
        sLocation = sLocation + "&searchRegionAa=true";
    if (document.transferForm.searchRegionBt.checked)
        sLocation = sLocation + "&searchRegionBt=true";
    if (document.transferForm.searchRegionFv.checked)
        sLocation = sLocation + "&searchRegionFv=true";
    if (document.transferForm.searchRegionSa.checked)
        sLocation = sLocation + "&searchRegionSa=true";
    document.location = sLocation;
}