//                ((( Daniele Marchesini email: skylark@iol.it  İ 2003-2005  All Rights reserved )))
//ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

// pages/ita/sezione_1/sottosezione_1_1/nomePagina.html
/*
urlElements
			[0]pages
			[1]ita
			[2]sezione_1
			[3]sezione_1_1
			[3]nomePagina.html ->	[0]terza
									[1]html
*/

// restituisce linguaggio, sezione, nomePagina e percorso per la root del file html corrente o del file passato come argomento tramite il suo URL
function localizePage(pageURL){
// Copyright 2004 Daniele Marchesini All rights reserved.
	if(!pageURL)
		var pageURL = top.location.href;

	siteFolderName = escape(siteFolderName); // utile nel caso in cui vi siano spazi bianchi all'interno del nome della cartella

	var localURL = pageURL.substring(pageURL.lastIndexOf(siteFolderName)+siteFolderName.length+1, pageURL.length);

	var urlElements = localURL.split('/');

	var toRoot = '';
	for(i=0;i<urlElements.length-1; i++)
		toRoot += '../';

	var pageName = urlElements[urlElements.length-1].split('.')[0];

	var langName = '';
	var sectionName = '';
	var subSectionName = '';
	var subSubSectionName = '';

	switch(urlElements.length){
		case 3:
			subSubSectionName = '';
			subSectionName = '';
			sectionName = '';
			langName = urlElements[urlElements.length-2];
		break;
		case 4:
			subSubSectionName = '';
			subSectionName = '';
			sectionName = urlElements[urlElements.length-2];
			langName = urlElements[urlElements.length-3];
		break;
		case 5:
			subSectionName = urlElements[urlElements.length-2];
			sectionName = urlElements[urlElements.length-3];
			langName = urlElements[urlElements.length-4];
		break;
		case 6:
			subSubSectionName = urlElements[urlElements.length-2];
			subSectionName = urlElements[urlElements.length-3];
			sectionName = urlElements[urlElements.length-4];
			langName = urlElements[urlElements.length-5];
		break;
	}

	var pageData = new Array();
	pageData['localURL'] = localURL;
	pageData['toRoot'] = toRoot;
	pageData['langName'] = langName;
	pageData['sectionName'] = sectionName;
	pageData['subSectionName'] = subSectionName;
	pageData['subSubSectionName'] = subSubSectionName;
	pageData['pageName'] = pageName;
	pageData['pageExtension'] = urlElements[urlElements.length-1].split('.')[1];

/*
	var r = '';
	for(j in pageData){
		r += '[ '+ j +' ] : [ '+ pageData[j] +' ]\n';
	}

	alert(r);
*/
	return pageData;
}

// -----------------------------------------------------------------------------------------------

/* azioni necessarie per inizializzare la pagina */
function init(pageURL){
// Copyright 2004 Daniele Marchesini All rights reserved.
	if(!pageURL)
		var pageURL = top.location.href;
	document.pageProperties = localizePage(pageURL);
/*
	var r = '';
	for(i in document.pageProperties){
		r += '[ '+ i +' ] : [ '+ document.pageProperties[i] +' ]\n';
	}

	alert(r);
*/
}

// -----------------------------------------------------------------------------------------------

function old_viewDiapo(diapoURL,title,description,layerText,l,t,w,h){
// İ 2004  Daniele Marchesini All Rights reserved
// apre una nuova finestra del browser e scrive nel suo document una pagina HTML contenente l'immagine e la didascalia
// se non si desidera inserire la didascalia, è sufficiente lasciare vuoto il parametro 'layerText'
	var left;
	var top;
	(viewDiapo.arguments[4])?left=l:left=5;
	(viewDiapo.arguments[5])?top=t:top=5;
	(viewDiapo.arguments[6])?width=w:width=60;
	(viewDiapo.arguments[7])?height=h:height=40;
	var opacity = 60;
	var opacityStyle;
	(navigator.appName=='Netscape')?opacityStyle='-moz-opacity:'+opacity+'%;':opacityStyle='filter:alpha(opacity='+opacity+');';

	var htmlSettings	=	'<html>\n<head>\n<title>'+title+'</title>\n';
	htmlSettings		+=	'<style type="text/css">\nbody{\nmargin: 0px;\npadding: 0px;\nbackground-color: #efefef;\ncolor: #333333;\nfont-family: verdana, arial, helvetica, sans-serif;\nfont-size: 12px;\noverflow: hidden;\n}\n';
	htmlSettings		+=	'img{\nmargin: 0px;\nborder: 0px #000000 solid;\n}\n';
	htmlSettings		+=	'div{\nposition: absolute;\ntop: '+top+'px;\nleft: '+left+'px;\nz-index: 2;\nmargin: 5px;\npadding: 2px;\nbackground-color: #ffffff;\ncolor: #333333;\nfont-family: verdana, arial, helvetica, sans-serif;\nfont-size: 10px;\nfont-weight:bold;\ntext-align: left;\nvertical-align: top;\noverflow: show;\nborder: 1px #333333 solid;\n'+opacityStyle+'\n}\n';
	htmlSettings		+=	'</style>\n';
	htmlSettings		+=	'</head>\n<body onUnload="opener.document.diapoWin=false">\n';
	if(layerText != ''){
		htmlSettings		+=	'<div>'+layerText+'</div>\n';
	}
	htmlSettings		+=	'<img src="'+diapoURL+'" width="'+width+'" height="'+height+'" alt="'+description+'" title="'+description+'">\n';
	htmlSettings		+=	'</body>\n</html>';
	var features ='top=0, left=0, width='+width+', height='+height+', resizable=yes, scrollbars=yes';

	closeDiapoWin();

	document.diapoWin = window.open('about:blank','diapo',features);
	if(navigator.appName=="Netscape"){
		document.diapoWin.innerWidth	=	width;
		document.diapoWin.innerHeight	=	height;
		document.diapoWin.moveTo(0,0);
	}
	with(document.diapoWin.document){
		open();
		write(htmlSettings);
		close();
	}
}

//-------------------------------------------------------------------------------------------------------------

function closeDiapoWin(){
// İ 2003  Daniele Marchesini All Rights reserved
	if(window.top.document.diapoWin){
		window.top.document.diapoWin.close();
	}
}

// -----------------------------------------------------------------------------------------------

function viewDiapo(imageURL,diapoTitle,description,layerText,l,t,w,h){
// İ 2004  Daniele Marchesini All Rights reserved
// apre una nuova finestra del browser in cui richiama una pagina vuota prototipo e invia a questa
// in modalità GET tutte le informazioni necessarie a completarne i contenuti.
// se non si desidera inserire la didascalia, è sufficiente lasciare vuoto il parametro 'layerText'

	var left;
	var top;
	(viewDiapo.arguments[4])?left=l:left=5;
	(viewDiapo.arguments[5])?top=t:top=5;
	(viewDiapo.arguments[6])?imageWidth=w:imageWidth=60;
	(viewDiapo.arguments[7])?imageHeight=h:imageHeight=40;
	var opacity = 60;
	var opacityStyle;
	(document.nav=='netscape')?opacityStyle='-moz-opacity:'+opacity+'%;':opacityStyle='filter:alpha(opacity='+opacity+');';

	var features ='top=0, left=0, width='+imageWidth+', height='+imageHeight+', resizable=yes, scrollbars=yes';

	closeDiapoWin();

	document.pageProperties = localizePage(document.location.href);
	toRoot = document.pageProperties['toRoot'];

	var templatePageURL = toRoot+'templates/diapoPage.html?d_t='+diapoTitle+'&i_URL='+imageURL+'&i_w='+imageWidth+'&i_h='+imageHeight+'&i_a='+description+'&i_t='+description+'&l_t='+layerText;

//	alert('templatePageURL:\n'+templatePageURL);

	window.top.document.diapoWin = window.open(templatePageURL,'diapo',features);

	if(document.nav=="netscape"){
		document.diapoWin.innerWidth	=	imageWidth;
		document.diapoWin.innerHeight	=	imageHeight;
		document.diapoWin.moveTo(0,0);
	}
}

//-------------------------------------------------------------------------------------------------------------

function readGetParameters(){
// İ 2003  Daniele Marchesini All Rights reserved
	var theURL = document.location.href;
	if(theURL.indexOf('?') >= 0){
		var variables = theURL.split('?')[1];
		if(variables.indexOf('&') >= 0){
			var singleVars = variables.split('&');
			var numPar = singleVars.length;
		}else{
			var singleVars = new Array(variables);
			var numPar = 1;
		}
		var rep = 'parametri passati:\n';
		for(i=0; i<numPar; i++){
			if(singleVars[i].indexOf('=') >= 0){
				tempVars = singleVars[i].split('=');
				rep += tempVars[0] + ' : ' + tempVars[1] + '\n';
			}else{
				rep += singleVars[i] + '\n';
			}
		}
		alert(rep);
	}else{
		alert('nessun parametro passato')
	}
}

//--------------------------------------------------------------------------------------------------------------

function centerIfNetscape(){
// İ 2004  Daniele Marchesini All Rights reserved
// centro la tabella se il browser è Netscape

	if(navigator.appName == 'Netscape'){
		var browserWidth = top.innerWidth;
		var browserHeight = top.innerHeight;

		if(browserWidth>792){
			document.getElementById('mainTable').style.marginLeft = Math.floor((browserWidth - 780)/2);
		}
		if(browserHeight>428){
			document.getElementById('mainTable').style.marginTop = Math.floor((browserHeight - 450)/4)-15;
		}
	}
}

// -----------------------------------------------------------------------------------------------

function changeLanguage(currentLang, nextLang){
// İ 2004  Daniele Marchesini All Rights reserved
	return;
	// top.location.href = top.location.href.split(currentLang)[0] + nextLang + top.location.href.split(currentLang)[1];
	// alert(top.location.href.split(currentLang)[1] + nextLang + top.location.href.split(currentLang)[1]);
	// top.location.href = 'http://www.repubblica.it';
	// alert('currentLang: '+currentLang+'\nnextLang: '+nextLang+'\nfirst: ' + top.location.href.split(currentLang)[0] + '\nlast: '+top.location.href.split(currentLang)[1]);
}

// -----------------------------------------------------------------------------------------------

function stretchLayer(){
// İ 2004  Daniele Marchesini All Rights reserved
	if(document.plat == 'win' && document.nav == 'explorer'){
		document.getElementById('galleryIconLayer').style.width = '350';
		document.getElementById('galleryIconLayer').style.width = document.getElementById('contentsCell').offsetWidth;// - 40 - 18;
	}
}

// -----------------------------------------------------------------------------------------------

var menuList = new Array('allestire','comunicare','contattaci');
var totMenuList = menuList.length;

var activeSuffix = 'Active';

// -----------------------------------------------------------------------------------------------

var theObjHeight;

function closeAllMenu(){
// İ 2004  Daniele Marchesini All Rights reserved
	var temp_topBarCell,temp_topBarLink,temp_menuCell,temp_menuLayer;
	for(i=0; i<totMenuList; i++){
		temp_topBarCell =  top.document.getElementById(menuList[i]+'_topBarCell');
		temp_topBarLink =  top.document.getElementById(menuList[i]+'_topBarLink');
		temp_topBarLayer =  top.document.getElementById(menuList[i]+'_topBarLayer');
		temp_menuCell = top.document.getElementById(menuList[i]+'_menuCell');
		temp_menuLayer = top.document.getElementById(menuList[i]+'_menuLayer');

		if(temp_topBarCell.className.match(activeSuffix)){
			temp_topBarCell.className = temp_topBarCell.className.split(activeSuffix)[0];
		}
		if(temp_topBarLayer.className.match(activeSuffix)){
			temp_topBarLayer.className = temp_topBarLayer.className.split(activeSuffix)[0];
		}
		if(temp_topBarLink.className.match(activeSuffix)){
			temp_topBarLink.className = temp_topBarLink.className.split(activeSuffix)[0];
		}
		if(temp_menuCell.className.match(activeSuffix)){
			temp_menuCell.className = temp_menuCell.className.split(activeSuffix)[0];
		}
		if(temp_menuLayer.className.match(activeSuffix)){
			temp_menuLayer.className = temp_menuLayer.className.split(activeSuffix)[0];
		}
	}
}

// -----------------------------------------------------------------------------------------------

var currentID = 'none';

function activateMenu(id){
// İ 2004  Daniele Marchesini All Rights reserved
	currentID = id;
	var topBarCell =  document.getElementById(id+'_topBarCell');
	var topBarLayer =  document.getElementById(id+'_topBarLayer');
	var topBarLink =  document.getElementById(id+'_topBarLink');
	var menuCell =  document.getElementById(id+'_menuCell');
	var menuLayer =  document.getElementById(id+'_menuLayer');

	if(topBarCell.className.match(activeSuffix) && topBarLayer.className.match(activeSuffix) && topBarLink.className.match(activeSuffix) && menuCell.className.match(activeSuffix) && menuLayer.className.match(activeSuffix)){
		var nowActive = true;
	}else{
		var nowActive = false;
	}

	closeAllMenu();

	if(!nowActive){
		topBarCell.className = topBarCell.className + activeSuffix;
		topBarLayer.className = topBarLayer.className + activeSuffix;
		topBarLink.className = topBarLink.className + activeSuffix;
		menuCell.className = menuCell.className + activeSuffix;
		menuLayer.className = menuLayer.className + activeSuffix;
		currentID = 'none';
	}
}

// -----------------------------------------------------------------------------------------------

function closeAllMenuFromBody(){
// İ 2004  Daniele Marchesini All Rights reserved
	if(currentID == 'none'){
		closeAllMenu();
	}
}

// -----------------------------------------------------------------------------------------------

function old_closeAllMenu(){
// İ 2004  Daniele Marchesini All Rights reserved
	var temp_topBarCell,temp_topBarLink,temp_topBarMenuCell,temp_topBarMenuLayer;
	for(i=0; i<totMenuList; i++){
		temp_topBarCell =  document.getElementById(menuList[i]+'_topBarCell');
		temp_topBarLink =  document.getElementById(menuList[i]+'_topBarLink');
		temp_topBarMenuCell =  document.getElementById(menuList[i]+'_topBarMenuCell');
		temp_topBarMenuLayer = document.getElementById(menuList[i]+'_topBarMenuLayer');

		if(temp_topBarCell.className.match(activeSuffix)){
			temp_topBarCell.className = temp_topBarCell.className.split(activeSuffix)[0];
		}
		if(temp_topBarLink.className.match(activeSuffix)){
			temp_topBarLink.className = temp_topBarLink.className.split(activeSuffix)[0];
		}
		if(temp_topBarMenuCell.className.match(activeSuffix)){
			temp_topBarMenuCell.className = temp_topBarMenuCell.className.split(activeSuffix)[0];
		}
		if(temp_topBarMenuLayer.className.match(activeSuffix)){
			temp_topBarMenuLayer.className = temp_topBarMenuLayer.className.split(activeSuffix)[0];
		}
	}
}

// -----------------------------------------------------------------------------------------------

// var currentID = 'none';

function old_activateMenu(id){
// İ 2004  Daniele Marchesini All Rights reserved
	currentID = id;
	var topBarCell =  document.getElementById(id+'_topBarCell');
	var topBarLink =  document.getElementById(id+'_topBarLink');
	var topBarMenuCell =  document.getElementById(id+'_topBarMenuCell');
	var topBarMenuLayer =  document.getElementById(id+'_topBarMenuLayer');

	if(topBarCell.className.match(activeSuffix) && topBarLink.className.match(activeSuffix) && topBarMenuCell.className.match(activeSuffix) && topBarMenuLayer.className.match(activeSuffix)){
		var nowActive = true;
	}else{
		var nowActive = false;
	}

	closeAllMenu();

	if(!nowActive){
		topBarCell.className = topBarCell.className + activeSuffix;
		topBarLink.className = topBarLink.className + activeSuffix;
		topBarMenuCell.className = topBarMenuCell.className + activeSuffix;
		topBarMenuLayer.className = topBarMenuLayer.className + activeSuffix;
		currentID = 'none';
	}
}

// -----------------------------------------------------------------------------------------------
function waitFor(n){
// İ 2004  Daniele Marchesini All Rights reserved
	var limit = Math.pow(10,n);
	var c = 0;
	for(i=0; i<limit; i++){
		c++;
	}
}

// -----------------------------------------------------------------------------------------------
function old_resetReferences(){
// İ 2004  Daniele Marchesini All Rights reserved
	var defaultIconLabelCellClassName = 'iconLabelCell';
	var defaultCellClassName = 'iconCell';
	var defaultIconClassName = 'referenceIndexIcon';
	var separator = 'Current';
	var totImages = document.images.length;
	for(i = 0; i<totImages; i++){
		if(document.images[i].className.match(defaultIconClassName)){
			if(document.images[i].src.match(separator)){
				document.images[i].src = document.images[i].src.split('_'+separator)[0]+document.images[i].src.split('_'+separator)[1];
			}
			if(document.images[i].className.match(separator)){
				document.images[i].className = document.images[i].className.split(separator)[0]+document.images[i].className.split(separator)[1];
			}
		}
	}
	var allCells = top.document.getElementsByTagName('td');//iconLabelCell
	var totCells = allCells.length;
	for(j = 0; j<totCells; j++){
		if((allCells[j].className.match(defaultIconLabelCellClassName))||(allCells[j].className.match(defaultCellClassName)) && allCells[j].className.match(separator)){
			allCells[j].className = allCells[j].className.split(separator)[0];
		}
	}
}

// -----------------------------------------------------------------------------------------------

function old_setReference(rp){
// İ 2004  Daniele Marchesini All Rights reserved
	resetReferences();
	top.document.referencesPath = rp;
	var referencesSection = top.document.referencesPath.split('|')[0];
	var currentID = top.document.referencesPath.split('|')[1];
	var currentIcoID = referencesSection+currentID;
	if(top.document.getElementById('label'+referencesSection)){
		top.document.getElementById('label'+referencesSection).className = top.document.getElementById('label'+referencesSection).className+'Current';
	}else{
		alert('label'+referencesSection+'\nnon trovato\nsetReference('+rp+')');
	}

	if(document.getElementById(currentIcoID)){
		document.getElementById(currentIcoID).className = document.getElementById(currentIcoID).className+'Current';
		var icoDetails = document.getElementById(currentIcoID).src.split('/');
		var icoFileName = icoDetails[icoDetails.length-1].split('.')[0];
		var icoExtension = icoDetails[icoDetails.length-1].split('.')[1];
		var icoPath = document.getElementById(currentIcoID).src.split(icoFileName)[0]
		document.getElementById(currentIcoID).src = icoPath+icoFileName+'_Current.'+icoExtension;
	}else{
		alert(currentIcoID+'\nnon trovato\nsetReference('+rp+')');
	}
/*
	if(top.document.getElementById('referencesContentsIframe')){
		var pageDetails = localizePage();
		var toRoot = pageDetails['toRoot'];
		var fileURL;
		fileURL = toRoot+'pages/ita/references/'+referencesSection.toLowerCase()+'/'+currentID+'.html';
		top.document.getElementById('referencesContentsIframe').src = fileURL;
		if(document.nav == 'opera'){
			// rallento l'esecuzione del codice solo per alcuni browser che, altrimenti, non caricano il file nell'iframe
			waitFor(6);
		}
	}else{
		alert('referencesContentsIframe non trovato')
	}
*/
}

// -----------------------------------------------------------------------------------------------

function resetReferences(){
// İ 2005  Daniele Marchesini All Rights reserved
	var defaultIconLabelCellClassName = 'iconLabelCell';
	var defaultCellClassName = 'iconCell';
	var defaultIconClassName = 'referenceIndexIcon';
	var separator = 'Current';
	var totImages = document.images.length;
	for(i = 0; i<totImages; i++){
		// alert(document.images[i].className);
		if(document.images[i].className.match(defaultIconClassName)){
			if(document.images[i].src.match(separator)){
				document.images[i].src = document.images[i].src.split('_'+separator)[0]+document.images[i].src.split('_'+separator)[1];
			}
			if(document.images[i].className.match(separator)){
				document.images[i].className = document.images[i].className.split(separator)[0]+document.images[i].className.split(separator)[1];
				// alert('resetReferences(): '+document.images[i].className);
			}
		}
	}
	/*
	var allCells = top.document.getElementsByTagName('td');//iconLabelCell
	var totCells = allCells.length;
	for(j = 0; j<totCells; j++){
		if((allCells[j].className.match(defaultIconLabelCellClassName))||(allCells[j].className.match(defaultCellClassName)) && allCells[j].className.match(separator)){
			allCells[j].className = allCells[j].className.split(separator)[0];
		}
	}
	*/
}

// -----------------------------------------------------------------------------------------------

function setReference(rp){
// İ 2005  Daniele Marchesini All Rights reserved
	resetReferences();
	top.document.referencesPath = rp;
	var referencesSection = top.document.referencesPath.split('|')[0];
	var currentID = top.document.referencesPath.split('|')[1];
	var currentIcoID = referencesSection+currentID;
	// alert('referencesSection: '+referencesSection+'\ncurrentID: '+currentID+'\ncurrentIcoID: '+currentIcoID);
/*
	if(top.document.getElementById('label'+referencesSection)){
		top.document.getElementById('label'+referencesSection).className = top.document.getElementById('label'+referencesSection).className+'Current';
	}else{
		alert('label'+referencesSection+'\n1 - non trovato\nsetReference('+rp+')');
	}
*/
	if(top.frames['referencesIndexIframe'].document.getElementById(currentIcoID)){
		var icoDetails = top.frames['referencesIndexIframe'].document.getElementById(currentIcoID).src.split('/');
		var icoFileName = icoDetails[icoDetails.length-1].split('.')[0];
		var icoExtension = icoDetails[icoDetails.length-1].split('.')[1];
		var icoPath = top.frames['referencesIndexIframe'].document.getElementById(currentIcoID).src.split(icoFileName)[0]
		top.frames['referencesIndexIframe'].document.getElementById(currentIcoID).src = icoPath+icoFileName+'_Current.'+icoExtension;
		top.frames['referencesIndexIframe'].document.getElementById(currentIcoID).className = top.frames['referencesIndexIframe'].document.getElementById(currentIcoID).className+'Current';
		// alert('setReference('+rp+'): '+top.frames['referencesIndexIframe'].document.getElementById(currentIcoID).className);		
	}else{
		alert('setReference('+rp+')\nelemento: '+currentIcoID+'non trovato\nmodifica attributi \'src\' e \'class\'');
	}
	var newSrc = rp.split('|')[1] + '.html'; /* rp.split('|')[0].toLowerCase() + '/' + */
	top.frames['referencesContentsIframe'].location.href = newSrc;
}

// -----------------------------------------------------------------------------------------------

function  setCurrentLinks(object){
	var theCell = object.parentNode;
	var allLinks = theCell.getElementsByTagName('a');
	var totLinks = allLinks.length;
	for(i=0; i<totLinks; i++){
		// alert(allLinks[i].className);
		allLinks[i].className = 'referencesAreaSelectorLink';
	}
	object.className = 'referencesAreaSelectorLinkCurrent';
	object.blur();
}

// -----------------------------------------------------------------------------------------------

function setOffset(){
// İ 2004  Daniele Marchesini All Rights reserved
	if(top.document.referencesPath){
		var offset = 0;
		var referencesSection = top.document.referencesPath.split('|')[0];
		switch(referencesSection){
			case 'Novita':
				offset = 0;
			break;

			case 'Fiere':
				offset = -360;
			break;

			case 'Cultura':
				offset = -665;
			break;

			case 'Showroom':
				offset = -955;
			break;

			case 'Itinerante':
				offset = -1220;
			break;

			case 'Comunicazione':
				offset = -1495;
			break;
		}
	}
}


// -----------------------------------------------------------------------------------------------

function reporter(){
// İ 2004  Daniele Marchesini All Rights reserved
	var rep = '';
	rep += 'offsetWidth: '+document.documentElement.offsetWidth+'\n';
	rep += 'offsetHeight: '+document.documentElement.offsetHeight+'\n';
	rep += 'offsetTop: '+document.documentElement.offsetTop+'\n';
	rep += 'offsetLeft: '+document.documentElement.offsetLeft+'\n';
	rep += 'scrollWidth: '+document.documentElement.scrollWidth+'\n';
	rep += 'scrollHeight: '+document.documentElement.scrollHeight+'\n';
	rep += 'scrollLeft: '+document.documentElement.scrollLeft+'\n';
	rep += 'scrollTop: '+document.documentElement.scrollTop+'\n';
	rep += 'clientWidth: '+document.documentElement.clientWidth+'\n';
	rep += 'clientHeight: '+document.documentElement.clientHeight+'\n';
	rep += 'clientLeft: '+document.documentElement.clientLeft+'\n';
	rep += 'clientTop: '+document.documentElement.clientTop;
	alert(rep);
}

// -----------------------------------------------------------------------------------------------

function stretchContentsIframe(){
// İ 2004  Daniele Marchesini All Rights reserved
	if(document.getElementById('referencesContentsIframe')){
		if(document.plat == 'win'){
			if(document.nav == 'netscape' || document.nav == 'firefox'){
				document.getElementById('referencesContentsIframe').style.height = 0;
				document.getElementById('referencesContentsIframe').style.height = document.getElementById('mainTableContentsCell').scrollHeight-document.getElementById('topBarTable').scrollHeight-2;
			}
		}
	}
}


// -----------------------------------------------------------------------------------------------

function setTheme(){
// İ 2004  Daniele Marchesini All Rights reserved
	var pageDetails = localizePage();
	var toRoot = pageDetails['toRoot'];
	var obj = document.getElementById('topBarTable');
	var localURL = document.location.href.split(siteFolderName)[1];
	var urlElements = localURL.split('/');
	var urlTheme = '';
	if(urlElements.length == 2){
		obj.style.backgroundImage = 'url('+toRoot+'images/chrome/themes/home.gif)';
	}else{
		urlTheme = 'url('+toRoot+'images/chrome/themes/'+pageDetails['langName']+'/'+urlElements[3]+'_'+pageDetails['pageName'].split('_')[0]+'.gif)';
		// alert(urlTheme);
		obj.style.backgroundImage = urlTheme;
	}
}

