var time = 3000;
var numofitems = 7;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
  this.numberofmenuitems = allitems;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
  this.thediv.style.visibility = startstate;
}

//menu methods
function ehandler(event,theobj){
  for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
  }
  theobj.thediv.style.visibility="visible";
}
				
function closesubnav(event){
  if ((event.clientY <48)||(event.clientY > 107)){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
      shutdiv.style.visibility='hidden';
    }
  }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function sendLink()
{
	window_new_open("http://www.attorney-austin.com/sendlinktofriend.aspx?url=" + location.href);
}
function buttonSwap(button)
{
   if (button.className=="button")
   {
     button.className="buttonover";
	 button.style.cursor = 'hand';
   }
   else
   {
      button.className="button";
	  button.style.cursor = 'default';
   }
}

function toggleInputFocus(inputBox)
{
   if (inputBox.className=="input2") {
     inputBox.className="input2Focus";
   } else {
      inputBox.className="input2";
   }
}
function toggleCommentFocus(inputBox)
{
   if (inputBox.className=="CommentBox") {
     inputBox.className="CommentBoxFocus";
   } else {
      inputBox.className="CommentBox";
   }
}
function search()
{
	var term = q.value;
	document.location='http://www.attorney-austin.com/search/index.asp?g=0&search=Search&q=' + term;
}