home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 September / Chip_2004-09_cd1.bin / chplus / navrcholu / navrcholu_soubory / nv_global.js < prev    next >
Text File  |  2004-08-01  |  2KB  |  72 lines

  1. var nv_mn_show_timeout=100;
  2. var nv_mn_hide_timeout=300;
  3. var nv_mn_active=0;
  4. var nv_mn_timeout;
  5.  
  6. function get_element(name){
  7.     if(document.all){
  8.         return document.all[name];
  9.     }else{
  10.         return document.getElementById(name);
  11.     }
  12. }
  13. function nv_mn_parse_id(id){
  14.     var out=Array();
  15.     var pattern=/-(\w+-\d+-\d+)$/;
  16.     var result;
  17.     if((result=pattern.exec(id))!=null){
  18.         return result[1];
  19.     }else{
  20.         return false;
  21.     }
  22. }
  23. function nv_mn_unregister(id){
  24.     if(nv_mn_active){
  25.         var element=get_element("mn-d-"+nv_mn_active);
  26.         if(element){
  27.             element.style.display="none";
  28.         }
  29.         var de_element=get_element("mn-de-"+nv_mn_active);
  30.         if(de_element.className!=""){
  31.             de_element.className="";
  32.         }
  33.         nv_mn_active=0;
  34.     }
  35. }
  36. function nv_mn_register(id){
  37.     nv_mn_active=nv_mn_parse_id(id);
  38.     var element=get_element("mn-d-"+nv_mn_active);
  39.     if(element){
  40.         element.className="on";
  41.         element.style.display="block";
  42.     }
  43.     var de_element=get_element("mn-de-"+nv_mn_active);
  44.     if(de_element.className!="on"){
  45.         de_element.className="on";
  46.     }
  47. }
  48. function nv_mn_ov(self){
  49.     if(nv_mn_timeout){
  50.         clearTimeout(nv_mn_timeout);
  51.     }
  52.     nv_mn_timeout=setTimeout("nv_mn_unregister(\""+self.id+"\"); nv_mn_register(\""+self.id+"\");",nv_mn_show_timeout);
  53. }
  54. function nv_mn_ou(self){
  55.     if(nv_mn_timeout){
  56.         clearTimeout(nv_mn_timeout);
  57.     }
  58.     nv_mn_timeout=setTimeout("nv_mn_unregister(\""+self.id+"\");",nv_mn_hide_timeout);
  59. }
  60. function nv_ow(path,name,width,height){
  61.     var left=Math.floor((screen.width-width)/2)
  62.     var top=Math.floor((screen.height-height)/2)
  63.     var newwindow=window.open(path,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+width+',height='+height+',top='+top+',left='+left);
  64.     return(typeof(newwindow)=="object")?true:false;
  65. }
  66. function nv_ow_help(path){
  67.     return !nv_ow(path,"nv_help",500,300);
  68. }
  69. function nv_ow_hc(path){
  70.     return !nv_ow(path,"nv_htmlcode",500,300);
  71. }
  72.