function PaginaProducto(){
this.restaurante=null;
this.arrayDistritosLocalesCerrados=null;
this.arrayDistritosLocalesSinStock=null;
this.flagRestauranteDistritoUsuarioActivo=false;
this.flagRestauranteVirtual=false;
this.flagLocalDisponibilidadAbierto=1;
this.producto=null;
this.productoConfigurado=null;
this.estadoActual=null;
this.idCeldaMensajesError="idCeldaMensajesError";
this.idCeldaMensajeErrorLocalesCerrados="idCeldaMensajeErrorLocalesCerrados";
this.idCeldaMensajeErrorLocalesSinStock="idCeldaMensajeErrorLocalesSinStock";
this.idDivLocalesCerrados="idDivLocalesCerrados";
this.idDivLocalesSinStock="idDivLocalesSinStock";
this.idSpanCategoriaFoodCourt="idSpanCategoriaFoodCourt";
this.idSpanCategoriaRestaurante="idSpanCategoriaRestaurante";
this.idImgLogoNormalProducto="idImgLogoNormalProducto";
this.idDivNombreProducto="idDivNombreProducto";
this.idDivDescripcionProducto="idDivDescripcionProducto";
this.idSpanPrecioProducto="idSpanPrecioProducto";
this.idSpanPrecioTotalProducto="idSpanPrecioTotalProducto";
this.idImgLogoReducidoRestaurante="idImgLogoReducidoRestaurante";
this.idSpanNombreRestaurante="idSpanNombreRestaurante";
this.idDivMensajeEscogeOpciones="idDivMensajeEscogeOpciones";
this.idSpanNombreProducto="idSpanNombreProducto";
this.idDivSeccionAtributoPrincipal="idDivSeccionAtributoPrincipal";
this.idDivSeccionAtributoSecundario="idDivSeccionAtributoSecundario";
this.idDivSeccionIngrediente="idDivSeccionIngrediente";
this.idDivSeccionIngredienteParte="idDivSeccionIngredienteParte";
this.idDivSeccionOtroAdicional="idDivSeccionOtroAdicional";
this.idDivSeccionComplementario="idDivSeccionComplementario";
this.idDivSeccionParte="idDivSeccionParte";
this.idDivParte="idDivParte";
this.idDivTab="idDivTab";
this.idDivCombo="idDivCombo";
this.idDivComboParte="idDivComboParte";
this.idDivIngredienteAdicional="idDivIngredienteAdicional";
this.idDivAtributoPrincipal="idDivAtributoPrincipal";
this.idDivAtributoSecundario="idDivAtributoSecundario";
this.idDivIngrediente="idDivIngrediente";
this.idDivIngredienteParte="idDivIngredienteParte";
this.idDivOtroAdicional="idDivOtroAdicional";
this.idDivRelacionado="idDivRelacionado";
this.idCmbCantidadProducto="idCmbCantidadProducto";
this.idSpanPrecioTotalProducto="idSpanPrecioTotalProducto";
this.idDivDescripcionProductoConfigurado="idDivDescripcionProductoConfigurado";
this.idSpanCantidadProducto="idSpanCantidadProducto";
this.idCmbCantidadProducto="idCmbCantidadProducto";
this.nameRdbAtributoPrincipal="nameRdbAtributoPrincipal";
this.nameRdbParte="nameRdbParte";
this.idDivIngredienteTab="idDivIngredienteTab";
this.nameChkOtroAdicional="nameChkOtroAdicional";
this.prefijoIdCmbAtributoSecundario="prefijoIdCmbAtributoSecundario";
this.prefijoIdTblAtributoSecundario="prefijoIdTblAtributoSecundario";
this.prefijoIdDivAtributoSecundarioError="prefijoIdDivAtributoSecundarioError";
this.prefijoIdDivIngredienteCompuestoError="prefijoIdDivIngredienteCompuestoError";
this.prefijoIdTxtComplementario="prefijoIdTxtComplementario";
this.idDivIngredienteAgregado="idDivIngredienteAgregado";
this.idSpanCmbIngredienteAdicional="idSpanCmbIngredienteAdicional";
this.idImgIngredienteSeleccionado="idImgIngredienteSeleccionado";
this.idSpanPrecioIngredienteSeleccionado="idSpanPrecioIngredienteSeleccionado";
this.idCmbIngredienteAdicional="idCmbIngredienteAdicional";
this.idDivComplementarioSeleccionado="idDivComplementarioSeleccionado";
this.idDivComplementario="idDivComplementario";
this.idDivSeccionCombo="idDivSeccionCombo";
this.idChkIngredienteOpcion="idChkIngredienteOpcion";
this.nameRdbIngredienteOpcion="nameRdbIngredienteOpcion";
this.idSpanIngredienteOpcion="idSpanIngredienteOpcion";
this.idChkIngredienteProducto="idChkIngredienteProducto";
this.idChkIngredienteProductoParte="idChkIngredienteProductoParte";
this.idDivTabCombo="idDivTabCombo";
this.idDivAtributoSecundarioTemp="idDivAtributoSecundarioTemp";
this.rutaLinea1="";
this.rutaLinea2="";
this.rutaLinea3="";
this.rutaLinea4="";
this.rutaBotonAgregar="";
this.rutaBotonRestituir="";
this.rutaBotonEliminar="";
this.rutaPunto="";
this.rutaBordeIzquierdo="";
this.rutaBordeDerecho="";
this.rutaImagenFoto="";
this.rutaParte1de2="";
this.rutaParte2de2="";
this.rutaParte1de4="";
this.rutaParte2de4="";
this.rutaParte3de4="";
this.rutaParte4de4="";
this.rutaParte1de8="";
this.rutaParte2de8="";
this.rutaParte3de8="";
this.rutaParte4de8="";
this.rutaParte5de8="";
this.rutaParte6de8="";
this.rutaParte7de8="";
this.rutaParte8de8="";
this.rutaLetra1="";
this.rutaLetra2="";
this.rutaLetra3="";
this.rutaCelda="";
this.rutaFlecha1="";
this.rutaFlecha2="";
this.idFrmEnvioDatos="idFrmProducto";
this.nameHidenEnvioProductoPedido="productoPedido";
this.rutaEnvioDatos="";
this.rutaBusquedaPorCategoriaFCV="";
this.rutaBusquedaPorCategoriaRST="";
this.rutaIrRestauranteRST="";
this.idTblLinea1="idTblLinea1";
this.idTblLinea2="idTblLinea2";
this.idTblBlanco1="idTblBlanco1";
this.idTblBlanco2="idTblBlanco2";
this.idImgBotonAgregarCarrito="idImgBotonAgregarCarrito";
this.lblTituloErrorLocalesCerradosSinStock="lblTituloErrorLocalesCerradosSinStock";
}
function clickCategoriaPNE(_1){
var _2=document.getElementById(this.idFrmEnvioDatos);
var _3="";
if(this.estadoActual.codigoRestaurante!=null&&this.estadoActual.codigoRestaurante!=undefined){
_3=this.rutaBusquedaPorCategoriaRST+"&codigoRestauranteHome="+this.restaurante.codigo;
}else{
_3=this.rutaBusquedaPorCategoriaFRST;
_3=this.rutaBusquedaPorCategoriaRST+"&codigoRestaurante="+this.restaurante.codigo;
}
_3=_3+"&codigoCiudad=1";
_3=_3+"&codigoDistritoAtencion="+this.estadoActual.codigoDistritoAtencion;
_3=_3+"&codigoCategoria="+_1;
_2.action=_3;
_2.method="POST";
_2.target="_parent";
_2.submit();
}
function getOtroAdicionalPNE(_4){
var _5=getObjetoHtmlPorId(this.nameChkOtroAdicional+"_"+_4);
if(_5==null){
return null;
}
if(!_5.checked){
return null;
}
return _5.value;
}
function clickOtroAdicionalPNE(){
var _6;
var _7;
var _8;
var _9;
_6=this.producto.arrayOtroAdicional.length;
this.productoConfigurado.arrayOtroAdicional=new Array();
for(var i=0;i<_6;i++){
_7=this.getOtroAdicional(this.producto.arrayOtroAdicional[i].componente.codigo);
if(_7!=null){
_8=this.producto.buscarOtroAdicionalPorCodigo(_7);
_9=new ComponenteCliente();
_9.componente=_8;
if(_8!=null){
this.productoConfigurado.arrayOtroAdicional.push(_9);
}
}
}
this.pintarGlosaPNE();
}
function getHtmlBordeComun(_b){
var _c;
var _d;
var _e;
var _f;
_c=new ObjetoTable();
_c.width="778";
_c.border="0";
_c.align="center";
_c.cellspacing="0";
_c.cellpadding="0";
_d=new ObjetoTr();
_e=new ObjetoTd();
_e.width="4";
_e.height="10";
_e.align="right";
_e.background=this.rutaBordeIzquierdo;
_d.arrayTd.push(_e);
_e=new ObjetoTd();
_e.width="10";
_e.height="10";
_e.estilo="fondoBlanco";
_d.arrayTd.push(_e);
_e=new ObjetoTd();
_e.width="750";
_e.estilo="fondoBlanco";
_e.text=_b;
_d.arrayTd.push(_e);
_e=new ObjetoTd();
_e.width="10";
_e.height="10";
_e.estilo="fondoBlanco";
_d.arrayTd.push(_e);
_e=new ObjetoTd();
_e.width="4";
_e.height="10";
_e.align="right";
_e.background=this.rutaBordeDerecho;
_d.arrayTd.push(_e);
_c.arrayTr.push(_d);
return _c.getHTML();
}
function pintarDatosProductoPNE(){
document.getElementById(this.idImgLogoNormalProducto).src=this.producto.rutaLogoNormal;
document.getElementById(this.idDivDescripcionProducto).innerHTML=this.producto.descripcionLarga;
document.getElementById(this.idDivNombreProducto).innerHTML=this.producto.nombre;
document.getElementById(this.idSpanNombreProducto).innerHTML=this.producto.nombre;
var _10=false;
if((!this.flagRestauranteDistritoUsuarioActivo)&&(this.flagRestauranteVirtual)){
if(this.restaurante.indicadorDisponibilidad==0){
setInvisible(this.idImgBotonAgregarCarrito);
setVisible(this.lblTituloErrorLocalesCerradosSinStock);
setInvisible(this.idDivDescripcionProductoConfigurado);
_10=true;
}else{
if(this.restaurante.indicadorProductoStockLocales==0){
setInvisible(this.idImgBotonAgregarCarrito);
setVisible(this.lblTituloErrorLocalesCerradosSinStock);
setInvisible(this.idDivDescripcionProductoConfigurado);
_10=true;
}
}
if(!_10){
if(this.arrayDistritosLocalesCerrados!=null){
var num=this.arrayDistritosLocalesCerrados.length;
var _12=this.arrayDistritosLocalesCerrados[0].distrito.nombre;
for(var i=1;i<num;i++){
_12=_12+", "+this.arrayDistritosLocalesCerrados[i].distrito.nombre;
}
_12=_12+".";
setVisible(this.idCeldaMensajesError);
setVisible(this.idDivLocalesCerrados);
document.getElementById(this.idCeldaMensajeErrorLocalesCerrados).innerHTML=_12;
}
if(this.arrayDistritosLocalesSinStock!=null){
var num=this.arrayDistritosLocalesSinStock.length;
var _14=this.arrayDistritosLocalesSinStock[0].distrito.nombre;
for(var i=1;i<num;i++){
_14=_14+", "+this.arrayDistritosLocalesSinStock[i].distrito.nombre;
}
_14=_14+".";
setVisible(this.idCeldaMensajesError);
setVisible(this.idDivLocalesSinStock);
document.getElementById(this.idCeldaMensajeErrorLocalesSinStock).innerHTML=_14;
}
}
}else{
if(!this.restaurante.buscarLocalAtiendeDistrito(codigoDistritoAtencion).esAbierto(this.flagLocalDisponibilidadAbierto)){
setInvisible(this.idImgBotonAgregarCarrito);
setVisible(this.lblTituloErrorLocalesCerradosSinStock);
setInvisible(this.idDivDescripcionProductoConfigurado);
}
if(this.producto.indicadorStock!=HABILITADO){
setInvisible(this.idImgBotonAgregarCarrito);
setVisible(this.lblTituloErrorLocalesCerradosSinStock);
setInvisible(this.idDivDescripcionProductoConfigurado);
}
if(!this.flagRestauranteVirtual&&!this.restaurante.vendeOnlineLocalAtiendeDistrito(codigoDistritoAtencion)){
setInvisible(this.idImgBotonAgregarCarrito);
setInvisible(this.idDivDescripcionProductoConfigurado);
}
}
}
function pintarGlosaPNE(){
var _15="";
_15=this.producto.nombre+" ";
if(this.productoConfigurado.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||this.productoConfigurado.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_15=_15+this.productoConfigurado.pintarGlosaPCP();
}else{
_15=_15+this.productoConfigurado.pintarGlosaPNE();
}
document.getElementById(this.idDivDescripcionProductoConfigurado).innerHTML=_15;
}
function pintarCategoriaPNE(){
var _16="";
var num=0;
var a;
var _19=null;
if(this.producto.categoriaRestaurante==null){
if(this.producto.categoriaFoodCourt!=null&&this.producto.categoriaFoodCourt!=undefined){
_19=this.buscarRamaCategoriaArbolPorCodigo(this.producto.arbolCategoriaFoodCourt,this.producto.categoriaFoodCourt.codigo);
}
}else{
_19=this.buscarRamaCategoriaArbolPorCodigo(this.producto.arbolCategoriaRestaurante,this.producto.categoriaRestaurante.codigo);
}
if(_19!=null){
num=_19.length;
for(var i=0;i<num;i++){
if(this.producto.indicadorOferta==INHABILITADO){
_16=_16+"<a href=\"javascript:gblPag.clickCategoria("+_19[num-i-1].codigo+")\" class=\"textoRojo\">"+_19[num-i-1].nombre+"</a>";
}else{
_16=_16+"<span class=\"textoRojo\">Ofertas</span>";
i=num-1;
}
if(i!=num-1){
_16=_16+"&nbsp;:&nbsp;";
}
}
}
if(this.producto.categoriaRestaurante!=null){
document.getElementById(this.idSpanCategoriaRestaurante).innerHTML=_16;
}else{
document.getElementById(this.idSpanCategoriaFoodCourt).innerHTML=_16;
}
}
function buscarRamaCategoriaArbolPorCodigoPNE(_1b,_1c){
var _1d;
var _1e=null;
var _1f=null;
if(_1b.codigo==_1c){
_1e=new Array();
return _1e;
}
if(_1b.categoriasHijas!=null){
_1d=_1b.categoriasHijas.length;
for(var i=0;i<_1d;i++){
_1f=this.buscarRamaCategoriaArbolPorCodigo(_1b.categoriasHijas[i],_1c);
if(_1f!=null){
_1e=_1f;
_1e.push(_1b.categoriasHijas[i]);
return _1e;
}
}
}
return null;
}
function pintarValorAtributoPrincipalPNE(_21,_22,_23){
var _24;
var _25;
var _26;
var _27;
var num;
var div=document.getElementById(this.idDivAtributoPrincipal+_22);
var _2a=_21.productoLocalActual.arrayValorAtributoPrincipalProductoLocal;
if(_2a==null){
setInvisible(this.idDivSeccionAtributoPrincipal+_22);
setInvisible(this.idDivAtributoPrincipal+_22);
return;
}else{
setVisible(this.idDivSeccionAtributoPrincipal+_22);
setVisible(this.idDivAtributoPrincipal+_22);
}
if(_2a[0].valorAtributoPrincipal.atributoPrincipal.codigo==ATRIBUTO_PRINCIPAL_NINGUNO){
setInvisible(this.idDivSeccionAtributoPrincipal+_22);
setInvisible(this.idDivAtributoPrincipal+_22);
}
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
setInvisible(this.idDivSeccionAtributoPrincipal+_22);
setInvisible(this.idDivAtributoPrincipal+_22);
}
num=_2a.length;
_24=new ObjetoTable();
_24.width="750";
_24.align="center";
_24.border="0";
_24.cellspacing="0";
_25=new ObjetoTr();
for(var i=0;i<num;i++){
_27=new ObjetoRadio();
_27.name=this.nameRdbAtributoPrincipal+_22;
_27.value=_2a[i].valorAtributoPrincipal.codigo;
if(_21.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO||_21.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_27.onclick="gblPag.clickAtributoPrincipal("+_22+","+_23+")";
}
if(_21.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_21.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_27.onclick="gblPag.clickAtributoPrincipalPCP("+_22+","+_23+")";
}
_26=new ObjetoTd();
_26.valign="top";
_26.height="30";
_26.estilo="fondoCremaFilaTablas2";
_26.text=_27.getHTML()+_2a[i].valorAtributoPrincipal.valor;
if(!(_21.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES&&_21.precioAutoCalculado==HABILITADO)){
if(_2a[i].precio>0){
precioConFormato=formatoNumero(_2a[i].precio,2);
_26.text="<b>"+_26.text+"</b> ("+"S/."+precioConFormato+")";
}else{
_26.text="<b>"+_26.text+"</b>";
}
}
_25.arrayTd.push(_26);
}
_24.arrayTr.push(_25);
div.innerHTML=_24.getHTML();
}
function pintarErrorAtributoSecundarioPNE(_2c,_2d){
var _2e=null;
var _2f=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_2e=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_2c,_2d);
_2f=_2e.producto;
}else{
_2e=this.productoConfigurado;
_2f=this.producto;
}
var _30=false;
var _31=_2e.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.atributoPrincipal.codigo;
var _32=_2e.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _33=_2f.buscarArrayAtributoSecundario();
var _34;
if(_33==null){
return;
}
var _35;
var _36;
var _37;
var num=_33.length;
for(var i=0;i<num;i++){
_36=_33[i].codigo;
_34=_2e.producto.buscarArrayMatrizValorAtributo(_31,_32,_36);
if(_34!=null){
if(_34.length>0){
_35=this.getValorAtributoSecundario(_36,_2c);
if(_35==null||_35==" "){
document.getElementById(this.prefijoIdTblAtributoSecundario+_2c+"_"+_36).className="atributoSecundarioError";
setVisible(this.prefijoIdDivAtributoSecundarioError+_2c+"_"+_36);
_30=true;
}else{
document.getElementById(this.prefijoIdTblAtributoSecundario+_2c+"_"+_36).className="";
setInvisible(this.prefijoIdDivAtributoSecundarioError+_2c+"_"+_36);
}
}
}
}
return _30;
}
function pintarErrorIngredienteCompuestoPCP(){
var _3a=this.productoConfigurado;
var _3b=this.producto;
var _3c=false;
var _3d=this.productoConfigurado.arrayIngredienteCompuesto;
if(_3d!=null){
num=_3d.length;
for(var i=0;i<num;i++){
if(_3d[i].codigoTipoProducto==undefined){
setVisible(this.prefijoIdDivIngredienteCompuestoError);
return true;
}
}
}else{
setVisible(this.prefijoIdDivIngredienteCompuestoError);
return true;
}
return _3c;
}
function pintarComboAtributoSecundarioPNE(id,_40,_41,_42,_43,_44){
var _45;
var _46;
_45=new ObjetoSelect();
_45.id=id;
_45.onchange="gblPag.clickAtributoSecundario("+_43+","+_44+");";
_46=new ObjetoOption();
_46.value=" ";
_46.text="---"+_41+"---";
_45.arrayOption.push(_46);
for(var j=0;j<_42.length;j++){
_46=new ObjetoOption();
_46.value=_42[j].valorAtributoSecundario.codigo;
var _48;
if(_42[j].precio>0){
_48=formatoNumero(_42[j].precio,2);
_46.text=_42[j].valorAtributoSecundario.valor+" ("+"S/."+_48+")";
}else{
_46.text=_42[j].valorAtributoSecundario.valor;
}
_45.arrayOption.push(_46);
}
var _49=new ObjetoTable();
var tr=new ObjetoTr();
var td=new ObjetoTd();
_49.align="center";
_49.border="0";
_49.id=_40;
_49.cellspacing="0";
td.text=_45.getHTML();
tr.arrayTd.push(td);
_49.arrayTr.push(tr);
return _49.getHTML();
}
function pintarValorAtributoSecundarioPNE(_4c,_4d,_4e){
var num;
var _50=_4c.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
var _51=_4c.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _52;
var _53;
var _54;
var _55;
var _56;
var _57;
var _58;
var _59;
var _5a;
var _5b;
var _5c;
var _5d=false;
_55=new ObjetoTable();
_55.width="750";
_55.align="center";
_55.border="0";
_55.cellspacing="0";
_55.estilo="fondoCremaFilaTablas2";
_56=new ObjetoTr();
_58=new ObjetoTr();
_59=new ObjetoTd();
_59.colspan=0;
_59.estilo="textoMensajeError";
_53=_4c.producto.buscarArrayAtributoSecundario();
if(_53!=null){
num=_53.length;
for(var i=0;i<num;i++){
_52=_53[i].codigo;
_54=_4c.producto.buscarArrayMatrizValorAtributo(_50,_51,_52);
if(_54!=null){
_5a=this.prefijoIdCmbAtributoSecundario+_4d+"_"+_53[i].codigo;
_5b=this.prefijoIdTblAtributoSecundario+_4d+"_"+_53[i].codigo;
_5c=this.prefijoIdDivAtributoSecundarioError+_4d+"_"+_53[i].codigo;
_57=new ObjetoTd();
_57.valign="top";
_57.height="35";
_57.text=this.pintarComboAtributoSecundario(_5a,_5b,_53[i].nombre,_54,_4d,_4e);
_56.arrayTd.push(_57);
_5d=true;
_59.colspan=_59.colspan+1;
_59.text="<div id="+_5c+" style=\"display:none\">[ * Error: Debe seleccionar la opcion: "+_53[i].nombre+" ]</div>"+_59.text;
}
}
}
if(!_5d){
setInvisible(this.idDivSeccionAtributoSecundario+_4d);
setInvisible(this.idDivAtributoSecundario+_4d);
return;
}else{
setVisible(this.idDivSeccionAtributoSecundario+_4d);
setVisible(this.idDivAtributoSecundario+_4d);
}
_58.arrayTd.push(_59);
_55.arrayTr.push(_56);
_55.arrayTr.push(_58);
document.getElementById(this.idDivAtributoSecundario+_4d).innerHTML=_55.getHTML();
}
function pintarSeccionPNormal(_5f,_60){
var _61=null;
var _62=null;
_61=this.productoConfigurado;
_62=this.producto;
var _63="";
_63=this.getHtmlSeccionTitulo1("Selecciona el Tama\xf1o del producto :")+"<div id=\""+this.idDivAtributoPrincipal+_5f+"\"></div>";
document.getElementById(this.idDivSeccionAtributoPrincipal+_5f).innerHTML=this.getHtmlBorde(_63);
_63=this.getHtmlSeccionTitulo1("Selecciona las siguientes opciones :")+"<div id=\""+this.idDivAtributoSecundario+_5f+"\"></div>";
document.getElementById(this.idDivSeccionAtributoSecundario+_5f).innerHTML=this.getHtmlBorde(_63);
if(this.producto.arrayIngrediente!=null||this.producto.arrayIngredienteAdicional!=null){
if(_62.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
_63=this.getHtmlSeccionTitulo2("Si deseas, agr\xe9gale o qu\xedtale Ingredientes a tu pedido : ","chk_"+this.idDivSeccionIngrediente+_5f,"gblPag.clickCheckSeccionIngrediente("+_5f+","+_60+")");
_63=_63+"<div id=\""+this.idDivIngrediente+_5f+"\" style=\"display:none\" ></div>";
document.getElementById(this.idDivSeccionIngrediente+_5f).innerHTML=this.getHtmlBorde(_63);
}
if(_62.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_63=this.getHtmlSeccionTitulo2PDin("Agr\xe9gale o qu\xedtale Ingredientes a tu pedido : ","chk_"+this.idDivSeccionIngrediente+_5f,"gblPag.clickCheckSeccionIngrediente("+_5f+","+_60+")");
_63=_63+"<div id=\""+this.idDivIngrediente+_5f+"\" style=\"display:block\" ></div>";
document.getElementById(this.idDivSeccionIngrediente+_5f).innerHTML=this.getHtmlBorde(_63);
}
_63=this.getHtmlSeccionTitulo2("Si deseas, selecciona Ingredientes adicionales por mitades : ","chk_"+this.idDivSeccionIngredienteParte+_5f,"gblPag.clickCheckSeccionIngredienteParte("+_5f+","+_60+")");
_63=_63+"<div id=\""+this.idDivIngredienteParte+_5f+"\" style=\"display:none\" ></div>";
document.getElementById(this.idDivSeccionIngredienteParte+_5f).innerHTML=this.getHtmlBorde(_63);
_63=this.getHtmlSeccionIngrediente(0,_5f,_60);
document.getElementById(this.idDivIngrediente+_5f).innerHTML=_63;
}
_63=this.getHtmlSeccionTitulo1("Incluye las salsas y condimentos que desees : ","chk_"+this.idDivOtroAdicional,this.idDivOtroAdicional,this.idDivOtroAdicional);
_63=_63+"<div id=\""+this.idDivOtroAdicional+"\"></div>";
document.getElementById(this.idDivSeccionOtroAdicional).innerHTML=this.getHtmlBorde(_63);
_63=this.getHtmlSeccionTitulo2("\xbfDeseas ver los Complementos que tenemos para tu producto?: ","chk_"+this.idDivSeccionComplementario,"gblPag.clickCheckSeccionComplementario()");
_63=_63+"<div id=\""+this.idDivComplementario+"\"></div>"+"<div id=\""+this.idDivComplementarioSeleccionado+"\" style=\"display:none\"></div>";
document.getElementById(this.idDivSeccionComplementario).innerHTML=this.getHtmlBorde(_63);
}
function getHtmlSeccionTitulo1PNE(_64){
var _65;
var tr1;
var td1;
_65=new ObjetoTable();
_65.width="750";
_65.border="0";
_65.cellspacing="0";
_65.cellpadding="0";
tr1=new ObjetoTr();
td1=new ObjetoTd();
td1.estilo="fondoTituloTablasInternas";
td1.height="20";
td1.text="&nbsp;"+_64;
tr1.arrayTd.push(td1);
_65.arrayTr.push(tr1);
return _65.getHTML();
}
function getHtmlSeccionTitulo2PNE(_68,_69,_6a){
var _6b;
var tr1;
var td1;
var _6e;
var a;
_6b=new ObjetoTable();
_6b.width="750";
_6b.border="0";
_6b.cellspacing="0";
_6b.cellpadding="0";
tr1=new ObjetoTr();
td1=new ObjetoTd();
td1.estilo="fondoTituloTablasInternas";
td1.height="20";
_6e=new ObjetoCheckBox();
_6e.id=_69;
_6e.onclick=_6a;
a=new ObjetoA();
a.href="javascript:"+_6a;
a.estilo="textoGrisPequeno";
a.text="&lt;Haz click aqui&gt;";
td1.text=_6e.getHTML()+"&nbsp;"+_68+"&nbsp;"+a.getHTML();
tr1.arrayTd.push(td1);
_6b.arrayTr.push(tr1);
return _6b.getHTML();
}
function getHtmlSeccionTitulo2PND(_70,_71,_72){
var _73;
var tr1;
var td1;
var _76;
var a;
_73=new ObjetoTable();
_73.width="750";
_73.border="0";
_73.cellspacing="0";
_73.cellpadding="0";
tr1=new ObjetoTr();
td1=new ObjetoTd();
td1.estilo="fondoTituloTablasInternas";
td1.height="20";
td1.text="&nbsp;"+_70;
tr1.arrayTd.push(td1);
_73.arrayTr.push(tr1);
return _73.getHTML();
}
function getHtmlSeccionTitulo3PNE(_78,_79,_7a){
var _7b;
var tr1;
var td1;
var _7e;
_7b=new ObjetoTable();
_7b.width="778";
_7b.border="0";
_7b.align="center";
_7b.cellspacing="0";
_7b.cellpadding="0";
tr1=new ObjetoTr();
td1=new ObjetoTd();
td1.width="4";
td1.height="10";
td1.align="right";
td1.background=this.rutaBordeIzquierdo;
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="10";
td1.height="10";
td1.estilo="fondoBlanco";
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="750";
td1.estilo="fondoBlanco";
td1.text=_78+"<div id=\""+_79+"\" style=\"display:none\"></div>";
if(_7a!=null){
td1.text=td1.text+"<div id=\""+_7a+"\"></div>";
}
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="10";
td1.height="10";
td1.estilo="fondoBlanco";
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="4";
td1.height="10";
td1.align="right";
td1.background=this.rutaBordeDerecho;
tr1.arrayTd.push(td1);
_7b.arrayTr.push(tr1);
return _7b.getHTML();
}
function clickCheckSeccionIngredientePNE(_7f,_80){
var chk=getFormElementById("chk_"+this.idDivSeccionIngrediente+_7f);
var _82=null;
var _83=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_82=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_7f,_80);
_83=_82.producto;
}else{
_82=this.productoConfigurado;
_83=this.producto;
}
if(esVisible(this.idDivIngrediente+_7f)){
chk.checked=false;
_82.indicadorIngredienteParte=INHABILITADO;
_82.indicadorIngrediente=INHABILITADO;
setInvisible(this.idDivIngrediente+_7f);
setInvisible(this.idDivSeccionIngredienteParte+_7f);
}else{
chk.checked=true;
_82.indicadorIngrediente=HABILITADO;
setVisible(this.idDivIngrediente+_7f);
if(document.getElementById(this.idDivIngredienteParte+_7f).innerHTML!=""){
setVisible(this.idDivSeccionIngredienteParte+_7f);
}
}
this.pintarPrecio();
}
function clickCheckSeccionIngredientePartePNE(_84,_85){
var chk=getFormElementById("chk_"+this.idDivSeccionIngredienteParte+_84);
var _87=null;
var _88=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_87=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_84,_85);
_88=_87.producto;
}else{
_87=this.productoConfigurado;
_88=this.producto;
}
if(esVisible(this.idDivIngredienteParte+_84)){
chk.checked=false;
_87.indicadorIngredienteParte=INHABILITADO;
setInvisible(this.idDivIngredienteParte+_84);
}else{
chk.checked=true;
_87.indicadorIngredienteParte=HABILITADO;
setVisible(this.idDivIngredienteParte+_84);
}
this.pintarPrecio();
}
function clickCheckSeccionComplementarioPNE(){
var chk=getFormElementById("chk_"+this.idDivSeccionComplementario);
if(esVisible(this.idDivComplementario)){
chk.checked=false;
setInvisible(this.idDivComplementario);
setInvisible(this.idDivComplementarioSeleccionado);
}else{
chk.checked=true;
setVisible(this.idDivComplementario);
setVisible(this.idDivComplementarioSeleccionado);
}
}
function clickCheckSeccionTituloPNE(_8a,_8b,_8c){
var chk=document.getElementById(_8a);
if(esVisible(_8b)){
chk.checked=false;
setInvisible(_8b);
setInvisible(_8c);
}else{
chk.checked=true;
setVisible(_8b);
if(document.getElementById(_8c).innerHTML!=""){
setVisible(_8c);
}
}
}
function clickAtributoPrincipalPNE(_8e,_8f){
var _90=this.getCodigoValorAtributoPrincipal(_8e);
var _91=null;
var _92=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_91=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_8e,_8f);
_92=_91.producto;
}else{
_91=this.productoConfigurado;
_92=this.producto;
}
_91.valorAtributoPrincipalProductoLocal=_92.productoLocalActual.buscarValorAtributoPrincipalProductoLocalPorCodigoValor(_90);
_91.valorAtributoPrincipalProducto=_92.buscarValorAtributoPrincipalProductoPorCodigoValor(_90);
this.pintarValorAtributoSecundario(_91,_8e,_8f);
_91.migrarAtributoSecundario(_92);
this.cargarValorAtributoSecundario(_91,_8e);
if(_92.arrayIngrediente!=null||_92.arrayIngredienteAdicional!=null){
var _93=0;
if(_92.arrayIngredienteAdicional!=null){
this.pintarAdicionalSeleccionado(_93,_8e,_8f);
this.pintarImgAdicionalSeleccionado(_93,_8e,_8f);
this.pintarIngredienteParte(_8e,_8f);
}
_91.sustituir(_90);
this.pintarAgregado(_90,_93,_8e,_8f);
}
this.pintarPrecio();
}
function getCodigoValorAtributoPrincipalPNE(_94){
var _95=null;
var _96;
var num;
_96=getObjetoHtmlPorName(this.nameRdbAtributoPrincipal+_94);
if(_96==null){
return null;
}
num=_96.length;
for(var i=0;i<num;i++){
if(_96[i].checked){
_95=_96[i].value;
break;
}
}
return _95;
}
function clickAtributoSecundarioPNE(_99,_9a){
var _9b=null;
var _9c=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_9b=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_99,_9a);
_9c=_9b.producto;
}else{
_9b=this.productoConfigurado;
_9c=this.producto;
}
var _9d=_9b.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.atributoPrincipal.codigo;
var _9e=_9b.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _9f=_9c.buscarArrayAtributoSecundario();
var _a0;
var _a1;
var _a2;
var num=_9f.length;
_9b.arrayMatrizValorAtributoProducto=new Array();
for(var i=0;i<num;i++){
_a1=_9f[i].codigo;
_a0=this.getValorAtributoSecundario(_a1,_99);
_a2=null;
if(_a0!=null&&_a0!=" "){
document.getElementById(this.prefijoIdTblAtributoSecundario+_99+"_"+_a1).className="";
setInvisible(this.prefijoIdDivAtributoSecundarioError+_99+"_"+_a1);
_a2=_9c.buscarMatrizValorAtributoProducto(_9d,_9e,_a1,_a0);
}
if(_a2!=null){
_9b.arrayMatrizValorAtributoProducto.push(_a2);
}
}
this.pintarPrecio();
}
function getValorAtributoSecundarioPNE(_a5,_a6){
var cmb=getObjetoHtmlPorId(this.prefijoIdCmbAtributoSecundario+_a6+"_"+_a5);
if(cmb==null){
return null;
}
return cmb.value;
}
function cargarValorAtributoSecundarioPNE(_a8,_a9){
var _aa=_a8.arrayMatrizValorAtributoProducto;
var _ab;
var _ac;
var _ad;
if(_aa==null){
return;
}
var num=_aa.length;
for(var i=0;i<num;i++){
_ac=_aa[i].matrizValorAtributo.valorAtributoSecundario.atributoSecundario.codigo;
_ab=_aa[i].matrizValorAtributo.valorAtributoSecundario.codigo;
_ad=this.prefijoIdCmbAtributoSecundario+_a9+"_"+_ac;
seleccionaComboPorIdPorValor(_ad,_ab);
}
}
function getHtmlSeccionIngredientePNE(_b0,_b1,_b2){
var _b3;
var _b4;
var tr1;
var tr2;
var td2;
var td1;
var _b9;
var _ba;
var _bb=null;
var _bc=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_bb=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_b1,_b2);
_bc=_bb.producto;
}else{
_bb=this.productoConfigurado;
_bc=this.producto;
}
_b3=new ObjetoTable();
_b3.width="750";
_b3.border="0";
_b3.align="center";
_b3.cellspacing="0";
_b3.cellpadding="0";
_b3.estilo="fondoCremaFilaTablas2";
tr1=new ObjetoTr();
td1=new ObjetoTd();
td1.width="196";
td1.height="25";
td1.estilo="subtitulosProdDetalleInterior";
td1.text="&nbsp;&nbsp;&nbsp;Ingredientes Disponibles :";
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="10";
td1.height="25";
td1.background=this.rutaLinea1;
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="544";
td1.height="25";
td1.estilo="subtitulosProdDetalleInterior";
td1.text="&nbsp;&nbsp;Ingredientes Escogidos :";
tr1.arrayTd.push(td1);
_b3.arrayTr.push(tr1);
tr1=new ObjetoTr();
td1=new ObjetoTd();
td1.valign="top";
_b4=new ObjetoTable();
_b4.width="176";
_b4.border="0";
_b4.align="center";
_b4.cellspacing="0";
_b4.cellpadding="0";
tr2=new ObjetoTr();
td2=new ObjetoTd();
td2.width="105";
tr2.arrayTd.push(td2);
td2=new ObjetoTd();
td2.width="47";
tr2.arrayTd.push(td2);
td2=new ObjetoTd();
td2.width="24";
tr2.arrayTd.push(td2);
_b4.arrayTr.push(tr2);
tr2=new ObjetoTr();
td2=new ObjetoTd();
td2.colspan="2";
td2.height="25";
td2.valign="middle";
td2.text="&nbsp;&nbsp;<span id=\""+this.idSpanCmbIngredienteAdicional+_b1+"_"+_b0+"\"></span>";
tr2.arrayTd.push(td2);
td2=new ObjetoTd();
td2.width="24";
td2.height="25";
td2.valign="middle";
tr2.arrayTd.push(td2);
_b4.arrayTr.push(tr2);
tr2=new ObjetoTr();
td2=new ObjetoTd();
td2.valign="middle";
td2.text="<span>&nbsp;&nbsp;&nbsp;Precio: S/.&nbsp;</span><span id=\""+this.idSpanPrecioIngredienteSeleccionado+_b1+"_"+_b0+"\"></span>";
tr2.arrayTd.push(td2);
td2=new ObjetoTd();
td2.valign="middle";
td2.align="right";
td2.colspan="2";
_b9=new ObjetoImg();
_b9.src=this.rutaBotonAgregar;
_b9.width="71";
_b9.height="16";
_b9.border="0";
if(_b0==0){
_ba="gblPag.agregarIngredienteAdicional("+_b0+","+_b1+","+_b2+")";
}else{
if(_bc.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_bc.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_ba="gblPag.agregarIngredienteAdicional("+_b0+","+_b1+","+_b2+")";
}else{
_ba="gblPag.agregarIngredienteAdicionalParte("+_b0+","+_b1+","+_b2+")";
}
}
td2.onclick=_ba;
td2.text="<a href=\"javascript:\""+_ba+">"+_b9.getHTML()+"</a>";
tr2.arrayTd.push(td2);
_b4.arrayTr.push(tr2);
tr2=new ObjetoTr();
td2=new ObjetoTd();
td2.text="<br>";
tr2.arrayTd.push(td2);
_b4.arrayTr.push(tr2);
td1.text="<div id='"+this.idDivIngredienteAdicional+_b1+"_"+_b0+"'>"+_b4.getHTML()+"</div>";
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="10";
td1.background=this.rutaLinea1;
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.valign="top";
td1.width="544";
td1.text="<div id='"+this.idDivIngredienteAgregado+_b1+"_"+_b0+"'></div>";
tr1.arrayTd.push(td1);
_b3.arrayTr.push(tr1);
return _b3.getHTML();
}
function pintarIngredienteAdicionalPNE(_bd,_be,_bf,_c0){
var _c1=document.getElementById(this.idSpanCmbIngredienteAdicional+_bf+"_"+_be);
var _c2=new ObjetoSelect();
var _c3;
var num;
if(_bd==null){
if(getObjetoHtmlPorId(this.idDivIngredienteAdicional+_bf+"_"+_be)!=null){
setInvisible(this.idDivIngredienteAdicional+_bf+"_"+_be);
}
return;
}
num=_bd.length;
_c2.id=this.idCmbIngredienteAdicional+_bf+"_"+_be;
_c2.onchange="gblPag.pintarAdicionalSeleccionado("+_be+","+_bf+","+_c0+");gblPag.pintarImgAdicionalSeleccionado("+_be+","+_bf+","+_c0+")";
for(var i=0;i<num;i++){
_c3=new ObjetoOption();
_c3.text=_bd[i].componente.nombre;
_c3.value=_bd[i].componente.codigo;
_c2.arrayOption.push(_c3);
}
_c1.innerHTML=_c2.getHTML();
}
function getCodigoAdicionalPNE(_c6,_c7){
var cmb=getObjetoHtmlPorId(this.idCmbIngredienteAdicional+_c7+"_"+_c6);
if(cmb==null){
return null;
}
return cmb.value;
}
function pintarAdicionalSeleccionadoPNE(_c9,_ca,_cb){
var _cc=null;
var _cd=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_cc=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_ca,_cb);
_cd=_cc.producto;
}else{
_cc=this.productoConfigurado;
_cd=this.producto;
}
var _ce=document.getElementById(this.idSpanPrecioIngredienteSeleccionado+_ca+"_"+_c9);
var _cf=this.getCodigoAdicional(_c9,_ca);
var _d0;
if(_cd.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO||_cd.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_d0=_cd.buscarDisponiblePorCodigo(_cf);
}
if(_cd.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_cd.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_d0=_cc.arrayIngredienteCompuesto[_c9-1].producto.buscarDisponiblePorCodigo(_cf);
}
var _d1=_cc.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _d2=_cc.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.atributoPrincipal.codigo;
var _d3;
var _d4;
if(_c9==0){
_d4=1;
_d3=_d0.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_d2,_d1,_d4);
}else{
if(_cd.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_d4=_cc.cantidadIngredienteOriginal;
}else{
if(_cd.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_d4=_cc.cantidadMaximaIngrediente;
}else{
_d4=_cc.valorAtributoPrincipalProducto.parte;
}
}
if(_cd.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_d3=_d0.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_d2,_d1,1);
}else{
_d3=_d0.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_d2,_d1,_d4);
}
}
_ce.innerHTML=_d3;
}
function pintarImgAdicionalSeleccionadoPNE(_d5,_d6,_d7){
var _d8=null;
var _d9=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_d8=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_d6,_d7);
_d9=_d8.producto;
}else{
_d8=this.productoConfigurado;
_d9=this.producto;
}
var _da=this.getCodigoAdicional(_d5,_d6);
var _db;
if(_d9.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO||_d9.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_db=_d9.buscarDisponiblePorCodigo(_da);
}
if(_d9.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_d9.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_db=_d8.arrayIngredienteCompuesto[_d5-1].producto.buscarDisponiblePorCodigo(_da);
}
}
function agregarIngredienteAdicionalPNE(_dc,_dd,_de){
var _df=null;
var _e0=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_df=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_dd,_de);
_e0=_df.producto;
}else{
_df=this.productoConfigurado;
_e0=this.producto;
}
var _e1=this.getCodigoAdicional(_dc,_dd);
var _e2;
var _e3=null;
if(_e0.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO||_e0.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_e2=_df.puedeAgregarIngrediente(_e1,_dc,_e0.cantidadMaximaMismoIngrediente,_e0.cantidadMaximaIngrediente);
}else{
var _e4=_df.arrayIngredienteCompuesto[_dc-1].producto.cantidadMaximaMismoIngrediente;
var _e5=_df.arrayIngredienteCompuesto[_dc-1].producto.cantidadMaximaIngrediente;
_e2=_df.arrayIngredienteCompuesto[_dc-1].puedeAgregarIngrediente(_e1,_dc,_e4,_e5);
}
if(_e2==1){
alert("No se puede agregar mas veces este ingrediente");
return;
}
if(_e2==2){
alert("No se puede agregar mas ingredientes");
return;
}
var _e6=_df.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
if(_e0.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
_e3=_e0.buscarDisponiblePorCodigo(_e1);
_df.agregarIngredienteAdicional(_e3);
_df.sustituir(_e6);
}
if(_e0.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_e3=_e0.buscarDisponiblePorCodigo(_e1);
_df.agregarIngredienteAdicional(_e3);
_df.ordenarArrayIngredienteAdicionalPorPrecio(_e6);
}
if(_e0.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_e0.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_e3=_df.arrayIngredienteCompuesto[_dc-1].producto.buscarDisponiblePorCodigo(_e1);
_df.arrayIngredienteCompuesto[_dc-1].agregarIngredienteAdicional(_e3);
}
this.pintarAgregado(_e6,_dc,_dd,_de);
this.pintarPrecio();
}
function pintarAgregadoPNE(_e7,_e8,_e9,_ea){
var _eb=null;
var _ec=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_eb=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_e9,_ea);
_ec=_eb.producto;
}else{
_eb=this.productoConfigurado;
_ec=this.producto;
}
var _ed=document.getElementById(this.idDivIngredienteAgregado+_e9+"_"+_e8);
var _ee=new ObjetoTable();
var _ef;
var _f0;
var _f1;
var _f2;
var _f3;
var _f4;
var _f5;
var _f6=null;
var _f7=null;
var _f8;
var _f9;
var _fa=null;
var _fb=false;
if(_ec.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO||_ec.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_fa=_eb;
_fb=_eb.esCantidadMinimaIngredienteOriginal(_ec.cantidadMinimaIngrediente);
}
if(_ec.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_ec.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_fa=_eb.arrayIngredienteCompuesto[_e8-1];
_fb=_eb.arrayIngredienteCompuesto[_e8-1].esCantidadMinimaIngredienteOriginal(_eb.arrayIngredienteCompuesto[_e8-1].producto.cantidadMinimaIngrediente);
}
_ee.border="0";
_ee.cellspacing="0";
_ee.cellpadding="0";
_f1=new ObjetoTd();
_f1.width="10";
_f1.text="&nbsp;";
_f2=_f1.getHTML();
_f1=new ObjetoTd();
_f1.width="10";
_f1.text="&nbsp;";
_f5=_f1.getHTML();
_f1=new ObjetoTd();
_f1.width="6";
_f1.align="center";
_f1.valign="top";
_f4=_f1.getHTML();
_f1.background=this.rutaLinea2;
_f3=_f1.getHTML();
if(_e8==0){
_f6=_fa.arrayIngrediente;
_f7=_fa.arrayIngredienteAdicional;
}else{
if(_ec.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_ec.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_f6=_fa.arrayIngrediente;
_f7=_fa.arrayIngredienteAdicional;
}else{
if(_fa.arrayIngredienteAdicionalParte!=null){
if(_fa.arrayIngredienteAdicionalParte[_e8-1]!=undefined){
_f7=_fa.arrayIngredienteAdicionalParte[_e8-1];
}
}
}
}
if(_f6==null){
_f8=0;
}else{
_f8=_f6.length;
}
if(_f7==null){
_f9=0;
}else{
_f9=_f7.length;
}
if(_f9+_f8==0){
_ed.innerHTML="";
return;
}
if(_f9+_f8==1){
_ef=new ObjetoTr();
_ef.arrayTdHtml.push(_f2+this.getTituloElementoAgregadoHTML()+_f5);
_ee.arrayTr.push(_ef);
}else{
_ef=new ObjetoTr();
_ef.arrayTdHtml.push(_f2+this.getTituloElementoAgregadoHTML()+_f3+_f5+this.getTituloElementoAgregadoHTML());
_ee.arrayTr.push(_ef);
}
var _fc=new Array();
for(var i=0;i<_f8;i++){
_fc.push(_f6[i]);
}
for(var i=0;i<_f9;i++){
_fc.push(_f7[i]);
}
for(var i=0;i<_f8+_f9;i++){
if(i%2==0){
_ef=new ObjetoTr();
var _fe;
var num=_f8+_f9;
if((num==1)&&(i==0)){
_fe=_f4;
}else{
_fe=_f3;
}
_ef.arrayTdHtml.push(_f2+this.getElementoAgregadoHTML(_fc[i],_e7,_e8,_fb,_e9,_ea)+_fe+_f5);
}else{
_ef.arrayTdHtml.push(this.getElementoAgregadoHTML(_fc[i],_e7,_e8,_fb,_e9,_ea));
}
if(i%2!=0||i==_f8+_f9-1){
_ee.arrayTr.push(_ef);
}
}
_ef=new ObjetoTr();
_f1=new ObjetoTd();
_f1.height="5";
_f1.getHTML();
_ef.arrayTdHtml.push(_f1.getHTML());
_ee.arrayTr.push(_ef);
_ed.innerHTML=_ee.getHTML();
}
function getTituloElementoAgregadoHTMLPNE(){
var _100;
var _101;
var _102="";
var _103="";
var _104="";
var _105="";
var _106="";
var _107="";
var _108="";
_100=new ObjetoTd();
_100.width="5";
_100.text="&nbsp;";
_102=_100.getHTML();
_100=new ObjetoTd();
_100.width="6";
_100.align="center";
_100.valign="top";
_103=_100.getHTML();
_100=new ObjetoTd();
_100.width="1";
_104=_100.getHTML();
_100=new ObjetoTd();
_100.width="53";
_100.text="&nbsp;";
_105=_100.getHTML();
_100=new ObjetoTd();
_100.width="104";
_100.text="&nbsp;";
_106=_100.getHTML();
_100=new ObjetoTd();
_100.width="27";
_100.align="center";
_100.text="<u>Cant.</u>";
_107=_100.getHTML();
_100=new ObjetoTd();
_100.width="40";
_100.align="center";
_100.text="<u>Precio</u>";
_108=_100.getHTML();
return _102+_104+_106+_103+_107+_103+_108+_103+_105;
}
function getElementoAgregadoHTMLPNE(_109,_10a,_10b,_10c,_10d,_10e){
var _10f;
var _110;
var _111="";
var _112="";
var _113="";
var _114="";
var _115="";
var _116="";
var _117="";
var _118;
var _119=null;
var _11a=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_119=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_10d,_10e);
_11a=_119.producto;
}else{
_119=this.productoConfigurado;
_11a=this.producto;
}
_10f=new ObjetoTd();
_10f.width="5";
_10f.align="center";
_10f.valign="top";
_110=new ObjetoImg();
_110.src=this.rutaPunto;
_110.width="4";
_110.height="11";
_10f.text=_110.getHTML();
_111=_10f.getHTML();
_10f=new ObjetoTd();
_10f.width="6";
_10f.align="center";
_10f.valign="top";
_112=_10f.getHTML();
_10f=new ObjetoTd();
_10f.width="1";
_10f.align="center";
_113=_10f.getHTML();
_10f=new ObjetoTd();
_10f.width="53";
_10f.align="center";
_10f.valign="top";
_110=new ObjetoImg();
_110.src=this.rutaBotonEliminar;
_110.alt="Eliminar";
if(_11a.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_11a.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_110.onclick="gblPag.eliminarAgregadoPCP('"+_109.componente.componente.codigo+"',"+_10b+","+_10d+","+_10e+");";
}else{
if(_10b==0){
_110.onclick="gblPag.eliminarAgregado('"+_109.componente.componente.codigo+"',"+_10d+","+_10e+");";
}else{
_110.onclick="gblPag.eliminarIngredienteAdicionalParte('"+_109.componente.componente.codigo+"',"+_10b+","+_10d+","+_10e+");";
}
}
if(_109.cantidad==0||_10c&&_109.cantidad<_109.componente.numeroVeces){
_110.src=this.rutaBotonRestituir;
_110.alt="Reestablecer";
if(_11a.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||_11a.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_110.onclick="gblPag.restituirOriginalPCP('"+_109.componente.componente.codigo+"',"+_10b+","+_10d+","+_10e+");";
}else{
_110.onclick="gblPag.restituirOriginal('"+_109.componente.componente.codigo+"',"+_10d+","+_10e+");";
}
}
_110.width="24";
_110.height="16";
_10f.text=_110.getHTML();
_114=_10f.getHTML();
_10f=new ObjetoTd();
_10f.width="104";
_10f.align="left";
if(_109.cantidad==0){
_10f.estilo="textoIngredientesInactivos";
}
_10f.text=_109.componente.componente.nombre;
if(_109.componente.codigoTipoComponente==1){
_10f.text=_10f.text+" ("+_109.componente.numeroVeces+")";
}
_115=_10f.getHTML();
_10f=new ObjetoTd();
_10f.width="27";
_10f.align="center";
if(_109.cantidad==0){
_10f.estilo="textoIngredientesInactivos";
}
_10f.text=""+_109.cantidad;
_116=_10f.getHTML();
_10f=new ObjetoTd();
_10f.width="40";
_10f.align="center";
if(_109.cantidad==0){
_10f.estilo="textoIngredientesInactivos";
}
if(_10b==0){
var _11b=_119.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
if(_11a.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
_10f.text="S/. "+_109.getPrecioTotalPorCodigoValorPNE(_11b,_10a);
}
if(_11a.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_10f.text="S/. "+_109.getPrecioTotalPorCodigoValorPND(_11b,_10a);
}
}else{
_118=_119.valorAtributoPrincipalProducto.parte;
var _11b=_119.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
if(_11a.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_118=_119.cantidadIngredienteOriginal;
_10f.text="S/. "+_109.getPrecioTotalPorCodigoValorPCP(_11b,_10a,_118);
}else{
if(_11a.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_118=_119.cantidadIngredienteOriginal;
_10f.text="S/. "+_109.getPrecioTotalPorCodigoValorPCP(_11b,_10a,1);
}else{
_10f.text="S/."+_109.getPrecioPorCodigoAtributoCodigoValorPorParte(_11b,_10a,_118);
}
}
}
_117=_10f.getHTML();
return _111+_113+_115+_112+_116+_112+_117+_112+_114;
}
function eliminarAgregadoPNE(_11c,_11d,_11e){
var _11f=null;
var _120=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_11f=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_11d,_11e);
_120=_11f.producto;
}else{
_11f=this.productoConfigurado;
_120=this.producto;
}
var _121=_11f.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
if(_120.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
if(!_11f.puedeEliminarIngrediente(_11c,_120.cantidadMinimaIngrediente)){
alert("No puede eliminar mas ingredientes originales");
return;
}
}
_11f.eliminarDisponible(_11c);
if(_120.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
_11f.sustituir(_121);
}
if(_120.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_11f.ordenarArrayIngredienteAdicionalPorPrecio(_121);
}
this.pintarAgregado(_121,0,_11d,_11e);
this.pintarPrecio();
}
function restituirOriginalPNE(_122,_123,_124){
var _125=null;
var _126=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_125=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_123,_124);
_126=_125.producto;
}else{
_125=this.productoConfigurado;
_126=this.producto;
}
var _127=_125.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
if(!_125.restituirOriginal(_122,_126.cantidadMaximaMismoIngrediente,_126.cantidadMaximaIngrediente)){
alert("No se puede restituir el ingrediente");
return;
}
_125.sustituir(_127);
this.pintarAgregado(_127,0,_123,_124);
this.pintarPrecio();
}
function pintarPaginaPNE(){
var _128=0;
var _129=0;
this.pintarDatosProducto();
this.pintarCategoria();
this.pintarSeccionPNormal(_128,_129);
this.pintarValorAtributoPrincipal(this.producto,_128,_129);
var _12a=0;
this.pintarIngredienteAdicional(this.producto.arrayIngredienteAdicional,_12a,_128,_129);
this.pintarComplementario();
this.pintarRelacionado();
this.pintarOtroAdicional();
this.pintarCantidad();
}
function cargarProductoConfiguradoPNE(){
var _12b;
var _12c=0;
var _12d=0;
if(this.productoConfigurado==null){
return;
}
if(this.productoConfigurado.valorAtributoPrincipalProductoLocal==null){
return;
}
if(this.productoConfigurado.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal==null){
return;
}else{
_12b=this.productoConfigurado.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
seleccionaRadioPorNombrePorValor(this.nameRdbAtributoPrincipal+_12c,_12b);
this.clickAtributoPrincipal(_12c,_12d);
}
}
function pintarPrecioPNE(){
var _12e=document.getElementById(this.idSpanPrecioProducto);
var _12f=document.getElementById(this.idSpanPrecioTotalProducto);
this.productoConfigurado.cantidad=parseInt(document.getElementById(this.idCmbCantidadProducto).value);
var _130=this.productoConfigurado.getPrecio();
var _131=this.productoConfigurado.getPrecioTotal();
if(_130>0){
_130=formatoNumero(_130,2);
}
if(_131>0){
_131=formatoNumero(_131,2);
}
_12e.innerHTML=" "+_130;
_12f.innerHTML=" "+_131;
this.pintarGlosaPNE();
}
function pintarPartePNE(_132,_133){
var _134=null;
var _135=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_134=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_132,_133);
_135=_134.producto;
}else{
_134=this.productoConfigurado;
_135=this.producto;
}
var _136=_134.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.atributoPrincipal.codigo;
var _137=_134.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _138=_135.buscarValorAtributoPrincipalProductoPorCodigoAtributoCodigoValor(_136,_137).parte;
var div=document.getElementById(this.idDivIngredienteParte+_132);
var html="";
var ruta;
for(var _13c=1;_13c<=_138;_13c++){
ruta=eval("this."+"rutaParte"+_13c+"de"+_138);
html=html+this.getTituloParteHTML(ruta,"<b>Parte "+_13c+" de "+_138+"</b>");
html=html+this.getHtmlSeccionIngrediente(_13c,_132,_133);
}
div.innerHTML=html;
}
function getTituloParteHTMLPNE(_13d,_13e){
var _13f=new ObjetoTable();
var tr=new ObjetoTr();
var _141;
var td;
_13f.width="750";
_13f.border="0";
_13f.cellspacing="0";
_13f.cellpadding="0";
td=new ObjetoTd();
td.estilo="fondoSubTitulosTablasInternas";
_141=new ObjetoImg();
_141.src=_13d;
_141.width="20";
_141.height="15";
td.text="&nbsp;"+_13e+"&nbsp;"+_141.getHTML();
tr.arrayTd.push(td);
_13f.arrayTr.push(tr);
return _13f.getHTML();
}
function pintarIngredientePartePNE(_143,_144){
var _145=null;
var _146=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_145=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_143,_144);
_146=_145.producto;
}else{
_145=this.productoConfigurado;
_146=this.producto;
}
var _147=_145.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.atributoPrincipal.codigo;
var _148=_145.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _149=_146.buscarValorAtributoPrincipalProductoPorCodigoAtributoCodigoValor(_147,_148).parte;
if(_149<2){
arrayTemp1=null;
}else{
arrayTemp1=_146.buscarArrayIngredienteAdicionalProductoPorCodigoAtributoPorCodigoValorPorParte(_147,_148,_149);
}
if(arrayTemp1==null){
var div=document.getElementById(this.idDivIngredienteParte+_143);
div.innerHTML="";
setInvisible(this.idDivSeccionIngredienteParte+_143);
return;
}else{
if(esVisible(this.idDivIngrediente+_143)){
setVisible(this.idDivSeccionIngredienteParte+_143);
}
}
this.pintarParte(_143,_144);
for(var _14b=1;_14b<=_149;_14b++){
this.pintarIngredienteAdicional(arrayTemp1,_14b,_143,_144);
this.pintarAdicionalSeleccionado(_14b,_143,_144);
this.pintarImgAdicionalSeleccionado(_14b,_143,_144);
}
}
function agregarIngredienteAdicionalPartePNE(_14c,_14d,_14e){
var _14f=null;
var _150=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_14f=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_14d,_14e);
_150=_14f.producto;
}else{
_14f=this.productoConfigurado;
_150=this.producto;
}
var _151=this.getCodigoAdicional(_14c,_14d);
var _152=_14f.puedeAgregarIngrediente(_151,_14c,_150.cantidadMaximaMismoIngrediente,_150.cantidadMaximaIngrediente);
if(_152==1){
alert("No se puede agregar mas veces este ingrediente");
return;
}
if(_152==2){
alert("No se puede agregar mas ingredientes");
return;
}
var _153=_14f.valorAtributoPrincipalProducto.parte;
var _154=_14f.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _155=_14f.producto.buscarDisponiblePorCodigo(_151);
_14f.agregarIngredienteAdicionalParte(_155,_14c);
if(_14f.sustituirParte(_155.componente.codigo)){
if(_150.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
_14f.sustituir(_154);
}
if(_150.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_14f.ordenarArrayIngredienteAdicionalPorPrecio(_154);
}
this.pintarAgregado(_154,0,_14d,_14e);
for(var i=1;i<=_153;i++){
this.pintarAgregado(_154,i,_14d,_14e);
}
}else{
this.pintarAgregado(_154,_14c,_14d,_14e);
}
this.pintarPrecio();
}
function eliminarIngredienteAdicionalPartePNE(_157,_158,_159,_15a){
var _15b=null;
var _15c=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_15b=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_159,_15a);
_15c=_15b.producto;
}else{
_15b=this.productoConfigurado;
_15c=this.producto;
}
var _15d=_15b.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
_15b.eliminarIngredienteAdicionalParte(_157,_158);
this.pintarAgregado(_15d,_158,_159,_15a);
this.pintarPrecio();
}
function getTituloComplementarioHTMLPNE(tipo){
var tr=new ObjetoTr();
var td;
var _161;
var _162;
var _163;
var _164;
var foto;
var _166;
var _167;
td=new ObjetoTd();
td.width="10";
td.text="<br>";
td.height="24";
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="440";
td.estilo="subtitulosProdDetalleInterior";
if(tipo==0){
td.text="Complementos Disponibles :";
}else{
td.text="Complementos Seleccionados :";
}
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
if(tipo==0){
td.text="Foto";
}
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
td.text="Precio";
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
td.text="Cantidad";
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="140";
td.text="<br>";
tr.arrayTd.push(td);
return tr.getHTML();
}
function getComplementarioSeleccionadoHTMLPNE(_168,_169){
var tr=new ObjetoTr();
var td;
var _16c;
td=new ObjetoTd();
td.width="10";
td.text="<br>";
td.height="18";
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="440";
td.text=_169+". "+_168.complementario.complementario.nombre;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
td.text="<BR>";
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
td.text=_168.complementario.valorAtributoPrincipalProductoLocal.precio;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
td.text=_168.cantidad;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="140";
img1=new ObjetoImg();
img1.src=this.rutaBotonEliminar;
img1.width="24";
img1.height="16";
img1.border="0";
img1.onclick="gblPag.eliminarComplementario('"+_168.complementario.complementario.codigo+"')";
td.text="<a href=\"#\">"+img1.getHTML()+"</a>";
tr.arrayTd.push(td);
return tr.getHTML();
}
function getComplementarioHTMLPNE(_16d){
var tr=new ObjetoTr();
var td;
var _170;
var _171;
td=new ObjetoTd();
td.width="10";
td.text="<br>";
td.height="24";
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="440";
td.text=_16d.complementario.nombre;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
img1=new ObjetoImg();
img1.src=this.rutaImagenFoto;
img1.width="24";
img1.height="16";
img1.border="0";
td.text="<a href=\"#\">"+img1.getHTML()+"</a>";
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
td.text=_16d.valorAtributoPrincipalProductoLocal.precio;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="40";
td.align="center";
_170=new ObjetoText();
_170.id=this.prefijoIdTxtComplementario+"_"+_16d.complementario.codigo;
_170.maxlength="2";
_170.size="3";
td.text=_170.getHTML();
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="10";
td.background=this.rutaLinea2;
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="140";
img1=new ObjetoImg();
img1.src=this.rutaBotonAgregar;
img1.width="71";
img1.height="16";
img1.border="0";
_171="gblPag.agregarComplementario('"+this.prefijoIdTxtComplementario+"_"+_16d.complementario.codigo+"','"+_16d.complementario.codigo+"')";
td.onclick=_171;
td.text="<a href=\"javascript:\""+_171+">"+img1.getHTML()+"</a>";
tr.arrayTd.push(td);
return tr.getHTML();
}
function pintarComplementarioPNE(){
if(this.producto.arrayComplementario==null){
setInvisible(this.idDivSeccionComplementario);
return;
}
if(this.producto.arrayComplementario.length==0){
setInvisible(this.idDivSeccionComplementario);
return;
}
setInvisible(this.idDivComplementario);
setInvisible(this.idDivComplementarioSeleccionado);
setVisible(this.idTblLinea1);
setVisible(this.idTblBlanco1);
setVisible(this.idTblBlanco2);
var _172=new ObjetoTable();
var td;
var img1;
var tr;
_172.estilo="fondoCremaFilaTablas2";
_172.width="750";
_172.border="0";
_172.cellspacing="0";
_172.cellpadding="0";
_172.arrayTrHtml.push(this.getTituloComplementarioHTML(0));
var num=this.producto.arrayComplementario.length;
for(var i=0;i<num;i++){
_172.arrayTrHtml.push(this.getComplementarioHTML(this.producto.arrayComplementario[i]));
}
tr=new ObjetoTr();
td=new ObjetoTd();
td.width="40";
td.colspan="10";
td.align="center";
td.background=this.rutaLinea3;
td.text="<BR>";
tr.arrayTd.push(td);
_172.arrayTrHtml.push(tr.getHTML());
document.getElementById(this.idDivComplementario).innerHTML=_172.getHTML();
}
function pintarComplementarioSeleccionadoPNE(){
var num;
if(this.productoConfigurado.arrayComplementario==null){
return;
}
if(this.productoConfigurado.arrayComplementario.length==0){
document.getElementById(this.idDivComplementarioSeleccionado).innerHTML="";
return;
}
var _179=new ObjetoTable();
var td;
var img1;
var tr;
_179.estilo="fondoCremaFilaTablas2";
_179.width="750";
_179.border="0";
_179.cellspacing="0";
_179.cellpadding="0";
_179.arrayTrHtml.push(this.getTituloComplementarioHTML(1));
num=this.productoConfigurado.arrayComplementario.length;
for(var i=0;i<num;i++){
_179.arrayTrHtml.push(this.getComplementarioSeleccionadoHTML(this.productoConfigurado.arrayComplementario[i],i+1));
}
document.getElementById(this.idDivComplementarioSeleccionado).innerHTML=_179.getHTML();
}
function agregarComplementarioPNE(_17e,_17f){
var _180=document.getElementById(_17e).value;
_180=parseInt(_180);
document.getElementById(_17e).value="";
if(isNaN(_180)){
return;
}
var _181=this.producto.buscarComplementarioPorCodigo(_17f);
this.productoConfigurado.agregarComplementario(_181,_180);
this.pintarComplementarioSeleccionado();
this.pintarPrecio();
}
function eliminarComplementarioPNE(_182){
this.productoConfigurado.eliminarComplementario(_182);
this.pintarComplementarioSeleccionado();
this.pintarPrecio();
}
function pintarRelacionadoPNE(){
if(this.producto.arrayRelacionado==null){
return;
}
if(this.producto.arrayRelacionado.length==0){
return;
}
var _183=new ObjetoTable();
var td;
var img1;
var tr;
_183.width="270";
_183.border="0";
_183.cellspacing="0";
_183.cellpadding="0";
tr=new ObjetoTr();
td=new ObjetoTd();
td.colspan="2";
td.estilo="fondoTituloTablasInternas";
td.height="17";
td.text="&nbsp;&nbsp;&nbsp;Productos Relacionados";
tr.arrayTd.push(td);
_183.arrayTr.push(tr);
var num=this.producto.arrayRelacionado.length;
for(var i=0;i<num;i++){
tr=new ObjetoTr();
td=new ObjetoTd();
td.width="20";
td.estilo="fondoCremaFilaTablas2";
td.height="15";
td.align="center";
td.valign="top";
img1=new ObjetoImg();
img1.src=this.rutaPunto;
img1.width="4";
img1.height="11";
td.text=img1.getHTML();
tr.arrayTd.push(td);
td=new ObjetoTd();
td.width="250";
td.estilo="fondoCremaFilaTablas2";
td.height="15";
td.text="<p><a href=\"#\">"+this.producto.arrayRelacionado[i].relacionado.nombre+"</a></p>";
tr.arrayTd.push(td);
_183.arrayTr.push(tr);
}
document.getElementById(this.idDivRelacionado).innerHTML=_183.getHTML();
}
function pintarOtroAdicionalPNE(){
var _189;
var _18a;
var _18b;
var _18c;
var num;
var div=document.getElementById(this.idDivOtroAdicional);
if(this.producto.arrayOtroAdicional==null){
setInvisible(this.idDivSeccionOtroAdicional);
return;
}else{
setVisible(this.idDivSeccionOtroAdicional);
setVisible(this.idDivOtroAdicional);
setVisible(this.idTblLinea1);
setVisible(this.idTblBlanco1);
setVisible(this.idTblBlanco2);
}
num=this.producto.arrayOtroAdicional.length;
_189=new ObjetoTable();
_189.width="750";
_189.align="center";
_189.border="0";
_189.cellspacing="0";
_18a=new ObjetoTr();
for(var i=0;i<num;i++){
_18c=new ObjetoCheckBox();
_18c.value=this.producto.arrayOtroAdicional[i].componente.codigo;
_18c.name=this.nameChkOtroAdicional;
_18c.id=this.nameChkOtroAdicional+"_"+this.producto.arrayOtroAdicional[i].componente.codigo;
_18c.onclick="gblPag.clickOtroAdicional()";
_18b=new ObjetoTd();
_18b.estilo="fondoCremaFilaTablas2";
_18b.text=_18c.getHTML()+this.producto.arrayOtroAdicional[i].componente.nombre;
_18a.arrayTd.push(_18b);
}
_189.arrayTr.push(_18a);
div.innerHTML=_189.getHTML();
}
function pintarCantidadPNE(){
var span=document.getElementById(this.idSpanCantidadProducto);
var _191;
var _192;
_191=new ObjetoSelect();
_191.id=this.idCmbCantidadProducto;
_191.onchange="gblPag.pintarPrecio();";
for(var j=1;j<=this.producto.cantidad;j++){
_192=new ObjetoOption();
_192.value=j;
_192.text=j;
_191.arrayOption.push(_192);
}
span.innerHTML=_191.getHTML();
}
function clickEnviarCarritoPNE(){
this.productoConfigurado.indicadorTextoAdicional=this.producto.indicadorTextoAdicional;
if(this.producto.indicadorTextoAdicional==1){
this.productoConfigurado.comentarioAdicional=document.getElementById("txtComentarioAdicional").value;
}
if(this.producto.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
this.pintarErrorAtributoSecundario(0,0);
var frm;
var ruta="";
if(!this.pintarErrorAtributoSecundario(0,0)){
frm=document.getElementById(this.idFrmEnvioDatos);
var _196=this.productoConfigurado.getXML("productoPedido");
eval("frm."+this.nameHidenEnvioProductoPedido).value="<"+TAG_CONTENEDOR+">"+_196+"</"+TAG_CONTENEDOR+">";
if(this.estadoActual.codigoRestaurante!=null){
if(this.estadoActual.codigoRestaurante!=""){
ruta=ruta+"&codigoRestauranteHome="+this.estadoActual.codigoRestaurante;
}
}
ruta=ruta+"&codigoCiudad=1";
ruta=ruta+"&codigoDistritoAtencion="+this.estadoActual.codigoDistritoAtencion;
ruta=ruta+"&codigoProducto="+this.productoConfigurado.producto.codigo;
ruta=ruta+"&codigoLocal="+this.productoConfigurado.producto.productoLocalActual.local.codigo;
ruta=ruta+"&codigoRestaurante="+this.productoConfigurado.restaurante.codigo;
if(this.productoConfigurado.producto.categoriaFoodCourt!=null){
ruta=ruta+"&codigoCategoria="+this.productoConfigurado.producto.categoriaFoodCourt.codigo;
}else{
ruta=ruta+"&codigoCategoria="+this.productoConfigurado.producto.categoriaRestaurante.codigo;
}
frm.action=this.rutaEnvioDatos+ruta;
frm.method="POST";
frm.target="_parent";
frm.submit();
}
}
if(this.producto.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
this.pintarErrorAtributoSecundario(0,0);
var frm;
var ruta="";
if(!this.pintarErrorAtributoSecundario(0,0)){
if(this.productoConfigurado.getCantidadTotalIngredientes()<this.productoConfigurado.producto.cantidadMinimaIngrediente){
alert("Debe tener por lo menos "+"' "+this.productoConfigurado.producto.cantidadMinimaIngrediente+" '"+" Ingredientes Escogidos.");
}else{
frm=document.getElementById(this.idFrmEnvioDatos);
eval("frm."+this.nameHidenEnvioProductoPedido).value="<"+TAG_CONTENEDOR+">"+this.productoConfigurado.getXML("productoPedido")+"</"+TAG_CONTENEDOR+">";
if(this.estadoActual.codigoRestaurante!=null){
if(this.estadoActual.codigoRestaurante!=""){
ruta=ruta+"&codigoRestauranteHome="+this.estadoActual.codigoRestaurante;
}
}
ruta=ruta+"&codigoCiudad=1";
ruta=ruta+"&codigoDistritoAtencion="+this.estadoActual.codigoDistritoAtencion;
ruta=ruta+"&codigoProducto="+this.productoConfigurado.producto.codigo;
ruta=ruta+"&codigoLocal="+this.productoConfigurado.producto.productoLocalActual.local.codigo;
ruta=ruta+"&codigoRestaurante="+this.productoConfigurado.restaurante.codigo;
if(this.productoConfigurado.producto.categoriaFoodCourt!=null){
ruta=ruta+"&codigoCategoria="+this.productoConfigurado.producto.categoriaFoodCourt.codigo;
}else{
ruta=ruta+"&codigoCategoria="+this.productoConfigurado.producto.categoriaRestaurante.codigo;
}
frm.action=this.rutaEnvioDatos+ruta;
frm.method="POST";
frm.target="_parent";
frm.submit();
}
}
}
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES||this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
this.pintarErrorAtributoSecundario(0,0);
this.pintarErrorIngredienteCompuesto();
var frm;
var ruta="";
if(!this.pintarErrorAtributoSecundario(0,0)){
if(!this.pintarErrorIngredienteCompuesto()){
frm=document.getElementById(this.idFrmEnvioDatos);
var _196=this.productoConfigurado.getXML("productoPedido");
eval("frm."+this.nameHidenEnvioProductoPedido).value="<"+TAG_CONTENEDOR+">"+_196+"</"+TAG_CONTENEDOR+">";
if(this.estadoActual.codigoRestaurante!=null){
if(this.estadoActual.codigoRestaurante!=""){
ruta=ruta+"&codigoRestauranteHome="+this.estadoActual.codigoRestaurante;
}
}
ruta=ruta+"&codigoCiudad=1";
ruta=ruta+"&codigoDistritoAtencion="+this.estadoActual.codigoDistritoAtencion;
ruta=ruta+"&codigoProducto="+this.productoConfigurado.producto.codigo;
ruta=ruta+"&codigoLocal="+this.productoConfigurado.producto.productoLocalActual.local.codigo;
ruta=ruta+"&codigoRestaurante="+this.productoConfigurado.restaurante.codigo;
if(this.productoConfigurado.producto.categoriaFoodCourt!=null){
ruta=ruta+"&codigoCategoria="+this.productoConfigurado.producto.categoriaFoodCourt.codigo;
}else{
ruta=ruta+"&codigoCategoria="+this.productoConfigurado.producto.categoriaRestaurante.codigo;
}
frm.action=this.rutaEnvioDatos+ruta;
frm.method="POST";
frm.target="_parent";
frm.submit();
}
}
}
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
if(this.producto.arrayIngredienteProductoCombo==null){
return;
}
var num=this.producto.arrayIngredienteProductoCombo.length;
for(var i=0;i<num;i++){
this.pintarErrorAtributoSecundario(i,0);
}
}
}
function pintarPaginaPCP(){
var _199=0;
var _19a=0;
this.pintarSeccionPCP(_199,_19a);
this.pintarDatosProducto();
this.pintarCategoria();
this.pintarValorAtributoPrincipal(this.producto,_199,_19a);
this.pintarComplementario();
this.pintarRelacionado();
this.pintarOtroAdicional();
this.pintarCantidad();
}
function pintarSeccionPCP(_19b,_19c){
html=this.getHtmlSeccionTitulo1("Selecciona el Tama\xf1o del producto :")+"<div id=\""+this.idDivAtributoPrincipal+_19b+"\"></div>";
document.getElementById(this.idDivSeccionAtributoPrincipal+_19b).innerHTML=this.getHtmlBorde(html);
html=this.getHtmlSeccionTitulo1("Selecciona las siguientes opciones :")+"<div id=\""+this.idDivAtributoSecundario+_19b+"\"></div>";
document.getElementById(this.idDivSeccionAtributoSecundario+_19b).innerHTML=this.getHtmlBorde(html);
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
html=this.getHtmlSeccionTitulo1("Seleccione cada Parte :");
}else{
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
html=this.getHtmlSeccionTitulo1("Seleccione los Productos :");
}
}
html=html+"<div id=\""+this.idDivParte+_19b+"\" style=\"display:none\" ></div>";
document.getElementById(this.idDivSeccionParte+_19b).innerHTML=this.getHtmlBorde(html);
html=this.getHtmlSeccionTitulo2("Si deseas, agr\xe9gale o qu\xedtale Ingredientes a tu pedido :","chk_"+this.idDivSeccionIngrediente+_19b,"gblPag.clickCheckSeccionIngredientePCP("+_19b+","+_19c+")");
html=html+"<div id=\""+this.idDivTab+_19b+"\" style=\"display:none\" ></div>";
html=html+"<div id=\""+this.idDivIngredienteParte+_19b+"\" style=\"display:none\" ></div>";
document.getElementById(this.idDivSeccionIngrediente+_19b).innerHTML=this.getHtmlBorde(html);
texto=this.getHtmlSeccionTitulo1("Incluye las salsas y condimentos que desees :","chk_"+this.idDivOtroAdicional,this.idDivOtroAdicional,this.idDivOtroAdicional);
document.getElementById(this.idDivSeccionOtroAdicional).innerHTML=this.getHtmlSeccionTitulo3(texto,this.idDivOtroAdicional,null);
texto=this.getHtmlSeccionTitulo2("\xbfDeseas ver los Complementos que tenemos para tu producto?:","chk_"+this.idDivSeccionComplementario,"gblPag.clickCheckSeccionComplementario()");
document.getElementById(this.idDivSeccionComplementario).innerHTML=this.getHtmlSeccionTitulo3(texto,this.idDivComplementario,this.idDivComplementarioSeleccionado);
}
function pintarIngredienteCompuestoPCP(_19d,_19e){
var _19f=null;
var _1a0=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_19f=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_19d,_19e);
_1a0=_19f.producto;
}else{
_19f=this.productoConfigurado;
_1a0=this.producto;
}
var _1a1;
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_1a1=_19f.cantidadIngredienteOriginal;
}else{
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_1a1=_19f.cantidadMaximaIngrediente;
}
}
var div=document.getElementById(this.idDivParte+_19d);
var html="";
var ruta;
if(_1a0.arrayIngredienteCompuesto==null){
return;
}
tableTemp=new ObjetoTable();
tableTemp.width="750";
tableTemp.align="center";
tableTemp.border="0";
tableTemp.cellspacing="0";
tableTemp.estilo="fondoCremaFilaTablas2";
trTemp=new ObjetoTr();
trTemp2=new ObjetoTr();
tdTemp2=new ObjetoTd();
tdTemp2.colspan=0;
tdTemp2.estilo="textoMensajeError";
var _1a5=this.prefijoIdDivIngredienteCompuestoError;
tdTemp2.text="<div id="+_1a5+" style=\"display:none\">[ * Error: Debe seleccionar un producto para cada una de las partes ]</div>";
trTemp2.arrayTd.push(tdTemp2);
tableTemp.arrayTr.push(trTemp);
tableTemp.arrayTr.push(trTemp2);
html=tableTemp.getHTML();
for(var _1a6=1;_1a6<=_1a1;_1a6++){
ruta=eval("this."+"rutaParte"+_1a6+"de"+_1a1);
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
html=html+this.getTituloParteHTML(ruta,"Parte "+_1a6+" de "+_1a1);
}
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
html=html+this.getTituloParteHTML(ruta,"Producto "+_1a6+" de "+_1a1);
}
html=html+this.getIngredienteCompuestoParteHTMLPCP(_1a6,_19d,_19e);
}
setVisible(this.idDivParte+_19d);
div.innerHTML=html;
}
function clickAtributoPrincipalPCP(_1a7,_1a8){
var _1a9=this.getCodigoValorAtributoPrincipal(_1a7);
var _1aa=null;
var _1ab=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_1aa=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1a7,_1a8);
_1ab=_1aa.producto;
}else{
_1aa=this.productoConfigurado;
_1ab=this.producto;
}
_1aa.valorAtributoPrincipalProductoLocal=_1ab.productoLocalActual.buscarValorAtributoPrincipalProductoLocalPorCodigoValor(_1a9);
_1aa.valorAtributoPrincipalProducto=_1ab.buscarValorAtributoPrincipalProductoPorCodigoValor(_1a9);
this.pintarValorAtributoSecundario(_1aa,_1a7,_1a8);
_1aa.migrarAtributoSecundario(_1ab);
this.cargarValorAtributoSecundario(_1aa,_1a7);
this.pintarIngredienteCompuestoPCP(_1a7,_1a8);
_1aa.iniciarIngredienteCompuestoPCP(_1ab.arrayIngredienteCompuesto[0]);
this.cargarIngredienteCompuestoPCP(_1a7,_1a8);
this.clickTabPCP(1,_1a7,_1a8);
}
function getIngredienteCompuestoParteHTMLPCP(_1ac,_1ad,_1ae){
var _1af;
var _1b0;
var _1b1;
var _1b2;
var num;
var _1b4=null;
var _1b5=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_1b4=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1ad,_1ae);
_1b5=_1b4.producto;
}else{
_1b4=this.productoConfigurado;
_1b5=this.producto;
}
num=_1b5.arrayIngredienteCompuesto.length;
_1af=new ObjetoTable();
_1af.width="750";
_1af.align="center";
_1af.estilo="fondoCremaFilaTablas2";
_1af.border="0";
_1af.cellspacing="0";
_1b0=new ObjetoTr();
for(var i=0;i<num;i++){
_1b2=new ObjetoRadio();
_1b2.name=this.nameRdbParte+_1ad+"_"+_1ac;
_1b2.value=_1b5.arrayIngredienteCompuesto[i].componente.codigo;
_1b2.onclick="gblPag.clickIngredienteCompuestoPCP("+_1ac+","+_1ad+","+_1ae+")";
_1b1=new ObjetoTd();
_1b1.estilo="fondoCremaFilaTablas2";
_1b1.text=_1b2.getHTML()+_1b5.arrayIngredienteCompuesto[i].componente.nombre;
_1b0.arrayTd.push(_1b1);
if((i+1)%PRODUCTO_POR_LINEA_PCP==0&&i<num){
_1af.arrayTr.push(_1b0);
_1b0=new ObjetoTr();
}
}
_1af.arrayTr.push(_1b0);
return _1af.getHTML();
}
function pintarTabPCP(_1b7,_1b8,_1b9){
var _1ba=null;
var _1bb=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_1ba=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1b8,_1b9);
_1bb=_1ba.producto;
}else{
_1ba=this.productoConfigurado;
_1bb=this.producto;
}
var div=document.getElementById(this.idDivTab+_1b8);
var _1bd=new ObjetoTable();
var _1be;
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_1be=_1ba.cantidadIngredienteOriginal;
}else{
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_1be=_1ba.cantidadMaximaIngrediente;
}
}
var num;
var html;
var td;
var tr;
var _1c3;
var _1c4=parseInt((_1b7-1)/3);
var _1c5;
_1bd.width="750";
_1bd.cellspacing="0";
_1bd.cellpadding="0";
_1bd.estilo="fondoSubTitulosTablasInternas";
_1c5=new ObjetoTr();
td=new ObjetoTd();
td.height="1";
td.colspan="3";
td.estilo="fondoTituloListadoPlatos";
_1c5.arrayTd.push(td);
for(var i=1;i<=_1be;i++){
if((i-1)%3==0){
tr=new ObjetoTr();
if(parseInt((i-1)/3)==_1c4){
_1c3=tr;
}else{
_1bd.arrayTr.push(tr);
_1bd.arrayTr.push(_1c5);
}
}
if(_1b7==i){
tr.arrayTdHtml.push(this.getTabHTMLPCP(i,true,_1ba.arrayIngredienteCompuesto[i-1],_1b8,_1b9));
}else{
tr.arrayTdHtml.push(this.getTabHTMLPCP(i,false,_1ba.arrayIngredienteCompuesto[i-1],_1b8,_1b9));
}
}
if(_1be<=3){
_1bd.arrayTr.push(tr);
}else{
_1bd.arrayTr.push(_1c3);
}
_1bd.arrayTr.push(_1c5);
div.innerHTML=_1bd.getHTML();
var _1c7=this.getHtmlSeccionIngrediente(_1b7,_1b8,_1b9);
document.getElementById(this.idDivIngredienteParte+_1b8).innerHTML=_1c7;
if(esVisible(this.idDivTab+_1b8)){
setVisible(this.idDivIngredienteParte+_1b8);
}else{
setInvisible(this.idDivIngredienteParte+_1b8);
}
}
function cargarProductoConfiguradoPCP(){
var _1c8;
var _1c9=0;
var _1ca=0;
if(this.productoConfigurado==null){
return;
}
if(this.productoConfigurado.valorAtributoPrincipalProductoLocal==null){
return;
}
if(this.productoConfigurado.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal==null){
return;
}else{
_1c8=this.productoConfigurado.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
seleccionaRadioPorNombrePorValor(this.nameRdbAtributoPrincipal+_1c9,_1c8);
this.clickAtributoPrincipalPCP(_1c9,_1ca);
}
}
function getTabHTMLPCP(_1cb,_1cc,_1cd,_1ce,_1cf){
var _1d0=null;
var _1d1=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_1d0=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1ce,_1cf);
_1d1=_1d0.producto;
}else{
_1d0=this.productoConfigurado;
_1d1=this.producto;
}
var td=new ObjetoTd();
var _1d3;
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_1d3=_1d0.cantidadIngredienteOriginal;
}else{
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_1d3=_1d0.cantidadMaximaIngrediente;
}
}
var ruta;
var _1d5;
td.align="center";
td.width="33%";
td.onclick="gblPag.clickTabPCP("+_1cb+","+_1ce+","+_1cf+")";
if(_1cc){
td.estilo="pestanaInteriorTablaOn";
}else{
td.estilo="pestanaInteriorTablaOff";
}
ruta=eval("this."+"rutaParte"+_1cb+"de"+_1d3);
_1d5=new ObjetoImg();
_1d5.src=ruta;
_1d5.width="20";
_1d5.height="15";
_1d5.border="0";
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
td.text="<span style=\"cursor: hand;\">Parte "+_1cb+" de "+_1d3+"&nbsp;"+_1d5.getHTML()+"&nbsp;&gt; "+_1cd.producto.nombre+" </span>";
}
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
td.text="<span style=\"cursor: hand;\">Producto "+_1cb+" de "+_1d3+"&nbsp;"+_1d5.getHTML()+"&nbsp;&gt; "+_1cd.producto.nombre+" </span>";
}
return td.getHTML();
}
function clickTabPCP(_1d6,_1d7,_1d8){
this.pintarTabPCP(_1d6,_1d7,_1d8);
this.pintarIngredientePartePCP(_1d6,_1d7,_1d8);
this.pintarPrecio();
}
function getCodigoIngredienteCompuestoPCP(_1d9,_1da){
var _1db=null;
var _1dc;
var num;
_1dc=getObjetoHtmlPorName(this.nameRdbParte+_1da+"_"+_1d9);
if(_1dc==null){
return null;
}
num=_1dc.length;
for(var i=0;i<num;i++){
if(_1dc[i].checked){
_1db=_1dc[i].value;
break;
}
}
return _1db;
}
function clickIngredienteCompuestoPCP(_1df,_1e0,_1e1){
var _1e2=null;
var _1e3=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_1e2=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1e0,_1e1);
_1e3=_1e2.producto;
}else{
_1e2=this.productoConfigurado;
_1e3=this.producto;
}
var _1e4=this.getCodigoIngredienteCompuestoPCP(_1df,_1e0);
var _1e5=_1e3.buscarArrayIngredienteCompuestoPorCodigo(_1e4);
if(_1e5!=null){
_1e2.agregarIngredienteCompuestoPCP(_1e5,_1df);
}
setInvisible(this.prefijoIdDivIngredienteCompuestoError);
this.clickTabPCP(_1df,_1e0,_1e1);
}
function cargarIngredienteCompuestoPCP(_1e6,_1e7){
var _1e8=null;
var _1e9=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_1e8=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1e6,_1e7);
_1e9=_1e8.producto;
}else{
_1e8=this.productoConfigurado;
_1e9=this.producto;
}
var _1ea;
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_1ea=_1e8.cantidadIngredienteOriginal;
}else{
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_1ea=_1e8.cantidadMaximaIngrediente;
}
}
if(_1e8.arrayIngredienteCompuesto==null){
return;
}
for(var _1eb=1;_1eb<=_1ea;_1eb++){
seleccionaRadioPorNombrePorValor(this.nameRdbParte+_1e6+"_"+_1eb,_1e8.arrayIngredienteCompuesto[_1eb-1].codigo);
this.clickIngredienteCompuestoPCP(_1eb,_1e6,_1e7);
}
}
function clickCheckSeccionIngredientePCP(_1ec,_1ed){
var _1ee=null;
var _1ef=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_1ee=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1ec,_1ed);
_1ef=_1ee.producto;
}else{
_1ee=this.productoConfigurado;
_1ef=this.producto;
}
var chk=getFormElementById("chk_"+this.idDivSeccionIngrediente+_1ec);
if(esVisible(this.idDivTab+_1ec)){
chk.checked=false;
_1ee.indicadorIngrediente=INHABILITADO;
setInvisible(this.idDivIngredienteParte+_1ec);
setInvisible(this.idDivTab+_1ec);
}else{
chk.checked=true;
_1ee.indicadorIngrediente=HABILITADO;
setVisible(this.idDivIngredienteParte+_1ec);
setVisible(this.idDivTab+_1ec);
}
this.pintarPrecio();
}
function pintarIngredientePartePCP(_1f1,_1f2,_1f3){
var _1f4=null;
var _1f5=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_1f4=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1f2,_1f3);
_1f5=_1f4.producto;
}else{
_1f4=this.productoConfigurado;
_1f5=this.producto;
}
var _1f6=_1f4.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.atributoPrincipal.codigo;
var _1f7=_1f4.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _1f8;
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_1f8=_1f4.cantidadIngredienteOriginal;
}else{
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_1f8=_1f4.cantidadMaximaIngrediente;
}
}
var _1f9=_1f4.arrayIngredienteCompuesto[_1f1-1];
var _1fa;
if(this.producto.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_1fa=_1f9.producto.buscarArrayIngredienteAdicionalProductoPorCodigoAtributoPorCodigoValorPorParte(_1f6,_1f7,_1f8);
}else{
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_1fa=_1f9.producto.buscarArrayIngredienteAdicionalProductoPorCodigoAtributoPorCodigoValorPorParte(_1f6,_1f7,1);
}
}
if(this.producto.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
var _1fb=0;
var _1fc=this.idDivSeccionIngrediente+_1f2;
if(_1fa!=null){
_1fb=_1fa.length;
}
if(_1f9.producto.arrayIngrediente!=null){
_1fb=_1f9.producto.arrayIngrediente.length;
}
if(_1fb>0){
document.getElementById(_1fc).style.display="block";
}else{
document.getElementById(_1fc).style.display="none";
}
}
this.pintarIngredienteAdicional(_1fa,_1f1,_1f2,_1f3);
if(_1fa==null){
try{
this.pintarAgregado(_1f7,_1f1,_1f2,_1f3);
}
catch(err){
}
}else{
this.pintarAdicionalSeleccionado(_1f1,_1f2,_1f3);
this.pintarImgAdicionalSeleccionado(_1f1,_1f2,_1f3);
this.pintarAgregado(_1f7,_1f1,_1f2,_1f3);
}
}
function eliminarAgregadoPCP(_1fd,_1fe,_1ff,_200){
var _201=null;
var _202=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_201=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_1ff,_200);
_202=_201.producto;
}else{
_201=this.productoConfigurado;
_202=this.producto;
}
var _203=_201.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _204=_201.arrayIngredienteCompuesto[_1fe-1].producto.cantidadMinimaIngrediente;
if(!_201.arrayIngredienteCompuesto[_1fe-1].puedeEliminarIngrediente(_1fd,_204)){
alert("No puede eliminar mas ingredientes originales");
return;
}
_201.arrayIngredienteCompuesto[_1fe-1].eliminarDisponible(_1fd);
this.pintarAgregado(_203,_1fe,_1ff,_200);
this.pintarPrecio();
}
function restituirOriginalPCP(_205,_206,_207,_208){
var _209=null;
var _20a=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_209=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_207,_208);
_20a=_209.producto;
}else{
_209=this.productoConfigurado;
_20a=this.producto;
}
var _20b=_209.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _20c=_209.arrayIngredienteCompuesto[_206-1].producto.cantidadMaximaMismoIngrediente;
var _20d=_209.arrayIngredienteCompuesto[_206-1].producto.cantidadMaximaIngrediente;
if(!_209.arrayIngredienteCompuesto[_206-1].restituirOriginal(_205,_20c,_20d)){
alert("No se puede restituir el ingrediente");
return;
}
this.pintarAgregado(_20b,_206,_207,_208);
this.pintarPrecio();
}
function pintarPaginaPC(){
this.pintarSeccionPC();
this.pintarDatosProducto();
this.pintarComplementario();
this.pintarRelacionado();
this.pintarOtroAdicional();
this.pintarCantidad();
this.pintarIngredienteComboPC();
}
function pintarSeccionPC(){
var _20e="";
var _20f="";
_20e=this.getHtmlSeccionTitulo1("Incluye las salsas y condimentos que desees :","chk_"+this.idDivOtroAdicional,this.idDivOtroAdicional,this.idDivOtroAdicional);
_20f=_20e+"<div id=\""+this.idDivOtroAdicional+"\"></div>";
document.getElementById(this.idDivSeccionOtroAdicional).innerHTML=this.getHtmlBorde(_20f);
_20e=this.getHtmlSeccionTitulo2("\xbfDeseas ver los Complementos que tenemos para tu producto?:","chk_"+this.idDivSeccionComplementario,"gblPag.clickCheckSeccionComplementario()");
_20f=_20e+"<div id=\""+this.idDivComplementario+"\"></div>"+"<div id=\""+this.idDivComplementarioSeleccionado+"\" style=\"display:none\"></div>";
document.getElementById(this.idDivSeccionComplementario).innerHTML=this.getHtmlBorde(_20f);
}
function pintarIngredienteComboPC(){
var num;
var num2;
var html="";
var _213="";
var _214="";
var _215="";
var tipo;
var _217;
var _218;
var _219;
var _21a=false;
if(this.producto.arrayIngredienteProductoCombo==null){
return;
}
num=this.producto.arrayIngredienteProductoCombo.length;
for(var i=0;i<num;i++){
tipo=this.producto.arrayIngredienteProductoCombo[i].indicadorTipoIngrediente;
_217=this.producto.arrayIngredienteProductoCombo[i].getNombre();
_219=i;
if(tipo==INGREDIENTE_COMBO_PRODUCTO){
_213=this.getHtmlSeccionTitulo2PC(i,tipo,_217);
_215=_213+"<div id=\""+this.idDivCombo+_219+"\" style=\"display:none\"></div><div id=\""+this.idDivAtributoSecundarioTemp+_219+"\" style=\"display:none\"></div><br>";
html=html+this.getHtmlBorde(_215);
}else{
_213=this.getHtmlSeccionTitulo2PC(i,tipo,_217);
_218=this.producto.arrayIngredienteProductoCombo[i].arrayIngredienteOpcion;
num2=_218.length;
_21a=false;
for(var j=0;j<num2;j++){
if(j==num2-1){
_21a=true;
}
_213=_213+this.getHtmlOpcionPC(_218[j].getNombre(),_21a,_219,j,_218[j].ingrediente.codigoTipoProducto);
}
_215=_213+"<div id=\""+this.idDivCombo+_219+"\" style=\"display:none\"></div><div id=\""+this.idDivAtributoSecundarioTemp+_219+"\" style=\"display:none\"></div><br>";
html=html+this.getHtmlBorde(_215);
}
}
document.getElementById(this.idDivSeccionCombo).innerHTML=html;
for(var i=0;i<num;i++){
tipo=this.producto.arrayIngredienteProductoCombo[i].indicadorTipoIngrediente;
if(tipo==INGREDIENTE_COMBO_PRODUCTO){
this.pintarValorAtributoSecundarioTemporal(i,0);
if(!esVisible(this.idDivAtributoSecundario+i)){
document.getElementById(this.idDivAtributoSecundarioTemp+i).innerHTML="";
setInvisible(this.idDivAtributoSecundarioTemp+i);
}
}
}
}
function cargarProductoConfiguradoPC(){
var _21d;
var _21e="";
var _21f="";
var _220="";
var _221=null;
if(this.productoConfigurado==null){
return;
}
if(this.productoConfigurado.arrayIngredienteProductoCombo==null){
return;
}
num=this.productoConfigurado.arrayIngredienteProductoCombo.length;
for(var i=0;i<num;i++){
if(this.productoConfigurado.arrayIngredienteProductoCombo[i].ingredienteOpcion!=null){
_221=this.productoConfigurado.arrayIngredienteProductoCombo[i].arrayProductoConfigurado[0];
_21e=_221.producto.codigo;
_21f=_221.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
_220=_221.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
_21d=this.producto.arrayIngredienteProductoCombo[i].buscarIndiceIngredienteOpcionPorCodigoPorCodigoAtributoPorCodigoValorAtributo(_21e,_21f,_220);
seleccionaRadioPorNombrePorIndice(this.nameRdbIngredienteOpcion+i,_21d);
this.clickOpcionIngredienteOpcionPC(i,_21d);
}
}
}
function getHtmlSeccionTitulo2PC(_223,tipo,_225){
var _226;
var tr1;
var td1;
var img1;
var chk1;
_226=new ObjetoTable();
_226.width="750";
_226.border="0";
_226.cellspacing="0";
_226.cellpadding="0";
tr1=new ObjetoTr();
tr1.estilo="pestanaDetalleProductoGenerOn";
td1=new ObjetoTd();
td1.width="21";
img1=new ObjetoImg();
img1.src=eval("this.rutaLetra"+(_223+1));
img1.width="21";
img1.height="29";
td1.text=img1.getHTML();
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="7";
img1=new ObjetoImg();
img1.src=this.rutaCelda;
img1.width="2";
img1.height="29";
td1.text=img1.getHTML();
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="400";
td1.align="left";
td1.estilo="textoPestanaGeneralOn";
td1.text=_225;
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="292";
td1.align="right";
img1=new ObjetoImg();
img1.src=this.rutaFlecha1;
img1.width="13";
img1.height="14";
if(tipo==INGREDIENTE_COMBO_PRODUCTO){
chk1=new ObjetoCheckBox();
chk1.name=this.idChkIngredienteProducto+_223;
chk1.onclick="gblPag.clickIngredienteProductoPC("+_223+")";
td1.text=chk1.getHTML()+"&nbsp;"+img1.getHTML()+"&nbsp;Desea configurar este producto?";
}
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="30";
td1.align="right";
img1=new ObjetoImg();
img1.src=this.rutaFlecha2;
img1.width="22";
img1.height="27";
img1.hspace="2";
td1.text=img1.getHTML();
tr1.arrayTd.push(td1);
_226.arrayTr.push(tr1);
return _226.getHTML();
}
function getHtmlOpcionPC(_22b,_22c,_22d,_22e,_22f){
var _230;
var tr1;
var td1;
var img1;
var rdb1;
var chk1;
_230=new ObjetoTable();
_230.width="750";
_230.border="0";
_230.cellspacing="0";
_230.cellpadding="0";
tr1=new ObjetoTr();
td1=new ObjetoTd();
td1.height="22";
td1.align="center";
td1.width="15";
td1.text="<b class=\"textoRojo\">&middot;</b>";
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="400";
td1.align="left";
rdb1=new ObjetoRadio();
rdb1.name=this.nameRdbIngredienteOpcion+_22d;
rdb1.onclick="gblPag.clickOpcionIngredienteOpcionPC("+_22d+","+_22e+")";
td1.text=rdb1.getHTML()+"<span id=\""+this.idSpanIngredienteOpcion+_22d+"_"+_22e+"\" >"+_22b+"</span>";
tr1.arrayTd.push(td1);
td1=new ObjetoTd();
td1.width="335";
td1.align="right";
img1=new ObjetoImg();
img1.src=this.rutaFlecha1;
img1.width="13";
img1.height="14";
chk1=new ObjetoCheckBox();
chk1.name=this.idChkIngredienteOpcion+_22d;
chk1.id=this.idChkIngredienteOpcion+_22d+"_"+_22e;
chk1.onclick="gblPag.clickIngredienteOpcionPC("+_22d+","+_22e+","+_22f+")";
td1.text=chk1.getHTML()+"&nbsp;"+img1.getHTML()+"&nbsp;Desea personalizar este producto?";
tr1.arrayTd.push(td1);
if(!_22c){
_230.arrayTr.push(tr1);
tr1=new ObjetoTr();
td1=new ObjetoTd();
td1.colspan="3";
td1.height="3";
td1.align="center";
td1.background=this.rutaLinea4;
tr1.arrayTd.push(td1);
}
_230.arrayTr.push(tr1);
return _230.getHTML();
}
function getHtmlMensajePC(_236){
var _237;
var tr1;
var td1;
var img1;
var chk1;
_237=new ObjetoTable();
_237.width="750";
_237.border="0";
_237.cellspacing="0";
_237.cellpadding="0";
tr1=new ObjetoTr();
tr1.estilo="pestanaDetalleProductoGeneral";
td1=new ObjetoTd();
td1.height="20";
td1.align="left";
td1.valign="middle";
td1.width="100%";
img1=new ObjetoImg();
img1.src=this.rutaFlecha1;
img1.width="13";
img1.height="14";
chk1=new ObjetoCheckBox();
chk1.id=this.idChkIngredienteProductoParte+_236;
chk1.onclick="gblPag.clickIngredienteProductoPartePC("+_236+")";
td1.text=chk1.getHTML()+img1.getHTML()+"&nbsp;Si desea, configura cada una de los productos por separado";
tr1.arrayTd.push(td1);
_237.arrayTr.push(tr1);
return _237.getHTML();
}
function getHtmlSeccionContenidoPC(_23c,_23d,_23e){
var html="";
if(_23c>1){
html=this.getHtmlMensajePC(_23d);
html=html+"<div id=\""+this.idDivTabCombo+_23d+"\" style=\"display:none\"></div>";
}
if(_23e==PRODUCTO_NORMAL_ESTATICO||_23e==PRODUCTO_NORMAL_DINAMICO){
html=html+"<div id=\""+this.idDivSeccionAtributoPrincipal+_23d+"\"></div>";
html=html+"<div id=\""+this.idDivSeccionAtributoSecundario+_23d+"\"></div>";
html=html+"<div id=\""+this.idDivSeccionIngrediente+_23d+"\"></div>";
html=html+"<div id=\""+this.idDivSeccionIngredienteParte+_23d+"\" style=\"display:none\"></div>";
}
if(_23e==PRODUCTO_COMPUESTO_PARTES){
html=html+"<div id=\""+this.idDivSeccionAtributoPrincipal+_23d+"\"></div>";
html=html+"<div id=\""+this.idDivSeccionAtributoSecundario+_23d+"\"></div>";
html=html+"<div id=\""+this.idDivSeccionParte+_23d+"\"></div>";
html=html+"<div id=\""+this.idDivSeccionIngrediente+_23d+"\"></div>";
html=html+"<div id=\""+this.idDivSeccionIngredienteParte+_23d+"\" style=\"display:none\"></div>";
}
return html;
}
function clickOpcionIngredienteOpcionPC(_240,_241){
var _242=document.getElementsByName(this.idChkIngredienteOpcion+_240);
var span;
var num;
num=_242.length;
for(var i=0;i<num;i++){
_242[i].checked=false;
span=document.getElementById(this.idSpanIngredienteOpcion+_240+"_"+i);
span.className="";
if(i==_241){
_242[i].disabled=false;
span.className="textoNegrita";
setInvisible(this.idDivCombo+_240);
}else{
_242[i].disabled=true;
}
}
this.productoConfigurado.arrayIngredienteProductoCombo[_240].ingredienteOpcion=this.producto.arrayIngredienteProductoCombo[_240].arrayIngredienteOpcion[_241];
this.productoConfigurado.arrayIngredienteProductoCombo[_240].arrayProductoConfigurado=this.productoConfigurado.arrayIngredienteProductoCombo[_240].arrayArrayProductoConfigurado[_241];
this.pintarValorAtributoSecundarioTemporal(_240,0);
if(!esVisible(this.idDivAtributoSecundario+_240)){
document.getElementById(this.idDivAtributoSecundarioTemp+_240).innerHTML="";
setInvisible(this.idDivAtributoSecundarioTemp+_240);
}
this.pintarPrecio();
}
function clickIngredienteOpcionPC(_246,_247,_248){
var chk=document.getElementById(this.idChkIngredienteOpcion+_246+"_"+_247);
var div;
var _24b=0;
if(chk.checked){
document.getElementById(this.idDivAtributoSecundarioTemp+_246).innerHTML="";
setInvisible(this.idDivAtributoSecundarioTemp+_246);
div=document.getElementById(this.idDivCombo+_246);
div.innerHTML=this.getHtmlSeccionContenidoPC(_246,_248);
setVisible(this.idDivCombo+_246);
var _24c=this.productoConfigurado.arrayIngredienteProductoCombo[_246].ingredienteOpcion.cantidad;
var _24d=this.productoConfigurado.arrayIngredienteProductoCombo[_246].arrayProductoConfigurado[_24b];
this.pintarSeccionIngredientePC(_24d,_24c,_246,_24b);
this.productoConfigurado.arrayIngredienteProductoCombo[_246].indicadorProductoConfigurado=HABILITADO;
}else{
this.pintarValorAtributoSecundarioTemporal(_246,_24b);
if(!esVisible(this.idDivAtributoSecundario+_246)){
document.getElementById(this.idDivAtributoSecundarioTemp+_246).innerHTML="";
setInvisible(this.idDivAtributoSecundarioTemp+_246);
}
setInvisible(this.idDivCombo+_246);
this.productoConfigurado.arrayIngredienteProductoCombo[_246].indicadorProductoConfigurado=INHABILITADO;
}
this.pintarPrecio();
}
function clickIngredienteProductoPC(_24e){
var chk=document.getElementById(this.idChkIngredienteProducto+_24e);
var _250=0;
if(chk.checked){
setVisible(this.idDivCombo+_24e);
var _251=this.productoConfigurado.arrayIngredienteProductoCombo[_24e].ingredienteProducto.cantidad;
var _252=this.productoConfigurado.arrayIngredienteProductoCombo[_24e].arrayProductoConfigurado[_250];
this.pintarSeccionIngredientePC(_252,_251,_24e,_250);
this.productoConfigurado.arrayIngredienteProductoCombo[_24e].indicadorProductoConfigurado=HABILITADO;
document.getElementById(this.idDivAtributoSecundarioTemp+_24e).innerHTML="";
setInvisible(this.idDivAtributoSecundarioTemp+_24e);
}else{
this.pintarValorAtributoSecundarioTemporal(_24e,_250);
if(!esVisible(this.idDivAtributoSecundario+_24e)){
document.getElementById(this.idDivAtributoSecundarioTemp+_24e).innerHTML="";
setInvisible(this.idDivAtributoSecundarioTemp+_24e);
}
setInvisible(this.idDivCombo+_24e);
this.productoConfigurado.arrayIngredienteProductoCombo[_24e].indicadorProductoConfigurado=INHABILITADO;
}
this.pintarPrecio();
}
function clickIngredienteProductoPartePC(_253){
var chk=document.getElementById(this.idChkIngredienteProductoParte+_253);
var _255=0;
if(chk.checked){
setVisible(this.idDivTabCombo+_253);
this.productoConfigurado.arrayIngredienteProductoCombo[_253].indicadorProductoSeparado=HABILITADO;
}else{
setInvisible(this.idDivTabCombo+_253);
this.clickTabPC(_253,_255);
this.productoConfigurado.arrayIngredienteProductoCombo[_253].indicadorProductoSeparado=INHABILITADO;
}
this.pintarPrecio();
}
function pintarSeccionIngredientePC(_256,_257,_258,_259){
document.getElementById(this.idDivCombo+_258).innerHTML=this.getHtmlSeccionContenidoPC(_257,_258,_256.producto.codigoTipoProducto);
this.pintarIngredientePC(_256,_257,_258,_259);
}
function pintarIngredientePC(_25a,_25b,_25c,_25d){
var html="";
var _25f;
var _260;
var _261=_25a.producto;
if(_25b>1){
this.pintarTabPC(_261.nombre,_25b,_25c,_25d);
}
if(_261.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO||_261.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
html=this.getHtmlSeccionTitulo1("Selecciona el Tama\xf1o del producto :")+"<div id=\""+this.idDivAtributoPrincipal+_25c+"\"></div>";
document.getElementById(this.idDivSeccionAtributoPrincipal+_25c).innerHTML=html;
html=this.getHtmlSeccionTitulo1("Selecciona las siguientes opciones :")+"<div id=\""+this.idDivAtributoSecundario+_25c+"\"></div>";
document.getElementById(this.idDivSeccionAtributoSecundario+_25c).innerHTML=html;
if(_261.arrayIngrediente!=null||_261.arrayIngredienteAdicional!=null){
html=this.getHtmlSeccionTitulo2("Si deseas, agr\xe9gale o qu\xedtale Ingredientes a tu pedido :","chk_"+this.idDivSeccionIngrediente+_25c,"gblPag.clickCheckSeccionIngrediente("+_25c+","+_25d+")");
html=html+"<div id=\""+this.idDivIngrediente+_25c+"\" style=\"display:none\"></div>";
document.getElementById(this.idDivSeccionIngrediente+_25c).innerHTML=html;
html=this.getHtmlSeccionTitulo2("Si deseas, selecciona Ingredientes adicionales por mitades :","chk_"+this.idDivSeccionIngredienteParte+_25c,"gblPag.clickCheckSeccionIngredienteParte("+_25c+","+_25d+")");
html=html+"<div id=\""+this.idDivIngredienteParte+_25c+"\" style=\"display:none\"></div>";
document.getElementById(this.idDivSeccionIngredienteParte+_25c).innerHTML=html;
html=this.getHtmlSeccionIngrediente(0,_25c,_25d);
document.getElementById(this.idDivIngrediente+_25c).innerHTML=html;
}
this.pintarValorAtributoPrincipal(_261,_25c,_25d);
_25f=0;
this.pintarIngredienteAdicional(_261.arrayIngredienteAdicional,_25f,_25c,_25d);
_260=_25a.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
seleccionaRadioPorNombrePorValor(this.nameRdbAtributoPrincipal+_25c,_260);
this.clickAtributoPrincipal(_25c,_25d);
if(_25a.indicadorIngrediente==HABILITADO){
getFormElementById("chk_"+this.idDivSeccionIngrediente+_25c).checked=true;
this.clickCheckSeccionIngrediente(_25c,_25d);
if(_25a.indicadorIngredienteParte==HABILITADO){
getFormElementById("chk_"+this.idDivSeccionIngredienteParte+_25c).checked=true;
this.clickCheckSeccionIngredienteParte(_25c,_25d);
}else{
setInvisible(this.idDivSeccionIngredienteParte+_25c);
}
}else{
setInvisible(this.idDivSeccionIngredienteParte+_25c);
}
}else{
html=this.getHtmlSeccionTitulo1("Selecciona el Tama\xf1o del producto :")+"<div id=\""+this.idDivAtributoPrincipal+_25c+"\"></div>";
document.getElementById(this.idDivSeccionAtributoPrincipal+_25c).innerHTML=html;
html=this.getHtmlSeccionTitulo1("Selecciona las siguientes opciones :")+"<div id=\""+this.idDivAtributoSecundario+_25c+"\"></div>";
document.getElementById(this.idDivSeccionAtributoSecundario+_25c).innerHTML=html;
html=this.getHtmlSeccionTitulo1("Seleccione cada Parte:");
html=html+"<div id=\""+this.idDivParte+_25c+"\" style=\"display:none\" ></div>";
document.getElementById(this.idDivSeccionParte+_25c).innerHTML=html;
html=this.getHtmlSeccionTitulo2("Si deseas, agr\xe9gale o qu\xedtale Ingredientes a tu pedido :","chk_"+this.idDivSeccionIngrediente+_25c,"gblPag.clickCheckSeccionIngredientePCP("+_25c+","+_25d+")");
html=html+"<div id=\""+this.idDivTab+_25c+"\" style=\"display:none\" ></div>";
html=html+"<div id=\""+this.idDivIngredienteParte+_25c+"\" style=\"display:none\" ></div>";
document.getElementById(this.idDivSeccionIngrediente+_25c).innerHTML=html;
this.pintarValorAtributoPrincipal(_261,_25c,_25d);
_260=_25a.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
seleccionaRadioPorNombrePorValor(this.nameRdbAtributoPrincipal+_25c,_260);
this.clickAtributoPrincipalPCP(_25c,_25d);
if(_25a.indicadorIngrediente==HABILITADO){
getFormElementById("chk_"+this.idDivSeccionIngrediente+_25c).checked=true;
this.clickCheckSeccionIngredientePCP(_25c,_25d);
}else{
setInvisible(this.idDivSeccionIngredienteParte+_25c);
setInvisible(this.idDivTab+_25c);
}
}
}
function getTabHTMLPC(_262,_263,_264,_265){
var td=new ObjetoTd();
td.align="center";
td.width="33%";
td.height="20";
td.onclick="gblPag.clickTabPC("+_262+","+_263+")";
if(_264){
td.estilo="pestanaInteriorTablaOn";
}else{
td.estilo="pestanaInteriorTablaOff";
}
td.text=_265+"  "+(_263+1);
return td.getHTML();
}
function clickTabPC(_267,_268){
var _269;
if(this.productoConfigurado.arrayIngredienteProductoCombo[_267].ingredienteProducto!=null){
_269=this.productoConfigurado.arrayIngredienteProductoCombo[_267].ingredienteProducto.cantidad;
}else{
_269=this.productoConfigurado.arrayIngredienteProductoCombo[_267].ingredienteOpcion.cantidad;
}
var _26a=this.productoConfigurado.arrayIngredienteProductoCombo[_267].arrayProductoConfigurado[_268];
this.pintarIngredientePC(_26a,_269,_267,_268);
this.pintarPrecio();
}
function pintarTabPC(_26b,_26c,_26d,_26e){
var _26f=new ObjetoTable();
var num;
var html;
var td;
var tr;
var _274;
var _275=parseInt((_26e)/3);
var _276;
_26f.width="750";
_26f.cellspacing="0";
_26f.cellpadding="0";
_26f.estilo="fondoSubTitulosTablasInternas";
_276=new ObjetoTr();
td=new ObjetoTd();
td.height="2";
td.colspan="3";
td.estilo="fondoTituloListadoPlatos";
_276.arrayTd.push(td);
for(var i=0;i<_26c;i++){
if((i)%3==0){
tr=new ObjetoTr();
if(parseInt((i)/3)==_275){
_274=tr;
}else{
_26f.arrayTr.push(tr);
_26f.arrayTr.push(_276);
}
}
if(_26e==i){
tr.arrayTdHtml.push(this.getTabHTMLPC(_26d,i,true,_26b));
}else{
tr.arrayTdHtml.push(this.getTabHTMLPC(_26d,i,false,_26b));
}
}
if(_26c<=3){
_26f.arrayTr.push(tr);
}else{
_26f.arrayTr.push(_274);
}
_26f.arrayTr.push(_276);
document.getElementById(this.idDivTabCombo+_26d).innerHTML=_26f.getHTML();
}
function pintarValorAtributoSecundarioTemporal(_278,_279){
var _27a=null;
var _27b=null;
if(this.producto.codigoTipoProducto==PRODUCTO_COMBO){
_27a=this.productoConfigurado.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC(_278,_279);
_27b=_27a.producto;
}else{
_27a=this.productoConfigurado;
_27b=this.producto;
}
if(getObjetoHtmlPorId(this.idDivCombo+_278)!=null){
document.getElementById(this.idDivCombo+_278).innerHTML="";
}
html=this.getHtmlSeccionTitulo1("Selecciona las siguientes opciones :")+"<div id=\""+this.idDivSeccionAtributoSecundario+_278+"\"><div id=\""+this.idDivAtributoSecundario+_278+"\"></div></div>";
document.getElementById(this.idDivAtributoSecundarioTemp+_278).innerHTML=html;
this.pintarValorAtributoSecundario(_27a,_278,_279);
if(getObjetoHtmlPorId(this.idDivSeccionAtributoSecundario+_278)!=null){
setVisible(this.idDivAtributoSecundarioTemp+_278);
}else{
setInvisible(this.idDivAtributoSecundarioTemp+_278);
}
_27a.migrarAtributoSecundario(_27b);
this.cargarValorAtributoSecundario(_27a,_278);
}
function irRestaurantePNE(_27c){
prepararActionStrutsFormFCVstore("frmAccionMenu",this.rutaIrRestauranteRST,"contentRST","_parent");
getFormElement("frmAccionMenu","codigoRestaurante").value=this.restaurante.codigo;
try{
getFormElement("frmAccionMenu","codigoRestauranteHome").value=this.restaurante.codigo;
}
catch(error){
}
getForm("frmAccionMenu").submit();
}
function precargarImagenesPNE(){
var _27d="";
var num;
if(this.producto.arrayIngrediente!=null){
for(var i=0;i<num;i++){
_27d=_27d+this.producto.arrayIngrediente[i].componente.rutaLogoReducido+",";
}
}
if(this.producto.arrayIngredienteAdicional!=null){
for(var i=0;i<num;i++){
_27d=_27d+this.producto.arrayIngredienteAdicional[i].componente.rutaLogoReducido+",";
}
}
if(this.producto.arrayOtroAdicional!=null){
for(var i=0;i<num;i++){
_27d=_27d+this.producto.arrayOtroAdicional[i].componente.rutaLogoReducido+",";
}
}
_27d=_27d.substr(0,_27d.length-1);
_27d="MM_preloadImages("+_27d+")";
eval(_27d);
}
PaginaProducto.prototype.clickCategoria=clickCategoriaPNE;
PaginaProducto.prototype.precargarImagenes=precargarImagenesPNE;
PaginaProducto.prototype.irRestaurante=irRestaurantePNE;
PaginaProducto.prototype.clickOtroAdicional=clickOtroAdicionalPNE;
PaginaProducto.prototype.getOtroAdicional=getOtroAdicionalPNE;
PaginaProducto.prototype.pintarValorAtributoSecundarioTemporal=pintarValorAtributoSecundarioTemporal;
PaginaProducto.prototype.pintarSeccionIngredientePC=pintarSeccionIngredientePC;
PaginaProducto.prototype.clickTabPC=clickTabPC;
PaginaProducto.prototype.getTabHTMLPC=getTabHTMLPC;
PaginaProducto.prototype.pintarTabPC=pintarTabPC;
PaginaProducto.prototype.pintarIngredientePC=pintarIngredientePC;
PaginaProducto.prototype.clickOpcionIngredienteOpcionPC=clickOpcionIngredienteOpcionPC;
PaginaProducto.prototype.clickIngredienteProductoPartePC=clickIngredienteProductoPartePC;
PaginaProducto.prototype.clickIngredienteProductoPC=clickIngredienteProductoPC;
PaginaProducto.prototype.clickIngredienteOpcionPC=clickIngredienteOpcionPC;
PaginaProducto.prototype.getHtmlSeccionContenidoPC=getHtmlSeccionContenidoPC;
PaginaProducto.prototype.getHtmlMensajePC=getHtmlMensajePC;
PaginaProducto.prototype.getHtmlOpcionPC=getHtmlOpcionPC;
PaginaProducto.prototype.pintarIngredienteComboPC=pintarIngredienteComboPC;
PaginaProducto.prototype.getHtmlSeccionTitulo2PC=getHtmlSeccionTitulo2PC;
PaginaProducto.prototype.pintarPaginaPC=pintarPaginaPC;
PaginaProducto.prototype.pintarSeccionPC=pintarSeccionPC;
PaginaProducto.prototype.cargarProductoConfiguradoPC=cargarProductoConfiguradoPC;
PaginaProducto.prototype.restituirOriginalPCP=restituirOriginalPCP;
PaginaProducto.prototype.eliminarAgregadoPCP=eliminarAgregadoPCP;
PaginaProducto.prototype.pintarIngredientePartePCP=pintarIngredientePartePCP;
PaginaProducto.prototype.clickCheckSeccionIngredientePCP=clickCheckSeccionIngredientePCP;
PaginaProducto.prototype.cargarIngredienteCompuestoPCP=cargarIngredienteCompuestoPCP;
PaginaProducto.prototype.getCodigoIngredienteCompuestoPCP=getCodigoIngredienteCompuestoPCP;
PaginaProducto.prototype.clickIngredienteCompuestoPCP=clickIngredienteCompuestoPCP;
PaginaProducto.prototype.clickTabPCP=clickTabPCP;
PaginaProducto.prototype.pintarTabPCP=pintarTabPCP;
PaginaProducto.prototype.getTabHTMLPCP=getTabHTMLPCP;
PaginaProducto.prototype.cargarProductoConfiguradoPCP=cargarProductoConfiguradoPCP;
PaginaProducto.prototype.getIngredienteCompuestoParteHTMLPCP=getIngredienteCompuestoParteHTMLPCP;
PaginaProducto.prototype.clickAtributoPrincipalPCP=clickAtributoPrincipalPCP;
PaginaProducto.prototype.pintarIngredienteCompuestoPCP=pintarIngredienteCompuestoPCP;
PaginaProducto.prototype.pintarPaginaPCP=pintarPaginaPCP;
PaginaProducto.prototype.pintarSeccionPCP=pintarSeccionPCP;
PaginaProducto.prototype.clickEnviarCarrito=clickEnviarCarritoPNE;
PaginaProducto.prototype.pintarCantidad=pintarCantidadPNE;
PaginaProducto.prototype.pintarOtroAdicional=pintarOtroAdicionalPNE;
PaginaProducto.prototype.pintarRelacionado=pintarRelacionadoPNE;
PaginaProducto.prototype.eliminarComplementario=eliminarComplementarioPNE;
PaginaProducto.prototype.agregarComplementario=agregarComplementarioPNE;
PaginaProducto.prototype.getComplementarioSeleccionadoHTML=getComplementarioSeleccionadoHTMLPNE;
PaginaProducto.prototype.getComplementarioHTML=getComplementarioHTMLPNE;
PaginaProducto.prototype.pintarComplementario=pintarComplementarioPNE;
PaginaProducto.prototype.pintarComplementarioSeleccionado=pintarComplementarioSeleccionadoPNE;
PaginaProducto.prototype.getTituloComplementarioHTML=getTituloComplementarioHTMLPNE;
PaginaProducto.prototype.eliminarIngredienteAdicionalParte=eliminarIngredienteAdicionalPartePNE;
PaginaProducto.prototype.getHtmlSeccionTitulo1=getHtmlSeccionTitulo1PNE;
PaginaProducto.prototype.getHtmlSeccionTitulo2=getHtmlSeccionTitulo2PNE;
PaginaProducto.prototype.getHtmlSeccionTitulo2PDin=getHtmlSeccionTitulo2PND;
PaginaProducto.prototype.getHtmlSeccionTitulo3=getHtmlSeccionTitulo3PNE;
PaginaProducto.prototype.clickCheckSeccionIngrediente=clickCheckSeccionIngredientePNE;
PaginaProducto.prototype.clickCheckSeccionIngredienteParte=clickCheckSeccionIngredientePartePNE;
PaginaProducto.prototype.clickCheckSeccionComplementario=clickCheckSeccionComplementarioPNE;
PaginaProducto.prototype.pintarDatosProducto=pintarDatosProductoPNE;
PaginaProducto.prototype.pintarValorAtributoPrincipal=pintarValorAtributoPrincipalPNE;
PaginaProducto.prototype.pintarSeccionPNormal=pintarSeccionPNormal;
PaginaProducto.prototype.pintarValorAtributoSecundario=pintarValorAtributoSecundarioPNE;
PaginaProducto.prototype.pintarComboAtributoSecundario=pintarComboAtributoSecundarioPNE;
PaginaProducto.prototype.clickAtributoPrincipal=clickAtributoPrincipalPNE;
PaginaProducto.prototype.getCodigoValorAtributoPrincipal=getCodigoValorAtributoPrincipalPNE;
PaginaProducto.prototype.clickAtributoSecundario=clickAtributoSecundarioPNE;
PaginaProducto.prototype.getValorAtributoSecundario=getValorAtributoSecundarioPNE;
PaginaProducto.prototype.cargarValorAtributoSecundario=cargarValorAtributoSecundarioPNE;
PaginaProducto.prototype.getHtmlSeccionIngrediente=getHtmlSeccionIngredientePNE;
PaginaProducto.prototype.pintarIngredienteAdicional=pintarIngredienteAdicionalPNE;
PaginaProducto.prototype.getCodigoAdicional=getCodigoAdicionalPNE;
PaginaProducto.prototype.pintarAdicionalSeleccionado=pintarAdicionalSeleccionadoPNE;
PaginaProducto.prototype.pintarImgAdicionalSeleccionado=pintarImgAdicionalSeleccionadoPNE;
PaginaProducto.prototype.agregarIngredienteAdicional=agregarIngredienteAdicionalPNE;
PaginaProducto.prototype.pintarAgregado=pintarAgregadoPNE;
PaginaProducto.prototype.getTituloElementoAgregadoHTML=getTituloElementoAgregadoHTMLPNE;
PaginaProducto.prototype.getElementoAgregadoHTML=getElementoAgregadoHTMLPNE;
PaginaProducto.prototype.eliminarAgregado=eliminarAgregadoPNE;
PaginaProducto.prototype.restituirOriginal=restituirOriginalPNE;
PaginaProducto.prototype.cargarProductoConfiguradoPNE=cargarProductoConfiguradoPNE;
PaginaProducto.prototype.pintarPagina=pintarPaginaPNE;
PaginaProducto.prototype.pintarPrecio=pintarPrecioPNE;
PaginaProducto.prototype.pintarParte=pintarPartePNE;
PaginaProducto.prototype.getTituloParteHTML=getTituloParteHTMLPNE;
PaginaProducto.prototype.pintarIngredienteParte=pintarIngredientePartePNE;
PaginaProducto.prototype.agregarIngredienteAdicionalParte=agregarIngredienteAdicionalPartePNE;
PaginaProducto.prototype.getHtmlBorde=getHtmlBordeComun;
PaginaProducto.prototype.pintarErrorAtributoSecundario=pintarErrorAtributoSecundarioPNE;
PaginaProducto.prototype.pintarErrorIngredienteCompuesto=pintarErrorIngredienteCompuestoPCP;
PaginaProducto.prototype.pintarCategoria=pintarCategoriaPNE;
PaginaProducto.prototype.buscarRamaCategoriaArbolPorCodigo=buscarRamaCategoriaArbolPorCodigoPNE;
PaginaProducto.prototype.pintarGlosaPNE=pintarGlosaPNE;


