2 * Left menu create and options
\r
4 dd_options['leftmenu'] = {
\r
6 arrow:'skin_pop_arrow',
\r
9 selrow:'skin_pop_mrow',
\r
10 defpos:{m:'tr', x:-15, y:0}
\r
13 dd_options['langmenu'] = {
\r
15 arrow:'skin_pop_arrow',
\r
18 selrow:'skin_pop_mrow',
\r
19 defpos:{m:'tr', x:0, y:0},
\r
20 mpos1:{m:'bl', x:0, y:0}
\r
25 {link:'?lang=ru',text:'Русский'},
\r
26 {link:'?lang=en',text:'English'}
\r
30 dd_options['skinmenu'] = {min:'0',arrow:'skin_pop_arrow',arrowtext:'',row:'skin_pop_row',selrow:'skin_pop_mrow',defpos:{m:'tr', x:0, y:0},mpos1:{m:'bl', x:0, y:0}};
\r
33 {link:'?skin=default',text:'Default'},
\r
34 {link:'?skin=modern',text:'Modern'},
\r
35 {link:'?skin=lofk_skin',text:'Lofk'},
\r
36 {link:'?skin=dark',text:'Dark'}
\r
39 //=========================
\r
40 function generateLeftMenu()
\r
43 var menu = leftmenu;
\r
44 var l = menu.length;
\r
45 for (var i = 0; i < l; i++)
\r
46 document.write(generateLeftSub(menu[i], i));
\r
48 function generateLeftSub(menu, id)
\r
50 var show = menuCookie[id] == 0 ? false : true;
\r
52 + '<div class=' + (show ? 'skin_lm_sub_on':'skin_lm_sub_off') + ' onClick = "toggleMenu(this, ' + id + ')">'
\r
53 + '<div class="skin_lm_ico" style="background: url(skin/wrath/img/menu/' + menu.ico + '-on.gif) no-repeat;"></div>'
\r
54 + '<div class="skin_lm_name">'
\r
55 + '<div style="position: absolute; left:-1px; top: -1px; color: black;">' + menu.name + '</div>'
\r
56 + '<div style="position: absolute; left:-1px; top: 1px; color: black;">' + menu.name + '</div>'
\r
57 + '<div style="position: absolute; left: 1px; top: -1px; color: black;">' + menu.name + '</div>'
\r
58 + '<div style="position: absolute; left: 1px; top: 1px; color: black;">' + menu.name + '</div>'
\r
59 + '<div style="position: absolute; left: 0px; top: 0px;">' + menu.name + '</div>'
\r
61 + '<div class="skin_lm_add"></div>'
\r
63 + '<div class=skin_lm_sub_top id=left_sub_'+ id + (show ? '' : ' style="display: none;"') + '>'
\r
64 + '<div class=skin_lm_sub_body>'
\r
65 + '<div class=skin_lm_sub_left>'
\r
66 + '<div class=skin_lm_sub_right>'
\r
67 + getSubMenuText(menu.sub, 'leftmenu_' + id)
\r
71 + '<div class=skin_lm_sub_bottom></div>'
\r
76 function changeSearch(element)
\r
78 var a = {'site':'all', 'item':'i', 'itemset':'set', 'quest':'q', 'spell':'s', 'npc':'n', 'object':'g', 'faction':'f', 'player':'p', 'area':'a'}
\r
79 var s = document.getElementById('topsearch');
\r
80 var s1 = document.getElementById('_topsearch');
\r
81 var v = a[element.value];
\r
85 function searchClick(link)
\r
87 var s = document.getElementById('topsearch');
\r
88 var s1 = document.getElementById('_topsearch');
\r
89 link.href = "?s=" + s1.value + "&name=" + s.value;
\r
92 function toggleMenu(menu, id)
\r
94 v = document.getElementById('left_sub_' + id);
\r
95 if (v.style.display == "none")
\r
97 menu.className = 'skin_lm_sub_on';
\r
98 v.style.display = "block";
\r
103 menu.className = 'skin_lm_sub_off';
\r
104 v.style.display = "none";
\r
105 menuCookie[id] = 0;
\r
107 setcookie('menuCookie', menuCookie.join(' '));
\r
109 if (typeof menu.onselectstart!="undefined") //IE route
\r
110 menu.onselectstart=function(){return false}
\r
111 else if (typeof menu.style.MozUserSelect!="undefined") //Firefox route
\r
112 menu.style.MozUserSelect="none"
\r
113 else //All other route (ie: Opera)
\r
114 menu.onmousedown=function(){return false}
\r
119 function getexpirydate(nodays){
\r
121 Today = new Date();
\r
122 nomilli=Date.parse(Today);
\r
123 Today.setTime(nomilli+nodays*24*60*60*1000);
\r
124 UTCstring = Today.toUTCString();
\r
127 function getcookie(cookiename) {
\r
128 var cookiestring=""+document.cookie;
\r
129 var index1=cookiestring.indexOf(cookiename);
\r
130 if (index1==-1 || cookiename=="") return "";
\r
131 var index2=cookiestring.indexOf(';',index1);
\r
132 if (index2==-1) index2=cookiestring.length;
\r
133 return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
\r
135 function setcookie(name,value){
\r
136 cookiestring=name+"="+escape(value)+";EXPIRES="+ getexpirydate(365)+";PATH=/";
\r
137 document.cookie=cookiestring;
\r
139 function prepareCookies()
\r
141 var tempString = getcookie("menuCookie");
\r
145 var l = leftmenu.length;
\r
146 for (var i = 0; i < l; i++)
\r
147 tempString+=(leftmenu[i].show ? 1 : 0) + ' ';
\r
148 setcookie('menuCookie', tempString);
\r
150 menuCookie = tempString.split(" ");
\r