$(function(){ $('[data-hash]').each(function(){ var self = $(this); var a_html = ''+self.html()+''; self.replaceWith(a_html); }); }); function ToggleCountries(id, obj) { $("#region"+id).children("span:first").toggle(0); $("#region"+id).children("span:last").toggle(0); $(obj).parent().toggleClass("down"); $(obj).children("span:first").toggle(0); $(obj).children("span:last").toggle(0); } function PrevPhoto() { currPhoto--; if(currPhoto<0) currPhoto = photosList.length-1; $("#c_main_photo").get(0).style.backgroundImage = "url("+photosList[currPhoto].src+")"; $("#alt").html(photosList[currPhoto].alt); } function NextPhoto() { currPhoto++; if(currPhoto==photosList.length) currPhoto = 0; $("#c_main_photo").get(0).style.backgroundImage = "url("+photosList[currPhoto].src+")"; $("#alt").html(photosList[currPhoto].alt); } function OpenSearch(frm) { if (frm.elements["q"].value) return true; else alert("Ââåäèòå ïîèñêîâóþ ôðàçó"); return false; } function ChangeMonth(year, month, cur_y, cur_m, cur_d) { var objGet = {}; $("#calendar_loader").ajaxSend(function(evt, request, settings) { $(this).show(); } ); if(cur_y && cur_m && cur_d) objGet = {y: year, m: month, c_y: cur_y, c_m: cur_m, c_d: cur_d}; else objGet = {y: year, m: month}; $.get("/calendar/", objGet, function(data) { $("#calendar_cont").html(data); }, "html" ); $("#calendar_loader").ajaxSuccess(function(evt, request, settings) { $(this).hide(); } ); } function SendNewsFilter(form,type) { value = form.filter[form.filter.selectedIndex].value; if(!isNaN(parseInt(value))) { if(value==0) { if(form.action=='/countries/' || form.action=='/types/') location.href = '/news/'; else location.href = form.action; } else { if(type) location.href = form.action+value+'/types/'+type+'/'; else location.href = form.action+value+'/'; } } else if(value.match(/^t_(\d+)$/)) location.href = '/types/'+value.match(/^t_(\d+)$/)[1]; }