<?
require_once('includes/configure.php');
require_once "../admin/include/function.php";
require_once "includes/$lang/contactus.php";
require_once "includes/formvalidator.php";


if($btnAdd){
    $validator = new FormValidator();
	$validator->addValidation("name","req",REQUIRED_NAME);	
    $validator->addValidation("contact","req",REQUIRED_CONTACT);		
    $validator->addValidation("email","req",REQUIRED_EMAIL);	
    $validator->addValidation("subject","req",REQUIRED_SUBJECT);	
    $validator->addValidation("msg","req",REQUIRED_MSG);	

	if($validator->ValidateForm())
    {
											
		mail(EMAIL,$subject,$msg,'From: '.$email);		
		
		$ainfo=urlencode(SUBMIT_SUCCESS);
		print("<script type='text/javascript'>location.href='index.php?ai=$ainfo'</script>");		
		
	}else {
	    $action_msg= "<br><B>Validation Errors:</B><br>";

        $error_hash = $validator->GetErrors();
        foreach($error_hash as $inpname => $inp_err)
        {
           $action_msg.= "$inp_err<br>";
        }        
    }


}

if(!$country)$country="MY";


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?= HTML_PARAMS ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?= CHARSET ?>" />
<title><?=TITLE?></title>
<!-- SmartMenus 6 config and script core files -->
<? if($_SESSION["egoLang"]=="ENG"){ ?>
<script type="text/javascript" src="c_config.js"></script>
<? }else if($_SESSION["egoLang"]=="CH"){ ?>
<script type="text/javascript" src="ch_config.js"></script>
<? } ?>
<script type="text/javascript" src="c_smartmenus.js"></script>

<!-- SmartMenus 6 config and script core files -->


<link rel="stylesheet" type="text/css" href="../styles.css" >
</head>

<body>
<table width="1000" height="600" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr>
    <td height="82" background="../images/iconic_01.jpg"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="91%" height="30" align="right" valign="bottom" ><? include_once "includes/topmenu.php"; ?></td>
        <td width="9%" rowspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td height="4"></td>
      </tr>
      <tr>
        <td height="14" align="right">
          <? include_once "includes/menu.php"; ?>
</td>
        <td height="29" rowspan="2"></td>
      </tr>
      <tr>
        <td height="3" align="right"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="500" valign="top" background="../images/memberlogin_bg.jpg" style="background-repeat:no-repeat">

      <table width="76%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="789" height="340" valign="bottom" class="title1"><?=CONTACT_US;?></td>
      </tr>
      
      <tr>
        <td >
		<form name="form" method="post" action="<?=$PHP_SELF ?>" >
	   <table width="820" height="250" border="0" align="center" cellpadding="0" cellspacing="0">
      
      <tr>
        
        <td valign="top"><table width="800" height="250" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
         
                <tr>
                  <td class="require"><? echo "<div class='Msg'>$action_msg</div>" ?></td>
                </tr>
              </table>
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="53%" valign="top">
                    <? include "contact_form.php"; ?></td>
                    </tr>
                </table>
              <table border="0" cellpadding="2" width="100%" cellspacing="1" class="small">
                  <tr>
                    <td width="627" class="text12">&nbsp;</td>
                  </tr>
              </table></td>
          </tr>
        </table>
<!--        <div class="scroll"> --></td>
      </tr>
    </table>
		</form>		</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><? include_once "includes/bottom.php" ?></td>
  </tr>
</table>
</body>
</html>