<?php ob_start();?>
<?php $mobile= $_SESSION['user_mobile'];?>
<?php $touchs= $_SESSION['user_touchs'];?>
<?php if(mb_stristr($pcaption,'%')){$plong=5;}?>
<?php if(empty($pobj)){$pobj=3;} ?>
<?php if($plong==''){$plong=9;} ?>
<?php if(empty($psize)){$psize=12;} ?>
<?php if(empty($pdefa)){$pdefa='';} ?>
<?php if(empty($ponclick)){$ponclick="";} ?>
<?php if(empty($pclass)){$pclass="";}?>

<?php $ponclick= str_replace('"',"'",$ponclick); ?>
<?php $ponenter= str_replace('"',"'",$ponenter); ?>
<?php $ponenter.=';'.$ponclick; ?>

<?php
	if($mobile=='true')
	{
		$ponenter=$ponclick;
		$ponclick='';
	}
?>
<script type="text/javascript">
</script>

<?php if($pobj==2){?>
<th id="th_<?php echo $pidtxt ?>" class="<?php //echo $pclass; ?>" width="<?php echo $plong ?>px" valign="top" align="center">
<?php } ?>
<?php if($pobj==3){?>
<td valign="top" class="<?php //echo $pclass; ?>" >
<?php } ?>

<?php if($pobj==2 || $pobj==3){?>
<div class="<?php echo $pclass; ?>" >
  <input type="button" 
         id="<?php echo $pidtxt ?>_btn" 
         onClick="_valdefa('<?php echo $pidtxt; ?>');" 
         style="
								font-weight:bold;
								font-family:arial;
								border-style:outset;
								border-width:3px;
								border-radius:5px;
								font-family:arial;
								font-size:<?php if($pobj==2 and mb_stristr($pcaption,'%')){echo $psize*0.8;}else{echo $psize;}?>px;
				 				<?php if($pobj==2 || $pobj==3){echo 'display:block;';}else{echo 'display:none;';}?>;
								<?php if($pobj==2)
											{
												if(mb_stristr($pcaption,'%'))
												{echo 'width:'.(4*$psize).'px;';}
												else
												{
												if(strlen($pcaption)<=$plong){echo 'width:100%;';}
												if(strlen($pcaption)>$plong){echo 'width:'.(strlen($pcaption)*$psize).'px;';}
												}
											}
								?>;
								<?php if($pobj==3){echo 'width:100%;';}?>;
								padding:2px;
								margin:0px;
								" 
				 tabIndex="-1"
         value="<?php echo strtoupper($pcaption) ?>" 
				 ></input>
 </div>
<?php } ?>

<?php if($pobj==3){?>
</td>
<td valign="top" class="<?php //echo $pclass; ?>" >
<?php } ?>

<?php if($pobj==1){ ?>	
<td valign="top" class="<?php //echo $pclass; ?>" >
<?php } ?>
  
  
<?php if($pobj!=1){ ?>	
	<div class="<?php echo $pclass; ?>" <?php if($pobj==2){echo 'align="center"';}?>>
<?php } ?>
	
  <input 
				 type="<?php if ($mobile=='false'){echo 'text';}else{echo 'text';}?>"
				 accesskey="<?php echo substr($pcaption,0,1)?>"
         id="<?php echo $pidtxt ?>"  
         name="<?php echo $pidtxt ?>"  
         maxlength="<?php echo $plong?>"
         onblur ="<?php echo $ponblur;?>;" 
         onKeyUp="_okupval(event,'<?php echo $pidtxt ?>','<?php echo $pdefa ?>','');" 
         size="<?php echo $plong?>"
         style="
								<?php if(($pobj==2) and mb_stristr($pcaption,'%'))
										{echo 'width:'.(4*$psize*.7).'px;';}
										else
										{echo 'width:'.(($plong*.7)*$psize).'px;';}
								?>;
								font-weight:bold;
								font-family:arial;
								font-size:<?php echo $psize+2;?>px;
								text-align:right;
								border:solid 1px;
								border-radius:5px;
								padding:2px;
								margin:0px;
								background-color:white;
								" 
				 title="<?php echo strtolower($pcaption) ?>" 
         value="<?php echo $pdefa;?>" 
				 defa="<?php echo $pdefa;?>" 
				 ></input>
	<span id="<?php echo $pidtxt ?>_error" class="txt_error" style="color:red;"></span>

<?php if($pobj!=1){ ?>	
</div>	
<?php } ?>

<?php if($pobj==1){ ?>	
</td>
<?php } ?>

<?php if($pobj==2){?>
</th>
<?php } ?>

<?php if($pobj==3){?>
</td>
<?php } ?>

<?php $pcaption='';?>
<?php $ptabla='';?>
<?php $pidtxt='';?>
<?php $plong='';?>
<?php $pobj='';?>
<?php $pdefa='';?>
<?php $ponblur='';?>
<?php $pclass='';?>

<?php $obstart = ob_get_clean(); ?>
<?php $obstart = alltrim($obstart); ?>
<?php echo $obstart; ?>
