2 overlibmws_crossframe.js plug-in module - Copyright Foteos Macrides 2003-2010. All rights reserved.
\r
3 For support of FRAME.
\r
4 Initial: August 3, 2003 - Last Revised: October 25, 2008
\r
5 See the Change History and Command Reference for overlibmws via:
\r
7 http://www.macridesweb.com/oltest/
\r
9 Published under an open source license: http://www.macridesweb.com/oltest/license.html
\r
15 function OLparseCrossframe(pf,i,ar){
\r
18 if(ar[k]==FRAME){v=ar[++k];if(pf=='ol_')ol_frame=v;else OLoptFRAME(v);return k;}}
\r
22 function OLgetFrameRef(thisFrame,ofrm){
\r
23 var i,v,retVal='';for(i=0;i<thisFrame.length;i++){if((((thisFrame[i].length>0)))&&(((OLns4))||
\r
24 ((OLie4)&&(v=thisFrame[i].document.all.tags('iframe'))!=null&&v.length==0)||
\r
25 ((OLns6)&&(v=thisFrame[i].document.getElementsByTagName('iframe'))!=null&&v.length==0))){
\r
26 retVal=OLgetFrameRef(thisFrame[i],ofrm);if(retVal=='')continue;}
\r
27 else if(thisFrame[i]!=ofrm)continue;retVal='['+i+']'+retVal;break;}
\r
31 function OLoptFRAME(frm){
\r
32 o3_frame=OLmkLyr('overDiv',frm)?frm:self;if(o3_frame!=self){var l,tFrm=OLgetFrameRef(top.frames,o3_frame),
\r
33 sFrm=OLgetFrameRef(top.frames,ol_frame);if(sFrm.length==tFrm.length) {l=tFrm.lastIndexOf('[');if(l){
\r
34 while(sFrm.substring(0,l)!=tFrm.substring(0,l))l=tFrm.lastIndexOf('[',l-1);tFrm=tFrm.substr(l);sFrm=sFrm.substr(l);}}
\r
35 var i,k,cnt=0,p='',str=tFrm;while((k=str.lastIndexOf('['))!= -1){cnt++;str=str.substring(0,k);}if(!sFrm&&o3_frame==parent)
\r
36 sFrm=OLgetFrameRef(parent,self);else for(i=0;i<cnt;i++)p=p+'parent.';OLfnRef=p+'frames'+sFrm+'.';var n=window.name,o;
\r
37 if((n&&parent!=self&&o3_frame==parent)&&(o=OLgetRef(n,parent.document))){if(OLie4&&!OLop7){
\r
38 OLx=event.clientX+OLfd().scrollLeft;OLy=event.clientY+OLfd().scrollTop;}
\r
39 OLifX=OLpageLoc(o,'Left')-(OLie4&&!OLop7?OLfd().scrollLeft:self.pageXOffset);
\r
40 OLifY=OLpageLoc(o,'Top')-(OLie4&&!OLop7?OLfd().scrollTop:self.pageYOffset);}}
\r
43 function OLchkIfRef(){
\r
44 var n=(parent!=self&&o3_frame==parent)?window.name:'',o=n?OLgetRef(n):null;
\r
45 if(o){var oR=OLgetRef(o3_ref,document);if(oR){OLrefXY=OLgetRefXY(o3_ref,document);
\r
46 OLrefXY[0]+=(OLpageLoc(o,'Left')-(OLie4&&!OLop7?OLfd(self).scrollLeft:self.pageXOffset));
\r
47 OLrefXY[1]+=(OLpageLoc(o,'Top')-(OLie4&&!OLop7?OLfd(self).scrollTop:self.pageYOffset));}}
\r
50 function OLchkFRAME(args){
\r
51 var OLfrmVal=self;for(var i=0;i<args.length;i++){if(typeof args[i]=='number'&&args[i]==FRAME){OLfrmVal=args[i+1];break;}}
\r
52 if(OLfrmVal!=self&&OLfrmVal.over&&OLfrmVal.cClick)OLfrmVal.cClick();
\r
55 OLregCmdLineFunc(OLparseCrossframe);
\r