var a_element,xdiv,ydiv
var state=true 
  function show_help(a_element)
  {
    var check,show,divarr,cou,strdivname,strdivgroup,content,strhtml,strname,strhtml2,posbody,posbodydown
    var countdivgroup=0 ;
    check2=true ;
    document.all("helpDiv2").style.display="none" ;  
    check=false ;  
    if (a_element == null)
    {    
      a_element=document.activeElement.id ; 
    }
    show = a_element+"_help" ; 
    divarr=document.getElementsByTagName("div") ;
    cou=divarr.length-1 ;
    for(i=0;i<=cou;i++)  
    { 
      strdivname=divarr[i].id ;
      if (strdivname == show )
      {
        check = true ;
      }
      if (strdivname.search("Group_help") != -1)
      {
        countdivgroup=countdivgroup+1 ;
      }
    }  
    if (check == false)
    {
      for (i=1;i<=countdivgroup;i++)
      {
        strdivgroup=document.all("Group_help"+i).getAttribute("name");
        if ((strdivgroup.search(a_element) != -1) && (a_element != ""))
        {
          show="Group_help"+i ;
          check = true ;
          if (strdivgroup.substring(0,strdivgroup.indexOf("+")) != "")
          {
            a_element=strdivgroup.substring(0,strdivgroup.indexOf("+")) ;
          }            
        }
      }
    }
    if (check == true)
    {
      document.all(a_element).style.position="relative"  
      if(state==true)
      { 
        xdiv=document.all(a_element).offsetLeft+document.all(a_element).offsetWidth ;
        ydiv=document.all(a_element).offsetTop+document.all(a_element).offsetHeight ;
        content=document.all(show).outerText ;
        strhtml="<table  width='130' cellSpacing='0' cellPadding='0' border='0'>" ;
        strhtml=strhtml+"<tr><td height='21' align='center' valign='bottom' dir=rtl><map name='FPMap1'><area href=javascript:state=false;show_help('"+a_element+"') shape='circle' coords='122, 8, 8'></map><img border='0' src='../../images/help_01.jpg' usemap='#FPMap1' width='130' height='21'></td></tr>" ;
        strhtml =strhtml+"<tr><td  align='center' bgcolor='#F3F3F3' background='../../images/help_02.jpg' style='font-family:Tahoma;font-size:11px;'><p dir=rtl align=justify style='margin-top:5px;margin-bottom:5px;margin-left:7px;margin-right:7px;'>"+content+"</p></td></tr>" ;
        strhtml=strhtml+"<tr><td height='16' dir=rtl align='center' background='../../images/help_03.jpg'></td></tr></table>" ;
        document.all("helpDiv2").innerHTML=strhtml ;
      }  
      else
      {
        xdiv=document.all(a_element).offsetLeft-40 ;
        ydiv=document.all(a_element).offsetTop ;
        if (document.all(a_element).getAttribute("type")== "file")
        {
          xdiv=xdiv-85 ;
        }  
        if (xdiv-30 < document.body.offsetLeft)
        {
          xdiv=xdiv+30 ;
        }
        strname=document.all(a_element).getAttribute("name");
        if((strname.search("color")!= -1) || (strname.search("Color")!= -1))
        {
          xdiv=document.all(a_element).offsetLeft+document.all(a_element).offsetWidth ;          
        } 
        strhtml2="<table   cellSpacing='0' cellPadding='0' style='margin-top:0px;'  border='0' borderColor='navy' style='BORDER-COLLAPSE: collapse'>" ;  
        strhtml2=strhtml2+"<tr><td  dir=rtl valign='middle'><a style='text-decoration:none;' href=javascript:state=true;show_help('"+a_element+"')><img src='../../images/help_show.gif' width=25 height=25 border=0></a></td></tr></table>" ;
        document.all("helpDiv2").innerHTML=strhtml2 ;     
      }
      document.all("helpDiv2").style.left=xdiv;
      document.all("helpDiv2").style.top=ydiv;      
      document.all("helpDiv2").style.display ="" ;
      posbodydown=document.body.offsetTop+document.body.offsetHeight ;
      if(ydiv+document.all("helpDiv2").offsetHeight+11 > posbodydown)
      {
        ydiv=ydiv-document.all(a_element).offsetHeight-document.all("helpDiv2").offsetHeight
        document.all("helpDiv2").style.top=ydiv;  
        document.all("helpDiv2").style.display ="" ;        
      }
      posbodyright=document.body.offsetLeft+document.body.offsetWidth ;
      if (xdiv+document.all("helpDiv2").offsetWidth > posbodyright)
      {
        xdiv=xdiv-document.all("helpDiv2").offsetWidth
        document.all("helpDiv2").style.left=xdiv;
        document.all("helpDiv2").style.display ="" ;       
      }      
      check=false ; 
    }  
  }  

