var scrollSpeed =.3;   // number of pixels to change every frame
var scrollDepth =200; // height of your display box
var scrollHeight=0;   // this will hold the height of your content
var scrollDelay=25;  // delay between movements.

var scrollPos=scrollDepth; // current scroll position
var scrollMov=scrollSpeed; // for stop&start of scroll

function doScroll() {
    if(scrollHeight==0) { getHeight(); }
    scrollPos-=scrollMov;
    if(scrollPos<(0-scrollHeight)) { scrollPos=scrollDepth; }
    document.getElementById('scrollTxt').style.top=scrollPos+'px';
    setTimeout('doScroll();', scrollDelay);
}

function getHeight() {
    scrollHeight=document.getElementById('scrollTxt').offsetHeight;
}

function scrMove() { scrollMov=scrollSpeed; }
function scrStop() { scrollMov=0; }

function doSearch(){
    var search_box=document.getElementById('search');
    var query=search_box.value;
    var base_url='http://www.google.com/cse?cx=000498994077898609375%3A2qu1ikdlp9u&ie=UTF-8&sa=Search&q='+query;
    document.location=base_url;
}
