    <table width="100%" border="0" cellpadding="1" cellspacing="0" style="border-collapse:collapse;">
    <?php
    require('cfg/res.php');
	$item_sql='select *,LEFT(item_codigo,6)as codigo from item0 where item_carr="1"  ';
    if(isset($_GET['id']) || !empty($_GET['id'])){$item_sql.='and item_descri like "%'.$_GET['id'].'%" ';}
    $item_sql.='GROUP BY codigo';
	
    $item_res=mysql_query($item_sql,$link_vcrx);
   
    if(mysql_num_rows($item_res)==0){
        $item_sql='select *,LEFT(item_codigo,6)as codigo from item0 where item_carr="1"  ';
        $item_sql.='GROUP BY codigo';
		
        $item_res=mysql_query($item_sql,$link_vcrx);
    }
	
    while($item_r=mysql_fetch_assoc($item_res)){?>
    <tr valign="top" style="">
    <td>
		<table border="0">
	    <tr valign="top">
        <td>
            <?php $img_sql='select *from imgi0 where left(imgi_item,6)="'.$item_r['codigo'].'" and imgi_status!="X" order by imgi_defa desc limit 1 ';
			$img_res=mysql_query($img_sql,$link_vcrx);
    		if(mysql_num_rows($img_res)!=0){
			if(file_exists('../gnya/imgi/'.mysql_result($img_res,0,'imgi_file'))){?> 
			<div>
            <img onclick="_imagengrande(this.src);" src="<?php echo 'http://gnya.vcrxol.com/imgi/'.mysql_result($img_res,0,'imgi_file');?>" class="cat_img"  id="img_<?php echo $item_r['codigo'];?>" />
            </div>
			<?php } 
			} ?>
               
        </td>
        <td>
            <?php 
				//$img_sql='select *from imgi0 where left(imgi_item,6)="'.$item_r['codigo'].'" and imgi_status!="X" and imgi_defa!="1"';
				$img_sql='select *from imgi0 where left(imgi_item,6)="'.$item_r['codigo'].'" and imgi_status!="X"';
			$img_res=mysql_query($img_sql,$link_vcrx);
    		if(mysql_num_rows($img_res)!=0){
			while($img_r=mysql_fetch_assoc($img_res)){	
			if(file_exists('../gnya/imgi/'.$img_r['imgi_file'])){?> 
			<div>
            <img onclick="_imagengrande(this.src);" src="<?php echo 'http://gnya.vcrxol.com/imgi/'.mysql_result($img_res,0,'imgi_file');?>" class="cat_img_t"  width="50" id="img_t_<?php echo $item_r['codigo'];?>" />
            </div>
			<?php } 
				}
			} ?>                  
        
        </td>
        </tr>
        </table>    
    </td>
	<td>
		<div align="center"><?php echo $item_r['item_descri'].' ('.$item_r['codigo'].')';?></div>

	</td>
	</tr>
    
    <tr style="border-bottom: #CCC solid 1px;" ><td colspan="2">
        <div>
        <?php $talla_res=mysql_query('select *, RIGHT(item_codigo,2)as talla from item0 where item_codigo like "'.$item_r['codigo'].'%" and LENGTH(item_codigo)=8',$link_vcrx); ?>
        <table cellpadding="8" border="0"><tr>
        <?php while($talla_r=mysql_fetch_assoc($talla_res)){?>
            <td>
            <div><?php echo substr($talla_r['item_codigov'],6,3); ?></div>
            <div><input type="radio" name="talla_<?php echo $item_r['codigo'];?>" value="<?php echo $item_r['codigo'].$talla_r['talla']; ?>" class="talla_<?php echo $item_r['codigo'];?>"  /></div>
            </td>
        <?php } ?>
        </tr></table>
        </div>

        <div id="talla_<?php echo $item_r['codigo'];?>_error" class="talla_error" ></div>
        <div style="border-bottom: #333 solid 1px; margin-bottom:10px;"><input type="button" value="Agregar Carrito" id="talla_<?php echo $item_r['codigo'];?>" onclick="_carro(this.id);"  class="agrega_btn" /></div>
        
    
    </td></tr>
    
    
	<?php } ?>
	</table>