home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 February / Chip_2003-02_cd1.bin / tema / mweil / emw.js < prev    next >
Text File  |  2002-12-18  |  6KB  |  276 lines

  1. var halve=false;
  2.  
  3.     vv = new Image(44,64);
  4.     vv.src = "images/vlajkacz1.gif";
  5.     aa = new Image(144,62);
  6.     aa.src = "images/adresa1.gif";
  7.     dd = new Image(72,75);
  8.     dd.src="images/dn1.gif";
  9.     uu = new Image(72,75);
  10.     uu.src="images/up1.gif";
  11.     uu0 = new Image(72,75);
  12.     uu0.src="images/up0.gif";
  13.     m1 = new Image(54,24);
  14.     m1.src = "images/efirma1.gif";
  15.     m2 = new Image(117,24);
  16.     m2.src = "images/eprima1.gif";
  17.     m3 = new Image(70,24);
  18.     m3.src = "images/ee1.gif";
  19.     m4 = new Image(77,24);
  20.     m4.src = "images/esortiment1.gif";
  21.     menupic1 = new Image(5,3);
  22.     menupic1.src = "images/poptr.gif";
  23.     menupic2 = new Image(5,8);
  24.     menupic2.src = "images/popbr.gif";
  25.     menupic3 = new Image(130,133);
  26.     menupic3.src = "images/popbg.gif";
  27.     menupic4 = new Image(400,8);
  28.     menupic4.src = "images/popb.gif";
  29.     menupic5 = new Image(5,133);
  30.     menupic5.src = "images/popr.gif";
  31.     menupic6 = new Image(135,3);
  32.     menupic6.src = "images/popt.gif";
  33.     menupic7 = new Image(430,64);
  34.     menupic7.src = "images/head.jpg";
  35.     menupic8 = new Image(142,223);
  36.     menupic8.src = "images/vetrak.gif";
  37.     menupic9 = new Image(204,88);
  38.     menupic9.src = "images/logo.gif";
  39.     menupic10 = new Image(142,62);
  40.     menupic10.src = "images/adresa.gif";
  41.  
  42.     
  43. function bigbang()
  44. {        
  45.     if(halve)
  46.     {
  47.         halve=false;
  48.         h3.src = "images/3a.gif";
  49.     }
  50.     else
  51.     {
  52.         halve=true;
  53.         h3.src = "images/3b.gif";
  54.     }
  55.     setTimeout("bigbang()",500)
  56. }
  57.  
  58. function biggerbang()
  59. {
  60.         var now = new Date()
  61.         
  62.         var minutes = now.getMinutes();
  63.         minutes = ""+ ((minutes<10)?"0":"") + minutes + "";
  64.         h4.src="images/4"+minutes.charAt(0)+".gif";
  65.         h5.src="images/5"+minutes.charAt(1)+".gif";
  66.  
  67.         var hours = now.getHours();      
  68.         hours="" + ((hours<10)?"0":"") + hours + "";
  69.         h1.src="images/1"+((hours.charAt(0)=="0")?"":hours.charAt(0))+".gif";
  70.         h2.src="images/2"+hours.charAt(1)+".gif";
  71.            setTimeout("biggerbang()",5000)
  72. }
  73.  
  74. var prvni = true;
  75. function primaci()
  76. {        
  77.     if(prvni)
  78.     {
  79.         prvni=false;
  80.         lhide("prima2");
  81.     }
  82.     else
  83.     {
  84.         prvni=true;
  85.         lshow("prima2");
  86.     }
  87.     setTimeout("primaci()",4000)
  88. }
  89.  
  90.  
  91. function nescrolluj()
  92. {
  93.     lpos("noscroll",lhx+634, lhy+88);
  94.     lshow("noscroll");
  95. }
  96.  
  97. pol = new Array("", "firma", "prima", "e", "sortiment");
  98. menux = new Array(0, 204,276,418,477);
  99.  
  100. function domenu(no)
  101. {
  102.     mouseIs = "in"; 
  103.     lpos(pol[no], menux[no]+lhx, 88+lhy);
  104. //    lshow(pol[no]);
  105.     if(document.form1) 
  106.     {
  107.         form1.katB.style.visibility="hidden";
  108.         form1.katC.style.visibility="hidden";
  109.     }
  110.  
  111.     for(var i=1; i<=4; i++)
  112.     {
  113.         if(i==no) {lshow(pol[i])} else {lhide(pol[i])}
  114.         eval("menu"+i+".src='images/e"+pol[i]+((i==no)?"1":"")+".gif';");
  115.     }
  116. }
  117.  
  118. function closemenu(no)
  119. {
  120.     for(var i=1; i<=4; i++)
  121.     {
  122.         lhide(pol[i]);
  123.         eval("menu"+i+".src='images/e"+pol[i]+".gif';");
  124.     }
  125. //    if(form1.katB) form1.katB.style.display="none";
  126. //    if(form1.katC) form1.katC.style.display="none";
  127.     if(document.form1)
  128.     {
  129.         form1.katB.style.visibility="visible";
  130.         form1.katC.style.visibility="visible";
  131.     }
  132. }
  133.  
  134. var mouseIs = "out";
  135. var mTimer = 0; 
  136.  
  137. function mTimerInit()
  138. {
  139.     mTimer = 20; 
  140. }
  141.  
  142. function mouseout()
  143. {
  144.     mouseIs = "out"; 
  145.     menutimer();
  146. }
  147.  
  148. function vynuluj()
  149. {
  150.     mouseIs = "in";
  151.     clearTimeout(timer);
  152. }
  153.  
  154. function menutimer()
  155. {
  156. if (mouseIs!="in"){
  157.  
  158.     if (mTimer<=0){
  159.         closemenu(1);
  160.         closemenu(2);
  161.         closemenu(3);
  162.         closemenu(4);
  163.         mTimerInit();
  164.     }
  165.     else{
  166.         mTimer -= 1; 
  167.         if (mouseIs!="in"){ 
  168.             timer = setTimeout("menutimer()",50);
  169.         }
  170.     }
  171. }
  172. }
  173.  
  174. //*********************
  175.  
  176. function lib_bwcheck(){ 
  177. // overenie typu prehliadaΦa
  178.     this.ver=navigator.appVersion
  179.     this.agent=navigator.userAgent
  180.     this.dom=document.getElementById?1:0
  181.     this.opera5=this.agent.indexOf("Opera 5")>-1
  182.     this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
  183.     this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
  184.     this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
  185.     this.ie=this.ie4||this.ie5||this.ie6
  186.     this.mac=this.agent.indexOf("Mac")>-1
  187.     this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
  188.     this.ns4=(document.layers && !this.dom)?1:0;
  189.     this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
  190.     return this
  191. }
  192. var bw=new lib_bwcheck()
  193.  
  194.  
  195.  
  196. var speed = 30
  197.  
  198. var loop, timer
  199.  
  200. function makeObj(obj,nest){
  201. nest=(!nest) ? "":'document.'+nest+'.'
  202.     this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  203.     this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
  204.     this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
  205.     this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
  206.     this.up=goUp;this.down=goDown;
  207.     this.moveIt=moveIt; this.x=0; this.y=0;
  208. this.obj = obj + "Object"
  209. eval(this.obj + "=this")
  210. return this
  211. }
  212.  
  213. var px = bw.ns4||window.opera?"":"px";
  214.  
  215. function moveIt(x,y){
  216.     this.x = x
  217.     this.y = y
  218.     this.css.left = this.x+px
  219.     this.css.top = this.y+px
  220. }
  221.  
  222.  
  223. // sp⌠sobφ pohyb objektu nahor
  224. function goDown(move){
  225.     if (this.y>-this.scrollHeight+oCont.clipHeight){
  226.         this.moveIt(0,this.y-move)
  227.             if (loop) setTimeout(this.obj+".down("+move+")",speed)
  228.     }
  229. }
  230.  
  231. // a tßto funkcia zasa nadol
  232. function goUp(move){
  233.     if (this.y<0){
  234.         this.moveIt(0,this.y-move)
  235.         if (loop) setTimeout(this.obj+".up("+move+")",speed)
  236.     }
  237. }
  238.  
  239.  
  240. // zavolß funkcie potrebnΘ k skrolovaniu, samozrejme a₧ potom, ako je strßnka nahranß
  241. function scroll(speed){
  242.     if (scrolltextLoaded){
  243.         loop = true;
  244.         if (speed>0) oScroll.down(speed)
  245.         else oScroll.up(speed)
  246.     }
  247. }
  248.  
  249.  
  250. // zastavφ pohyb
  251. function noScroll(){
  252.     loop = false
  253.     if (timer) clearTimeout(timer)
  254.     
  255.         closemenu(1);
  256.         closemenu(2);
  257.         closemenu(3);
  258.         closemenu(4);
  259.         mTimerInit();
  260.     
  261. }
  262.  
  263. // vytvorφ objekt
  264. var scrolltextLoaded = false
  265. function scrolltextInit(){
  266.     oCont = new makeObj('divScrollTextCont')
  267.     oScroll = new makeObj('divText','divScrollTextCont')
  268.     oScroll.moveIt(0,0)
  269.     oCont.css.visibility = "visible"
  270.     scrolltextLoaded = true
  271. }
  272.  
  273. // spustφ cel² proces, ak je strßnka nahranß a priehladaΦ je v poriadku
  274. //if (bw.bw) onload = scrolltextInit
  275.  
  276.