// This script is based on the Scrolling Image script by Premshree Pillai (premshree@hotmail.com)
 window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);

//------------------C U S T O M I S E------------------------


if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
 layerStyleRef="layer.";
 layerRef="document.layers";
 styleSwitch="";
 }else{
 layerStyleRef="layer.style.";
 layerRef="document.all";
 styleSwitch=".style";
 }
}

//SCROLL RIGHT
function scroll_right(layerName) {
 if (NS4 || IE4) { 
   get_docwidth();
   if( i < (begin_pos) ) {
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+(i)+'"');
    i++;
    j++;
   }
  if(i==j){
   if( i<begin_pos){
    setTimeout("scroll_right('"+layerName+"')",time_length);
   }
   else if (end_bounce) {
    i--;
    j--;
    setTimeout("scroll_left('"+layerName+"')",pause_length);
   } 
   else {
		i = begin_pos;
		j = i;
    setTimeout("scroll_right('"+layerName+"')",time_length);
   	
   }
  }
 }
}

//SCROLL LEFT
function scroll_left(layerName)
{
 if (NS4 || IE4){
  get_docwidth();
  if(i>(begin_pos-scroll_length)){
   eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
   eval(layerRef+'["'+layerName+'"]'+ styleSwitch+'.left="'+(i)+'"');
   i--;
   j--;
  }
  if(i==j) {
   if( i>begin_pos-scroll_length){
    setTimeout("scroll_left('"+layerName+"')",time_length);
   } 
   else if (end_bounce) {
    i++;
    j++;
    setTimeout("scroll_right('"+layerName+"')",pause_length);
   }
   else {
 		i = begin_pos;
		j = i;
    setTimeout("scroll_left('"+layerName+"')",time_length);
   }
  }
 }
}

function get_docwidth(){
 // NS
 if (window.innerWidth){ 
  return window.innerWidth;
 } 
 //IE
 if (document.body.clientWidth){ 
  return document.body.clientWidth;
 }
}

function get_docheight(){
 // NS
 if (window.innerHeight){ 
  return window.innerHeight;
 } 
 //IE
 if (document.body.clientHeight){ 
  return document.body.clientHeight;
 }
}
