// JavaScript Document
function home()
{
    document.form3.action = "../main/index.php"
    document.form3.target = "_self";    // Open in a new window
    document.form3.submit();
    return true;
}
function account()
{
    document.form3.action = "../Profile/account.php"
    document.form3.target = "_self";    // Open in a new window
    document.form3.submit();
    return true;
}
function contacts()
{
    document.form3.action = "../Profile/accountContacts.php"
    document.form3.target = "_self";    // Open in a new window
    document.form3.submit();
    return true;
}
function histories()
{
    document.form3.action = "../Profile/accountHistories.php"
    document.form3.target = "_self";    // Open in a new window
    document.form3.submit();
    return true;
}
function accountPay()
{
    document.form3.action = "../Profile/accountAddFund.php"
    document.form3.target = "_self";    // Open in a new window
    document.form3.submit();
    return true;
}


function validate(form_id, email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.forms[form_id].elements[email].value;
   if(reg.test(address) == false) {
      alert('Invalid Email Address, please try again');
      return false;
   }
}


function OnCancel(backPage)
{
    document.form1.action = backPage
    document.form1.target = "_self";    // Open in a new window
    document.form1.submit();
    return true;
}


function isInteger(s)
{ 
    var i;
    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}
