<!--
/*
 - www.MiglioriSiti.NET production copyright 2009 [Do not remove this copyright notice]

You are free to consult, to use or to modify the following HTML and/or Javascript code for your personal purposes.
miglioriSiti.Net hopes that, for facilities that will derive you from these practices, appreciating our work,
you could send us a compensation, decide you the price, variable from 5 to 50 dollars or euro,
depending on the kind of your use (ex. learning, personal use, commercial use).
The donation will allow improving and a continuous work of our free services.
For more information contact us

Best regards,	MiglioriSiti.NET
*/

var VOTO	= new Array('voto', 'mark')
//var NOME	= new Array('Il tuo nome', 'Your name ')
//var CATEGOR	= new Array('Categoria:', 'Category:')

var COMBO_SET_VOTO	= new Array('Dai il voto:', 'Set the mark:')

var COMBO_OTTIMO		= new Array('Eccellente','Excelent')
var COMBO_BUONO		= new Array('Ottimo',	'Good')
var COMBO_SUFFICIE	= new Array('Buono',	'Fair')
var COMBO_INSUFFIC	= new Array('Medio',	'Mediocre')
var COMBO_SCADENTE	= new Array('Scarso',	'Bad')

var sito='I';
var ArrLingPos = sito!='E' ? 0 : 1

function addBlank(numBLinks){	//Tabella per l'inserimento del nuovo link

// riempio le combo delle categorie
  var cbox = document.getElementById('main').elements['catB'+numBLinks]   //prendo il combo delle categorie del menu di legno
  cbox.options.length = 0    //cancella
  for (var j=0; j<menuTopChild.length; j++){
  	var comboCod = menuTopChild[j];
	var comboDesc = menuTree[comboCod].n;
	comboDesc = comboDesc.replace(/&agrave;/g,'a');
	cbox.options[j] = eval( new Option(comboDesc, comboCod)  );
  }
  cbox.options[0].selected=true

  initCombo('catB' + numBLinks)
//  initCombo('sCatB'+ numBLinks)
  initCombo('votoB'+ numBLinks)

}//addBlank()


function sitoClic(idSito){
	document.getElementById('main').elements['click-'+idSito].value='true'
}


var testoNotaValue = '';
var testoNotaColor = '';
var testoNotaWeight = '';
function popView(testo, id)   //visualizza la dedica
{
	//if(testo.substring(0,2)=='&&') popViewOld(testo, id)
	obj = document.getElementById('main').elements['nota-'+id]
	testoNotaValue = obj.value
	obj.value = testo
	obj.style.backgroundColor = '#FFE0A0'
	testoNotaColor = obj.style.color
	obj.style.color = '#000000'
	testoNotaWeight = obj.style.fontWeight
	obj.style.fontWeight = 'bold'
}
function popHide(id)   //popHideOld = MM_showHideLayers('PopUp','','hide')
{
	obj = document.getElementById('main').elements['nota-'+id]
	obj.style.backgroundColor = '#F0F0F0'
	obj.value = testoNotaValue
	obj.style.color = testoNotaColor
	obj.style.fontWeight = testoNotaWeight
}

function popViewOld(testo, id)//dedica con layer utilizzabile per i banner publicitari dei siti
{
	testo = '<table border="0" cellspacing="0" cellpadding="0"><tr><td nowrap>'+ testo +'</td></tr></table>' ;
//alert( '-'+ document.getElementById("L"+id).offsetTop)
	var y = document.getElementById("L"+id).offsetTop
	var yBas = document.getElementById('tabLinks').offsetTop + 190
	var xBas = 180//427
//	if ( isIE )	yBas = yHead - 12  //old 88
//	if (isMozilla)	yBas = yHead - 12

	document.getElementById('PopUp').style.top= yBas + y
	document.getElementById('PopUp').style.left= xBas
	document.getElementById('PopTxt').innerHTML = testo

	document.getElementById('PopUp').style.visibility='visible'
}

	// obj = oggetto combo su cui agire
	// id = identificativo del nuovo link
function cambia(obj, id) {//loads the subcategory combo

	var objSubSelect  = document.getElementById('main').elements['sCat'+id] //combo di sotto categorie
	objSubSelect.options.length = 0	//cancella gli elementi del combo-box
	var currentIdCat = obj.options[obj.selectedIndex].value	//idCat da caricare
	objSubSelect.options[0] = eval(new Option(' '+ (sito=='E' ? 'Subcategory' : 'Sottocategoria') +': ', currentIdCat) )
//alert(currentIdCat);
	if( currentIdCat.indexOf('NonCla')==-1 ){

		var caunt = 0;
		var stack = menuTree[currentIdCat].c.concat(new Array());

		while(stack.length!=0) {
			currentIdCat = stack.shift();
//alert(currentIdCat +' '+stack.length);
			var currentCat = menuTree[currentIdCat];
			var comboDesc = getCatName(currentIdCat, true);

			comboDesc = comboDesc.replace(/&agrave;/g,'a');
			objSubSelect.options[++caunt] = eval( new Option( comboDesc, currentIdCat ));

			if (currentCat.e!=0) {	//if is expandible it fill the sottocategory combo
				stack = currentCat.c.concat(stack);
			}
		}

		objSubSelect.options[0].selected=true;
		objSubSelect.disabled=false;
		objSubSelect.focus();

	} else {
		objSubSelect.disabled=true
	}
}


function initCombo(nome){ //es. initCombo('voto-324')
	var combo = document.getElementById('main').elements[nome]
	if(nome.indexOf('voto')>-1){
		if(nome.indexOf('votoB')>-1){
			combo.options.length = 0
			combo.options[0] = eval(new Option(COMBO_SET_VOTO[ArrLingPos], '60') )
		}
		combo.options[1] = eval(new Option(COMBO_OTTIMO[ArrLingPos], '100') )
		combo.options[2] = eval(new Option(COMBO_BUONO[ArrLingPos], '80') )
		combo.options[3] = eval(new Option(COMBO_SUFFICIE[ArrLingPos], '60') )
		combo.options[4] = eval(new Option(COMBO_INSUFFIC[ArrLingPos], '40') )
		combo.options[5] = eval(new Option(COMBO_SCADENTE[ArrLingPos], '20') )

		combo.options[0].selected=true
		combo.disabled=false
	}
}
function initAreaMsg(nome){ //es. initAreaMsg('nota-1167')
	var areaMsg = document.getElementById('main').elements[nome]
	areaMsg.value=COMMENTO_LINK
}
function initComboDiPag(){
		var objIdLink = document.getElementById('main').elements['idLink[]']
		if(objIdLink!=undefined){//se ci sono indirizzi
			if( objIdLink.length==undefined ){
				initAreaMsg( 'nota-'+objIdLink.value )
				initCombo( 'voto-'+objIdLink.value )
			}else{
				for (var j=0; j<objIdLink.length; j++){
					initAreaMsg( 'nota-'+objIdLink[j].value )
					initCombo( 'voto-'+objIdLink[j].value )
				}
			}
		}
}


//-->
