function MoveDownInMenu(tbl_obj)
{
try
{
if(tbl_obj==null || tbl_obj.rows.length==0)
	return;
var anchor=tbl_obj.rows[0].cells[0].firstChild;

//var anchor=tbl_obj.rows[1].cells[0].firstChild;
anchor.focus();
//alert(anchor.innerHTML)
//td.style.backgroundColor='red';
	 /*if (!e) var e = window.event;

        if (e.keyCode)
        { code = e.keyCode; }
        else if (e.which)
        { code = e.which; }
        alert(code)*/
        }
        catch(e)
        {
        }
}

function ShowDiv1(obj,arrow,right,imgID,imgSRC)
  {
  if(imgID != null)
  {
	//alert(imgID + "-imgID != null");
  	if(document.getElementById(imgID) != null)
  	{
	  //	alert(imgSRC+"image src");
  		document.getElementById(imgID).src = imgSRC;
  		//alert(document.getElementById(imgID).id + "-imgage id");
  	}
  }
  if(obj==null)
  	return;
  	
   var element = arrow.parentElement.parentElement;
   	
   //obj.style.right = (document.body.clientWidth - arrow.offsetLeft - arrow.clientWidth + 2).toString() + 'px';
   obj.style.right = (document.body.clientWidth - element.offsetLeft - element.clientWidth + 2).toString() + 'px';
   //obj.style.top = arrow.offsetTop + arrow.offsetHeight-2 ;//- 2;
   obj.style.top = element.offsetTop + element.offsetHeight-2 + 'px';
   obj.style.display='block';
   
  for(var tt=1;tt<=4;tt++)
  {
	if( document.getElementById('DivMenu'+tt)!=null)
		document.getElementById('DivMenu'+tt).style.display='none';
  }

   if(parseInt(obj.style.right) +  obj.clientWidth > 1161)
   		obj.style.right = (parseInt(obj.style.right) - obj.clientWidth + element.clientWidth - 2).toString() + 'px';
	/*if(obj.offsetLeft < 0 )//out of screen!
	  //if(obj.offsetLeft < obj.parentNode.offsetLeft)//out of site main-borders!
	  {		  		  		  	
	  	right = 0;
	  }
	  

    if (right == 1)
    {
    
     obj.style.right = (parseInt(obj.style.right) - arrow.offsetWidth).toString() + 'px' ;//-10
     
     }
    else
     obj.style.right = (parseInt(obj.style.right) - obj.clientWidth)-2 + 'px';*/	  
 }

function HideDiv1(obj,stam,imgID,imgSRC)    
  {
  if(imgID != null)
  {	  
  	if(document.getElementById(imgID) != null)
  	{  		
  		document.getElementById(imgID).src = imgSRC;  		
  	}
  }
  
  if(obj==null)
  	return;
   obj.style.display='none'; 
  }
  
  function HideFinalParentDiv(obj)
  {
  	HideDiv1(obj.parentNode.parentNode.parentNode.parentNode);
  }

function ShowHideSubMenu(obj)
{
  //document.getElementById('DivMenu'+tt).style.display='none';
  if(obj==null)
  	return;
  	if(obj.style.display=='block')
        obj.style.display='none';
    else
       obj.style.display='block';
}
