
/**
 * Copyright 2003, IMTEAM www.imteam.it
 * QUESTO PROGRAMMA E' COPERTO DA COPYRIGHT E NON PUO' ESSERE COPIATO O
 * MODIFICATO (NEMMENO PARZIALMENTE) SENZA ESPLICITO CONSENSO DEL PROPRIETARIO.
 * NON PUO' ESSERE UTILIZZATO AL DI FUORI DEL PRODOTTO CON CUI E' STATO FORNITO.
 */
var mouseX = 0;
var mouseY = 0;

// determina area disponibile in larghezza dell'utente
function winGetWH(outer) {
	var d = new Array();
	d[0] = 1;
	d[1] = 1;
	if (self.innerHeight) {// all except Explorer 
		d[0] = self.innerWidth;
		if (outer) d[0]=self.outerWidth();
		d[1] = self.innerHeight;
		if (outer) d[0]=self.outerHeight();
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			// Explorer 6 Strict Mode
			d[0] = document.documentElement.clientWidth;
			d[1] = document.documentElement.clientHeight;
		} else {
			if (document.body) {// other Explorers
				d[0] = document.body.clientWidth;
				d[1] = document.body.clientHeight;
			}
		}
	}
	return d;
}
function winGetWidth() {
	return winGetWH()[0];
}

// determina area disponibile in altezza dell'utente
function winGetHeight() {
	return winGetWH()[1];
}

// get cursor location
function winCursorPosition(e) {
	if (typeof (is) == "undefined" || is === null) {
		return true;
	}
	if (is.ns4 || is.ns6) {
		mouseX = e.pageX;
		mouseY = e.pageY;
	} else {
		mouseX = event.clientX + document.body.scrollLeft;
		mouseY = event.clientY + document.body.scrollTop;
	}
}

// verifica se mouse su scrollbar
function winMouseOnScrollbars(mouseX, mouseY) {
	var barWidth = 20;
	if (mouseX > (winGetWidth() + document.body.scrollLeft)) {
		return true;
	}
	if (mouseY > (winGetHeight() + document.body.scrollTop)) {
		return true;
	}
	return false;
}
function winChangeImage(imgName, imgObj) {
	if (typeof (is) == "undefined" || is === null) {
		return true;
	}
	if (is.ns4) {
		if (this.document.imgName !== null) {
			eval("this.document." + imgName + ".src = \"" + imgObj + "\"");
		}
	}
	if (is.ie4 || is.ie5 || is.ns6) {
		if (document.images[imgName] != null) {
			document.images[imgName].src = imgObj;
		}
	}
	return true;
}

// determina posizione della finestra del browser
function winGetScreenPosition() {
	var d = new Array();
	d[0] = d[1] = 0;
	if (is.ns4 || is.ns6) {
		d[0] = self.screenX;
		d[1] = self.screenY;
	} else {
		if (is.ie4 || is.ie5) {
			d[0] = self.screenLeft;
			d[1] = self.screenTop;
		} else {
			if (document.body) { // other Explorers
			}
		}
	}
	d[0] = document.body.clientWidth;
	d[1] = document.body.clientHeight;
	return d;
}
function CheckPopup() {	
//xypos = winGetScreenPosition();
//xpos = xypos[0];
//ypos = xypos[1];
//xpos = xpos + winGetWidth()/2;
//ypos = ypos + winGetHeight()/2;
	xpos = 10000;
	ypos = 10000;
	winpopup = window.open("img/map/white.jpg", "CheckPopupWin", "height=10,width=10,screenX=" + xpos + ",screenY=" + ypos + ",left=" + xpos + ",top=" + ypos + ",alwaysLowered=true,dependent=true");
	if (winpopup == null) {
		alert("Le impostazioni del browser che stai utilizzando non consentono l'apertura di finestre pop up:\nper navigare correttamente sul sito, inserisci il sito attuale\ntra quelli a cui consenti la visualizzazione dei pop up.\n- per impostare Explorer: Opzioni Internet/Privacy\n- per impostare Netscape: Modifica/ Privacy & Security");
	} else {
		winpopup.close();
	}
	return winpopup;
}


