<?php ob_start();?>
<?php $mobile= $_SESSION['user_mobile'];?>
<?php $touchs= $_SESSION['user_touchs'];?>
<?php $pbground='#D4FEF9'; ?>
<?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($psize)){$psize='100%';} ?>
<?php if(empty($pdefa)){$pdefa='';} ?>
<?php if(empty($ponclick)){$ponclick="";} ?>
<?php if(empty($pclass)){$pclass="";}?>
<?php if(empty($plist)){$plist='';}?>
<?php if(empty($pvalue)){$pvalue=$pdefa;} ?>
<?php if(empty($phide)){$phide=0;} ?>
<?php if(empty($pphold) and $pobj==1){$pphold=$pcaption;}?>
<?php //if($plist!=''){$plong=$plong+2;} ?>
<?php $plong1=$plong; ?>

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


<?php
	if($mobile=='true')
	{
		$ponenter=$ponclick;
		$ponclick='';
	}

if($plist!=''){$plong=$plong+2;}

?>


<?php if($pobj==2){?>
<th id="th_<?php echo $pidtxt; ?>" class="<?php echo $pclass; ?>" width="<?php echo $plong ?>px" valign="top" align="center" style="<?php if($phide==1){echo 'display:none;';} ?>">
<?php } ?>
<?php if($pobj==3){?>
<td valign="top" class="<?php echo $pclass; ?>" >
<?php } ?>

<?php if($pobj==2 or $pobj==3){ ?>
<div class="<?php echo $pclass; ?>" style="<?php if($phide==1){echo 'display:none;';} ?>">
<?php if($pobj==2 or $pobj==3){?>
  
  <input type="button" 
         class="getval_btn"
         id="<?php echo $pidtxt; ?>_btn" 
         onClick="_valdefa('<?php echo $pidtxt; ?>');" 
         style="
								font-size:<?php if($pobj==2 and mb_stristr($pcaption,'%')){echo round($psize*0.8,0);}else{echo $psize;}?>px;
                <?php if(!empty($pclor)){echo 'background-color:'.$pclor.';';} ?>
				 				<?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%;';
// 												if(strlen($pcaption)<=$plong){echo 'width:100%;';}
// 												if(strlen($pcaption)>$plong){echo 'width:'.(strlen($pcaption)*$psize).'px;';}
                  } 
                ?>;
								padding:2px;
								margin:0px;
								" 
				 tabIndex="-1"
         value="<?php echo strtoupper($pcaption) ?>" 
				 ></input>
  <?php } ?>  
</div>
<?php } ?>

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

<?php if($pobj==1){ ?>	
<td valign="top" align="center" class="<?php //echo $pclass; ?>" >
<?php } ?>
  
  
<?php if($pobj!=1){ ?>	
	<div class="<?php echo $pclass; ?>" <?php if($pobj==2){echo 'align="center"';}?>>
<?php } ?>
<?php 
    $plong2=0;
    if($plist!=''){$plong2=2;}
    $plong2=2;

?>	
  <input 
				 type="<?php 
               if ($mobile=='false')
               {if($plist==''){echo 'text';}else{echo 'search';}}
               else
               {echo 'number';}
               ?>"
         autocomplete="off"
         class="getval_txt"
				 accesskey="<?php echo substr($pcaption,0,1)?>"
         id="<?php echo $pidtxt; ?>"  
         name="<?php echo $pname; ?>"  
         maxlength="<?php echo $plong;?>"
         onfocus="{this.style.background='<?php echo $pbground;?>';}"
         onblur ="<?php echo $ponblur;?>;{this.style.background='white';}" 
				 <?php if($preado==1){echo ' readonly ';}else{ ?>
         onKeyUp="_okupval(event,this.id,'<?php echo $pdefa ?>','');" 
         <?php } ?>
         size="<?php echo $plong?>"
         style="
                <?php if($phide==1){echo 'display:none;';} ?>
								<?php if(($pobj==2) and mb_stristr($pcaption,'%'))
										{echo 'width:'.(((4+$plong2)*.7)*$psize).'px;';}
										else
										{echo 'width:'.((($plong+$plong2)*.7)*$psize).'px;';}
								?>;
								font-size:<?php echo $psize+2;?>px;
								" 
				 title="<?php echo strtolower($pcaption) ?>" 
         value="<?php echo $pvalue;?>" 
				 defa="<?php echo $pdefa;?>" 
         <?php if($pphold!=""){echo 'placeholder="'.$pphold.'"';}?>
				 <?php if($plist!=''){echo 'list="'.$plist.'"';} ?>
				 ></input>
	<span id="<?php echo $pidtxt; ?>_error" class="txt_error" style="color:red;"></span>

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

<?php if($mobile=='true' and $preado==0 and $pobj!=2 and 1==""){ ?><div class="" style="height:50px;"></div><?php } ?>
<?php if($mobile=='true' and $preado==0){ ?><div class="" style="height:50px;"></div><?php } ?>
<?php if($mobile=='true' and $preado==1){ ?><div class="" style="height:25px;"></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 $plist='';?>
<?php $pvalue='';?>
<?php $psize='';?>
<?php $preado='';?>
<?php $pclor='';?>
<?php $pphold='';?>
<?php $pname='';?>

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