			var noteCount = 0;
			var notes = [];
			var openNotes = {};
		
			closeNote = function (noteID)
			{
				var note = $(noteID);
				
				for (var i = 0; i < notes.length; i++)
				{
					if (notes[i] == note)
					{
						notes.splice(i, 1);	
					}	
				}
				
				
				
				new Effect.Fade(note, {duration:0.7});
			}
			
			noteExists = function (noteID)
			{
				for (var i = 0; i < notes.length; i++)
				{
					if (notes[i] == note)
					{
						return true;
					}	
				}					
				
				return false;
			}
			
			
			createNote = function (title, call)
			{
				
			
				var noteID = "note" + noteCount;
				
				var content = "Loading note...";

				//<div class='pbElement' id='" + noteID + "'><div id='top'></div><div id='pinBoardContent" + noteID + "'>" + content + "</div><div id='bottom'></div>

				new Insertion.Top("pinBoard", "<div class='pbElement' id='" + noteID + "'><div id='top'><img src='/images/pbElement_arrow.jpg'>&nbsp;" + title + "</div><div class='pbContent' id='pinBoardContent" + noteID + "'>" + content + "</div><div id='bottom'></div>");
				//new Insertion.Top("pinBoard", "<span class='note' id='" + noteID + "'><div id='header'>" + title + "    <a href='#' onclick='closeNote(" + '"' + noteID + '"' + ");'>Close</a></div><div id='content" + noteID + "'>" + content + "</div></span>");
				var note = $(noteID);
		
				new Effect.Appear(note);
				
				notes.push(note);
				
				
					
				if (notes.length > 6)
				{
					Element.remove(notes[0]);
					notes.splice(0, 1);
				}	
				
				new Ajax.Updater("pinBoardContent" + noteID, call, {asynchronous:true, evalScripts:true});
					
				noteCount++;			
			}
			
			showBox = function (obj, note, grow)
			{
				var newX = findPosX(obj);
				var newY = findPosY(obj);
	
				var box = $("highlight");
				box.style.position = "absolute";
				box.style.top = newY + 'px';
				box.style.left = newX + 'px';

				var innerBox = $("highlightBox");
				innerBox.style.width = note.offsetWidth + "px";
				innerBox.style.height = note.offsetHeight + "px";

				var dx = findPosX(note) - newX;
				var dy = findPosY(note) - newY;
		
				
				//if (grow) new Effect.Grow(innerBox, {duration:0.3});	
				Element.show(box);
				
				new Effect.MoveBy(box, dy, dx, {duration:0.3, afterFinish: function ()
				{
					Element.hide(box);
				}});			
			}
			
			addNote = function (obj, title, call)
			{
				if (openNotes[title] != null) 
				{
					showBox(obj, openNotes[title], true);
					return;
				}	
			
				var noteID = "note" + noteCount;
				
				var content = "Loading note...";

				//<div class='pbElement' id='" + noteID + "'><div id='top'></div><div id='pinBoardContent" + noteID + "'>" + content + "</div><div id='bottom'></div>

				new Insertion.Top("noteBoard", "<div class='pbElement' id='" + noteID + "'><div id='top2'>&nbsp;&nbsp;<img src='/images/pbElement_note.jpg'>&nbsp;" + title + "</div><div class='pbContent2' id='pinBoardContent" + noteID + "'>" + content + "</div><div style='height:10px'></div>");//<div id='bottom'></div>
				//new Insertion.Top("pinBoard", "<span class='note' id='" + noteID + "'><div id='header'>" + title + "    <a href='#' onclick='closeNote(" + '"' + noteID + '"' + ");'>Close</a></div><div id='content" + noteID + "'>" + content + "</div></span>");
				var note = $(noteID);
		
				
				showBox(obj, note);
				
				new Effect.Appear(note);
				
				notes.push(note);
				openNotes[title] = note;
					
				if (notes.length > 6)
				{
					Element.remove(notes[0]);
					notes.splice(0, 1);
				}	
				
				new Ajax.Updater("pinBoardContent" + noteID, call, {asynchronous:true, evalScripts:true, onComplete: function()
				{
					/*if (document.getElementById) {
						var windowHeight=getWindowHeight();
						if (windowHeight>0) {
							var contentHeight=document.getElementById('frame').offsetHeight;
							var footerElement=document.getElementById('footer');
							var footerHeight=footerElement.offsetHeight;
							var headerHeight=document.getElementById('contentHeader').offsetHeight;
							var contentRightHeight = document.getElementById('contentRight').offsetHeight + headerHeight;
							if(contentRightHeight>contentHeight)
								contentHeight = contentRightHeight;
							if (windowHeight-(contentHeight)>=0) {
								footerElement.style.position='absolute';
								footerElement.style.top=((contentHeight-footerHeight))+'px';
							}
							else {
								footerElement.style.position='static';
							}
						}
					}	*/			
				}
				});
					
				noteCount++;			
				/*
				var noteID = "note" + noteCount;
				
				var content = "Loading note...";

				//new Insertion.Top("pinBoard", "<span class='note' id='" + noteID + "'><div id='header'>" + title + "    <a href='#' onclick='closeNote(" + '"' + noteID + '"' + ");'>Close</a></div><div id='content" + noteID + "'>" + content + "</div></span>");
				new Insertion.Top("pinBoard", "<div class='pbElement' id='" + noteID + "'><div id='top'><img src='/images/pbElement_arrow.jpg'>&nbsp;" + title + "</div><div class='pbContent' id='content" + noteID + "'>" + content + "</div><div id='bottom'></div><br>");
				
				var note = $(noteID);
		
				var newX = findPosX(obj);
				var newY = findPosY(obj);
	
				var box = $("highlight");
				box.style.position = "absolute";
				box.style.top = newY + 'px';
				box.style.left = newX + 'px';

				var innerBox = $("highlightBox");
				innerBox.style.width = note.offsetWidth + "px";
				innerBox.style.height = note.offsetHeight + "px";

				var dx = findPosX(note) - newX;
				var dy = findPosY(note) - newY;
		
				Element.show(box);
				new Effect.MoveBy(box, dy, dx, {duration:1.5, afterFinish: function ()
				{
					Element.hide(box);
				}});
				
				//new Effect.Grow(innerBox, {duration:0.5});				

				new Effect.Appear(note);
				
				notes.push(note);
					
				if (notes.length > 6)
				{
					Element.remove(notes[0]);
					notes.splice(0, 1);
				}	
				
				//new Ajax.Updater("content" + noteID, call, {asynchronous:true, evalScripts:true});
				new Ajax.Updater("content" + noteID, call, {asynchronous:true, evalScripts:true});
					
				noteCount++;*/
			}

			
			/*
			addNote = function (obj, title, call)
			{
				var noteID = "note" + noteCount;
				
				var content = "Loading note...";

				new Insertion.After(obj, "<span class='note' id='" + noteID + "'><div id='header'>" + title + "    <a href='#' onclick='closeNote(" + '"' + noteID + '"' + ");'>Close</a></div><div id='content" + noteID + "'>" + content + "</div></span>");
				var note = $(noteID);
		
				new Effect.Appear(note);
		
				new Ajax.Updater("content" + noteID, call, {asynchronous:true, evalScripts:true});
					
				noteCount++;
			}	
			*/		
			