if(linkTo.indexOf("#")>-1){
	myIndex=linkTo.indexOf("#")
	linkTo=linkTo.substring(0,myIndex) + whichAnchor
	}

if(myLevel==1) {
	imageSource = "totop.gif"
	}
else if(myLevel==2) {
	imageSource = "../totop.gif"
	}
else if(myLevel==3) {
	imageSource = "../../totop.gif"
	}
else if(myLevel==4) {
	imageSource = "../../../totop.gif"
	}
else if(myLevel==5) {
	imageSource = "../../../../totop.gif"
	}


/* imageSource = "totop.gif"  */

imageWidth = 17
imageHeight = 38
if (bodyWidth==null) {
	var bodyWidth = 569
	}

n = (document.layers) ? 1:0
ie = (document.all) ? 1:0

topMsg="Inizio pagina"
function topOverLink() {
	return overLink(topMsg)
	}
	
function topOutLink() {
	return outLink()
	}

function watermarkgraphic() {
	if (n || ie) {
	    //createLayer("watermark",null,0,0,imageWidth,imageHeight,"<A HREF=\'" + linkTo + "\' onmouseover=\'return topOverLink()\' onmouseout=\'return topOutLink()\'><IMG SRC=\'" + imageSource + "\' BORDER=0></A>")
	    createLayer("watermark",null,0,0,imageWidth,imageHeight,"<A HREF=\' #Anchor-Top\' onmouseover=\'return topOverLink()\' onmouseout=\'return topOutLink()\'><IMG SRC=\'" + imageSource + "\' BORDER=0></A>")

		if (ie) {
			//MSIE 5.0 Mac patch (part 1) -----------------
			//error returned if dynLayer already exists:
			//(document.all["watermark"] is reset==null)
			if (document.all["watermark"]){
				mark = new dynLayer("watermark")
				}
			//---------------------------------------------
		}else{
			mark = new dynLayer("watermark")
		}
	    setInterval("wtrmark()",100)
	    }
	}

function dynLayer(id,nestref) {
	if (n) {
		this.css = document.layers[id]
		}
	else if (ie) {
		this.css = document.all[id].style
		}

    this.moveBy = dynLayerMoveBy
    this.moveTo = dynLayerMoveTo
	}

function dynLayerMoveBy(x,y) {
    this.x += x
    this.css.left = this.x
    this.y += y
    this.css.top = this.y
	}
function dynLayerMoveTo(x,y) {
    this.x = x
    this.css.left = this.x
    this.y = y
    this.css.top = this.y
}

function wtrmark() {
	if (n) {
	    windowWidth = window.innerWidth-17
	    windowHeight = window.innerHeight-17
//	    myOoffset = ((window.innerWidth-bodyWidth)/2)-(imageWidth/2)
	    myOoffset = ((window.innerWidth-bodyWidth)/2)-(imageWidth/2)-(imageWidth/2)
	    myVoffset = 28
	    if (imageAlign == "topleft")    mark.moveTo(window.pageXOffset,window.pageYOffset)
	    if (imageAlign == "topright")   mark.moveTo(windowWidth-imageWidth+window.pageXOffset,window.pageYOffset)
	    if (imageAlign == "bottomleft") mark.moveTo(window.pageXOffset,windowHeight-imageHeight+window.pageYOffset)
	    if (imageAlign == "bottomright")mark.moveTo(windowWidth-imageWidth+window.pageXOffset-myOoffset,windowHeight-imageHeight+window.pageYOffset-myVoffset)
	    }
	else if (ie) {
    	windowWidth = document.body.clientWidth
    	windowHeight = document.body.clientHeight
//   		 myOoffset = ((windowWidth-bodyWidth)/2)
   		 myOoffset = ((windowWidth-bodyWidth)/2)-(imageWidth/2)
   		 myVoffset = 50
		if (imageAlign == "topleft")    mark.moveTo(document.body.scrollLeft,document.body.scrollTop)
		if (imageAlign == "topright")   mark.moveTo(windowWidth-imageWidth+document.body.scrollLeft,document.body.scrollTop)
		if (imageAlign == "bottomleft") mark.moveTo(document.body.scrollLeft,windowHeight-imageHeight+document.body.scrollTop)
		if (imageAlign == "bottomright")mark.moveTo(windowWidth+document.body.scrollLeft-myOoffset-(imageWidth/2),windowHeight-imageHeight+document.body.scrollTop-myVoffset)
		}
	}

function createLayer(id,nestref,left,top,width,height,content,bgColor,visibility,zIndex) {
	if (n) {
		if (nestref) {
			var lyr = eval("document."+nestref+".document."+id+" = new Layer(width, document."+nestref+")")
			}
		else {
			var lyr = document.layers[id] = new Layer(width)
			eval("document."+id+" = lyr")
			}
		lyr.name = id
		lyr.left = left
		lyr.top = top
		if (height!=null) lyr.clip.height = height
		if (bgColor!=null) lyr.bgColor = bgColor
		lyr.visibility = (visibility=='hidden')? 'hide' : 'show'
		if (zIndex!=null) lyr.zIndex = zIndex
		if (content) {
			lyr.document.open()
			lyr.document.write(content)
			lyr.document.close()
			}
		}
	else if (ie) {
		var str = '\n<DIV id='+id+' style="position:absolute; left:'+left+'; top:'+top+'; width:'+width
		if (height!=null) {
			str += '; height:'+height
			str += '; clip:rect(0,'+width+','+height+',0)'
			}
		if (bgColor!=null) str += '; background-color:'+bgColor         
		if (zIndex!=null) str += '; z-index:'+zIndex
		if (visibility) str += '; visibility:'+visibility
		str += ';">'+((content)? content :'')+'</DIV>'
		if (nestref) {
			index = nestref.lastIndexOf(".")
			var nestlyr = (index != -1)? nestref.substr(index+1) : nestref
			document.all[nestlyr].insertAdjacentHTML("BeforeEnd",str);
			}
		else {
			//MSIE 5.0 Mac patch (part 2) -----------------
			//error returned if dynLayer already exists:
			//(document.all[id] is reset==null)
			if (! document.all[id]){
				document.body.insertAdjacentHTML("BeforeEnd",str)
				}
			//---------------------------------------------
			}
		}
	}
