Subversion Repositories oidinfo_new_design

Rev

View as "text/javascript" | Blame | Last modification | View Log | RSS feed

  1.  
  2. function LoadSld( slideId )
  3. {
  4.         if( !g_supportsPPTHTML ) return
  5.         if( slideId )
  6.                 parent.SldUpdated(slideId)
  7.         g_origSz=parseInt(SlideObj.style.fontSize)
  8.         g_origH=SlideObj.style.posHeight
  9.         g_origW=SlideObj.style.posWidth
  10.         g_scaleHyperlinks=(document.all.tags("AREA").length>0)
  11.         if( g_scaleHyperlinks )
  12.                 InitHLinkArray()
  13.         if( g_scaleInFrame||(IsWin("PPTSld") && parent.IsFullScrMode() ) )
  14.                 document.body.scroll="no"
  15.         _RSW()
  16.         if( IsWin("PPTSld") && parent.IsFullScrMode() ) {
  17.                 document.oncontextmenu=parent._CM;
  18.                 self.focus()
  19.         }
  20. }
  21. function MakeSldVis( fTrans )
  22. {
  23.         fTrans=fTrans && g_showAnimation
  24.         if( fTrans )
  25.         {
  26.                 if( g_bgSound ) {
  27.                         idx=g_bgSound.indexOf(",");
  28.                         pptSound.src=g_bgSound.substr( 0, idx );
  29.                         pptSound.loop= -(parseInt(g_bgSound.substr(idx+1)));
  30.                 }
  31.                 SlideObj.filters.revealtrans.Apply()
  32.         }
  33.         SlideObj.style.visibility="visible"
  34.         if( fTrans )
  35.                 SlideObj.filters.revealtrans.Play()
  36. }
  37. function MakeNotesVis()
  38. {
  39.         if( !IsNts() ) return false
  40.         SlideObj.style.display="none"
  41.         nObj = document.all.item("NotesObj")
  42.         parent.SetHasNts(0)
  43.         if( nObj ) {
  44.                 nObj.style.display=""
  45.                 parent.SetHasNts(1)
  46.         }
  47.         return 1
  48. }
  49. function Redirect( frmId,sId )
  50. {
  51.         var str=document.location.hash,idx=str.indexOf('#')
  52.         if(idx>=0) str=str.substr(1);
  53.         if( window.name != frmId && ( sId != str) ) {
  54.                 obj = document.all.item("Main-File")
  55.                 window.location.href=obj.href+"#"+sId
  56.                 return 1
  57.         }
  58.         return 0
  59. }
  60. function HideMenu() { if( frames["PPTSld"] && PPTSld.document.all.item("ctxtmenu") && PPTSld.ctxtmenu.style.display!="none" ) { PPTSld.ctxtmenu.style.display='none'; return true } return false }
  61. function IsWin( name ) { return window.name == name }
  62. function IsNts() { return IsWin("PPTNts") }
  63. function IsSldOrNts() { return( IsWin("PPTSld")||IsWin("PPTNts") ) }
  64. function SupportsPPTAnimation() { return( navigator.platform == "Win32" && navigator.appVersion.indexOf("Windows")>0 ) }
  65. function SupportsPPTHTML()
  66. {
  67.         var appVer=navigator.appVersion, msie=appVer.indexOf("MSIE "), ver=0
  68.         if( msie >= 0 )
  69.                 ver=parseFloat( appVer.substring( msie+5, appVer.indexOf(";",msie) ) )
  70.         else
  71.                 ver=parseInt(appVer)
  72.  
  73.         return( ver >= 4 && msie >= 0 )
  74. }
  75. var MHTMLPrefix = CalculateMHTMLPrefix();
  76. function CalculateMHTMLPrefix()
  77. {
  78.         if ( document.location.protocol == 'mhtml:') {
  79.                 href=new String(document.location.href)
  80.                 Start=href.indexOf('!')+1
  81.                 End=href.lastIndexOf('/')+1
  82.                 if (End < Start)
  83.                         return href.substring(0, Start)
  84.                 else
  85.                 return href.substring(0, End)
  86.         }
  87.         return '';
  88. }
  89.  
  90. function _RSW()
  91. {
  92.         if( !g_supportsPPTHTML || IsNts() ||
  93.           ( !g_scaleInFrame && (( window.name != "PPTSld" ) || !parent.IsFullScrMode()) ) )
  94.                 return
  95.  
  96.         cltWidth=document.body.clientWidth
  97.         cltHeight=document.body.clientHeight
  98.         factor=(1.0*cltWidth)/g_origW
  99.         if( cltHeight < g_origH*factor )
  100.                 factor=(1.0*cltHeight)/g_origH
  101.  
  102.         newSize = g_origSz * factor
  103.         if( newSize < 1 ) newSize=1
  104.  
  105.         s=SlideObj.style
  106.         s.fontSize=newSize+"px"
  107.         s.posWidth=g_origW*factor
  108.         s.posHeight=g_origH*factor
  109.         s.posLeft=(cltWidth-s.posWidth)/2
  110.         s.posTop=(cltHeight-s.posHeight)/2
  111.  
  112.         if( g_scaleHyperlinks )
  113.                 ScaleHyperlinks( factor )
  114. }
  115.  
  116. function _KPH()
  117. {
  118.   if( IsNts() ) return;
  119.  
  120.   if( !parent.IsFramesMode() && event.keyCode == 27 && !parent.HideMenu() )
  121.     parent.window.close( self );
  122.   else if( event.keyCode == 32 )
  123.   {
  124.     if( window.name == "PPTSld" )
  125.       parent.PPTSld.DocumentOnClick();
  126.     else
  127.       parent.GoToNextSld();
  128.   }
  129. }
  130.  
  131. function DocumentOnClick()
  132. {
  133.         if( IsNts() || parent.HideMenu() ) return;
  134.         if( ( g_allowAdvOnClick && !parent.IsFramesMode() ) ||
  135.             (event && (event.keyCode==32) ) )
  136.                 parent.GoToNextSld();
  137. }
  138.  
  139.  
  140.  
  141. var g_supportsPPTHTML = SupportsPPTHTML(), g_scaleInFrame = true, gId="", g_bgSound="",
  142.     g_scaleHyperlinks = false, g_allowAdvOnClick = true, g_showInBrowser = false;
  143. var g_showAnimation = g_supportsPPTHTML && SupportsPPTAnimation() && ( (window.name=="PPTSld" && !parent.IsFramesMode()) || g_showInBrowser );var g_hasTrans = false, g_autoTrans = false, g_transSecs = 0;
  144. var g_animManager = null;
  145.  
  146. var ENDSHOW_MESG="Fin du diaporama, cliquez pour quitter.", SCREEN_MODE="Frames", gIsEndShow=0, NUM_VIS_SLDS=29, SCRIPT_HREF="script.js", FULLSCR_HREF="fullscreen.htm";
  147. var gCurSld = gPrevSld = 1, g_offset = 0, gNtsOpen = gHasNts = gOtlTxtExp = gNarrationPaused = false, gOtlOpen = true
  148. window.gPPTHTML=SupportsPPTHTML()
  149.  
  150. function UpdNtsPane(){ PPTNts.location.replace( MHTMLPrefix+GetHrefObj( gCurSld ).mNtsHref ) }
  151. function UpdNavPane( sldIndex ){ if(gNavLoaded) PPTNav.UpdNav() }
  152. function UpdOtNavPane(){ if(gOtlNavLoaded) PPTOtlNav.UpdOtlNav() }
  153. function UpdOtlPane(){ if(gOtlLoaded) PPTOtl.UpdOtl() }
  154. function SetHasNts( fVal )
  155. {
  156.         if( gHasNts != fVal ) {
  157.                 gHasNts=fVal
  158.                 UpdNavPane()
  159.         }
  160. }
  161. function ToggleOtlText()
  162. {
  163.         gOtlTxtExp=!gOtlTxtExp
  164.         UpdOtlPane()
  165. }
  166. function ToggleOtlPane()
  167. {
  168.         frmset=document.all("PPTHorizAdjust")
  169.         frm=document.all("PPTOtl")
  170.  
  171.         if( gOtlOpen )
  172.                 frmset.cols="*,100%"
  173.         else
  174.                 frmset.cols="20%,80%"
  175.  
  176.         gOtlOpen=!gOtlOpen
  177.         frm.noResize=!frm.noResize
  178.         UpdOtNavPane()
  179. }
  180. function ToggleNtsPane()
  181. {
  182.         frmset=document.all("PPTVertAdjust")
  183.         frm=document.all("PPTNts")
  184.  
  185.         if( gNtsOpen )
  186.                 frmset.rows="100%,*"
  187.         else
  188.                 frmset.rows="80%,20%"
  189.  
  190.         gNtsOpen=!gNtsOpen
  191.         UpdNtsPane()
  192. }
  193. function FullScreen(){ window.open( MHTMLPrefix+FULLSCR_HREF,null,"fullscreen=yes" ) }
  194. function ToggleVNarration()
  195. {
  196.         rObj=PPTSld.document.all("NSPlay")
  197.         if( rObj ) {
  198.                 if( gNarrationPaused )
  199.                         rObj.Play()
  200.                 else
  201.                         rObj.Pause()
  202.  
  203.                 gNarrationPaused=!gNarrationPaused
  204.         }
  205. }
  206. function GetCurSldNum()
  207. {  
  208.         obj=GetHrefObj(gCurSld)
  209.         if( obj.mOrigVis == 1 )
  210.                 return obj.mSldIdx
  211.         else  
  212.                 return gCurSld
  213. }
  214. function GetNumSlds()
  215. {  
  216.         if( GetHrefObj(gCurSld).mOrigVis == 1 )
  217.                 return NUM_VIS_SLDS
  218.         else
  219.                 return gDocTable.length
  220. }
  221. function GetSldNum( href )
  222. {
  223.         for(ii=0; ii<gDocTable.length; ii++) {
  224.                 if ( gDocTable[ii].mSldHref == href )
  225.                         return ii+1
  226.         }
  227.         return 1
  228. }
  229. function GetHrefObj( sldIdx ){ return gDocTable[sldIdx-1] }
  230. function IsFramesMode(){ return ( SCREEN_MODE == "Frames" ) }
  231. function IsFullScrMode(){ return ( SCREEN_MODE == "FullScreen" ) }
  232. function GoToNextSld()
  233. {  
  234.         ii=gCurSld + 1
  235.         if( GetHrefObj( ii-1 ).mOrigVis == 0 ) {
  236.                 if( ii<=gDocTable.length ) {
  237.                         obj=GetHrefObj(ii)
  238.                         obj.mVis=1
  239.                         GoToSld(obj.mSldHref)
  240.                         return
  241.                 }              
  242.         }
  243.         else {
  244.                 obj=GetHrefObj( ii )
  245.                 while ( obj && ( obj.mOrigVis == 0 ) )
  246.                         obj=GetHrefObj(ii++)
  247.                 if( obj && obj.mOrigVis ) {
  248.                         GoToSld(obj.mSldHref)  
  249.                         return
  250.                 }      
  251.         }
  252.         if( !IsFramesMode() ) EndShow()
  253. }
  254. function GoToPrevSld()
  255. {
  256.         ii=gCurSld-1
  257.         if( ii > 0 ) {      
  258.                 obj=GetHrefObj(ii)
  259.                 while ( ( obj.mVis == 0 ) && ( ii>0 ) )
  260.                         obj=GetHrefObj(ii--)
  261.                 GoToSld(obj.mSldHref)
  262.         }
  263. }
  264. function GoToFirst(){ GoToSld( GetHrefObj(1).mSldHref ) }
  265. function GoToLast()
  266. {
  267.         ii=gDocTable.length
  268.         if( ii != gCurSld )
  269.                 GoToSld( GetHrefObj(ii).mSldHref )
  270. }
  271. function GoToSld( href )
  272. {
  273.         if( PPTSld.event ) PPTSld.event.cancelBubble=true
  274.         GetHrefObj( GetSldNum(href) ).mVis=1
  275.         PPTSld.location.href=MHTMLPrefix+href
  276. }
  277. function SldUpdated( id )
  278. {
  279.         if( id == GetHrefObj(gCurSld).mSldHref ) return
  280.         gPrevSld=gCurSld
  281.         gCurSld=GetSldNum(id)
  282.         if( IsFramesMode() ) {
  283.                 UpdNavPane(); UpdOtlPane(); UpdNtsPane()
  284.         }
  285. }
  286.  
  287. function PrevSldViewed(){ GoToSld( GetHrefObj(gPrevSld).mSldHref ) }
  288. function HasPrevSld() { return ( gIsEndShow || ( gCurSld != 1 && GetHrefObj( gCurSld-1 ).mVis == 1 )||( GetCurSldNum() > 1 ) ) }
  289. function HasNextSld() { return (GetCurSldNum() != GetNumSlds()) }
  290. function EndShow()
  291. {
  292.         if( PPTSld.event ) PPTSld.event.cancelBubble=true
  293.  
  294.         doc=PPTSld.document
  295.         doc.open()
  296.         doc.writeln('<html><head><script defer>function CloseWindow(){ if( parent.HideMenu() ) return; if( !parent.IsFramesMode() && event && (event.keyCode==27 || event.keyCode==32 || event.type=="click" ) ) parent.window.close( self ); } function Unload() { parent.gIsEndShow=0; } function SetupEndShow() { parent.gIsEndShow=1; document.body.scroll="no"; document.onkeypress=CloseWindow; document.onclick=CloseWindow; document.oncontextmenu=parent._CM; }</script></head><body bgcolor=black onload=SetupEndShow() onunload=Unload()><center><p><font face=Tahoma color=white size=2><br><b>' + ENDSHOW_MESG + '</b></font></p></center></body></html>')
  297.         doc.close()
  298. }
  299. function SetSldVisited(){ gDocTable[gCurSld-1].mVisited=true }
  300. function IsSldVisited(){ return gDocTable[gCurSld-1].mVisited }
  301. function hrefList( sldHref, visible, sldIdx )
  302. {
  303.         this.mSldHref= this.mNtsHref = sldHref
  304.         this.mSldIdx = sldIdx
  305.         this.mOrigVis= this.mVis = visible
  306.         this.mVisited= false
  307. }
  308. var gDocTable = new Array(
  309.    new hrefList("slide0036.htm", 1, 1),
  310.    new hrefList("slide0155.htm", 1, 2),
  311.    new hrefList("slide0149.htm", 1, 3),
  312.    new hrefList("slide0150.htm", 1, 4),
  313.    new hrefList("slide0199.htm", 1, 5),
  314.    new hrefList("slide0198.htm", 1, 6),
  315.    new hrefList("slide0212.htm", 1, 7),
  316.    new hrefList("slide0200.htm", 1, 8),
  317.    new hrefList("slide0213.htm", 1, 9),
  318.    new hrefList("slide0151.htm", 1, 10),
  319.    new hrefList("slide0152.htm", 1, 11),
  320.    new hrefList("slide0153.htm", 1, 12),
  321.    new hrefList("slide0165.htm", 1, 13),
  322.    new hrefList("slide0214.htm", 1, 14),
  323.    new hrefList("slide0201.htm", 1, 15),
  324.    new hrefList("slide0202.htm", 1, 16),
  325.    new hrefList("slide0203.htm", 1, 17),
  326.    new hrefList("slide0204.htm", 1, 18),
  327.    new hrefList("slide0205.htm", 1, 19),
  328.    new hrefList("slide0206.htm", 1, 20),
  329.    new hrefList("slide0207.htm", 1, 21),
  330.    new hrefList("slide0215.htm", 1, 22),
  331.    new hrefList("slide0216.htm", 1, 23),
  332.    new hrefList("slide0217.htm", 1, 24),
  333.    new hrefList("slide0209.htm", 1, 25),
  334.    new hrefList("slide0210.htm", 1, 26),
  335.    new hrefList("slide0211.htm", 1, 27),
  336.    new hrefList("slide0160.htm", 1, 28),
  337.    new hrefList("slide0097.htm", 1, 29)
  338. );
  339.  
  340. function ImgBtn( oId,bId,w,action )
  341. {
  342.         var t=this
  343.         t.Perform    = _IBP
  344.         t.SetActive  = _IBSetA
  345.         t.SetInactive= _IBSetI
  346.         t.SetPressed = _IBSetP
  347.         t.SetDisabled= _IBSetD
  348.         t.Enabled    = _IBSetE
  349.         t.ChangeIcon = null
  350.         t.UserAction = action
  351.         t.ChgState   = _IBUI
  352.         t.mObjId   = oId
  353.         t.mBorderId= bId
  354.         t.mWidth   = w
  355.         t.mIsOn    = t.mCurState = 0
  356. }
  357. function _IBSetA()
  358. {
  359.         if( this.mIsOn ) {
  360.                 obj=this.ChgState( gHiliteClr,gShadowClr,2 )
  361.                 obj.style.posTop=0
  362.         }
  363. }
  364. function _IBSetI()
  365. {
  366.         if( this.mIsOn ) {
  367.                 obj=this.ChgState( gFaceClr,gFaceClr,1 )
  368.                 obj.style.posTop=0
  369.         }
  370. }
  371. function _IBSetP()
  372. {
  373.         if( this.mIsOn ) {
  374.                 obj=this.ChgState( gShadowClr,gHiliteClr,2 )
  375.                 obj.style.posLeft+=1; obj.style.posTop+=1
  376.         }
  377. }
  378. function _IBSetD()
  379. {  
  380.         obj=this.ChgState( gFaceClr,gFaceClr,0 )
  381.         obj.style.posTop=0
  382. }
  383. function _IBSetE( state )
  384. {
  385.         var t=this
  386.         GetObj( t.mBorderId ).style.visibility="visible"
  387.         if( state != t.mIsOn ) {
  388.                 t.mIsOn=state
  389.                 if( state )
  390.                         t.SetInactive()
  391.                 else
  392.                         t.SetDisabled()
  393.         }
  394. }
  395. function _IBP()
  396. {
  397.         var t=this
  398.         if( t.mIsOn ) {
  399.                 if( t.UserAction != null )
  400.                         t.UserAction()
  401.                 if( t.ChangeIcon ) {
  402.                         obj=GetObj(t.mObjId)
  403.                         if( t.ChangeIcon() )
  404.                                 obj.style.posLeft=obj.style.posLeft+(t.mCurState-4)*t.mWidth
  405.                         else
  406.                                 obj.style.posLeft=obj.style.posLeft+(t.mCurState-0)*t.mWidth
  407.                 }
  408.                 t.SetActive()
  409.         }  
  410. }
  411. function _IBUI( clr1,clr2,nextState )
  412. {
  413.         var t=this
  414.         SetBorder( GetObj( t.mBorderId ),clr1,clr2 )
  415.         obj=GetObj( t.mObjId )
  416.         obj.style.posLeft=obj.style.posLeft+(t.mCurState-nextState)*t.mWidth-obj.style.posTop
  417.         t.mCurState=nextState
  418.         return obj
  419. }
  420. function TxtBtn( oId,oeId,action,chkState )
  421. {
  422.         var t=this
  423.         t.Perform    = _TBP
  424.         t.SetActive  = _TBSetA
  425.         t.SetInactive= _TBSetI
  426.         t.SetPressed = _TBSetP
  427.         t.SetDisabled= _TBSetD
  428.         t.SetEnabled = _TBSetE
  429.         t.GetState   = chkState
  430.         t.UserAction = action
  431.         t.ChgState   = _TBUI
  432.         t.mObjId      = oId
  433.         t.m_elementsId= oeId
  434.         t.mIsOn       = 1
  435. }
  436. function _TBSetA()
  437. {
  438.         var t=this
  439.         if( t.mIsOn && !t.GetState() )
  440.                 t.ChgState( gHiliteClr,gShadowClr,0,0 )
  441. }
  442. function _TBSetI()
  443. {
  444.         var t=this
  445.         if( t.mIsOn && !t.GetState() )
  446.                 t.ChgState( gFaceClr,gFaceClr,0,0 )
  447. }
  448. function _TBSetP()
  449. {
  450.         if( this.mIsOn )
  451.                 this.ChgState( gShadowClr,gHiliteClr,1,1 )
  452. }
  453. function _TBSetD()
  454. {  
  455.         this.ChgState( gFaceClr,gFaceClr,0,0 )
  456.         this.mIsOn = 0
  457. }
  458. function _TBSetE()
  459. {
  460.         var t=this
  461.         if( !t.GetState() )
  462.                 t.ChgState( gFaceClr,gFaceClr,0,0 )
  463.         else
  464.                 t.ChgState( gShadowClr,gHiliteClr,1,1 )
  465.         t.mIsOn = 1
  466. }
  467. function _TBP()
  468. {
  469.         var t=this
  470.         if( t.mIsOn ) {
  471.                 if( t.UserAction != null )
  472.                         t.UserAction()
  473.                 if( t.GetState() )
  474.                         t.SetPressed()
  475.                 else
  476.                         t.SetActive()
  477.         }  
  478. }
  479. function _TBUI( clr1,clr2,lOffset,tOffset )
  480. {
  481.         SetBorder( GetObj( this.mObjId ),clr1,clr2 )
  482.         Offset( GetObj( this.m_elementsId ),lOffset,tOffset )
  483. }
  484. function GetObj( objId ){ return document.all.item( objId ) }
  485. function Offset( obj, top, left ){ obj.style.top=top; obj.style.left=left }
  486. function SetBorder( obj, upperLeft, lowerRight )
  487. {
  488.         s=obj.style;
  489.         s.borderStyle      = "solid"
  490.         s.borderWidth      = 1
  491.         s.borderLeftColor  = s.borderTopColor = upperLeft
  492.         s.borderBottomColor= s.borderRightColor = lowerRight
  493. }
  494. function GetBtnObj(){ return gBtnArr[window.event.srcElement.id] }
  495. function BtnOnOver(){ b=GetBtnObj(); if( b != null ) b.SetActive() }
  496. function BtnOnDown(){ b=GetBtnObj(); if( b != null ) b.SetPressed() }
  497. function BtnOnOut(){ b=GetBtnObj(); if( b != null ) b.SetInactive() }
  498. function BtnOnUp()
  499. {
  500.         b=GetBtnObj()
  501.         if( b != null )
  502.                 b.Perform()
  503.         else
  504.                 Upd()
  505. }
  506. function GetNtsState(){ return parent.gNtsOpen }
  507. function GetOtlState(){ return parent.gOtlOpen }
  508. function GetOtlTxtState(){ return parent.gOtlTxtExp }
  509. function NtsBtnSetFlag( fVal )
  510. {
  511.         s=document.all.item( this.m_flagId ).style
  512.         s.display="none"
  513.         if( fVal )
  514.                 s.display=""
  515.         else
  516.                 s.display="none"
  517. }
  518.  
  519. var gHiliteClr="THREEDHIGHLIGHT",gShadowClr="THREEDSHADOW",gFaceClr="THREEDFACE"
  520. var gBtnArr = new Array()
  521. gBtnArr["nb_otl"] = new TxtBtn( "nb_otl","nb_otlElem",parent.ToggleOtlPane,GetOtlState )
  522. gBtnArr["nb_nts"] = new TxtBtn( "nb_nts","nb_ntsElem",parent.ToggleNtsPane,GetNtsState )
  523. gBtnArr["nb_prev"]= new ImgBtn( "nb_prev","nb_prevBorder",30,parent.GoToPrevSld )
  524. gBtnArr["nb_next"]= new ImgBtn( "nb_next","nb_nextBorder",30,parent.GoToNextSld )
  525. gBtnArr["nb_sldshw"]= new ImgBtn( "nb_sldshw","nb_sldshwBorder",18,parent.FullScreen )
  526. gBtnArr["nb_voice"]  = new ImgBtn( "nb_voice","nb_voiceBorder",18,parent.ToggleVNarration )
  527. gBtnArr["nb_otlTxt"]= new ImgBtn( "nb_otlTxt","nb_otlTxtBorder",23,parent.ToggleOtlText )
  528. gBtnArr["nb_nts"].m_flagId= "notes_flag"
  529. gBtnArr["nb_nts"].SetFlag = NtsBtnSetFlag
  530. gBtnArr["nb_otlTxt"].ChangeIcon= GetOtlTxtState
  531. var sNext="Suivant",sPrev="Précédent",sEnd="Mettre fin au diaporama",sFont="Arial"
  532. function ShowMenu()
  533. {
  534.         BuildMenu();
  535.         var doc=PPTSld.document.body,x=PPTSld.event.clientX+doc.scrollLeft,y=PPTSld.event.clientY+doc.scrollTop
  536.  
  537.         m = PPTSld.document.all.item("ctxtmenu")
  538.         m.style.pixelLeft=x
  539.         if( (x+m.scrollWidth > doc.clientWidth)&&(x-m.scrollWidth > 0) )
  540.                 m.style.pixelLeft=x-m.scrollWidth
  541.  
  542.         m.style.pixelTop=y
  543.         if( (y+m.scrollHeight > doc.clientHeight)&&(y-m.scrollHeight > 0) )
  544.                 m.style.pixelTop=y-m.scrollHeight
  545.  
  546.         m.style.display=""
  547. }
  548. function _CM()
  549. {
  550.         if( !parent.IsFullScrMode() ) return;
  551.         if(!PPTSld.event.ctrlKey) {
  552.                 ShowMenu()
  553.                 return false
  554.         } else
  555.                 HideMenu()
  556. }
  557. function BuildMenu()
  558. {
  559.         if( PPTSld.document.all.item("ctxtmenu") ) return
  560.  
  561.         var mObj=CreateItem( PPTSld.document.body )
  562.         mObj.id="ctxtmenu"
  563.         var s=mObj.style
  564.         s.position="absolute"
  565.         s.cursor="default"
  566.         s.width="100px"
  567.         SetCMBorder(mObj,"menu","black")
  568.  
  569.         var iObj=CreateItem( mObj )
  570.         SetCMBorder( iObj, "threedhighlight","threedshadow" )
  571.         iObj.style.padding=2
  572.         CreateMenuItem( iObj,sNext,M_GoNextSld,M_True )
  573.         CreateMenuItem( iObj,sPrev,M_GoPrevSld,M_HasPrevSld )
  574.         var sObj=CreateItem( iObj )
  575.         SetCMBorder(sObj,"menu","menu")
  576.         var s=sObj.style
  577.         s.borderTopColor="threedshadow"
  578.         s.borderBottomColor="threedhighlight"
  579.         s.height=1
  580.         s.fontSize="0px"
  581.         CreateMenuItem( iObj,sEnd,M_End,M_True )
  582. }
  583. function Highlight() { ChangeClr("activecaption","threedhighlight") }
  584. function Deselect() { ChangeClr("threedface","menutext") }
  585. function Perform()
  586. {
  587.         e=PPTSld.event.srcElement
  588.         if( e.type=="menuitem" && e.IsActive() )
  589.                 e.Action()
  590.         else
  591.                 PPTSld.event.cancelBubble=true
  592. }
  593. function ChangeClr( bg,clr )
  594. {
  595.         e=PPTSld.event.srcElement
  596.         if( e.type=="menuitem" && e.IsActive() ) {
  597.                 e.style.backgroundColor=bg
  598.                 e.style.color=clr
  599.         }
  600. }
  601.  
  602. function M_HasPrevSld() { return( parent.HasPrevSld() ) }
  603. function M_GoNextSld() { if( gIsEndShow ) M_End(); else GoToNextSld() }
  604. function M_GoPrevSld() { if( gIsEndShow ) { history.back(); PPTSld.event.cancelBubble=true; } else GoToPrevSld() }
  605. function M_True() { return true }
  606. function M_End() { window.close( self ) }
  607. function CreateMenuItem( node,text,action,eval )
  608. {
  609.         var e=CreateItem( node )
  610.         e.type="menuitem"
  611.         e.Action=action
  612.         e.IsActive=eval
  613.         e.innerHTML=text
  614.  
  615.         if( !e.IsActive() )
  616.                 e.style.color="threedshadow"
  617.         e.onclick=Perform
  618.         e.onmouseover=Highlight
  619.         e.onmouseout=Deselect
  620.         s=e.style;
  621.         s.fontFamily=sFont
  622.         s.fontSize="8pt"
  623.         s.paddingLeft=2
  624. }
  625. function CreateItem( node )
  626. {
  627.         var elem=PPTSld.document.createElement("DIV")
  628.         node.insertBefore( elem )
  629.         return elem
  630. }
  631. function SetCMBorder( o,ltClr,rbClr )
  632. {
  633.         var s=o.style
  634.         s.backgroundColor="menu"
  635.         s.borderStyle="solid"
  636.         s.borderWidth=1
  637.         s.borderColor=ltClr+" "+rbClr+" "+rbClr+" "+ltClr
  638. }