Поиск квестов по типам классов...
[cswowd.git] / js / achievement.js
blob11970bc4949c41d84470d5178586f9884455f9d2
1 var a_lastShow = 0;
3 function changeFaction(href)
5 uploadFromHref(href, 'a_data');
6 return false;
9 function cacheCat(url)
11 ajaxCacheHtmlId('a_data', url);
14 function selectCat(id)
16 var node = $('a_category');
17 if (!node)
18 return;
19 a_lastShow = 0;
20 var list = node.getElementsByTagName('a'), selected = 0;
21 for (var i=0;i<list.length;i++)
23 var e = list[i], parent = e.parentNode;
24 if (e.id == 'ach_' + id)
26 parent.className = 'a_bodycat_sel';
27 if (e.className=='sub')
28 e.className = 'sel';
29 selected = parent;
30 uploadFromHref(e, 'a_data');
32 else
34 if (selected!=parent)
35 parent.className = 'a_bodycat';
36 if (e.className=='sel')
37 e.className = 'sub';
40 return false;
43 function changeSelection(element, sel)
45 var name = element.className, s = sel?' select':'';
46 element.className = (name=='ach_show' || name=='ach_show select') ? 'ach_show'+s : 'ach_show'+s+' locked';
47 element.id = sel ? 'selected':'not_select';
50 function showAchReq(element)
52 if (a_lastShow && a_lastShow != element)
53 changeSelection(a_lastShow, false);
54 a_lastShow = element;
55 changeSelection(element, element.id != 'selected');