// variabile per il test di apertura della finestra opener di viewer, stereoviewer, streaming audio video, glossaryvar motherOpened = true;// GESTIONE DELLA FINESTRA ESTERNA VIEWERvar imgWin;var imgWinOpened = false;function openImgWindow(wurl, frameurl, wn, imgName, imgWidth, imgHeight) {	if (!imgWinOpened) {		imgWinOpened = true;		winOpts = "toolbar=0,location=0,resizable=1,status=1,menubar=1,width=600,height=400";		winURL = wurl;		winName = wn;		window.imageName = imgName;		window.imageWidth = imgWidth;		window.imageHeight = imgHeight;		imgWin = window.open(winURL,winName,winOpts);//		imgWin.focus();	} else {		if (imgWin.imgOpened == null) {			imgWinOpened = true;			winOpts = "toolbar=0,location=0,resizable=1,status=1,menubar=1";			winURL = wurl;			winName = wn;			window.imageName = imgName;			window.imageWidth = imgWidth;			window.imageHeight = imgHeight;			imgWin = window.open(winURL,winName,winOpts);//			imgWin.focus();		} else {			imgWin.setImage(imgName);			imgWin.setImageDim(imgWidth, imgHeight);			imgWin.updateImageData(frameurl);			imgWin.loadImage(imgWin.getImage(), 100);			imgWin.focus();			imgWin.frames['image'].history.go(0);		}		}	//	alert(imgWin.imageName + "  iw = " + imgWin.imageWidth + "  ih = " + imgWin.imageHeight);}// GESTIONE DELLA FINESTRA ESTERNA STEREOVIEWERvar stereoimgWin;var stereoimgWinOpened = false;function openStereoImgWindow(wurl, frameurl, wn, imgName_l, imgName_r, imgWidth_s, imgHeight_s) {	if (!stereoimgWinOpened) {		stereoimgWinOpened = true;		winOpts = "toolbar=0,location=0,resizable=1,status=1,menubar=1,width=600,height=400";		winURL = wurl;		winName = wn;		window.imageName_l = imgName_l;		window.imageName_r = imgName_r;		window.imageWidth_s = imgWidth_s;		window.imageHeight_s = imgHeight_s;		stereoimgWin = window.open(winURL,winName,winOpts);//		stereoimgWin.focus();	} else {//		if (stereoimgWin.stereoimgWinOpened == null) {		if (stereoimgWin.stereoimgOpened == null) {			stereoimgWinOpened = true;			winOpts = "toolbar=0,location=0,resizable=1,status=1,menubar=1";			winURL = wurl;			winName = wn;			window.imageName_l = imgName_l;			window.imageName_r = imgName_r;			window.imageWidth_s = imgWidth_s;			window.imageHeight_s = imgHeight_s;			stereoimgWin = window.open(winURL,winName,winOpts);			stereoimgWin.focus();		} else {			stereoimgWin.setImageLeft(imgName_l);			stereoimgWin.setImageRight(imgName_r);			stereoimgWin.setImageDim(imgWidth_s, imgHeight_s);			stereoimgWin.updateImageData(frameurl);			stereoimgWin.loadImage(stereoimgWin.getImageLeft(), stereoimgWin.getImageRight(), 100);			stereoimgWin.focus();			stereoimgWin.frames['image_l'].history.go(0);			stereoimgWin.frames['image_r'].history.go(0);		}		}	//	alert("iw = " + stereoimgWin.imageWidth + "  ih = " + stereoimgWin.imageHeight);}// GESTIONE DELLA FINESTRA ESTERNA STREAMING AUDIO VIDEOvar streamWin;var streamWinOpened = false;function openStreamWindow(wurl, frameurl, wn, movName, strName, strWidth, strHeight, strDuration) {	if (!streamWinOpened) {		streamWinOpened = true;		winOpts = "toolbar=0,location=0,resizable=1,status=1,menubar=1,width=600,height=400";		winURL = wurl;		winName = wn;		window.movieName = movName;		window.streamName = strName;		window.streamWidth = strWidth;		window.streamHeight = strHeight;		window.streamDuration = strDuration;		streamWin = window.open(winURL,winName,winOpts);//		streamWin.focus();	} else {		if (streamWin.imgOpened == null) {			streamWinOpened = true;			winOpts = "toolbar=0,location=0,resizable=1,status=1,menubar=1";			winURL = wurl;			winName = wn;			window.movieName = movName;			window.streamName = strName;			window.streamWidth = strWidth;			window.streamHeight = strHeight;			window.streamDuration = strDuration;			streamWin = window.open(winURL,winName,winOpts);//			streamWin.focus();		} else {			streamWin.setMovie(movName);			streamWin.setStreamAV(strName);			streamWin.setStreamAVDim(strWidth, strHeight);			streamWin.setStreamAVDuration(strDuration);			streamWin.updateStreamAVData(frameurl);			streamWin.loadStreamAV(streamWin.getMovie(), streamWin.getStreamAV());			streamWin.focus();			streamWin.frames['stream'].history.go(0);		}	}	//	alert(streamWin.streamName + "  sw = " + streamWin.streamWidth + "  sh = " + streamWin.streamHeight);}// GESTIONE DELLA FINESTRA ESTERNA GLOSSARYvar glossaWin;var glossaWinOpened = false;var glossaURL = "";function openGlossaWindow(wurl, wn) {//	alert("glossaWinOpened = " + glossaWinOpened);	if (!glossaWinOpened) {		glossaWinOpened = true;		winOpts = "toolbar=0,location=1,resizable=1,scrollbars=1,status=1,menubar=1,width=512,height=384";		winURL = wurl;		winName = wn;		glossaWin = window.open(winURL,winName,winOpts);//		glossaWin.focus();	} else {//		alert("" + glossaWin.glossaOpened);		if (propertyExist(glossaWin.glossaOpened) && (typeof(glossaWin.glossaOpened)=="boolean")) {			if (glossaURL != wurl) {//				alert(glossaURL + " " + wurl);				glossaWin.location = wurl;			}			glossaWin.glossaOpened = true;			glossaWin.focus();		} else {			glossaWinOpened = true;			winOpts = "toolbar=0,location=1,resizable=1,scrollbars=1,status=1,menubar=1,width=512,height=384";			winURL = wurl;			winName = wn;			glossaWin = window.open(winURL,winName,winOpts);			glossaWin.focus();		}	}/*	} else {		glossaWinOpened = true;		winOpts = "toolbar=1,location=1,resizable=1,status=1,menubar=1";		winURL = wurl;		winName = wn;		glossaWin = window.open(winURL,winName,winOpts);		glossaWin.focus();	}*/}// GESTIONE DI TUTTE LE FINESTRE ESTERNE (VIEWER, STEREOVIEWER, STREAMING AUDIO VIDEO, GLOSSARY)function winClosed(w) {	if (w=="stereoimg") {		stereoimgWinOpened = false;	} else if (w=="stream") {		streamWinOpened = false;	} else if (w=="glossa") {		glossaWinOpened = false;	} else {		imgWinOpened = false;	}}function closeWindow(mother) {	var win = typeof(imgWin);	if (win == "object") {		if (imgWin.imgOpened == null) {			;		} else {			imgWin.close();		}	}		win = typeof(stereoimgWin);	if (win == "object") {		if (stereoimgWin.stereoimgOpened == null) {			;		} else {			stereoimgWin.close();		}	}		win = typeof(streamWin);	if (win == "object") {		if (streamWin.streamOpened == null) {			;		} else {			streamWin.close();		}	}		win = typeof(glossaWin);	if (win == "object") {		if (glossaWin.glossaOpened == null) {			;		} else {			glossaWin.close();		}	}		if (mother == true) self.close();}var xw = "Apri una nuova finestra con il visore di immagini.";var svxw = "Apri una nuova finestra con lo stereovisore di immagini (occhi paralleli).";var svxxw = "Apri una nuova finestra con lo stereovisore di immagini (occhi incrociati).";var savxw = "Apri una nuova finestra con la clip audio-video in streaming QuickTime.";var gxw = "Apri una nuova finestra con la voce del glossario.";var iw = 768;var ih = 512;var iw4 = 768;var ih3 = 576;/*function showStatus(s) {	parent.status = s;}*/function getContentURL(fileName, relativePath) {	var contentURL = "";		if((typeof(relativePath) != "undefined") && (relativePath.length > 0)) {		counter = 0;		start = 0;		tof = true;		while(tof) {			offset = relativePath.indexOf("../", start);			if(offset == -1) {				tof = false;			} else {				start += 3;				counter++;			}		}		relativePath = relativePath.substring(start, relativePath.length);				var oldURL = document.location.toString();		offset = oldURL.lastIndexOf("/");		if(offset != -1) { // if "/" exists			contentURL = oldURL.substring(0, offset);			for(var i = 0; i < counter; i++) {				offset = contentURL.lastIndexOf("/");				if(offset != -1) {					contentURL = contentURL.substring(0, offset);				}			}			contentURL = contentURL + "/" + relativePath;		}	}		contentURL += fileName;//	alert(contentURL);	return contentURL;}function propertyExist(objProp) {	var testProp = "" + objProp;	if(testProp == "undefined")		return false;	else		return true;}