
	

var fechas=new Array('53|08-02-2012');
var fechas2=new Array('53|07-02-2012','53|06-02-2012','53|03-02-2012','53|02-02-2012');

						
		var busqueda=new Array();
		var fechasbusqueda=new Array();
		
		today = new Date();
		var d=today.getDate();
		var a=today.getFullYear();
		var dactual=today.getDate();
		var mactual=today.getMonth()+1;
		var m=today.getMonth()+1;
		var aactual=today.getFullYear();
		var diacambia=d;
		var aniocambia=a;
		var mescambia=m;
	
function fechavalida(mes, anio, dia) {
	var diahoy, meshoy, dat1, dat2;
	if (dia.length==1) dia=0+dia;
	if (mes.length==1) mes=0+mes;
	
	dia = dia / 10000;
	mes = mes / 100;
	dat1 = anio - - mes - - dia;

	diahoy = dactual / 10000;
	meshoy = mactual / 100;
	dat2 = aactual - - meshoy - - diahoy;
	
	if (dat1 < dat2) {
		return false;
 	}
 	else {
 		return true;
 	}
}

function enviaCalendario(subas) {
	document.formusubasta.idsub.value=subas;
	document.formusubasta.submit();
}

function iniciacalendario(){
	var cal = '<div class="derecha">';
	document.write('<form id="formusubasta" name="formusubasta" method="post" enctype="multipart/form-data" action="/muestraSubastas"><input name="idsub" type="hidden" value="" /></form>');
	cal += '<h4 class="tituloder">Calendario de Subasta</h4>';
	cal += '<hr class="gris" /><div id="calendariotabla">';
	document.write(cal);
	
	calendario_accesible(eval(m), eval(a),eval(dactual),fechas,fechas2,dactual,mactual,aactual);
	
	cal = '</div><p class="fecha"><img src="/conozcacajastur/montepiedad/images/fechagris.gif" alt="" width="10" height="10" style="border:1px #000000 solid" title="en color gris y borde negro"/>&nbsp;Día actual</p>';
	cal += '<p class="fecha"><img src="/conozcacajastur/montepiedad/images/fecharoja.gif" alt="" width="10" height="10" title="en color rojo y entre paréntesis"/>&nbsp;(Día de la subasta)</p>';
	cal += '<p class="fecha"><img src="/conozcacajastur/montepiedad/images/fechaverde.gif" alt="" width="10" height="10" title="en color verde y entre corchetes" />&nbsp;[Exposición de los lotes]<acronym title="ver horario"><strong>*</strong></acronym></p>';
	cal += '<hr class="gris" />';
	cal += '<p class="fecha"><b>*</b>Horario</strong></p>';
	cal += '<p class="horario">Lunes y Martes:<br/>&nbsp;08:30 a 13:00 horas<br/>&nbsp;17:00 a 19:30 horas<br/><br/>Resto de días:<br/>&nbsp;08:30 a 13:00 horas</p>';
	document.write('</form>');
	cal += '</div>';
	document.write(cal);
	
}

var hoy = new Date();
var a_meses=new Array('1|ene','2|feb','3|mar','4|abr','5|may','6|jun','7|jul','8|ago','9|sep','10|oct','11|nov','12|dic');
var a_anios=new Array('2001','2002','2003','2004','2005','2006','2007','2008','2009','2010');
var fecha=new Date();
var v_mes;
var v_anio;
function valortupla(tupla,campo){
	if (tupla.indexOf('|')!=-1){
		var matriz=tupla.split('|');
		return matriz[campo-1];
	}
	else	return tupla
}

function arraymeses(m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12){
	this[0]=m0;this[1]=m1;this[2]=m2;this[3]=m3;this[4]=m4;
	this[5]=m5;this[6]=m6;this[7]=m7;this[8]=m8;this[9]=m9;
	this[10]=m10;this[11]=m11;this[12]=m12;
}
var longitudesmeses = new arraymeses('',31,28,31,30,31,30,31,31,30,31,30,31);
if ((( hoy.getFullYear() % 4 == 0) && ( hoy.getFullYear() % 100 != 0)) || (hoy.getFullYear()% 400 == 0))
		longitudesmeses[2] = 29;
		
var NombMes=new Array('','enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre','diciembre');

// Premios, Área musical, Otros
var colores=new Array('7F9DD2','E70000','398C52');


function calendario1_accesible(mes,anio,vardia,arrayfecha,arrayfecha2)
	{
		 
		ames=mes;
		aanyo=anio;
		dia=vardia;
		var nfilas=6; //filas de cada mes
		var diasmes = longitudesmeses[mes]; //dias que tiene ese mes...
		var fecha = new Date();
		fecha.setDate(1);
		fecha.setMonth(mes-1);	
		fecha.setFullYear(anio);
		var diasemana = fecha.getDay();
		if (diasemana==0) diasemana=7;
		var cont = 1;
		presenta='<tr>';
		//pìnto espacios antes del primer día
		for (i=1;i<=diasemana-1; i++)
			{presenta+='<td align="right"  bgcolor="#ffffff">&nbsp;</td>';}
		
		//pinto primera fila de días
		for (i=diasemana;i<=7; i++) 
			{
					var idsubasta=devuelvedia(mes,anio,cont,arrayfecha);
					if (idsubasta != -1)
					{
						if((dia==cont)&& (eval(m)==mes)&& (eval(a)==anio))
							{
								if (fechavalida(mes,anio,cont))
									presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;"><div style="background-color:#'+colores[1]+';"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" >('+cont+')</a></div></td>');
								else	
									presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;"><div style="background-color:#'+colores[1]+';">('+cont+')</div></td>');
							}
						else
						{
							if (fechavalida(mes,anio,cont))
								presenta+=('<td align="right"  bgcolor="#'+colores[1]+'"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" >('+cont+')</a></td>');
							else
								presenta+=('<td align="right"  bgcolor="#'+colores[1]+'">('+cont+')</td>');	
						}
					}
				else
				{
					idsubasta=devuelvedia(mes,anio,cont,arrayfecha2);
					if (idsubasta != -1)
					{
						if((dia==cont)&& (eval(m)==mes)&& (eval(a)==anio))
							{
								if (fechavalida(mes,anio,cont))
									presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;"><div style="background-color:#'+colores[2]+';"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" >['+cont+']</a></div></td>');
								else
									presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;"><div style="background-color:#'+colores[2]+';">['+cont+']</div></td>');	
							}
						else
						{
							if (fechavalida(mes,anio,cont))
								presenta+=('<td align="right"  bgcolor="#'+colores[2]+'"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" >['+cont+']</a></td>');
							else
								presenta+=('<td align="right"  bgcolor="#'+colores[2]+'">['+cont+']</td>');	
						}
					}
			
					else
						{
							if((dia==cont) && (eval(m)==mes)&& (eval(a)==anio))
								{presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;">'+cont+'</td>');}
							else
								{presenta+=('<td align="right"  bgcolor="#ffffff">'+cont+'</td>');}
						}
				}
				cont++;
			}

		presenta+='</tr>';
		//las demas filas
		for (j=2;j<=6;j++)
			{
				presenta+='<tr>';
				for (h=1;h<=7;h++)
					{
						if (cont<=diasmes) 
							{
								var idsubasta=devuelvedia(mes,anio,cont,arrayfecha);
								if (idsubasta != -1)
									{
										if((dia==cont) && (eval(m)==mes)&& (eval(a)==anio))
											{
												if (fechavalida(mes,anio,cont))
													presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;"><div style="background-color:#'+colores[1]+';"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" >('+cont+')</a></div></td>');
												else
													presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;"><div style="background-color:#'+colores[1]+';">('+cont+')</div></td>');
											}
										else
										{
											if (fechavalida(mes,anio,cont))
												presenta+=('<td align="right"  bgcolor="#'+colores[1]+'"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" >('+cont+')</a></td>');
											else
												presenta+=('<td align="right"  bgcolor="#'+colores[1]+'">('+cont+')</td>');	
										}
									}
								else
								{
									idsubasta=devuelvedia(mes,anio,cont,arrayfecha2);
									if (idsubasta != -1)
									{
										if((dia==cont) && (eval(m)==mes)&& (eval(a)==anio))
											{
												if (fechavalida(mes,anio,cont))
													presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;"><div style="background-color:#'+colores[2]+';"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" >['+cont+']</a></div></td>');
												else	
													presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;"><div style="background-color:#'+colores[2]+';">['+cont+']</div></td>');
											}
										else
										{
											if (fechavalida(mes,anio,cont))
												presenta+=('<td align="right"  bgcolor="#'+colores[2]+'"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" >['+cont+']</a></td>');
											else	
												presenta+=('<td align="right"  bgcolor="#'+colores[2]+'">['+cont+']</td>');
										}
									}
									else
									{
										if((dia==cont) && (eval(m)==mes)&& (eval(a)==anio))
											{presenta+=('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid;">'+cont+'</td>');}
										else
											{presenta+=('<td align="right"  bgcolor="#ffffff">'+cont+'</td>');}
									}
								}
							}
						else
							{presenta+='<td align="right"  bgcolor="#ffffff"><img src="/images/sizer.gif" width="1" height="1" alt="" /> </td>';}
						cont++;
					}
				presenta+='</tr>';
			}
		return presenta;
	}

function devuelvedia(valormes,valoranio,valordia,arrayfecha)
{
  // recorro el array de fechas buscando si el dia actual está en el array de fechas q tienen actividad
  //primero formo la fecha en la que quiero buscar

  valoranio=valoranio.toString();
  valormes=valormes.toString();
  valordia=valordia.toString();
  if (valormes.length==1)
    valormes='0'+valormes;
  if (valordia.length==1)
    valordia='0'+valordia;
   //var encontrado=false;
   var idsubasta=-1;   
  fechaactual=valordia+"-"+valormes+"-"+valoranio;
  for (var i=0;i<arrayfecha.length;i++)
    {
		if (fechaactual==valortupla(arrayfecha[i],2))
		{
			//encontrado=true;
			idsubasta=valortupla(arrayfecha[i],1);
		}
	}  
  return idsubasta;
}

function fanterior()
{
  valor=mescambia;
  if ((parseInt(mescambia)) != (parseInt(valor)+1))
  {
	  if (valor=='01') 
		{
		  mesanterior='12';
		  mescambia=mesanterior;
		  anioanterior=eval(aniocambia)-1;
		  aniocambia=anioanterior;
		 }
		else
		  {
			mesanterior=eval(mescambia)-1;
			ma=mesanterior.toString();
			 if (ma.length == 1)
				mescambia='0'+mesanterior;
			else
				mescambia=mesanterior;
		  }
	  var tabla = '<table cellspacing="0" cellpadding="2" border="0" class="calendario" id="tabla_calendario">';
	  var caption='<caption style="border:1px #E4E4E4 solid"><a href="javascript:fanterior();" class="fanterior"><img alt="" height="7" width="6" src="/osyc/images/flechaizq.gif"/></a><strong id="meses">'+NombMes[eval(mesanterior)]+'  '+aniocambia+'</strong><a href="javascript:siguiente();" class="fsiguiente"><img alt="" height="7" width="6" src="/osyc/images/flechader.gif" /></a></caption>';
	  var cabeceras = '<tr id="cabeceras"><th class="tipo1 color1" scope="col"><abbr title="lunes">Lu</abbr></th><th class="tipo1 color1" scope="col"><abbr title="martes">Ma</abbr></th><th class="tipo1 color1" scope="col"><abbr title="miércoles">Mi</abbr></th><th class="tipo1 color1" scope="col"><abbr title="jueves">Ju</abbr></th><th class="tipo1 color1" scope="col"><abbr title="viernes">Vi</abbr></th><th class="tipo1 color1" scope="col"><abbr title="sábado">Sa</abbr></th><th class="tipo1 color1" scope="col"><abbr title="domingo">Do</abbr></th></tr>'
		var calendario=calendario1_accesible(eval(mescambia), eval(aniocambia),eval(diacambia),fechas,fechas2);
	  var fintabla = '</table>';
	  
	  var objTabla = document.getElementById('calendariotabla');
		objTabla.innerHTML= tabla + caption + cabeceras + calendario + fintabla;		
	}
	
}
function siguiente()
{
   valor=mescambia;
  if (valor=='12') 
    {
      mesanterior='01';
	  mescambia=mesanterior;
	  anioanterior=eval(aniocambia)+1;
	  aniocambia=anioanterior;
	 }
	else
	  {
	    mesanterior=eval(mescambia)+1;
		ma=mesanterior.toString();
		 if (ma.length == 1)
		    mescambia='0'+mesanterior;
		else
			mescambia=mesanterior;
	  }
  	var tabla = '<table cellspacing="0" cellpadding="2" border="0" class="calendario" id="tabla_calendario">';
		var caption='<caption style="border:1px #E4E4E4 solid"><a href="javascript:fanterior();" class="fanterior"><img alt="" height="7" width="6" src="/osyc/images/flechaizq.gif"/></a><strong id="meses">'+NombMes[eval(mesanterior)]+ ' '+aniocambia+'</strong><a href="javascript:siguiente();" class="fsiguiente"><img alt="" height="7" width="6" src="/osyc/images/flechader.gif"/></a></caption>';
	  var cabeceras = '<tr id="cabeceras"><th class="tipo1 color1" scope="col"><abbr title="lunes">Lu</abbr></th><th class="tipo1 color1" scope="col"><abbr title="martes">Ma</abbr></th><th class="tipo1 color1" scope="col"><abbr title="miércoles">Mi</abbr></th><th class="tipo1 color1" scope="col"><abbr title="jueves">Ju</abbr></th><th class="tipo1 color1" scope="col"><abbr title="viernes">Vi</abbr></th><th class="tipo1 color1" scope="col"><abbr title="sábado">Sa</abbr></th><th class="tipo1 color1" scope="col"><abbr title="domingo">Do</abbr></th></tr>'
		var calendario= calendario1_accesible(eval(mescambia), eval(aniocambia),eval(diacambia),fechas,fechas2);
		var fintabla = '</table>';
	  
	  var objTabla = document.getElementById('calendariotabla');
		
		objTabla.innerHTML= tabla + caption + cabeceras + calendario + fintabla;		

}

function calendario_accesible(mes,anio,vardia, arrayfecha, arrayfecha2, dactual,mactual,aactual)
	{
		ames=mes;
		aanyo=anio;
		var nfilas=6; //filas de cada mes
		var diasmes = longitudesmeses[mes]; //dias que tiene ese mes...
		var fecha = new Date();
		fecha.setDate(1);
		fecha.setMonth(mes-1);	
		fecha.setFullYear(anio);
		var diasemana = fecha.getDay();
		if (diasemana==0) diasemana=7;
		var cont = 1;	
		document.write('<table cellspacing="0" cellpadding="2" border="0" class="calendario" id="tabla_calendario"><caption style="border:1px #E4E4E4 solid"><a href="javascript:fanterior();" class="fanterior"><img alt="" height="7" width="6" src="/osyc/images/flechaizq.gif"/></a><strong id="meses"> <script type="text/javascript">document.write(NombMes[eval(m)]);</script> <script type="text/javascript">document.write(eval(a));</script></strong> <a href="javascript:siguiente();" class="fsiguiente"><img alt="" height="7" width="6" src="/osyc/images/flechader.gif"/></a></caption><tr id="cabeceras"><th class="tipo1 color1" scope="col"><abbr title="lunes">Lu</abbr></th><th class="tipo1 color1" scope="col"><abbr title="martes">Ma</abbr></th><th class="tipo1 color1" scope="col"><abbr title="miércoles">Mi</abbr></th><th class="tipo1 color1" scope="col"><abbr title="jueves">Ju</abbr></th><th class="tipo1 color1" scope="col"><abbr title="viernes">Vi</abbr></th><th class="tipo1 color1" scope="col"><abbr title="sábado">Sa</abbr></th><th class="tipo1 color1" scope="col"><abbr title="domingo">Do</abbr></th></tr>');
		document.write('<tr>');
		//pìnto espacios antes del primer día
		for (i=1;i<=diasemana-1; i++)
			{document.write('<td align="right"  bgcolor="#ffffff"></td>');}
	
		//pinto primera fila de días
		for (i=diasemana;i<=7; i++) 
			{
				
				
					var idsubasta=devuelvedia(mes,anio,cont,arrayfecha);
					if (idsubasta != -1)
					{
						if(dactual==cont)
							{
								if (fechavalida(mes,anio,cont))
									document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid"><div style="background-color:#'+colores[1]+'; " ><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" title="día de la subasta">('+cont+')</a></div></td>');
								else
									document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid"><div style="background-color:#'+colores[1]+'; " >'+cont+'</div></td>');
							}
						
						else
						{
							if (fechavalida(mes,anio,cont))
								document.write('<td align="right"  bgcolor="#'+colores[1]+'"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" title="día de la subasta">('+cont+')</a></td>');
							else
								document.write('<td align="right"  bgcolor="#'+colores[1]+'">('+cont+')</td>');
						}	
					}
				
					
				/*********************************************/
				else
				{
					idsubasta=devuelvedia(mes,anio,cont,arrayfecha2);
					if (idsubasta != -1)
					{
						if(dactual==cont)
							{
								if (fechavalida(mes,anio,cont))
									document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid"><div style="background-color:#'+colores[2]+';" ><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" title="día de exposición de los lotes">['+cont+']</a></div></td>');
								else
									document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid"><div style="background-color:#'+colores[2]+';" >'+cont+'</div></td>');	
							}
						
						else
						{
							if (fechavalida(mes,anio,cont))
								document.write('<td align="right"  bgcolor="#'+colores[2]+'"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" title="día de exposición de los lotes">['+cont+']</a></td>');
							else
								document.write('<td align="right"  bgcolor="#'+colores[2]+'">['+cont+']</td>');
						}	
					}
				/**************************************************/
					else
						{
							if(dactual==cont)
								{document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid" title="día actual">'+cont+'</td>');}
							else
								{document.write('<td align="right"  bgcolor="#ffffff">'+cont+'</td>');}
						}
				}
				cont++;
			}
		document.write('</tr>');
	
		//las demas filas
		for (j=2;j<=6;j++)
			{
				document.write('<tr>');
				for (h=1;h<=7;h++)
					{
						
						if (cont<=diasmes) 
							{
								var idsubasta=devuelvedia(mes,anio,cont,arrayfecha);
								if (idsubasta != -1)
									
									{
										if(dactual==cont)
											{
												if (fechavalida(mes,anio,cont))
													document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid"><div style="background-color:#'+colores[1]+';"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" title="día de la subasta">('+cont+')</a></div></td>');
												else
													document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid"><div style="background-color:#'+colores[1]+';">('+cont+')</div></td>');
											}
										else
											{
												if (fechavalida(mes,anio,cont))
													document.write('<td align="right"  bgcolor="#'+colores[1]+'"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" title="día de la subasta">('+cont+')</a></td>');
												else
													document.write('<td align="right"  bgcolor="#'+colores[1]+'">('+cont+')</td>');
											}
									}
								else
								{	
									idsubasta=devuelvedia(mes,anio,cont,arrayfecha2);
									if (idsubasta != -1)
									
									{
										if(dactual==cont)
											{
												if (fechavalida(mes,anio,cont))
													document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid"><div style="background-color:#'+colores[2]+';"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" title="día de exposición de los lotes">['+cont+']</a></div></td>');
												else
													document.write('<td align="right"  bgcolor="#BDC6CE" style="border:1px #000000 solid"><div style="background-color:#'+colores[2]+';">['+cont+']</div></td>');	
											}
										else 
											{
												if (fechavalida(mes,anio,cont))
													document.write('<td align="right"  bgcolor="#'+colores[2]+'"><a style="color:#FFFFFF;" href="javascript:enviaCalendario('+idsubasta+')" title="día de exposición de los lotes">['+cont+']</a></td>');
												else	
													document.write('<td align="right"  bgcolor="#'+colores[2]+'">['+cont+']</td>');
											}
									}
									else
									{
										if(dactual==cont)
											{document.write('<td align="right"  style="border:1px #000000 solid" bgcolor="#BDC6CE" title="día actual">'+cont+'</td>');}
										else
											{document.write('<td align="right"  bgcolor="#ffffff">'+cont+'</td>');}
									}
								}
							}
						else
							{document.write('<td align="right"  bgcolor="#ffffff">&nbsp;</td>');}
						cont++;
					}
				document.write('</tr>');
			}
		document.write('</table>');	
	}
	
function escribeSelectLotes(){
	document.write('<select id="idcategorialote" name="idcategorialote" >');
	document.write('	<option value="#">Seleccione una categoría</option>');
	document.write('	<option value="grupolote5.html">Acuñaciones y monedas</option>');
	document.write('	<option value="grupolote15.html">Antigüedades</option>');
	document.write('	<option value="grupolote10.html">Cadenas, collares, gargantillas</option>');
	document.write('	<option value="grupolote14.html">Colgantes, cruces, medallas</option>');
	document.write('	<option value="grupolote12.html">Diamantes</option>');
	document.write('	<option value="grupolote8.html">Gemelos, pasadores corbata y llaveros</option>');
	document.write('	<option value="grupolote16.html">Imperdibles y broches</option>');
	document.write('	<option value="grupolote6.html">Lotes</option>');
	document.write('	<option value="grupolote1.html">Oro</option>');
	document.write('	<option value="grupolote13.html">Otras piedras</option>');
	document.write('	<option value="grupolote7.html">Pendientes</option>');
	document.write('	<option value="grupolote2.html">Perlas</option>');
	document.write('	<option value="grupolote9.html">Plata</option>');
	document.write('	<option value="grupolote4.html">Pulseras y brazaletes</option>');
	document.write('	<option value="grupolote11.html">Relojes</option>');
	document.write('	<option value="grupolote3.html">Sortijas y aros</option>');
	document.write('</select>');
}

function escribeSelectLotes(direc){
	document.write('<select id="idcategorialote" name="idcategorialote">');
	document.write('	<option value="#?ordencate=-1">Seleccione una categoría</option>');
	document.write('	<option value="grupolote5.html?ordencate=1">Acuñaciones y monedas</option>');
	document.write('	<option value="grupolote15.html?ordencate=2">Antigüedades</option>');
	document.write('	<option value="grupolote10.html?ordencate=3">Cadenas, collares, gargantillas</option>');
	document.write('	<option value="grupolote14.html?ordencate=4">Colgantes, cruces, medallas</option>');
	document.write('	<option value="grupolote12.html?ordencate=5">Diamantes</option>');
	document.write('	<option value="grupolote8.html?ordencate=6">Gemelos, pasadores corbata y llaveros</option>');
	document.write('	<option value="grupolote16.html?ordencate=7">Imperdibles y broches</option>');
	document.write('	<option value="grupolote6.html?ordencate=8">Lotes</option>');
	document.write('	<option value="grupolote1.html?ordencate=9">Oro</option>');
	document.write('	<option value="grupolote13.html?ordencate=10">Otras piedras</option>');
	document.write('	<option value="grupolote7.html?ordencate=11">Pendientes</option>');
	document.write('	<option value="grupolote2.html?ordencate=12">Perlas</option>');
	document.write('	<option value="grupolote9.html?ordencate=13">Plata</option>');
	document.write('	<option value="grupolote4.html?ordencate=14">Pulseras y brazaletes</option>');
	document.write('	<option value="grupolote11.html?ordencate=15">Relojes</option>');
	document.write('	<option value="grupolote3.html?ordencate=16">Sortijas y aros</option>');
	document.write('</select>');
	
	var idcategorialote_obj = document.getElementById('idcategorialote');
	var selec = -1;
	try {
		selec = direc.substr(direc.lastIndexOf('=', direc.length)+1, direc.length);
		if (selec > 0 && selec <= 16) {
			idcategorialote_obj.selectedIndex=selec;
		}
	} catch(e) {
		//window.alert(e);
	}
	idcategorialote_obj.selectedIndex = selec;
}

function escribeSelectLotesPre(){
	document.write('<li>');
	document.write('Por categorías &nbsp;&nbsp;&nbsp; ');
}
function escribeSelectLotesPost(){
	//var selector = document.getElementById('idcategorialote');
	//var selval = selector.value;
	//var selval = selector[selector.selectedIndex].value;
	document.write('<input name="botonIr" id="botonIr" type="submit" value="Ver lotes" style="font-size:1em; margin-top: -0.5em; margin-left: 1em; width: 6em;" onclick="javascript:self.location.href=document.getElementById(\'idcategorialote\').value;"');
	document.write('</li>');
}	


