var domainroot="howiplantogetrich.com" // change this later on if the domain name changes.
var foo = null; // object
var minLength = 90;
var maxLength = 200;
var constNum = 10;

function doMove() {
  var length = 	parseInt(foo.style.width);
  if(length <= maxLength)
  {
		foo.style.width = parseInt(foo.style.width)+constNum+'px';
		setTimeout(doMove,2);
                if(foo.value == '' || foo.value == '\t' || foo.value == '\n' || foo.value == '\r' || foo.value == 'Search' )
		foo.value = '';
		
		if(foo.className.search('searchFocus') < 0)
			foo.className += ' searchFocus';
  }
  
}

function undoMove() {
  var length = 	parseInt(foo.style.width);
  if(length >= minLength)
  {
		foo.style.width = parseInt(foo.style.width)-constNum+'px';
		setTimeout(undoMove,2);
                if(foo.value == '' || foo.value == '\t' || foo.value == '\n' || foo.value == '\r' )
		          foo.value = 'Search';
		foo.className = foo.className.replace('searchFocus', '');
  }
}

function initSearchField() {
  foo = document.getElementById('txtSearchField'); 
  foo.style.width = minLength + 'px'; 
}



function Gsitesearch(curobj){
curobj.q.value="site:"+domainroot+" "+curobj.qfront.value
}



if (window.addEventListener) 
{
window.addEventListener ("load",initSearchField,false);
}
else if (window.attachEvent)
{
window.attachEvent ("onload",initSearchField);
} 
else 
{
window.onload = initSearchField;
}

