// This Javascript Source File is protected by Copyright laws 2004 January Pinched LTSIII Production and Design.
// Please use this code AT WILL with NO WARRANTY but please keep the following notice in place and give credit where credit is due.
// Special thanks to all of those astounding people who taught through their actions.
//*************************************************
// Javascript composed by Len Schwalm III http://www.pinched.com LTSIII Production and Design
// Please contact Len if you need installation help, have suggestions or would like be a part of any projects
// Phone: (909) 319-1137 Ontario, CA USA
// or
// Fill out the contact form at http://www.pinched.com/contact
//*************************************************

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// Slideshow

// Path
var path="images/monitor/";
// ID of Element
var id="headerspacer";
//Specify background images to slide
var bgslides=new Array(
						"train2.jpg",
						"train1.jpg",
						"train0.jpg"
						)

//Specify interval between slide (in miliseconds)
var speed=5500

//preload images
var processed=new Array()
for (i=0;i<bgslides.length;i++){
processed[i]=new Image()
processed[i].src=path+bgslides[i]
}

var inc=-1
var ntimes=0

function slideback(){
if (ntimes>=1){
clearInterval(keeptrack)
return
}
if (inc<bgslides.length-1)
inc++
else{
inc=0
ntimes++
}
setBackgroundImage(id, processed[inc].src);
}

function setBackgroundImage (id, imageURL) {
var imageprops = "177px bottom no-repeat";
  if (document.layers)
    document[id].background.src = imageURL == 'none' ? null : imageURL;
  else if (document.all)
    document.all[id].style.background = imageURL == 'none' ? 'none' 
: 'url(' + imageURL + ') '+imageprops+'';
  else if (document.getElementById)
    document.getElementById(id).style.background = imageURL == 
'none' ? 'none' : 'url(' + imageURL + ') '+imageprops+'';
}
if (document.all||document.getElementById){
window.onload=new Function('keeptrack=setInterval("slideback()",speed)')
}
//end Slideshow

//adds additional onload events
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
//window.onload=startresize();
// Resize function will not work called from body onload

// Start Slider - Rotating/Linked
//slider's width
var swidth=135

//slider's height
var sheight=250

//slider's speed
var sspeed=2

//messages: change to your own; use as many as you'd like; set up Hyperlinks to URLs as you normally do: <a target=... href="... URL ...">..message..</a>
var singletext=new Array()
singletext[0]='TEST 1'
singletext[2]='TEST 2'
singletext[3]='TEST 3'
if (singletext.length>1)
i=1
else
i=0
function start(){
if (document.all){
ieslider1.style.top=sheight
iemarquee(ieslider1)
}
else if (document.layers){
document.ns4slider.document.ns4slider1.top=sheight
document.ns4slider.document.ns4slider1.visibility='show'
ns4marquee(document.ns4slider.document.ns4slider1)
}
else if (document.getElementById&&!document.all){
document.getElementById('ns6slider1').style.top=sheight
ns6marquee(document.getElementById('ns6slider1'))
}
}
function iemarquee(whichdiv){
iediv=eval(whichdiv)
if (iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){
iediv.style.pixelTop=0
setTimeout("iemarquee(iediv)",100)
}
if (iediv.style.pixelTop>=sheight*-1){
iediv.style.pixelTop-=sspeed
setTimeout("iemarquee(iediv)",100)
}
else{
iediv.style.pixelTop=sheight
iediv.innerHTML=singletext[i]
if (i==singletext.length-1)
i=0
else
i++
}
}
function ns4marquee(whichlayer){
ns4layer=eval(whichlayer)
if (ns4layer.top>0&&ns4layer.top<=sspeed){
ns4layer.top=0
setTimeout("ns4marquee(ns4layer)",100)
}
if (ns4layer.top>=sheight*-1){
ns4layer.top-=sspeed
setTimeout("ns4marquee(ns4layer)",100)
}
else{
ns4layer.top=sheight
ns4layer.document.write(singletext[i])
ns4layer.document.close()
if (i==singletext.length-1)
i=0
else
i++
}
}
function ns6marquee(whichdiv){
ns6div=eval(whichdiv)
if (parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){
ns6div.style.top=0
setTimeout("ns6marquee(ns6div)",100)
}
if (parseInt(ns6div.style.top)>=sheight*-1){
ns6div.style.top=parseInt(ns6div.style.top)-sspeed
setTimeout("ns6marquee(ns6div)",100)
}
else{
ns6div.style.top=sheight
ns6div.innerHTML=singletext[i]
if (i==singletext.length-1)
i=0
else
i++
}
}
// End Slider - Rotating/Linked
