if (isShowFloatTop) {
  var floatTopX = '<div id="FloatSlideShow" name="FloatSlideShow" class="floatslideshow">';
  floatTopX += '<a href="#pagetop">';
  floatTopX += '<img id="SlideShow" name="SlideShow" src="../img/floattop.gif" width="60" height="20" border="0" />';
  floatTopX += '</a></div>';
  document.write(floatTopX);
}

var slideShowSpeed = 3000;

// Duration of crossfade (seconds) for IE:
var crossFadeDuration = 3;

// Set the positioning variables, below:
// Negative numbers are relative to right (whereX) or bottom (whereY)
// Positive numbers are relative to left (whereX) or (whereY) top

var whereX = 910;
var whereY = -60;
var atX = 920; //upper left corner of slide show
var atY = 0;
var iW = 60; //size of slide
var iH = 20;
var scrollbar_nn4 = 18;

// Specify the image files:
var Pic = new Array();

Pic[0] = '../img/floattop.gif';

var nn = (navigator.appName.indexOf("Netscape") != -1);
var t;
var j=0;
var p=Pic.length;
var preLoad = new Array();

for (i=0;i<p;i++){
  preLoad[i] = new Image();
  preLoad[i].src = Pic[i];
}

var dD = document, dH = dD.html, dB = dD.body, px = dD.layers ? '' : 'px';

function runSlideShow() {
  //blendTrans: applicable in IE only
  if (ie4up) {
    if (dom) {
      document.getElementById("SlideShow").style.filter="blendTrans(duration=2)";
      document.getElementById("SlideShow").style.filter="blendTrans(duration=crossFadeDuration)";
      document.getElementById("SlideShow").filters.blendTrans.Apply();
    } 
    else if (ie4) {
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();
    }
  }
  
  if (document.all || document.getElementById) {
    document.images.SlideShow.src = preLoad[j].src;
  }
  else if (!nn4) {
    document.FloatSlideShow.document.images["SlideShow"].src = preLoad[j].src;
  }
  else {
    document.layers["FloatSlideShow"].document.images["SlideShow"].src = preLoad[j].src;
  }
  
  
  if (ie4up) {
    document.images.SlideShow.filters.blendTrans.Play();
  }
  
  j = j + 1;
  if ( j > (p - 1)) j = 0;
  t = setTimeout('runSlideShow()', slideShowSpeed);
}


var sbuffer = '', scount = 0, smax=1000;

function floatSS(iX,iY,id) {
  var st;
  var L = dD.getElementById ? dD.getElementById(id) : dD.all ? dD.all[id] : dD.layers[id];		

  this[id+'O'] = L;
  if (dD.layers) L.style = L;
  L.nX = L.iX = iX;
  L.nY = L.iY = iY;
  L.nX = GetPageXOffset() + GetWindowWidth() - 100; //initial position of slide
  L.nY = GetPageYOffset() + GetWindowHeight() + 70;
  L.P = function(x,y){
          this.style.left = x + px;
          this.style.top = y + px;
        };
  L.Fss = function(){
            var pX, pY, cW, cH;
            var dX, dY;
            pX = GetPageXOffset();
            pY = GetPageYOffset();
            cW = GetWindowWidth();
            cH = GetWindowHeight();
            dX = pX + (iX<0? (cW+iX<0?0:cW+iX) : (cW<(iX+iW)?(cW<iW?0:(cW-iW)):iX));
            if (dX > atX) dX = atX;  
            dY = pY + (iY<0? (cH+iY<0?0:cH+iY) : (cH<(iY+iH)?(cH<iH?0:(cH-iH)):iY));
            this.nX+=.1*(dX-this.nX);
            this.nY+=.1*(dY-this.nY);
            
            this.P(this.nX,this.nY);
            setTimeout(this.id + 'O.Fss()',33);
          };
  return L;
}


function GetWindowWidth() {
  var width=0;

  if (ie5up){
    if (document.documentElement&&document.documentElement.clientWidth){
      width=document.documentElement.clientWidth;
    }
    else if (document.body&&document.body.clientWidth){
      width=document.body.clientWidth;
    }
  }
  else {
    if (document.documentElement&&document.documentElement.clientWidth){
      width=document.documentElement.clientWidth;
    }
    else if (document.body&&document.body.clientWidth){
      width=document.body.clientWidth;
    }
    else if (typeof(window.innerWidth)=='number'){
      width=window.innerWidth;
      if (nn4) width -= scrollbar_nn4;
    }
  }
  return width;
}


function GetWindowHeight() {
  var height=0,deh=0,bh=0,wh=0;
  
  if (document.documentElement&&document.documentElement.clientHeight){
    deh=document.documentElement.clientHeight;
  }
  if (document.body&&document.body.clientHeight){
    bh=document.body.clientHeight;
  }
  if (typeof(window.innerHeight)=='number'){
    wh=window.innerHeight;
  }
  if (deh != 0) { 
    if (bh != 0) {
      height = (deh < bh ? deh : bh);
      if (wh != 0) height = (height < wh ? height : wh); 
    }
    else {
      if (wh != 0)
        height = (deh < wh ? deh : wh);
      else
        height = deh;
      }
  }
  else {
    if (bh != 0){
      if (wh != 0) {
        height = (bh < wh ? bh : wh);
      }
      else {
        height = bh;
      }
    }
    else{
      height = wh;
    }
  }
  return height;
}


function GetPageYOffset() {
  var osy=0; //offset of y-axis

  if (typeof(window.pageYOffset)=='number'){
    osy=window.pageYOffset;
  }
  else if (document.documentElement&&document.documentElement.scrollTop){
    osy=document.documentElement.scrollTop;
  }
  else if (document.body&&document.body.scrollTop){
    osy=document.body.scrollTop;
  }
  return osy;
}


function GetPageXOffset() {
  var osx=0;

  if (typeof(window.pageXOffset)=='number'){
    osx=window.pageXOffset;
  }
  else if (document.documentElement&&document.documentElement.scrollLeft){
    osx=document.documentElement.scrollLeft;
  }
  else if (document.body&&document.body.scrollLeft){
    osx=document.body.scrollLeft;
  }
  return osx;
}

if (isShowFloatTop) {
  floatSS(whereX,whereY,'FloatSlideShow').Fss();
}

/* float slide show end */
function writeresult() {
  document.getElementById('writeroot').innerHTML = sbuffer;
}