function genereateNewListFromXml(xml,itemname,listname,itemDefault){
	var	items = xml.getElementsByTagName(itemname),
		risultato = "",
		i=0;

	var list = eval('document.listform.' + listname);

	for (i in list.options.length) {
		list.options[i] = null;
	}
	i = 0;	
	if (itemDefault==1){
			opt = new Option();
			opt.value = "";
			opt.text = "Selezionare un valore";
			list.options[i++] = opt;
		
	}
	for(var a = 0, b = items.length; a < b; a++) {
			opt = new Option();
			opt.value = leggiContenuto(items[a], "id");
			opt.text = leggiContenuto(items[a], "valore");
			list.options[i++] = opt;
	};
		list.length = i;
	return "";
}

function toggle(obj) {
var sibling;
if(obj.nextSibling.nodeType==3) {
    sibling=obj.nextSibling.nextSibling;
    }
else {
    sibling=obj.nextSibling;
    }
sibling.style.display=(sibling.style.display=='none')? 'block' : 'none';
}


function gotoMenu(m){
	var c=null;
	if (m==6){
		c= document.getElementById("content");
		c.innerHTML = "<div align=\"center\"><br><br><b>...L O A D I N G...</b></div>";
		//document.location.href=urlroot + "index.php?sezione=giochi";
		document.location.href=urlroot + "sezione/giochi/giochi-gratis-per-bambini";
	//}else if (m!=2){
}else if (m!=2){		
		c = document.getElementById("content");
		c.innerHTML = "<div align=\"center\"><br><br><b>...L O A D I N G...</b></div>";
		//document.location.href=urlroot + "index.php?m="+m;
		if (m==0) document.location.href=urlroot;
		else if (m==1) document.location.href=urlroot + "page/1/cellulare-sicurezza-bambini-per-controllare-a-distanza-i-propri-figli";
		else if (m==2) document.location.href=urlroot + "page/2/acquista-e-regala-primo-telefono-sicurezza-bambini";
		else if (m==3) document.location.href=urlroot + "page/3/manuale-uso-cellulare-per-bambini";
		else if (m==4) document.location.href=urlroot + "page/4/bambini-protetti-con-aiuto-cellulare-amico";
		else if (m==5) document.location.href=urlroot + "page/5/famiglia-e-bambini-sicuri-in-vacanza-lontano-dai-genitori";
	}else{		
		openEcomm();
	}
}

function openColora(){
	var c = document.getElementById("iframcolorateddy");
	hs.htmlExpand(c, { contentId: 'highslide-html-11', objectType: 'iframe', objectWidth: 1000, objectHeight: 600, objectLoadTime: 'after', allowWidthReduction: 1} );
}

function openPuntini(){
	var c = document.getElementById("iframunisciteddy");
	hs.htmlExpand(c, { contentId: 'highslide-html-12', objectType: 'iframe', objectWidth: 1000, objectHeight: 600, objectLoadTime: 'after', allowWidthReduction: 1} );
}


function openEcomm(){
		var c = document.getElementById("content");
		c.innerHTML = "<div align=\"center\"><br><br><b>...L O A D I N G...</b></div>";
		document.location.href=urlroot + "ecomm/index.php?option=com_virtuemart&page=shop.browse&category_id=2&Itemid=1";


	/*
	var c = document.getElementById("iframetest");
	if (hs.addSlideshow) hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: false,
		fixedControls: false,
		overlayOptions: {
			opacity: 1,
			position: 'top right',
			hideOnMouseOut: false
		}
	});

	return hs.htmlExpand(c,{contentId: 'highslide-html-9', objectType: 'iframe', objectWidth: 800, objectHeight: 900, objectLoadTime: 'after', allowWidthReduction: 1} );
	*/
}