Newsgroup: it.comp.lang.javascript
Titolo: Only for who have patience :-)

 
 
Hello everybody,
This script is written for a webpages, but this script don't work with
Netscape 6.
I test it with other type of Netscape and other browser,
whio can help me to modified this script, with Netscape 6 the function
will not be running and don't visualized my layer menu.
Thanks to your help.
 
-------------------------------------------------
function BrowserCheck() {
 if (navigator.appName=="Netscape") 
this.name
 = "ns";
 else
  if (navigator.appName=="Microsoft Internet Explorer")
this.name
 = "ie";
  else 
this.name
 = navigator.appName;
 
 this.version = parseInt(navigator.appVersion);
 
 this.ns = (
this.name
 == "ns" && this.version >= 4);
 this.ns3 = (
this.name
 == "ns" && this.version == 3);
 this.ns4 = (
this.name
 == "ns" && this.version == 4);
 this.ns5 = (
this.name
 == "ns" && this.version == 5);
 
 
this.ie
 = (
this.name
 == "ie" && this.version >= 4);
 this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
 this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
 
 if (this.ie5) this.version = 5;
 
 //this.win = (navigator.userAgent.indexOf('Win')>0);
 //this.mac = (navigator.userAgent.indexOf('Mac')>0);
 
 this.dhtml = (this.ns||
this.ie
);
 //this.css = (this.ns||
this.ie
);
}
var is = new BrowserCheck(); 
 
if (is.dhtml) {
 if (is.ns) docLayers = document.layers;
 if (
is.ie
) docLayers = document.all;
}
 
// fix resize bug in NS4
if(is.ns) {
  var origWidth = innerWidth;
  var origHeight = innerHeight;
  onresize=repaint;
}
function repaint() {
  if (innerWidth!=origWidth || innerHeight!=origHeight) { 
    location.href = location.href; 
  }
}
 
var old = null;
 
function X_menu_on(name,l,t){
 if (old != null) X_menu_off(old);
 
 
document.images["icomenu"+name].src="images/site/menu_lingua_<%=asuff(L)%>.jpg"
 if (is.ns) {
  eval("document.NAV" + name + ".left ="+ l );
  eval("document.NAV" + name + ".top ="+ t);
  eval("document.NAV" + name + ".zIndex = 100");
  eval("document.NAV" + name + ".visibility = 'show'");
 }
 else {
  eval("document.all.NAV" + name + ".style.pixelLeft ="
+ l);
  eval("document.all.NAV" + name + ".style.pixelTop =" +
t);
  eval("document.all.NAV" + name + ".style.zIndex =
100");
  document.all("NAV" + name).style.visibility=
'visible'; 
 }
 old = name;
}
 
function Y_menu_on(name,l,t){
 if (old != null) X_menu_off(old);
 
document.images["icomenu"+name].src="images/site/menu_lingua_<%=asuff(L)%>.jpg"
 if (is.ns) {
  eval("document.NAV" + name + ".left ="+ l );
  eval("document.NAV" + name + ".top ="+ t);
  eval("document.NAV" + name + ".zIndex = 100");
  eval("document.NAV" + name + ".visibility = 'show'");
 }
 else {
  if (event.y > 131 ) {
   document.all("NAV" + name).style.visibility=
'visible'; 
  }
 }
 old = name;
}
 
function X_menu_off(name){
 document.images["icomenu1"].src =
"images/site/menu_lingua_<%=asuff(L)%>.jpg";
 if (is.ns) {
 /* eval("document.NAV" + name + ".visibility =
'hidden'");
  window.clearTimeout();
  eval("document.NAV" + name + ".zIndex = 0");*/
 }
 else if (
is.ie
) {
  document.all("NAV" + name).style.visibility =
'hidden';
  window.clearTimeout();
  eval("document.all.NAV" + name + ".style.zIndex = 0");
 }
}
 
 
 
---------------
    beep beep Roby
 
PS: togliere Le XXX per rispondere via mail.
PS: delete XXX to mail reply
 
==================
Cordiali Saluti
Roberto Valt
EDP
________________________
Xtend Italia Spa
Phone: 
+39 0471 50 20 21
Fax: 
+39 0471 50 17 34
Mobile: 
+39 338 2276343
Mail: 
robert...@xtend.it
Net: 
www.xtend.it
-------------------------
PGP key available
 
---------------
    beep beep Roby
PS: togliere Le XXX per rispondere via mail.
PS: delete XXX to mail reply

