// JavaScript Document
function initDBFillIn()
{
  document.getElementById('errorPrefixId').style.visibility = 'hidden';
  document.getElementById('errorHostId').style.visibility = 'hidden';  
  document.getElementById('errorUserNameId').style.visibility = 'hidden';  
  document.getElementById('errorDBNameId').style.visibility = 'hidden';  
}
function checkDBFillIn()
{
  var flag = true;
  initDBFillIn();
  var pattern = /_$/;
  var preFix = document.getElementById('dbPrefixId').value;
  var chkFlag = pattern.test(preFix);

  if('' == preFix || !chkFlag)
  {
    document.getElementById('errorPrefixId').style.visibility = 'visible';  
    flag = false;
  }
  if('' == document.getElementById('dbHostId').value)
  {
    document.getElementById('errorHostId').style.visibility = 'visible';  
    flag = false;
  }  
  if('' == document.getElementById('dbUserNameId').value)
  {
    document.getElementById('errorUserNameId').style.visibility = 'visible';  
    flag = false;
  }
  if('' == document.getElementById('dbNameId').value)
  {
    document.getElementById('errorDBNameId').style.visibility = 'visible';  
    flag = false;
  }
  return flag;
}


function initCheckAdmin()
{
  document.getElementById('adminNameErrorId').style.visibility = 'hidden';
  document.getElementById('adminPasswordErrorId').style.visibility = 'hidden';
  document.getElementById('adminPasswordCheckErrorId').style.visibility = 'hidden';  
}

function checkAdmin()
{
  var flag = true;
  initCheckAdmin();
  if('' == document.getElementById('adminNameId').value)
  {
    document.getElementById('adminNameErrorId').style.visibility = 'visible';  
    flag = false;
  }
  if('' == document.getElementById('adminPasswordId').value || 5 > document.getElementById('adminPasswordId').value.length)
  {
    document.getElementById('adminPasswordErrorId').style.visibility = 'visible';  
    flag = false;
  }
  if('' == document.getElementById('adminPasswordCheckId').value || document.getElementById('adminPasswordId').value != document.getElementById('adminPasswordCheckId').value)
  {
    document.getElementById('adminPasswordCheckErrorId').style.visibility = 'visible';  
    flag = false;
  }
  return flag;
}