<!--

// ANIMATION - Image Swap for the menu frame (frame_navbody.html)

function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_swapImgRestore() {//v1.0
 var doc=document,i; if(doc.$imgSwaps) { for(i=0;i<doc.$imgSwaps.length;i++) {
  var elm=doc.$imgSwaps[i]; if(elm) { elm.src=elm.$src; elm.$src=null; } } 
  doc.$imgSwaps=null; }
}


// NAVIGATION - Pop-up

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=770,height=500,scrollbars=yes');
return false;
}


// EFFECT - Status scroller


message		= "CBESC.com^" +
                "Columbia Business Equipment has changed its name to^" +
                "Carolina Business Equipment^" +
                "Same Company - Different Name^" +
		"Monday - Friday, 8:00 AM - 5:00 PM Eastern Time^" +
		"Solutions at the Speed of Business 1-800-868-9005^" +
                "^"
  scrollSpeed	= 25
  lineDelay	= 1500


  txt		= ""

  function scrollText(pos) {
    if (message.charAt(pos) != '^') {
      txt	= txt + message.charAt(pos)
      status	= txt
      pauze	= scrollSpeed
    }
    else {
      pauze	= lineDelay
      txt	= ""
      if (pos == message.length-1) pos = -1
    }
    pos++
    setTimeout("scrollText('"+pos+"')",pauze)
  }

scrollText(0)


// Back to top function

var b2tx=95,b2ty=40,b2th='<nobr>Back To Top</nobr>';

function b2x(){return ((moz)?window.innerWidth-20:document.body.clientWidth)-b2tx;}
function b2y(){return ((moz)?window.innerHeight:document.body.clientHeight)+b2o()-b2ty;}
function b2o(){return (moz)?window.pageYOffset:document.body.scrollTop;}
function b2t(){with(document.getElementById('bttl').style){left=((b2o()<1)?-500:b2x())+'px';top=((b2o()<1)?-500:b2y())+'px';}setTimeout('b2t()',99);}
var moz=(document.getElementById&&!document.all)?1:0;document.write('<div id="bttl" class="back2top" style="position:absolute"><a style="cursor:'+((moz)?'pointer':'hand')+'" onclick="JavaScript:scrollTo(0,0)">'+b2th+'</a></div>');b2t();


// Random Image Rotator

var interval = 2; // delay between rotating images (in seconds)
var random_display = 1; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/1.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/2.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/3.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/4.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/5.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/6.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/7.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/8.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/9.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/10.jpg");
image_list[image_index++] = new imageItem("http://cbesc.com/images/graphics/rotate/11.jpg");
var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}




//-->