// General javascript functions

function switchDisplayResultados(idObj){
	var obj = $(idObj);

	if(obj.style.display == 'none'){
		Effect.Appear(idObj);
	}
	else{
		Effect.Fade(idObj);
	}
}

function SetForm(elementId,valor) {
	if (document.getElementById(elementId)) {
		document.getElementById(elementId).value=valor;
	}
}

function pagerSubmit() {
	defaultCommand = document.getElementById('defaultCommand').value;
 	document.getElementById('actionForm').value = defaultCommand;
 	document.getElementById('page').form.submit();
	return true;
}

function recordar() {
	var l=screen.availWidth-(420+20);
    window.open("/recordar.cgi","Contrasenia","width=420,height=240,directories=no,toolbar=no,resizable=no,menubar=no,scrollbars=no,top=20,left="+l);
}

function logout() {
	var url = location.href;
	url = url.replace(/^http[s]?:\/\/\w[\.\w\-\_]+/ig, "");
	url = url.replace(/&/ig, "*");
	location.href = '/serviceLogin.cgi?accion=logout&back='+url;
}

function sendLoginForm(idForm) {
	var frm = document.getElementById(idForm);
    if (frm.usuario.value == '') {
        alert("Debe colocar su nombre de usuario.");
        frm.usuario.focus();
    }
    else if (frm.pass.value == '') {
        alert("Debe colocar su password."); 
        frm.pass.focus();
    }
    else if ((frm.usuario.value != '') && (frm.pass.value != '')) {
		var url = '/';
		
		if (frm.back.value != '') {
			url = frm.back.value;
		}

		frm.back.value = url.replace(/&/ig, "*");
		
		temp = hex_sha1(frm.pass.value);
		frm.password.value = temp

		frm.submit();
    }
}

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 tabsControl() {
	new Control.Tabs('tablas_tabs');	
}

function changeMainImg(imgNoticia, codigo, urlNoticia){
	$('imgPpal').innerHTML = '<a href="' + urlNoticia + '"><img src="' + imgNoticia + '" alt="" border="0" /></a>';
	$('tituloPpal').innerHTML = '<a href="' + urlNoticia + '">' + $('titulo_'+codigo).innerHTML + '' + $('comentario_'+codigo).innerHTML + '</a>';
	$('resumenPpal').innerHTML = $('resumen_'+codigo).innerHTML + '...<a href="' + urlNoticia + '" style="color:#0066FF;">[+]</a>';
}

function loadTablaPosiciones(){
	var rand = Math.round(100*Math.random()); //  IE CACHE FIX 
	new Ajax.Updater({success:'tabla_posiciones',failure:'',exception:''}, '/index.cgi', {
						parameters: 'accion=getPlugin&pluginName=get_template&template=tabla_posiciones.tmpl&template_dir=static/editables'+'&_nocache='+rand,
						method: 'get',
						evalScripts: true,
						evalJS: true,
						onCreate: function(){},
						onComplete: function(transport) {},
						onFailure: function(){ alert('Ha ocurrido un error en el sistema. Vuelva a intentar la operación por favor.'); }
					});
}

function cambiarImagenMenu(idMenu){
	var ancho;
	switch(idMenu){
		case ('noticias'): 
			ancho = '107px';
			break;
		case ('secciones'):
			ancho = '104px';
			break;
		case ('estadisticas'):
			ancho = '108px';
			break;
		case ('reglamentos'):
			ancho = '106px';
			break;
	}


	$(idMenu).select('img')[0].writeAttribute('src','/images/submenu/sub_menu_top_'+idMenu+'.png');
	$(idMenu).select('img')[0].setStyle({marginTop: '-25px',
										marginLeft: '-5px'});
	$(idMenu).setStyle({
						width: ancho
// 						height: '43px',
						});
}

function restaurarImagenMenu(idMenu){
	var ancho;
	switch(idMenu){
		case ('noticias'): 
			ancho = '68px';
			break;
		case ('secciones'):
			ancho = '78px';
			break;
		case ('estadisticas'):
			ancho = '91px';
			break;
		case ('reglamentos'):
			ancho = '98px';
			break;
	}
	$(idMenu).select('img')[0].writeAttribute('src','/images/menu_'+idMenu+'.png');
	$(idMenu).select('img')[0].setStyle({
											marginTop: '0px',
											marginLeft: '0px'
										});
	$(idMenu).setStyle({
						width: ancho
// 						height:'43px',
						});
}

// widgets

var TabSelector = Class.create({
  initialize: function(name, defaultSelectedTab) {
    this.name = name; // widget id
    this.defaultSelectedTab = defaultSelectedTab; // widget id
    this.initWidget();
    this.tabsElements;
    this.contentsElements;
  },
  setActiveTab: function(tabToActive) { // metodo que setea el tab activo
    var tabToActiveId = tabToActive.readAttribute('id');

    this.tabsElements.each(function(tab) { // recorro los tabs
	  if (tabToActiveId == tab.readAttribute('id')) { // si el tab es igual al q busco
	      var classArray = tab.classNames().toArray();
	      for (var index = 0, len = classArray.size(); index < len; ++index) {
		  var className = classArray[index]
		  if (className.match(/^solapa/)) {  // si es la clase que define el estilo de la solapa
		      if (!className.match(/_on$/)) { // sino termina en "on"
			  tab.addClassName(className+'_on');
			  tab.removeClassName(className);
		      }
		  }
	      }
	  }
	  else { // si el tab no es igual al que busco
	      var classArray = tab.classNames().toArray();
	      for (var index = 0, len = classArray.size(); index < len; ++index) {
		  var className = classArray[index]
		  if (className.match(/^solapa/)) {  // si es la clase que define el estilo de la solapa
		      if (className.match(/(.+)_on$/)) { // sino termina en "on"
			  var cleanClassName = RegExp.$1;
			  tab.addClassName(cleanClassName);
			  tab.removeClassName(cleanClassName+'_on');
		      }
		  }
	      }
	  }
    });

    var idToSelect = tabToActiveId.match(/tab\-(\d+)/) ? RegExp.$1 : null; // id del seleccionado
    var contentToActiveId = 'content-'+idToSelect;

    this.contentsElements.each(function(contentToActive) {
	if (contentToActiveId == contentToActive.readAttribute('id')) {
	    contentToActive.show();
	}
	else {
	    contentToActive.hide();
	}
    });
  },
  initWidget: function() { // inicializa el widget
    var tabs = $(this.name).select('.tab');
    this.tabsElements = tabs;
    var contents = $(this.name).select('.content');
    this.contentsElements = contents;
    var tabObject = this;
    tabs.each(function(tab) {
      tab.observe('click', function(event){tabObject.setActiveTab(this);});
    });
  }
});

//Solapas tablas de posiciones y goleadores
function activarSolapasTablas(idSolapaTabla){
	var solapaPosiciones = $('solapaPos');
	var solapaGoleadores = $('solapaGol');
	var tablaPosiciones = $('posiciones');
	var tablaGoleadores = $('goleadores');

	if (idSolapaTabla == "solapaGol"){
		tablaPosiciones.style.display = 'none';
		tablaGoleadores.style.display = 'block';
		solapaPosiciones.className = 'solapa_posiciones';
		solapaGoleadores.className = 'solapa_goleadores_on';
	}
	else{
		tablaPosiciones.style.display = 'block';
		tablaGoleadores.style.display = 'none';
		solapaPosiciones.className = 'solapa_posiciones_on';
		solapaGoleadores.className = 'solapa_goleadores';
	}
}

CarouselElementosRelacionados = Class.create(Abstract, {
	initialize: function (scroller, slides, controls, options) {
		this.scrolling	= false;
		this.scroller	= $(scroller);
		this.slides		= slides;
		this.controls	= controls;

		this.options    = Object.extend({
            duration:           0.8,
            auto:               true,
            frequency:          8,
            visibleSlides:      1,
            controlClassName:   'carousel-control',
            jumperClassName:    'carousel-jumper',
            disabledClassName:  'carousel-disabled',
            selectedClassName:  'carousel-selected',
            circular:           true,
            wheel:              false,
            effect:             'fade',
            transition:         'spring'
        }, options || {});
        
        if (this.options.effect == 'fade') {
            this.options.circular = true;
        }

		this.slides.each(function(slide, index) {
			slide._index = index;
        });

		if (this.controls) {
            this.controls.invoke('observe', 'click', this.click.bind(this));
        }
        
        if (this.options.wheel) {            
            this.scroller.observe('mousewheel', this.wheel.bindAsEventListener(this)).observe('DOMMouseScroll', this.wheel.bindAsEventListener(this));;
        }

        if (this.options.auto) {
            this.start();
        }

		if (this.options.initial) {
			var initialIndex = this.slides.indexOf($(this.options.initial));
			if (initialIndex > (this.options.visibleSlides - 1) && this.options.visibleSlides > 1) {               
				if (initialIndex > this.slides.length - (this.options.visibleSlides + 1)) {
					initialIndex = this.slides.length - this.options.visibleSlides;
				}
			}
            this.moveTo(this.slides[initialIndex]);
		}
	},

	click: function (event) {
		this.stop();

		var element = event.findElement('a');

		if (!element.hasClassName(this.options.disabledClassName)) {
			if (element.hasClassName(this.options.controlClassName)) {
				eval("this." + element.rel + "()");
            } else if (element.hasClassName(this.options.jumperClassName)) {
                this.moveTo(element.rel);
                if (this.options.selectedClassName) {
                    this.controls.invoke('removeClassName', this.options.selectedClassName);
                    element.addClassName(this.options.selectedClassName);
                }
            }
        }

		this.deactivateControls();

		event.stop();
    },

	moveTo: function (element) {
		if (this.options.beforeMove && (typeof this.options.beforeMove == 'function')) {
			this.options.beforeMove();
        }

		this.previous = this.current ? this.current : this.slides[0];
		this.current  = $(element);

		var scrollerOffset = this.scroller.cumulativeOffset();
		var elementOffset  = this.current.cumulativeOffset();

		if (this.scrolling) {
			this.scrolling.cancel();
		}

        switch (this.options.effect) {
            case 'fade':               
                this.scrolling = new Effect.Opacity(this.scroller, {
                    from:   1.0,
                    to:     0.1,
                    duration: this.options.duration,
                    afterFinish: (function () {
                        this.scroller.scrollLeft = elementOffset[0] - scrollerOffset[0];
                        this.scroller.scrollTop  = elementOffset[1] - scrollerOffset[1];

                        new Effect.Opacity(this.scroller, {
                            from: 0.3,
                            to: 1.0,
                            duration: this.options.duration,
                            afterFinish: (function () {
                                if (this.controls) {
                                    this.activateControls();
                                }
                                if (this.options.afterMove && (typeof this.options.afterMove == 'function')) {
                                    this.options.afterMove();
                                }
                            }).bind(this)
                        });
                    }
                ).bind(this)});
            break;
            case 'scroll':
            default:
                var transition;
                switch (this.options.transition) {
                    case 'spring':
                        transition = Effect.Transitions.spring;
                        break;
                    case 'sinoidal':
                    default:
                        transition = Effect.Transitions.sinoidal;
                        break;
                }

                this.scrolling = new Effect.SmoothScroll(this.scroller, {
                    duration: this.options.duration,
                    x: (elementOffset[0] - scrollerOffset[0]),
                    y: (elementOffset[1] - scrollerOffset[1]),
                    transition: transition,
                    afterFinish: (function () {
                        if (this.controls) {
                            this.activateControls();
                        }
                        if (this.options.afterMove && (typeof this.options.afterMove == 'function')) {
                            this.options.afterMove();
                        }                        
                        this.scrolling = false;
                    }).bind(this)});
            break;
        }

		return false;
	},

	prev: function () {
		if (this.current) {
			var currentIndex = this.current._index;
			var prevIndex = (currentIndex == 0) ? (this.options.circular ? this.slides.length - 1 : 0) : currentIndex - 1;
        } else {
            var prevIndex = (this.options.circular ? this.slides.length - 1 : 0);
        }

		if (prevIndex == (this.slides.length - 1) && this.options.circular && this.options.effect != 'fade') {
			this.scroller.scrollLeft =  (this.slides.length - 1) * this.slides.first().getWidth();
			this.scroller.scrollTop =  (this.slides.length - 1) * this.slides.first().getHeight();
			prevIndex = this.slides.length - 2;
        }

		this.moveTo(this.slides[prevIndex]);
	},

	next: function () {
		if (this.current) {
			var currentIndex = this.current._index;
			var nextIndex = (this.slides.length - 1 == currentIndex) ? (this.options.circular ? 0 : currentIndex) : currentIndex + 1;
        } else {
            var nextIndex = 1;
        }

		if (nextIndex == 0 && this.options.circular && this.options.effect != 'fade') {
			this.scroller.scrollLeft = 0;
			this.scroller.scrollTop  = 0;
			nextIndex = 1;
        }

		if (nextIndex > this.slides.length - (this.options.visibleSlides + 1)) {
			nextIndex = this.slides.length - this.options.visibleSlides;
		}		

		this.moveTo(this.slides[nextIndex]);
	},

	first: function () {
		this.moveTo(this.slides[0]);
    },

	last: function () {
		this.moveTo(this.slides[this.slides.length - 1]);
    },

	toggle: function () {
		if (this.previous) {
			this.moveTo(this.slides[this.previous._index]);
        } else {
            return false;
        }
    },

	stop: function () {
		if (this.timer) {
			clearTimeout(this.timer);
		}
	},

	start: function () { 
        this.periodicallyUpdate();
    },

	pause: function () {
		this.stop();
		this.activateControls();
    },

	resume: function (event) {
		if (event) {
			var related = event.relatedTarget || event.toElement;
			if (!related || (!this.slides.include(related) && !this.slides.any(function (slide) { return related.descendantOf(slide); }))) {
				this.start();
            }
        } else {
            this.start();
        }
    },

	periodicallyUpdate: function () {
		if (this.timer != null) {
			clearTimeout(this.timer);
			this.next();
        }
		this.timer = setTimeout(this.periodicallyUpdate.bind(this), this.options.frequency * 1000);
    },
    
    wheel: function (event) {
        event.cancelBubble = true;
        event.stop();
        
		var delta = 0;
		if (!event) {
            event = window.event;
        }
		if (event.wheelDelta) {
			delta = event.wheelDelta / 120; 
		} else if (event.detail) { 
            delta = -event.detail / 3;	
        }        
       
        if (!this.scrolling) {
            this.deactivateControls();
            if (delta > 0) {
                this.prev();
            } else {
                this.next();
            }            
        }
        
		return Math.round(delta); //Safari Round
    },

	deactivateControls: function () {
		this.controls.invoke('addClassName', this.options.disabledClassName);
    },

	activateControls: function () {
		this.controls.invoke('removeClassName', this.options.disabledClassName);
    }
});
function getComentarios(idNoticia){
							var rand = Math.round(100*Math.random()); //  IE CACHE FIX 
							new Ajax.Updater({success:'detalleComentarios',failure:'',exception:''}, '/index.cgi', {
							parameters: 'accion=getPlugin&pluginName=get_related_news&template=detalle_comentarios.tmpl&category_id=29&new_id='+idNoticia+'&_nocache='+rand,
							method: 'get',
							evalScripts: true,
							evalJS: true,
							onCreate: function(){},
							onComplete: function(transport) {},
							onFailure: function(){ alert('Ha ocurrido un error en el sistema. Vuelva a intentar la operación por favor.'); }
							});
						}

						
function addComment(){
	var rand = Math.round(100*Math.random()); //  IE CACHE FIX 
	new Ajax.Request('/index.cgi', {
						parameters:Form.serialize('formComentario')+'&formAlta=comentario&related_news_id='+newsArticleId,
// '/index.cgi?accion=getPlugin&pluginName=do_add_news&template=plugin_comentario.tmpl&_nocache='+rand,
						method: 'post',
						onCreate: function(){
						},
						onComplete: function(transport) {

							alert("Su comentario ha sido cargado correctamente.");
							Form.reset('formComentario');
						},
						onFailure: function(){ alert('Ha ocurrido un error en el sistema. Vuelva a intentar la operación por favor.'); }
					});
	
}

function loadSugerencias(){
	var rand = Math.round(100*Math.random()); //  IE CACHE FIX 
	new Ajax.Updater({success:'formSugerencias',failure:'',exception:''}, '/index.cgi', {
						parameters: '_wf=true&mod=formFront&accion=getNewFormView&formId=3&_nocache='+rand,
						method: 'get',
						evalScripts: true,
						evalJS: true,
						onCreate: function(){},
						onComplete: function(){},
						onFailure: function(){ alert('Ha ocurrido un error en el sistema. Vuelva a intentar la operación por favor.'); }
					});

}

function verificarFormulario() {

	

	if (v.exec()) {
		//Validar las repeticiones			
		for (var i=0;i < doubleValidationIds.length;i++){
			var success = compare(doubleValidationIds[i][0], doubleValidationIds[i][1]);
			if(!(success)){
				var arrName = doubleValidationIds[i][0].split('_');
				var cSpanId = 'span_'+arrName[1];
				var cSpan = document.getElementById(cSpanId);
				if(cSpan){
					var spanText = cSpan.firstChild;
					alert(spanText.nodeValue + ' no coincide la repetición');
				}
				else alert('Hay campos que deben ser iguales');

				return false;
			}
		}
		enviarDatos();
	}
	return false;
}

function enviarDatos(){
	var rand = Math.round(100*Math.random()); //  IE CACHE FIX 
	new Ajax.Request('/index.cgi', {
				parameters: Form.serialize('frmSugerencias') + '&_nocache=' + rand,
				onCreate: function(){},
				onSuccess: function(transport) {},
				onComplete: function(transport) {
					if (200 == transport.status){
						var response = transport.responseText;
						
						$('formSugerencias').innerHTML = response;
					}
				},
				onFailure: function(){alert('Ha ocurrido un error en el sistema. Vuelva a intentar la operación por favor.'); }
			});

}

function abreradio(){
				window.open("http://www.radiomitrerosario.com.ar/online", "RadioMitre", "width=470,height=270,status=no,menu=no,toolbar=no,resize=no");
			}
			
function cortarString(idContenedor, CantCaracteres){
// alert(idContenedor);
	var textoLargo = $(idContenedor).innerHTML;
// alert(textoLargo);
	var textoCortado = textoLargo.substring(0, CantCaracteres);
// alert(textoCortado);
	$(idContenedor).innerHTML=textoCortado;
}

function getXMLHttpRequest(){
        var xmlhttp;
        if(window.XMLHttpRequest) { // no es IE
            xmlhttp = new XMLHttpRequest();
        }
        else { // Es IE o no tiene el objeto
            try {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert('El navegador utilizado no esta soportado');
            }
        }
        return xmlhttp;
}

function habilitarMes(){
	var comboAnio = $('anio_filtro');
	if(comboAnio.options[comboAnio.selectedIndex].value != 'SelectAno'){
		$('mes_filtro').disabled = false;
		
	}
	else{
		$('mes_filtro').disabled = true;
		$('mes_filtro').selectedIndex = 0;
		$('semana_filtro').disabled = true;
		$('semana_filtro').selectedIndex = 0;
 		
	}
}

function habilitarSemana(){
	var comboMes = $('mes_filtro');
	if(comboMes.options[comboMes.selectedIndex].value != 'SelectMes'){
		$('semana_filtro').disabled = false;
		
	}
	else{
		$('semana_filtro').disabled = true;
		$('semana_filtro').selectedIndex = 0;
 		
	}
}


function buscarEventos(){
	var valorComboAnio = $('anio_filtro').options[$('anio_filtro').selectedIndex].value;
	var valorComboMes = $('mes_filtro').options[$('mes_filtro').selectedIndex].value;
	var valorComboSemana = $('semana_filtro').options[$('semana_filtro').selectedIndex].value;



	if(valorComboSemana == 'SelectSem'){
		if(valorComboMes == 'SelectMes'){
			fechaIni = 'SelectSem';
			fechaFin = 'SelectSem';

		}
		else{
			fechaIni = '01';
			fechaFin = '31';
		}
	}
	else{
		var valores = valorComboSemana.split('_');

		if(valores.length > 1){
			fechaIni = valores[0];
			fechaFin = valores[1];
		}
		else{
			fechaIni = valores[0];
			if(valorComboMes == '01' || valorComboMes == '03' || valorComboMes == '05' || valorComboMes == '07' || valorComboMes == '08' || valorComboMes == '10'  || valorComboMes == '12'){
				fechaFin = '31';
			}
			else if(valorComboMes == '02'){
				fechaFin = '28';
			}
			else if(valorComboMes == '04' || valorComboMes == '06' || valorComboMes == '09' || valorComboMes == '11'){
				fechaFin = '30';
			}
			else{
				fechaFin = 'SelectSem';
			}
		}
	}

	fechaIni += '/' + valorComboMes + '/' + valorComboAnio;
	fechaFin += '/' + valorComboMes + '/' + valorComboAnio;
	if(fechaIni == 'SelectSem/SelectMes/SelectAno'){
		fechaActual = new Date();
		diaActual = fechaActual.getDate();
		mesActual = fechaActual.getMonth();
		anioActual = fechaActual.getYear();
		anioActual += 1900;
		fechaIni = '01/01/2007';
		fechaFin = diaActual + '/' + mesActual + '/' + anioActual;
		
		if($('inputPalabras').value == '' && $('inputFecha').value == ''){
			alert('No selecciono ningun dato de busqueda');
			return;
		}
	}
	else if(fechaIni == 'SelectSem/SelectMes/' + valorComboAnio){
		fechaIni = '01/01/' + valorComboAnio;
		fechaFin = '31/12/' + valorComboAnio;
	}
	
	if($('searchField__article__fecha_alta__range-equal__dateLike').name == 'searchField__article__fecha_alta__range__dateLike'){
		$('searchField__article__fecha_alta__range-equal__dateLike').value = fechaIni + '-' + fechaFin;
	}
	else{
		var valorInputEqual = $('inputFecha').value;
		$('searchField__article__fecha_alta__range-equal__dateLike').value = valorInputEqual;
	}

 	document.formSearchArch.submit();
}

function activaFiltro(){
	if($('range').checked){
		$('inputFecha').value= '';
		$('inputFecha').disabled = true;
		$('imgFecha').onclick = function(){};
		$('anio_filtro').disabled = false;
		$('searchField__article__fecha_alta__range-equal__dateLike').name = 'searchField__article__fecha_alta__range__dateLike';
	}
	else{
		$('anio_filtro').value = 'SelectAno';
		$('mes_filtro').value = 'SelectMes';
		$('semana_filtro').value = 'SelectSem';
		$('anio_filtro').disabled = true;
		$('mes_filtro').disabled = true;
		$('semana_filtro').disabled = true;
		$('inputFecha').disabled = false;
 		$('imgFecha').onclick = function(){$("calendario").show();};
		$('searchField__article__fecha_alta__range-equal__dateLike').name = 'searchField__article__fecha_alta__equal__dateLike';
	}
}

function setInputValues(valueInputFecha, valueComboFecha){
	if(valueInputFecha == ''){
		$('range').checked = true;
		$('equal').checked = false;
		if (valueComboFecha) {
			var fechaSep = valueComboFecha.split('-');
			var fechaInicio = fechaSep[0];
			var fechaFinal = fechaSep[1];
			
			var fechaInicioSep = fechaInicio.split('/');
			var fechaInicioDia = fechaInicioSep[0];
			var fechaInicioMes = fechaInicioSep[1];
			var fechaInicioAno = fechaInicioSep[2];
			
			var fechaFinalSep = fechaFinal.split('/');
			var fechaFinalDia = fechaFinalSep[0];
			var fechaFinalMes = fechaFinalSep[1];
			var fechaFinalAno = fechaFinalSep[2];
			
			if (fechaInicioAno == fechaFinalAno) {
				var comboAno = $('anio_filtro')
				for (var i = 0; i < comboAno.options.length; i++) {
					if (comboAno.options[i].value == fechaInicioAno) {
						comboAno.options[i].selected = true;
						habilitarMes();
					}
				}
				
				var comboMes = $('mes_filtro')
				if(fechaInicioMes == fechaFinalMes){
					for (var i = 0; i < comboMes.options.length; i++){
						if(comboMes.options[i].value == fechaInicioMes){
							comboMes.options[i].selected = true;
							habilitarSemana();
						}
					}
				}
				if(fechaInicioDia == '01'){
					if (fechaFinalDia == '07'){
						fechaTotalDia = '01_07';
					}
					else{
						fechaTotalDia = 'SelectSem';
					}
				}
				else if(fechaInicioDia == '08'){
					fechaTotalDia = '08_14';
				}
				else if(fechaInicioDia == '15'){
					fechaTotalDia = '15_21';
				}
				else{
					fechaTotalDia = '22';
				}
				var comboSem = $('semana_filtro')
				for (var i = 0; i < comboSem.options.length; i++){
					if(comboSem.options[i].value == fechaTotalDia){
						comboSem.options[i].selected = true;
					}
				}
			}

		}
	}
	else{
		$('range').checked = false;
		$('equal').checked = true;
		$('inputFecha').value = valueInputFecha;
	}
	activaFiltro();
}
