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