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

  1.  
  2. function lpos(vrstva,left,top)
  3. {
  4.   if(document.all)
  5.     if(document.all[vrstva]){
  6.       document.all[vrstva].style.top=top;
  7.       document.all[vrstva].style.left=left;
  8.     }else{alert("Cannot find layer> "+vrstva);
  9.     }
  10.   else if(document.layers[vrstva]){
  11.     document.layers[vrstva].top=top;
  12.     document.layers[vrstva].left=left;
  13.   }
  14.   else{
  15.     alert("Either cannot find layer>"+ vrstva + ", \nor your browser does not support \nlayer positioning. Sorry.");
  16.   }
  17. }
  18.  
  19. function lposr(vrstva,left,top) // relativne od posledniho lpos
  20. {
  21.   if(document.all)
  22.     if(document.all[vrstva]){
  23.       document.all[vrstva].style.posTop+=top;
  24.       document.all[vrstva].style.posLeft+=left;
  25.     }else{alert("Cannot find layer> "+vrstva);
  26.     }
  27.   else if(document.layers[vrstva]){
  28.     document.layers[vrstva].top+=top;
  29.     document.layers[vrstva].left+=left;
  30.   }
  31.   else{
  32.     alert("Either cannot find layer >"+ vrstva + "<, \nor your browser does not support \nlayer positioning. Sorry.");
  33.   }
  34. }
  35.  
  36. function lshow(vrstva)
  37. {
  38.   if(document.all)
  39.     if(document.all[vrstva]){
  40.       document.all[vrstva].style.visibility="visible";
  41.     }else{alert("Cannot find no layer >"+vrstva+"< to show.");
  42.     }
  43.   else if(document.layers[vrstva]){
  44.     document.layers[vrstva].visibility="show";
  45.   }
  46.   else{
  47.     alert("Either cannot find layer >"+ vrstva + "< to show, \nor your browser does not support \nlayer positioning. Sorry.");
  48.   }
  49. }
  50.  
  51. function lhide(vrstva)
  52. {
  53.   if(document.all)
  54.     if(document.all[vrstva]){
  55.       document.all[vrstva].style.visibility="hidden";
  56.     }else{alert("Cannot find no layer >"+vrstva+"< to hide.");
  57.     }
  58.   else if(document.layers[vrstva]){
  59.     document.layers[vrstva].visibility="hide";
  60.   }
  61.   else{
  62.     alert("Either cannot find layer >"+ vrstva + "< to hide, \nor your browser does not support \nlayer positioning. Sorry.");
  63.   }
  64. }
  65.  
  66. function lposz(vrstva,zetko)
  67. {
  68.   if(document.all)
  69.     if(document.all[vrstva]){
  70.       document.all[vrstva].style.zIndex=zetko;
  71.     }else{alert("Cannot find no layer >"+vrstva+"< to z-positioning.");
  72.     }
  73.   else if(document.layers[vrstva]){
  74.     document.layers[vrstva].zIndex=zetko;
  75.   }
  76.   else{
  77.     alert("Either cannot find layer >"+ vrstva + "< to z-positioning, \nor your browser does not support \nlayer positioning. Sorry.");
  78.   }
  79. }
  80.  
  81. function lclip(vrstva,x1,y1,x2,y2)
  82. {
  83.   if(x1>x2) x1=x2;
  84.   if(y1>y2) y1=y2;
  85.   if(document.all)
  86.     if(document.all[vrstva]){
  87.       document.all[vrstva].style.clip= "rect("+ y1 +" " + x2 + " " + y2 + " " + x1 + ")";
  88.     }else{alert("Cannot find no layer >"+vrstva+"< to clip.");
  89.     }
  90.   else if(document.layers[vrstva]){
  91.     document.layers[vrstva].clip.left=x1;
  92.     document.layers[vrstva].clip.top=y1;
  93.     document.layers[vrstva].clip.right=x2;
  94.     document.layers[vrstva].clip.bottom=y2;
  95.   }
  96.   else{
  97.     alert("Either cannot find layer >"+ vrstva + "< to clip, \nor your browser does not support \nlayer positioning. Sorry.");
  98.   }
  99. }
  100.  
  101. function getlx(vrstva)
  102. {
  103.   var a;
  104.   if(document.all)
  105.     if(document.all[vrstva]){
  106.       a=document.all[vrstva].style.offsetLeft;
  107.     }else{alert("Cannot find layer> "+vrstva);
  108.     }
  109.   else if(document.layers[vrstva]){
  110.     a=document.layers[vrstva].pageX; //vzhledem ke strance
  111.   }
  112.   else{
  113.     alert("Either cannot find layer>"+ vrstva + ", \nor your browser does not support \nlayer positioning. Sorry.");
  114.     a=0;
  115.   }
  116.   return a;
  117. }
  118.  
  119. function getly(vrstva)
  120. {
  121.   var a;
  122.   if(document.all)
  123.     if(document.all[vrstva]){
  124.       a=document.all[vrstva].offsetTop;
  125.     }else{alert("Cannot find layer> "+vrstva);
  126.     }
  127.   else if(document.layers[vrstva]){
  128.     a=document.layers[vrstva].pageY;//vzhledem ke strance
  129.   }
  130.   else{
  131.     alert("Either cannot find layer>"+ vrstva + ", \nor your browser does not support \nlayer positioning. Sorry.");
  132.     a=0;
  133.   }
  134.   return a;
  135. }
  136.  
  137.