<? 
require_once "include/application.php"; 
require_once "include/function.php";
require_once "include/parameter.php";
require_once "include/newvalue_lib.php";

if($btnAdd){
	$dob=$year."-".$month."-".$day;
	$spdob=$syear."-".$smonth."-".$sday;
	if(!$active)$active="No";
	
	if(count($type)>0)$typelevel=implode(",", $type);	
		
	$sql="
	INSERT INTO `person` (
	`p_name` ,
	`p_title` ,
	`p_ic` ,
	`p_company` ,
	`p_job` ,
	`p_role` ,
	`p_race` ,
	`p_status` ,	
	`p_gender` ,
	`p_dob` ,
	`p_spouse` ,
	`p_spdob` ,
	`p_spphone` ,
	`p_type` ,
	`p_industry` ,
	`p_source` ,
	`p_classification` ,
	`p_active` ,
	`p_preference` ,
	`p_email1` ,
	`p_email2` ,
	`p_email3` ,
	`p_phone1` ,
	`p_phone1_label` ,
	`p_phone2` ,
	`p_phone2_label` ,
	`p_phone3` ,
	`p_phone3_label` ,
	`p_fax` ,
	`p_url1` ,
	`p_url2` ,
	`p_msg1` ,
	`p_msg1_label` ,
	`p_msg2` ,
	`p_msg2_label` ,
	`p_addr1` ,
	`p_addr2` ,
	`p_addr3` ,
	`p_city` ,
	`p_state` ,
	`p_zip` ,
	`p_country` ,
	`p_paddr1` ,
	`p_paddr2` ,
	`p_paddr3` ,
	`p_pcity` ,
	`p_pstate` ,
	`p_pzip` ,
	`p_pcountry`,p_user,p_stay,p_flight,p_nationality,p_joinbuyer1,p_joinbuyeric1,p_joinbuyer2,p_joinbuyeric2,p_joinbuyer3,p_joinbuyeric3
	)
	VALUES (
	\"$name\",'$title','$ic', '$sid', '$job', '$role','$race','$status', '$gender', '$dob', '$spouse', '$spdob', '$sphone', '$typelevel', '$industry', '$source', '$classification', '$active',
	'$preference', '$email1', '$email2', '$email3', '$phone1', '$phone1_label', '$phone2', '$phone2_label', '$phone3', '$phone3_label', '$fax', '$url1', '$url2', '$msg1', '$msg1_type','$msg2', '$msg2_type',
	\"$addr1\", \"$addr2\", \"$addr3\", \"$city\", \"$state\", '$zip', \"$country\", \"$paddr1\", \"$paddr2\", \"$paddr3\", \"$pcity\", \"$pstate\", '$pzip', \"$pcountry\",'".$_SESSION["egoUser"]."','$stay','$flight',
	'$nationality',\"$buyer1\",'$buyeric1',\"$buyer2\",'$buyeric2',\"$buyer3\",'$buyeric3'
	);
	";

	@mysql_query($sql) or die(mysql_error());

	$name=""; $title=""; $ic="";$job=""; $gender=""; $role=""; $day=""; $month=""; 
	$spouse=""; $year=""; $sday=""; $smonth=""; $syear="";  $sphone=""; $type=""; $industry=""; $source=""; $classification="";
	print("<script type='text/javascript'>alert('Record is added.')</script>");


}


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

?>

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="sddm.css" >
<link rel="stylesheet" type="text/css" href="include/tabcontent.css" />

<script type="text/javascript" src="include/tabcontent.js">

/***********************************************
* Tab Content script v2.2- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

<script src="include/validation.js" type="text/javascript"></script>
  <link rel="stylesheet" href="datepicker/themes/winter.css" />
<!-- Loading Calendar JavaScript files -->
    <script type="text/javascript" src="datepicker/zapatec.js"></script>
    <script type="text/javascript" src="datepicker/calendar.js"></script>
<!-- Loading language definition file -->
    <script type="text/javascript" src="datepicker/calendar-en.js"></script>

<title><? echo TITLE?></title></head>
<body>

<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f1efd8">
  <tr>
    <td  colspan="2" align="center"><? require_once "include/header.php"; ?></td>
  </tr>
  <tr>
    <td colspan="2" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td width="185" valign="top" bgcolor="e6f3f9">
	
<? require_once "include/columnLeft.php"; ?>	</td>
    <td width="834" valign="top">
	<form name="form" method="post" action="<?=$PHP_SELF ?>"  ONSUBMIT="return ValidateAddNewPerson(this)">
	  <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="2">
          <tr>
            <td height="30" colspan="2" class="TitleH3">New Person </td>
          </tr>
          <tr>
            <td height="1" colspan="2" bgcolor="#B8ED83"></td>
          </tr>
          <tr>
            <td colspan="2" ><? echo "<div class='Msg'>$action_msg</div>" ?>&nbsp;</td>
          </tr>
          <tr>
            <td width="47%" valign="top" ><table id="tbl-tabMainContact" class="editTbl" border="0" cellspacing="0" 
  cellpadding="0">
              <tbody>
                <tr>
                  <th width="120" height="23" class="TextH1"><div align="left">Name <span class="require">*</span></div></th>
                  <td width="238" class="TextH1"><input 
      name="name" id="name" value="<? echo $name ?>" maxlength="50" style="WIDTH: 180px"/>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Title <span class="require">*</span></div></th>
                  <td class="TextH1"><span class="main">
                    <select name="title" id="title" style="WIDTH: 180px" onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Title',this.value);}">
                      <option value="1"></option>
					  					   <?
			 
			 	$sql="select * from newvalue where nv_type='Title' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($title==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?>
            
					      <? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>
                            </select>
                  </span></td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">New IC/Passport <span class="require">*</span></div></th>
                  <td class="TextH1"><input 
      name="ic" id="ic" value="<? echo $ic ?>" maxlength="50" style="WIDTH: 180px"/>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Company Name</div></th>
                  <td class="TextH1"><input name="company" type="text" class="info" id="company" style="WIDTH: 180px" onfocus="if(document.images){blur()}" value="<? echo $company ?>" size="40" maxlength="50"/>
                    <input name="btnInfo2" type="button" class="btnInfo" id="btnInfo2" value="..." onclick="DialogWindow('popup/popCompanyName.php?fld=sid&amp;inpfld=name','Search','Classic')"/>
                    <span class="require">
                    <input name="sid" type="hidden" id="sid" value="<? echo $sid ?>" />
                    </span></td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Job Title</div></th>
                  <td class="TextH1"><input 
      name="job" id="job" style="WIDTH: 180px" value="<? echo $job ?>" maxlength="50" />                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Role</div></th>
                  <td class="TextH1"><select style="WIDTH: 180px"
      name="role" id="role" onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Role',this.value);}">
                      <option value="1"></option>
					   <?
			 
			 	$sql="select * from newvalue where nv_type='Role' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($role==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?>

                      <? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>
                    </select>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Gender <span class="require">*</span></div></th>
                  <td class="TextH1"><select name="gender" id="gender" style="WIDTH: 180px">
				       <option value=""></option>
                      <option value="Male">Male</option>
                      <option 
        value="Female">Female</option>
                    </select>

                    <? stayfocus("form","gender",$gender) ?></td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Date of birth</div></th>
                  <td class="TextH1"><?
echo "<select name='day'>";
echo '<option value=""></option>\n';
foreach ($days as $value) {
	echo '<option value="'.$value.'"';
	if($day==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} echo '</select> ';

echo "<select name='month'>";
echo '<option value=""></option>\n';
foreach ($months  as $key => $value) {
	echo '<option value="'.$key.'"';
	if($month==$key)echo ' selected';
	echo '>'.$value.'</option>\n';
}
echo '</select> ';

echo "<select name='year'>";
echo '<option value=""></option>\n';
foreach ($years as $value) {
	echo '<option value="'.$value.'"';
	if($year==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} 
echo '</select> ';
?>                    <span class="subItem"></span></td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Race <span class="require">*</span></div></th>
                  <td class="TextH1"><select style="WIDTH: 180px"
      name="race" id="race" onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Race',this.value);}">
                      <option value="1"></option>
                      <?
			 
			 	$sql="select * from newvalue where nv_type='Race' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($race==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?>
                      <? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>
                    </select>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Nationality</div></th>
                  <td class="TextH1"><select style="WIDTH: 180px"
      name="nationality" id="nationality" onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Race',this.value);}">
                      <option value="1"></option>
                      <?
			 
			 	$sql="select * from newvalue where nv_type='Nationality' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($nationality==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?>
                      <? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>
                    </select>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Status</div></th>
                  <td class="TextH1"><select style="WIDTH: 180px"
      name="status" id="status" onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('status',this.value);}">
                      <option value="1"></option>
                      <?
			 
			 	$sql="select * from newvalue where nv_type='Status' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($status==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?>
                      <? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>
                    </select>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Spouse</div></th>
                  <td class="TextH1"><input 
      name="spouse" id="spouse" style="WIDTH: 180px" value="<? echo $spouse ?>" maxlength="50" />                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Spouse DoB</div></th>
                  <td class="TextH1"><?
echo "<select name='sday'>";
echo '<option value=""></option>\n';
foreach ($days as $value) {
	echo '<option value="'.$value.'"';
	if($sday==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} echo '</select> ';

echo "<select name='smonth'>";
echo '<option value=""></option>\n';
foreach ($months  as $key => $value) {
	echo '<option value="'.$key.'"';
	if($smonth==$key)echo ' selected';
	echo '>'.$value.'</option>\n';
}
echo '</select> ';

echo "<select name='syear'>";
echo '<option value=""></option>\n';
foreach ($years as $value) {
	echo '<option value="'.$value.'"';
	if($syear==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} 
echo '</select> ';
?></td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Spouse phone</div></th>
                  <td class="TextH1"><input 
      name="sphone" id="sphone" style="WIDTH: 180px" value="<? echo $sphone ?>" maxlength="20" />                  </td>
                </tr>
                <tr>
                  <th height="23" valign="top" class="TextH1"><div align="left">Type  <span class="require">*</span></div></th>
                  <td class="TextH1"><select 
      name="type[]" size="6" multiple="multiple" id="type" style="WIDTH: 180px" >
                   
						 <?
						 for($i=0;$i<count($tl); $i++)
						 {
							echo "<option value='".$tl[$i]."'>".$nv[$tl[$i]]." </option>";
						 }
			
?>  

                    </select>
                    <? staymultifocus("form","type",$type) ?></td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Industry</div></th>
                  <td class="TextH1"><select 
      name="industry" id="industry" style="WIDTH: 180px" 
      onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Industry',this.value);}">
                      <option value="1"></option>
                       <?
			 
			 	$sql="select * from newvalue where nv_type='Industry' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($industry==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?>  
<? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>         </select>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Source</div></th>
                  <td class="TextH1"><select 
      name="source" id="source" style="WIDTH: 180px" 
      onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Source',this.value);}">
                      <option value="1"></option>
                      <?
			 
			 	$sql="select * from newvalue where nv_type='Source' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($source==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?>  
<? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>                    </select>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Classification</div></th>
                  <td class="TextH1"><select 
      name="classification" id="classification" style="WIDTH: 180px" 
      onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Classification',this.value);}">
                      <option value="1"></option>
                      
		<?
			 
			 	$sql="select * from newvalue where nv_type='Classification' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($classification==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?> 
<? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>                    </select>                  </td>
                </tr>
                <tr>
                  <th height="23" class="TextH1"><div align="left">Live/Active</div></th>
                  <td class="TextH1"><input class="cb" value="Yes" checked="checked" type="checkbox" name="active" />                  </td>
                </tr>
              </tbody>
            </table></td>
            <td width="53%" rowspan="2" valign="top" ><div id="pettabs" class="indentmenu">
<ul>
<li><a href="#" rel="dog1" class="selected">Address</a></li>
<li><a href="#" rel="dog2">Postal</a></li>
</ul>
<br style="clear: left" />
</div>

<div style="border:1px solid gray; width:400px; height: 330px; padding: 5px; margin-bottom:1em">

<div id="dog1" class="tabcontent">
<table id="tbl-tabAddresses" class="editTbl" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                      <tr>
                        <th height="23" class="TextH1">Preference</th>
                        <td><select style="WIDTH: 180px" name="preference" onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Preference',this.value);}">
                          <option value="1"></option>
	<?
			 
			 	$sql="select * from newvalue where nv_type='Preference' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($preference==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
			
?> 
                      <? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>						  
      
                        </select>                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Email 1</th>
                        <td><input style="WIDTH: 180px" name="email1" /></td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Email 2</th>
                        <td><input style="WIDTH: 180px" name="email2" /></td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Email 3</th>
                        <td><input style="WIDTH: 180px" name="email3" /></td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Phone 1</th>
                        <td><input style="WIDTH: 100px" maxlength="20" name="phone1" />
                            <select style="WIDTH: 100px" name="phone1_label">
                              <option value="1"></option>
	<?			 
			 	$sql="select * from newvalue where nv_type='Phone Label' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($phone1_label==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
?> 							
                            </select>              </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Phone 2</th>
                        <td><input style="WIDTH: 100px" maxlength="20" name="phone2" />
                            <select style="WIDTH: 100px" name="phone2_label">
                              <option value="1"></option><span class="subItem"> eg.60127654321 </span>   
                         <?			 
			 	$sql="select * from newvalue where nv_type='Phone Label' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($phone2_label==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
?> 
                            </select>                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Phone 3</th>
                        <td><input style="WIDTH: 100px" maxlength="20" name="phone3" />
                            <select style="WIDTH: 100px" name="phone3_label">
                              <option value="1"></option>
                             <?			 
			 	$sql="select * from newvalue where nv_type='Phone Label' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($phone3_label==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
?> 
                           
                            </select>                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Fax</th>
                        <td><input style="WIDTH: 100px" maxlength="20" name="fax" />  <span class="subItem"> eg.0379770976 </span>                         </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">URL 1</th>
                        <td><input style="WIDTH: 300px" name="url1" maxlength="50"/>                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">URL 2</th>
                        <td><input style="WIDTH: 300px" name="url2"  maxlength="50"/>                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Messenger 1</th>
                        <td><input style="WIDTH: 180px" maxlength="50" 
      name="msg1" />
                            <select style="WIDTH: 120px" 
      onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Messager Type',this.value);}" 
      name="msg1_type">
                              <option value="1"></option>
							  	<?			 
			 	$sql="select * from newvalue where nv_type='Messager Type' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($msg1_type==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
?> 	
                      <? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>                            </select>                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Messenger 2</th>
                        <td><input style="WIDTH: 180px" maxlength="50" 
      name="msg2" />
                  <select style="WIDTH: 120px" 
      onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Messager Type',this.value);}" 
      name="msg2_type">
                              <option value="1"></option>
							  	<?			 
			 	$sql="select * from newvalue where nv_type='Messager Type' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($msg2_type==$myrow["nv_id"])echo "selected";
					echo ">".$myrow["nv_name"]." </option>";
				}
?> 	
                      <? if(array_search("NewValue",$menulist)==true) echo '<option value="add">-- Add a New Value --</option>';  ?>                            </select>                        </td>
                      </tr>
                    </tbody>
              </table>
</div>

<div id="dog2" class="tabcontent">
<table id="tbl-tabPostalAddresses" class="editTbl" border="0" cellspacing="0" 
cellpadding="0">
                    <tbody>
                      <tr>
                        <th width="150" height="23" class="TextH1">Postal Address</th>
                        <td><input style="WIDTH: 180px" maxlength="50" name="addr1" />                        </td>
                      </tr>
                 

                        <th height="23" class="TextH1">Line 2</th>
                        <td><input style="WIDTH: 180px" maxlength="50" name="addr2" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Line 3</th>
                        <td><input style="WIDTH: 180px" maxlength="50" name="addr3" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">City</th>
                        <td><input style="WIDTH: 180px" maxlength="50" name="city" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">State</th>
                        <td><input style="WIDTH: 180px" maxlength="50" name="state" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Zip/Postcode</th>
                        <td><input style="WIDTH: 180px" maxlength="20" 
      name="zip" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Country</th>
                        <td>                <select name="country" id="country">
						<option value=""></option>
						                <? require "country.inc"; ?>
										</select>
										                <? stayfocus("form","country",$country) ?>
	                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Physical Address</th>
                        <td><input style="WIDTH: 180px" maxlength="50" name="paddr1" />                        </td>
                      </tr>

                      <tr>
                        <th height="23" class="TextH1">Line 2</th>
                        <td><input style="WIDTH: 180px" maxlength="50" 
      name="paddr2" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Line 3</th>
                        <td><input style="WIDTH: 180px" maxlength="50" 
      name="paddr3" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">City</th>
                        <td><input style="WIDTH: 180px" maxlength="50" name="pcity" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">State</th>
                        <td><input style="WIDTH: 180px" maxlength="50" 
      name="pstate" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Zip/Postcode</th>
                        <td><input style="WIDTH: 180px" maxlength="20" 
      name="pzip" />                        </td>
                      </tr>
                      <tr>
                        <th height="23" class="TextH1">Country</th>
                        <td>        <select name="pcountry" id="pcountry">
						<option value=""></option>
						                <? require "country.inc"; ?>
										</select>
										                <? stayfocus("form","pcountry",$pcountry) ?>
	               </td>
                      </tr>
                    </tbody>
                  </table></div>
				  
			  
</div>

<script type="text/javascript">

var mypets=new ddtabcontent("pettabs")
mypets.setpersist(true)
mypets.setselectedClassTarget("link")
mypets.init(0)

</script></td>
          </tr>
          <tr>
            <td valign="top" >&nbsp;</td>
          </tr>
          
          <tr class="small">
            <td height="1" colspan="2" bgcolor="#999999"></td>
          </tr>
          <tr class="small">
            <td height="30" colspan="2" class="TextH1"><span class="require">* Denotes a require_onced field</span></td>
          </tr>
          <tr>
            <td colspan="2" valign="top" ><span class="text12">
              <input name="btnAdd" type="submit" class="btn" id="btnAdd" value="ADD" onclick="return confirm('Are you sure ?')"/>
&nbsp;</span></td>
            </tr>
          

        </table>
		
	</td>

      </tr>
 
    </table><br />
	</form>	</td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#333333" class="Footer" align="center"><br />
    <? require_once "footer.php"; ?></td>
  </tr>
</table>
</body>
</html>
<?
if(array_search("People",$menulist)==false)
		print("<script type='text/javascript'>location.href='index.php'</script>");
?>