<!-- Begin

/**
 * Dichiarazione
 */

var bw= new lib_bwcheck();				// Browser (needed)
var preload= new lib_preload();		// Preload (needed)


/**
 * Funzioni
 */
 
// Check the browser (needed)
function lib_bwcheck(){
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera5=this.agent.indexOf("Opera 5")>-1;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
	return this;
}

// The preload class (needed)
function lib_preload() {
	this.preload= false;
	this.start= false;
	this.ok= false;
	return this;
}

// Create new image with the src
function lib_createImage(src) {
	var img= new Image();
	img.src= src;
	return img;
}

// Get the layer for name (all browsers)
function getLayer(layerName) {
	var returnValue= null;
	if (layerName!="" && bw.bw) {
		if (bw.dom) returnValue= document.getElementById(layerName);
		else if (bw.ns4) returnValue= eval("document.layers" + "['" + layerName + "']");
		else returnValue= eval("document.all" + "['" + layerName + "']");
	}
	return returnValue;
}

// Get the layer's property (all browsers)
function getLayerProperty(layerName, propertyName) {
	var propertyValue= "";
	if (layerName!="" && propertyName!="" && bw.bw) {
		var styleRef= "";
		if (bw.ie || bw.opera5) styleRef= ".style";
		propertyValue= eval("getLayer(layerName)" + styleRef + "." + propertyName);
	}
	return propertyValue;
}

// Set the layer's property (all browsers)
function setLayerProperty(layerName, propertyName, propertyValue) {
	if (layerName!="" && propertyName!="" && propertyValue!="" && bw.bw) {
		var styleRef= "";
		if (bw.ie || bw.opera5) styleRef= ".style";
		eval("getLayer(layerName)" + styleRef + "." + propertyName + "=" + propertyValue);
	}
}

// Open new window
function openWindow(theURL,winName,features) {
  	newWindow= window.open(theURL,winName,features);
}

// Close new window
function closeWindow() {
	window.close();
}

// Show text on the status bar
function showStatus(statusText) {
	return top.status= statusText;
}

// End -->
