/* acc-calendar v 1.0 / Calendario accesible en javascript.
   Copyright (C) 2007  Jorge Rumoroso
   http://www.niquelao.net

   Esta obra está hecha bajo una licencia de Creative Commons:
   http://creativecommons.org/licenses/by-nc-sa/2.5/es
*/
var formato = 'dd/mm/yyyy';
var fichero_consulta = '/js/days.php'; // Dirección que devuelve los días disponibles del mes y año
var dir_imagenes = 'img/'; //Direcctorio donde se encuentren las imágenes
var preposiciones = {
	ca : new Array('de','para'),
	es : new Array('de','para'),
	en : new Array('of','to')
	};
var carga = {
	ca : new Array('Carregant...'),
	es : new Array('Cargando...'),
	en : new Array('Loading...')
	};
var Meses = {
	ca : new Array('Gener','Febrer','Març','Abril','Maig','Juny','Juliol','Agost','Sep','Oct','Nov','Des'),
	es : new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'),
	en : new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')
	};
var encabezados = {
	ca : new Array('l','m','m','j','v','s','d'),
	es : new Array('Lunes','Martes','Miercoles','Jueves','Viernes','Sabado','Domingo'),
	en : new Array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')
	};
var texto_enlace = {
	ca : 'Calendari',
	es : 'Calendario',
	en : 'Calendar'
	};
var title_enlace = {
	ca : 'Desplegar per seleccionar la data per',
	es : 'Desplegar para seleccionar la fecha para',
	en : 'Unfold to select date to'
	};
var go_month = {
	ca : 'Accedir al mes',
	es : 'Acceder al mes',
	en : 'Go to month'
	};
var go_year = {
	ca : 'Accedir al any',
	es : 'Acceder al año',
	en : 'Go to year'
	};
var summary = {
	ca : 'Calendari amb els dies disponibles corresponents al mes de',
	es : 'Calendario con los días disponibles correspondientes al mes de',
	en : 'Calendar with the available days of'
	};
var close_text = {
	ca : 'X ',
	es : 'X ',
	en : 'X '
	};
var tit_dia = {
	ca : 'Seleccionar aquesta data',
	es : 'Seleccionar esta fecha',
	en : 'Select this date'
	};
var label_mes = {
	ca : 'Mes',
	es : 'Mes',
	en : 'Month'
	};
var label_year = {
	ca : 'Any',
	es : 'Año',
	en : 'Year'
	};
var label_class = { // el nombre de clase que haga aparecer el enlace para abrir el calendario asociado a un campo
	ca : 'fecha',
	es : 'fecha',
	en : 'fecha'
	};
var lang = document.getElementsByTagName('html')[0].getAttribute('lang');
if(!lang) 
	var lang = document.getElementsByTagName('html')[0].getAttribute('xml:lang');
if(!lang)
	lang = 'es';
else
	lang = lang.toLowerCase();
if(lang.substr(0,2) != 'es' && lang.substr(0,2) != 'en' && lang.substr(0,2) != 'ca')
	var lang = 'es';
var DiasPorMes = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var tope;
var destino;
var tope_mes = true;
var todact;
var Hoy_real = new Date();
var labels = document.getElementsByTagName('label');
var inputs = document.getElementsByTagName('input');
var nav = navigator.userAgent.toLowerCase(); 
this.nav = nav;
var destino;
var comp = 1900;
if(nav.indexOf("msie") != -1 || (nav.indexOf("opera") != -1 && parseFloat(navigator.appVersion,10) >= 9.5)) {
	comp = 0;
}
document.onkeydown = teclado;
var contador = 1;
function teclado(event){
	var key;
    if (!event)
      var event = window.event;
    if (window.event)
       key = window.event.keyCode;
    else if (event.which)
       key = event.which;
    else
       return true;
    if (!key)
       return true;
    if (key == 27 || key == 32 && document.getElementById('bio_calendar')){
		cierra(destino)
		return false;	  
	}
    return true;
}
function insertAfter(previo,nodo) {
	var parent_previo = previo.parentNode;
	if (previo.nextSibling) {
		parent_previo.insertBefore(nodo, previo.nextSibling)
	} else {
		parent_previo.appendChild(nodo);
	}
}
function cierra(destino) {
	if(document.getElementById('bio_calendar')){
		document.getElementById('bio_calendar').parentNode.removeChild(document.getElementById('bio_calendar'));
	        if(destino) {
        	    if (document.getElementById(destino).disabled == false){
	                document.getElementById(destino).focus()
        	    }
	        }
        }
}
function padre(element,tag) {
	if (element == null)
		return null;
	else if (element.nodeType == 1 && element.tagName.toLowerCase() == tag.toLowerCase())
		return (element)
	else
		return padre(element.parentNode,tag);
}
function zindex(element) {
	if (element == null)
		return null;
	else if (element.nodeType == 1 && element.tagName.toLowerCase() != 'body')
		element.parentNode.style.zIndex = 1000 + contador;
	else
		return zindex(element.parentNode)
}
function obten_texto(element) {
	if (element.nodeType == 3) return element.nodeValue;
	var texto = new Array(),i=0;
	while(element.childNodes[i]) {
		texto[texto.length] = obten_texto(element.childNodes[i]);
		i++;
	}
	return texto.join("");
}
function carga_estilos() {
	var scripts = document.getElementsByTagName('script');
	for (var i = 0; i < scripts.length; i++) {
		if(scripts[i].src.indexOf('acc_calendar.js') > -1) {
			var ruta = scripts[i].src.replace('.js','.css');
			var link_style = document.createElement('link');
			link_style.setAttribute('rel','stylesheet');
			link_style.setAttribute('type','text/css');
			link_style.setAttribute('href',ruta);
			insertAfter(scripts[i],link_style)
		}
	}
}
function cargaLinks() {
	
	for (var i = 0; i < labels.length; i++) {
		var asociado = labels[i].htmlFor;
		var elasociado = document.getElementById(asociado);
		if(!document.getElementById('cal_' + asociado)){
			var destinos = new Array(); 
			if(elasociado.type == 'text' && elasociado.className.indexOf(label_class[lang.substr(0,2)]) != -1) {
				if(elasociado.className) {
					var group = elasociado.className.split(' ');
					for(var a = 0; a < group.length; a++){
						if(group[a].indexOf(label_class[lang.substr(0,2)]) != -1 && group[a].length > label_class[lang.substr(0,2)].length){
							destinos = getElementsByClassName(document, 'input', group[a])
						}
					}
					if(destinos.length == 3){
						elasociado = destinos[0];
						i = i + 2;
					}
				}
				
				var dest = elasociado.id;
				var enl_cal = document.createElement('a');
				enl_cal.className = 'enl_cal';
				if(destinos.length == 3) enl_cal.className = 'enl_cal_group';
				enl_cal.id = 'cal_' + dest;
				var enl_cal_img = document.createElement('img'); 
				enl_cal_img.setAttribute('alt',texto_enlace[lang.substr(0,2)]);
				enl_cal_img.setAttribute('src',dir_imagenes + '/acc_calendar.png');
				enl_cal.appendChild(enl_cal_img);
				var rango = 0;
				if(elasociado.className.indexOf('rang') != -1) {
					var jar = elasociado.className.split('rang');
					var fin = jar[1].indexOf(' ');
					if (fin != -1)
						rango = jar[1].substr(0,fin);
					else
						rango = jar[1];
				}
				if(elasociado.className.indexOf('todnact') != -1)
					todact = false
				else
					todact = true;
				var cons_disp = false;
				if(elasociado.className.indexOf('disp') != -1)
					cons_disp = true;
				enl_cal.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ',' + Hoy_real.getMonth() + ',"","","' + dest +'",' + rango + ')');
				enl_cal.setAttribute('title',title_enlace[lang.substr(0,2)] + ' ' + obten_texto(labels[i]));
					if(destinos.length < 3){
						if(padre(elasociado,'label')){
							insertAfter(padre(elasociado,'label'),enl_cal);
						}else{
							insertAfter(elasociado,enl_cal);
						}
					}else{
						elasociado.parentNode.parentNode.insertBefore(enl_cal,elasociado.parentNode)
					}
					if(!enl_cal.parentNode.style.position)
						enl_cal.parentNode.style.position = 'relative';
			}
		}
	} 
}
Array.prototype.indexOf = function(s) {
	for (var x=0;x<this.length;x++)
		if(this[x] == s)
			return x+1;
}
function calendario(cons_disp,todact,mes,year,nuevo,id,rango,dia) {
	var calendar = document.getElementById('bio_calendar')
	if(id != destino && calendar){
		cierra(destino)
		calendar = false;
	}
	if (calendar){
		var all_el = new Array('nav_mes','label_Meses');
		for(i = 0; i < all_el.length ; i++) {
			if(document.getElementById(all_el[i]))
				calendar.removeChild(document.getElementById(all_el[i]));
		}
		if(rango > 0) {
			calendar.removeChild(document.getElementById('nav_year'));
			calendar.removeChild(document.getElementById('label_year'));
		}
		document.getElementById('calendario').removeChild(document.getElementById('caption'));
		document.getElementById('calendario').removeChild(document.getElementById('tbody'));
	}else{
			calendar = document.createElement('div');
	}
	calendar.id = 'bio_calendar';
	if(!document.getElementById('calendario')){
		insertAfter(document.getElementById('cal_' + id),calendar);
		zindex(calendar);
		calendar.style.top = (document.getElementById(id).offsetHeight + document.getElementById(id).offsetTop) + 'px';
		calendar.style.left = (document.getElementById('cal_' + id).offsetLeft-2*(calendar.offsetWidth/3)) + 'px';
	}
	if(!document.getElementById('close_it')) {
		var close_it = document.createElement('div');
		close_it.id = 'close_it';
		var close_it_enl = document.createElement('a');
		var close_it_enl_text = document.createTextNode(close_text[lang.substr(0,2)]);
		close_it_enl.setAttribute('href','javascript:cierra("' + id +'")');
		close_it_enl.appendChild(close_it_enl_text);
		close_it.appendChild(close_it_enl);
		calendar.appendChild(close_it);
	}
	 
	var en_carga = document.createElement('img');
	en_carga.id = 'en_carga';
	en_carga.src = 'img/loading.gif';
	en_carga.setAttribute('alt',carga[lang.substr(0,2)]);
	calendar.appendChild(en_carga)
	destino = id;
	var Hoy = new Date();
	if(document.getElementById(id).className.indexOf('post') != -1) {
		tope = 2;
	}else if(document.getElementById(id).className.indexOf('prev') != -1) {
		tope = 1;
	} else{
		tope = 0;
	}
	if(!(mes+1)){
		mes = Hoy.getMonth();
	}
	if(!year){
		year = Hoy.getYear()
	}

	ajax_izar.sendRequest(cons_disp,fichero_consulta,function(req,val,cons_disp) {
		if(destino == id){
		 	var disponibles = new Array;
		 	if(val){
				var disponibles = req.responseText.split(',');
				for(var i = 0; i < disponibles.length; i++)
					disponibles[i] = disponibles[i] + 'd';
			}else{
				for(var i = 0; i <= 31; i++)
					disponibles.push( i + 'd');
			}
			if(id != destino) cierra(destino)
			Hoy.setMonth(mes);
			Hoy.setYear(year+comp);
			Anyo = Hoy.getYear()+comp;
			if (((Anyo % 4 == 0) && (Anyo % 100 != 0)) || (Anyo % 400 == 0)){
		    	DiasPorMes[1] = 29;
			}else{
		    	DiasPorMes[1] = 28;
			}
			NDias =DiasPorMes[mes];
			PrimerDia = Hoy;
			PrimerDia.setDate(1);
			if(lang == 'en-us')
				PrimerDia.setDate(2);
			Comienzo = PrimerDia.getDay();
			if(Comienzo == 0) {
				Comienzo = 7;
			}
			var total = Comienzo+NDias;
			var celda = new Array();
			for(var i = 0; i < Comienzo-1; i++){
				celda[i] = '';
			}
			for(var i = Comienzo-1; i < total-1; i++){
				celda[i] = i-Comienzo+2;
			}
			var resto = 7 - (i % 7);
			if(resto < 7){
				var white = celda.length+resto;
				for(var cont = celda.length; cont < white; cont++){
					celda[cont] = '';
				}
			}
			var semanas = (celda.length/7)-1;
			var calendario_tbody_tr_td = new Array();
			for(var i = 0; i < celda.length; i++){
				calendario_tbody_tr_td[i] = document.createElement('td');
				var calendario_tbody_tr_td_text = document.createTextNode(celda[i]);
				if(disponibles.indexOf(celda[i] + 'd') >= 0){
					var marc_dia = document.createElement('a');
					marc_dia.id = 'dat_' + celda[i];
					marc_dia.setAttribute('href','javascript:send_date(' + cons_disp + ',' + todact + ',"' + calendario_tbody_tr_td_text.nodeValue + '/' + (mes+1) + '/' + (year+comp) + '","'+ id +'",'+ rango +')');
					marc_dia.onclick = function() {
						var day_week = document.getElementById('nombre_dia_'+id);
						if(day_week) {
							if(day_week.tagName.toLowerCase() != 'input') {
								if(document.getElementById('nw_'+id))
									day_week.removeChild(document.getElementById('nw_'+id));
								var nw = document.createElement('span');
								nw.id = 'nw_'+id;
								nw.appendChild(document.createTextNode(encabezados[lang.substr(0,2)][padre(this.parentNode,'td').id.substring(3,4)]));
								day_week.appendChild(nw);
							}else{
								day_week.value = encabezados[lang.substr(0,2)][padre(this.parentNode,'td').id.substring(3,4)];
							}
						}
					}
					marc_dia.setAttribute('title',tit_dia[lang.substr(0,2)]);
				}else{
					var marc_dia = document.createElement('span');
				}
				if(celda[i] == Hoy_real.getDate() && mes == Hoy_real.getMonth() && year == Hoy_real.getYear()) {
					var strong = document.createElement('strong');
					calendario_tbody_tr_td[i].className = 'hoy';
					if(todact) {
						marc_dia.appendChild(calendario_tbody_tr_td_text);
						strong.appendChild(marc_dia);
						calendario_tbody_tr_td[i].className = 'act';
					}else{
						strong.appendChild(calendario_tbody_tr_td_text);
						calendario_tbody_tr_td[i].className = 'inact';
					}
					calendario_tbody_tr_td[i].appendChild(strong);
				}else if(celda[i] > 0){
					if((((celda[i] < Hoy_real.getDate()) && (mes == Hoy_real.getMonth() && year == Hoy_real.getYear())) || (mes < Hoy_real.getMonth() && year == Hoy_real.getYear())  || (year < Hoy_real.getYear())) && celda[i] >0){
						if( tope != 2){
							marc_dia.appendChild(calendario_tbody_tr_td_text);
							calendario_tbody_tr_td[i].appendChild(marc_dia);
							calendario_tbody_tr_td[i].className = 'act';
						}else{
							calendario_tbody_tr_td[i].appendChild(calendario_tbody_tr_td_text);
							calendario_tbody_tr_td[i].className = 'inact';
						}
					} else {
						if( tope != 1){
							marc_dia.appendChild(calendario_tbody_tr_td_text);
							calendario_tbody_tr_td[i].appendChild(marc_dia);
							calendario_tbody_tr_td[i].className = 'act';
						}else{
							calendario_tbody_tr_td[i].appendChild(calendario_tbody_tr_td_text);
							calendario_tbody_tr_td[i].className = 'inact';
						}
					}
				} else {
					calendario_tbody_tr_td[i].appendChild(calendario_tbody_tr_td_text);
				}
				if(celda[i] == dia)
					calendario_tbody_tr_td[i].className = 'elect ' + calendario_tbody_tr_td[i].className;
			}
			if(!document.getElementById('calendario')) {
				var calendario = document.createElement('table');
				calendario.id = 'calendario';
			}else{
				calendario = document.getElementById('calendario')
			}
			calendario.setAttribute('summary',summary[lang.substr(0,2)] + ' ' + Meses[lang.substr(0,2)][mes] + ' ' + preposiciones[lang.substr(0,2)][0] + ' ' + Anyo);
			var calendario_caption = document.createElement('caption');
			calendario_caption.id = 'caption';
			var texto_caption = document.createTextNode( Meses[lang.substr(0,2)][mes] + ' ' + (year+comp));
			calendario_caption.appendChild(texto_caption);
			calendario.appendChild(calendario_caption);
			if(lang != 'en-us' && !document.getElementById('calendario')) {
				var nor_day = document.createElement('colgroup');
				nor_day.setAttribute('span','5');
				var week_day = document.createElement('colgroup');
				week_day.className = 'end';
				week_day.setAttribute('span','2');
				calendario.appendChild(nor_day);
				calendario.appendChild(week_day);
			}
			var calendario_thead = document.createElement('thead');
			var calendario_thead_tr = document.createElement('tr');
			for (var i = 0; i < encabezados[lang.substr(0,2)].length; i++) {
				var calendario_thead_tr_th = document.createElement('th');
				calendario_thead_tr_th.setAttribute('scope','col');
				var calendario_thead_tr_th_abbr = document.createElement('abbr');
				var n = i;
				if(lang == 'en-us') {
					n = i - 1;
					if(n == -1)
						n = 6;
					else if(n+1 == encabezados.length)
						n = 0;
				}
				calendario_thead_tr_th_abbr.setAttribute('title',encabezados[lang.substr(0,2)][n]);
				var calendario_thead_tr_th_abbr_text = document.createTextNode(encabezados[lang.substr(0,2)][n].substr(0,3));
				calendario_thead_tr_th_abbr.appendChild(calendario_thead_tr_th_abbr_text);
				calendario_thead_tr_th.appendChild(calendario_thead_tr_th_abbr);
				calendario_thead_tr.appendChild(calendario_thead_tr_th);
			}
			calendario_thead.appendChild(calendario_thead_tr);
			if(!document.getElementById('calendario'))
				calendario.appendChild(calendario_thead);
			var calendario_tbody = document.createElement('tbody');
			calendario_tbody.id = 'tbody';
			for(var i = 0; i <= semanas; i++){
				var calendario_tbody_tr = document.createElement('tr');
				for(a = 0; a < 7; a++){
					if(calendario_tbody_tr_td[(i*7)+a]) {
						calendario_tbody_tr_td[(i*7)+a].id = 'dw_' + a;
						if(a == 5) 
							calendario_tbody_tr_td[(i*7)+a].className = 'sat ' + calendario_tbody_tr_td[(i*7)+a].className;
						else if (a == 6)
							calendario_tbody_tr_td[(i*7)+a].className = 'sun ' + calendario_tbody_tr_td[(i*7)+a].className;
						calendario_tbody_tr.appendChild(calendario_tbody_tr_td[(i*7)+a]);
					}
				}
				calendario_tbody.appendChild(calendario_tbody_tr);
			}
			calendario.appendChild(calendario_tbody);
			if(!document.getElementById('calendario')){
				zindex(calendar);
				contador = contador + 1;
				calendar.style.top = (document.getElementById(id).offsetHeight + document.getElementById(id).offsetTop) + 'px';
				calendar.style.left = (document.getElementById('cal_' + id).offsetLeft-2*(calendar.offsetWidth/3)) + 'px';
			}
			crea_nav_year_select(cons_disp,todact,mes,year,id,rango);
			//crea_nav_mes_select(cons_disp,todact,mes,year,id,rango);
			en_carga.parentNode.removeChild(en_carga);
			calendar.appendChild(calendario);
			crea_nav_mes(cons_disp,todact,mes,year,id,rango);
			crea_nav_year(cons_disp,todact,mes,year,id,rango);
			if(document.getElementById('nav_year_select')) {
				if(rango == 0)
					document.getElementById('nav_mes_select').focus();
				else
					document.getElementById('nav_year_select').focus();
			}
		}	
	},'month=' + (mes+1) + '&year=' + (year+comp))
	if(calendar)
		zindex(calendar);
}
function crea_nav_mes(cons_disp,todact,mes,year,id,rango){
	var nav_mes = document.createElement('ul');
	nav_mes.id = 'nav_mes';
	var nav_mes_li = document.createElement('li');
	if(mes-1 == -1) {
		var prev_mes = 11;
		var prev_year = year-1;
	}else{
		var prev_mes = mes-1;
		var prev_year = year;
	}
	//var nav_mes_li_text = document.createTextNode(Meses[lang.substr(0,2)][prev_mes]);
	var nav_mes_li_text = document.createTextNode("<<");
	var nav_mes_li_a = document.createElement('a');
	nav_mes_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' +  todact + ','+ prev_mes + ',' + prev_year + ',"","'+id+'",' + rango +')');
	nav_mes_li_a.appendChild(nav_mes_li_text);
	nav_mes_li_a.setAttribute('title',go_month[lang.substr(0,2)]);
	nav_mes_li.appendChild(nav_mes_li_a);
	var nav_mes_post_li = document.createElement('li');
	nav_mes_li.className = 'post';
	if(mes == 11) {
		var next_mes = 0;
		var next_year = year+1;
	}else{
		var next_mes = mes+1;
		var next_year = year;
	}
	//var nav_mes_post_li_text = document.createTextNode(Meses[lang.substr(0,2)][next_mes]);
	var nav_mes_post_li_text = document.createTextNode(">>");
	
	var nav_mes_post_li_a = document.createElement('a');
	nav_mes_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' +  todact + ','+ next_mes + ',' + next_year + ',"","'+id+'",' + rango +')');
	nav_mes_post_li_a.appendChild(nav_mes_post_li_text);
	nav_mes_post_li_a.setAttribute('title',go_month[lang.substr(0,2)]);
	nav_mes_post_li.appendChild(nav_mes_post_li_a);
	switch ( tope ) { 
		case 0:
			if(prev_year >= (Hoy_real.getYear()-rango))
				nav_mes.appendChild(nav_mes_li);
			if(next_year <= (Hoy_real.getYear()+rango))
				nav_mes.appendChild(nav_mes_post_li);
			break
		case 1:
			if(prev_year >= (Hoy_real.getYear()-rango))
				nav_mes.appendChild(nav_mes_li);
			if(next_year <= (Hoy_real.getYear()+1) && next_year <= (Hoy_real.getYear()+rango)){
				if((tope_mes && next_mes <= Hoy_real.getMonth()) || next_year < Hoy_real.getYear()){
					nav_mes.appendChild(nav_mes_post_li);
				}
			}
			break
		case 2:
			if(prev_year >= Hoy_real.getYear() && prev_year >= (Hoy_real.getYear()-rango)){
				if((tope_mes && prev_mes >= Hoy_real.getMonth()) || next_year > Hoy_real.getYear()){
					nav_mes.appendChild(nav_mes_li);
				}
			}
			if(next_year <= (Hoy_real.getYear()+rango))
				nav_mes.appendChild(nav_mes_post_li);
			break
	}
	document.getElementById('bio_calendar').appendChild(nav_mes);
}
function crea_nav_mes_select(cons_disp,todact,mes,year,id,rango){
	var nav_mes_select = document.createElement('select');
	nav_mes_select.id = 'nav_mes_select';
	var nav_mes_select_label = document.createElement('label');
	nav_mes_select_label.htmlFor =  'nav_mes_select';
	nav_mes_select_label.id =  'label_Meses';
	var nav_mes_select_label_text = document.createTextNode(label_mes[lang.substr(0,2)]);
	if(year == Hoy_real.getYear()) {
		switch ( tope ) {
			case 0:
				var from = 0;
				var to = Meses[lang.substr(0,2)].length;
				break
			case 1:
				var from = 0;
				var to = Hoy_real.getMonth()+1;
				break
			case 2:
				var from = Hoy_real.getMonth();
				var to = Meses[lang.substr(0,2)].length;
				break
		}
	}else{
		var from = 0;
		var to = Meses[lang.substr(0,2)].length;
	}
	for(i = from; i < to; i++){
		var nav_mes_select_opt = document.createElement('option');
		if(i == mes){
			nav_mes_select_opt.setAttribute('selected','selected');
		}
		nav_mes_select_opt.innerHTML = Meses[lang.substr(0,2)][i];
		nav_mes_select.appendChild(nav_mes_select_opt)
	}
	nav_mes_select.onchange = function() {
		switch ( tope ) {
			case 0:
				calendario(cons_disp,todact,nav_mes_select.selectedIndex ,year,'',id,rango)
				break
			case 1:
				if((tope_mes && year == Hoy_real.getYear() && nav_mes_select.selectedIndex <= Hoy_real.getMonth()) || year < Hoy_real.getYear()){
					calendario(cons_disp,todact,nav_mes_select.selectedIndex ,year,'',id,rango)
				}else{
					nav_mes_select.selectedIndex = mes
				}
				break
			case 2:
				if((tope_mes && year > Hoy_real.getYear()) || (tope_mes && year == Hoy_real.getYear() && (nav_mes_select.selectedIndex+Hoy_real.getMonth()) >= Hoy_real.getMonth()) || year > Hoy_real.getYear()){
					if(tope_mes && year > Hoy_real.getYear()){
						calendario(cons_disp,todact,nav_mes_select.selectedIndex ,year,'',id,rango)
					}else{
						calendario(cons_disp,todact,nav_mes_select.selectedIndex+Hoy_real.getMonth() ,year,'',id,rango)
					}
				}else{
					nav_mes_select.selectedIndex = mes
				}
				break
		}
	}
	nav_mes_select_label.appendChild(nav_mes_select_label_text);
	nav_mes_select_label.appendChild(nav_mes_select);
	if(document.getElementById('nav_mes_select'))
		document.getElementById('nav_mes_select').focus();
	if(to-from)
		document.getElementById('bio_calendar').appendChild(nav_mes_select_label);
}
function crea_nav_year(cons_disp,todact,mes,year,id,rango){
	var nav_year = "";
	var nav_year = document.createElement('ul');
	nav_year.id = 'nav_year';
	var nav_year_li = document.createElement('li');
	nav_year_li.className = 'post';
	//var nav_year_li_text = document.createTextNode(year+comp-1);
	var nav_year_li_text = document.createTextNode("");
	var nav_year_li_a = document.createElement('a');
	nav_year_li_a.setAttribute('title',go_year[lang.substr(0,2)]);
	var nav_year_post_li = document.createElement('li');
	//var nav_year_post_li_text = document.createTextNode(year+comp+1);
	var nav_year_post_li_text = document.createTextNode("");
	var nav_year_post_li_a = document.createElement('a');
	nav_year_post_li_a.setAttribute('title',go_year[lang.substr(0,2)]);
	if(!mes) mes = 0;
	nav_year_li_a.appendChild(nav_year_li_text);
	nav_year_li.appendChild(nav_year_li_a);
	nav_year_post_li_a.appendChild(nav_year_post_li_text);
	nav_year_post_li.appendChild(nav_year_post_li_a);
	switch ( tope ) { 
		case 0:
			nav_year_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year-1) + ',"","'+ id +'",' + rango +')');
			nav_year_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year+1) + ',"","'+ id +'",' + rango +')');
			if((year-1) >= (Hoy_real.getYear() - rango))
				nav_year.appendChild(nav_year_li);
			if(year+1 <= Hoy_real.getYear() + rango)
				nav_year.appendChild(nav_year_post_li);
			break
		case 1:
			nav_year_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year-1) + ',"","'+ id +'",' + rango +')');
			if(tope_mes && mes <= Hoy_real.getMonth()){
				nav_year_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year+1) + ',"","'+ id +'",' + rango +')');
			}else{
				nav_year_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ Hoy_real.getMonth() + ',' + (year+1) + ',"","'+ id +'",' + rango +')');
			}
			if((year-1) >= (Hoy_real.getYear() - rango))
				nav_year.appendChild(nav_year_li);
			if(year+1 <= Hoy_real.getYear())
				nav_year.appendChild(nav_year_post_li);
			break
		case 2:
			if(tope_mes && mes >= Hoy_real.getMonth()){
				nav_year_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ',' + mes + ',' + (year-1) + ',"","'+ id +'",' + rango +')');
			}else{
				nav_year_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ Hoy_real.getMonth() + ',' + (year-1) + ',"","'+ id +'",' + rango +')');
			}
			nav_year_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year+1) + ',"","'+ id +'",' + rango +')');
			if(year-1 >= Hoy_real.getYear())
				nav_year.appendChild(nav_year_li);
			if((year+1) <= (Hoy_real.getYear() + rango))
				nav_year.appendChild(nav_year_post_li);
			break
	}
	if(rango > 0) 
		document.getElementById('bio_calendar').appendChild(nav_year);
}
function crea_nav_year_select(cons_disp,todact,mes,year,id,rango){
	var nav_year_select = document.createElement('select');
	nav_year_select.id = 'nav_year_select';
	var nav_year_select_label = document.createElement('label');
	nav_year_select_label.htmlFor =  'nav_year_select';
	nav_year_select_label.id =  'label_year';
	var nav_year_select_label_text = document.createTextNode(label_year[lang.substr(0,2)]);
	var tope_pre = Hoy_real.getYear() - rango;
	var tope_post = Hoy_real.getYear() + rango;
	if ( tope ==  1)
		tope_post = Hoy_real.getYear();
	else if(tope == 2)
		tope_pre = Hoy_real.getYear();
	tope_pre = tope_pre + comp;
	tope_post = tope_post + comp;
	for(i = tope_pre; i<=tope_post; i++){
		var nav_year_select_opt = document.createElement('option');
		if(i == (year + comp) ){
			nav_year_select_opt.setAttribute('selected','selected');
		}
		nav_year_select_opt.innerHTML = i;
		nav_year_select.appendChild(nav_year_select_opt)
	}
	nav_year_select.onchange = function() {
		switch ( tope ) { 
			case 0:
				calendario(cons_disp,todact,mes ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				break
			case 1:
				if(tope_mes && (nav_year_select.options[nav_year_select.selectedIndex].text-comp < Hoy_real.getYear() || (nav_year_select.options[nav_year_select.selectedIndex].text-comp == Hoy_real.getYear() && mes <= Hoy_real.getMonth()))){
					calendario(cons_disp,todact,mes ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				}else{
					calendario(cons_disp,todact,Hoy_real.getMonth() ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				}
				break
			case 2:
				if(tope_mes &&((nav_year_select.options[nav_year_select.selectedIndex].text-comp > Hoy_real.getYear()) || ((nav_year_select.options[nav_year_select.selectedIndex].text-comp == Hoy_real.getYear()) && mes >= Hoy_real.getMonth()))){
					calendario(cons_disp,todact,mes ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				}else{
					calendario(cons_disp,todact,Hoy_real.getMonth() ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				}
				break
		}
	}
	//nav_year_select_label.appendChild(nav_year_select_label_text);
	//nav_year_select_label.appendChild(nav_year_select);
	if(rango > 0)
		document.getElementById('bio_calendar').appendChild(nav_year_select_label);
}
function getElementsByClassName(oElm, strTagName, oClassNames){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var arrRegExpClassNames = new Array();
    if(typeof oClassNames == "object"){


        for(var i = 0; i < oClassNames.length; i++){

            arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
        }
    }
    else{
        arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
    }
    var oElement;
    var bMatchesAll;
    for(var j=0; j<arrElements.length; j++){
        oElement = arrElements[j];
        bMatchesAll = true;
        for(var k=0; k<arrRegExpClassNames.length; k++){
            if(!arrRegExpClassNames[k].test(oElement.className)){
                bMatchesAll = false;
                break;                      
            }
        }
        if(bMatchesAll){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}

function send_date(cons_disp,todact,date,destino,rango) {
		var fecha = date.split('/');
		var day = fecha[0];
		var month = fecha[1];
		var year = fecha[2];
		var destinos = new Array();
		var long_dia = formato.lastIndexOf('d')- formato.indexOf('d') +1;
		var long_mes = formato.lastIndexOf('m')- formato.indexOf('m') +1;
		var long_year = formato.lastIndexOf('y')- formato.indexOf('y') +1;
		if(long_year < 2 || long_year == 3)
			long_year = 2;
		if(long_year > 4)
			long_year = 4;
		var fecha_format = formato;
		if(fecha[0].length == 1 && long_dia >= 2)
			fecha[0] = '0' + fecha[0]
		fecha_format = fecha_format.replace('d',fecha[0]);
		for(i = 0; i <= long_dia; i++) 
			fecha_format = fecha_format.replace('d','');
		if(fecha[1].length == 1 && long_mes >= 2)
			fecha[1] = '0' + fecha[1]
		fecha_format = fecha_format.replace('m',fecha[1]);
		for(i = 0; i <= long_mes; i++) 
			fecha_format = fecha_format.replace('m','');
		var inic = 0;
		if(long_year == 2)
			inic = 2;
		fecha_format = fecha_format.replace('y',fecha[2].substr(inic,long_year));
		for(i = 0; i <= long_year; i++) 
			fecha_format = fecha_format.replace('y','');
		var	input_destino =	document.getElementById(destino)
		var group = input_destino.className.split(' ');
		for(var i = 0; i < group.length; i++){
			if(group[i].indexOf(label_class[lang.substr(0,2)]) != -1 && group[i].length > label_class[lang.substr(0,2)].length){
				destinos = getElementsByClassName(document, 'input', group[i])
			}
		}
		if(destinos.length == 3){
			for(var i = 0; i <= 2; i++){
				if(destinos[i].className.indexOf('day') != -1) destinos[i].value = fecha[0];
				if(destinos[i].className.indexOf('month') != -1) destinos[i].value = fecha[1];
				if(destinos[i].className.indexOf('year') != -1) destinos[i].value = fecha[2];
			}
			cierra(destinos[2].id);
		}else{
			input_destino.value = fecha_format;
			cierra(destino);
		}
			document.getElementById('cal_' + destino).setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ',' + (fecha[1]-1) + ', ' + (fecha[2]-comp) + ' ,"","' + destino +'",' + rango + ',' + fecha[0] + ')');
}
ajax_izar = {
	XMLHttpFactories: [
		function () {return new XMLHttpRequest()},
		function () {return new ActiveXObject("Msxml2.XMLHTTP")},
		function () {return new ActiveXObject("Msxml3.XMLHTTP")},
		function () {return new ActiveXObject("Microsoft.XMLHTTP")},
		],
	sendRequest: function(send,url,callback,postData) {
		if(send){
			var req = ajax_izar.createXMLHTTPObject();
			if (!req) return;
			var method = (postData) ? "POST" : "GET";
			req.open(method,url,true);
			req.setRequestHeader('User-Agent','XMLHTTP/1.0');
			if (postData)
				req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				req.onreadystatechange = function () {
				if (req.readyState != 4) return;
				if (req.status != 200 && req.status != 304) {
					callback(req,false,send);
					return;
				}else{
					callback(req,true,send);
				}
			}
			if (req.readyState == 4) return;
				req.send(postData);
		}else{
			callback(req,false,send);
		}
	},
	createXMLHTTPObject: function(url,callback,postData) {
		var xmlhttp = false;
		for (var i = 0; i < ajax_izar.XMLHttpFactories.length; i++)
		{
			try {
				xmlhttp = ajax_izar.XMLHttpFactories[i]();
			}
			catch (e) {


				continue;
			}
			break;
		}
		return xmlhttp;
	}

}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
addLoadEvent(carga_estilos);
addLoadEvent(cargaLinks);


/* acc-calendar v 1.0 / Calendario accesible en javascript.
   Copyright (C) 2007  Jorge Rumoroso
   http://www.niquelao.net

   Esta obra está hecha bajo una licencia de Creative Commons:
   http://creativecommons.org/licenses/by-nc-sa/2.5/es
*/
var formato = 'dd/mm/yyyy';
var fichero_consulta = '/js/days.php'; // Dirección que devuelve los días disponibles del mes y año
var dir_imagenes = 'img/'; //Direcctorio donde se encuentren las imágenes
var preposiciones = {
	ca : new Array('de','para'),
	es : new Array('de','para'),
	en : new Array('of','to')
	};
var carga = {
	ca : new Array('Carregant...'),
	es : new Array('Cargando...'),
	en : new Array('Loading...')
	};
var Meses = {
	ca : new Array('Gener','Febrer','Març','Abril','Maig','Juny','Juliol','Agost','Sep','Oct','Nov','Des'),
	es : new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'),
	en : new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')
	};
var encabezados = {
	ca : new Array('Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte','Diumenge'),
	es : new Array('Lunes','Martes','Miercoles','Jueves','Viernes','Sabado','Domingo'),
	en : new Array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')
	};
var texto_enlace = {
	ca : 'Calendari',
	es : 'Calendario',
	en : 'Calendar'
	};
var title_enlace = {
	ca : 'Desplegar per seleccionar la data per',
	es : 'Desplegar para seleccionar la fecha para',
	en : 'Unfold to select date to'
	};
var go_month = {
	ca : 'Accedir al mes',
	es : 'Acceder al mes',
	en : 'Go to month'
	};
var go_year = {
	ca : 'Accedir al any',
	es : 'Acceder al año',
	en : 'Go to year'
	};
var summary = {
	ca : 'Calendari amb els dies disponibles corresponents al mes de',
	es : 'Calendario con los días disponibles correspondientes al mes de',
	en : 'Calendar with the available days of'
	};
var close_text = {
	ca : 'Tancar el calendari',
	es : 'Cerrar el calendario',
	en : 'Close calendar'
	};
var tit_dia = {
	ca : 'Seleccionar aquesta data',
	es : 'Seleccionar esta fecha',
	en : 'Select this date'
	};
var label_mes = {
	ca : 'Mes',
	es : 'Mes',
	en : 'Month'
	};
var label_year = {
	ca : 'Any',
	es : 'Año',
	en : 'Year'
	};
var label_class = { // el nombre de clase que haga aparecer el enlace para abrir el calendario asociado a un campo
	ca : 'fecha',
	es : 'fecha',
	en : 'fecha'
	};
var lang = document.getElementsByTagName('html')[0].getAttribute('lang');
if(!lang) 
	var lang = document.getElementsByTagName('html')[0].getAttribute('xml:lang');
if(!lang)
	lang = 'es';
else
	lang = lang.toLowerCase();
if(lang.substr(0,2) != 'es' && lang.substr(0,2) != 'en' && lang.substr(0,2) != 'ca')
	var lang = 'es';
var DiasPorMes = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var tope;
var destino;
var tope_mes = true;
var todact;
var Hoy_real = new Date();
var labels = document.getElementsByTagName('label');
var inputs = document.getElementsByTagName('input');
var nav = navigator.userAgent.toLowerCase(); 
this.nav = nav;
var destino;
var comp = 1900;
if(nav.indexOf("msie") != -1 || (nav.indexOf("opera") != -1 && parseFloat(navigator.appVersion,10) >= 9.5)) {
	comp = 0;
}
document.onkeydown = teclado;
var contador = 1;
function teclado(event){
	var key;
    if (!event)
      var event = window.event;
    if (window.event)
       key = window.event.keyCode;
    else if (event.which)
       key = event.which;
    else
       return true;
    if (!key)
       return true;
    if (key == 27 || key == 32 && document.getElementById('bio_calendar')){
		cierra(destino)
		return false;	  
	}
    return true;
}
function insertAfter(previo,nodo) {
	var parent_previo = previo.parentNode;
	if (previo.nextSibling) {
		parent_previo.insertBefore(nodo, previo.nextSibling)
	} else {
		parent_previo.appendChild(nodo);
	}
}
function cierra(destino) {
	if(document.getElementById('bio_calendar')){
		document.getElementById('bio_calendar').parentNode.removeChild(document.getElementById('bio_calendar'));
	        if(destino) {
        	    if (document.getElementById(destino).disabled == false){
	                document.getElementById(destino).focus()
        	    }
	        }
        }
}
function padre(element,tag) {
	if (element == null)
		return null;
	else if (element.nodeType == 1 && element.tagName.toLowerCase() == tag.toLowerCase())
		return (element)
	else
		return padre(element.parentNode,tag);
}
function zindex(element) {
	if (element == null)
		return null;
	else if (element.nodeType == 1 && element.tagName.toLowerCase() != 'body')
		element.parentNode.style.zIndex = 1000 + contador;
	else
		return zindex(element.parentNode)
}
function obten_texto(element) {
	if (element.nodeType == 3) return element.nodeValue;
	var texto = new Array(),i=0;
	while(element.childNodes[i]) {
		texto[texto.length] = obten_texto(element.childNodes[i]);
		i++;
	}
	return texto.join("");
}
function carga_estilos() {
	var scripts = document.getElementsByTagName('script');
	for (var i = 0; i < scripts.length; i++) {
		if(scripts[i].src.indexOf('acc_calendar.js') > -1) {
			var ruta = scripts[i].src.replace('.js','.css');
			var link_style = document.createElement('link');
			link_style.setAttribute('rel','stylesheet');
			link_style.setAttribute('type','text/css');
			link_style.setAttribute('href',ruta);
			insertAfter(scripts[i],link_style)
		}
	}
}
function cargaLinks() {
	
	for (var i = 0; i < labels.length; i++) {
		var asociado = labels[i].htmlFor;
		var elasociado = document.getElementById(asociado);
		if(!document.getElementById('cal_' + asociado)){
			var destinos = new Array(); 
			if(elasociado.type == 'text' && elasociado.className.indexOf(label_class[lang.substr(0,2)]) != -1) {
				if(elasociado.className) {
					var group = elasociado.className.split(' ');
					for(var a = 0; a < group.length; a++){
						if(group[a].indexOf(label_class[lang.substr(0,2)]) != -1 && group[a].length > label_class[lang.substr(0,2)].length){
							destinos = getElementsByClassName(document, 'input', group[a])
						}
					}
					if(destinos.length == 3){
						elasociado = destinos[0];
						i = i + 2;
					}
				}
				
				var dest = elasociado.id;
				var enl_cal = document.createElement('a');
				enl_cal.className = 'enl_cal';
				if(destinos.length == 3) enl_cal.className = 'enl_cal_group';
				enl_cal.id = 'cal_' + dest;
				var enl_cal_img = document.createElement('img'); 
				enl_cal_img.setAttribute('alt',texto_enlace[lang.substr(0,2)]);
				enl_cal_img.setAttribute('src',dir_imagenes + '/acc_calendar.png');
				enl_cal.appendChild(enl_cal_img);
				var rango = 0;
				if(elasociado.className.indexOf('rang') != -1) {
					var jar = elasociado.className.split('rang');
					var fin = jar[1].indexOf(' ');
					if (fin != -1)
						rango = jar[1].substr(0,fin);
					else
						rango = jar[1];
				}
				if(elasociado.className.indexOf('todnact') != -1)
					todact = false
				else
					todact = true;
				var cons_disp = false;
				if(elasociado.className.indexOf('disp') != -1)
					cons_disp = true;
				enl_cal.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ',' + Hoy_real.getMonth() + ',"","","' + dest +'",' + rango + ')');
				enl_cal.setAttribute('title',title_enlace[lang.substr(0,2)] + ' ' + obten_texto(labels[i]));
					if(destinos.length < 3){
						if(padre(elasociado,'label')){
							insertAfter(padre(elasociado,'label'),enl_cal);
						}else{
							insertAfter(elasociado,enl_cal);
						}
					}else{
						elasociado.parentNode.parentNode.insertBefore(enl_cal,elasociado.parentNode)
					}
					if(!enl_cal.parentNode.style.position)
						enl_cal.parentNode.style.position = 'relative';
			}
		}
	} 
}
Array.prototype.indexOf = function(s) {
	for (var x=0;x<this.length;x++)
		if(this[x] == s)
			return x+1;
}
function calendario(cons_disp,todact,mes,year,nuevo,id,rango,dia) {
	var calendar = document.getElementById('bio_calendar')
	if(id != destino && calendar){
		cierra(destino)
		calendar = false;
	}
	if (calendar){
		var all_el = new Array('nav_mes','label_Meses');
		for(i = 0; i < all_el.length ; i++) {
			if(document.getElementById(all_el[i]))
				calendar.removeChild(document.getElementById(all_el[i]));
		}
		if(rango > 0) {
			calendar.removeChild(document.getElementById('nav_year'));
			calendar.removeChild(document.getElementById('label_year'));
		}
		document.getElementById('calendario').removeChild(document.getElementById('caption'));
		document.getElementById('calendario').removeChild(document.getElementById('tbody'));
	}else{
			calendar = document.createElement('div');
	}
	calendar.id = 'bio_calendar';
	if(!document.getElementById('calendario')){
		insertAfter(document.getElementById('cal_' + id),calendar);
		zindex(calendar);
		calendar.style.top = (document.getElementById(id).offsetHeight + document.getElementById(id).offsetTop) + 'px';
		calendar.style.left = (document.getElementById('cal_' + id).offsetLeft-2*(calendar.offsetWidth/3)) + 'px';
	}
	if(!document.getElementById('close_it')) {
		var close_it = document.createElement('div');
		close_it.id = 'close_it';
		var close_it_enl = document.createElement('a');
		var close_it_enl_text = document.createTextNode(close_text[lang.substr(0,2)]);
		close_it_enl.setAttribute('href','javascript:cierra("' + id +'")');
		close_it_enl.appendChild(close_it_enl_text);
		close_it.appendChild(close_it_enl);
		calendar.appendChild(close_it);
	}
	 
	var en_carga = document.createElement('img');
	en_carga.id = 'en_carga';
	en_carga.src = 'img/loading.gif';
	en_carga.setAttribute('alt',carga[lang.substr(0,2)]);
	calendar.appendChild(en_carga)
	destino = id;
	var Hoy = new Date();
	if(document.getElementById(id).className.indexOf('post') != -1) {
		tope = 2;
	}else if(document.getElementById(id).className.indexOf('prev') != -1) {
		tope = 1;
	} else{
		tope = 0;
	}
	if(!(mes+1)){
		mes = Hoy.getMonth();
	}
	if(!year){
		year = Hoy.getYear()
	}

	ajax_izar.sendRequest(cons_disp,fichero_consulta,function(req,val,cons_disp) {
		if(destino == id){
		 	var disponibles = new Array;
		 	if(val){
				var disponibles = req.responseText.split(',');
				for(var i = 0; i < disponibles.length; i++)
					disponibles[i] = disponibles[i] + 'd';
			}else{
				for(var i = 0; i <= 31; i++)
					disponibles.push( i + 'd');
			}
			if(id != destino) cierra(destino)
			Hoy.setMonth(mes);
			Hoy.setYear(year+comp);
			Anyo = Hoy.getYear()+comp;
			if (((Anyo % 4 == 0) && (Anyo % 100 != 0)) || (Anyo % 400 == 0)){
		    	DiasPorMes[1] = 29;
			}else{
		    	DiasPorMes[1] = 28;
			}
			NDias =DiasPorMes[mes];
			PrimerDia = Hoy;
			PrimerDia.setDate(1);
			if(lang == 'en-us')
				PrimerDia.setDate(2);
			Comienzo = PrimerDia.getDay();
			if(Comienzo == 0) {
				Comienzo = 7;
			}
			var total = Comienzo+NDias;
			var celda = new Array();
			for(var i = 0; i < Comienzo-1; i++){
				celda[i] = '';
			}
			for(var i = Comienzo-1; i < total-1; i++){
				celda[i] = i-Comienzo+2;
			}
			var resto = 7 - (i % 7);
			if(resto < 7){
				var white = celda.length+resto;
				for(var cont = celda.length; cont < white; cont++){
					celda[cont] = '';
				}
			}
			var semanas = (celda.length/7)-1;
			var calendario_tbody_tr_td = new Array();
			for(var i = 0; i < celda.length; i++){
				calendario_tbody_tr_td[i] = document.createElement('td');
				var calendario_tbody_tr_td_text = document.createTextNode(celda[i]);
				if(disponibles.indexOf(celda[i] + 'd') >= 0){
					var marc_dia = document.createElement('a');
					marc_dia.id = 'dat_' + celda[i];
					marc_dia.setAttribute('href','javascript:send_date(' + cons_disp + ',' + todact + ',"' + calendario_tbody_tr_td_text.nodeValue + '/' + (mes+1) + '/' + (year+comp) + '","'+ id +'",'+ rango +')');
					marc_dia.onclick = function() {
						var day_week = document.getElementById('nombre_dia_'+id);
						if(day_week) {
							if(day_week.tagName.toLowerCase() != 'input') {
								if(document.getElementById('nw_'+id))
									day_week.removeChild(document.getElementById('nw_'+id));
								var nw = document.createElement('span');
								nw.id = 'nw_'+id;
								nw.appendChild(document.createTextNode(encabezados[lang.substr(0,2)][padre(this.parentNode,'td').id.substring(3,4)]));
								day_week.appendChild(nw);
							}else{
								day_week.value = encabezados[lang.substr(0,2)][padre(this.parentNode,'td').id.substring(3,4)];
							}
						}
					}
					marc_dia.setAttribute('title',tit_dia[lang.substr(0,2)]);
				}else{
					var marc_dia = document.createElement('span');
				}
				if(celda[i] == Hoy_real.getDate() && mes == Hoy_real.getMonth() && year == Hoy_real.getYear()) {
					var strong = document.createElement('strong');
					calendario_tbody_tr_td[i].className = 'hoy';
					if(todact) {
						marc_dia.appendChild(calendario_tbody_tr_td_text);
						strong.appendChild(marc_dia);
						calendario_tbody_tr_td[i].className = 'act';
					}else{
						strong.appendChild(calendario_tbody_tr_td_text);
						calendario_tbody_tr_td[i].className = 'inact';
					}
					calendario_tbody_tr_td[i].appendChild(strong);
				}else if(celda[i] > 0){
					if((((celda[i] < Hoy_real.getDate()) && (mes == Hoy_real.getMonth() && year == Hoy_real.getYear())) || (mes < Hoy_real.getMonth() && year == Hoy_real.getYear())  || (year < Hoy_real.getYear())) && celda[i] >0){
						if( tope != 2){
							marc_dia.appendChild(calendario_tbody_tr_td_text);
							calendario_tbody_tr_td[i].appendChild(marc_dia);
							calendario_tbody_tr_td[i].className = 'act';
						}else{
							calendario_tbody_tr_td[i].appendChild(calendario_tbody_tr_td_text);
							calendario_tbody_tr_td[i].className = 'inact';
						}
					} else {
						if( tope != 1){
							marc_dia.appendChild(calendario_tbody_tr_td_text);
							calendario_tbody_tr_td[i].appendChild(marc_dia);
							calendario_tbody_tr_td[i].className = 'act';
						}else{
							calendario_tbody_tr_td[i].appendChild(calendario_tbody_tr_td_text);
							calendario_tbody_tr_td[i].className = 'inact';
						}
					}
				} else {
					calendario_tbody_tr_td[i].appendChild(calendario_tbody_tr_td_text);
				}
				if(celda[i] == dia)
					calendario_tbody_tr_td[i].className = 'elect ' + calendario_tbody_tr_td[i].className;
			}
			if(!document.getElementById('calendario')) {
				var calendario = document.createElement('table');
				calendario.id = 'calendario';
			}else{
				calendario = document.getElementById('calendario')
			}
			calendario.setAttribute('summary',summary[lang.substr(0,2)] + ' ' + Meses[lang.substr(0,2)][mes] + ' ' + preposiciones[lang.substr(0,2)][0] + ' ' + Anyo);
			var calendario_caption = document.createElement('caption');
			calendario_caption.id = 'caption';
			var texto_caption = document.createTextNode( Meses[lang.substr(0,2)][mes] + ' ' + (year+comp));
			calendario_caption.appendChild(texto_caption);
			calendario.appendChild(calendario_caption);
			if(lang != 'en-us' && !document.getElementById('calendario')) {
				var nor_day = document.createElement('colgroup');
				nor_day.setAttribute('span','5');
				var week_day = document.createElement('colgroup');
				week_day.className = 'end';
				week_day.setAttribute('span','2');
				calendario.appendChild(nor_day);
				calendario.appendChild(week_day);
			}
			var calendario_thead = document.createElement('thead');
			var calendario_thead_tr = document.createElement('tr');
			for (var i = 0; i < encabezados[lang.substr(0,2)].length; i++) {
				var calendario_thead_tr_th = document.createElement('th');
				calendario_thead_tr_th.setAttribute('scope','col');
				var calendario_thead_tr_th_abbr = document.createElement('abbr');
				var n = i;
				if(lang == 'en-us') {
					n = i - 1;
					if(n == -1)
						n = 6;
					else if(n+1 == encabezados.length)
						n = 0;
				}
				calendario_thead_tr_th_abbr.setAttribute('title',encabezados[lang.substr(0,2)][n]);
				var calendario_thead_tr_th_abbr_text = document.createTextNode(encabezados[lang.substr(0,2)][n].substr(0,3));
				calendario_thead_tr_th_abbr.appendChild(calendario_thead_tr_th_abbr_text);
				calendario_thead_tr_th.appendChild(calendario_thead_tr_th_abbr);
				calendario_thead_tr.appendChild(calendario_thead_tr_th);
			}
			calendario_thead.appendChild(calendario_thead_tr);
			if(!document.getElementById('calendario'))
				calendario.appendChild(calendario_thead);
			var calendario_tbody = document.createElement('tbody');
			calendario_tbody.id = 'tbody';
			for(var i = 0; i <= semanas; i++){
				var calendario_tbody_tr = document.createElement('tr');
				for(a = 0; a < 7; a++){
					if(calendario_tbody_tr_td[(i*7)+a]) {
						calendario_tbody_tr_td[(i*7)+a].id = 'dw_' + a;
						if(a == 5) 
							calendario_tbody_tr_td[(i*7)+a].className = 'sat ' + calendario_tbody_tr_td[(i*7)+a].className;
						else if (a == 6)
							calendario_tbody_tr_td[(i*7)+a].className = 'sun ' + calendario_tbody_tr_td[(i*7)+a].className;
						calendario_tbody_tr.appendChild(calendario_tbody_tr_td[(i*7)+a]);
					}
				}
				calendario_tbody.appendChild(calendario_tbody_tr);
			}
			calendario.appendChild(calendario_tbody);
			if(!document.getElementById('calendario')){
				zindex(calendar);
				contador = contador + 1;
				calendar.style.top = (document.getElementById(id).offsetHeight + document.getElementById(id).offsetTop) + 'px';
				calendar.style.left = (document.getElementById('cal_' + id).offsetLeft-2*(calendar.offsetWidth/3)) + 'px';
			}
			crea_nav_year_select(cons_disp,todact,mes,year,id,rango);
			crea_nav_mes_select(cons_disp,todact,mes,year,id,rango);
			en_carga.parentNode.removeChild(en_carga);
			calendar.appendChild(calendario);
			crea_nav_mes(cons_disp,todact,mes,year,id,rango);
			crea_nav_year(cons_disp,todact,mes,year,id,rango);
			if(document.getElementById('nav_year_select')) {
				if(rango == 0)
					document.getElementById('nav_mes_select').focus();
				else
					document.getElementById('nav_year_select').focus();
			}
		}	
	},'month=' + (mes+1) + '&year=' + (year+comp))
	if(calendar)
		zindex(calendar);
}
function crea_nav_mes(cons_disp,todact,mes,year,id,rango){
	var nav_mes = document.createElement('ul');
	nav_mes.id = 'nav_mes';
	var nav_mes_li = document.createElement('li');
	if(mes-1 == -1) {
		var prev_mes = 11;
		var prev_year = year-1;
	}else{
		var prev_mes = mes-1;
		var prev_year = year;
	}
	var nav_mes_li_text = document.createTextNode(Meses[lang.substr(0,2)][prev_mes]);
	var nav_mes_li_a = document.createElement('a');
	nav_mes_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' +  todact + ','+ prev_mes + ',' + prev_year + ',"","'+id+'",' + rango +')');
	nav_mes_li_a.appendChild(nav_mes_li_text);
	nav_mes_li_a.setAttribute('title',go_month[lang.substr(0,2)]);
	nav_mes_li.appendChild(nav_mes_li_a);
	var nav_mes_post_li = document.createElement('li');
	nav_mes_li.className = 'post';
	if(mes == 11) {
		var next_mes = 0;
		var next_year = year+1;
	}else{
		var next_mes = mes+1;
		var next_year = year;
	}
	var nav_mes_post_li_text = document.createTextNode(Meses[lang.substr(0,2)][next_mes]);
	var nav_mes_post_li_a = document.createElement('a');
	nav_mes_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' +  todact + ','+ next_mes + ',' + next_year + ',"","'+id+'",' + rango +')');
	nav_mes_post_li_a.appendChild(nav_mes_post_li_text);
	nav_mes_post_li_a.setAttribute('title',go_month[lang.substr(0,2)]);
	nav_mes_post_li.appendChild(nav_mes_post_li_a);
	switch ( tope ) { 
		case 0:
			if(prev_year >= (Hoy_real.getYear()-rango))
				nav_mes.appendChild(nav_mes_li);
			if(next_year <= (Hoy_real.getYear()+rango))
				nav_mes.appendChild(nav_mes_post_li);
			break
		case 1:
			if(prev_year >= (Hoy_real.getYear()-rango))
				nav_mes.appendChild(nav_mes_li);
			if(next_year <= (Hoy_real.getYear()+1) && next_year <= (Hoy_real.getYear()+rango)){
				if((tope_mes && next_mes <= Hoy_real.getMonth()) || next_year < Hoy_real.getYear()){
					nav_mes.appendChild(nav_mes_post_li);
				}
			}
			break
		case 2:
			if(prev_year >= Hoy_real.getYear() && prev_year >= (Hoy_real.getYear()-rango)){
				if((tope_mes && prev_mes >= Hoy_real.getMonth()) || next_year > Hoy_real.getYear()){
					nav_mes.appendChild(nav_mes_li);
				}
			}
			if(next_year <= (Hoy_real.getYear()+rango))
				nav_mes.appendChild(nav_mes_post_li);
			break
	}
	document.getElementById('bio_calendar').appendChild(nav_mes);
}
function crea_nav_mes_select(cons_disp,todact,mes,year,id,rango){
	var nav_mes_select = document.createElement('select');
	nav_mes_select.id = 'nav_mes_select';
	var nav_mes_select_label = document.createElement('label');
	nav_mes_select_label.htmlFor =  'nav_mes_select';
	nav_mes_select_label.id =  'label_Meses';
	var nav_mes_select_label_text = document.createTextNode(label_mes[lang.substr(0,2)]);
	if(year == Hoy_real.getYear()) {
		switch ( tope ) {
			case 0:
				var from = 0;
				var to = Meses[lang.substr(0,2)].length;
				break
			case 1:
				var from = 0;
				var to = Hoy_real.getMonth()+1;
				break
			case 2:
				var from = Hoy_real.getMonth();
				var to = Meses[lang.substr(0,2)].length;
				break
		}
	}else{
		var from = 0;
		var to = Meses[lang.substr(0,2)].length;
	}
	for(i = from; i < to; i++){
		var nav_mes_select_opt = document.createElement('option');
		if(i == mes){
			nav_mes_select_opt.setAttribute('selected','selected');
		}
		nav_mes_select_opt.innerHTML = Meses[lang.substr(0,2)][i];
		nav_mes_select.appendChild(nav_mes_select_opt)
	}
	nav_mes_select.onchange = function() {
		switch ( tope ) {
			case 0:
				calendario(cons_disp,todact,nav_mes_select.selectedIndex ,year,'',id,rango)
				break
			case 1:
				if((tope_mes && year == Hoy_real.getYear() && nav_mes_select.selectedIndex <= Hoy_real.getMonth()) || year < Hoy_real.getYear()){
					calendario(cons_disp,todact,nav_mes_select.selectedIndex ,year,'',id,rango)
				}else{
					nav_mes_select.selectedIndex = mes
				}
				break
			case 2:
				if((tope_mes && year > Hoy_real.getYear()) || (tope_mes && year == Hoy_real.getYear() && (nav_mes_select.selectedIndex+Hoy_real.getMonth()) >= Hoy_real.getMonth()) || year > Hoy_real.getYear()){
					if(tope_mes && year > Hoy_real.getYear()){
						calendario(cons_disp,todact,nav_mes_select.selectedIndex ,year,'',id,rango)
					}else{
						calendario(cons_disp,todact,nav_mes_select.selectedIndex+Hoy_real.getMonth() ,year,'',id,rango)
					}
				}else{
					nav_mes_select.selectedIndex = mes
				}
				break
		}
	}
	nav_mes_select_label.appendChild(nav_mes_select_label_text);
	nav_mes_select_label.appendChild(nav_mes_select);
	if(document.getElementById('nav_mes_select'))
		document.getElementById('nav_mes_select').focus();
	if(to-from)
		document.getElementById('bio_calendar').appendChild(nav_mes_select_label);
}
function crea_nav_year(cons_disp,todact,mes,year,id,rango){
	var nav_year = document.createElement('ul');
	nav_year.id = 'nav_year';
	var nav_year_li = document.createElement('li');
	nav_year_li.className = 'post';
	var nav_year_li_text = document.createTextNode(year+comp-1);
	var nav_year_li_a = document.createElement('a');
	nav_year_li_a.setAttribute('title',go_year[lang.substr(0,2)]);
	var nav_year_post_li = document.createElement('li');
	var nav_year_post_li_text = document.createTextNode(year+comp+1);
	var nav_year_post_li_a = document.createElement('a');
	nav_year_post_li_a.setAttribute('title',go_year[lang.substr(0,2)]);
	if(!mes) mes = 0;
	nav_year_li_a.appendChild(nav_year_li_text);
	nav_year_li.appendChild(nav_year_li_a);
	nav_year_post_li_a.appendChild(nav_year_post_li_text);
	nav_year_post_li.appendChild(nav_year_post_li_a);
	switch ( tope ) { 
		case 0:
			nav_year_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year-1) + ',"","'+ id +'",' + rango +')');
			nav_year_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year+1) + ',"","'+ id +'",' + rango +')');
			if((year-1) >= (Hoy_real.getYear() - rango))
				nav_year.appendChild(nav_year_li);
			if(year+1 <= Hoy_real.getYear() + rango)
				nav_year.appendChild(nav_year_post_li);
			break
		case 1:
			nav_year_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year-1) + ',"","'+ id +'",' + rango +')');
			if(tope_mes && mes <= Hoy_real.getMonth()){
				nav_year_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year+1) + ',"","'+ id +'",' + rango +')');
			}else{
				nav_year_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ Hoy_real.getMonth() + ',' + (year+1) + ',"","'+ id +'",' + rango +')');
			}
			if((year-1) >= (Hoy_real.getYear() - rango))
				nav_year.appendChild(nav_year_li);
			if(year+1 <= Hoy_real.getYear())
				nav_year.appendChild(nav_year_post_li);
			break
		case 2:
			if(tope_mes && mes >= Hoy_real.getMonth()){
				nav_year_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ',' + mes + ',' + (year-1) + ',"","'+ id +'",' + rango +')');
			}else{
				nav_year_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ Hoy_real.getMonth() + ',' + (year-1) + ',"","'+ id +'",' + rango +')');
			}
			nav_year_post_li_a.setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ','+ mes + ',' + (year+1) + ',"","'+ id +'",' + rango +')');
			if(year-1 >= Hoy_real.getYear())
				nav_year.appendChild(nav_year_li);
			if((year+1) <= (Hoy_real.getYear() + rango))
				nav_year.appendChild(nav_year_post_li);
			break
	}
	if(rango > 0) 
		document.getElementById('bio_calendar').appendChild(nav_year);
}
function crea_nav_year_select(cons_disp,todact,mes,year,id,rango){
	var nav_year_select = document.createElement('select');
	nav_year_select.id = 'nav_year_select';
	var nav_year_select_label = document.createElement('label');
	nav_year_select_label.htmlFor =  'nav_year_select';
	nav_year_select_label.id =  'label_year';
	var nav_year_select_label_text = document.createTextNode(label_year[lang.substr(0,2)]);
	var tope_pre = Hoy_real.getYear() - rango;
	var tope_post = Hoy_real.getYear() + rango;
	if ( tope ==  1)
		tope_post = Hoy_real.getYear();
	else if(tope == 2)
		tope_pre = Hoy_real.getYear();
	tope_pre = tope_pre + comp;
	tope_post = tope_post + comp;
	for(i = tope_pre; i<=tope_post; i++){
		var nav_year_select_opt = document.createElement('option');
		if(i == (year + comp) ){
			nav_year_select_opt.setAttribute('selected','selected');
		}
		nav_year_select_opt.innerHTML = i;
		nav_year_select.appendChild(nav_year_select_opt)
	}
	nav_year_select.onchange = function() {
		switch ( tope ) { 
			case 0:
				calendario(cons_disp,todact,mes ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				break
			case 1:
				if(tope_mes && (nav_year_select.options[nav_year_select.selectedIndex].text-comp < Hoy_real.getYear() || (nav_year_select.options[nav_year_select.selectedIndex].text-comp == Hoy_real.getYear() && mes <= Hoy_real.getMonth()))){
					calendario(cons_disp,todact,mes ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				}else{
					calendario(cons_disp,todact,Hoy_real.getMonth() ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				}
				break
			case 2:
				if(tope_mes &&((nav_year_select.options[nav_year_select.selectedIndex].text-comp > Hoy_real.getYear()) || ((nav_year_select.options[nav_year_select.selectedIndex].text-comp == Hoy_real.getYear()) && mes >= Hoy_real.getMonth()))){
					calendario(cons_disp,todact,mes ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				}else{
					calendario(cons_disp,todact,Hoy_real.getMonth() ,nav_year_select.options[nav_year_select.selectedIndex].text-comp,"",id,rango)
				}
				break
		}
	}
	nav_year_select_label.appendChild(nav_year_select_label_text);
	nav_year_select_label.appendChild(nav_year_select);
	if(rango > 0)
		document.getElementById('bio_calendar').appendChild(nav_year_select_label);
}
function getElementsByClassName(oElm, strTagName, oClassNames){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var arrRegExpClassNames = new Array();
    if(typeof oClassNames == "object"){


        for(var i = 0; i < oClassNames.length; i++){

            arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
        }
    }
    else{
        arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
    }
    var oElement;
    var bMatchesAll;
    for(var j=0; j<arrElements.length; j++){
        oElement = arrElements[j];
        bMatchesAll = true;
        for(var k=0; k<arrRegExpClassNames.length; k++){
            if(!arrRegExpClassNames[k].test(oElement.className)){
                bMatchesAll = false;
                break;                      
            }
        }
        if(bMatchesAll){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}

function send_date(cons_disp,todact,date,destino,rango) {
		var fecha = date.split('/');
		var day = fecha[0];
		var month = fecha[1];
		var year = fecha[2];
		var destinos = new Array();
		var long_dia = formato.lastIndexOf('d')- formato.indexOf('d') +1;
		var long_mes = formato.lastIndexOf('m')- formato.indexOf('m') +1;
		var long_year = formato.lastIndexOf('y')- formato.indexOf('y') +1;
		if(long_year < 2 || long_year == 3)
			long_year = 2;
		if(long_year > 4)
			long_year = 4;
		var fecha_format = formato;
		if(fecha[0].length == 1 && long_dia >= 2)
			fecha[0] = '0' + fecha[0]
		fecha_format = fecha_format.replace('d',fecha[0]);
		for(i = 0; i <= long_dia; i++) 
			fecha_format = fecha_format.replace('d','');
		if(fecha[1].length == 1 && long_mes >= 2)
			fecha[1] = '0' + fecha[1]
		fecha_format = fecha_format.replace('m',fecha[1]);
		for(i = 0; i <= long_mes; i++) 
			fecha_format = fecha_format.replace('m','');
		var inic = 0;
		if(long_year == 2)
			inic = 2;
		fecha_format = fecha_format.replace('y',fecha[2].substr(inic,long_year));
		for(i = 0; i <= long_year; i++) 
			fecha_format = fecha_format.replace('y','');
		var	input_destino =	document.getElementById(destino)
		var group = input_destino.className.split(' ');
		for(var i = 0; i < group.length; i++){
			if(group[i].indexOf(label_class[lang.substr(0,2)]) != -1 && group[i].length > label_class[lang.substr(0,2)].length){
				destinos = getElementsByClassName(document, 'input', group[i])
			}
		}
		if(destinos.length == 3){
			for(var i = 0; i <= 2; i++){
				if(destinos[i].className.indexOf('day') != -1) destinos[i].value = fecha[0];
				if(destinos[i].className.indexOf('month') != -1) destinos[i].value = fecha[1];
				if(destinos[i].className.indexOf('year') != -1) destinos[i].value = fecha[2];
			}
			cierra(destinos[2].id);
		}else{
			input_destino.value = fecha_format;
			cierra(destino);
		}
			document.getElementById('cal_' + destino).setAttribute('href','javascript:calendario(' + cons_disp + ',' + todact + ',' + (fecha[1]-1) + ', ' + (fecha[2]-comp) + ' ,"","' + destino +'",' + rango + ',' + fecha[0] + ')');
}
ajax_izar = {
	XMLHttpFactories: [
		function () {return new XMLHttpRequest()},
		function () {return new ActiveXObject("Msxml2.XMLHTTP")},
		function () {return new ActiveXObject("Msxml3.XMLHTTP")},
		function () {return new ActiveXObject("Microsoft.XMLHTTP")},
		],
	sendRequest: function(send,url,callback,postData) {
		if(send){
			var req = ajax_izar.createXMLHTTPObject();
			if (!req) return;
			var method = (postData) ? "POST" : "GET";
			req.open(method,url,true);
			req.setRequestHeader('User-Agent','XMLHTTP/1.0');
			if (postData)
				req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				req.onreadystatechange = function () {
				if (req.readyState != 4) return;
				if (req.status != 200 && req.status != 304) {
					callback(req,false,send);
					return;
				}else{
					callback(req,true,send);
				}
			}
			if (req.readyState == 4) return;
				req.send(postData);
		}else{
			callback(req,false,send);
		}
	},
	createXMLHTTPObject: function(url,callback,postData) {
		var xmlhttp = false;
		for (var i = 0; i < ajax_izar.XMLHttpFactories.length; i++)
		{
			try {
				xmlhttp = ajax_izar.XMLHttpFactories[i]();
			}
			catch (e) {


				continue;
			}
			break;
		}
		return xmlhttp;
	}

}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
addLoadEvent(carga_estilos);
addLoadEvent(cargaLinks);


/*
 * Date prototype extensions. Doesn't depend on any
 * other code. Doens't overwrite existing methods.
 *
 * Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear,
 * isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear,
 * setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods
 *
 * Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 *
 * Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString -
 * I've added my name to these methods so you know who to blame if they are broken!
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * An Array of day names starting with Sunday.
 * 
 * @example dayNames[0]
 * @result 'Sunday'
 *
 * @name dayNames
 * @type Array
 * @cat Plugins/Methods/Date
 */
Date.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];

/**
 * An Array of abbreviated day names starting with Sun.
 * 
 * @example abbrDayNames[0]
 * @result 'Sun'
 *
 * @name abbrDayNames
 * @type Array
 * @cat Plugins/Methods/Date
 */
Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];

/**
 * An Array of month names starting with Janurary.
 * 
 * @example monthNames[0]
 * @result 'January'
 *
 * @name monthNames
 * @type Array
 * @cat Plugins/Methods/Date
 */
Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

/**
 * An Array of abbreviated month names starting with Jan.
 * 
 * @example abbrMonthNames[0]
 * @result 'Jan'
 *
 * @name monthNames
 * @type Array
 * @cat Plugins/Methods/Date
 */
Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

/**
 * The first day of the week for this locale.
 *
 * @name firstDayOfWeek
 * @type Number
 * @cat Plugins/Methods/Date
 * @author Kelvin Luck
 */
Date.firstDayOfWeek = 1;

/**
 * The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc).
 *
 * @name format
 * @type String
 * @cat Plugins/Methods/Date
 * @author Kelvin Luck
 */
Date.format = 'dd/mm/yyyy';
//Date.format = 'mm/dd/yyyy';
//Date.format = 'yyyy-mm-dd';
//Date.format = 'dd mmm yy';

/**
 * The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear
 * only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes.
 *
 * @name format
 * @type String
 * @cat Plugins/Methods/Date
 * @author Kelvin Luck
 */
Date.fullYearStart = '20';

(function() {

	/**
	 * Adds a given method under the given name 
	 * to the Date prototype if it doesn't
	 * currently exist.
	 *
	 * @private
	 */
	function add(name, method) {
		if( !Date.prototype[name] ) {
			Date.prototype[name] = method;
		}
	};
	
	/**
	 * Checks if the year is a leap year.
	 *
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.isLeapYear();
	 * @result true
	 *
	 * @name isLeapYear
	 * @type Boolean
	 * @cat Plugins/Methods/Date
	 */
	add("isLeapYear", function() {
		var y = this.getFullYear();
		return (y%4==0 && y%100!=0) || y%400==0;
	});
	
	/**
	 * Checks if the day is a weekend day (Sat or Sun).
	 *
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.isWeekend();
	 * @result false
	 *
	 * @name isWeekend
	 * @type Boolean
	 * @cat Plugins/Methods/Date
	 */
	add("isWeekend", function() {
		return this.getDay()==0 || this.getDay()==6;
	});
	
	/**
	 * Check if the day is a day of the week (Mon-Fri)
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.isWeekDay();
	 * @result false
	 * 
	 * @name isWeekDay
	 * @type Boolean
	 * @cat Plugins/Methods/Date
	 */
	add("isWeekDay", function() {
		return !this.isWeekend();
	});
	
	/**
	 * Gets the number of days in the month.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getDaysInMonth();
	 * @result 31
	 * 
	 * @name getDaysInMonth
	 * @type Number
	 * @cat Plugins/Methods/Date
	 */
	add("getDaysInMonth", function() {
		return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()];
	});
	
	/**
	 * Gets the name of the day.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getDayName();
	 * @result 'Saturday'
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getDayName(true);
	 * @result 'Sat'
	 * 
	 * @param abbreviated Boolean When set to true the name will be abbreviated.
	 * @name getDayName
	 * @type String
	 * @cat Plugins/Methods/Date
	 */
	add("getDayName", function(abbreviated) {
		return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()];
	});

	/**
	 * Gets the name of the month.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getMonthName();
	 * @result 'Janurary'
	 *
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getMonthName(true);
	 * @result 'Jan'
	 * 
	 * @param abbreviated Boolean When set to true the name will be abbreviated.
	 * @name getDayName
	 * @type String
	 * @cat Plugins/Methods/Date
	 */
	add("getMonthName", function(abbreviated) {
		return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()];
	});

	/**
	 * Get the number of the day of the year.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getDayOfYear();
	 * @result 11
	 * 
	 * @name getDayOfYear
	 * @type Number
	 * @cat Plugins/Methods/Date
	 */
	add("getDayOfYear", function() {
		var tmpdtm = new Date("1/1/" + this.getFullYear());
		return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000);
	});
	
	/**
	 * Get the number of the week of the year.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getWeekOfYear();
	 * @result 2
	 * 
	 * @name getWeekOfYear
	 * @type Number
	 * @cat Plugins/Methods/Date
	 */
	add("getWeekOfYear", function() {
		return Math.ceil(this.getDayOfYear() / 7);
	});

	/**
	 * Set the day of the year.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.setDayOfYear(1);
	 * dtm.toString();
	 * @result 'Tue Jan 01 2008 00:00:00'
	 * 
	 * @name setDayOfYear
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("setDayOfYear", function(day) {
		this.setMonth(0);
		this.setDate(day);
		return this;
	});
	
	/**
	 * Add a number of years to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addYears(1);
	 * dtm.toString();
	 * @result 'Mon Jan 12 2009 00:00:00'
	 * 
	 * @name addYears
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addYears", function(num) {
		this.setFullYear(this.getFullYear() + num);
		return this;
	});
	
	/**
	 * Add a number of months to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addMonths(1);
	 * dtm.toString();
	 * @result 'Tue Feb 12 2008 00:00:00'
	 * 
	 * @name addMonths
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addMonths", function(num) {
		var tmpdtm = this.getDate();
		
		this.setMonth(this.getMonth() + num);
		
		if (tmpdtm > this.getDate())
			this.addDays(-this.getDate());
		
		return this;
	});
	
	/**
	 * Add a number of days to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addDays(1);
	 * dtm.toString();
	 * @result 'Sun Jan 13 2008 00:00:00'
	 * 
	 * @name addDays
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addDays", function(num) {
		this.setDate(this.getDate() + num);
		return this;
	});
	
	/**
	 * Add a number of hours to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addHours(24);
	 * dtm.toString();
	 * @result 'Sun Jan 13 2008 00:00:00'
	 * 
	 * @name addHours
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addHours", function(num) {
		this.setHours(this.getHours() + num);
		return this;
	});

	/**
	 * Add a number of minutes to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addMinutes(60);
	 * dtm.toString();
	 * @result 'Sat Jan 12 2008 01:00:00'
	 * 
	 * @name addMinutes
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addMinutes", function(num) {
		this.setMinutes(this.getMinutes() + num);
		return this;
	});
	
	/**
	 * Add a number of seconds to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addSeconds(60);
	 * dtm.toString();
	 * @result 'Sat Jan 12 2008 00:01:00'
	 * 
	 * @name addSeconds
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addSeconds", function(num) {
		this.setSeconds(this.getSeconds() + num);
		return this;
	});
	
	/**
	 * Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant.
	 * 
	 * @example var dtm = new Date();
	 * dtm.zeroTime();
	 * dtm.toString();
	 * @result 'Sat Jan 12 2008 00:01:00'
	 * 
	 * @name zeroTime
	 * @type Date
	 * @cat Plugins/Methods/Date
	 * @author Kelvin Luck
	 */
	add("zeroTime", function() {
		this.setMilliseconds(0);
		this.setSeconds(0);
		this.setMinutes(0);
		this.setHours(0);
		return this;
	});
	
	/**
	 * Returns a string representation of the date object according to Date.format.
	 * (Date.toString may be used in other places so I purposefully didn't overwrite it)
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.asString();
	 * @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy'
	 * 
	 * @name asString
	 * @type Date
	 * @cat Plugins/Methods/Date
	 * @author Kelvin Luck
	 */
	add("asString", function() {
		var r = Date.format;
		return r
			.split('yyyy').join(this.getFullYear())
			.split('yy').join((this.getFullYear() + '').substring(2))
			.split('mmm').join(this.getMonthName(true))
			.split('mm').join(_zeroPad(this.getMonth()+1))
			.split('dd').join(_zeroPad(this.getDate()));
	});
	
	/**
	 * Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object
	 * (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere)
	 *
	 * @example var dtm = Date.fromString("12/01/2008");
	 * dtm.toString();
	 * @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy'
	 * 
	 * @name fromString
	 * @type Date
	 * @cat Plugins/Methods/Date
	 * @author Kelvin Luck
	 */
	Date.fromString = function(s)
	{
		var f = Date.format;
		var d = new Date('01/01/1977');
		var iY = f.indexOf('yyyy');
		if (iY > -1) {
			d.setFullYear(Number(s.substr(iY, 4)));
		} else {
			// TODO - this doesn't work very well - are there any rules for what is meant by a two digit year?
			d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2)));
		}
		var iM = f.indexOf('mmm');
		if (iM > -1) {
			var mStr = s.substr(iM, 3);
			for (var i=0; i<Date.abbrMonthNames.length; i++) {
				if (Date.abbrMonthNames[i] == mStr) break;
			}
			d.setMonth(i);
		} else {
			d.setMonth(Number(s.substr(f.indexOf('mm'), 2)) - 1);
		}
		d.setDate(Number(s.substr(f.indexOf('dd'), 2)));
		if (isNaN(d.getTime())) {
			return false;
		}
		return d;
	};
	
	// utility method
	var _zeroPad = function(num) {
		var s = '0'+num;
		return s.substring(s.length-2)
		//return ('0'+num).substring(-2); // doesn't work on IE :(
	};
	
})();
/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $
 * $Rev: 4257 $
 *
 * Version: 1.2
 *
 * Requires: jQuery 1.2+
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5($){$.19={P:\'1.2\'};$.u([\'j\',\'w\'],5(i,d){$.q[\'O\'+d]=5(){p(!3[0])6;g a=d==\'j\'?\'s\':\'m\',e=d==\'j\'?\'D\':\'C\';6 3.B(\':y\')?3[0][\'L\'+d]:4(3,d.x())+4(3,\'n\'+a)+4(3,\'n\'+e)};$.q[\'I\'+d]=5(b){p(!3[0])6;g c=d==\'j\'?\'s\':\'m\',e=d==\'j\'?\'D\':\'C\';b=$.F({t:Z},b||{});g a=3.B(\':y\')?3[0][\'8\'+d]:4(3,d.x())+4(3,\'E\'+c+\'w\')+4(3,\'E\'+e+\'w\')+4(3,\'n\'+c)+4(3,\'n\'+e);6 a+(b.t?(4(3,\'t\'+c)+4(3,\'t\'+e)):0)}});$.u([\'m\',\'s\'],5(i,b){$.q[\'l\'+b]=5(a){p(!3[0])6;6 a!=W?3.u(5(){3==h||3==r?h.V(b==\'m\'?a:$(h)[\'U\'](),b==\'s\'?a:$(h)[\'T\']()):3[\'l\'+b]=a}):3[0]==h||3[0]==r?S[(b==\'m\'?\'R\':\'Q\')]||$.N&&r.M[\'l\'+b]||r.A[\'l\'+b]:3[0][\'l\'+b]}});$.q.F({z:5(){g a=0,f=0,o=3[0],8,9,7,v;p(o){7=3.7();8=3.8();9=7.8();8.f-=4(o,\'K\');8.k-=4(o,\'J\');9.f+=4(7,\'H\');9.k+=4(7,\'Y\');v={f:8.f-9.f,k:8.k-9.k}}6 v},7:5(){g a=3[0].7;G(a&&(!/^A|10$/i.16(a.15)&&$.14(a,\'z\')==\'13\'))a=a.7;6 $(a)}});5 4(a,b){6 12($.11(a.17?a[0]:a,b,18))||0}})(X);',62,72,'|||this|num|function|return|offsetParent|offset|parentOffset|||||borr|top|var|window||Height|left|scroll|Left|padding|elem|if|fn|document|Top|margin|each|results|Width|toLowerCase|visible|position|body|is|Right|Bottom|border|extend|while|borderTopWidth|outer|marginLeft|marginTop|client|documentElement|boxModel|inner|version|pageYOffset|pageXOffset|self|scrollTop|scrollLeft|scrollTo|undefined|jQuery|borderLeftWidth|false|html|curCSS|parseInt|static|css|tagName|test|jquery|true|dimensions'.split('|'),0,{}))
//dimScreen()
//by Brandon Goldman
jQuery.extend({
    //dims the screen
    dimScreen: function(speed, opacity, callback) {
        if(jQuery('#__dimScreen').size() > 0) return;
        
        if(typeof speed == 'function') {
            callback = speed;
            speed = null;
        }

        if(typeof opacity == 'function') {
            callback = opacity;
            opacity = null;
        }

        if(speed < 1) {
            var placeholder = opacity;
            opacity = speed;
            speed = placeholder;
        }
        
        if(opacity >= 1) {
            var placeholder = speed;
            speed = opacity;
            opacity = placeholder;
        }

        speed = (speed > 0) ? speed : 500;
        opacity = (opacity > 0) ? opacity : 0.5;
        return jQuery('<div></div>').attr({
                id: '__dimScreen'
                ,fade_opacity: opacity
                ,speed: speed
            }).css({
            background: '#000'
            ,height: $(document).height() + 'px'
            ,left: '0px'
            ,opacity: 0
            ,position: 'absolute'
            ,top: '0px'
            ,width: $(document).width() + 'px'
            ,zIndex: 999
        }).appendTo(document.body).fadeTo(speed, 0.7, callback);
    },
    
    //stops current dimming of the screen
    dimScreenStop: function(callback) {
        var x = jQuery('#__dimScreen');
        var opacity = x.attr('fade_opacity');
        var speed = x.attr('speed');
        x.fadeOut(speed, function() {
            x.remove();
            if(typeof callback == 'function') callback();
        });
    }
});
jQuery.fn.accessNews = function(settings) {
    settings = jQuery.extend({
        newsHeadline: "Top Stories",
        newsSpeed: "normal"
    }, settings);
    return this.each(function(i) {
        aNewsSlider.itemWidth = parseInt(jQuery(".item:eq(" + i + ")",".news_slider").css("width")) + parseInt(jQuery(".item:eq(" + i + ")",".news_slider").css("margin-right"));
        aNewsSlider.init(settings,this);
        jQuery(".view_all > a", this).click(function() {
            aNewsSlider.vAll(settings,this);
            return false;
        });
    });
};
var aNewsSlider = {
    itemWidth: 0,
    init: function(s,p) {
        jQuery(".messaging",p).css("display","none");
        itemLength = jQuery(".item",p).length;
       /* if (jQuery(".view_all",p).width() == null) {
            jQuery(".news_items",p).prepend("<p class='view_all'>" + s.newsHeadline + " [ " + itemLength + " total ] &nbsp;-&nbsp; <a href='#'>View All</a></p>");
        }*/
        newsContainerWidth = itemLength * aNewsSlider.itemWidth;
        jQuery(".container",p).css("width",newsContainerWidth + "px");
        jQuery(".next",p).css("display","block");
        animating = false;
        jQuery(".next",p).click(function() {
            if (animating == false) {
                animating = true;
                animateLeft = parseInt(jQuery(".container",p).css("left")) - (aNewsSlider.itemWidth * 2);
                if (animateLeft + parseInt(jQuery(".container",p).css("width")) > 0) {
                    jQuery(".prev",p).css("display","block");
                    jQuery(".container",p).animate({left: animateLeft}, s.newsSpeed, function() {
                        jQuery(this).css("left",animateLeft);
                        if (parseInt(jQuery(".container",p).css("left")) + parseInt(jQuery(".container",p).css("width")) <= aNewsSlider.itemWidth * 2) {
                            jQuery(".next",p).css("display","none");
                        }
                        animating = false;
                    });
                } else {
                    animating = false;
                }
            }
            return false;
        });
        jQuery(".prev",p).click(function() {
            if (animating == false) {
                animating = true;
                animateLeft = parseInt(jQuery(".container",p).css("left")) + (aNewsSlider.itemWidth * 2);
                if ((animateLeft + parseInt(jQuery(".container",p).css("width"))) <= parseInt(jQuery(".container",p).css("width"))) {
                    jQuery(".next",p).css("display","block");
                    jQuery(".container",p).animate({left: animateLeft}, s.newsSpeed, function() {
                        jQuery(this).css("left",animateLeft);
                        if (parseInt(jQuery(".container",p).css("left")) == 0) {
                            jQuery(".prev",p).css("display","none");
                        }
                        animating = false;
                    });
                } else {
                    animating = false;
                }
            }
            return false;
        });
    },
    vAll: function(s,p) {
        var o = p;
        while (p) {
            p = p.parentNode;
            if (jQuery(p).attr("class") != undefined && jQuery(p).attr("class").indexOf("news_slider") != -1) {
                break;
            }
        }
        if (jQuery(o).text().indexOf("View All") != -1) {
            jQuery(".next",p).css("display","none");
            jQuery(".prev",p).css("display","none");
            jQuery(o).text("View Less");
            jQuery(".container",p).css("left","0px").css("width",aNewsSlider.itemWidth * 2 + "px");
        } else {
            jQuery(o).text("View All");
            aNewsSlider.init(s,p);
        }
    }
};

if(!document.createElement('canvas').getContext){(function(){var m=Math;var y=m.round;var z=m.sin;var A=m.cos;var Z=10;var B=Z/2;function getContext(){if(this.context_){return this.context_}return this.context_=new CanvasRenderingContext2D_(this)}var C=Array.prototype.slice;function bind(f,b,c){var a=C.call(arguments,2);return function(){return f.apply(b,a.concat(C.call(arguments)))}}var D={init:function(a){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var b=a||document;b.createElement('canvas');b.attachEvent('onreadystatechange',bind(this.init_,this,b))}},init_:function(a){if(!a.namespaces['g_vml_']){a.namespaces.add('g_vml_','urn:schemas-microsoft-com:vml')}if(!a.styleSheets['ex_canvas_']){var b=a.createStyleSheet();b.owningElement.id='ex_canvas_';b.cssText='canvas{display:inline-block;overflow:hidden;'+'text-align:left;width:300px;height:150px}'+'g_vml_\\:*{behavior:url(#default#VML)}'}},i:function(a){if(!a.getContext){a.getContext=getContext;a.attachEvent('onpropertychange',onPropertyChange);a.attachEvent('onresize',onResize);var b=a.attributes;if(b.width&&b.width.specified){a.style.width=b.width.nodeValue+'px'}else{a.width=a.clientWidth}if(b.height&&b.height.specified){a.style.height=b.height.nodeValue+'px'}else{a.height=a.clientHeight}}return a}};function onPropertyChange(e){var a=e.srcElement;switch(e.propertyName){case'width':a.style.width=a.attributes.width.nodeValue+'px';a.getContext().clearRect();break;case'height':a.style.height=a.attributes.height.nodeValue+'px';a.getContext().clearRect();break}}function onResize(e){var a=e.srcElement;if(a.firstChild){a.firstChild.style.width=a.clientWidth+'px';a.firstChild.style.height=a.clientHeight+'px'}}D.init();var E=[];for(var i=0;i<16;i++){for(var j=0;j<16;j++){E[i*16+j]=i.toString(16)+j.toString(16)}}function createMatrixIdentity(){return[[1,0,0],[0,1,0],[0,0,1]]}function processStyle(a){var b,alpha=1;a=String(a);if(a.substring(0,3)=='rgb'){var c=a.indexOf('(',3);var d=a.indexOf(')',c+1);var e=a.substring(c+1,d).split(',');b='#';for(var i=0;i<3;i++){b+=E[Number(e[i])]}if(e.length==4&&a.substr(3,1)=='a'){alpha=e[3]}}else{b=a}return[b,alpha]}function processLineCap(a){switch(a){case'butt':return'flat';case'round':return'round';case'square':default:return'square'}}function CanvasRenderingContext2D_(a){this.m_=createMatrixIdentity();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle='#000';this.fillStyle='#000';this.lineWidth=1;this.lineJoin='miter';this.lineCap='butt';this.miterLimit=Z*1;this.globalAlpha=1;this.canvas=a;var b=a.ownerDocument.createElement('div');b.style.width=a.clientWidth+'px';b.style.height=a.clientHeight+'px';b.style.overflow='hidden';b.style.position='absolute';a.appendChild(b);this.element_=b;this.arcScaleX_=1;this.arcScaleY_=1}var F=CanvasRenderingContext2D_.prototype;F.clearRect=function(){this.element_.innerHTML='';this.currentPath_=[]};F.beginPath=function(){this.currentPath_=[]};F.moveTo=function(a,b){var p=this.getCoords_(a,b);this.currentPath_.push({type:'moveTo',x:p.x,y:p.y});this.currentX_=p.x;this.currentY_=p.y};F.lineTo=function(a,b){var p=this.getCoords_(a,b);this.currentPath_.push({type:'lineTo',x:p.x,y:p.y});this.currentX_=p.x;this.currentY_=p.y};F.bezierCurveTo=function(a,b,c,d,e,f){var p=this.getCoords_(e,f);var g=this.getCoords_(a,b);var h=this.getCoords_(c,d);this.currentPath_.push({type:'bezierCurveTo',cp1x:g.x,cp1y:g.y,cp2x:h.x,cp2y:h.y,x:p.x,y:p.y});this.currentX_=p.x;this.currentY_=p.y};F.fillRect=function(a,b,c,d){this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.fill();this.currentPath_=[]};F.createLinearGradient=function(a,b,c,d){return new CanvasGradient_('gradient')};F.createRadialGradient=function(a,b,c,d,e,f){var g=new CanvasGradient_('gradientradial');g.radius1_=c;g.radius2_=f;g.focus_.x=a;g.focus_.y=b;return g};F.stroke=function(d){var e=[];var f=false;var a=processStyle(d?this.fillStyle:this.strokeStyle);var g=a[0];var h=a[1]*this.globalAlpha;var W=10;var H=10;e.push('<g_vml_:shape',' fillcolor="',g,'"',' filled="',Boolean(d),'"',' style="position:absolute;width:',W,';height:',H,';"',' coordorigin="0 0" coordsize="',Z*W,' ',Z*H,'"',' stroked="',!d,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',g,'"',' path="');var j=false;var k={x:null,y:null};var l={x:null,y:null};for(var i=0;i<this.currentPath_.length;i++){var p=this.currentPath_[i];var c;switch(p.type){case'moveTo':e.push(' m ');c=p;e.push(y(p.x),',',y(p.y));break;case'lineTo':e.push(' l ');e.push(y(p.x),',',y(p.y));break;case'close':e.push(' x ');p=null;break;case'bezierCurveTo':e.push(' c ');e.push(y(p.cp1x),',',y(p.cp1y),',',y(p.cp2x),',',y(p.cp2y),',',y(p.x),',',y(p.y));break;case'at':case'wa':e.push(' ',p.type,' ');e.push(y(p.x-this.arcScaleX_*p.radius),',',y(p.y-this.arcScaleY_*p.radius),' ',y(p.x+this.arcScaleX_*p.radius),',',y(p.y+this.arcScaleY_*p.radius),' ',y(p.xStart),',',y(p.yStart),' ',y(p.xEnd),',',y(p.yEnd));break}if(p){if(k.x==null||p.x<k.x){k.x=p.x}if(l.x==null||p.x>l.x){l.x=p.x}if(k.y==null||p.y<k.y){k.y=p.y}if(l.y==null||p.y>l.y){l.y=p.y}}}e.push(' ">');if(typeof this.fillStyle=='object'){var m={x:'50%',y:'50%'};var n=l.x-k.x;var o=l.y-k.y;var q=n>o?n:o;m.x=y(this.fillStyle.focus_.x/n*100+50)+'%';m.y=y(this.fillStyle.focus_.y/o*100+50)+'%';var r=[];if(this.fillStyle.type_=='gradientradial'){var s=this.fillStyle.radius1_/q*100;var t=this.fillStyle.radius2_/q*100-s}else{var s=0;var t=100}var u={offset:null,color:null};var v={offset:null,color:null};this.fillStyle.colors_.sort(function(a,b){return a.offset-b.offset});for(var i=0;i<this.fillStyle.colors_.length;i++){var w=this.fillStyle.colors_[i];r.push(w.offset*t+s,'% ',w.color,',');if(w.offset>u.offset||u.offset==null){u.offset=w.offset;u.color=w.color}if(w.offset<v.offset||v.offset==null){v.offset=w.offset;v.color=w.color}}r.pop();e.push('<g_vml_:fill',' color="',v.color,'"',' color2="',u.color,'"',' type="',this.fillStyle.type_,'"',' focusposition="',m.x,', ',m.y,'"',' colors="',r.join(''),'"',' opacity="',h,'" />')}else if(d){e.push('<g_vml_:fill color="',g,'" opacity="',h,'" />')}else{var x=Math.max(this.arcScaleX_,this.arcScaleY_)*this.lineWidth;e.push('<g_vml_:stroke',' opacity="',h,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',processLineCap(this.lineCap),'"',' weight="',x,'px"',' color="',g,'" />')}e.push('</g_vml_:shape>');this.element_.insertAdjacentHTML('beforeEnd',e.join(''))};F.fill=function(){this.stroke(true)};F.closePath=function(){this.currentPath_.push({type:'close'})};F.getCoords_=function(a,b){return{x:Z*(a*this.m_[0][0]+b*this.m_[1][0]+this.m_[2][0])-B,y:Z*(a*this.m_[0][1]+b*this.m_[1][1]+this.m_[2][1])-B}};function CanvasPattern_(){}G_vmlCMjrc=D})()}if(jQuery.browser.msie){document.execCommand("BackgroundImageCache",false,true)}(function($){var N=$.browser.msie;var O=N&&!window.XMLHttpRequest;var P=$.browser.opera;var Q=typeof document.createElement('canvas').getContext=="function";var R=function(i){return parseInt(i,10)||0};var S=function(a,b,c){var x=a,y;if(x.currentStyle){y=x.currentStyle[b]}else if(window.getComputedStyle){if(typeof arguments[2]=="string")b=c;y=document.defaultView.getComputedStyle(x,null).getPropertyValue(b)}return y};var T=function(a,p){return S(a,'border'+p+'Color','border-'+p.toLowerCase()+'-color')};var U=function(a,p){if(a.currentStyle&&!P){w=a.currentStyle['border'+p+'Width'];if(w=='thin')w=2;if(w=='medium'&&!(a.currentStyle['border'+p+'Style']=='none'))w=4;if(w=='thick')w=6}else{p=p.toLowerCase();w=document.defaultView.getComputedStyle(a,null).getPropertyValue('border-'+p+'-width')}return R(w)};var V=function(a,i){return a.tagName.toLowerCase()==i};var W=function(e,a,b,c,d){if(e=='tl')return a;if(e=='tr')return b;if(e=='bl')return c;if(e=='br')return d};var X=function(a,b,c,d,e,f,g){var h,curve_to;if(d.indexOf('rgba')!=-1){var i=/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/;var j=i.exec(d);if(j){var k=[R(j[1]),R(j[2]),R(j[3])];d='rgb('+k[0]+', '+k[1]+', '+k[2]+')'}}var l=a.getContext('2d');if(b==1||g=='notch'){if(e>0&&b>1){l.fillStyle=f;l.fillRect(0,0,b,b);l.fillStyle=d;h=W(c,[0-e,0-e],[e,0-e],[0-e,e],[e,e]);l.fillRect(h[0],h[1],b,b)}else{l.fillStyle=d;l.fillRect(0,0,b,b)}return a}else if(g=='bevel'){h=W(c,[0,0,0,b,b,0,0,0],[0,0,b,b,b,0,0,0],[0,0,b,b,0,b,0,0],[b,b,b,0,0,b,b,b]);l.fillStyle=d;l.beginPath();l.moveTo(h[0],h[1]);l.lineTo(h[2],h[3]);l.lineTo(h[4],h[5]);l.lineTo(h[6],h[7]);l.fill();if(e>0&&e<b){l.strokeStyle=f;l.lineWidth=e;l.beginPath();h=W(c,[0,b,b,0],[0,0,b,b],[b,b,0,0],[0,b,b,0]);l.moveTo(h[0],h[1]);l.lineTo(h[2],h[3]);l.stroke()}return a}h=W(c,[0,0,b,0,b,0,0,b,0,0],[b,0,b,b,b,0,0,0,0,0],[0,b,b,b,0,b,0,0,0,b],[b,b,b,0,b,0,0,b,b,b]);l.fillStyle=d;l.beginPath();l.moveTo(h[0],h[1]);l.lineTo(h[2],h[3]);if(c=='br')l.bezierCurveTo(h[4],h[5],b,b,h[6],h[7]);else l.bezierCurveTo(h[4],h[5],0,0,h[6],h[7]);l.lineTo(h[8],h[9]);l.fill();if(e>0&&e<b){var m=e/2;var n=b-m;h=W(c,[n,m,n,m,m,n],[n,n,n,m,m,m],[n,n,m,n,m,m,m,n],[n,m,n,m,m,n,n,n]);curve_to=W(c,[0,0],[0,0],[0,0],[b,b]);l.strokeStyle=f;l.lineWidth=e;l.beginPath();l.moveTo(h[0],h[1]);l.bezierCurveTo(h[2],h[3],curve_to[0],curve_to[1],h[4],h[5]);l.stroke()}return a};var Y=function(p,a){var b=document.createElement('canvas');b.setAttribute("height",a);b.setAttribute("width",a);b.style.display="block";b.style.position="absolute";b.className="jrCorner";Z(p,b);if(!Q&&N){if(typeof G_vmlCanvasManager=="object"){b=G_vmlCanvasManager.initElement(b)}else if(typeof G_vmlCMjrc=="object"){b=G_vmlCMjrc.i(b)}else{throw Error('Could not find excanvas');}}return b};var Z=function(p,a){if(p.is("table")){p.children("tbody").children("tr:first").children("td:first").append(a);p.css('display','block')}else if(p.is("td")){if(p.children(".JrcTdContainer").length===0){p.html('<div class="JrcTdContainer" style="padding:0px;position:relative;margin:-1px;zoom:1;">'+p.html()+'</div>');p.css('zoom','1');if(O){p.children(".JrcTdContainer").get(0).style.setExpression("height","this.parentNode.offsetHeight")}}p.children(".JrcTdContainer").append(a)}else{p.append(a)}};if(N){var ba=document.createStyleSheet();ba.media='print';ba.cssText='.jrcIECanvasDiv { display:none !important; }'}var bb=function(D){if(this.length==0||!(Q||N)){return this}if(D=="destroy"){return this.each(function(){var p,elm=$(this);if(elm.is(".jrcRounded")){if(typeof elm.data("ie6tmr.jrc")=='number')window.clearInterval(elm.data("ie6tmr.jrc"));if(elm.is("table"))p=elm.children("tbody").children("tr:first").children("td:first");else if(elm.is("td"))p=elm.children(".JrcTdContainer");else p=elm;p.children(".jrCorner").remove();elm.unbind('mouseleave.jrc').unbind('mouseenter.jrc').removeClass('jrcRounded').removeData('ie6tmr.jrc');if(elm.is("td"))elm.html(elm.children(".JrcTdContainer").html())}})}var o=(D||"").toLowerCase();var E=R((o.match(/(\d+)px/)||[])[1])||"auto";var F=((o.match(/(#[0-9a-f]+)/)||[])[1])||"auto";var G=/round|bevel|notch/;var H=((o.match(G)||['round'])[0]);var I=/hover/.test(o);var J=/oversized/.test(o);var K=o.match("hiddenparent");if(N){var G=/ie6nofix|ie6fixinit|ie6fixexpr|ie6fixonload|ie6fixwidthint|ie6fixheightint|ie6fixbothint/;var L=((o.match(G)||['ie6fixinit'])[0])}var M={tl:/top|left|tl/.test(o),tr:/top|right|tr/.test(o),bl:/bottom|left|bl/.test(o),br:/bottom|right|br/.test(o)};if(!M.tl&&!M.tr&&!M.bl&&!M.br)M={tl:1,tr:1,bl:1,br:1};this.each(function(){var d=$(this),rbg=null,bg,s,b,pr;var a=this;var e=S(this,'display');var f=S(this,'position');var g=S(this,'lineHeight','line-height');if(F=="auto"){s=d.siblings(".jrcRounded:eq(0)");if(s.length>0){b=s.data("rbg.jrc");if(typeof b=="string"){rbg=b}}}if(K||rbg===null){var h=this.parentNode,hidden_parents=new Array(),a=0;while((typeof h=='object')&&!V(h,'html')){if(K&&S(h,'display')=='none'){hidden_parents.push({originalvisibility:S(h,'visibility'),elm:h});h.style.display='block';h.style.visibility='hidden'}var j=S(h,'backgroundColor','background-color');if(rbg===null&&j!="transparent"&&j!="rgba(0, 0, 0, 0)"){rbg=j}h=h.parentNode}if(rbg===null)rbg="#ffffff"}if(F=="auto"){bg=rbg;d.data("rbg.jrc",rbg)}else{bg=F}if(e=='none'){var k=S(this,'visibility');this.style.display='block';this.style.visibility='hidden';var l=true}else{var m=false}var n=d.height();var p=d.width();if(I){var q=o.replace(/hover|ie6nofix|ie6fixinit|ie6fixexpr|ie6fixonload|ie6fixwidthint|ie6fixheightint|ie6fixbothint/g,"");if(L!='ie6nofix')q="ie6fixinit "+q;d.bind("mouseenter.jrc",function(){d.addClass('jrcHover');d.corner(q)});d.bind("mouseleave.jrc",function(){d.removeClass('jrcHover');d.corner(q)})}if(O&&L!='ie6nofix'){this.style.zoom=1;if(L!='ie6fixexpr'){if(d.width()%2!=0)d.width(d.width()+1);if(d.height()%2!=0)d.height(d.height()+1)}$(window).load(function(){if(L=='ie6fixonload'){if(d.css('height')=='auto')d.height(d.css('height'));if(d.width()%2!=0)d.width(d.width()+1);if(d.height()%2!=0)d.height(d.height()+1)}else if(L=='ie6fixwidthint'||L=='ie6fixheightint'||L=='ie6fixbothint'){var c,ie6FixFunction;if(L=='ie6fixheightint'){ie6FixFunction=function(){d.height('auto');var a=d.height();if(a%2!=0)a=a+1;d.css({height:a})}}else if(L=='ie6fixwidthint'){ie6FixFunction=function(){d.width('auto');var a=d.width();if(a%2!=0)a=a+1;d.css({width:a});d.data('lastWidth.jrc',d.get(0).offsetWidth)}}else if(L=='ie6fixbothint'){ie6FixFunction=function(){d.width('auto');d.height('auto');var a=d.width();var b=d.height();if(b%2!=0)b=b+1;if(a%2!=0)a=a+1;d.css({width:a,height:b})}}c=window.setInterval(ie6FixFunction,100);d.data("ie6tmr.jrc",c)}})}var r=n<p?this.offsetHeight:this.offsetWidth;if(E=="auto"){E=r/2;if(E>10)E=r/4}if(E>r/2&&!J){E=r/2}E=Math.floor(E);var t=U(this,'Top');var u=U(this,'Right');var v=U(this,'Bottom');var w=U(this,'Left');if(f=='static'&&!V(this,'td')){this.style.position='relative'}else if(f=='fixed'&&N&&!(document.compatMode=='CSS1Compat'&&!O)){this.style.position='absolute'}if(t+u+v+w>0){this.style.overflow='visible'}if(l)d.css({display:'none',visibility:k});if(typeof hidden_parents!="undefined"){for(var i=0;i<hidden_parents.length;i++){hidden_parents[i].elm.style.display='none';hidden_parents[i].elm.style.visibility=hidden_parents[i].originalvisibility}}var x=0-t,p_right=0-u,p_bottom=0-v,p_left=0-w;var y=(d.find("canvas").length>0);if(y){if(V(this,'table'))pr=d.children("tbody").children("tr:first").children("td:first");else if(V(this,'td'))pr=d.children(".JrcTdContainer");else pr=d}if(M.tl){bordersWidth=t<w?t:w;if(y)pr.children("canvas.jrcTL").remove();var z=X(Y(d,E),E,'tl',bg,bordersWidth,T(this,'Top'),H);$(z).css({left:p_left,top:x}).addClass('jrcTL')}if(M.tr){bordersWidth=t<u?t:u;if(y)pr.children("canvas.jrcTR").remove();var A=X(Y(d,E),E,'tr',bg,bordersWidth,T(this,'Top'),H);$(A).css({right:p_right,top:x}).addClass('jrcTR')}if(M.bl){bordersWidth=v<w?v:w;if(y)pr.children("canvas.jrcBL").remove();var B=X(Y(d,E),E,'bl',bg,bordersWidth,T(this,'Bottom'),H);$(B).css({left:p_left,bottom:p_bottom}).addClass('jrcBL')}if(M.br){bordersWidth=v<u?v:u;if(y)pr.children("canvas.jrcBR").remove();var C=X(Y(d,E),E,'br',bg,bordersWidth,T(this,'Bottom'),H);$(C).css({right:p_right,bottom:p_bottom}).addClass('jrcBR')}if(N)d.children('canvas.jrCorner').children('div').addClass('jrcIECanvasDiv');if(O&&L=='ie6fixexpr'){if(M.bl){B.style.setExpression("bottom","this.parentNode.offsetHeight % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])) : 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])+1)")}if(M.br){C.style.setExpression("right","this.parentNode.offsetWidth  % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderRightWidth']))  : 0-(parseInt(this.parentNode.currentStyle['borderRightWidth'])+1)");C.style.setExpression("bottom","this.parentNode.offsetHeight % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])) : 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])+1)")}if(M.tr){A.style.setExpression("right","this.parentNode.offsetWidth   % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderRightWidth']))  : 0-(parseInt(this.parentNode.currentStyle['borderRightWidth'])+1)")}}d.addClass('jrcRounded')});if(typeof arguments[1]=="function")arguments[1](this);return this};$.fn.corner=bb})(jQuery);
;(function($){var _remove=$.fn.remove;$.fn.remove=function(){$("*",this).add(this).triggerHandler("remove");return _remove.apply(this,arguments);};function isVisible(element){function checkStyles(element){var style=element.style;return(style.display!='none'&&style.visibility!='hidden');}
var visible=checkStyles(element);(visible&&$.each($.dir(element,'parentNode'),function(){return(visible=checkStyles(this));}));return visible;}
$.extend($.expr[':'],{data:function(a,i,m){return $.data(a,m[3]);},tabbable:function(a,i,m){var nodeName=a.nodeName.toLowerCase();return(a.tabIndex>=0&&(('a'==nodeName&&a.href)||(/input|select|textarea|button/.test(nodeName)&&'hidden'!=a.type&&!a.disabled))&&isVisible(a));}});$.keyCode={BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38};function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods);}
var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'));}
return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this;}
if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options)));(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace][name]=function(element,options){var self=this;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(e,key,value){return self._setData(key,value);}).bind('getData.'+name,function(e,key){return self._getData(key);}).bind('remove',function(){return self.destroy();});this._init();};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName);},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled');}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,e,data){var eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);e=e||$.event.fix({type:eventName,target:this.element[0]});return this.element.triggerHandler(eventName,[e,data],this.options[type]);}};$.widget.defaults={disabled:false};$.ui={plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},cssCache:{},css:function(name){if($.ui.cssCache[name]){return $.ui.cssCache[name];}
var tmp=$('<div class="ui-gen">').addClass(name).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!((!(/auto|default/).test(tmp.css('cursor'))||(/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0));}catch(e){}
return $.ui.cssCache[name];},disableSelection:function(el){$(el).attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},enableSelection:function(el){$(el).attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},hasScroll:function(e,a){var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(e[scroll]>0){return true;}
e[scroll]=1;has=(e[scroll]>0);e[scroll]=0;return has;}};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(e){return self._mouseDown(e);});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},_mouseDown:function(e){(this._mouseStarted&&this._mouseUp(e));this._mouseDownEvent=e;var self=this,btnIsLeft=(e.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(e.target).parents().add(e.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(e)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(e)!==false);if(!this._mouseStarted){e.preventDefault();return true;}}
this._mouseMoveDelegate=function(e){return self._mouseMove(e);};this._mouseUpDelegate=function(e){return self._mouseUp(e);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);return false;},_mouseMove:function(e){if($.browser.msie&&!e.button){return this._mouseUp(e);}
if(this._mouseStarted){this._mouseDrag(e);return false;}
if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,e)!==false);(this._mouseStarted?this._mouseDrag(e):this._mouseUp(e));}
return!this._mouseStarted;},_mouseUp:function(e){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._mouseStop(e);}
return false;},_mouseDistanceMet:function(e){return(Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance);},_mouseDelayMet:function(e){return this.mouseDelayMet;},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.fn.unwrap=$.fn.unwrap||function(expr){return this.each(function(){$(this).parents(expr).eq(0).after(this).remove();});};$.widget("ui.slider",{plugins:{},ui:function(e){return{options:this.options,handle:this.currentHandle,value:this.options.axis!="both"||!this.options.axis?Math.round(this.value(null,this.options.axis=="vertical"?"y":"x")):{x:Math.round(this.value(null,"x")),y:Math.round(this.value(null,"y"))},range:this._getRange()};},_propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n=="slide"?n:"slide"+n,[e,this.ui()],this.options[n]);},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider");if(this.handle&&this.handle.length){this.handle.unwrap("a");this.handle.each(function(){$(this).data("mouse")._mouseDestroy();});}
this.generated&&this.generated.remove();},_setData:function(key,value){$.widget.prototype._setData.apply(this,arguments);if(/min|max|steps/.test(key)){this._initBoundaries();}
if(key=="range"){value?this.handle.length==2&&this._createRange():this._removeRange();}},_init:function(){var self=this;this.element.addClass("ui-slider");this._initBoundaries();this.handle=$(this.options.handle,this.element);if(!this.handle.length){self.handle=self.generated=$(self.options.handles||[0]).map(function(){var handle=$("<div/>").addClass("ui-slider-handle").appendTo(self.element);if(this.id)
handle.attr("id",this.id);return handle[0];});}
var handleclass=function(el){this.element=$(el);this.element.data("mouse",this);this.options=self.options;this.element.bind("mousedown",function(){if(self.currentHandle)this.blur(self.currentHandle);self._focus(this,true);});this._mouseInit();};$.extend(handleclass.prototype,$.ui.mouse,{_mouseStart:function(e){return self._start.call(self,e,this.element[0]);},_mouseStop:function(e){return self._stop.call(self,e,this.element[0]);},_mouseDrag:function(e){return self._drag.call(self,e,this.element[0]);},_mouseCapture:function(){return true;},trigger:function(e){this._mouseDown(e);}});$(this.handle).each(function(){new handleclass(this);}).wrap('<a href="javascript:void(0)" style="outline:none;border:none;"></a>').parent().bind('focus',function(e){self._focus(this.firstChild);}).bind('blur',function(e){self._blur(this.firstChild);}).bind('keydown',function(e){if(!self.options.noKeyboard)return self._keydown(e.keyCode,this.firstChild);});this.element.bind('mousedown.slider',function(e){self._click.apply(self,[e]);self.currentHandle.data("mouse").trigger(e);self.firstValue=self.firstValue+1;});$.each(this.options.handles||[],function(index,handle){self.moveTo(handle.start,index,true);});if(!isNaN(this.options.startValue))
this.moveTo(this.options.startValue,0,true);this.previousHandle=$(this.handle[0]);if(this.handle.length==2&&this.options.range)this._createRange();},_initBoundaries:function(){var element=this.element[0],o=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};$.extend(o,{axis:o.axis||(element.offsetWidth<element.offsetHeight?'vertical':'horizontal'),max:!isNaN(parseInt(o.max,10))?{x:parseInt(o.max,10),y:parseInt(o.max,10)}:({x:o.max&&o.max.x||100,y:o.max&&o.max.y||100}),min:!isNaN(parseInt(o.min,10))?{x:parseInt(o.min,10),y:parseInt(o.min,10)}:({x:o.min&&o.min.x||0,y:o.min&&o.min.y||0})});o.realMax={x:o.max.x-o.min.x,y:o.max.y-o.min.y};o.stepping={x:o.stepping&&o.stepping.x||parseInt(o.stepping,10)||(o.steps?o.realMax.x/(o.steps.x||parseInt(o.steps,10)||o.realMax.x):0),y:o.stepping&&o.stepping.y||parseInt(o.stepping,10)||(o.steps?o.realMax.y/(o.steps.y||parseInt(o.steps,10)||o.realMax.y):0)};},_keydown:function(keyCode,handle){var k=keyCode;if(/(33|34|35|36|37|38|39|40)/.test(k)){var o=this.options,xpos,ypos;if(/(35|36)/.test(k)){xpos=(k==35)?o.max.x:o.min.x;ypos=(k==35)?o.max.y:o.min.y;}else{var oper=/(34|37|40)/.test(k)?"-=":"+=";var step=/(37|38|39|40)/.test(k)?"_oneStep":"_pageStep";xpos=oper+this[step]("x");ypos=oper+this[step]("y");}
this.moveTo({x:xpos,y:ypos},handle);return false;}
return true;},_focus:function(handle,hard){this.currentHandle=$(handle).addClass('ui-slider-handle-active');if(hard)
this.currentHandle.parent()[0].focus();},_blur:function(handle){$(handle).removeClass('ui-slider-handle-active');if(this.currentHandle&&this.currentHandle[0]==handle){this.previousHandle=this.currentHandle;this.currentHandle=null;};},_click:function(e){var pointer=[e.pageX,e.pageY];var clickedHandle=false;this.handle.each(function(){if(this==e.target)
clickedHandle=true;});if(clickedHandle||this.options.disabled||!(this.currentHandle||this.previousHandle))
return;if(!this.currentHandle&&this.previousHandle)
this._focus(this.previousHandle,true);this.offset=this.element.offset();this.moveTo({y:this._convertValue(e.pageY-this.offset.top-this.currentHandle[0].offsetHeight/2,"y"),x:this._convertValue(e.pageX-this.offset.left-this.currentHandle[0].offsetWidth/2,"x")},null,!this.options.distance);},_createRange:function(){if(this.rangeElement)return;this.rangeElement=$('<div></div>').addClass('ui-slider-range').css({position:'absolute'}).appendTo(this.element);this._updateRange();},_removeRange:function(){this.rangeElement.remove();this.rangeElement=null;},_updateRange:function(){var prop=this.options.axis=="vertical"?"top":"left";var size=this.options.axis=="vertical"?"height":"width";this.rangeElement.css(prop,(parseInt($(this.handle[0]).css(prop),10)||0)+this._handleSize(0,this.options.axis=="vertical"?"y":"x")/2);this.rangeElement.css(size,(parseInt($(this.handle[1]).css(prop),10)||0)-(parseInt($(this.handle[0]).css(prop),10)||0));},_getRange:function(){return this.rangeElement?this._convertValue(parseInt(this.rangeElement.css(this.options.axis=="vertical"?"height":"width"),10),this.options.axis=="vertical"?"y":"x"):null;},_handleIndex:function(){return this.handle.index(this.currentHandle[0]);},value:function(handle,axis){if(this.handle.length==1)this.currentHandle=this.handle;if(!axis)axis=this.options.axis=="vertical"?"y":"x";var curHandle=$(handle!=undefined&&handle!==null?this.handle[handle]||handle:this.currentHandle);if(curHandle.data("mouse").sliderValue){return parseInt(curHandle.data("mouse").sliderValue[axis],10);}else{return parseInt(((parseInt(curHandle.css(axis=="x"?"left":"top"),10)/(this.actualSize[axis=="x"?"width":"height"]-this._handleSize(handle,axis)))*this.options.realMax[axis])+this.options.min[axis],10);}},_convertValue:function(value,axis){return this.options.min[axis]+(value/(this.actualSize[axis=="x"?"width":"height"]-this._handleSize(null,axis)))*this.options.realMax[axis];},_translateValue:function(value,axis){return((value-this.options.min[axis])/this.options.realMax[axis])*(this.actualSize[axis=="x"?"width":"height"]-this._handleSize(null,axis));},_translateRange:function(value,axis){if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&value>=this._translateValue(this.value(1),axis))
value=this._translateValue(this.value(1,axis)-this._oneStep(axis),axis);if(this.currentHandle[0]==this.handle[1]&&value<=this._translateValue(this.value(0),axis))
value=this._translateValue(this.value(0,axis)+this._oneStep(axis),axis);}
if(this.options.handles){var handle=this.options.handles[this._handleIndex()];if(value<this._translateValue(handle.min,axis)){value=this._translateValue(handle.min,axis);}else if(value>this._translateValue(handle.max,axis)){value=this._translateValue(handle.max,axis);}}
return value;},_translateLimits:function(value,axis){if(value>=this.actualSize[axis=="x"?"width":"height"]-this._handleSize(null,axis))
value=this.actualSize[axis=="x"?"width":"height"]-this._handleSize(null,axis);if(value<=0)
value=0;return value;},_handleSize:function(handle,axis){return $(handle!=undefined&&handle!==null?this.handle[handle]:this.currentHandle)[0]["offset"+(axis=="x"?"Width":"Height")];},_oneStep:function(axis){return this.options.stepping[axis]||1;},_pageStep:function(axis){return 10;},_start:function(e,handle){var o=this.options;if(o.disabled)return false;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(!this.currentHandle)
this._focus(this.previousHandle,true);this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:e.pageY-this.handleOffset.top,left:e.pageX-this.handleOffset.left};this.firstValue=this.value();this._propagate('start',e);this._drag(e,handle);return true;},_stop:function(e){this._propagate('stop',e);if(this.firstValue!=this.value())
this._propagate('change',e);this._focus(this.currentHandle,true);return false;},_drag:function(e,handle){var o=this.options;var position={top:e.pageY-this.offset.top-this.clickOffset.top,left:e.pageX-this.offset.left-this.clickOffset.left};if(!this.currentHandle)this._focus(this.previousHandle,true);position.left=this._translateLimits(position.left,"x");position.top=this._translateLimits(position.top,"y");if(o.stepping.x){var value=this._convertValue(position.left,"x");value=Math.round(value/o.stepping.x)*o.stepping.x;position.left=this._translateValue(value,"x");}
if(o.stepping.y){var value=this._convertValue(position.top,"y");value=Math.round(value/o.stepping.y)*o.stepping.y;position.top=this._translateValue(value,"y");}
position.left=this._translateRange(position.left,"x");position.top=this._translateRange(position.top,"y");if(o.axis!="vertical")this.currentHandle.css({left:position.left});if(o.axis!="horizontal")this.currentHandle.css({top:position.top});this.currentHandle.data("mouse").sliderValue={x:Math.round(this._convertValue(position.left,"x"))||0,y:Math.round(this._convertValue(position.top,"y"))||0};if(this.rangeElement)
this._updateRange();this._propagate('slide',e);return false;},moveTo:function(value,handle,noPropagation){var o=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(handle==undefined&&!this.currentHandle&&this.handle.length!=1)
return false;if(handle==undefined&&!this.currentHandle)
handle=0;if(handle!=undefined)
this.currentHandle=this.previousHandle=$(this.handle[handle]||handle);if(value.x!==undefined&&value.y!==undefined){var x=value.x,y=value.y;}else{var x=value,y=value;}
if(x!==undefined&&x.constructor!=Number){var me=/^\-\=/.test(x),pe=/^\+\=/.test(x);if(me||pe){x=this.value(null,"x")+parseInt(x.replace(me?'=':'+=',''),10);}else{x=isNaN(parseInt(x,10))?undefined:parseInt(x,10);}}
if(y!==undefined&&y.constructor!=Number){var me=/^\-\=/.test(y),pe=/^\+\=/.test(y);if(me||pe){y=this.value(null,"y")+parseInt(y.replace(me?'=':'+=',''),10);}else{y=isNaN(parseInt(y,10))?undefined:parseInt(y,10);}}
if(o.axis!="vertical"&&x!==undefined){if(o.stepping.x)x=Math.round(x/o.stepping.x)*o.stepping.x;x=this._translateValue(x,"x");x=this._translateLimits(x,"x");x=this._translateRange(x,"x");o.animate?this.currentHandle.stop().animate({left:x},(Math.abs(parseInt(this.currentHandle.css("left"))-x))*(!isNaN(parseInt(o.animate))?o.animate:5)):this.currentHandle.css({left:x});}
if(o.axis!="horizontal"&&y!==undefined){if(o.stepping.y)y=Math.round(y/o.stepping.y)*o.stepping.y;y=this._translateValue(y,"y");y=this._translateLimits(y,"y");y=this._translateRange(y,"y");o.animate?this.currentHandle.stop().animate({top:y},(Math.abs(parseInt(this.currentHandle.css("top"))-y))*(!isNaN(parseInt(o.animate))?o.animate:5)):this.currentHandle.css({top:y});}
if(this.rangeElement)
this._updateRange();this.currentHandle.data("mouse").sliderValue={x:Math.round(this._convertValue(x,"x"))||0,y:Math.round(this._convertValue(y,"y"))||0};if(!noPropagation){this._propagate('start',null);this._propagate('stop',null);this._propagate('change',null);this._propagate("slide",null);}}});$.ui.slider.getter="value";$.ui.slider.defaults={handle:".ui-slider-handle",distance:1,animate:false};})(jQuery);(function($){$.widget("ui.tabs",{_init:function(){this.options.event+='.tabs';this._tabify(true);},_setData:function(key,value){if((/^selected/).test(key))
this.select(value);else{this.options[key]=value;this._tabify();}},length:function(){return this.$tabs.length;},_tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a);},ui:function(tab,panel){return{options:this.options,tab:tab,panel:panel,index:this.$tabs.index(tab)};},_tabify:function(init){this.$lis=$('li:has(a[href])',this.element);this.$tabs=this.$lis.map(function(){return $('a',this)[0];});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#',''))
self.$panels=self.$panels.add(a.hash);else if($(a).attr('href')!='#'){$.data(a,'href.tabs',a.href);$.data(a,'load.tabs',a.href);var id=self._tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.element);$panel.data('destroy.tabs',true);}
self.$panels=self.$panels.add($panel);}
else
o.disabled.push(i+1);});if(init){this.element.addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.addClass(o.panelClass);});if(o.selected===undefined){if(location.hash){this.$tabs.each(function(i,a){if(a.hash==location.hash){o.selected=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId);},500);}
scrollTo(0,0);return false;}});}
else if(o.cookie){var index=parseInt($.cookie('ui-tabs-'+$.data(self.element[0])),10);if(index&&self.$tabs[index])
o.selected=index;}
else if(self.$lis.filter('.'+o.selectedClass).length)
o.selected=self.$lis.index(self.$lis.filter('.'+o.selectedClass)[0]);}
o.selected=o.selected===null||o.selected!==undefined?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.$lis.filter('.'+o.disabledClass),function(n,i){return self.$lis.index(n);}))).sort();if($.inArray(o.selected,o.disabled)!=-1)
o.disabled.splice($.inArray(o.selected,o.disabled),1);this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(o.selected!==null){this.$panels.eq(o.selected).show().removeClass(o.hideClass);this.$lis.eq(o.selected).addClass(o.selectedClass);var onShow=function(){self._trigger('show',null,self.ui(self.$tabs[o.selected],self.$panels[o.selected]));};if($.data(this.$tabs[o.selected],'load.tabs'))
this.load(o.selected,onShow);else
onShow();}
$(window).bind('unload',function(){self.$tabs.unbind('.tabs');self.$lis=self.$tabs=self.$panels=null;});}
else
o.selected=this.$lis.index(this.$lis.filter('.'+o.selectedClass)[0]);if(o.cookie)
$.cookie('ui-tabs-'+$.data(self.element[0]),o.selected,o.cookie);for(var i=0,li;li=this.$lis[i];i++)
$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass(o.selectedClass)?'addClass':'removeClass'](o.disabledClass);if(o.cache===false)
this.$tabs.removeData('cache.tabs');var hideFx,showFx,baseFx={'min-width':0,duration:1},baseDuration='normal';if(o.fx&&o.fx.constructor==Array)
hideFx=o.fx[0]||baseFx,showFx=o.fx[1]||baseFx;else
hideFx=showFx=o.fx||baseFx;var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie)
resetCSS.opacity='';function hideTab(clicked,$hide,$show){$hide.animate(hideFx,hideFx.duration||baseDuration,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideFx.opacity)
$hide[0].style.filter='';if($show)
showTab(clicked,$show,$hide);});}
function showTab(clicked,$show,$hide){if(showFx===baseFx)
$show.css('display','block');$show.animate(showFx,showFx.duration||baseDuration,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showFx.opacity)
$show[0].style.filter='';self._trigger('show',null,self.ui(clicked,$show[0]));});}
function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show);}
this.$tabs.unbind('.tabs').bind(o.event,function(){var $li=$(this).parents('li:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||$(this).hasClass(o.loadingClass)||self._trigger('select',null,self.ui(this,$show[0]))===false){this.blur();return false;}
self.options.selected=self.$tabs.index(this);if(o.unselect){if($li.hasClass(o.selectedClass)){self.options.selected=null;$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false;}else if(!$hide.length){self.$panels.stop();var a=this;self.load(self.$tabs.index(this),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show);});this.blur();return false;}}
if(o.cookie)
$.cookie('ui-tabs-'+$.data(self.element[0]),self.options.selected,o.cookie);self.$panels.stop();if($show.length){var a=this;self.load(self.$tabs.index(this),$hide.length?function(){switchTab(a,$li,$hide,$show);}:function(){$li.addClass(o.selectedClass);showTab(a,$show);});}else
throw'jQuery UI Tabs: Mismatching fragment identifier.';if($.browser.msie)
this.blur();return false;});if(!(/^click/).test(o.event))
this.$tabs.bind('click.tabs',function(){return false;});},add:function(url,label,index){if(index==undefined)
index=this.$tabs.length;var o=this.options;var $li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label));$li.data('destroy.tabs',true);var id=url.indexOf('#')==0?url.replace('#',''):this._tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.hideClass).data('destroy.tabs',true);}
$panel.addClass(o.panelClass);if(index>=this.$lis.length){$li.appendTo(this.element);$panel.appendTo(this.element[0].parentNode);}else{$li.insertBefore(this.$lis[index]);$panel.insertBefore(this.$panels[index]);}
o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this._tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'load.tabs');if(href)
this.load(index,href);}
this._trigger('add',null,this.ui(this.$tabs[index],this.$panels[index]));},remove:function(index){var o=this.options,$li=this.$lis.eq(index).remove(),$panel=this.$panels.eq(index).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1)
this.select(index+(index+1<this.$tabs.length?1:-1));o.disabled=$.map($.grep(o.disabled,function(n,i){return n!=index;}),function(n,i){return n>=index?--n:n});this._tabify();this._trigger('remove',null,this.ui($li.find('a')[0],$panel[0]));},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1)
return;var $li=this.$lis.eq(index).removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block');},0);}
o.disabled=$.grep(o.disabled,function(n,i){return n!=index;});this._trigger('enable',null,this.ui(this.$tabs[index],this.$panels[index]));},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.$lis.eq(index).addClass(o.disabledClass);o.disabled.push(index);o.disabled.sort();this._trigger('disable',null,this.ui(this.$tabs[index],this.$panels[index]));}},select:function(index){if(typeof index=='string')
index=this.$tabs.index(this.$tabs.filter('[href$='+index+']')[0]);this.$tabs.eq(index).trigger(this.options.event);},load:function(index,callback){var self=this,o=this.options,$a=this.$tabs.eq(index),a=$a[0],bypassCache=callback==undefined||callback===false,url=$a.data('load.tabs');callback=callback||function(){};if(!url||!bypassCache&&$.data(a,'cache.tabs')){callback();return;}
var inner=function(parent){var $parent=$(parent),$inner=$parent.find('*:last');return $inner.length&&$inner.is(':not(img)')&&$inner||$parent;};var cleanup=function(){self.$tabs.filter('.'+o.loadingClass).removeClass(o.loadingClass).each(function(){if(o.spinner)
inner(this).parent().html(inner(this).data('label.tabs'));});self.xhr=null;};if(o.spinner){var label=inner(a).html();inner(a).wrapInner('<em></em>').find('em').data('label.tabs',label).html(o.spinner);}
var ajaxOptions=$.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(a.hash).html(r);cleanup();if(o.cache)
$.data(a,'cache.tabs',true);self._trigger('load',null,self.ui(self.$tabs[index],self.$panels[index]));o.ajaxOptions.success&&o.ajaxOptions.success(r,s);callback();}});if(this.xhr){this.xhr.abort();cleanup();}
$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions);},0);},url:function(index,url){this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs',url);},destroy:function(){var o=this.options;this.element.unbind('.tabs').removeClass(o.navClass).removeData('tabs');this.$tabs.each(function(){var href=$.data(this,'href.tabs');if(href)
this.href=href;var $this=$(this).unbind('.tabs');$.each(['href','load','cache'],function(i,prefix){$this.removeData(prefix+'.tabs');});});this.$lis.add(this.$panels).each(function(){if($.data(this,'destroy.tabs'))
$(this).remove();else
$(this).removeClass([o.selectedClass,o.unselectClass,o.disabledClass,o.panelClass,o.hideClass].join(' '));});}});$.ui.tabs.defaults={unselect:false,event:'click',disabled:[],cookie:null,spinner:'Loading…',cache:false,idPrefix:'ui-tabs-',ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:'<div></div>',navClass:'ui-tabs-nav',selectedClass:'ui-tabs-selected',unselectClass:'ui-tabs-unselect',disabledClass:'ui-tabs-disabled',panelClass:'ui-tabs-panel',hideClass:'ui-tabs-hide',loadingClass:'ui-tabs-loading'};$.ui.tabs.getter="length";$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){continuing=continuing||false;var self=this,t=this.options.selected;function start(){self.rotation=setInterval(function(){t=++t<self.$tabs.length?t:0;self.select(t);},ms);}
function stop(e){if(!e||e.clientX){clearInterval(self.rotation);}}
if(ms){start();if(!continuing)
this.$tabs.bind(this.options.event,stop);else
this.$tabs.bind(this.options.event,function(){stop();t=self.options.selected;start();});}
else{stop();this.$tabs.unbind(this.options.event,stop);}}});})(jQuery);

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
/*
 * jTweetsAnywhere V1.2.1
 * http://thomasbillenstein.com/jTweetsAnywhere/
 *
 * Copyright 2010, Thomas Billenstein
 * Licensed under the MIT license.
 * http://thomasbillenstein.com/jTweetsAnywhere/license.txt
 */
 
var lang = document.getElementsByTagName('html')[0].getAttribute('lang');
if (lang == "ca") {
	universitat = "La Universitat a Twitter";
	publi = "Publicat fa ";
	dia = " dia";
	dies = " dies";
	hora = " hora";
	hores = " hores";
	segon = " segon";
	minut = " minut";
	minuts = " minuts";
	carrega = "Carregant...";
	no_info = "No hi ha mÃ©s informaciÃ³";
	mes_tweets = "MÃ©s tweets";
	mes_info = "MÃ©s";
	desde = " des de";
	retweet = " retweet de: ";
	menys_minut = " menys d'un minut";
	ago = "";
	usuari = "ub_endirecte";
	enllac = "http://twitter.com/ub_endirecte";
} else if (lang == "es") {

	universitat = "La Universidad en Twitter";
	publi = "Publicado hace ";
	dia = " dÃ­a";
	dies = " dias";
	hora = " hora";
	hores = " horas";
	segon = " segundo";
	minut = " minuto";
	minuts = " minutos";
	carrega = "Cargando...";
	no_info = "No hay mÃ¡s informaciÃ³n";
	mes_tweets = "MÃ¡s tweets";
	mes_info = "MÃ¡s";
	desde = " desde";
	retweet = " retweet de: ";
	menys_minut = " menos de un minuto";
	ago = "";
	usuari = "ub_endirecto";
	enllac = "http://twitter.com/ub_endirecto";

} else {
	universitat = "The University on Twitter";
	publi = " ";
	dia = " day";
	dies = " days";
	hora = " hour";
	hores = " hours";
	segon = " second";
	minut = " minute";
	minuts = " minutes";
	carrega = "Loading...";
	no_info = "No more information";
	mes_tweets = "More tweets";
	mes_info = "More";
	desde = " from: ";
	retweet = " retweet de: ";
	menys_minut = " less than a minute";
	ago = " ago";
	usuari = "ub_live";
	enllac = "http://twitter.com/ub_live";
}
 
 
 if (typeof usuari === 'undefined') {
 	usuari = 'ub_endirecte'
 }
(
 
 
 function(e){e.fn.jTweetsAnywhere=function(a){a=e.extend({username:usuari,list:null,searchParams:null,count:0,tweetProfileImagePresent:null,tweetFilter:defaultTweetFilter,showTweetFeed:true,showFollowButton:false,showConnectButton:false,showLoginInfo:false,showTweetBox:false,mainDecorator:defaultMainDecorator,tweetFeedDecorator:defaultTweetFeedDecorator,tweetDecorator:defaultTweetDecorator,tweetProfileImageDecorator:defaultTweetProfileImageDecorator,tweetBodyDecorator:defaultTweetBodyDecorator, tweetUsernameDecorator:defaultTweetUsernameDecorator,tweetTextDecorator:defaultTweetTextDecorator,tweetAttributesDecorator:defaultTweetAttributesDecorator,tweetTimestampDecorator:defaultTweetTimestampDecorator,tweetSourceDecorator:defaultTweetSourceDecorator,tweetGeoLocationDecorator:defaultTweetGeoLocationDecorator,tweetInReplyToDecorator:defaultTweetInReplyToDecorator,tweetRetweeterDecorator:defaultTweetRetweeterDecorator,tweetFeedControlsDecorator:defaultTweetFeedControlsDecorator,tweetFeedControlsMoreBtnDecorator:defaultTweetFeedControlsMoreBtnDecorator, tweetFeedControlsPrevBtnDecorator:defaultTweetFeedControlsPrevBtnDecorator,tweetFeedControlsNextBtnDecorator:defaultTweetFeedControlsNextBtnDecorator,tweetFeedAutorefreshTriggerDecorator:defaultTweetFeedAutorefreshTriggerDecorator,tweetFeedAutorefreshTriggerContentDecorator:defaultTweetFeedAutorefreshTriggerContentDecorator,connectButtonDecorator:defaultConnectButtonDecorator,loginInfoDecorator:defaultLoginInfoDecorator,loginInfoContentDecorator:defaultLoginInfoContentDecorator,followButtonDecorator:defaultFollowButtonDecorator, tweetBoxDecorator:defaultTweetBoxDecorator,linkDecorator:defaultLinkDecorator,usernameDecorator:defaultUsernameDecorator,hashtagDecorator:defaultHashtagDecorator,loadingDecorator:defaultLoadingDecorator,errorDecorator:defaultErrorDecorator,noDataDecorator:defaultNoDataDecorator,tweetTimestampFormatter:defaultTweetTimestampFormatter,tweetTimestampTooltipFormatter:defaultTweetTimestampTooltipFormatter,tweetVisualizer:defaultTweetVisualizer,loadingIndicatorVisualizer:defaultLoadingIndicatorVisualizer, autorefreshTriggerVisualizer:defaultAutorefreshTriggerVisualizer,onDataRequestHandler:defaultOnDataRequestHandler,onRateLimitDataHandler:defaultOnRateLimitDataHandler,_tweetFeedConfig:{expandHovercards:false,showTimestamp:{refreshInterval:0},showSource:false,showGeoLocation:true,showInReplyTo:true,showProfileImages:null,showUserScreenNames:null,showUserFullNames:false,includeRetweets:true,paging:{mode:"none",_limit:0,_offset:0},autorefresh:{mode:"none",interval:60,duration:3600,_startTime:null,_triggerElement:null}, _pageParam:0,_maxId:null,_recLevel:0,_noData:false,_clearBeforePopulate:false},_tweetBoxConfig:{counter:true,width:515,height:65,label:"What's happening?",defaultContent:"",onTweet:function(){}},_connectButtonConfig:{size:"medium"},_baseSelector:null,_baseElement:null,_tweetFeedElement:null,_tweetFeedControlsElement:null,_followButtonElement:null,_loginInfoElement:null,_connectButtonElement:null,_tweetBoxElement:null,_loadingIndicatorElement:null,_noDataElement:null,_tweetsCache:[],_autorefreshTweetsCache:[], _stats:{dataRequestCount:0,rateLimitPreventionCount:0,rateLimit:{remaining_hits:150,hourly_limit:150}}},a);if(a.mainDecorator){a._baseSelector=this.selector;if(typeof a.username!="string"){if(!a.searchParams)a.searchParams=["q=des de:"+a.username.join(desde)];a.username=a.username[0]}typeof a.showTweetFeed=="object"&&e.extend(true,a._tweetFeedConfig,a.showTweetFeed);if(typeof a.showTweetBox=="object"){a._tweetBoxConfig=a.showTweetBox;a.showTweetBox=true}if(typeof a.showConnectButton=="object"){a._connectButtonConfig= a.showConnectButton;a.showConnectButton=true}if(a._tweetFeedConfig.showProfileImages==null)a._tweetFeedConfig.showProfileImages=a.tweetProfileImagePresent;if(a._tweetFeedConfig.showProfileImages==null)a._tweetFeedConfig.showProfileImages=(a.list||a.searchParams)&&a.tweetProfileImageDecorator;if(a._tweetFeedConfig.showUserScreenNames==null){if(a.list||a.searchParams)a._tweetFeedConfig.showUserScreenNames=true;if(!a.tweetUsernameDecorator)a._tweetFeedConfig.showUserScreenNames=false}if(a._tweetFeedConfig.showUserFullNames== null){if(a.list||a.searchParams)a._tweetFeedConfig.showUserFullNames=true;if(!a.tweetUsernameDecorator)a._tweetFeedConfig.showUserFullNames=false}a.count=validateRange(a.count,0,a.searchParams?100:20);a._tweetFeedConfig.autorefresh.interval=Math.max(30,a._tweetFeedConfig.autorefresh.interval);a._tweetFeedConfig.paging._offset=0;a._tweetFeedConfig.paging._limit=a.count;if(a.count==0||!a.showTweetFeed){a.tweetFeedDecorator=null;a.tweetFeedControlsDecorator=null}if(a._tweetFeedConfig.paging.mode=="none")a.tweetFeedControlsDecorator= null;if(!a.showFollowButton)a.followButtonDecorator=null;if(!a.showTweetBox)a.tweetBoxDecorator=null;if(!a.showConnectButton)a.connectButtonDecorator=null;if(!a.showLoginInfo)a.loginInfoDecorator=null;if(!a._tweetFeedConfig.showTimestamp)a.tweetTimestampDecorator=null;if(!a._tweetFeedConfig.showSource)a.tweetSourceDecorator=null;if(!a._tweetFeedConfig.showGeoLocation)a.tweetGeoLocationDecorator=null;if(!a._tweetFeedConfig.showInReplyTo)a.tweetInReplyToDecorator=null;e.ajaxSetup({cache:true});return this.each(function(){a._baseElement= e(this);a._tweetFeedElement=a.tweetFeedDecorator?e(a.tweetFeedDecorator(a)):null;a._tweetFeedControlsElement=a.tweetFeedControlsDecorator?e(a.tweetFeedControlsDecorator(a)):null;a._followButtonElement=a.followButtonDecorator?e(a.followButtonDecorator(a)):null;a._tweetBoxElement=a.tweetBoxDecorator?e(a.tweetBoxDecorator(a)):null;a._connectButtonElement=a.connectButtonDecorator?e(a.connectButtonDecorator(a)):null;a._loginInfoElement=a.loginInfoDecorator?e(a.loginInfoDecorator(a)):null;a.mainDecorator(a); populateTweetFeed(a);populateAnywhereControls(a);bindEventHandlers(a);a._tweetFeedConfig.autorefresh._startTime=(new Date).getTime();startAutorefresh(a);startTimestampRefresh(a)})}};defaultMainDecorator=function(a){a._tweetFeedElement&&a._baseElement.append(a._tweetFeedElement);a._tweetFeedControlsElement&&a._baseElement.append(a._tweetFeedControlsElement);a._connectButtonElement&&a._baseElement.append(a._connectButtonElement);a._loginInfoElement&&a._baseElement.append(a._loginInfoElement);a._followButtonElement&& a._baseElement.append(a._followButtonElement);a._tweetBoxElement&&a._baseElement.append(a._tweetBoxElement)};defaultTweetFeedControlsDecorator=function(a){var b="";if(a._tweetFeedConfig.paging.mode=="prev-next"){if(a.tweetFeedControlsPrevBtnDecorator)b+=a.tweetFeedControlsPrevBtnDecorator(a);if(a.tweetFeedControlsNextBtnDecorator)b+=a.tweetFeedControlsNextBtnDecorator(a)}else if(a._tweetFeedConfig.paging.mode!="endless-scroll")if(a.tweetFeedControlsMoreBtnDecorator)b+=a.tweetFeedControlsMoreBtnDecorator(a);
  return'<div class="jta-tweet-list-controls">'+b+"</div>"};
  defaultTweetFeedControlsMoreBtnDecorator=function(){return'<div class="jta-tweet-list-controls-button jta-tweet-list-controls-button-more"></div>'};
 defaultTweetFeedControlsPrevBtnDecorator=function(){return'<div class="jta-tweet-list-controls-button jta-tweet-list-controls-button-prev"></div>'};
 defaultTweetFeedControlsNextBtnDecorator=function(){return'<div class="jta-tweet-list-controls-button jta-tweet-list-controls-button-next"></div>'}; 
 defaultTweetFeedAutorefreshTriggerDecorator=function(a,b){var c="";if(b.tweetFeedAutorefreshTriggerContentDecorator)c=b.tweetFeedAutorefreshTriggerContentDecorator(a,b);return'<li class="jta-tweet-list-autorefresh-trigger">'+c+"</li>"};
 defaultTweetFeedAutorefreshTriggerContentDecorator=function(a){return'<span class="jta-tweet-list-autorefresh-trigger-content">'+(""+a+" new "+(a>1?" tweets":" tweet"))+"</span>"};
 defaultTweetFeedDecorator=function(){return'<ul class="jta-tweet-list"></ul>'};
 
 defaultTweetDecorator= function(a,b){var c="";if(b._tweetFeedConfig.showProfileImages)c+=b.tweetProfileImageDecorator(a,b);
 if(b.tweetBodyDecorator)c+=b.tweetBodyDecorator(a,b);c+='<div class="jta-clear"></div>';
 return'<div class="jta-tweet-list titol_twitter">'+universitat+'</div><li class="jta-tweet-list-item">'+c+"</li>"};
 defaultTweetProfileImageDecorator=function(a){a=a.retweeted_status||a;var b=a.user?a.user.screen_name:a.from_user;return'<div class="jta-tweet-profile-image">'+('<a class="jta-tweet-profile-image-link" href="http://twitter.com/'+b+'" target="_blank"><img src="'+ (a.user?a.user.profile_image_url:a.profile_image_url)+'" alt="'+b+'"'+(isAnywherePresent()?"":' title="'+b+'"')+"/></a>")+"</div>"};
 defaultTweetBodyDecorator=function(a,b){var c="";if(b.tweetTextDecorator)c+=b.tweetTextDecorator(a,b);if(b.tweetAttributesDecorator)c+=b.tweetAttributesDecorator(a,b);return'<div class="jta-tweet-body '+(b._tweetFeedConfig.showProfileImages?"jta-tweet-body-list-profile-image-present":"")+'">'+c+"</div>"};defaultTweetTextDecorator=function(a,b){var c=a.text;if(a.retweeted_status&& (b._tweetFeedConfig.showUserScreenNames||b._tweetFeedConfig.showUserScreenNames==null||b._tweetFeedConfig.showUserFullNames||b._tweetFeedConfig.showUserFullNames==null))c=a.retweeted_status.text;if(b.linkDecorator)c=b.linkDecorator(c,b);if(b.usernameDecorator)c=b.usernameDecorator(c,b);if(b.hashtagDecorator)c=b.hashtagDecorator(c,b);if(b._tweetFeedConfig.showUserScreenNames||b._tweetFeedConfig.showUserFullNames||a.retweeted_status&&(b._tweetFeedConfig.showUserScreenNames==null||b._tweetFeedConfig.showUserFullNames== null))c=b.tweetUsernameDecorator(a,b)+" "+c;return'<span class="jta-tweet-text">'+c+"</span>"};defaultTweetUsernameDecorator=function(a,b){var c=a.retweeted_status||a,d=c.user?c.user.screen_name:c.from_user;c=c.user?c.user.name:null;var f;if(d&&(b._tweetFeedConfig.showUserScreenNames||b._tweetFeedConfig.showUserScreenNames==null&&a.retweeted_status))f='<span class="jta-tweet-user-screen-name"><a class="jta-tweet-user-screen-name-link" href="http://twitter.com/'+d+'" target="_blank">'+d+"</a></span>"; var g;if(c&&(b._tweetFeedConfig.showUserFullNames||b._tweetFeedConfig.showUserFullNames==null&&a.retweeted_status))g='<span class="jta-tweet-user-full-name">'+(f?" (":"")+'<a class="jta-tweet-user-full-name-link" href="http://twitter.com/'+d+'" name="'+d+'" target="_blank">'+c+"</a>"+(f?")":"")+"</span>";d="";if(f)d+=f;if(g){if(f)d+=" ";d+=g}if(f||g)d='<span class="jta-tweet-user-name">'+(a.retweeted_status?"RT ":"")+d+"</span>";return d};defaultTweetAttributesDecorator=function(a,b){var c="";if(b.tweetTimestampDecorator|| b.tweetSourceDecorator||b.tweetGeoLocationDecorator||b.tweetInReplyToDecorator||a.retweeted_status&&b.tweetRetweeterDecorator){c+='<span class="jta-tweet-attributes">';if(b.tweetTimestampDecorator)c+=b.tweetTimestampDecorator(a,b);if(b.tweetSourceDecorator)c+=b.tweetSourceDecorator(a,b);if(b.tweetGeoLocationDecorator)c+=b.tweetGeoLocationDecorator(a,b);if(b.tweetInReplyToDecorator)c+=b.tweetInReplyToDecorator(a,b);if(a.retweeted_status&&b.tweetRetweeterDecorator)c+=b.tweetRetweeterDecorator(a,b); c+="</span>"}return c};defaultTweetTimestampDecorator=function(a,b){var c=a.retweeted_status||a,d=formatDate(c.created_at),f=b.tweetTimestampFormatter(d),g=b.tweetTimestampTooltipFormatter(d);return'<span class="jta-tweet-timestamp"><a class="jta-tweet-timestamp-link" data-timestamp="'+d+'" href="http://twitter.com/'+(c.user?c.user.screen_name:c.from_user)+"/status/"+c.id+'" target="_blank" title="'+g+'">'+f+"</a></span>"};defaultTweetTimestampTooltipFormatter=function(a){return(new Date(a)).toLocaleString()}; defaultTweetTimestampFormatter=function(a){var b=new Date,c=parseInt((b.
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																													/*marcador segons*/																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																							getTime()-Date.parse(a))/1E3),d="";if(c<60)d+= publi + c + segon + ago (c == 1 ? "" : "s");
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																														/*marcador minuts*/																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																									else if(c<3600){b=parseInt((c+30)/60);d+= (b == 1 ? publi+b+minut+ago : publi +b+ minuts+ago );}
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																											
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																												/*marcador hores*/																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																												else if(c<86400){b=parseInt((c+1800)/3600);d+= (b == 1 ? publi +hora+ago : publi +b+ hores+ago );}
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																													
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																														else{a=new Date(a);a.getHours();a.getMinutes();d+=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()]+" "+a.getDate();if(a.getFullYear()<b.getFullYear())d+=", "+a.getFullYear(); b=parseInt((c+43200)/86400);
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																														
/*marcador dies-*/

d ="";

d = (b == 1 ? publi + b + dia +ago : publi + b + dies+ago);}return d};
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																													exTimestampFormatter=function(a){var b=parseInt(((new Date).getTime()-Date.parse(a))/1E3),c="";if(b<60)c+=menys_minut;else if(b<3600){b=parseInt((b+30)/60);c+=publi + b+ minut+(b==1?"":"s")}else if(b<86400){b=parseInt((b+1800)/3600);c+=publi+b+hora+(b==1?"":"s")}else{b=parseInt((b+43200)/86400);c+=publi+b+dia+(b==1?"":"s");a=new Date(a);b="AM";var d=a.getHours();if(d>12){d-=12;b="PM"}var f= a.getMinutes();c+=" ("+d+":"+((f<10?"0":"")+f)+" "+b+" "+(a.getMonth()+1)+"/"+a.getDate()+"/"+a.getFullYear()+")"}return c};defaultTweetSourceDecorator=function(a){return'<span class="jta-tweet-source">'+desde+'<span class="jta-tweet-source-link">'+(a.retweeted_status||a).source.replace(/\&lt\;/gi,"<").replace(/\&gt\;/gi,">").replace(/\&quot\;/gi,'"')+"</span></span>"};defaultTweetGeoLocationDecorator=function(a){var b="";a=a.retweeted_status||a;var c;if(a.geo&&a.geo.coordinates)c=a.geo.coordinates.join(); else if(a.place&&a.place.full_name)c=a.place.full_name;if(c){b="here";if(a.place&&a.place.full_name)b=a.place.full_name;b='<span class="jta-tweet-location">'+desde+' <a class="jta-tweet-location-link" href="'+("http://maps.google.com/maps?q="+c)+'" target="_blank">'+b+"</a></span>"}return b};defaultTweetInReplyToDecorator=function(a){a=a.retweeted_status||a;var b="";if(a.in_reply_to_status_id&&a.in_reply_to_screen_name)b='<span class="jta-tweet-inreplyto"> <a class="jta-tweet-inreplyto-link" href="http://twitter.com/'+ a.in_reply_to_screen_name+"/status/"+a.in_reply_to_status_id+'" target="_blank">en resposta a: '+a.in_reply_to_screen_name+"</a></span>";return b};defaultTweetRetweeterDecorator=function(a){var b="";if(a.retweeted_status){b=a.user?a.user.screen_name:a.from_user;a=(a.retweeted_status.retweet_count||0)-1;var c=" and "+a+(a>1?" others":" other");b='<br/><span class="jta-tweet-retweeter">'+retweet+('<a class="jta-tweet-retweeter-link" href="http://twitter.com/'+b+'" target="_blank">'+b+"</a>")+(a>0? c:"")+"</span>"}return b};defaultConnectButtonDecorator=function(){return'<div class="jta-connect-button"></div>'};defaultLoginInfoDecorator=function(){return'<div class="jta-login-info"></div>'};defaultLoginInfoContentDecorator=function(a,b){var c="";if(b.isConnected()){c=b.currentUser.data("screen_name");var d=b.currentUser.data("profile_image_url");c='<div class="jta-login-info-profile-image"><a href="http://twitter.com/'+c+'" target="_blank"><img src="'+d+'" alt="'+c+'" title="'+c+'"/></a></div><div class="jta-login-info-block"><div class="jta-login-info-screen-name"><a href="http://twitter.com/'+ c+'" target="_blank">'+c+'</a></div><div class="jta-login-info-sign-out">Sign out</div></div><div class="jta-clear"></div>'}return c};defaultFollowButtonDecorator=function(){return'<div class="jta-follow-button"></div>'};defaultTweetBoxDecorator=function(){return'<div class="jta-tweet-box"></div>'};defaultLinkDecorator=function(a){return a.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1" class="jta-tweet-a jta-tweet-link" target="_blank" rel="nofollow">$1</a>')}; defaultUsernameDecorator=function(a){return isAnywherePresent()?a:a.replace(/@([a-zA-Z0-9_]+)/gi,'@<a href="http://twitter.com/$1" class="jta-tweet-a twitter-anywhere-user" target="_blank" rel="nofollow">$1</a>')};defaultHashtagDecorator=function(a){return a.replace(/#([a-zA-Z0-9_]+)/gi,'<a href="http://search.twitter.com/search?q=%23$1" class="jta-tweet-a jta-tweet-hashtag" title="#$1" target="_blank" rel="nofollow">#$1</a>')};defaultLoadingDecorator=function(){return'<div class="jta-loading">'+ carrega +'</div>'}; defaultErrorDecorator=function(a){return'<li class="jta-error">ERROR: '+a+"</li>"};defaultNoDataDecorator=function(){return'<li class="jta-nodata">No hi ha més informació</li>'};defaultTweetFilter=function(){return true};defaultTweetVisualizer=function(a,b,c){a[c](b)};defaultLoadingIndicatorVisualizer=function(a,b,c,d){defaultVisualizer(a,b,"append","fadeIn",600,"fadeOut",200,d)};defaultAutorefreshTriggerVisualizer=function(a,b,c,d){defaultVisualizer(a,b,"prepend","slideDown",600,"fadeOut",200,d)};defaultVisualizer= function(a,b,c,d,f,g,k,h){var j=function(){h&&h()};if(a){b.hide();a[c](b);b[d](f,j)}else b[g](k,function(){b.remove();j()})};defaultOnDataRequestHandler=function(){return true};defaultOnRateLimitDataHandler=function(){};updateLoginInfoElement=function(a,b){if(a._loginInfoElement&&a.loginInfoContentDecorator){a._loginInfoElement.children().remove();a._loginInfoElement.append(a.loginInfoContentDecorator(a,b));e(a._baseSelector+" .jta-login-info-sign-out").bind("click",function(){twttr.anywhere.signOut()})}}; getFeedUrl=function(a,b){var c="https:"==document.location.protocol?"https:":"http:";if(a.searchParams)c+="//search.twitter.com/search.json?"+(a.searchParams instanceof Array?a.searchParams.join("&"):a.searchParams)+"&rpp=100";else if(a.list)c+="//api.twitter.com/1/"+a.username+"/lists/"+a.list+"/statuses.json?per_page=20";else{c+="//api.twitter.com/1/statuses/user_timeline.json?screen_name="+a.username+"&count=20";if(a._tweetFeedConfig.includeRetweets)c+="&include_rts=true"}if(b)c+=(a._tweetFeedConfig._maxId? "&max_id="+a._tweetFeedConfig._maxId:"")+"&page="+a._tweetFeedConfig._pageParam;c+="&callback=?";return c};isAnywherePresent=function(){return typeof twttr!="undefined"};clearTweetFeed=function(a){a._tweetFeedElement&&a._tweetFeedElement.empty()};populateTweetFeed=function(a){a.tweetDecorator&&a._tweetFeedElement&&getPagedTweets(a,function(b,c){c._tweetFeedConfig._clearBeforePopulate&&clearTweetFeed(c);hideLoadingIndicator(c,function(){e.each(b,function(d,f){c.tweetVisualizer(c._tweetFeedElement, e(c.tweetDecorator(f,c)),"append",c)});if(c._tweetFeedConfig._noData&&c.noDataDecorator&&!c._tweetFeedConfig._noDataElement){c._tweetFeedConfig._noDataElement=e(c.noDataDecorator(c));c._tweetFeedElement.append(c._tweetFeedConfig._noDataElement)}c._tweetFeedConfig._clearBeforePopulate&&c._tweetFeedElement.scrollTop(0);addHovercards(c)})})};populateTweetFeed2=function(a){if(a._tweetFeedElement&&a._autorefreshTweetsCache.length>0)if(a._tweetFeedConfig.autorefresh.mode=="trigger-insert")if(a._tweetFeedConfig.autorefresh._triggerElement)a.tweetFeedAutorefreshTriggerContentDecorator&& a._tweetFeedConfig.autorefresh._triggerElement.html(a.tweetFeedAutorefreshTriggerContentDecorator(a._autorefreshTweetsCache.length,a));else{if(a.tweetFeedAutorefreshTriggerDecorator){a._tweetFeedConfig.autorefresh._triggerElement=e(a.tweetFeedAutorefreshTriggerDecorator(a._autorefreshTweetsCache.length,a));a._tweetFeedConfig.autorefresh._triggerElement.bind("click",function(){a.autorefreshTriggerVisualizer(null,a._tweetFeedConfig.autorefresh._triggerElement,a,function(){insertTriggerTweets(a)});a._tweetFeedConfig.autorefresh._triggerElement= null});a.autorefreshTriggerVisualizer(a._tweetFeedElement,a._tweetFeedConfig.autorefresh._triggerElement,a)}}else insertTriggerTweets(a)};insertTriggerTweets=function(a){if(a.tweetDecorator&&a._autorefreshTweetsCache.length>0){for(;a._autorefreshTweetsCache.length>0;){var b=a._autorefreshTweetsCache.pop();a._tweetsCache.unshift(b);a._tweetFeedConfig.paging._offset++;a.tweetVisualizer(a._tweetFeedElement,e(a.tweetDecorator(b,a)),"prepend",a)}addHovercards(a)}};addHovercards=function(a){isAnywherePresent()&& twttr.anywhere(function(b){b(a._baseSelector+" .jta-tweet-list").hovercards({expanded:a._tweetFeedConfig.expandHovercards});b(a._baseSelector+" .jta-tweet-profile-image img").hovercards({expanded:a._tweetFeedConfig.expandHovercards,username:function(c){return c.alt}});b(a._baseSelector+" .jta-tweet-retweeter-link").hovercards({expanded:a._tweetFeedConfig.expandHovercards,username:function(c){return c.text}});b(a._baseSelector+" .jta-tweet-user-screen-name-link").hovercards({expanded:a._tweetFeedConfig.expandHovercards, username:function(c){return c.text}});b(a._baseSelector+" .jta-tweet-user-full-name-link").hovercards({expanded:a._tweetFeedConfig.expandHovercards,username:function(c){return c.name}})})};populateAnywhereControls=function(a){isAnywherePresent()&&twttr.anywhere(function(b){a.tweetBoxDecorator&&b(a._baseSelector+" .jta-tweet-box").tweetBox(a._tweetBoxConfig);a.followButtonDecorator&&b(a._baseSelector+" .jta-follow-button").followButton(a.username);if(a.connectButtonDecorator){var c=e.extend({authComplete:function(){updateLoginInfoElement(a, b)},signOut:function(){updateLoginInfoElement(a,b)}},a._connectButtonConfig);b(a._baseSelector+" .jta-connect-button").connectButton(c);updateLoginInfoElement(a,b)}})};bindEventHandlers=function(a){if(a.tweetFeedControlsDecorator)if(a._tweetFeedConfig.paging.mode=="prev-next"){e(a._baseSelector+" .jta-tweet-list-controls-button-prev").bind("click",function(){!isLoading(a)&&a._tweetFeedConfig.paging._offset>0&&prevPage(a,true)});e(a._baseSelector+" .jta-tweet-list-controls-button-next").bind("click", function(){isLoading(a)||nextPage(a,true)})}else a._tweetFeedConfig.paging.mode=="endless-scroll"?a._tweetFeedElement.bind("scroll",function(){!isLoading(a)&&e(this)[0].scrollHeight-e(this).scrollTop()==e(this).outerHeight()&&nextPage(a,false)}):e(a._baseSelector+" .jta-tweet-list-controls-button-more").bind("click",function(){isLoading(a)||nextPage(a,false)})};nextPage=function(a,b){doPage(a,b,Math.min(a._tweetFeedConfig.paging._offset+a._tweetFeedConfig.paging._limit,a._tweetsCache.length))};prevPage= function(a,b){doPage(a,b,Math.max(0,a._tweetFeedConfig.paging._offset-a._tweetFeedConfig.paging._limit))};doPage=function(a,b,c){a._tweetFeedConfig.paging._offset=c;a._tweetFeedConfig._clearBeforePopulate=b;populateTweetFeed(a)};startAutorefresh=function(a){if(a._tweetFeedConfig.autorefresh.mode!="none"&&a._tweetFeedConfig.paging.mode!="prev-next"&&a._tweetFeedConfig.autorefresh.duration!=0&&(a._tweetFeedConfig.autorefresh.duration<0||(new Date).getTime()-a._tweetFeedConfig.autorefresh._startTime<= a._tweetFeedConfig.autorefresh.duration*1E3))window.setTimeout(function(){processAutorefresh(a)},a._tweetFeedConfig.autorefresh.interval*1E3)};stopAutorefresh=function(a){a._tweetFeedConfig.autorefresh.duration=0};processAutorefresh=function(a){if(a._tweetFeedConfig.autorefresh.duration!=0){getRateLimitedData(a,true,getFeedUrl(a,false),function(b,c){var d=(b.results||b).slice(0);d.reverse();e.each(d,function(f,g){isTweetInCache(g,c)||c.tweetFilter(g,c)&&c._autorefreshTweetsCache.unshift(g)});populateTweetFeed2(c)}); startAutorefresh(a)}};startTimestampRefresh=function(a){a.tweetTimestampDecorator&&typeof a._tweetFeedConfig.showTimestamp=="object"&&a._tweetFeedConfig.showTimestamp.refreshInterval>0&&window.setTimeout(function(){processTimestampRefresh(a)},a._tweetFeedConfig.showTimestamp.refreshInterval*1E3)};processTimestampRefresh=function(a){e.each(a._tweetFeedElement.find(".jta-tweet-timestamp-link"),function(b,c){var d=e(c).attr("data-timestamp");e(c).html(a.tweetTimestampFormatter(d))});startTimestampRefresh(a)}; isTweetInCache=function(a,b){for(var c=b._tweetsCache.length,d=0;d<c;d++)if(a.id==b._tweetsCache[d].id)return true;return false};showLoadingIndicator=function(a){if(a._tweetFeedElement&&a.loadingDecorator&&!a._loadingIndicatorElement){a._loadingIndicatorElement=e(a.loadingDecorator(a));a.loadingIndicatorVisualizer(a._tweetFeedElement,a._loadingIndicatorElement,a,null);a._tweetFeedElement.scrollTop(1E6)}};hideLoadingIndicator=function(a,b){if(a._loadingIndicatorElement){a.loadingIndicatorVisualizer(null, a._loadingIndicatorElement,a,b);a._loadingIndicatorElement=null}else b&&b()};isLoading=function(a){return a._loadingIndicatorElement!=null};formatDate=function(a){return a.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i,"$1,$2$4$3")};validateRange=function(a,b,c){if(a<b)a=b;if(a>c)a=c;return a};showError=function(a,b){a.errorDecorator&&a._tweetFeedElement&&a._tweetFeedElement.append(a.errorDecorator(b,a))};getPagedTweets=function(a,b){a._tweetFeedConfig._recLevel=0;getRecPagedTweets(a,a._tweetFeedConfig.paging._offset, a._tweetFeedConfig.paging._limit,b)};getRecPagedTweets=function(a,b,c,d){++a._tweetFeedConfig._recLevel;if(b+c<=a._tweetsCache.length||a._tweetFeedConfig._recLevel>3||a._tweetFeedConfig._noData){if(b+c>a._tweetsCache.length)c=Math.max(0,a._tweetsCache.length-b);for(var f=[],g=0;g<c;g++)f[g]=a._tweetsCache[b+g];d(f,a)}else{++a._tweetFeedConfig._pageParam;getRateLimitedData(a,false,getFeedUrl(a,true),function(k,h){var j=k.results||k;if(j.length==0)h._tweetFeedConfig._noData=true;else e.each(j,function(l, i){if(i.id_str)i.id=i.id_str;if(i.in_reply_to_status_id_str)i.in_reply_to_status_id=i.in_reply_to_status_id_str;if(!h._tweetFeedConfig._maxId)h._tweetFeedConfig._maxId=i.id;h.tweetFilter(i,h)&&h._tweetsCache.push(i)});getRecPagedTweets(h,b,c,d)})}};getRateLimitedData=function(a,b,c,d){getRateLimit(a,function(f){if(f&&f.remaining_hits<=0){a._stats.rateLimitPreventionCount++;hideLoadingIndicator(a,null)}else getData(a,b,c,d)})};getData=function(a,b,c,d){a._stats.dataRequestCount++;if(a.onDataRequestHandler(a._stats, a)){b||showLoadingIndicator(a);e.getJSON(c,function(f){f.error?showError(a,f.error):d(f,a)})}else hideLoadingIndicator(a,null)};getRateLimit=function(a,b){e.getJSON("http://api.twitter.com/1/account/rate_limit_status.json?callback=?",function(c){a._stats.rateLimit=c;a.onRateLimitDataHandler(a._stats,a);b(c)})}})(jQuery);
