function ShowContent(divId,ajaxIndex,url) {
	document.getElementById(divId).innerHTML = AjaxObjects[ajaxIndex].response;
	if(enableCache){
		jsCache[url] = 	AjaxObjects[ajaxIndex].response;
	}
	AjaxObjects[ajaxIndex] = false;
}

function Ajax(divId,url) {
	if(enableCache && jsCache[url]){
		document.getElementById(divId).innerHTML = jsCache[url];
		return;
	}	
	var ajaxIndex = AjaxObjects.length;
	document.getElementById(divId).innerHTML = '<img id="imagewait" src="/elementi/img/movewait.gif" alt="" />';
	AjaxObjects[ajaxIndex] = new sack();
	AjaxObjects[ajaxIndex].requestFile = url;
	AjaxObjects[ajaxIndex].onCompletion = function(){ ShowContent(divId,ajaxIndex,url); };
	AjaxObjects[ajaxIndex].runAJAX();
}

function setlinkblank() {
	linkObj = document.getElementById('corpo');
	if(linkObj){
		var linkLinkObj = linkObj.getElementsByTagName('A');
		for(var no=0;no<linkLinkObj.length;no++){
			if (linkLinkObj[no].hostname!="www.comune.sarre.ao.it"){
				var tempHref = linkLinkObj[no].href.toLowerCase();
				if (tempHref.indexOf('javascript')==-1 && tempHref.indexOf('mailto')==-1){
					linkLinkObj[no].target = '_blank';
				}
			}
		}
	}
}

function settransparent() {
	ulObj = document.getElementById('lingue');
	var anchorList = ulObj.getElementsByTagName('A');
	for(var no=0;no<anchorList.length;no++){
		var imageList = anchorList[no].getElementsByTagName('IMG');
		for(var ni=0;ni<imageList.length;ni++){
			imageList[ni].style.filter = 'alpha(opacity=50)';
			imageList[ni].style.opacity = 0.5;
		}
	}
}

function shimg(oImg, sAct) {
	var imageList = oImg.getElementsByTagName('IMG');
	if( sAct == "s" ) {
		imageList[0].style.filter = 'alpha(opacity=100)';
		imageList[0].style.opacity = 1;
	}else{
		imageList[0].style.filter = 'alpha(opacity=50)';
		imageList[0].style.opacity = 0.5;
	}
}

// =========================================================================================
// Funzione che apre una nuova finestra per visualizzare le immagini.
// Parametri: intImgNum = numero dell'immagine da visualizzare.
// Versione: 2.0a - 17/06/2002
//
function OpenQtVr(imageName, imageTitle) {

imageWidth = 600;
imageHeight = 265;

// Coordinate per centrare la nuova finestra
var xOffset = (window.screen.width - imageWidth)/2, yOffset = (window.screen.height - imageHeight)/2;

// Aggiusto le coordinate per situazioni particolari...
version=Math.round(parseFloat(navigator.appVersion) * 1000);

// Controllo se browser = konqueror
if(navigator.appName.indexOf("Konqueror")!=-1) { xOffset += 18; yOffset += 96; }

// Controllo se browser = Netscape6+ su mac
if(navigator.appName.indexOf("Netscape")!=-1) { if(version>=5000) { if(navigator.appVersion.indexOf("Mac")!=-1) { yOffset += 5; } } }

// Controllo se browser = IE su mac
if(navigator.appName.indexOf("Microsoft")!=-1) { if(navigator.appVersion.indexOf("Mac")!=-1) { xOffset -= 11; yOffset -= 11; } }

// Codice da inserire nella nuova finestra
var strWinCode = "<html><head>"
strWinCode += "<title>" + imageTitle + "</title>"
strWinCode += "</head><body topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'>"
strWinCode += "<a href='JavaScript:close()'>"
strWinCode += "<embed src='"+imageName+"' width='"+imageWidth+"' height='"+imageHeight+"' autoplay='true' loop='true' controller='true' playeveryframe='false' cache='false' bgcolor='#FFFFFF' kioskmode='false' targetcache='false' pluginspage='http://www.apple.com/quicktime/'>"
strWinCode += "</embed></a>"
strWinCode += "</body></html>"

// Apertura della nuova finestra.
var newWin = window.open('','','width='+imageWidth+',height='+imageHeight+',top='+yOffset+',left='+xOffset+',screenX='+xOffset+',screenY='+yOffset+',location=0,directories=0,status=no,menuBar=no,scrollBars=no,resizable=no');
newWin.document.open()
newWin.document.write(strWinCode)
newWin.document.close()
newWin.focus();
//newWin.moveTo(xOffset, yOffset)
}