

var quotes = [
  {"txt":"I have yet to find the perfect online collaboration tool. [...] A.nnotate is a service that gets as close as anything I've found on the Web.", "att":"makeuseof.com", "url":"http://www.makeuseof.com/tag/mark-up-your-documents-with-annotate/"},
  {"txt":"If you're in need of a way to collaborate on everything from books to web pages, A.nnotate is a simple, secure and attractive way to do just that.", "att":"makeuseof.com", "url":"http://www.makeuseof.com/tag/mark-up-your-documents-with-annotate/"},

  {"txt":"A.nnotate lets you annotate and upload documents of almost any kind - PDF, Word, PowerPoint, Excel, RTF, and HTML are all supported. It works totally within your web browser (currently Firefox, Internet Explorer, and Safari), and is an easy and useful solution.", "att":"makeuseof.com", "url":"http://www.makeuseof.com/tag/mark-up-your-documents-with-annotate/"},

  {"txt":"A.nnotate is the newest addition to The Best Applications For Annotating Websites. ", "att":"Larry Ferlazzo", "url":"http://larryferlazzo.edublogs.org/2009/03/20/annotate-gets-added-to-a-the-best-list/"},


  {"txt":"A.nnotate - Love the functionality but REALLY love the thought out into pricing",  "att":"e-Clippings", 
   "url": "http://blogoehlert.typepad.com/eclippings/2009/03/annotate-love-the-functionality-but-really-love-the-thought-out-into-pricing.html"},


  {"txt":"... now you can put up one document and send the link to hundreds of people who can then see it and annotate to it if needed. ", "att":"Tyler Wall", "url":"http://easierway.ca/2009/03/02/annotate-an-online-way-to-to-comment-and-take-notes/"}, 
            
  {"txt":"A.nnotate offers a solution for those who have to review documents or web page designs with a far-flung group of people who may all be using different platforms: move the review online.",  "att":"Web Worker Daily", "url":"http://webworkerdaily.com/2008/05/20/review-with-annotate/"}, 
            
  {"txt":"This afternoon I've been playing with a real fun annotation tool (at least fun compared with Microsoft Word). It's called A.nnotate, and it's one of the simplest tools I've come across, letting you add small (or very large) notes, corrections, or scribblings that float on top of the document like little widgets.", "att":"Josh Lowensohn, webware, cnet.com", "url":"http://news.cnet.com/8301-17939_109-9950553-2.html"}


            
              ];
              

function getPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	} else if (obj.y) {
		curtop += obj.y;
	}
	return Number(curtop);
}


function showAQuote() {
	var qdiv = document.getElementById("quotediv");
	var fdiv = document.getElementById("footer");
	
	if (!fdiv || !qdiv) {
		return;
	}
	
	var yf = getPosY(fdiv);
	var yq = getPosY(qdiv);
	if (yq + 100 > yf) {
		// don't want the quote to make the page longer 
		return;
	}
	
	var div = document.createElement("div");
	var iq = Math.floor(Math.random() * quotes.length);
	var q = quotes[iq];
	 
	
	div.innerHTML = '"' + q.txt + '"';
	qdiv.appendChild(div);
	
	var adiv = document.createElement("div");
	adiv.id = "quoteatt";
	if (q.url) {
		var a = document.createElement("a");
		a.href = q.url;
		a.innerHTML = q.att;
		adiv.appendChild(a);
		
	} else {
   	   adiv.innerHTML = q.att;	
	}
	qdiv.appendChild(adiv);
}

 
function loadAnalytics() {
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	var str = (unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' " +
	"type='text/javascript'%3E%3C/script%3E"));
	var div = document.createElement("div");
	div.innerHTML = str;
	document.body.appendChild(div);
	setTimeout(initGat, 500);
}

function initGat() {
	if (typeof(_gat) == "undefined") {
		setTimeout(initGat, 500);
	} else {
		var pageTracker = _gat._getTracker("UA-1704251-2");
		pageTracker._initData();
		pageTracker._trackPageview();
	}
}

 
function localActions() {
	showAQuote();
    loadAnalytics();
}


function loadFN() {
	var todo = window.onload;
	this.go = function() { 
		todo();
		localActions();
	}
}
 
if (typeof(window.onload) == "function") {
	var ldr = new loadFN();
	window.onload = ldr.go;
} else {
	window.onload = localActions;
}

 

