// JavaScript Document
function showNote(noteLink){
	var noteLinkID = getRight(noteLink.id, "_");
	// show only my note.
	nixNotes();
	var noteObj = getObjectRef("note_" + noteLinkID);
	noteObj.style.display = "block";
	noteObj.style.visibility = "visible";
}
//
function placeNote(noteLink, leftOffSet, topOffset){

	leftOffSet = (leftOffSet!=undefined) ? leftOffSet : 180;
	topOffset = (topOffset!=undefined) ? topOffset : 1;
	var noteLinkID = getRight(noteLink.id, "_");
	// show only my note.
	nixNotes();
	var noteObj = getObjectRef("note_" + noteLinkID);
	var linkLoc = getScreenLoc(noteLink);
	with (noteObj.style){
		display = "block";
		visibility = "visible";
    	left = linkLoc[0]+leftOffSet +"px";
		top = linkLoc[1]+topOffset +"px";
	}
}
//
function collectNotes(){
	allNotes = new Array();
	var ithNote;
	for (var i=0; i<20; i++){
		ithNote = getObjectRef("note_" + i);
		if (ithNote == undefined || ithNote == null) continue;
		allNotes.push(ithNote);
	}
}
//
function nixNotes(){
	var ithNote;
	for (var i=0; i<allNotes.length; i++){
		ithNote = allNotes[i];
		ithNote.style.display = "none";
		ithNote.style.visibility = "hidden";
	}
}
// insert our functionality into onload and onresize events, while maintaining whatever may already be there.

doOnEvent(window, "load", collectNotes);
/*
var existingOnload = function(){};
if (window.onload!=null) { existingOnload = window.onload };
window.onload=collectNotes;
*/
//