$(document).ready(function()
{
	$('.accesible #letras').html('<ul><li class="big"><a id="aumentar"  href="#" title="'+ aumentitulo + '">A</a></li><li class="medium"><a href="javascript:location.reload()" title="'+ restaurartitulo+'">A</a></li><li class="small"><a id="disminuir" href="#" title="'+ distitulo +'">A</a></li></ul>');
});				      
$(function(){
	$("#aumentar").click(function(){
		var fontSize = $("body").css('font-size');
		fontSize = fontSize.substring(0,fontSize.length-2);
		var newSize = fontSize*1.2;
		$("body").css('font-size',newSize+'px');
	});
	$("#disminuir").click(function(){
		var fontSize = $("body").css('font-size');
		fontSize = fontSize.substring(0,fontSize.length-2);
		var newSize = fontSize/1.2;
		$("body").css('font-size',newSize+'px');
	});
});

/*pijama*/
	$('table.pijama').each(function(index) {
    $(this).find("tbody > tr:odd td").css("background-color", "#f5f5f5");
  });
function cambiarIdioma()
{
	var url = document.location.href;
	var host = document.location.host;
	var path = document.location.pathname;
	var query = document.location.search;
	var lang = document.getElementById('lang').value;
	var cookieVal = lang.substring(0,lang.indexOf("/"));
	lang = "/" + lang;

	if(path.length>1)
	{
		if(url.match(host+"/index.html"))
			path = path.replace("/", lang);
		else if(path.match("comun"))
			path = path;
		else
			path =lang + path.substring(4);
	}
	else
		path = path.replace("/", lang);

	url = "http://" + host + path + query;

	createCookie('senior.idioma',cookieVal,6000);
	window.open(url,'_self');	
} 
function buscarEventos()
{
	var url = "";
	var host = document.location.host;
	var path = document.location.pathname;
	var url = document.location.href;
	var urlPeriodo = document.getElementById('periodo').value;
	var urlTema = document.getElementById('tema').value;

	if(urlTema.match("noSelec"))
		url = "http://" + host + urlPeriodo;
	else
		url = "http://" + host + path + "?tema=" + urlTema;

	window.open(url,'_self');	
}
function buscarNoticias()
{
	var url = "";
	var host = document.location.host;
	var path = document.location.pathname;
	var url = document.location.href;
	var urlPeriodo = document.getElementById('periodoNoticias').value;
	var urlCategoria = document.getElementById('noticiasSobre').value;

	if(urlCategoria != "noSel")
		url = "http://" + host + path + "?noticiasSobre=" + urlCategoria;
	
	if(urlPeriodo != "noSel")
		url = "http://" + host + path + "?periodoNoticias=" + urlPeriodo;
				
	window.open(url,'_self');
}
function buscarPublicaciones()
{
	var url = "";
	var host = document.location.host;
	var path = document.location.pathname;
	var url = document.location.href;
	var urlTema = document.getElementById('tema').value;

	if(urlTema.match("noSel")){}
	else
		url = "http://" + host + path + "?tema=" + urlTema;
				
	window.open(url,'_self');
}
function buscarFaq()
{
	var url = "";
	var host = document.location.host;
	var path = document.location.pathname;
	var url = document.location.href;
	var urlModalidad = document.getElementById('modalidadFaq').value;
	var urlTramite = document.getElementById('tramitesFaq').value;

	if(urlModalidad != "noSel")
		url = "http://" + host + path + "?modalidadFaq=" + urlModalidad;
	if(urlTramite != "noSel")
		url = "http://" + host + path + "?tramitesFaq=" + urlTramite;
	if(urlTramite != "noSel" && urlModalidad != "noSel")
		url = "http://" + host + path + "?tramitesFaq=" + urlTramite + "&modalidadFaq=" + urlModalidad;
	
	alert(url);			
	window.open(url,'_self');
}
