
brow = "";
versione = navigator.appVersion;
var bVer = parseInt(versione.substring(0,1));
bName = navigator.appName;
if (bName.substring(0,8) == "Netscape") {
if(bVer >= 4) brow = "n4";
else if(bVer == 3) brow = "n3";
else if(bVer == 2) brow = "n2";
}
else if (bName.substring(0,9) == "Microsoft") {
if(bVer >= 4) brow = "e4";
else brow = "e3";
}
function stampa() {
if ((brow == "e2")||(brow == "e3")||(brow == "n3")) {
alert('Con questo browser non si puņ stampare da codice');
}
else if (brow == "e4") {
top.focus();
setTimeout('top.print()',100);
}
else {
top.print();
}
}
function chiudi() {
top.close();
}

// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}
