1
|
//\/////
|
2
|
|
3
|
//\ overLIB Center Popup Plugin
|
4
|
|
5
|
//\ This file requires overLIB 4.10 or later.
|
6
|
|
7
|
//\
|
8
|
|
9
|
//\ overLIB 4.10 - You may not remove or change this notice.
|
10
|
|
11
|
//\ Copyright Erik Bosrup 1998-2003. All rights reserved.
|
12
|
|
13
|
//\ Contributors are listed on the homepage.
|
14
|
|
15
|
//\ See http://www.bosrup.com/web/overlib/ for details.
|
16
|
|
17
|
//\/////
|
18
|
|
19
|
//\ THIS IS A VERY MODIFIED VERSION. DO NOT EDIT OR PUBLISH. GET THE ORIGINAL!
|
20
|
|
21
|
if(typeof olInfo=='undefined'||typeof olInfo.meets=='undefined'||!olInfo.meets(4.10))alert('overLIB 4.10 or later is required for the Center Popup Plugin.');else{registerCommands('centerpopup,centeroffset');
|
22
|
|
23
|
if(typeof ol_centerpopup=='undefined')var ol_centerpopup=0;if(typeof ol_centeroffset=='undefined')var ol_centeroffset='0';
|
24
|
|
25
|
var o3_centerpopup=0,o3_centeroffset='0';
|
26
|
|
27
|
function setCenterPopupVariables(){o3_centerpopup=ol_centerpopup;o3_centeroffset=ol_centeroffset;}
|
28
|
|
29
|
function parseCenterPopupExtras(pf,i,ar){var k=i,v;
|
30
|
|
31
|
if(k<ar.length){if(ar[k]==CENTERPOPUP){eval(pf+'centerpopup=('+pf+'centerpopup==0)?1:0');return k;}
|
32
|
|
33
|
if(ar[k]==CENTEROFFSET){k=opt_MULTIPLEARGS(++k,ar,(pf+'centeroffset'));return k;}}
|
34
|
|
35
|
return-1;}
|
36
|
|
37
|
function centerPopupHorizontal(browserWidth,horizontalScrollAmount,widthFix){if(!o3_centerpopup)return void(0);
|
38
|
|
39
|
var vdisp=o3_centeroffset.split(','),placeX,iwidth=browserWidth,winoffset=horizontalScrollAmount,pWd=parseInt(o3_width);
|
40
|
|
41
|
placeX=winoffset+Math.round((iwidth-widthFix-pWd)/2)+parseInt(vdisp[0]);if(typeof o3_followscroll!='undefined'&&o3_followscroll&&o3_sticky)o3_relx=placeX;
|
42
|
|
43
|
return placeX;}
|
44
|
|
45
|
function centerPopupVertical(browserHeight,verticalScrollAmount){if(!o3_centerpopup)return void(0);
|
46
|
|
47
|
var placeY,iheight=browserHeight,scrolloffset=verticalScrollAmount,vdisp=o3_centeroffset.split(','),pHeight=(o3_aboveheight?parseInt(o3_aboveheight):(olNs4?over.clip.height:over.offsetHeight));
|
48
|
|
49
|
placeY=scrolloffset+Math.round((iheight-pHeight)/2)+(vdisp.length>1?parseInt(vdisp[1]):0);if(typeof o3_followscroll!='undefined'&&o3_followscroll&&o3_sticky)o3_rely=placeY;
|
50
|
|
51
|
return placeY;}
|
52
|
|
53
|
registerRunTimeFunction(setCenterPopupVariables);registerCmdLineFunction(parseCenterPopupExtras);registerHook('horizontalPlacement',centerPopupHorizontal,FCHAIN);registerHook('verticalPlacement',centerPopupVertical,FCHAIN);if(olInfo.meets(4.10))registerNoParameterCommands('centerpopup');
|
54
|
|
55
|
}
|
56
|
|