var linkTag = ""; function inputListenerSeason(el){ jQuery17(el).change(function () { if(!jQuery17.cookie("cssSeason")) { var season2date = jQuery17(this).val(); if(season2date){ jQuery17.ajax({ url: 'index.php?getSeason=true&seasonFromDate='+season2date, success: function(season) { var seasonFile = "http://www.lozere-resa.com/templates/bms/css/seasons/bms-"+season+".php" if(linkTag.attr("href") != seasonFile){ linkTag.attr("href",seasonFile); } } }); } } }) } jQuery17(document).ready(function() { var _default = jQuery17('meta[name="season"]').attr("content"); linkTag = jQuery17('#bmsSeasonFile'); jQuery17('a.chooseSeason').bind('click', function(event) { event.preventDefault(); var season = jQuery17(this).attr('href').replace("#",""); linkTag.attr("class",jQuery17(this).attr('class')) linkTag.attr("href","http://www.lozere-resa.com/templates/bms/css/seasons/bms-"+season+".php"); if(_default==season){ jQuery17.cookie('cssSeason', null); }else{ jQuery17.cookie("cssSeason",season, {expires: 15, path: '/'}); } return false; }); });