home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 May / CHIPCD200305.iso / super / altn / md_en.exe / TOPVIEW.JS < prev    next >
Encoding:
Text File  |  2002-11-25  |  1.3 KB  |  56 lines

  1. function AfterLoad(){
  2.   preloadImages(
  3.     'RedLine/getmail_on.gif',
  4.     'RedLine/compose_on.gif',
  5.     'RedLine/calendar_on.gif',     
  6.     'RedLine/fax_on.gif',
  7.     'RedLine/address_on.gif',
  8.     'RedLine/options_on.gif',
  9.     'RedLine/emptytrash_on.gif',
  10.     'RedLine/logoff_on.gif',
  11.     'RedLine/help_on.gif');
  12.  
  13.     if (typeof(top.frames.Main.ViewName) == 'string')
  14.         CurrentView(top.frames.Main.ViewName);
  15. }
  16.  
  17. function preloadImages(){
  18.   var d=document;
  19.   if(d.images){
  20.     if(!d.p)
  21.       d.p=new Array();
  22.     var i,j=d.p.length,a=preloadImages.arguments;
  23.     for(i=0; i<a.length; i++){
  24.       if (a[i].indexOf("#")!=0){
  25.         d.p[j]=new Image;
  26.         d.p[j++].src=a[i];
  27.       }
  28.     }
  29.   }
  30. }
  31.  
  32. function findObj(n, d) { //v3.0
  33.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  34.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  35.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  36.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document); return x;
  37. }
  38.  
  39. function swapImage(name, image){
  40.   document.sr=new Object;
  41.   var x = findObj(name);
  42.   if (x != null){
  43.     document.sr=x;
  44.     if(!x.oSrc)
  45.       x.oSrc=x.src;
  46.     if(image)
  47.       x.src=image;
  48.     else
  49.       x.src='RedLine/'+name+'_on.gif';
  50.   }
  51. }
  52.  
  53. function swapImgRestore(){
  54.   var x = document.sr;
  55.   x.src=x.oSrc;
  56. }