function initScrollLayer() {
  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
  // if horizontal scrolling, id of element containing scrolling content (table?)
  wndo[0] = new dw_scrollLayer('wn', 'lyr1');
  
  // bSizeDragBar set true by default (explained at www.dyn-web.com/dhtml/scroll/ )
  // wndo.bSizeDragBar = false;
  
  // arguments: dragBar id, track id, axis ("v" or "h"), x offset, y offset
  // (x/y offsets of dragBar in track)
  wndo[0].setUpScrollbar("dragBar", "track", "v", 1, 1);
  
  // pass id's of any wndo's that scroll vertically inside tables
  // i.e., if you have 3 (with id's wn1, wn2, wn3): GeckoTableBugFix('wn1', 'wn2', 'wn3');
  GeckoTableBugFix('wn'); // only needed for scrolling vertically in tables
}
var wndo = [];

// Necessary to avoid errors before page loaded 
function dw_startScroll(num, dir, sp) {
  if ( wndo[num] && wndo[num].startScroll ) wndo[num].startScroll(dir, sp);
}

function dw_stopScroll(num) {
  if ( wndo[num] && wndo[num].stopScroll ) wndo[num].stopScroll();
}

function dw_loadLayer(num, id, cntId) {
  if ( wndo[num] && wndo[num].loadLayer ) wndo[num].loadLayer(id, cntId);
}


function confirmSubmit(form){
	if(confirm("Sicuro di voler continuare?")){
		form.submit();
	}
}


function openPopup(theURL,winName,features, position) {
	if(position==true){
		var winY = 0;
		var winX = 0;
		features += ", top=" + winY +",left=" + winX;
	}
  window.open(theURL,winName,features);
}

function showElement(id){
	var el = document.getElementById(id);
	el.style.visibility = "visible";
}

function hideElement(id){
	var el = document.getElementById(id);
	el.style.visibility = "hidden";
}

