Array.prototype.inArray = function (value){
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] === value) {
		return true;
		}
	}
	return false;
};

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function recuperarClave(base) {
	window.open(base+"/forgotPassword.aspx", "myWindow", "status = 1, height = 163, width = 372, resizable = 0" );
}


function error_alert(errorcode){
	switch(errorcode){
			case 1:
				alert('Usuario o contrasena incorrectos');
			break;
			case 2:
				alert('Hubo un error en la votación. Inténtelo en unos minutos');
			break;
			case 3:
				alert('En este momento no se pueden realizar compras en el portal. Contáctenos para más información.');
			break;
			case 4:
				alert('Se produjo un error en el proceso de pago. Contáctenos para más información.');
			break;
			case 5:
				alert('El producto seleccionado no posee el stock suficiente.');
			break;
			case 6:
				alert('El nombre de usuario ya existe');
			break;
			case 7:
				alert('Hubo un error al intentar actualizar sus datos');
			break;
			case 8:
				alert('Error en el costo de envío');
			break;
			case 9:
				alert('El registro ha sido removido o se encuentra deshabilitado');
			break;
			case 10:
				alert('Su cuenta se encuentra inactiva. Contáctenos para más información.');
			break;
			case 666:
				alert('Se ha producido un error');
			break;
	}
	if(errorcode>0){
	document.location.reload();
	}
}

var consultaMode=0;
function showConsulta(){
	var formulario_consulta = document.getElementById('contact_form');
	if(consultaMode==0){
		formulario_consulta.style.display="inline";
		consultaMode=1;
	}else{
		formulario_consulta.style.display="none";
		consultaMode=0;
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
/*
function MM_setTextOfTextfield(formulario,objId,x,newText,checkText) { //v9.0
  with (document){
	if(getElementById){
		  var obj = document.forms[formulario][objId];
	}
	if(obj && obj.value==checkText){
		obj.value = newText;
	}
  }
}
*/
function MM_setTextOfTextfield(formulario,objId,x,newText,checkText) { //v9.0
  with (document){
	if(getElementById){
		  var obj = document.forms[formulario][objId];
	}
	if(obj && obj.value==checkText){
		obj.value = newText;
	}
  }
}

function MM_resetField(formulario,objId,checkText) { //v9.0
  with (document){
	if(getElementById){
		  var obj = document.forms[formulario][objId];
	}
	if(obj && obj.value==""){
		obj.value = checkText;
	}
  }
}

function getElementsByClassName(clsName){
   var i;
   var matches=new Array();
   var els = document.getElementsByTagName('*');
   for(i=0; i<els.length; i++) {
      if(els.item(i).className==clsName) {
         matches.push(els.item(i));
      }
   }
   return matches;
}

function openmenu(cual,url){
			if(categoriaexpand && categoriaexpand!=0 && categoriaexpand!=cual){
				var occb = getElementsByClassName('padre_'+categoriaexpand);
				if(occb && occb.length>0){				
					for(i=0;i<occb.length;i++){
						occb[i].style.display="none";				
					}
				}				
			}
			var occ = getElementsByClassName('padre_'+cual);
			if(occ && occ.length>0){				
				for(i=0;i<occ.length;i++){
					occ[i].style.display="inline-block";				
				}
				categoriaexpand=cual;
			}else{
				document.location.href=url;	
			}

}


function __setKw(){
	document.getElementById('Keywords').value = document.getElementById('Name').value;
}
function setCategoria(valor,nombre){
	document.getElementById('textsearch').innerHTML = nombre;
	document.getElementById('nav').style.display = "none";
	document.getElementById('Id').value = valor;
	setTimeout( function(){	document.getElementById('nav').style.display = "inline";},2);
	//document.buscador.Name.focus();
}
function setHidden(campo,valor,lista,nombre){
	document.getElementById('nav'+lista).style.display = "none";
	document.getElementById(campo).value = valor;
	document.getElementById('textsearch_'+lista).innerHTML = "<font color='#000000'><b>"+nombre+"</b></font>";
	setTimeout( function(){	document.getElementById('nav'+lista).style.display = "inline";},2);
}

function inspector(el) {
var str ="";
for (var i in el){
	str+= i + ": " + el.getAttribute(i) + "<br>";
}
document.write(str);
}

function qty_add(sumar,minStock,stock){
	var cantidad_form = document.getElementById('Quantity');
	var cantidad = parseInt(cantidad_form.value);
	if(sumar > 0){
		if(stock > cantidad){
			cantidad_form.value=cantidad+1;
		}		
	}else{
		if(cantidad > minStock && cantidad > 1){
			cantidad_form.value=cantidad-1;
		}
	}	
}


function MM_validateFormSuscribe() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormSuscribe.arguments;
    for (i=0; i<(args.length-2); i+=3){
		test=args[i+2];
		val=document.forms['susc'].elements[(args[i])];	
		if(val.value=="nombre y apellido" || val.value=="email"){			
			valor="";			
		}else{
			valor=val.value;	
		}
		if (val){
			nm=val.name;
			if(nm=="suscriberFirstName"){			
				nm="nombre y apellido";	
			}
			if(nm=="suscriberName"){			
				nm="email";	
			}
			if((val=valor)!=""){
				if (test.indexOf('isEmail')!=-1) {
					p=val.indexOf('@');
					if (p<1 || p==(val.length-1)) errors+='- '+val+' no es un email válido.\n';
				}else if (test!='R') {
					num = parseFloat(val);
					if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) {
						p=test.indexOf(':');
						min=test.substring(8,p);
						max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					}
				}
			}else if(test.charAt(0) == 'R')errors += '- '+nm+' debe estar completo.\n';
		}
    }
	if (errors) alert('Error al enviar el formulario:\n'+errors);
    document.MM_returnValue = (errors == '');
} }



function MM_validateFormLogin() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormLogin.arguments;
    for (i=0; i<(args.length-2); i+=3){
		test=args[i+2];
		val=document.forms['login'].elements[(args[i])];	
		if(val.value=="usuario" || val.value=="password"){			
			valor="";			
		}else{
			valor=val.value;	
		}
		if (val){
			nm=val.name;
			if(nm=="customerName"){			
				nm="usuario";	
			}
			if(nm=="customerPassword"){			
				nm="password";	
			}
			if((val=valor)!=""){
				if (test.indexOf('isEmail')!=-1) {
					p=val.indexOf('@');
					if (p<1 || p==(val.length-1)) errors+='- '+val+' no es un email válido.\n';
				}else if (test!='R') {
					num = parseFloat(val);
					if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) {
						p=test.indexOf(':');
						min=test.substring(8,p);
						max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					}
				}
			}else if(test.charAt(0) == 'R')errors += '- '+nm+' debe estar completo.\n';
		}
    }
	if (errors) alert('Error al enviar el formulario:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

function MM_validateFormLogin2() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormLogin2.arguments;
    for (i=0; i<(args.length-2); i+=3){
		test=args[i+2];
		val=document.forms['login2'].elements[(args[i])];	
		if(val.value=="usuario" || val.value=="password"){			
			valor="";			
		}else{
			valor=val.value;	
		}
		if (val){
			nm=val.name;
			if(nm=="customerName"){			
				nm="usuario";	
			}
			if(nm=="customerPassword"){			
				nm="password";	
			}
			if((val=valor)!=""){
				if (test.indexOf('isEmail')!=-1) {
					p=val.indexOf('@');
					if (p<1 || p==(val.length-1)) errors+='- '+val+' no es un email válido.\n';
				}else if (test!='R') {
					num = parseFloat(val);
					if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) {
						p=test.indexOf(':');
						min=test.substring(8,p);
						max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					}
				}
			}else if(test.charAt(0) == 'R')errors += '- '+nm+' debe estar completo.\n';
		}
    }
	if (errors) alert('Error al enviar el formulario:\n'+errors);
    document.MM_returnValue = (errors == '');
} }



function MM_validateFormContact() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormContact.arguments;
    for (i=0; i<(args.length-2); i+=3){
		test=args[i+2];
		val=document.forms['consulta'].elements[(args[i])];	
		/*
		if(val.value=="nombre y apellido" || val.value=="email"){			
			valor="";			
		}else{
			valor=val.value;	
		}
		*/
		valor=val.value;
		if (val){
			nm=val.name;
			if(nm=="txtFirstName"){			
				nm="Nombre y Apellido";	
			}
			if(nm=="txtEmail"){			
				nm="E-mail";	
			}
			if(nm=="Comentario"){			
				nm="Comentario";	
			}
			if((val=valor)!=""){
				if (test.indexOf('isEmail')!=-1) {
					p=val.indexOf('@');
					if (p<1 || p==(val.length-1)) errors+='- '+val+' no es un email válido.\n';
				}else if (test!='R') {
					num = parseFloat(val);
					if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) {
						p=test.indexOf(':');
						min=test.substring(8,p);
						max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					}
				}
			}else if(test.charAt(0) == 'R')errors += '- '+nm+' debe estar completo.\n';
		}
    }
	if (errors) alert('Error al enviar el formulario:\n'+errors);
    document.MM_returnValue = (errors == '');
} }


function MM_validateFormComment() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormComment.arguments;
    for (i=0; i<(args.length-2); i+=3){
		test=args[i+2];
		val=document.forms['myform'].elements[(args[i])];	
		
		if(val.value=="nombre y apellido" || val.value=="email"){			
			valor="";			
		}else{
			valor=val.value;	
		}
		if (val){
			nm=val.name;
			if(nm=="postName"){			
				nm="nombre";	
			}
			if(nm=="postMail"){			
				nm="email";	
			}
			if(nm=="postText"){			
				nm="comentario";	
			}
			if((val=valor)!=""){
				if (test.indexOf('isEmail')!=-1) {
					p=val.indexOf('@');
					if (p<1 || p==(val.length-1)) errors+='- '+val+' no es un email válido.\n';
				}else if (test!='R') {
					num = parseFloat(val);
					if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) {
						p=test.indexOf(':');
						min=test.substring(8,p);
						max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					}
				}
			}else if(test.charAt(0) == 'R')errors += '- '+nm+' debe estar completo.\n';
		}
    }
	if(errors){
		alert(errors);
	}else{
		document.forms['myform'].submit();
	}
    //document.MM_returnValue = (errors == '');
} }


function MM_validateFormServices() { //v4.0

  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormServices.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
		
		
		if(val.value=="Número de Orden" || val.value=="N&uacute;mero de Orden"){			
			valor="";
			terror="Por favor complete el número de orden";
		}else if(val.value=="buscar..."){			
			valor="";
			terror="Por favor ingrese el texto a buscar";
		}else{
			valor=val.value;
		}
		
		//alert(valor);
		
      if (val) { nm=val.name; if ((val=valor)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert(terror);
    document.MM_returnValue = (errors == '');
} }

function MM_validateFormReg() { //v4.0
	error_text="Error al enviar el formulario";	
	error_email="no es un email válido";
	error_pie="debe estar completo";
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormReg.arguments;	
	var k = 0;
    for (i=0; i<(args.length-2); i+=3){
		test=args[i+2];
		val=document.forms['f_registracion'][args[i]];
		valor=val.value;
		
		if (val){
			nm=val.name;			
			if(nm=="customerName"){			
				nm="email";	
			}
			if(nm=="customerPassword"){			
				nm="password";	
			}
			if(nm=="customerCompany"){			
				nm="empresa";	
			}
			
			if(nm=="customerIdentificationNumber"){			
				nm="DNI";
			}
			
			if(nm=="customerFirstName"){	
				nm="Nombre";	
			}
			if(nm=="customerLastName"){	
				nm="Apellido";	
			}
			if(nm=="customerPhone"){			
				nm="Teléfono";	
			}
			if(nm=="customerAddress"){			
				nm="Direccion";	
			}
			if(nm=="customerCity"){			
				nm="Ciudad";	
			}
			if(nm=="customerState"){			
				nm="Provincia";	
			}
			if(nm=="customerPostalCode"){			
				nm="Código Postal";	
			}

			
			
			if(valor!="" && valor!=nm){
				if (test.indexOf('isEmail')!=-1) {
					p=valor.indexOf('@');
					if (p<1 || p==(valor.length-1)) errors+='- '+valor+' '+error_email+'.\n';
				}else if (test!='R') {
					num = parseFloat(val);
					if (isNaN(valor)) errors+='- '+nm+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) {
						p=test.indexOf(':');
						min=test.substring(8,p);
						max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					}
				}
			}else if(test.charAt(0) == 'R')errors += '- '+nm+' '+error_pie+'.\n';
		}
    }
	if(errors){
		alert(error_text+':\n'+errors);
	}else{
		document.forms['f_registracion'].submit();
	}
	
    //document.MM_returnValue = (errors == '');
}
}


						function buildMarcas(){
							var espacioMarcas = document.getElementById('marcas_cat');
							var conc = '';
							var mass=1;
							conc += '<select name="marcas_sel" id="marcas_sel" onchange="setCategoria(2,this.options[this.selectedIndex].value,0);setCategoria(3,-1,0);subMarcas(this.options[this.selectedIndex].value,this.options[this.selectedIndex])"> <option class="optionoff" disabled="disabled" selected="selected">Seleccionar</option>';
							if(marq.length>1){
								for(m=1;m<marq.length;m++){
									if(marq[m][2]==2){
										var ssel ="";
										//si hay marca seleccionada
										if(  (buscadorIdes[2]&& (buscadorIdes[2]==marq[m][1]))  || catId == marq[m][1] || parentId == marq[m][1]){
											ssel=" selected='selected'";
											hayMarcaSel=mass;
											buscadorIdes[2] = marq[m][1];
										}										
										conc += "<option value='"+marq[m][1]+"' id='op_marca_"+m+"'"+ssel+">"+marq[m][0]+"</option>\n";
										mass++;
									}
								}
							}
							conc += ' </select>';
							espacioMarcas.innerHTML = conc;
						}
						function buildCategorias(){	
							if(parentId==0){
								parentId = buscarCat(buscadorIdes[1]);
				 			}
							var mass=1;
							var espacioCat = document.getElementById('cat');
							var conc = '';
							conc += '<select name="cat_sel" id="cat_sel" onchange="setCategoria(0,this.options[this.selectedIndex].value,0);setCategoria(1,-1,0);subCat(this.options[this.selectedIndex].value,this.options[this.selectedIndex])"> <option class="optionoff" disabled="disabled" selected="selected">Seleccionar</option> ';
							if(cats.length>1){								
								for(m=1;m<cats.length;m++){
									if(cats[m][2]==2){
										var ssel ="";							
										if( (buscadorIdes[0] && (buscadorIdes[0]==cats[m][1]))   || catId == cats[m][1] || parentId == cats[m][1] ){
											ssel=" selected='selected'";
											hayCatSel = mass;
											buscadorIdes[0]=cats[m][1];
										}
										conc += "<option value='"+cats[m][1]+"' id='op_cat_"+m+"'"+ssel+">"+cats[m][0]+"</option>\n";
										mass++;
									}
								}
							}
							conc += ' </select>';
							espacioCat.innerHTML = conc;			

						}
						
						
						function subMarcas(marca,orden){
							if(marca && marca>0){
								var espacioSubMarcas = document.getElementById('marcas_subcat');
								document.getElementById('SearchButton').className  = "header_search_boton_on";
								document.getElementById('SearchButton').disabled  = false;	
								var mass=1;
								var conc2 = '';
								conc2 += '<select name="submarcas_sel" id="submarcas_sel" onchange="setCategoria(3,this.options[this.selectedIndex].value,0)"> <option value="-1" selected="selected">Todos</option>';								
									for(m=1;m<marq.length;m++){
										if(marq[m][3]==marca){
											var ssel ="";
											if((buscadorIdes[3] && (buscadorIdes[3]==marq[m][1])) || catId == marq[m][1] || parentId == marq[m][1]){
											   ssel=" selected='selected'";
											   haySubMarcaSel = marq[m][1];
											   buscadorIdes[3]= marq[m][1];
											   setCategoria(3,marq[m][1],0);
											}
											conc2 += "<option value='"+marq[m][1]+"'"+ssel+">"+marq[m][0]+"</option>\n";
											mass++;
										}
									}
								conc2 += '</select>';				
								espacioSubMarcas.innerHTML = conc2;
								marcaSel=orden.id;
								setCategoria(2,marca,0);
							}else{					
								var catOrig = document.getElementById(marcaSel);								
								catOrig.selected = true;
							}			
						}
						
						
						
						function subCat(catt,orden){
				
							if(catt && catt>0){
								var espacioSubCat = document.getElementById('subcat');								
								var conc2 = '';
								conc2 += '<select name="subcat_sel" id="subcat_sel" onchange="setCategoria(1,this.options[this.selectedIndex].value,0)"> <option value="-1" selected="selected">Todos</option> ';								
									for(m=1;m<cats.length;m++){										
										if(cats[m][3]==catt){
											var ssel ="";
											//if( (buscadorId && buscadorId==cats[m][1]) || (buscadorPadre && buscadorPadre==cats[m][1]) ){
											if( (buscadorIdes[1]==cats[m][1]) || catId == cats[m][1] || parentId == cats[m][1] ){
												ssel=" selected='selected'";
												haySubCatSel = cats[m][1];
												buscadorIdes[1]==cats[m][1];
												setCategoria(1,cats[m][1],0);
											}
											conc2 += "<option value='"+cats[m][1]+"'"+ssel+">"+cats[m][0]+"</option>\n";
										}
									}
								conc2 += '</select>';				
								espacioSubCat.innerHTML = conc2;
								catIdSel=orden.id;
								setCategoria(0,catt,0);
							}else{					
								var subcatOrig = document.getElementById(catIdSel);								
								subcatOrig.selected = true;
							}			
						}
						
						
						function buscarPadre(id){
							for(i=0;i<marq.length;i++){
								var elemento = marq[i];
								if(elemento[1]==id && elemento[2]==3){
									return elemento[3];
								}								
							}							
						}
						function buscarCat(id){
							for(i=0;i<cats.length;i++){
								var elemento = cats[i];
								if(elemento[1]==id && elemento[2]==3){
									return elemento[3];
								}								
							}							
						}

						function setCategoria(clave,marca,categoria){
							buscadorIdes[clave]=marca;
							//si le paso el tipo de categoria
							if(!buscadorIdes[0] || buscadorIdes[0]==-1){
								buscadorIdes[0]='';
							}
							if(!buscadorIdes[1] || buscadorIdes[1]==-1){
								buscadorIdes[1]='';
							}
							if(!buscadorIdes[2] || buscadorIdes[2]==-1){
								buscadorIdes[2]='';
							}
							if(!buscadorIdes[3] || buscadorIdes[3]==-1){
								buscadorIdes[3]='';
							}
							document.getElementById('SearchButton').disabled  = false;
							document.getElementById('SearchButton').className  = "header_search_boton_on";
							document.getElementById('Categories').value = buscadorIdes[0]+","+buscadorIdes[1]+","+buscadorIdes[2]+","+buscadorIdes[3];
						}	
						

			function desplegar(cual,url,depth,modo){		
				//cierro todos los niveles por debajo del boton					
				var pdepth = parseInt(depth)+1;
				var accion = 0;
				for(k=pdepth;k<=10;k++){
					//alert("-"+k);
					$('.prof-'+k).css("display","none");
				}
				//si hay una categoria expandida y no es esta, o si no hay ninguna
				if((categoriaexpand!=0 && categoriaexpand!=cual) || categoriaexpand==0){
						if(categoriaexpand!=0 && categoriaexpanddepth==depth){
							$('.btn-child-'+categoriaexpand).css("display","none");
						}else{
							categoriaexpanddepth=depth;	
						}
						//muestro los hijos la actual
						var btnChild = $('.btn-child-'+cual).css("display","inline-block");
						//y si no tiene, voy al link
						if(btnChild.length<1 && modo!='auto'){
							document.location.href = url;	
						}
						categoriaexpand=cual;
						accion=1;
				//si la categoria que estoy expandiendo esta abierta, la cierro.
				}else if(categoriaexpand==cual){
					$('.btn-child-'+categoriaexpand).css("display","none");
					categoriaexpand=0;
					accion=1;
				}
				if(accion==0){
					desplegar(36,'',2);;
				}
			}

			function openChat(){
				window.open(RootPath+'/Chat.aspx','','width=400,height=500');	
			}
			
			function registrar(){
				var capa = document.getElementById('login-register');
				
				if(capa.style.display=="inline"){
					capa.style.display='none';
				}else{
					capa.style.display='inline';
				}
			}
			
			function home(){
				document.location.href= RootPath;
			}
			
			function LightboxDelegate() {
				$('#popup').click();
			}
			
			
			
			function moveDestacados(sentido,id,cant){
				cantt = 3-cant;
				if((sentido == 1 && pagina[id]<0) || (sentido == -1 && pagina[id]>(3-cant)) ){
					pagina[id] += sentido;
					var tabla = document.getElementById('destacados-tabla-'+id);
					tabla.style.marginLeft = ((pagina[id]*166)) + 'px';
					if(pagina[id]<0){						
						document.getElementById('izq_btn_'+id).style.visibility = "visible";
					}else{
						document.getElementById('izq_btn_'+id).style.visibility = "hidden";
					}
					if(pagina[id]==cantt){						
						document.getElementById('der_btn_'+id).style.visibility = "hidden";
					}else{
						document.getElementById('der_btn_'+id).style.visibility = "visible";
					}			
				}
			}
			function moveCatDestacados(sentido,id,cant){
				cantt = 4-cant;
				if((sentido == 1 && pagina[id]<0) || (sentido == -1 && pagina[id]>(4-cant)) ){
					pagina[id] += sentido;
					var tabla = document.getElementById('destacados-tabla-'+id);
					tabla.style.marginLeft = ((pagina[id]*150)) + 'px';
					if(pagina[id]<0){						
						document.getElementById('izq_btn_'+id).style.visibility = "visible";
					}else{
						document.getElementById('izq_btn_'+id).style.visibility = "hidden";
					}
					if(pagina[id]==cantt){						
						document.getElementById('der_btn_'+id).style.visibility = "hidden";
					}else{
						document.getElementById('der_btn_'+id).style.visibility = "visible";
					}			
				}
			}
			function moveNuevos(sentido,id,cant){
				cantt = 1-cant;
				if((sentido == 1 && n_pagina[id]<0) || (sentido == -1 && n_pagina[id]>(1-cant)) ){
					n_pagina[id] += sentido;
					var tabla = document.getElementById('nuevos-tabla-'+id);
					tabla.style.marginLeft = ((n_pagina[id]*278)) + 'px';
					if(n_pagina[id]<0){						
						document.getElementById('n_izq_btn_'+id).style.visibility = "visible";
					}else{
						document.getElementById('n_izq_btn_'+id).style.visibility = "hidden";
					}
					if(n_pagina[id]==cantt){						
						document.getElementById('n_der_btn_'+id).style.visibility = "hidden";
					}else{
						document.getElementById('n_der_btn_'+id).style.visibility = "visible";
					}			
				}
			}
