var fund_images=new Array
          (
          "images/logo_es_small.gif","#easysearch", 
          "images/logo_efr_small.gif","#easyfr", 
          "images/logo_ebay_small.gif","#ebay",  
          "images/logo_ym_small.gif","#yellowmoon",
          "images/logo_sl_small.gif","#schoollink",
          "images/logo_cfs_small.png","#cfs", 
          "images/logo_bt4b_small.gif","#boxtops",
          "images/logo_ak08_small.gif","#ak08",
          "images/logo_ebay_small.gif","#ebay" 
          );

var fund_blank="images/blank_end_3px.png";
var fund_spacer="images/logo_spacer.gif";
var fund_spacer_width=12;
var fund_image_width=90;
var fund_image_height=30;
var fund_image_count=9;
var fund_image_index=1;
var fund_images_displayed=0;
var image_array = new Array;
var click_array = new Array;
var quantity_to_scroll=90;
var end_spacer=0;
var end_spacer_baseline=0;
var command_halt=0;


function stop_scrolling()
{
   command_halt=1;
}

function start_scrolling()
{
   var browserName=navigator.appName; 
   if (browserName=="Microsoft Internet Explorer")
   {
      command_halt=0;
   }
}

function scrollimages()
{
   if (command_halt==0)
   {
      quantity_to_scroll=quantity_to_scroll-1;
      if (quantity_to_scroll<=0)
      {
         //Change image details
         snapimages();
         quantity_to_scroll=fund_image_width;
         setTimeout(scrollimages,500);
      }
      else
      {
         image_array[1].style.width=quantity_to_scroll+"px";
         image_array[1].style.height=fund_image_height+"px";
         image_array[fund_images_displayed+1].style.width=fund_image_width-quantity_to_scroll;
//         image_array[fund_images_displayed+1].style.height=fund_image_height+"px";
         setTimeout(scrollimages,15);
      }
   }
   else
   {
      setTimeout(scrollimages,15);
   }
}

function snapimages()
{
   fund_image_index=fund_image_index+1;
   if (fund_image_index>fund_image_count)
      fund_image_index=1;
   var loop=fund_image_index;

   for (iid=1; iid<=fund_images_displayed+1; iid++)
   {
      click_array[iid].href=fund_images[(loop*2)-1];
      image_array[iid].src=fund_images[(loop*2)-2];
      image_array[iid].style.width=fund_image_width+"px";
//      image_array[iid].style.height=fund_image_height+"px";
      loop=loop+1;
      if (loop>fund_image_count)
        loop=1;      
   }
   image_array[fund_images_displayed+1].style.width="0px";
//   image_array[fund_images_displayed+1].style.width=fund_image_height+"px";
}

function fundraisingscroller()
{
   if(document.getElementById)
   {
      if (fund_image_count<=8) 
         fund_images_displayed=fund_image_count
      else
         fund_images_displayed=8;

      var SA=document.getElementById("scroller");
      var image_width=(fund_images_displayed*fund_image_width);
      var blank_width=(842-image_width)/2;
      var spacerimage=document.createElement("img"); 
      spacerimage.style.top=0+"px";
      spacerimage.style.width=blank_width+"px";
      spacerimage.style.borderWidth="0";
      spacerimage.src=fund_blank;
      SA.appendChild(spacerimage);

      for (var loop=1; loop<=fund_images_displayed; loop++)
      {
         click_array[loop]=document.createElement("a");
         image_array[loop]=document.createElement("img"); 
         SA.appendChild(click_array[loop]);
         click_array[loop].appendChild(image_array[loop]);
         click_array[loop].href=fund_images[(loop*2)-1];
         image_array[loop].style.top=0+"px";
         image_array[loop].style.width=fund_image_width+"px";
         image_array[loop].style.height=fund_image_height+"px";
         image_array[loop].style.borderWidth="0";
         image_array[loop].src=fund_images[(loop*2)-2];
         image_array[loop].onmouseover=stop_scrolling;
         image_array[loop].onmouseout=start_scrolling;
      }
      // image to be expanded
      loop=fund_images_displayed+1;    
      click_array[loop]=document.createElement("a");
      image_array[loop]=document.createElement("img"); 
      SA.appendChild(click_array[loop]);
      if (loop>fund_image_count)
         click_array[loop].appendChild(image_array[1])
      else
         click_array[loop].appendChild(image_array[loop]);
      click_array[loop].href=fund_images[(loop*2)-1];
      image_array[loop].style.top=0+"px";
      image_array[loop].style.width="0px";
      image_array[loop].style.height=fund_image_height+"px";
      image_array[loop].style.borderWidth="0";
      image_array[loop].src=fund_images[(loop*2)-2];

      var spacerimage=document.createElement("img"); 
      SA.appendChild(spacerimage);
      spacerimage.style.top=0+"px";
      spacerimage.style.width=blank_width+"px";
      spacerimage.style.borderWidth="0";
      spacerimage.src=fund_blank;
      end_spacer=spacerimage;
      end_spacer_baseline=blank_width;
   }       
   var browserName=navigator.appName; 
   if (browserName=="Microsoft Internet Explorer")
   {
      setTimeout(scrollimages,100);
   }
   if (browserName=="Netscape")
   {
      setTimeout(scrollimages,100);
   }
}