
function OpenWindow(strURL, strDimensions) //strWidth, strHeight
{
  objWindow = window.open(strURL, 'Window', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,' + strDimensions + 'left=10,top=10');
  //width=' + strWidth + ',height=' + strHeight + ',
}

function CharacterCount(frmForm, strValue, strMaxLength, txtCounter) //, objCountDisplay)
{
  var fldTextBoxCharacterCounter;
  fldTextBoxCharacterCounter = eval(frmForm && '.' && txtCounter);
  fldTextBoxCharacterCounter.value = strValue.length + ' of ' + strMaxLength;
}
function ShowHideHelp()
{
  var pagecontentsection = document.getElementById("ContentArea");
  var pagehelpsection = document.getElementById("ctl00_divPageHelp");
  var pagehelplink = document.getElementById("ctl00_lnkPageHelp");
  if ( pagehelpsection.style.display == "none" )
  {
    pagehelpsection.style.display = "block";
    pagehelplink.innerHTML = "Hide Help";
  }
  else
  {     
    pagehelpsection.style.display = "none";   
    pagehelplink.innerHTML = "Show Help";
  }
}
function CheckAll(pattern, bCheck)
{
   var objInputs = document.getElementsByTagName("INPUT");
   var intInputCounter;
   for(intInputCounter=0;intInputCounter<objInputs.length;intInputCounter++)
   {
      if(pattern =='' || objInputs[intInputCounter].id.indexOf(pattern) >=0)
           /*if(objInputs[intInputCounter].onclick!=ReturnFalse)*/
                objInputs[intInputCounter].checked = bCheck;
   }
   return;
}
/*
How about the following features?

http://javascript.internet.com/page-details/session-time-out.html
*/


function ShowHideDropdowns()
{
  if (document.getElementsByTagName)
  {
    var aryDropdowns = document.getElementsByTagName('select');
    if (aryDropdowns.length)
    {
      var blnHideDropdowns = (aryDropdowns[0].style.visibility == 'visible' || aryDropdowns[0].style.visibility == '');
      for(var i=0; i < aryDropdowns.length; i++)
      {
        if (blnHideDropdowns)
          aryDropdowns[i].style.visibility='hidden';
        else
          aryDropdowns[i].style.visibility='visible';
      }
    }
  }
}

function ShowHideField(fieldname)
{
  if (document.getElementById)
  {
    var field = document.getElementById(fieldname);
    if (field.style.display == 'none')
      field.style.display = 'block';
    else
      field.style.display = 'none';
  }
}

function DeSelectRadio(fieldname)
{
  /*
  if (document.getElementsByTagName)
  {
    var aryRadioButtons = document.getElementsByTagName('radio');
    if (aryRadioButtons.length)
    {
      for(var i=0; i < aryRadioButtons.length; i++)
      {
      alert(aryRadioButtons[i].name.substring(0,fieldname.length));
      
        if (aryRadioButtons[i].name.substring(0,fieldname.length) == fieldname)
          {
            if (field.checked==true)
              {
                field.checked=false;
              }
          }
      }
    }
  }
  */
  
  if (document.getElementById)
  {
    var field = document.getElementById(fieldname);
    if (field.checked==true)
      {
        field.checked=false;
      }
  }

}
