// clanza@imteam.it - versione 2.0 - 2002/10/04

function init(){
	is = new BrowserCheck();
	return true;
}

function BrowserCheck() {
	this.ns4 = (document.layers);
	this.ns6 = (!document.all && document.getElementById);
	this.ie4 = (document.all && !document.getElementById);
	this.ie5 = (document.all && document.getElementById);
	return true;
}

function showObject(obj) {
  	if (is.ns4) {
		this.layer = window.document[obj];
		this.layer.visibility = "show";
	}
  	if (is.ie4) {
		this.element = window.document.all[obj];
		this.style = this.element.style;
		this.style.visibility = "visible";
	}
  	if (is.ns6 || is.ie5) {
		this.element = document.getElementById(obj);
		this.style = this.element.style;
		this.style.visibility = "visible";
	}
	return true;
}

function hideObject(obj) {
  	if (is.ns4) {
		this.layer = window.document[obj];
		this.layer.visibility = "hide";
	}
  	if (is.ie4) {
		this.element = window.document.all[obj];
		this.style = this.element.style;
		this.style.visibility = "hidden";
	}
  	if (is.ns6 || is.ie5) {
		this.element = document.getElementById(obj);
		this.style = this.element.style;
		this.style.visibility = "hidden";
	}
	return true;
}

function resetObject(obj, val_height) {
  if (is.ns4) {
		this.layer = window.document[obj];
		this.layer.height = val_height;
	}
  	if (is.ie4) {
		this.element = window.document.all[obj];
		this.style = this.element.style;
		this.style.height = val_height;
	}
  	if (is.ns6 || is.ie5) {
		this.element = document.getElementById(obj);
		this.style = this.element.style;
		this.style.height = val_height;
	}
	return true;
}

function setBody(layer,obj,body) {
  //netscape 4.x
  if (is.ns4) {
		this.layer = window.document[obj];
		for(var i = 0; i < body.length; i++) {
			this.layer.document.writeln(body[i]);
    }
		this.layer.document.close();
	}
  //internet explorer 4.x
  if (is.ie4) {
		this.element = window.document.all[obj];
    this.element.innerHTML = body;
  }
  //internet explorer 5.x e 6.x
  //netscape 6.x e 7.x
  if (is.ie5 || is.ns6) {
	this.element = document.getElementById(obj);
    this.element.innerHTML = body;
  }
	return true;  
}

function changeImage(imgName,imgObj,obj) {
  //netscape 4.x
  if (is.ns4) {
    this.layer = window.document[obj];
    this.layer.document.images[imgName].src = imgObj;
//old//		eval("document.images[" + imgName + "].src = '" + imgObj + "'");
	}
  //internet explorer 4.x
  if (is.ie4) {
    document.images[imgName].src = imgObj;
  }
  //internet explorer 5.x e 6.x
  //netscape 6.x e 7.x
  if (is.ie5 || is.ns6) {
    document.images[imgName].src = imgObj;
  }
  return true; 
}

function openPopUp(Url, params){
  var strOpen = new String("");
  strOpen = strOpen.concat("channelmode=no,directories=no,location=no,menubar=no,resizable=yes,status=no,,titlebar=no,scrollbars=yes,width=800,height=600");
  wPopUp = window.open(Url, '_new', strOpen);
  wPopUp.focus();
}

function openPopUpNews(Url, params){
  var strOpen = new String("");
  strOpen = strOpen.concat("channelmode=no,directories=no,location=no,menubar=no,resizable=no,status=no,,titlebar=no,scrollbars=yes,width=800,height=600");
  wPopUp = window.open(Url, 'DettNews', strOpen);
  wPopUp.focus();
}

function getUrlFromSelect(selectObject){
  var url = selectObject.options[selectObject.selectedIndex].value;
  window.location = url;
}

function getUrlFromSelect_composed(selectObject,secondSelectObject){
  var url = selectObject.options[selectObject.selectedIndex].value;
  var param = secondSelectObject.options[secondSelectObject.selectedIndex].value;
  window.location = url + param;
}

function printpage()
{
 window.print();
}
