<!--

var preloadFlag = true;

function goto_URL(object)
{
	var myhost = window.parent.location.hostname;
	var value = object.options[object.selectedIndex].value;

	if (value == '') return;
	self.location.href = "http://" + myhost + value;
}

function goto_POPUP(object,xs,ys)
{
	var myhost = window.parent.location.hostname;
	var value = object.options[object.selectedIndex].value;

	if (value == '') return;
	html = "http://" + myhost + value;
	popup(html, xs, ys);
}

function last_URL(idx)
{
	var obj = document.forms[idx].Argomenti;

	goto_URL(obj);
}	

function preloadImg(src) {

	if (src.indexOf("preload/", 1) > -1 || src.indexOf("bottoni/", 1) > -1) {
		img = new Image();
		img.src = src;
	}
}
	
function preloadImages() {

	if (preloadFlag) {
		if (document.images) {
			for (var i=0; i<document.images.length; i++)
				preloadImg(document.images[i].src);

			preloadFlag = false;
		}
	}
}


function toCenter(xs, ys) {

	x = (screen.availWidth - xs) / 2;
	y = (screen.availHeight - ys) /2;

	self.resizeTo(xs,ys);
	self.moveTo(x,y);
}

function popup(html, xs, ys) {
	opt  = "alwaysRaised,toolbar=no,location=no,directories=no,";
	opt += "status=no,menubar=no,scrollbars=no,resizable=no,";
	opt += "width=" + xs + ",height=" + ys;

	x    = (screen.availWidth - xs) / 2;
	y    = (screen.availHeight - ys) /2;

	if (self.name != "PopUp") {
		win = window.open(html, "PopUp", opt);

		if (!win.opener) win.opener = self; /* WA: NN v2 */

		win.resizeTo(xs,ys);
		win.moveTo(x,y);
		win.focus();
	}
	else {
		self.location = html;
		self.resizeTo(xs,ys);
		self.moveTo(x,y);
	}
}


function popupScroll(html, xs, ys) {
	opt  = "alwaysRaised,toolbar=no,location=no,directories=no,";
	opt += "status=no,menubar=no,scrollbars=yes,resizable=no,";
	opt += "width=" + xs + ",height=" + ys;

	x    = (screen.availWidth - xs) / 2;
	y    = (screen.availHeight - ys) /2;

	if (self.name != "PopUpS") {
		win = window.open(html, "PopUpS", opt);

		if (!win.opener) win.opener = self; /* WA: NN v2 */

		win.resizeTo(xs,ys);
		win.moveTo(x,y);
		win.focus();
	}
	else {
		self.location = html;
		self.resizeTo(xs,ys);
		self.moveTo(x,y);
	}
}


// -->

