// ********initialization for ToolBar ********
<!--
///////////////////////////////////////////////////////////////////////////////
// - Global Variable Declarations
var textstring="Welcome to TITANS Home Page!!!";
var URL="home.html";
var spanelems,Spans;
var checksp=new Array();
var counter=0,gcount=0,  spc=0,  cnt=0,cnt2=50;
var T=70;
var bool=true;
// - End Global Variable Declarations
// - Main Module

function loadIt()
{
 spanTag(" ","visible");
 recursive();
 br();
 for(var x=0;x<textstring.length;x++)
  {
   var count=x+1;
   spanTag(textstring.substring(count,count-1),"hidden");
  }
	 checktextstring();
}
// - End Main Module
///////////////////////////////////////////////////////////////////////////////
// - Method Definitions
function checktextstring()
{
 var sp=" ";
 for(var x=0;x<textstring.length;x++)
 {
  checksp[x]=(x==0)?textstring.lastIndexOf(sp,textstring.length):textstring.lastIndexOf(sp,checksp[x-1]-1);
 
   if(checksp[x]!=-1)
   {
    Spans[eval(parseInt(checksp[x])+1)].innerHTML="<b style='visibility:hidden'>_</b>";
   }
 }
}
function spanTag(buffer,toggle)
{ 
 spanelems=document.createElement('span');
 spanelems.innerHTML=buffer;
 spanelems.style.visibility=toggle;
 spanelems.onclick=gohere;
 document.body.appendChild(spanelems);
}
function recursive()
{
 if(counter<=textstring.length)
  {
    Spans=document.getElementsByTagName('span');
		Spans[0].innerHTML=textstring.substring(counter,counter-1);
	  counter++;
  }
	else if(bool)
	{
	  T=20;
	  for(var x=0;x<Spans.length;x++)
	  {
	    Spans[x].style.visibility="visible";
		  Spans[x].style.color="black";
	  }
	 Spans[0].style.visibility="hidden";
	 bool=false;
	}
	else if(spc<=35)
	{
	  Spans[gcount].style.position="relative";
		Spans[gcount].style.color="white";
	  Spans[gcount].style.left=spc;
		spc+=10;
	}
	else if(gcount<Spans.length-1)
	{
	 gcount++;spc=0;
	 Spans[gcount].style.color="blue";
	}
 else if(cnt<50)
 {
   for(var x=0;x<Spans.length;x++)
	   Spans[x].style.filter="glow(color=blue,strength="+cnt+")";
		 
		 cnt+=2;
 }
 else if(cnt2>0)
 {
   for(var x=0;x<Spans.length;x++)
	   Spans[x].style.filter="glow(color=blue,strength="+cnt2+")";
		 cnt2-=1;
 }
 setTimeout("recursive();",T);
}
function br()
{
 br=document.createElement('br');
 document.body.appendChild(br);
}
function gohere()
{
 location.href=URL;
}

//Global variables
var CurrentImage;
var CurrentImageSrcSave;
var MyImage;
var disabledImg;
var currElement;

function doInOut(tabname, out){
	if(currElement == tabname) return;
	if(document.getElementById(tabname) != null)
		if(out){
  		document.getElementById(tabname).className = "navTabRegBody";
		}else{
  		document.getElementById(tabname).className = "navTabOverBody";
		}
}

function doInit(tabname){
/*
  if(document.getElementById("home_bottom") != null)
  		document.getElementById("home_bottom").className = "navTabRegBody";
  if(document.getElementById('home_bottomHead') != null)
  		document.getElementById('home_bottomHead').className = "navTabHead";
  if(document.getElementById("home_bottomLabel") != null)
  		document.getElementById("home_bottomLabel").className = "navRegLabel";
  if(document.getElementById("home_bottomTail") != null)
  		document.getElementById("home_bottomTail").className = "navTabTail";

  if(document.getElementById("sch_bottom") != null)
  		document.getElementById("sch_bottom").className = "navTabRegBody";
  if(document.getElementById('sch_bottomHead') != null)
    	document.getElementById('sch_bottomHead').className = "navTabHead";
  if(document.getElementById("sch_bottomLabel") != null)
  		document.getElementById("sch_bottomLabel").className = "navRegLabel";
  if(document.getElementById("sch_bottomTail") != null)
  		document.getElementById("sch_bottomTail").className = "navTabTail";

  if(document.getElementById("stand_bottom") != null)
  		document.getElementById("stand_bottom").className = "navTabRegBody";
  if(document.getElementById('stand_bottomHead') != null)
    	document.getElementById('stand_bottomHead').className = "navTabHead";
  if(document.getElementById("stand_bottomLabel") != null)
  		document.getElementById("stand_bottomLabel").className = "navRegLabel";
  if(document.getElementById("stand_bottomTail") != null)
  		document.getElementById("stand_bottomTail").className = "navTabTail";

  if(document.getElementById("stats_bottom") != null)
  		document.getElementById("stats_bottom").className = "navTabRegBody";
  if(document.getElementById('stats_bottomHead') != null)
    	document.getElementById('stats_bottomHead').className = "navTabHead";
  if(document.getElementById("stats_bottomLabel") != null)
  		document.getElementById("stats_bottomLabel").className = "navRegLabel";
  if(document.getElementById("stats_bottomTail") != null)
  		document.getElementById("stats_bottomTail").className = "navTabTail";

  if(document.getElementById("mem_bottom") != null)
  		document.getElementById("mem_bottom").className = "navTabRegBody";
  if(document.getElementById('mem_bottomHead') != null)
    	document.getElementById('mem_bottomHead').className = "navTabHead";
  if(document.getElementById("mem_bottomLabel") != null)
  		document.getElementById("mem_bottomLabel").className = "navRegLabel";
  if(document.getElementById("mem_bottomTail") != null)
  		document.getElementById("mem_bottomTail").className = "navTabTail";

  if(document.getElementById("grnd_bottom") != null)
  		document.getElementById("grnd_bottom").className = "navTabRegBody";
  if(document.getElementById('grnd_bottomHead') != null)
    	document.getElementById('grnd_bottomHead').className = "navTabHead";
  if(document.getElementById("grnd_bottomLabel") != null)
  		document.getElementById("grnd_bottomLabel").className = "navRegLabel";
  if(document.getElementById("grnd_bottomTail") != null)
  		document.getElementById("grnd_bottomTail").className = "navTabTail";

  if(document.getElementById("col_bottom") != null)
  		document.getElementById("col_bottom").className = "navTabRegBody";
  if(document.getElementById('col_bottomHead') != null)
    	document.getElementById('col_bottomHead').className = "navTabHead";
  if(document.getElementById("col_bottomLabel") != null)
  		document.getElementById("col_bottomLabel").className = "navRegLabel";
  if(document.getElementById("col_bottomTail") != null)
  		document.getElementById("col_bottomTail").className = "navTabTail";

  if(document.getElementById("arch_bottom") != null)
  		document.getElementById("arch_bottom").className = "navTabRegBody";
  if(document.getElementById('arch_bottomHead') != null)
    	document.getElementById('arch_bottomHead').className = "navTabHead";
  if(document.getElementById("arch_bottomLabel") != null)
  		document.getElementById("arch_bottomLabel").className = "navRegLabel";
  if(document.getElementById("arch_bottomTail") != null)
  		document.getElementById("arch_bottomTail").className = "navTabTail";
*/
  highlight(tabname);
  currElement = document.getElementById("imgLabel").value;
 
}

function doOnClick(tabname) {
	highlight(tabname);
	currElement = document.getElementById("imgLabel").value;
}

function highlight(tabId) {
 //  restore the current button, use imgLabel to save current page
    if (CurrentImage != null) {
              var currentTab = document.getElementById("imgLabel").value;
              CurrentImage = currentTab;

              if(CurrentImage.indexOf("bottom") != -1){
                document.getElementById(CurrentImage).className = "navTabRegBody";
      			document.getElementById(CurrentImage + 'Head').className = "navTabHead"
     			document.getElementById(CurrentImage + 'Label').className = "navRegLabel";
      			document.getElementById(CurrentImage + 'Tail').className = "navTabTail";
      	      }
    }

   //save the new button
    if (tabId != null)  {
	MyImage = tabId;
	if(MyImage){
		CurrentImage = MyImage;
		if(MyImage.indexOf("bottom") != -1){
			document.getElementById( MyImage + 'Label').className = "navSelLabel"
   			document.getElementById( MyImage + 'Head').className = "navTabHead"
    		document.getElementById(MyImage+ 'Tail').className = "navTabTail";
    		document.getElementById(MyImage).className = "navTabSelBody";
    	}

        document.getElementById("imgLabel").value = tabId;
       }
    }

}

function showaltname(current,text){
	var altName = unescape(text);
    altName = altName.replace('+',' ');
	altName = altName.replace('+/+',' / ');
    current.title=altName;
}


var tree_rowstate = new Array();
var tree_callbacks = new Array();

function tree_hideRow(rowId) {
  el = document.getElementById(rowId);
  el.style.display = "none";
}

function tree_showRow(rowId) {
  el = document.getElementById(rowId);
  el.style.display = "";
}

function tree_hasChildren(rowId) {
  res = document.getElementById(rowId + '_0');
  return (res != null);
}

function tree_getRowChildren(rowId) {
  el = document.getElementById(rowId);
  var arr = new Array();
  i = 0;
  while (true) {
    childRowId = rowId + '_' + i;
    childEl = document.getElementById(childRowId);
    if (childEl) {
      arr[i] = childRowId;
    } else {
      break;
    }
    i++;
  }
  return (arr);
}

function tree_toggleRow(rowId, state, force) {
  var rowChildren;
  var i;
  // open or close all children rows depend on current state
  force = (force == null) ? 1 : force; 
  if (state == null) {
    row_state = ((tree_rowstate[rowId]) ? (tree_rowstate[rowId]) : 1) * -1;
  } else {
    row_state = state;
  }
  rowChildren = tree_getRowChildren(rowId);
  if (rowChildren.length == 0) return (false);
  for (i = 0; i < rowChildren.length; i++) {
    if (row_state == -1) {
      tree_hideRow(rowChildren[i]);
      tree_toggleRow(rowChildren[i], row_state, -1);
    } else {
      if (force == 1 || tree_rowstate[rowId] != -1) {
        tree_showRow(rowChildren[i]);
        tree_toggleRow(rowChildren[i], row_state, -1);
      }
    }
  }
  if (force == 1) {
    tree_rowstate[rowId] = row_state;
    tree_fireEventRowStateChanged(rowId, row_state);
  }
//  document.getElementById(rowId).focus();
  return (true);
}

function tree_fireEventRowStateChanged(rowId, state) {
  if (tree_callbacks['eventRowStateChanged']) {
    callback = tree_callbacks['eventRowStateChanged'] + "('" + rowId + "', " + state + ");";
    eval(callback);
  }
}

function tree_collapseAll(tableId) {
  table = document.getElementById(tableId);
  rowChildren = table.getElementsByTagName('tr');
  for (i = 0; i < rowChildren.length; i++) {
    if (index = rowChildren[i].id.indexOf('_')) {
      // do not hide root elements
      if(index != rowChildren[i].id.lastIndexOf('_')) {
        rowChildren[i].style.display = 'none';
      }
      if (tree_hasChildren(rowChildren[i].id)) {
        tree_rowstate[rowChildren[i].id] = -1;
        tree_fireEventRowStateChanged(rowChildren[i].id, -1);
      }
    }
  }
  return (true);
}    

function tree_expandAll(tableId) {
  table = document.getElementById(tableId);
  rowChildren = table.getElementsByTagName('tr');
  for (i = 0; i < rowChildren.length; i++) {
    if (index = rowChildren[i].id.indexOf('_')) {
      rowChildren[i].style.display = '';
      if (tree_hasChildren(rowChildren[i].id)) {
        tree_rowstate[rowChildren[i].id] = 1;
        tree_fireEventRowStateChanged(rowChildren[i].id, 1);
      }
    }
  }
  return (true);
}

    tree_callbacks['eventRowStateChanged'] = 'tree_eventRowChanged';
    
    function tree_eventRowChanged(rowId, state) {
      img = document.getElementById(rowId).getElementsByTagName('td')[0].getElementsByTagName('img')[0];
      if (state == 1) {
        img.src = 'resources/minusbox.gif';
      } else {
        img.src = 'resources/plusbox.gif';
      }
//	  img.focus();
      return (true);
    }  
/***** Implement Dragging**/

var ie=document.all;
var ns6=document.getElementById&&!document.all;

var dragapproved=false;
var z,x,y;

function move(e){
	if (dragapproved){
		z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x;
		z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y;
		return false;
	}
}

function drags(e){
	if (!ie&&!ns6)
		return;
	var firedobj=ns6? e.target : event.srcElement;
	var topelement=ns6? "HTML" : "BODY";

	while (firedobj.tagName!=topelement&&firedobj.className!="drag"){
		firedobj=ns6? firedobj.parentNode : firedobj.parentElement;
	}

	if (firedobj.className=="drag"){
		dragapproved=true;
		z=firedobj;
		temp1=parseInt(z.style.left+0);
		temp2=parseInt(z.style.top+0);
		x=ns6? e.clientX: event.clientX;
		y=ns6? e.clientY: event.clientY;
		document.onmousemove=move;
		return false;
	}
}
document.onmousedown=drags;
document.onmouseup=new Function("dragapproved=false");
/***** End Dragging Function******/

// - End Method Definitions
///////////////////////////////////////////////////////////////////////////////