home *** CD-ROM | disk | FTP | other *** search
/ Clickx 75 / Clickx 75.iso / software / expressionweb / expressionwebv3 / ExpressionWeb_en.exe / Setup / WeConen.cab / xweb.slideshow.SLDSHOW.JS.en < prev    next >
Encoding:
Text File  |  2009-06-09  |  4.5 KB  |  174 lines

  1. leftdisabled = true
  2. rightdisabled = true
  3. widthLength = 640
  4.  
  5. function fp_ie4() {
  6.     var nav = navigator.appVersion.indexOf("MSIE");
  7.     return (nav>0) && (parseInt(navigator.appVersion.substring(nav+5, nav+6)) >= 4);
  8. }
  9.  
  10. function fp_ns6() {
  11.     return ((navigator.appName == "Netscape") &&
  12.                 (parseInt(navigator.appVersion.substring(0, 1)) >= 5))
  13. }
  14.  
  15. function fp_ShowImg(src, sWidth, sHeight, sID, iIndex)
  16. {    
  17.     var el = document.images["fpGalleryMainImg_" + sID];
  18.     if (el) {
  19.         if(fp_ie4()) {
  20.             el.style.visiblity = "hidden";
  21.             el.src = src.getAttribute ? src.getAttribute("lowsrc") : src.lowsrc;
  22.             el.width = sWidth;
  23.             el.height = sHeight;
  24.                 
  25.             var caption = document.all["fpGalleryCaptions_" + sID].all.tags("div")
  26.             var sCaptionTxt;
  27.             var sCaptionHTML;
  28.             
  29.             if (caption && caption[iIndex]) {
  30.                 sCaptionTxt = caption[iIndex].innerText
  31.                 sCaptionHTML = caption[iIndex].innerHTML
  32.             } else {
  33.                 sCaptionTxt = "";
  34.                 sCaptionHTML = "";
  35.             }
  36.             
  37.             el.title = sCaptionTxt;
  38.             el.style.visiblity = "visible";
  39.             
  40.             var el = document.all["fpGalleryCaptionCell_" + sID];
  41.             if (el) {
  42.                 el.innerHTML = sCaptionHTML;
  43.             }
  44.             
  45.             var el = document.all["fpGalleryDescCell_" + sID];
  46.             if (el) {
  47.                 var sDesc = document.all["fpGalleryDescriptions_" + sID].all.tags("div")
  48.                 el.innerHTML = sDesc && sDesc[iIndex]?sDesc[iIndex].innerHTML:"";
  49.             }
  50.         } else {
  51.             el.src = src.getAttribute ? src.getAttribute("lowsrc") : src.lowsrc
  52.             el.style.width = sWidth
  53.             el.style.height = sHeight
  54.  
  55.             caption = document.getElementById("fpGalleryCaptions_" + sID).getElementsByTagName("div")            
  56.             if (caption && caption[iIndex]) {
  57.                 sCaptionTxt = caption[iIndex].innerText
  58.                 sCaptionHTML = caption[iIndex].innerHTML
  59.             } else {
  60.                 sCaptionTxt = ""
  61.                 sCaptionHTML = ""
  62.             }
  63.         
  64.             el.title = sCaptionTxt            
  65.             var e = document.getElementById("fpGalleryCaptionCell_" + sID)
  66.             if (e) {
  67.                 e.innerHTML = sCaptionHTML
  68.             }
  69.             
  70.             var e = document.getElementById("fpGalleryDescCell_" + sID)
  71.             if (e) {
  72.                 var sDesc = document.getElementById("fpGalleryDescriptions_" + sID).getElementsByTagName("div")
  73.                 e.innerHTML = sDesc[iIndex]?sDesc[iIndex].innerHTML:""
  74.             }
  75.  
  76.         }
  77.     }
  78. }
  79.  
  80. function fp_ScrollLeft(sID) {
  81.     var el = document.all["fpGalleryListCell_" + sID];
  82.     if (el && fp_ie4()) {
  83.         var coll = el.children.tags("A");
  84.         var count = 20;
  85.  
  86.         if (coll) {
  87.             for (i=1;i<coll.length;i++) {
  88.                 if (coll(i).style.display != "none") {
  89.                     coll(i-1).style.display = "inline";
  90.                     break;    
  91.                 }
  92.             }
  93.             
  94.             for (i=0;i<coll.length;i++) {
  95.                 if (coll(i).style.display != "none") {
  96.                     var images = coll[i].children.tags("img");
  97.                     count = count + 20 + images[0].width;
  98.                     
  99.                     if (count > widthLength)                
  100.                         coll(i).style.display = "none";
  101.                 }
  102.             }
  103.  
  104.             if ((el.scrollWidth - 5) >= el.clientWidth) {
  105.                 var btn = document.all["fpGalleryRightBtn_" + sID]
  106.                 if (btn && rightdisabled) {
  107.                     rightdisabled = false;
  108.                     te = btn.src
  109.                     btn.src = btn.getAttribute ? btn.getAttribute("lowsrc") : btn.lowsrc
  110.                     btn.lowsrc = te
  111.                 }
  112.             }
  113.             
  114.             if (coll(0).style.display != "none") {
  115.                 var btn = document.all["fpGalleryLeftBtn_" + sID]
  116.                 if (btn && !leftdisabled) {
  117.                     leftdisabled = true;
  118.                     te = btn.src
  119.                     btn.src = btn.getAttribute ? btn.getAttribute("lowsrc") : btn.lowsrc
  120.                     btn.lowsrc = te
  121.                 }
  122.             }
  123.         }
  124.         
  125.     }
  126. }
  127.  
  128. function fp_ScrollRight(sID) {
  129.     var el = document.all["fpGalleryListCell_" + sID];
  130.     if (el && fp_ie4()) {
  131.         if (!rightdisabled)
  132.         {
  133.             var coll = el.children.tags("A");
  134.             if (coll) {
  135.                 var state = 0;
  136.                 var count = 20;
  137.                 for (i=0;i<coll.length;i++) {
  138.                     if (state == 0)
  139.                     {
  140.                         if (coll(i).style.display != "none") {
  141.                             coll(i).style.display = "none";    
  142.                             state = 1;
  143.                         }
  144.                     }
  145.                     else{
  146.                         var images = coll[i].children.tags("img");
  147.                         count = count + 20 + images[0].width;
  148.                         if (count <= widthLength)
  149.                             coll(i).style.display = "inline";
  150.                         else
  151.                             coll(i).style.display = "none";
  152.                     }
  153.                 }
  154.             }
  155.         
  156.             var btn = document.all["fpGalleryRightBtn_" + sID];
  157.             if (btn && coll(coll.length - 1).style.display != "none") {
  158.                 rightdisabled = true
  159.                 te = btn.src
  160.                 btn.src = btn.getAttribute ? btn.getAttribute("lowsrc") : btn.lowsrc
  161.                 btn.lowsrc = te
  162.             }
  163.             
  164.             var btn = document.all["fpGalleryLeftBtn_" + sID];
  165.             if (btn && leftdisabled) {
  166.                 te = btn.src
  167.                 btn.src = btn.getAttribute ? btn.getAttribute("lowsrc") : btn.lowsrc
  168.                 btn.lowsrc = te
  169.                 leftdisabled = false
  170.             }
  171.         }        
  172.     }
  173. }
  174.