    
    var xs_scrlup,xe_scrlup,ys_scrlup,ye_scrlup,xp,yp;
    var xs_scrldown,xe_scrldown,ys_scrldown,ye_scrldown,thumbscrollvariation;

    ie = document.all ? true : false;
    
    ss = 2; // scroll speed
    st = 2; // scroll time
    //ft = 10; not being used
    fs = 2; // fade speed
    xp,yp = 0;
    
    
// for the slideshow section
    function CMSSlideShow(){
      var len = imgsrclist.length;
      
      tar = [];
      title_arr = [];
      for(i=0; i < len; i++){
        var id = imgsrclist[i];
        var title = imgtitlelist[i];
        //alert(id);
        tar[i] = id;
        title_arr[i] = title;

        // when the last src/title is found then get random combination for initial start
        if(i == len - 1) 
        {
            var rnd_no = Math.floor ( Math.random() * imgsrclist.length ); 
            id = imgsrclist[rnd_no];
            title = imgtitlelist[rnd_no];
            getImg(id,title);
        }
      }
      tarl = tar.length;
    }

    function getImg(id,title){
      if(auto){clearTimeout(ia.timer)}
      if(ci != null){
        var ts = ia.getElementsByTagName('img');
        //alert(ts.length); always appears to be 1
        var tsl = ts.length;
        var x = 0;
        for(x; x < tsl; x++){
          if(ci.id != id){
            var o = ts[x];
            clearInterval(o.timer);
            o.timer = setInterval(function(){fdOut(o)},fs);
          }
        }
      }
      var i;
      if(!document.getElementById(id)){
        i = document.createElement('img');
        ia.appendChild(i);
        i.id = id;
        i.av = 0;
        i.style.opacity = 0;
        i.style.filter = 'alpha(opacity=0)';
        i.src = id; //imgdir + '/' + id + imgext;
        i.alt = title;
        i.title = title;
        
        
        //document.getElementById('ctl00_ContentBody_TextBox1').value = id;
        document.getElementById('ctl00_ContentBody_RotationImage').value = id;
      }else{
        i = document.getElementById(id);
        clearInterval(i.timer);
      }
      i.timer = setInterval(function(){fdIn(i)},fs);
    }

    function imgNav(d){

      var curr = 0;
      for(key in tar){
        if(tar[key] == ci.id){
          curr = key;
        }
      }
      if(tar[parseInt(curr) + d]){
        getImg(tar[parseInt(curr) + d],title_arr[parseInt(curr) + d]);
      }else{
        if(d == 1){
          getImg(tar[0],title_arr[0]);
        }else{
          getImg(tar[tarl - 1],title_arr[tarl - 1]);
        }
      }
    }

    function autoSlide(){
      ia.timer = setInterval(function(){imgNav(1)}, autodelay * 1000);
    }

    function fdIn(i){
      if(i.complete){
        i.av = i.av + fs;
        i.style.opacity = i.av / 100;
        i.style.filter = 'alpha(opacity=' + i.av + ')';
      }
      if(i.av >= 100){
        if(auto){autoSlide()}
        clearInterval(i.timer);
        ci = i;
      }
    }

    function fdOut(i){
      i.av = i.av - fs;
      i.style.opacity = i.av / 100;
      i.style.filter = 'alpha(opacity=' + i.av + ')';
      if(i.av <= 0){
        clearInterval(i.timer);
        if(i.parentNode){i.parentNode.removeChild(i)}
      }
    }

// based on a button to retrieve the next image of slideshow
    function getSlideShowImage(direction, anchor) {    
        try 
        {
            cid = document.getElementById('ctl00_ContentBody_RotationImage').value;
    //        alert(cid);
            cindex = findArrayIndex(cid);
            if(direction == 'next')
            {
               cindex++;
               if(cindex > imgsrclist.length-1)
               {
                  cindex = 0;
               }
            }
                 // document.getElementById('ctl00_ContentBody_TextBox1').value= imgsrclist[cindex];
                  document.getElementById('ctl00_ContentBody_RotationImage').value= imgsrclist[cindex];
                  getImg(imgsrclist[cindex],imgtitlelist[cindex]);
        }
        catch(e)
        {
            alert (e.message);
        }
     }
     
// based on the thumbnail clicked to retrieve the slideshow image
// cid is the source path to image
    function getSlideShowThumbImage(image_src, anchor) {    
        try 
        {
            cindex = findArrayIndex(image_src);
            document.getElementById('ctl00_ContentBody_RotationImage').value= imgsrclist[cindex];
            getImg(imgsrclist[cindex],imgtitlelist[cindex]);
        }
        catch(e)
        {
            alert (e.message);
        }
     }
// get the index of passed value (image srs)
    function findArrayIndex(image_src){ 
        var index = 0;
        for ( i=0; i < imgsrclist.length; i++ ){
            if(imgsrclist[i] == image_src)
            {
                index = i;
            }
        }
        return index;
    }
// following slider was replace with slider_vertical.js
//  beginning of thumb slide
////    function cnclScrl(){clearTimeout(ta.timer)}

////    function scrlThumbs(d){
////      clearInterval(ta.timer);
////      var l;
////      if(d == -1){
////        l = 0;
////      }else{
////      //changed the offsetWidth to Height - it stops the scroll correcly                 adjust to -3 from + 10 to have scroll end @ image correctly
////        l = t[tarl-1].offsetTop - (ta.parentNode.offsetHeight - t[tarl-1].offsetHeight) - thumbscrollvariation;
////      }
////      ta.timer = setInterval(function(){scrlMv(d,l)},st);
////    }

////    function scrlMv(d,l){
////      ta.style.top = ta.style.top || '0px';
////      var left = ta.style.top.replace('px','');
////      if(d == 1){
////        if(l - Math.abs(left) <= ss){
////          cnclScrl(ta.id);
////          ta.style.top = '-' + l + 'px';
////        }else{
////          ta.style.top = left - ss + 'px';
////        }
////      }else{
////        if(Math.abs(left) - l <= ss){
////          cnclScrl(ta.id);
////          ta.style.top = l + 'px';
////        }else{
////          ta.style.top = parseInt(left) + ss + 'px';
////        }
////      }
////    }
////    
////    function getPos(e){
////      if(ie){
////        xp = event.clientX + document.body.scrollLeft;
////        yp = event.clientY + document.body.scrollTop;
////      }else{
////        xp = e.pageX;
////        yp = e.pageY;
////      }  
////     // alert('a' + xp + ' - ' + yp);
////    //  alert('b' + xs_scrldown + ' - ' + ys_scrldown + ' - ' + ye_scrldown);
////      if(xp < 0){xp = 0}
////      if(yp < 0){yp = 0}
////        if(xp > xs_scrlup && xp < xe_scrlup && yp > ys_scrlup && yp < ye_scrlup){
////        scrlThumbs(-1);// scroll up
////        }else if(xp > xs_scrldown && xp < xe_scrldown && yp > ys_scrldown && yp < ye_scrldown){
////        scrlThumbs(1);
////      }else{
////        cnclScrl();
////      }
////    }

////    function leftPos(t){
////      var left = 0;
////      if(t.offsetParent){
////        while(1){
////          left += t.offsetLeft;
////          if(!t.offsetParent){break}
////          t = t.offsetParent;
////        }
////      }else if(t.x){
////        left += t.x;
////      }
////      return left;
////    }

////    function topPos(t){
////      var top = 0;
////      if(t.offsetParent){
////        while(1){
////          top += t.offsetTop;
////          if(!t.offsetParent){break}
////          t = t.offsetParent;
////        }
////      }else if(t.y){
////        top += t.y;
////      }
////      return top;
////    }
////    
////    