\n'); } function startPolling(anPoint){ //Have to make a local variable to this function, won't work just as 'anPoint' //And can't use 'var' in front of it, or it won't work anPt = anPoint; //clearInterval(my_polling_prog);//clear first to ensure it's not still going from time before //Number is in milliseconds, ex 500 = 500 milliseconds (1/2 a second) my_polling_prog = setInterval("poll(anPt)",15); //calls to 'Poll' function to scroll } // FUNCTION TO SCROLL DOWN PAGE TO 'ANCHOR' POINT BASED ON BROWSER y POSITION FROM FLASH FILE fsCommand var position = ""; var currentPos = ""; var color = "#ffffff"; function getCurrentScrollPosition() { // Check Which Browser if (navigator.appName == "Microsoft Internet Explorer"){ //for IE if (document.body.scrollTop) { //for IE 5 & 5.5 currentPos = document.body.scrollTop; } else { //for IE 6 currentPos = document.documentElement.scrollTop; } } else { //for Netscape, Opera currentPos = window.pageYOffset; } } function poll(anchorPoint){ //Only do this once each time if (position == "") { //Determines current scroll position getCurrentScrollPosition();//sets value of 'currentPos' //Set 'position' to current scroll position position = currentPos; } //Changing to new page, put at top of page with no scrolling & clearInterval //fsCommand will have parameter set to "top" coming from Flash movie if (anchorPoint == "top") { //Scroll to this x, y position in browser window window.scrollTo(0,0);//top of page position = "";//Reset variable //Stops setInterval calling to function: DONE clearInterval(my_polling_prog); } //Want to be at top of page, and already are at top of page, so do nothing--> need to clearInterval if (anchorPoint == 0 && position == anchorPoint) { position = "";//Reset variable //Stops setInterval calling to function: DONE clearInterval(my_polling_prog); } //Scroll back to top, backwards scroll if (anchorPoint == 0 && position != anchorPoint) { //Keep scrolling back up position -= 10; //Make sure not a negative number, set to zero to stop if (position <= 0) { position = 0;//will stop //Stops setInterval calling to function: DONE clearInterval(my_polling_prog); } //If user scrolls down while program scrolling up, scrolling will stop getCurrentScrollPosition();//Sets value of 'currentPos' if (position < (currentPos-10)) { position = "";//Reset variable //Stops setInterval calling to function: DONE clearInterval(my_polling_prog); } //Scroll to this x, y position in browser window window.scrollTo(0,position); } //Keep scrolling down until reach this number: anchorPoint //If anchorPoint=0, go to scroll back to top statement instead(unless position=anchorPoint=0) if (position >= anchorPoint && anchorPoint !=0 && anchorPoint != "top") { //Set to final 'anchorPoint' destination window.scrollTo(0,anchorPoint); position = "";//Reset variable //Stops setInterval calling to function: DONE clearInterval(my_polling_prog); } else if (position < anchorPoint && anchorPoint != 0 && anchorPoint != "top") { //keep scrolling down position += 10; //Scroll to this x, y position in browser window window.scrollTo(0,position); return true; } }//END 'POLL' FUNCTION FOR SCROLLING //----end Hide------------->