
// Browser Detection
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (navigator.appCodeName.indexOf("Mozilla")!=-1) ?true:false;
stopSign = 0;
ssRotate=0;
// Body onload utility (supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f)
{
  if (IEmac && IE4)  // IE 4.5 blows out on testing window.onload
  {
    window.onload = SafeOnload;
    gSafeOnload[gSafeOnload.length] = f;
  }
  else if  (window.onload)
  {
    if (window.onload != SafeOnload)
    {
      gSafeOnload[0] = window.onload;
      window.onload = SafeOnload;
    }
    gSafeOnload[gSafeOnload.length] = f;
  }
  else
    window.onload = f;
}
function SafeOnload()
{
  for (var i=0;i<gSafeOnload.length;i++)
    gSafeOnload[i]();
}


//
// Main Slideshow Function
//
function ShowSlides()
{

  var htmlStr = '<table border="' + ssBorderWidth + '" cellspacing="0" cellpadding="0">';
  htmlStr += '<tr><td>';
  htmlStr += '<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#aaaaaa">';
  htmlStr += '<tr><td><img border="0" width="1" height="' + ssHeight + '" src="' + ssSpacerImg + '"></td>';
  htmlStr += '<td align="center"><img border="0" src="'+ ssImages[ssIndex] + '">';
  htmlStr += '</td></tr></table>';
  htmlStr += '</td></tr></table>';
  if (IE4plus)
  {
    slideshowdiv.innerHTML = htmlStr;
  }
  else if (NS4)
  {

    document.slideshowlayer.document.open();
    document.slideshowlayer.document.write(htmlStr);
    document.slideshowlayer.document.close();
    document.slideshowlayer.left = document.placeholder.x;
    document.slideshowlayer.top = document.placeholder.y;
  }
  else if (NS6)
  {
    document.getElementById("slideshowdiv").innerHTML = htmlStr;
  }


  ssIndex++;
  if (ssIndex >= ssImages.length){
    ssIndex = 0;
    ssRotate ++;
  }
  if ((stopSign==0)&&(ssRotate<2)){
    setTimeout("ShowSlides()",ssInterval);
  }else{

  }
}

function startSlide(){

  stopSign=0;
  ssRotate=0;
  ShowSlides();

}
function stopSlide(){

stopSign = 1;
ShowSlides();

}
function SlideShow()
{
  if (IE4plus || NS6)
  {
    document.write('<DIV ID=slideshowdiv name=slideshowdiv  STYLE="position:relative; WIDTH=' + ssWidth + 'px; HEIGHT=' + ssHeight + 'px"></DIV>');
  }
  else if (NS4)
  {
    document.write('<LAYER ID=slideshowlayer WIDTH=' + ssWidth + ' HEIGHT=' + ssHeight + '></LAYER>');

    // Because NS needs floating layers, we need a placeholder graphic to force anything
    // below the graph to leave whitespace for the graph
    document.write('<img name="placeholder" border="0" width="' + ssWidth + '" height="' + ssHeight + '" src="' + ssSpacerImg + '">');
  }

}

function HandleResize()
{
  location.reload();
  return false;
}

if (NS4)
{
  window.captureEvents(Event.RESIZE);
  window.onresize = HandleResize;
}

SafeAddOnload(ShowSlides);


var ssIndex = 0;
var ssImages = new Array();




