//Code for layout and menus.  Used by all pages

if (document.layers)  
{
  visible = 'show';
  hidden = 'hide';
} else {
  visible = 'visible';
  hidden = 'hidden';
}

function insPathGrp(sPath, reg) 
{
  Tmplt = /\D{1,3}/
  return Tmplt.test(sPath.value);
}

function GrantFocus()
{
  document.CatalogSearch.txtSearch.focus();
  posBottomBar();
}

function posBottomBar()
{
  if ((document.getElementById('cssRightBody').offsetHeight + 150) > 640) 
  {
    document.getElementById('cssFooter').style.top = document.getElementById('cssRightBody').offsetHeight + 150;
    document.getElementById('subUsefulLinks').style.top = document.getElementById('cssRightBody').offsetHeight;
  } else {
    document.getElementById('cssFooter').style.top = 640;
    document.getElementById('subUsefulLinks').style.top = 570;
  };
}

function LogInTog(menu)
{
  if (document.all) 
  {
    sMenu = document.all(menu).style;
  } else {
    sMenu = document.getElementById(menu).style;
  }

  if (sMenu.visibility == visible)
  {
    sMenu.visibility = hidden;
  } else {
    sMenu.visibility = visible;
  }

}

function barTog(menu) 
{ 
  if (document.all) 
  {
    sMenu = document.all(menu).style;
  } else {
    sMenu = document.getElementById(menu).style;
  }

  if (document.all)
  {
    document.all('subPrograms').style.visibility = hidden;
    document.all('subProducts').style.visibility = hidden;
    document.all('subServices').style.visibility = hidden;
    document.all('subLegislation').style.visibility = hidden;
    document.all('subAbout').style.visibility = hidden;
    document.all('subContact').style.visibility = hidden;
    document.all('subUsefulLinks').style.visibility = hidden;
    if(document.all('subPbaOnline'))
    {
      document.all('subPbaOnline').style.visibility = hidden;
    }
    sMenu.visibility = visible;
  } else {
    document.getElementById('subPrograms').style.visibility = hidden;
    document.getElementById('subProducts').style.visibility = hidden;
    document.getElementById('subServices').style.visibility = hidden;
    document.getElementById('subLegislation').style.visibility = hidden;
    document.getElementById('subAbout').style.visibility = hidden;
    document.getElementById('subContact').style.visibility = hidden;
    document.getElementById('subUsefulLinks').style.visibility = hidden;
    if(document.getElementById('subPbaOnline'))
    {
      document.getElementById('subPbaOnline').style.visibility = hidden;
    }
    sMenu.visibility = visible;
  };
  lastMenu = sMenu;
} 

function closeMnu()
{
  if (document.all)
  {
    document.all('subPrograms').style.visibility = hidden;
    document.all('subProducts').style.visibility = hidden;
    document.all('subServices').style.visibility = hidden;
    document.all('subLegislation').style.visibility = hidden;
    document.all('subAbout').style.visibility = hidden;
    document.all('subContact').style.visibility = hidden;
    document.all('subUsefulLinks').style.visibility = hidden;
    if(document.all('subPbaOnline'))
    {
      document.all('subPbaOnline').style.visibility = hidden;
    }
  } else {
    document.getElementById('subPrograms').style.visibility = hidden;
    document.getElementById('subProducts').style.visibility = hidden;
    document.getElementById('subServices').style.visibility = hidden;
    document.getElementById('subLegislation').style.visibility = hidden;
    document.getElementById('subAbout').style.visibility = hidden;
    document.getElementById('subContact').style.visibility = hidden;
    document.getElementById('subUsefulLinks').style.visibility = hidden;
    if(document.getElementById('subPbaOnline'))
    {
      document.getElementById('subPbaOnline').style.visibility = hidden;
    }
  };
}

function ArticleSwap(psArticle)
{
  if (document.all) 
  {
    sArticle = document.all(psArticle).style;
  } else {
    sArticle = document.getElementById(psArticle).style;
  }

  if (document.all)
  {
    document.all('subArticle1').style.visibility = hidden;
    document.all('subArticle2').style.visibility = hidden;
    document.all('subArticle3').style.visibility = hidden;
    document.all('subArticle4').style.visibility = hidden;
    document.all('cssRightBody').style.visibility = hidden;
    sArticle.visibility = visible;
  } else {
    document.getElementById('subArticle1').style.visibility = hidden;
    document.getElementById('subArticle2').style.visibility = hidden;
    document.getElementById('subArticle3').style.visibility = hidden;
    document.getElementById('subArticle4').style.visibility = hidden;
    document.getElementById('cssRightBody').style.visibility = hidden;
    sArticle.visibility = visible;
  };

  posBottomBar();
}

function popUp(URL) 
{
  eval("page = window.open(URL, 'Window1', 'toolbar=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=0, width=650, height=500, left=0 top=0');");
  return;
}

function toolbarpopUp(URL)
{
  eval("page = window.open(URL, 'Window1', 'toolbar=1, scrollbars=1, location=1, resizable=1, menubars=1, width=650, height=500, left=0 top=0');");
  return;
}

function validation(sPath)
{
  for (i = 1; i != 2; i++)
  {
    if (sPath.elements[i].value == "") 
    {
      alert("A required field has not been filled. Please enter all required information and click the Send My Request              button.");
      return false;
    };
  }
      
  if (sPath.elements[9].value == "") 
  {
    alert(sPath.elements[9].name + " is blank");
    return false;
  };   
}

function ConvertToCurrency(sValue)
{
  Tmplt = /\d+\.\d{2}/;
  if (Tmplt.test(sValue) == false)
  {
    Tmplt = /\d+\.\d/;
    if (Tmplt.test(sValue) == true)
    {
      sValue = sValue + "0";
    }
    if (Tmplt.test(sValue) == false)
    {
      Tmplt = /\d+/;
      if (Tmplt.test(sValue) == true)
      {
        sValue = sValue + ".00";
      }
    }
  }
  return sValue
}

function OpenGenericRatioCalc()
{
  URL=''
  newWindow = window.open(URL,'Window1','toolbars=0, scrollbars=0, location=0, statusbars=0,menubars=0, resizable=0, width=400, height=500, left=400 top=200');
  document.GenericRatioCalc.submit()
}

//code for SignOn

function SignOnValidation(sPath)
{
  sTR = document.SignOn.txtJsCheck;
  sTR.value = "";
  sTR.value = "1";
  document.SignOn.Redirect.value = location.search.slice(1);
  for (i = 0; i != 5; i++)
  {
    Tmplt = /\s/g;
    sPath.elements[i].value = sPath.elements[i].value.replace(Tmplt, "");
    txtCurrent = sPath.elements[i].value;
    txtName = sPath.elements[i].name;
    if (txtCurrent == '')
    {
      if (txtName == 'txtNabpNb')
      {
        txtName = 'Customer Id';
        alert("Please fill the " + txtName + " field and press the Submit Button");
        return false;
      }

      if (txtName == 'txtPasswordTx')
      {
        txtName = 'Password';
        alert("Please fill the " + txtName + " field and press the Submit Button");
        return false;
      }
    };

    if (txtName == 'txtNabpNb')
    {
      txtName = 'Customer ID';
      Tmplt = /\D/g;
      iMatch = txtCurrent.search(Tmplt);

      if (iMatch != -1)
      {
        alert ("You may only enter numbers in the Customer ID field.");
        return false;
      }

      if (txtCurrent.length < 6)
      {
        alert ("The Customer ID field must have 7 numbers.");
        return false;
      }
    }

    if (txtName == 'txtPasswordTx')
    {
      txtName = 'Password';
      Tmplt = /\W/g;
      iMatch = txtCurrent.search(Tmplt);
      if (iMatch != -1)
      {
        alert ("You may only enter numbers or letters in the Password field.");
        return false;
      }
    }
    //writeCookie();
  };
}

function writeCookie(sPath)
{
  if (SignOnValidation(sPath) == false) 
  {
    return false;
  }
  else
  {
    var CustId = document.SignOn.txtNabpNb.value;
    var the_cookie = "CustInfo=" + escape("CustId=" + CustId) + ";expires=Mon, 31-Dec-2025 00:00:00 GMT";
    document.cookie = the_cookie;
  }
}

function readCookie()
{ 
  if(document.cookie == '') 
  {
    return false; 
  } 
  else 
  {
    var the_cookie = document.cookie;
    var CustIdStart = unescape(the_cookie).indexOf("CustId");
    var CustId = unescape(the_cookie).substr(CustIdStart + 7,7);  
    document.SignOn.txtNabpNb.value = CustId;
  }
}

//End code for sign on

//Code for Catalog Search

function SimpleValidation(sPath)
{
  var sTxt = sPath.value;
  if (sTxt != " ") 
  {
    if (insPathGrp(sPath, "\D") == true || (sPath.value == "0") || (sPath.value =="00") || (sPath.value == "000"))
    {
      event.returnValue = false;
      sPath.focus();
      sPath.value = "";
      alert("The information you have entered is invalid.  Please enter a number between 1 and 99.");
      return;
    }
  };
}

function SearchByLetter(sLetter)
{
  document.CatalogSearch.txtSearch.value = sLetter;
  document.CatalogSearch.SearchType.value = 'LetterSearch';
  document.CatalogSearch.submit();
}

function SubmitAddToCart()
{
  URL = 'http://www.pbahealth.com/pbaOnline/pbaoProcessing.htm';

  newWindow = window.open(URL,'newWindow','toolbars=0, scrollbars=0, location=0, statusbars=0,menubars=0, resizable=0, width=190, height=190, left=400 top=300');

  if (f_store(document.ResultList) == true)
  {
    document.xmlsPathing.submit();
  }

  status = 'Items Added To Cart';

  for (i = 0; i < document.ResultList.length; i++) 
  {
    var e = document.ResultList.elements[i];
    if (e.type == "text") 
    {
      if ((e.value != "") && (e.value != " ")) 
      {
        e.value = '';
      };
    };
  }

//  setTimeout("newWindow.close()", 1500);
  setTimeout("newWindow.close()", 4000);

}

function f_store(sPath)
{
  var sTxt = "";
  for (i = 0; i < sPath.length; i++)
  {
    var e = sPath.elements[i];
    var txtName = e.name;
    sSubsPath = txtName.substr(9);
    if (e.type == "text") 
    {
      if ((e.value != "") && (e.value != " ")) 
      {
        sTxt = sTxt + '<Item InvtId="' + sSubsPath;
        sTxt = sTxt + '" QtyOrd="' + e.value + '"/>';
      };
    };
  }

  var XmlTrans = document.xmlsPathing.txtItemList;
  if (sTxt != "") 
  {
    XmlTrans.value = "";
    XmlTrans.value = "<ItemList>" + sTxt; 
  } else {
    XmlTrans.value = "";
  };
  var sTxt = "";
  if (document.xmlsPathing.txtItemList.value != "")
  {
    document.xmlsPathing.txtItemList.value = document.xmlsPathing.txtItemList.value + "</ItemList>";
    return true;
  }
  else
  {
    alert("No item quantities were specified.  Please enter the quantity information for at least one item and try again.");
    return false;
  }
}

function AdvancedSearch()
{
  menu='AdvancedSearch';

  if (document.all) 
  {
    sMenu = document.all(menu).style;
  } else {
    sMenu = document.getElementById(menu).style;
  }

  if (sMenu.visibility == visible)
  {
    sMenu.visibility = hidden;
  } else {
    sMenu.visibility = visible;
  }  
}

//End code for catalog search
//Code for Shopping Cart

  function SaveShoppingCart() 
  {
    document.ShoppingCart.submit();
  }

//End code for Shopping Cart
//Code for Order Options

function SendOrder()
{ 
  sChkFlg = "false"; 
  c = 0      
  c = document.OrderOptions.optShipVia.length;

  if (document.OrderOptions.optShipVia.checked == true)
  {
    sChkFlg = "true";
  } else {
    for (i = 0; i < c; i++)
    {
      if (document.OrderOptions.optShipVia[i].checked == true)
      {
        sChkFlg = "true";
      } 
    };
  }  
        
  if (sChkFlg == "true")
  { 
    document.OrderOptions.submit();
  } else {  
    alert ("Please select a shipping method.");
  };
}

function CalcTotOrd(sSelected) 
{
  posBottomBar();
  sTotOrd = document.OrderOptions.txtOrgTotOrd.value;
  sTotOrd = sTotOrd.replace(/\s*,\s*/, "")
  sTotOrd = sTotOrd.replace(/\\$/, "")
  sTotOrd = (Number(sSelected) + Number(sTotOrd));
  sTotOrd = ConvertToCurrency(sTotOrd);
  sSelected = ConvertToCurrency(sSelected);
  sTotOrd = sTotOrd + "";
        
  nLength = sTotOrd.length;
  if (nLength > 6)
  {
    if (nLength < 10) 
    {
      nEnd = nLength - 6;
      sTotOrd = sTotOrd.slice(0,nEnd) + ',' + sTotOrd.slice(nEnd);
    }
  }
  if (nLength > 10)
  {
    if (nLength < 13)
    {
      nEnd = nLength - 6;
      sTotOrd = sTotOrd.slice(0,nEnd) + ',' + sTotOrd.slice(nEnd);
      nEnd = nLength - 9;
      sTotOrd = sTotOrd.slice(0,nEnd) + ',' + sTotOrd.slice(nEnd);
    }
  }
  document.OrderOptions.txtTotOrd.value = "$" + sTotOrd;
  document.OrderOptions.txtTotPremFrt.value = "$" + sSelected;
}

function GotFocus(sName)
{
  document.OrderOptions.txtOnFocus.value = sName.value
}

function LostFocus(sName)
{
  sName.value = document.OrderOptions.txtOnFocus.value;
}

//End code for Order Options
//Code for My Reports

function Archive(menu, menuPicture)
{

    if (document.all)
    {
      sMenu = document.all(menu).style;
    } else {
      sMenu = document.getElementById(menu).style;
    }

    if (document.all)
    {
      if (sMenu.display == 'block')
      {
        sMenu.display = 'none';
        document[menuPicture].src = "http://www.pbahealth.com/images/artPlus.gif"
      } else {
        sMenu.display = 'block';
        document[menuPicture].src = "http://www.pbahealth.com/images/artMinus.gif"
      }
    } else {
      if (sMenu.display == 'block')
      {
        sMenu.display = 'none';
        document[menuPicture].src = "http://www.pbahealth.com/images/artPlus.gif"
      } else {
        sMenu.display = 'block';
        document[menuPicture].src = "http://www.pbahealth.com/images/artMinus.gif"
      }
    };
    lastMenu = sMenu;

    posBottomBar();
}

function ToggleTabs(sTab)
{
  if (document.all)
  {
    if (sTab == 'Reports')
    {
      document.all('ActivitySummary').style.display = 'none';
      document.all('mnuActivitySummaryOff').style.display = 'block';
      document.all('mnuActivitySummaryOn').style.display = 'none';
      document.all('Reports').style.display = 'block';
      document.all('mnuReportsOff').style.display = 'none';
      document.all('mnuReportsOn').style.display = 'block';
      document.all('ProgramListing').style.display = 'none';
      document.all('mnuProgramListingOff').style.display = 'block';
      document.all('mnuProgramListingOn').style.display = 'none';
    }
  } else {
    if (sTab == 'Reports')
    {
      document.getElementById('ActivitySummary').style.display = 'none';
      document.getElementById('mnuActivitySummaryOff').style.display = 'block';
      document.getElementById('mnuActivitySummaryOn').style.display = 'none';
      document.getElementById('Reports').style.display = 'block';
      document.getElementById('mnuReportsOff').style.display = 'none';
      document.getElementById('mnuReportsOn').style.display = 'block';
      document.getElementById('ProgramListing').style.display = 'none';
      document.getElementById('mnuProgramListingOff').style.display = 'block';
      document.getElementById('mnuProgramListingOn').style.display = 'none';
    }
  }

  if (document.all)
  {
    if (sTab == 'ActivitySummary')
    {
      document.all('ActivitySummary').style.display = 'block';
      document.all('mnuActivitySummaryOff').style.display = 'none';
      document.all('mnuActivitySummaryOn').style.display = 'block';
      document.all('Reports').style.display = 'none';
      document.all('mnuReportsOff').style.display = 'block';
      document.all('mnuReportsOn').style.display = 'none';
      document.all('ProgramListing').style.display = 'none';
      document.all('mnuProgramListingOff').style.display = 'block';
      document.all('mnuProgramListingOn').style.display = 'none';
    } 
  } else {
    if (sTab == 'ActivitySummary')
    {
      document.getElementById('ActivitySummary').style.display = 'block';
      document.getElementById('mnuActivitySummaryOff').style.display = 'none';
      document.getElementById('mnuActivitySummaryOn').style.display = 'block';
      document.getElementById('Reports').style.display = 'none';
      document.getElementById('mnuReportsOff').style.display = 'block';
      document.getElementById('mnuReportsOn').style.display = 'none';
      document.getElementById('ProgramListing').style.display = 'none';
      document.getElementById('mnuProgramListingOff').style.display = 'block';
      document.getElementById('mnuProgramListingOn').style.display = 'none';
    }
  }

  if (document.all)
  {
    if (sTab == 'ProgramListing')
    {
      document.all('ActivitySummary').style.display = 'none';
      document.all('mnuActivitySummaryOff').style.display = 'block';
      document.all('mnuActivitySummaryOn').style.display = 'none';
      document.all('Reports').style.display = 'none';
      document.all('mnuReportsOff').style.display = 'block';
      document.all('mnuReportsOn').style.display = 'none';
      document.all('ProgramListing').style.display = 'block';
      document.all('mnuProgramListingOff').style.display = 'none';
      document.all('mnuProgramListingOn').style.display = 'block';
    } 
  } else {
    if (sTab == 'ProgramListing')
    {
      document.getElementById('ActivitySummary').style.display = 'none';
      document.getElementById('mnuActivitySummaryOff').style.display = 'block';
      document.getElementById('mnuActivitySummaryOn').style.display = 'none';
      document.getElementById('Reports').style.display = 'none';
      document.getElementById('mnuReportsOff').style.display = 'block';
      document.getElementById('mnuReportsOn').style.display = 'none';
      document.getElementById('ProgramListing').style.display = 'block';
      document.getElementById('mnuProgramListingOff').style.display = 'none';
      document.getElementById('mnuProgramListingOn').style.display = 'block';
    }
  }

  posBottomBar();
}
//End Code for My Reports
//Code for express lane

function SubmitExpressLane(sSubmitalType)
{
  if (sSubmitalType == 'Submit')
  {
    ExpressLaneValidation(document.ExpressLanePost)
  } else {
    return false;
  }
}

function RepackCheck()
{
  document.ExpressLanePost.Action.value = "CheckForRepacks";
  document.ExpressLanePost.submit()
}

function ExpressLaneValidation(sPath)
{
  for (i = 0; i < 20; i++)
  {
    Tmplt = /\s/g
    sPath.elements[i].value = sPath.elements[i].value.replace(Tmplt, "")
    txtCurrent = sPath.elements[i].value
  }

  for (i = 0; i < 20; i++)
  {
    txtCurrent = sPath.elements[i].value
    txtName = sPath.elements[i].name
    txtNumber = txtName.substr(9,2)
    txtName = txtName.substr(0,9)

    if (txtName == "txtInvtId")
    {
      for (a = 0; a < 20; a++)
      {
        txtTempName = sPath.elements[a].name
        txtTempNumber = txtTempName.substr(9,2)
        txtTempName = txtTempName.substr(0,9)

        if (txtTempName == txtName)
        {
          if ((txtCurrent == sPath.elements[a].value) && (sPath.elements[a] != sPath.elements[i]) && (txtCurrent != "") && (txtCurrent != " "))
          {
            alert("Sorry. The item you have entered in line " + txtNumber + " is the same as the item entered in line " + txtTempNumber + ".  Please correct one of the items and try again.")
            return false;
          }
        }
      }
    }
    if (txtName != "txtInvtId")
    {
      if (txtCurrent != " ")
      {
        if ((txtCurrent == "0") || (txtCurrent =="00") || (txtCurrent == "000"))
        {
          event.returnValue = false
          sPath.focus();
	  sPath.value = ""
	  return;
	}
      }
    };
  };
  document.ExpressLanePost.submit()
}
//end code for express lane
//Begin code for Add To Cart

function CopyFields()
{
  ParentWindow = window.opener;
  ParentWindow.document.ShoppingCartTotals.CartCount.value = document.ShoppingCart.CartCount.value;
  ParentWindow.document.ShoppingCartTotals.TotMerch.value = document.ShoppingCart.TotMerch.value;
  setTimeout(self.close, 1500);
}

//End code for Add To Cart
//Begin code for Item Customization

function SearchValidation(sPath)
{
  if (sPath.txtSearch.value == "") 
  {
    if (sPath.optSelection[2].checked == true)
    { 
      return true;
    } else {
      alert("The search field is empty. Please enter search criteria and resubmit.");
      return false;
    };
  };

  Tmplt = /[^A-Za-z_0-9 ]/g;
  iMatch = sPath.txtSearch.value.search(Tmplt);
  if (iMatch != -1)
  {
    alert ("You may only enter numbers or letters in the search field.");
    event.returnValue = false;
    sPath.txtSearch.focus();
    sPath.txtSearch.value = "";
    return;
  }
}

function GrantFocusCustomization()
{
  document.CustomizationSearch.txtSearch.focus();
  posBottomBar();
}


function f_customization(sPath)
{
  var sTxt = "";
  for (i = 0; i < sPath.length; i++)
  {
    var e = sPath.elements[i];
    i = i + 1
    var f = sPath.elements[i];
    i = i + 1
    var g = sPath.elements[i];
    var txtName = e.name;

    sSubsPath = txtName.substr(9);

    if (g.checked == true)
    {

      sTxt = sTxt + '<Item InvtId="' + sSubsPath;
      sTxt = sTxt + '" Type="' + e.id ;
      sTxt = sTxt + '" UpdateIn="Y' ; 
      sTxt = sTxt + '" Value=""/>';

    } else {

      if (e.type == "text") 
      {
        if ((e.value != "") && (e.value != " ")) 
        {
          sTxt = sTxt + '<Item InvtId="' + sSubsPath;
          sTxt = sTxt + '" Type="' + e.id ;
          sTxt = sTxt + '" UpdateIn="' + f.value; 
          sTxt = sTxt + '" Value="' + e.value + '"/>';
        } else if ((e.type == "text") && (e.value == "") && (f.value == "Y"))
        {
          sTxt = sTxt + '<Item InvtId="' + sSubsPath;
          sTxt = sTxt + '" Type="' + e.id ;
          sTxt = sTxt + '" UpdateIn="' + f.value; 
          sTxt = sTxt + '" Value="' + '"/>';
        };
      };

    };
  }

  var XmlTrans = document.xmlsPathing.txtItemList;
  if (sTxt != "") 
  {
    XmlTrans.value = "";
    XmlTrans.value = "<ItemList>" + sTxt; 
  } else {
    XmlTrans.value = "";
  };
  var sTxt = "";
  if (document.xmlsPathing.txtItemList.value != "")
  {
    document.xmlsPathing.txtItemList.value = document.xmlsPathing.txtItemList.value + "</ItemList>";
    return true;
  }
  else
  {
    alert("No item quantities were specified.  Please enter the quantity information for at least one item and try again.");
    return false;
  }
}

function ICValidation(sPath)
{
  var sTxt = sPath.value;
  if (sTxt != " ") 
  {
    if (sPath.id == "AutoBin")
    {
      Tmplt = /[^A-Za-z_0-9\- ]/g;
      iMatch = sTxt.search(Tmplt);
      if (iMatch != -1)
      {
        alert ("You may only enter numbers or letters in the AutoBin field.");
        event.returnValue = false;
        sPath.focus();
        sPath.value = "";
        return;
      }
    } else {
      
      sPath.value = sPath.value.replace(/\s*,\s*/, "")
      sPath.value = sPath.value.replace(/\\$/, "")
      sPath.value = ConvertToCurrency(sPath.value);
      var Tmplt = /^\s*\d+\.\d{2}\s*$/;


      if (Tmplt.test(sPath.value) == false || (sPath.value == "0") || (sPath.value =="00") || (sPath.value == "000"))
      {
        event.returnValue = false;
        sPath.focus();
        sPath.value = "";
        alert("You may only enter a dollar amount in the Retail Pricing field.");
        return;
      }
    }
  };
}
//End code for Item Customization
//Endorsed Partner

function ToggleAds(sTab)
{
  if (document.all)
  {
    if (sTab == 'ComputerRx')
    {
      document.all('adComputerRx').style.display = 'block';
      document.all('adClinicalPharmacology').style.display = 'none';
      document.all('adGunnAndRichards').style.display = 'none';
      document.all('adCompanyStore').style.display = 'none';
    }
  } else {
    if (sTab == 'ComputerRx')
    {
      document.getElementById('adComputerRx').style.display = 'block';
      document.getElementById('adClinicalPharmacology').style.display = 'none';
      document.getElementById('adGunnAndRichards').style.display = 'none';
      document.getElementById('adCompanyStore').style.display = 'none';
    }
  }

  if (document.all)
  {
    if (sTab == 'ClinicalPharmacology')
    {
      document.all('adComputerRx').style.display = 'none';
      document.all('adClinicalPharmacology').style.display = 'block';
      document.all('adGunnAndRichards').style.display = 'none';
      document.all('adCompanyStore').style.display = 'none';
    }
  } else {
    if (sTab == 'ClinicalPharmacology')
    {
      document.getElementById('adComputerRx').style.display = 'none';
      document.getElementById('adClinicalPharmacology').style.display = 'block';
      document.getElementById('adGunnAndRichards').style.display = 'none';
      document.getElementById('adCompanyStore').style.display = 'none';
    }
  }

  if (document.all)
  {
    if (sTab == 'GunnAndRichards')
    {
      document.all('adComputerRx').style.display = 'none';
      document.all('adClinicalPharmacology').style.display = 'none';
      document.all('adGunnAndRichards').style.display = 'block';
      document.all('adCompanyStore').style.display = 'none';
    }
  } else {
    if (sTab == 'GunnAndRichards')
    {
      document.getElementById('adComputerRx').style.display = 'none';
      document.getElementById('adClinicalPharmacology').style.display = 'none';
      document.getElementById('adGunnAndRichards').style.display = 'block';
      document.getElementById('adCompanyStore').style.display = 'none';
    }
  }

  if (document.all)
  {
    if (sTab == 'CompanyStore')
    {
      document.all('adComputerRx').style.display = 'none';
      document.all('adClinicalPharmacology').style.display = 'none';
      document.all('adGunnAndRichards').style.display = 'none';
      document.all('adCompanyStore').style.display = 'block';
    }
  } else {
    if (sTab == 'CompanyStore')
    {
      document.getElementById('adComputerRx').style.display = 'none';
      document.getElementById('adClinicalPharmacology').style.display = 'none';
      document.getElementById('adGunnAndRichards').style.display = 'none';
      document.getElementById('adCompanyStore').style.display = 'block';
    }
  }

  posBottomBar();
}

//End code for Endorsed Partner
//Code for Trinet Calculator
function SubmitTrinetInfo()
{
  if (document.TriNet.txtFirstNm.value == "")
  {
    alert("Please enter your First Name");
    return false;
  }
  if (document.TriNet.txtLastNm.value == "")
  {
    alert("Please enter your Last Name");
    return false;
  }
  if (document.TriNet.txtNabpNb.value == "")
  {
    alert("Please enter your Nabp Number");
    return false;
  }
  if (document.TriNet.txtAreaCd.value == "")
  {
    alert("Please enter your Phone Number");
    return false;
  }
  if (document.TriNet.txtPhone1.value == "")
  {
    alert("Please enter your Phone Number");
    return false;
  }
  if (document.TriNet.txtPhone2.value == "")
  {
    alert("Please enter your Phone Number");
    return false;
  }
}
//End code for Trinet Calculator