
 xwin  = null; TimeoutID = -1;
  function FocusWin() { clearTimeout(TimeoutID); if (xwin!=null && !xwin.closed  && xwin.type!='undefined') xwin.focus(); 
 }


  function openSubwin(wname,src,w,h) {

     wpars='screenY='+(screen.height-h)/2+',screenX='+(screen.width-w)/2+',screenY=1,width='+w+',height='+h+',status=0,toolbar=0,location=0,menubar=0,directories=0,scrollbars=1,resizable=1,dependent=1,left='+(screen.width-w)/2+',top='+(screen.height-h)/2;
      xwin = top.open(src,wname,wpars);
      TimeoutID=setTimeout('FocusWin()',500);
  }

  xwinurl  = null; TimeoutID = -1;
  function FocusWinurl() { clearTimeout(TimeoutID); if (xwinurl!=null && !xwinurl.closed  && xwinurl.type!='undefined') xwinurl.focus(); 
 }

  function openSubwin2(wname,src,w,h) {

     wpars='screenY='+(screen.height-h)/2+',screenX='+(screen.width-w)/2+',screenY=1,width='+w+',height='+h+',status=0,toolbar=0,location=0,menubar=0,directories=0,scrollbars=1,resizable=1,dependent=1';
      xwinurl = top.open(src,wname,wpars);
      TimeoutID=setTimeout('FocusWinurl()',500);
  }
  function gotoquestion(f) {

	document.forms.selfcall.set_par.value="J";
	document.forms.selfcall.set_par2.value=f.value;
	document.forms.selfcall.submit();
  }

  callform=null;
  
  function showQlist() {
    openSubwin('qlist','qwindow.phtml',250,320);
  }

  function setFonts() {
	document.forms.selfcall.font.value=col;
	document.forms.selfcall.submit();	
  }

  function setcolor(col) {
    
	document.forms.selfcall.color.value=col;
	document.forms.selfcall.submit();	
  }
  pTimeout=-1;
  drilldowncond='';
  thepoint=new point(0,0);

   bName=navigator.appName, bVer=parseInt(navigator.appVersion),           

   NS4 = (bName == 'Netscape') && (bVer >= 4),                             
   IS4 = (bName == 'Microsoft Internet Explorer') && (bVer >= 4),          
   layerOK= NS4||IS4;                                                      

   if (bName=='Netscape' && bVer >= 5) netsc6=1; else netsc6=0;		

              if (layerOK) {                                                
                if (document.layers != null) {                              
                   layerRof='document.layers.'; styleSwitch='';             


		            } else if (document.all != null) {                          
                   layerRof='document.all.'; styleSwitch='.style';                 
		
                }        
		if (netsc6) {layerRof='document.getElementById("';styleSwitch='.style';}                                     
              }                                                                       


              function changeLayer(name,show) {                                       
                if (layerOK) {                                                        
                  if (show) x='visible'; else x='hidden';                          
		  if (netsc6) name=name+'")';
                  eval('if ('+layerRof+name+'!=null) '+layerRof+name+styleSwitch+'.visibility=\"'+x+'\"');            
                }                                                                     
              }                                                                       


              function moveLayer(name,ltop,lleft,mode) {                              
                if (layerOK) {                                                        
		  if (netsc6) name=name+'")';
                  eval('var layerstyle='+layerRof+name+styleSwitch);                  
                  var winw,winh,w,h;                                                  
                  if (NS4) {                                                          
                     winw=window.innerWidth-15; winh=window.innerHeight-15;           
                     Xofs=window.pageXOffset; Yofs=window.pageYOffset                 
                     if (!netsc6) {w=layerstyle.clip.width; h=layerstyle.clip.height;} else {w=layerstyle.width; h=layerstyle.height;}                
                  } else {                                                            
                     winw=document.body.clientWidth; winh=document.body.clientHeight; 
                     Xofs=document.body.scrollLeft; Yofs=document.body.scrollTop      
                     w=document.all[name].clientWidth; h=document.all[name].clientHeight;
                  }                                                                   

                  if (typeof mode != 'number') mode=3;
                  l=lleft-Xofs; t=ltop-Yofs;
                  if (l+w > winw) if (mode & 1) l=winw-w;                             
                                  else if (((mode & 4) == 0)&&(l > winw-30)) l=winw-30;
                  if (l < 0) l=5;                                                     
                  if (t+h > winh) if (mode & 2) t=winh-h;                             
                                  else if (((mode & 8) == 0)&&(t > winh-30)) t=winh-30;
                  if (t < 0) t=5;                                                     
                  layerstyle.top=Yofs+t;  
                  layerstyle.left=Xofs+l;                                             
                }                                                                     
              }                                                                       
              function getLayerForm(lname,fname) {                                    
                if (NS4) return document.layers[lname].document.forms[fname];         
                else     return document.forms[fname];                                
                alert(document.forms.length);					      
              }                                                                       

              function point(x,y) {this.x=x; this.y=y;}                               

              function getCurrPoint(e,p) {                                            
                if (typeof e.clientX =='number' && !netsc6) {                                    
                   p.x=e.clientX+document.body.scrollLeft;                            
                   p.y=e.clientY+document.body.scrollTop;                             
                } else  { p.x=e.pageX; p.y=e.pageY; }                                 
                return true;                                                          
              }                                                                       

  function showpopup(e,cond) {
    var show=(typeof e == 'object');


    if (typeof clear_T_pops!='undefined') clear_T_pops();
    if (typeof clear_all_pops!='undefined' && cond[0]!='l') clear_all_pops();
    if (typeof clear_all_pops_lab!='undefined' && cond[0]=='l') clear_all_pops_lab();

    if (show) {
      clearTimeout(pTimeout);
      getCurrPoint(e,thepoint);
      moveLayer(cond,thepoint.y+5,thepoint.x,1);

    } 

    changeLayer(cond,show);

  }

    function emptyfunc() {

    }

  function hidepop(cond) {

	pTimeout=setTimeout('showpopup(0,"'+cond+'")',0);

  }
  var se_whole_loaded=0;

