
/*
* this code is copyright (c) 1996 nick heinle and athenia associates,
* all rights reserved. in order to receive the right to license this
* code for use on your site the original code must be copied from the
* web site webreference.com/javascript/. license is granted to user to
* reuse this code on their own web site if and only if this entire copyright
* notice is included. code written by nick heinle of webreference.com.
*/

function tocitem (name) {
	this.on = new Image();
	this.on.src = '../immagini/' + name + "on.gif"
	this.off = new Image();
	this.off.src = '../immagini/' + name + "off.gif"
}

function toc_new (name) {
	tocitem[name] = new tocitem(name);
}

function img_act (imgname) {
	if (document.images) document[imgname].src = tocitem[imgname].on.src;
}

function img_inact (imgname) {
	if (document.images) document[imgname].src = tocitem[imgname].off.src;
}

function load_toc (name, inizio, fine) {
	for (i = inizio; i <= fine; i++) toc_new(name + i);
}


function linkover(Id)
{
	document.getElementById(Id).style.cursor="pointer";
}


function apripagina(Link)
{
	window.open( Link );
}


function LinkOver(Id)
{
	document.getElementById(Id).className="titolo_linkSopra";
}


function LinkOut(Id)
{
	document.getElementById(Id).className="titolo_link";
}


function LinkOverClasse(Id, Classe)
{
	document.getElementById(Id).className=Classe;
}


function LinkOutClasse(Id, Classe)
{
	document.getElementById(Id).className=Classe;
}


function left(str, n)
{
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}


function right(str, n)
{
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}



function mid(str, inizio, lunghezza)
{
	return String(str).substring(inizio-1, inizio-1+lunghezza);
}


function OverHand(Id)
{
	document.getElementById(Id).style.cursor="pointer";
}


function LinkEsterno(link)
{
	if(left(link,5)=="index")
		link+="&ctfn=0";
	newWindow= window.open("","");
	newWindow.location.href = link;
}


function ApriLinkPagina(link)
{
	document.location.href=link;
}


if (document.images != null) load_toc ('origamimauro', 98, 114);
