var tab1href = "";var tab2href = "";var tab3href = "";var tab4href = "";var tab5href = "";function setTabsRef(relativePath) {	if((typeof(relativePath) != "undefined") && (relativePath != "")) {		tab1href = "javascript:loadLastFrameset('1', getContentURL('monument.html', '" + relativePath + "'))";		tab2href = "javascript:loadLastFrameset('2', getContentURL('city.html', '" + relativePath + "'))";		tab3href = "javascript:loadLastFrameset('3', getContentURL('bsc.html', '" + relativePath + "'))";		tab4href = "javascript:loadLastFrameset('4', getContentURL('search.html', '" + relativePath + "'))";		tab5href = "javascript:loadLastFrameset('5', getContentURL('thinkstereo.html', '" + relativePath + "'))";	} else {		tab1href = "javascript:loadLastFrameset('1', 'monument.html')";		tab2href = "javascript:loadLastFrameset('2', 'city.html')";		tab3href = "javascript:loadLastFrameset('3', 'bsc.html')";		tab4href = "javascript:loadLastFrameset('4', 'search.html')";		tab5href = "javascript:loadLastFrameset('5', 'thinkstereo.html')";	}}function navigatorTest() {	document.write("Caricamento di un secondo file.js esterno.");		document.write("<P>The value of navigator.appCodeName is: " + navigator.appCodeName);	document.write("<P>The value of navigator.appName is: " + navigator.appName);	document.write("<P>The value of navigator.appVersion is: " + navigator.appVersion);	document.write("<P>The value of navigator.userAgent is: " + navigator.userAgent);}function println(s) {	document.write(s, "<BR>");}// Sets cookie values. Expiration date is optional// Tokens number and index are optional; they require if cookie value is a collection of tokens// Any token starts with "@#@#", where "#" sign is an integer 0 to tokens number - 1function setCookie(name, value, expire, tokensNb, index) {	var newValue = value;		// cookie is a collection of tokens	if((typeof(tokensNb) != "undefined") && (typeof(index) != "undefined")) {		if((tokensNb > 0) && (index >= 0)) {			if(index < tokensNb) {				newValue = getTokens(name, value, tokensNb, index);//				alert("" + newValue);			} else {				newValue = "";			}		}	}		document.cookie = name + "=" + escape(newValue) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) + "; path=/";//	document.writeln(document.cookie);}function getTokens(name, value, tokensNb, index) {	tokens = getCookie(name);		if((typeof(tokens) != "undefined") && (tokens.length > 0)) {		// do nothing	} else {		tokens = "";		for(var i = 0; i < tokensNb; i++) {			str = "@" + i + "@" + i;			tokens += str;		}	}		str1 = "@" + index + "@" + index;	start = tokens.indexOf(str1) + 4;	if(index < tokensNb - 1) {		str2 = "@" + (index + 1) + "@" + (index + 1);		end = tokens.indexOf(str2);	} else {		end = tokens.length;	}		newTokens = tokens.substring(0, start) + value + tokens.substring(end, tokens.length);	return newTokens;}function getCookie(Name) {	var search = Name + "=";	if(document.cookie.length > 0) { // if there are any cookies		offset = document.cookie.indexOf(search);		if(offset != -1) { // if cookie exists			offset += search.length;			// set index of beginning of value			end = document.cookie.indexOf(";", offset);			// set index of end of cookie value			if(end == -1) {				end = document.cookie.length;			}			return unescape(document.cookie.substring(offset, end));		}	}}function controlIfCookieTokenIsRight(name, tokensNb, index) {	tokens = getCookie(name);	var navbarURL = document.location.toString();	var partialPath = navbarURL;	offset = navbarURL.lastIndexOf("/");	if(offset != -1) { // if "/" exists		partialPath = navbarURL.substring(0, offset);	}//	alert("partialPath: " + partialPath);		var searchedToken = getCookieToken(name, index);//	alert("searchedToken: " + searchedToken);	offset = searchedToken.indexOf(partialPath);	if(offset == -1) { // cookie token is wrong//		alert("cookie token is wrong");		setCookie(name, "", null, tokensNb, index);//		for(var i = 1; i < tokensNb; i++) {//			setCookie(name, "", null, tokensNb, i);//		}	}}function getCookieToken(name, index) {	tokens = getCookie(name);	searchedToken = "";		if((typeof(tokens) != "undefined") && (tokens.length > 0)) {		str1 = "@" + index + "@" + index;		start = tokens.indexOf(str1) + 4;		index2 = parseInt(index, 10) + 1;		str2 = "@" + index2 + "@" + index2;		end = tokens.indexOf(str2, start);		if(end == -1) {			end = tokens.length;		}//		alert("Start: " + start + ". End: " + end);				if(start != -1) {			searchedToken = tokens.substring(start, end);		}//		document.writeln("Start: " + searchedToken);	}	//	alert("Last content: " + searchedToken);//	document.writeln("Last content: " + searchedToken);	return searchedToken;}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 loadLastFrameset(type, defaultPage, replaceURL) {	var framesetURL = "";	if(type == "1") {		framesetURL = getCookie("abcMonCookie");	} else if(type == "2") {		framesetURL = getCookie("abcCityCookie");	} else if(type == "3") {		framesetURL = getCookie("abcBSCCookie");	} else if(type == "4") {		framesetURL = getCookie("abcSearchCookie");	} else if(type == "5") {		framesetURL = getCookie("abcTSCookie");	}		if((typeof(framesetURL) != "undefined") && (framesetURL.length > 0)) {		top.location = framesetURL;	} else {		if(typeof(defaultPage) != "undefined") {			top.location = defaultPage;		}	}		if(replaceURL) {		document.location.replace(top.location);	// consente il funzionamento del pulsante "back" del browser	}	//	alert("Last Frameset:  " + top.location);}function loadLastContent(type, subtype, defaultPage) {	var oldURL = document.location.toString();//	alert(oldURL);	offset = oldURL.lastIndexOf("/");	if(offset != -1) { // if "/" exists		oldURL = oldURL.substring(0, offset + 1) + defaultPage;	}	//	alert("Last Content:  " + oldURL);	var contentURL = "";	if(type == "1") {		controlIfCookieTokenIsRight("abcMonContentCookie", 7, parseInt(subtype));		contentURL = getCookieToken("abcMonContentCookie", subtype);	} else if(type == "2") {		controlIfCookieTokenIsRight("abcCityContentCookie", 9, parseInt(subtype));		contentURL = getCookieToken("abcCityContentCookie", subtype);	} else if(type == "3") {		contentURL = getCookieToken("abcBSCContentCookie", subtype);	} else if(type == "4") {		contentURL = getCookieToken("abcSearchContentCookie", subtype);	} else if(type == "5") {		contentURL = getCookieToken("abcTSContentCookie", subtype);	}		if((typeof(contentURL) == "undefined") || (contentURL.length == 0)) {		contentURL = oldURL;	}	//	alert("Last Content:  " + contentURL);//	document.location = contentURL;	document.location.replace(contentURL);	// consente il funzionamento del pulsante "back" del browser//	document.writeln("Last content: " + contentURL);}function loadInFrame(path) {	if(parent.frames.length == 0) {//		alert("no frame");		var filename = "" + path;		var contentURL = "";		if((typeof(path) != "undefined") && (path.length > 0)) {			contentURL += filename;		} else {			contentURL += "index.html";		}		parent.document.location = contentURL;		//		var standardContentURL = getContentURL(contentURL);//		document.location = standardContentURL;//		document.location.replace(standardContentURL);	// consente il funzionamento del pulsante "back" del browser		//		alert("URL: " + standardContentURL);//	} else {//		alert("frame");	}}var prev = "Torna indietro";var next = "Vai avanti";function goNext() {	if(top.frames.length == 0) {//		alert("no frames");		history.forward();	} else {//		alert("frames");		top.frames['content'].history.forward();	}}function goPrev() {	if(top.frames.length == 0) {//		alert("no frames");		history.back();	} else {//		alert("frames");		top.frames['content'].history.back();	}}function showStatus(s) {	parent.status = s;}