// JavaScript Document

// GLOBAL VARIABLES
var  menu_out = "#F0EEF3" ;
var  menu_over  = "#ABC3DB" ;

var blink_flag = 0 ;
function blinkit( objID)
{
           var obj = document.getElementById( objID) ;
           blink_flag = blink_flag == 0? 1 : 0 ;
           if ( blink_flag )
              obj.style.visibility = 'hidden' ;
           else
              obj.style.visibility = 'visible' ;
}

function findPos(obj) 
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function setPos( obj, target, tx, ty ) 
{
  var myobj = document.getElementById( target );
  var tmp = findPos( obj );
  myobj.style.top = (tmp[1]+ty)+"px" ;
  myobj.style.left = (tmp[0]+tx)+"px" ;
}

function Show( obj_id )
{
	var obj = document.getElementById( obj_id ) ;
	obj.style.visibility = "visible" ; 
}

function Hide( obj_id )
{
	var obj = document.getElementById( obj_id ) ;
	obj.style.visibility = "hidden" ; 
}

function BgColor( obj_id, color )
{
  var obj = document.getElementById( obj_id ) ;
  obj.style.backgroundColor = color ; 
}

function BgColorObj( obj, color )
{
	obj.style.backgroundColor = color ;
}

function Underline( obj_id, line_style )
{
  var obj = document.getElementById( obj_id ) ;
  obj.style.textDecoration = line_style ; 
}

function Disable_Submenu( cell_id )
{
    var obj = document.getElementById( cell_id ) ;
	obj.onmouseover = null ;
	obj.onmouseout  = null ;
}

function BottomBorder( cell_id )
{
	var obj = document.getElementById( cell_id ) ;
	obj.style.borderBottomStyle = "solid";
	obj.style.borderBottomWidth = "1px" ;
	obj.style.borderBottomColor = "yellow" ;
}
	
function LinkTo( url )
{
	window.location = url ;
}


function Color( obj_id, color )
{
  var obj = document.getElementById( obj_id ) ;
  obj.style.color = color ; 
}	


function Cursor( obj_id, type )
{
	var obj = document.getElementById( obj_id ) ;
	obj.style.cursor = type ;
}

function onSubMenuOver( parent_id, menu_id, cursor_type, parent_color )
{
	Show(menu_id);
	Cursor(menu_id, cursor_type);
	Color( parent_id, parent_color );
}

function onSubMenuOut( parent_id, menu_id, cursor_type, parent_color )
{
	Hide(menu_id);
	Cursor(menu_id, cursor_type);
	Color( parent_id, parent_color );
}

function onSubMenuItemOver( obj, color )
{
	BgColorObj(obj,color);
}

function onSubMenuItemOut( obj, color )
{
	BgColorObj(obj,color);
}

function onMenuOver( menu_id , cursor_type )
{
	Cursor(menu_id, cursor_type);
}

function onMenuOut( menu_id, cursor_type )
{
	Cursor(menu_id, cursor_type);
}

// this_obj : the cell object in the table
// submenu_id : id of the submenu which will be visible
// item_id : id of the text inside the cell
// item_color : color of the text item in the cell
function onMenuItemOver( this_obj, submenu_id,  item_id, item_color )
{
	Show(submenu_id);
	setPos(this_obj,submenu_id,0,this_obj.offsetHeight) ;
	Color( item_id, item_color );
}

function onMenuItemOut( this_obj, submenu_id, item_id, item_color )
{
	Hide(submenu_id);
	Color(item_id, item_color);
}

function onMenuItemSingleOver( item_id, item_color )
{
	Color( item_id, item_color );
}

function onMenuItemSingleOut( item_id, item_color )
{
	Color( item_id, item_color );
}
function ChangeLink(obj_id,color)
{
	Color(obj_id,color);
}
function ChangeLink1(obj_id,color)
{
	Color(obj_id,color);
	var obj = document.getElementById( obj_id ) ;
	obj.style.textDecoration = "none" ; 
}
function ChangeSubMenu( obj_id , color)
{
   BgColor(obj_id, color);
   Disable_Submenu( obj_id ); 
}
 
	 