/*
d[8] = aniofin
d[9] = mesfin
d[10] = diafin
*/


function buscar()
{
	
	window.document.location.href='buscar.aspx?b=' + document.forms[0].buscador.value;
}

function RellenarDiasMarcados(owner, day, evt)
{
	if(customDays == null) return;
	var d, back = "", url = "";
	var i = customDays.length;
	while(i-- > 0)
	{
		d = customDays[i];
		if(d == null || d.length < 5) continue;
		if((d[0] == -1 || d[0] == day.year) && (d[1] < 0 || d[1] == day.month) && d[2] == day.day)
		{
		    if (!day.selected) 
		    		
			back = d[3];
			url = d[4];
			if(url.length > 0) url = "url(\"" + url + "\")";
			break;	
			
		}
	}
	day.element.style.backgroundColor = back;
	day.element.style.backgroundImage = url;	
	day.element.style.backgroundRepeat = "no-repeat";
}
function CambioDia(owner, date, evt)
{
	if(customDays == null || date == null) return;
	var year = date.getFullYear(), month = date.getMonth() + 1, day = date.getDate();
	var fec = "",back = "", url = "", tag = "";
	var bell = false;
	var elem = ig_csom.getElementById("NoBell");
	if(elem != null) bell = elem.checked;
	var i = customDays.length;
	while(i-- > 0)
	{
		var d = customDays[i];
		if(d == null || d.length < 6) continue;
		if((d[0] == -1 || d[0] == year) && (d[1] < 0 || d[1] == month) && d[2] == day)
		{
			back = d[3];
			fec = d[5];
			tag += d[7] + "<br />";
			
		}
	}
	elem = ig_csom.getElementById("lblSeleccionado");
	if(elem == null){alert("no hay etiqueta lblSeleccionado"); return;}
	if(fec.length > 0 || tag.length > 0)
	    back = "Fecha:&nbsp;" + fec + "" + "<p>" + tag + "</p>";
	else	
	    back = "No hay eventos la fecha seleccionada.";
	elem.innerHTML = back;
}