/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Philip Myers :: http://virtualipod.tripod.com/bookmark.html */

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}



/* EXPLORER MENU - Source: http://www.constile.org/DHTML/menu_ad_albero */
/* gestione del menu */
function mmenu(IDul,IDa) {
var menu = document.getElementById(IDul);
var display = menu.style.display;
menu.style.display = (display == "block") ? "none" : "block";
var lnk = document.getElementById(IDa);
var newCls = (lnk.getAttribute("class") == "isOpen") ? "isClosed" : "isOpen";
lnk.setAttribute("class",newCls);
}

/* inizializzazione del menu */
window.onload = function() {
var uls = document.getElementsByTagName("ul");
}



// Window properties  v1.1
// documentation: http://www.dithered.com/javascript/window_properties/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)


function getInnerWidth(win) {
  var winWidth;
  if (win.innerWidth) {
    winWidth = win.innerWidth;
  }
  else if (win.document.documentElement && win.document.documentElement.clientWidth) {
    winWidth = win.document.documentElement.clientWidth;
  }
  else if (document.body) {
    winWidth = win.document.body.clientWidth;
  }
  return winWidth;
}

function getInnerHeight(win) {
  var winHeight;
  if (win.innerHeight) {
    winHeight = win.innerHeight;
  }
  else if (win.document.documentElement && win.document.documentElement.clientHeight) {
    winHeight = win.document.documentElement.clientHeight;
  }
  else if (win.document.body) {
    winHeight = win.document.body.clientHeight;
  }
  return winHeight;
}

function getScrollTop(win) {
   var scrollTop = 0;
   if (win.pageYOffset) {
	   scrollTop = win.pageYOffset;
   }
   else if (win.document.documentElement && win.document.documentElement.scrollTop) {
	   scrollTop = win.document.body.scrollTop;
   }
   else if (win.document.body) {
      scrollTop = win.document.body.scrollTop;
   }
   return scrollTop;
}

function getScrollLeft(win) {
   var scrollLeft = 0;
   if (win.pageXOffset) {
	   scrollLeft = win.pageXOffset;
   }
   else if (win.document.documentElement && win.document.documentElement.scrollLeft) {
	   scrollLeft = win.document.body.scrollLeft;
   }
   else if (win.document.body) {
      scrollLeft = win.document.body.scrollLeft;
   }
   return scrollLeft;
}