
function showHidePP(col) {
	var state   = '';
	var divsObj = null;	
	var divs    = document.getElementsByTagName('div');
	
  for(i=0;i<divs.length;i++) { 
    if(divs[i].id.match(col)) {  
    	divsObj  = (document.getElementById) ? document.getElementById(divs[i].id) : eval("document.all['" + divs[i].id + "']");
	    var curr_state = divsObj.style.display;
	    
	    if ( curr_state == 'none' )
		    state = '';
	    else
		    state = 'none';
		  if ( divsObj != null )
	      divsObj.style.display = state;   
	
     } 
   } 
}



var dropMenuObj = null;
var checkIt;
var dropMenu2Obj = null;
var checkIt2;
var toolTipObj = null;
var colDefObj  = null;
var coldefsObj = null;
var tdObj      = null;
var linkObj     = null;
var tdParentObj = null;
var menuObj        = null;
var tdcells    = new Array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y' );	

function goHere( form )
{
		var opt_key = form.selectedIndex;
		var url_val = form.options[opt_key].value;
		//window.open(url_val,'_top');
		if ( url_val ) location.href = url_val;
		return true;
}
function showColDef( column )
{
	colDefObj  = (document.getElementById) ? document.getElementById(column) : eval("document.all['" + column + "']");
	if ( coldefsObj == null ) {
	  coldefsObj = (document.getElementById) ? document.getElementById( "coldefs" ) : eval("document.all['coldefs']");
	}
	if ( coldefsObj != null ) {
		coldefsObj.style.visibility = "hidden";
	}
	if (colDefObj != null) {
		colDefObj.style.visibility = "visible";
	}
}
function hideColDef( column )
{
	if (colDefObj != null) {
		colDefObj.style.visibility  = "hidden";
	}
	if ( coldefsObj != null ) {
		coldefsObj.style.visibility = "visible";
	}
}

function showToolTip( tip, color )
{
	toolTipObj  = ( document.getElementById ) ? document.getElementById( tip ) : eval( "document.all['" + tip + "']" );
	if (toolTipObj != null) {
		toolTipObj.style.backgroundColor = color;
		document.onmousemove = moveTip;
	}
}

function hideToolTip( tip )
{
	if ( toolTipObj != null ) {
		toolTipObj.style.visibility  = "hidden";
	}
	document.onmousemove = null;
}

function moveTip(e)
{
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		posx = e.clientX + document.body.scrollLeft;
		posy = e.clientY + document.body.scrollTop;
	}
	toolTipObj.style.left = posx + 14 + 'px';
	toolTipObj.style.top  = posy + 18 + 'px';
	toolTipObj.style.visibility = "visible";
}

function showBorder( tr ) 
{
	var tdcell  = null;
  for ( i = 0; i < tdcells.length; i++  ) {
    tdcell = tr + tdcells[i];
    if ( document.getElementById && document.getElementById( tdcell ) || document.all && eval( "document.all['" + tdcell + "']" ) ) {
      tdObj  = ( document.getElementById ) ? document.getElementById( tdcell ) : eval( "document.all['" + tdcell + "']" );
      tdObj.style.borderBottomStyle = 'solid';
      tdObj.style.borderTopStyle    = 'solid';
      tdObj.style.borderBottomColor = 'brown';
	    tdObj.style.borderTopColor    = 'brown';
	  }
  }
}

function hideBorder( tr, oldcolor ) 
{
	var tdcell  = null;
  for ( i = 0; i < tdcells.length; i++  ) {
    tdcell = tr + tdcells[i];
    if ( document.getElementById && document.getElementById( tdcell ) || document.all && eval( "document.all['" + tdcell + "']" ) ) {
      tdObj  = ( document.getElementById ) ? document.getElementById( tdcell ) : eval( "document.all['" + tdcell + "']" );
      tdObj.style.borderBottomColor = oldcolor;
	    tdObj.style.borderTopColor    = oldcolor;
	  }
  } 
}

function menuOn( lyr, menuid ) {
  lyr.style.backgroundColor = '#eee';
  menuObj = (document.getElementById) ? document.getElementById(menuid) : eval("document.all['" + menuid + "']");
  menuObj.style.color="#804040"
   // lyr.style.Color           = 'black';
}

function menuOff( lyr ) {
  lyr.style.backgroundColor = '#222';
  menuObj.style.color       = 'white';
 // lyr.style.Color           = 'white';
  
}

function parentMenuOn( linkid, tdid ) {
  
  linkObj = (document.getElementById) ? document.getElementById(linkid) : eval("document.all['" + linkid + "']");
  linkObj.style.color="#804040";
  tdParentObj = (document.getElementById) ? document.getElementById(tdid) : eval("document.all['" + tdid + "']");
  tdParentObj.style.backgroundColor = '#eee';
  
}
function parentMenuOff( linkid, tdid ) {
  
  // linkObj = (document.getElementById) ? document.getElementById(linkid) : eval("document.all['" + linkid + "']");
  linkObj.style.color='white';
  // tdParentObj = (document.getElementById) ? document.getElementById(tdid) : eval("document.all['" + tdid + "']");
  tdParentObj.style.backgroundColor = '#222';
  
}

function go( here ){
	if ( here ) location.href = here;
  return true;
}

function goNew( here ){
	if ( here ) window.open(here, "_blank");
  return true;
}

function dropMenu( obj, menu )
{
  checkUserInput();
  var newX   = findPosX(obj);
	var newY   = findPosY(obj);
	var oWidth = obj.offsetWidth;
	var farRight = newX + oWidth;
	dropMenuObj  = ( document.getElementById ) ? document.getElementById( menu ) : eval( "document.all['" + menu + "']" );
	
	if (dropMenuObj != null) {
	  dropMenuObj.style.top = newY + 27 + 'px';
	  dropMenuObj.style.left = farRight - 220 + 'px';
		dropMenuObj.style.visibility = "visible";
	}
}

function checkUserInput()
{
	if (checkIt) clearTimeout(checkIt);
}

function startTimeout(){
	checkIt = setTimeout('hideDropMenu()',500);
}

function hideDropMenu()
{
	if ( dropMenuObj != null ) {
		dropMenuObj.style.visibility  = "hidden";
	}
}

function dropMenu2( obj, menu )
{
  if (dropMenu2Obj != null) {
    dropMenu2Obj.style.visibility = "hidden";
  }
  checkUserInput2();
  var newX   = findPosX(obj);
	var newY   = findPosY(obj);
	var oWidth = obj.offsetWidth;
	//var farRight = newX + oWidth;
	dropMenu2Obj  = ( document.getElementById ) ? document.getElementById( menu ) : eval( "document.all['" + menu + "']" );
	
	if (dropMenu2Obj != null) {
	  dropMenu2Obj.style.top = newY  + 'px';
	  dropMenu2Obj.style.left = newX - 130 + 'px';
		dropMenu2Obj.style.visibility = "visible";
	}
}
function hideDropMenu2()
{
if ( dropMenu2Obj != null ) {
		dropMenu2Obj.style.visibility  = "hidden";
	}
}

function checkUserInput2()
{
	if (checkIt2) clearTimeout(checkIt2);
}

function startTimeout2(){
	checkIt2 = setTimeout('hideDropMenu2()',250);
}


function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function hideSelectMenu() {
  var selectMenuObj = (document.getElementById) ? document.getElementById( "selectmenu" ) : eval("document.all['selectmenu']");
  if ( selectMenuObj != null ) {
		selectMenuObj.style.visibility = "hidden";
	}
}




