// Javascript per lo switching della contenutistica nelle pagine applications.php e products.php.

function hide() {
var divs=document.getElementById('testo').getElementsByTagName('div');
for (j=0; j<divs.length; j++) {
var rE = new RegExp("(^|\\s)" + 'switch' + "(\\s|$)");
if (rE.test(divs[j].className)) {
divs[j].style.display="none";
}
}
}

function change(first) {
var thebuttons=document.getElementById('destra').getElementsByTagName('a');
for (i=0; i<thebuttons.length; i++) {
thebuttons[i].onclick=function() {
hide();
var thestory=(this.href).split("#",2)[1];
document.getElementById(thestory).style.display="block";
document.getElementById(thestory).style.height="385px";
return false;
}
}
if (first) {
var firstone=document.getElementById('testo').firstChild;
if (firstone.nodeType != 1) {firstone = firstone.nextSibling;}
firstone.style.display="block";
}
}
window.onload=function() {
hide();
change(1);
}