home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2001 November / MICD2001_11_NR1.iso / Www / @t / pliki / ALLADYN.JS < prev    next >
Text File  |  2001-07-05  |  2KB  |  51 lines

  1. function Alladyn(G){
  2. function V(v){for(var i=0;i<v.length;)with(v[i]){A(v[i++],id);if(ns4)V(document.layers)}}
  3. function A(X,v){
  4.     vlay[v]=X;if(ns4){X.style=X;X.vol=0}
  5.     X.vpos=P;X.vclip=ns4?c:C;X.vopacity=ie?O:ns6?o:N;X.vHTML=ns4?h:H;X.S=S;X.vkf=K
  6.     X.van={group:'',F:0,go:0,d:1,mode:'',f:[],a:{},s:{},purge:Q,reset:R,UDF:''}
  7.     X.vGIN={};for(v in G){p=G[v];X.vGIN[p]=this[p]();with(X.vGIN[p]){v=X;i()}}
  8. }
  9. function P(l,t){with(this.style){left=l;top=t}}
  10. function C(t,r,b,l){this.style.clip='rect('+t+' '+r+' '+b+' '+l+')'}function c(t,r,b,l){with(this.clip){top=t;right=r;bottom=b;left=l}}
  11. function O(v){this.style.filter='alpha(opacity='+v+')'}function o(v){this.style.MozOpacity=v+'%'}function N(v){with(this){visibility=(v<(vol?vol:STPE.vol))?'hid':'show'}}
  12. function H(v){this.innerHTML=v}function h(v){with(this.document){write(v);close()}}
  13. function R(){with(this){go=0;F=0;d=1;mode='';UDF='';f=[];a={}}}
  14. function Q(){with(this){f=[{}];a={};for(F in s)a[F]=f[0][F]=s[F];F=0}}
  15. function S(c){
  16.     with(this)with(van){r=f.length
  17.         for(p in f[F]){s[p]=f[F][p];switch(p){
  18.             case 'vopacity':vopacity(s[p]);break
  19.             case 'ct','cr','cb','cl':c=1;break
  20.             default:style[p]=s[p]}
  21.         }if(c)with(s)vclip(ct,cr,cb,cl)
  22.         F+=d;if((F<0)||(F==r))switch(mode){
  23.             case 'loop':F=(F<0)?r-1:0;break
  24.             case 'ping':d=-d;F+=2*d;break
  25.             default:F-=d;go=0;eval(UDF)
  26. }    }    }
  27. function K(v,t,N){
  28.     with(this.van){r=f.length+t-1,q={}
  29.         for(p in v){q[p]=(a[p]!=N)?(v[p]-a[p])/t:0;a[p]=v[p]}
  30.         for(u=0;u<=t;u++){if(u!=t)f[r-u]={};if(r>=u)for(p in v)f[r-u][p]=Math.round(v[p]-u*q[p])}
  31. }    }
  32. function s(g){clearInterval(I[g].I);I[g]=0}
  33. function g(g,t,a,u){if(!I[g])I[g]={I:setInterval('STPE.s("'+g+'")',t),A:a,U:u?u:''}}
  34. function a(g){p=1
  35.     for(q in vlay)with(vlay[q])if(van.go&&van.group==g)p=S()
  36.     if(p)with(I[g])if(A){s(g);eval(U)}
  37. }
  38. function n(v,w,p){p=p?p:ns4?window:doc.body
  39.     if(ns4){q=new Layer(w,p);q.visibility='show'}else{
  40.         if(ie){p.insertAdjacentHTML('BeforeEnd','<div id='+v+' style="position:absolute"></div>');q=ie.tags('div')[v]}
  41.         else{q=doc.createElement('div');q.style.position='absolute';p.appendChild(q)}
  42.         q.style.width=w
  43.     }A(q,v)
  44. }
  45. function i(){r=doc.images
  46.     if(ns4)for(p in vlay)with(vlay[p].document)for(u in images)r[u]=images[u]
  47.     return r
  48. }
  49. var I={},p,q,r,u;doc=document;ie=doc.all;ns4=doc.layers;up5=doc.getElementById?doc.getElementsByTagName('div'):0;ns6=up5&&!ie
  50. STPE={v:1.6,s:a,go:g,stop:s,vol:50,N:n,I:i};vlay=[];V(up5?up5:ie?ie.tags('div'):ns4)
  51. }