 var _run; // set a global variable with a null value. The null value will act as a Boolean false value.

if(navigator.userAgent.indexOf("Firebird")!=-1||navigator.appName=="Microsoft Internet Explorer")
{_run=false;}
else {_run= true;}

/* In the above lines of code, we’re checking to make sure the person is using either Mozilla FireBird or Microsoft Internet Explorer. We’ll set our global variable to false if they are using it, or set it to true in the event that someone is using Netscape or Opera (or some other unpopular browser). This variable will tell us which function to run. */

function vScroll() // begin function
{
var top = (window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop; 

/* An explanation is needed here: the variable “top” is going to represent one of three things: window.pageYOffset (if it is available, if it’s not, it represents document.documentElement.scrollTop. If document.documentElement is not available, it will represent document.body.scrollTop (sound familiar?). This is the variable we’ll use to determine the amount of pixels this document is scrolled from the top. It’s important because it tells us where we should put the frame on the right. */

parent.frames["catFrame"].scrollTo(0,top);

/* This code will make the right frame (remember its ID in the fscroll_main.html page?) scroll to zero horizontally, and the same place as this left frame vertically. */

} // End function

function searchScroll(){ // begin function
var top = (window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop;
/* Again, we’re setting the variable top to equal that of the amount of pixels the document is scrolled from the top. The reason for not declaring this variable once (before any functions were put into the code), is because you wouldn’t be able to scroll either document! This variable would always equal zero. By putting it into the function, the variable re-validates each time, resulting in a different number (assuming the document was scrolled up or down). */
parent.frames["catFrame"].scrollTo(0,top);
/* This code places the scrolling of the right frame in the same place as the left frame. Keep in mind that if you’ve scrolled horizontally, it will go back to zero. */
window.setTimeout("searchScroll();",1);
/* Why a setTimeout function? We’re going to re-run this function 1000 times a second. The scrolling might appear a bit choppy if you do it really fast, but it doesn’t work in Netscape otherwise. */
}

if(_run == false) // if the browser is Mozilla FireBird or if it’s Internet Explorer…
{
window.onscroll=function(){vScroll();} // when the document is scrolled, run the function specified.
} else { // If the browser is not Mozilla FireBird or Internet Explorer…
window.onload=function(){searchScroll()} // when the document loads, run the function specified. Remember we’re using a setTimeout function with this function, because it takes place when the document loads, not when it is scrolled (some browsers do not support the window.onscroll event handler).
}
