function getUrlParam(url, par)
{
  var rgx = "[\\?&]"+par+"=([^&#]*)";
  var regex = new RegExp(rgx);
  var matches = regex.exec(url);

  return (matches == null)? "" : matches[1];
}

function check_signup()
{
  if(document.frm.email.value=="" )
  {
    alert("請輸入電子郵件信箱");
    document.frm.email.focus();
    return false;
  }
  else if(document.frm.display_name.value=="")
  {
    alert("請輸入顯示名稱");
    document.frm.display_name.focus();
    return false;
  }
  else if(document.frm.password.value=="")
  {
    alert("請輸入密碼");
    document.frm.password.focus();
    return false;
  }
  else if(document.frm.confirm_password.value=="")
  {
    alert("請再一次輸入密碼");
    document.frm.confirm_password.focus();
    return false;
  }

  return true;
}

function check_login()
{
  if (document.frm.email.value=="" || document.frm.password.value=="") {
    alert("請輸入電子郵件信箱及密碼");
    return false;
  }

  return true;
}

function submit_cmt()
{
  if (document.frm_comment.comment.value=="")
    return false;
  else
    return true;
}

