6 |
kaklik |
1 |
function MM_openBrWindow(theURL,winName,features) { //v2.0
|
|
|
2 |
window.open(theURL,winName,features);
|
|
|
3 |
}
|
|
|
4 |
|
|
|
5 |
function writeCookie(name, data, noDays){
|
|
|
6 |
var cookieStr = name + "="+ data
|
|
|
7 |
if (writeCookie.arguments.length > 2){
|
|
|
8 |
cookieStr += "; expires=" + getCookieExpireDate(noDays)
|
|
|
9 |
}
|
|
|
10 |
document.cookie = cookieStr
|
|
|
11 |
}
|
|
|
12 |
|
|
|
13 |
function readCookie(cookieName){
|
|
|
14 |
var searchName = cookieName + "="
|
|
|
15 |
var cookies = document.cookie
|
|
|
16 |
var start = cookies.indexOf(cookieName)
|
|
|
17 |
if (start == -1){ // cookie not found
|
|
|
18 |
return ""
|
|
|
19 |
}
|
|
|
20 |
start += searchName.length //start of the cookie data
|
|
|
21 |
var end = cookies.indexOf(";", start)
|
|
|
22 |
if (end == -1){
|
|
|
23 |
end = cookies.length
|
|
|
24 |
}
|
|
|
25 |
return cookies.substring(start, end)
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
function blocking(nr, cookie, vis_state)
|
|
|
29 |
{
|
|
|
30 |
if (document.layers)
|
|
|
31 |
{
|
|
|
32 |
current = (document.layers[nr].display == 'none') ? vis_state : 'none';
|
|
|
33 |
if (cookie != '')
|
|
|
34 |
writeCookie(nr, current);
|
|
|
35 |
document.layers[nr].display = current;
|
|
|
36 |
}
|
|
|
37 |
else if (document.all)
|
|
|
38 |
{
|
|
|
39 |
current = (document.all[nr].style.display == 'none') ? vis_state : 'none';
|
|
|
40 |
if (cookie != '')
|
|
|
41 |
writeCookie(nr, current);
|
|
|
42 |
document.all[nr].style.display = current;
|
|
|
43 |
}
|
|
|
44 |
else if (document.getElementById)
|
|
|
45 |
{
|
|
|
46 |
display = (document.getElementById(nr).style.display == 'none') ? vis_state : 'none';
|
|
|
47 |
if (cookie != '')
|
|
|
48 |
writeCookie(nr, display);
|
|
|
49 |
document.getElementById(nr).style.display = display;
|
|
|
50 |
}
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
function adjust_popup()
|
|
|
55 |
{
|
|
|
56 |
var w, h, fixedW, fixedH, diffW, diffH;
|
|
|
57 |
|
|
|
58 |
if (document.all) {
|
|
|
59 |
fixedW = document.body.clientWidth;
|
|
|
60 |
fixedH = document.body.clientHeight;
|
|
|
61 |
window.resizeTo(fixedW, fixedH);
|
|
|
62 |
diffW = fixedW - document.body.clientWidth;
|
|
|
63 |
diffH = fixedH - document.body.clientHeight;
|
|
|
64 |
} else {
|
|
|
65 |
fixedW = window.innerWidth;
|
|
|
66 |
fixedH = window.innerHeight;
|
|
|
67 |
window.resizeTo(fixedW, fixedH);
|
|
|
68 |
diffW = fixedW - window.innerWidth;
|
|
|
69 |
diffH = fixedH - window.innerHeight;
|
|
|
70 |
}
|
|
|
71 |
w = fixedW + diffW;
|
|
|
72 |
h = fixedH + diffH;
|
|
|
73 |
if (h >= screen.availHeight) w += 16;
|
|
|
74 |
if (w >= screen.availWidth) h += 16;
|
|
|
75 |
w = Math.min(w,screen.availWidth);
|
|
|
76 |
h = Math.min(h,screen.availHeight);
|
|
|
77 |
window.resizeTo(w,h);
|
|
|
78 |
window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
|
|
|
79 |
}
|
|
|
80 |
|