
document.write("<link href='http://qwisk.com/sbmedia/css/blog_widget.css' rel='stylesheet'");

document.write("<div id='qwisk-container' style='width:200px'><div id='qwisk-header'></div><div id='qwisk-content'></div><div id='qwisk-footer'></div></div>");

var bob = 'Orient Lodge Readers';
var group_url = 'http://qwisk.com//groups/2008/';
var orig_transactions = [{"index": 0, "sharer_id": 2007, "sender_id": 2008, "app_id": 1, "display": 1, "to_id": null, "template": "<table border='0' width='100%' {.section data}type='{type}' {.section sharer} group='{sender_id}' {.end}{.end} >\r\n  <tr>\r\n    <td rowspan='2' valign='top' width='35px'>\r\n    {.section data}\r\n      {.section type_sharer_user}\r\n        <a href='{sender_profile}'><img src='{sender_pic}' title='{sender_name}' class='icon_profile'/></a>\r\n        <br />\r\n        <img src='/sbmedia/images/users/tiny/{up_id}.png' class='icon_app'/>\r\n      {.end}\r\n      {.section sharer}\r\n          <a href='/surfer/{id}/'><img src='{pic}' title='{name}' class='icon_profile'/></a>\r\n          <br />\r\n             <a href='{sender_profile}'><img src='{sender_pic}' class='icon_app' title='{sender_name} Group' /></a>\r\n        {.end}\r\n    {.end}\r\n    </td>\r\n    <td>\r\n      {.section data}\r\n        {.section del}\r\n         <div class='delete_tran' style='float:right;background:url(http://bruwser.com/sbmedia/images/inner/delete.png) no-repeat;height:9px;width:9px;position:relative;top:-2px;cursor:pointer;' href='/transactions/delete/{id}/'></div>\r\n         {.end}\r\n         {.section type_link }\r\n            <a href = '{url}' title='{title}'>{title|etc}</a>\r\n         {.end}\r\n         {.section type_img }\r\n             <a href='{url}' title='{title}'>{title|etc}</a><br />\r\n             <a href='{url}' >\r\n               <div style='max-height: 135px; overflow: hidden;padding: 3px;'>\r\n         <img style='border: 1px solid rgb(204, 213, 224);background: #FFF;' src='{src}' border='0' width='135px'  />\r\n               </div>\r\n   </a>\r\n         {.end}\r\n         {.section type_direct}\r\n            <a href='{url}' onclick=\"top.Sbrowse.applications.apps.socialbrowse.app.Menu.open('{url}', {chat_id}, '{title}'); return false\" style='color:#3B9CCE'><img src='/sbmedia/images/feed/message.png' class='feed_icon' />Direct Message</a> about:\r\n           <div><a href = '{url}' title='{title}' chat_id='{chat_id}' class='chat_title'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section type_video }\r\n             <a href='{url}' >{title}</a>\r\n     <div>{object}</div>\r\n         {.end}         \r\n         {.section type_comment}\r\n              <div><a href = '{url}' title='{title}'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section comment}\r\n            <a href = '{url}' style='color: #777; font-style: italic;'><img src='http://qwisk.com/sbmedia/images/feed/comment.png' class='feed_icon' />\"{comment|etc}\"</a>          \r\n         {.end}\r\n          {.section type_fan }\r\n            <a href = '{url}' title='{title}'>{title}</a>\r\n         {.end}\r\n      {.end}\r\n     </td>\r\n  </tr>\r\n  <tr><td class='feed_item_details'>\r\n     <div class='feed_item_ts'>{date|pretty-date}\r\n        {.section delete }<a href=\"/transactions/delete/{id}/\">delete</a>{.end}\r\n</div>\r\n        <div class='feed_item_ic_reply' />\r\n        </td></tr>\r\n</table>", "date": "May 29, 2010 16:24:17", "data": {"comment": "A great blog post from an interesting history blog about the first woman lawyer in the United States", "type_comment": 1, "title": "THE CHICAGO HISTORY JOURNAL: Myra Bradwell: Practicing Law is no Place for a Lady", "url": "http://www.chicagohistoryjournal.com/2010/05/myra-bradwell-practicing-law-is-no.html", "sharer": {"pic": "http://profile.ak.fbcdn.net/profile3/1517/101/q500406724_36911.jpg", "id": 2007, "ts": "29-05-10::12:26:56", "name": "Aldon Hynes"}, "expandable": 1, "type": "comment", "stack": "group_2008"}, "id": 11935}, {"index": 0, "sharer_id": 2007, "sender_id": 2008, "app_id": 1, "display": 1, "to_id": null, "template": "<table border='0' width='100%' {.section data}type='{type}' {.section sharer} group='{sender_id}' {.end}{.end} >\r\n  <tr>\r\n    <td rowspan='2' valign='top' width='35px'>\r\n    {.section data}\r\n      {.section type_sharer_user}\r\n        <a href='{sender_profile}'><img src='{sender_pic}' title='{sender_name}' class='icon_profile'/></a>\r\n        <br />\r\n        <img src='/sbmedia/images/users/tiny/{up_id}.png' class='icon_app'/>\r\n      {.end}\r\n      {.section sharer}\r\n          <a href='/surfer/{id}/'><img src='{pic}' title='{name}' class='icon_profile'/></a>\r\n          <br />\r\n             <a href='{sender_profile}'><img src='{sender_pic}' class='icon_app' title='{sender_name} Group' /></a>\r\n        {.end}\r\n    {.end}\r\n    </td>\r\n    <td>\r\n      {.section data}\r\n        {.section del}\r\n         <div class='delete_tran' style='float:right;background:url(http://bruwser.com/sbmedia/images/inner/delete.png) no-repeat;height:9px;width:9px;position:relative;top:-2px;cursor:pointer;' href='/transactions/delete/{id}/'></div>\r\n         {.end}\r\n         {.section type_link }\r\n            <a href = '{url}' title='{title}'>{title|etc}</a>\r\n         {.end}\r\n         {.section type_img }\r\n             <a href='{url}' title='{title}'>{title|etc}</a><br />\r\n             <a href='{url}' >\r\n               <div style='max-height: 135px; overflow: hidden;padding: 3px;'>\r\n         <img style='border: 1px solid rgb(204, 213, 224);background: #FFF;' src='{src}' border='0' width='135px'  />\r\n               </div>\r\n   </a>\r\n         {.end}\r\n         {.section type_direct}\r\n            <a href='{url}' onclick=\"top.Sbrowse.applications.apps.socialbrowse.app.Menu.open('{url}', {chat_id}, '{title}'); return false\" style='color:#3B9CCE'><img src='/sbmedia/images/feed/message.png' class='feed_icon' />Direct Message</a> about:\r\n           <div><a href = '{url}' title='{title}' chat_id='{chat_id}' class='chat_title'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section type_video }\r\n             <a href='{url}' >{title}</a>\r\n     <div>{object}</div>\r\n         {.end}         \r\n         {.section type_comment}\r\n              <div><a href = '{url}' title='{title}'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section comment}\r\n            <a href = '{url}' style='color: #777; font-style: italic;'><img src='http://qwisk.com/sbmedia/images/feed/comment.png' class='feed_icon' />\"{comment|etc}\"</a>          \r\n         {.end}\r\n          {.section type_fan }\r\n            <a href = '{url}' title='{title}'>{title}</a>\r\n         {.end}\r\n      {.end}\r\n     </td>\r\n  </tr>\r\n  <tr><td class='feed_item_details'>\r\n     <div class='feed_item_ts'>{date|pretty-date}\r\n        {.section delete }<a href=\"/transactions/delete/{id}/\">delete</a>{.end}\r\n</div>\r\n        <div class='feed_item_ic_reply' />\r\n        </td></tr>\r\n</table>", "date": "May 10, 2010 16:08:26", "data": {"comment": "The 'Mother's Day reflection' meme circulated widely over the past few days.  However, this unique take on the meme is well worth reading.", "type_comment": 1, "title": "Our Transplant Journey: a Mother's Day reflection", "url": "http://ourtransplantjourney.blogspot.com/2010/05/mothers-day-reflection.html", "sharer": {"pic": "http://profile.ak.fbcdn.net/profile3/1517/101/q500406724_36911.jpg", "id": 2007, "ts": "09-05-10::15:06:19", "name": "Aldon Hynes"}, "expandable": 1, "type": "comment", "stack": "group_2008"}, "id": 11768}, {"index": 0, "sharer_id": 2007, "sender_id": 2008, "app_id": 1, "display": 1, "to_id": null, "template": "<table border='0' width='100%' {.section data}type='{type}' {.section sharer} group='{sender_id}' {.end}{.end} >\r\n  <tr>\r\n    <td rowspan='2' valign='top' width='35px'>\r\n    {.section data}\r\n      {.section type_sharer_user}\r\n        <a href='{sender_profile}'><img src='{sender_pic}' title='{sender_name}' class='icon_profile'/></a>\r\n        <br />\r\n        <img src='/sbmedia/images/users/tiny/{up_id}.png' class='icon_app'/>\r\n      {.end}\r\n      {.section sharer}\r\n          <a href='/surfer/{id}/'><img src='{pic}' title='{name}' class='icon_profile'/></a>\r\n          <br />\r\n             <a href='{sender_profile}'><img src='{sender_pic}' class='icon_app' title='{sender_name} Group' /></a>\r\n        {.end}\r\n    {.end}\r\n    </td>\r\n    <td>\r\n      {.section data}\r\n        {.section del}\r\n         <div class='delete_tran' style='float:right;background:url(http://bruwser.com/sbmedia/images/inner/delete.png) no-repeat;height:9px;width:9px;position:relative;top:-2px;cursor:pointer;' href='/transactions/delete/{id}/'></div>\r\n         {.end}\r\n         {.section type_link }\r\n            <a href = '{url}' title='{title}'>{title|etc}</a>\r\n         {.end}\r\n         {.section type_img }\r\n             <a href='{url}' title='{title}'>{title|etc}</a><br />\r\n             <a href='{url}' >\r\n               <div style='max-height: 135px; overflow: hidden;padding: 3px;'>\r\n         <img style='border: 1px solid rgb(204, 213, 224);background: #FFF;' src='{src}' border='0' width='135px'  />\r\n               </div>\r\n   </a>\r\n         {.end}\r\n         {.section type_direct}\r\n            <a href='{url}' onclick=\"top.Sbrowse.applications.apps.socialbrowse.app.Menu.open('{url}', {chat_id}, '{title}'); return false\" style='color:#3B9CCE'><img src='/sbmedia/images/feed/message.png' class='feed_icon' />Direct Message</a> about:\r\n           <div><a href = '{url}' title='{title}' chat_id='{chat_id}' class='chat_title'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section type_video }\r\n             <a href='{url}' >{title}</a>\r\n     <div>{object}</div>\r\n         {.end}         \r\n         {.section type_comment}\r\n              <div><a href = '{url}' title='{title}'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section comment}\r\n            <a href = '{url}' style='color: #777; font-style: italic;'><img src='http://qwisk.com/sbmedia/images/feed/comment.png' class='feed_icon' />\"{comment|etc}\"</a>          \r\n         {.end}\r\n          {.section type_fan }\r\n            <a href = '{url}' title='{title}'>{title}</a>\r\n         {.end}\r\n      {.end}\r\n     </td>\r\n  </tr>\r\n  <tr><td class='feed_item_details'>\r\n     <div class='feed_item_ts'>{date|pretty-date}\r\n        {.section delete }<a href=\"/transactions/delete/{id}/\">delete</a>{.end}\r\n</div>\r\n        <div class='feed_item_ic_reply' />\r\n        </td></tr>\r\n</table>", "date": "May 06, 2010 15:08:13", "data": {"comment": "One blog I often visit is Outlandish Observations, about Diana Gabaldon's work.  This post, is the second that has been written about Diana Gabaldon's struggles with dealing with Fan Fic.  Well worth the read.", "type_comment": 1, "title": "Outlandish Observations: More on the fan-fiction controversy", "url": "http://outlandishobservations.blogspot.com/2010/05/more-on-fan-fiction-controversy.html", "sharer": {"pic": "http://profile.ak.fbcdn.net/profile3/1517/101/q500406724_36911.jpg", "id": 2007, "ts": "06-05-10::01:36:52", "name": "Aldon Hynes"}, "expandable": 1, "type": "comment", "stack": "group_2008"}, "id": 11699}, {"index": 0, "sharer_id": 2007, "sender_id": 2008, "app_id": 1, "display": 1, "to_id": null, "template": "<table border='0' width='100%' {.section data}type='{type}' {.section sharer} group='{sender_id}' {.end}{.end} >\r\n  <tr>\r\n    <td rowspan='2' valign='top' width='35px'>\r\n    {.section data}\r\n      {.section type_sharer_user}\r\n        <a href='{sender_profile}'><img src='{sender_pic}' title='{sender_name}' class='icon_profile'/></a>\r\n        <br />\r\n        <img src='/sbmedia/images/users/tiny/{up_id}.png' class='icon_app'/>\r\n      {.end}\r\n      {.section sharer}\r\n          <a href='/surfer/{id}/'><img src='{pic}' title='{name}' class='icon_profile'/></a>\r\n          <br />\r\n             <a href='{sender_profile}'><img src='{sender_pic}' class='icon_app' title='{sender_name} Group' /></a>\r\n        {.end}\r\n    {.end}\r\n    </td>\r\n    <td>\r\n      {.section data}\r\n        {.section del}\r\n         <div class='delete_tran' style='float:right;background:url(http://bruwser.com/sbmedia/images/inner/delete.png) no-repeat;height:9px;width:9px;position:relative;top:-2px;cursor:pointer;' href='/transactions/delete/{id}/'></div>\r\n         {.end}\r\n         {.section type_link }\r\n            <a href = '{url}' title='{title}'>{title|etc}</a>\r\n         {.end}\r\n         {.section type_img }\r\n             <a href='{url}' title='{title}'>{title|etc}</a><br />\r\n             <a href='{url}' >\r\n               <div style='max-height: 135px; overflow: hidden;padding: 3px;'>\r\n         <img style='border: 1px solid rgb(204, 213, 224);background: #FFF;' src='{src}' border='0' width='135px'  />\r\n               </div>\r\n   </a>\r\n         {.end}\r\n         {.section type_direct}\r\n            <a href='{url}' onclick=\"top.Sbrowse.applications.apps.socialbrowse.app.Menu.open('{url}', {chat_id}, '{title}'); return false\" style='color:#3B9CCE'><img src='/sbmedia/images/feed/message.png' class='feed_icon' />Direct Message</a> about:\r\n           <div><a href = '{url}' title='{title}' chat_id='{chat_id}' class='chat_title'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section type_video }\r\n             <a href='{url}' >{title}</a>\r\n     <div>{object}</div>\r\n         {.end}         \r\n         {.section type_comment}\r\n              <div><a href = '{url}' title='{title}'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section comment}\r\n            <a href = '{url}' style='color: #777; font-style: italic;'><img src='http://qwisk.com/sbmedia/images/feed/comment.png' class='feed_icon' />\"{comment|etc}\"</a>          \r\n         {.end}\r\n          {.section type_fan }\r\n            <a href = '{url}' title='{title}'>{title}</a>\r\n         {.end}\r\n      {.end}\r\n     </td>\r\n  </tr>\r\n  <tr><td class='feed_item_details'>\r\n     <div class='feed_item_ts'>{date|pretty-date}\r\n        {.section delete }<a href=\"/transactions/delete/{id}/\">delete</a>{.end}\r\n</div>\r\n        <div class='feed_item_ic_reply' />\r\n        </td></tr>\r\n</table>", "date": "April 26, 2010 14:44:54", "data": {"comment": "Be The Change is a great blog with some interesting stories about how we can make the world a better place.  I'm not sure what I think of this idea, but it is enteresting.", "type_comment": 1, "title": "Be The Change: Cow Power - Using A Treadmill!", "url": "http://tobethechange.blogspot.com/2010/04/cow-power-using-treadmill.html", "sharer": {"pic": "http://profile.ak.fbcdn.net/profile3/1517/101/q500406724_36911.jpg", "id": 2007, "ts": "25-04-10::19:18:39", "name": "Aldon Hynes"}, "expandable": 1, "type": "comment", "stack": "group_2008"}, "id": 11560}, {"index": 0, "sharer_id": 2007, "sender_id": 2008, "app_id": 1, "display": 1, "to_id": null, "template": "<table border='0' width='100%' {.section data}type='{type}' {.section sharer} group='{sender_id}' {.end}{.end} >\r\n  <tr>\r\n    <td rowspan='2' valign='top' width='35px'>\r\n    {.section data}\r\n      {.section type_sharer_user}\r\n        <a href='{sender_profile}'><img src='{sender_pic}' title='{sender_name}' class='icon_profile'/></a>\r\n        <br />\r\n        <img src='/sbmedia/images/users/tiny/{up_id}.png' class='icon_app'/>\r\n      {.end}\r\n      {.section sharer}\r\n          <a href='/surfer/{id}/'><img src='{pic}' title='{name}' class='icon_profile'/></a>\r\n          <br />\r\n             <a href='{sender_profile}'><img src='{sender_pic}' class='icon_app' title='{sender_name} Group' /></a>\r\n        {.end}\r\n    {.end}\r\n    </td>\r\n    <td>\r\n      {.section data}\r\n        {.section del}\r\n         <div class='delete_tran' style='float:right;background:url(http://bruwser.com/sbmedia/images/inner/delete.png) no-repeat;height:9px;width:9px;position:relative;top:-2px;cursor:pointer;' href='/transactions/delete/{id}/'></div>\r\n         {.end}\r\n         {.section type_link }\r\n            <a href = '{url}' title='{title}'>{title|etc}</a>\r\n         {.end}\r\n         {.section type_img }\r\n             <a href='{url}' title='{title}'>{title|etc}</a><br />\r\n             <a href='{url}' >\r\n               <div style='max-height: 135px; overflow: hidden;padding: 3px;'>\r\n         <img style='border: 1px solid rgb(204, 213, 224);background: #FFF;' src='{src}' border='0' width='135px'  />\r\n               </div>\r\n   </a>\r\n         {.end}\r\n         {.section type_direct}\r\n            <a href='{url}' onclick=\"top.Sbrowse.applications.apps.socialbrowse.app.Menu.open('{url}', {chat_id}, '{title}'); return false\" style='color:#3B9CCE'><img src='/sbmedia/images/feed/message.png' class='feed_icon' />Direct Message</a> about:\r\n           <div><a href = '{url}' title='{title}' chat_id='{chat_id}' class='chat_title'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section type_video }\r\n             <a href='{url}' >{title}</a>\r\n     <div>{object}</div>\r\n         {.end}         \r\n         {.section type_comment}\r\n              <div><a href = '{url}' title='{title}'>{title|etc}</a></div>\r\n         {.end}\r\n         {.section comment}\r\n            <a href = '{url}' style='color: #777; font-style: italic;'><img src='http://qwisk.com/sbmedia/images/feed/comment.png' class='feed_icon' />\"{comment|etc}\"</a>          \r\n         {.end}\r\n          {.section type_fan }\r\n            <a href = '{url}' title='{title}'>{title}</a>\r\n         {.end}\r\n      {.end}\r\n     </td>\r\n  </tr>\r\n  <tr><td class='feed_item_details'>\r\n     <div class='feed_item_ts'>{date|pretty-date}\r\n        {.section delete }<a href=\"/transactions/delete/{id}/\">delete</a>{.end}\r\n</div>\r\n        <div class='feed_item_ic_reply' />\r\n        </td></tr>\r\n</table>", "date": "April 23, 2010 19:28:45", "data": {"comment": "Great blog post about Alzheimer's patients waiting for the bus", "type_comment": 1, "title": "Cromely's World: Stop Alzheimer\u2019s and Dementia patients from wandering off", "url": "http://cromely.blogspot.com/2010/04/stop-alzheimers-and-dementia-patients.html", "sharer": {"pic": "http://profile.ak.fbcdn.net/profile3/1517/101/q500406724_36911.jpg", "id": 2007, "ts": "22-04-10::18:56:30", "name": "Aldon Hynes"}, "expandable": 1, "type": "comment", "stack": "group_2008"}, "id": 11507}];
var site_url = 'http://qwisk.com/';
site_url = site_url.slice(0, site_url.length-1);
var proxy_url = 'http://qwisk.com/#url=';
var v = new Date();;
var div = document.getElementById('qwisk-content');

document.getElementById('qwisk-header').innerHTML = "<a href='" + group_url + "'>" + bob + " on Qwisk</a>";
document.getElementById('qwisk-footer').innerHTML = "<span id='qwisk-join'><a href='http://qwisk.com/?users=1,2,2008#url=http://qwisk.com//surfer/2008/?login=true'>Join the discussion!</span></span>"


function renderTransactions(tl) {
    var n = tl.length;

    div.innerHTML = "";
if (n > 0) {

	while (n--) {
		var t = tl[n];
		
		t.date = new Date(t.date);
		var template = jsontemplate.Template(t.template, {
			'undefined_str': ""
		});
		
		try {
			var rendered_item = template.expand(t);
		} 
		catch (err) {
		}
		// Append the transaction to the list
		div.innerHTML = rendered_item + div.innerHTML;
		
	}
	
	var links = div.getElementsByTagName('a');
	n = links.length;
	while (n--) {
		var link = links[n];
		var href = link.getAttribute('href');
		link.setAttribute('href', proxy_url + href);
		link.setAttribute('target', '_blank');
	}
	
	var images = div.getElementsByTagName('img');
	n = images.length;
	while (n--) {
		var image = images[n];
		var src = image.getAttribute('src');
		if (src && src.slice(0, 4) != 'http') {
			// This is a relative link
			image.setAttribute('src', site_url + src);
		}
	}
}else {
	div.innerHTML="<a href='http://qwisk.com//surfer/2008/' target='_blank'><img src='http://qwisk.com/sbmedia/images/misc/widget_default.png' border='0'/></a>";
}

}

    function getAndRender() {

	function sendRequest(url,callback,postData) {
	    var req = createXMLHTTPObject();
	    if (!req) return;
	    var method = (postData) ? "POST" : "GET";
	    req.open(method,url,true);
	    req.setRequestHeader('User-Agent','XMLHTTP/1.0');
	    if (postData)
		req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	    req.onreadystatechange = function () {
		if (req.readyState != 4) return;
		if (req.status != 200 && req.status != 304) {
		    //alert('HTTP error ' + req.status);
		    return;
		}
		callback(req);
	    }
	    if (req.readyState == 4) return;
	    req.send(postData);
	}

var XMLHttpFactories = [
			function () {return new XMLHttpRequest()},
			function () {return new ActiveXObject("Msxml2.XMLHTTP")},
			function () {return new ActiveXObject("Msxml3.XMLHTTP")},
			function () {return new ActiveXObject("Microsoft.XMLHTTP")}
			];

function createXMLHTTPObject() {
    var xmlhttp = false;
    for (var i=0;i<XMLHttpFactories.length;i++) {
	try {
	    xmlhttp = XMLHttpFactories[i]();
	}
	catch (e) {
	    continue;
	}
	break;
    }
    return xmlhttp;
}

         sendRequest('http://qwisk.com//surfer/widget/transactions/2008/', function(o) { 
		renderTransactions(eval(o.responseText));
	     });
    }

renderTransactions(orig_transactions);


// Poll for transactions every 5 minutes
setInterval('getAndRender()', 300000);
