

var cimFeedUrl = "http://feeds.feedburner.com/MichiganMessenger-FrontPage";

var cimFeed = {"channel":{"title":"Michigan Messenger - Front Page","link":"http:\/\/www.michiganmessenger.com","description":"Michigan Messenger","lastbuilddate":"Sat, 10 May 2008 20:38:11 GMT","tagline":"Michigan Messenger"},"items":[{"title":"Smoking Ban exposes Bishop and eleven other Republican senators who voted against  it","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1238"},{"title":"Sen. Levin announces plans to go after rising gas prices","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1236"},{"title":"Levin addresses Michigan Policy Summit","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1235"},{"title":"We the people in order to form a more perfect union...","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1234"},{"title":"State Senate Votes to Ban Smoking in Restaurants","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1233"},{"title":"Fieger trial serves up plenty of courtroom drama","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1232"},{"title":"Obama Wins More Labor Support After Bonior Nod","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1231"},{"title":"Criminal investigations in Cedar Fest riots continue","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1230"},{"title":"Second annual Michigan Policy Summit slated for Saturday","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1229"},{"title":"Supporters of anti-bullying legislation use Florida bill passage to call for action locally","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1228"},{"title":"John Edwards: Did he, or didn't he vote for Obama?","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1227"},{"title":"Home foreclosure crisis kicks desperate families to the curb","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1226"},{"title":"What's new at Michigan Messenger","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1225"},{"title":"Frankenmuth the latest battleground in religious symbol debate","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1224"},{"title":"Bonior Endorses Obama","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1223"},{"title":"Kids Exercise on Capitol Lawn","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1222"},{"title":"He's back","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1221"},{"title":"Michigan Messenger reporter Todd Heywood on Sirius Radio Out Q","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1220"},{"title":"Violent attack shocks mine opponents","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1219"},{"title":"Florida group fighting for marriage equality says Michigan court ruling harbinger of things to come","link":"http:\/\/www.michiganmessenger.com\/showDiary.do?diaryId=1218"}]};
/* prototype lite minified */

var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}}
Object.extend=function(destination,source){for(property in source)destination[property]=source[property];return destination;}
Function.prototype.bind=function(object){var __method=this;return function(){return __method.apply(object,arguments);}}
Function.prototype.bindAsEventListener=function(object){var __method=this;return function(event){__method.call(object,event||window.event);}}
function $(){if(arguments.length==1)return get$(arguments[0]);var elements=[];$c(arguments).each(function(el){elements.push(get$(el));});return elements;function get$(el){if(typeof el=='string')el=document.getElementById(el);return el;}}
if(!window.Element)var Element=new Object();Object.extend(Element,{remove:function(element){element=$(element);element.parentNode.removeChild(element);},hasClassName:function(element,className){element=$(element);if(!element)return;var hasClass=false;element.className.split(' ').each(function(cn){if(cn==className)hasClass=true;});return hasClass;},addClassName:function(element,className){element=$(element);Element.removeClassName(element,className);element.className+=' '+className;},removeClassName:function(element,className){element=$(element);if(!element)return;var newClassName='';element.className.split(' ').each(function(cn,i){if(cn!=className){if(i>0)newClassName+=' ';newClassName+=cn;}});element.className=newClassName;},cleanWhitespace:function(element){element=$(element);$c(element.childNodes).each(function(node){if(node.nodeType==3&&!/\S/.test(node.nodeValue))Element.remove(node);});},find:function(element,what){element=$(element)[what];while(element.nodeType!=1)element=element[what];return element;}});var Position={cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[valueL,valueT];}};document.getElementsByClassName=function(className){var children=document.getElementsByTagName('*')||document.all;var elements=[];$c(children).each(function(child){if(Element.hasClassName(child,className))elements.push(child);});return elements;}
Array.prototype.each=function(func){for(var i=0;ob=this[i];i++)func(ob,i);}
function $c(array){var nArray=[];for(i=0;el=array[i];i++)nArray.push(el);return nArray;}/* writes a rss box for newjournalist.org  sites*/


// private variables
if (!cimArrow)
	var cimArrow = 'http://rss.newjournalist.org/img/arrowBlue.gif';

if (!cimArrowOver)
	var cimArrowOver = 'http://rss.newjournalist.org/img/arrowOrange.gif';

if (!rssIcon)
	var rssIcon = 'http://rss.newjournalist.org/img/rss24mi.gif';

if (!cimBottomImage)
	var cimBottomImage =  "http://rss.newjournalist.org/img/miMessengerBoxBottom.jpg";
	
if (!cimHeadline)
	var cimHeadline = "MORE FROM";
	
if (!cimHeadline2)
	var cimHeadline2 = "Michigan Messenger";
	
if (!cimHeadlineColor)
	var cimHeadlineColor = "#dd7000";

if (!cimHeadline2Color)
	var cimHeadline2Color = "#004080";	
	
if (!cimBorderColor)
	var cimBorderColor = "#afacbd";
	
if (!cimBackgroundColor)
	var cimBackgroundColor = "#fff";

if (!cimNewsBorderColor)
	var cimNewsBorderColor = "#004080";
	
if (!cimItemColor)
	var cimItemColor = "#000";
	
if (!cimItemColorOver)
	var cimItemColorOver = "#dd7000";
	
	if (!cimContainerWidth)
		var cimContainerWidth = "166";	
	
var cimMaxHeight = 208;
with(document){
	write('<div style=" height: 286px; width: '+cimContainerWidth+'px; border: 1px solid '+cimBorderColor+'; background: '+cimBackgroundColor+' url(\''+cimBottomImage+'\') no-repeat bottom left; text-align: left; font: bold 10px/12px Arial, Helvetica, sans-serif; padding: 7px;" id="cimFeedBox">');

	write('\t <h2 style="padding:0px 0px 2px 0px; margin:0px; text-align: left; font: bold 10px/12px Arial, Helvetica, sans-serif; color: '+cimHeadlineColor+';">'+cimHeadline+'</h2>');	
	write('\t <h1 style="text-align: left; font: bold 16px/19px Arial, Helvetica, sans-serif; margin:0px; padding:0px 0px 2px 0px;"><a href="'+cimFeed.channel.link+'" style="color: '+cimHeadline2Color+'; text-decoration: none;">'+ cimFeed.channel.tagline +'</a></h1>');	

	write('\t <div id="cimNewsBox" style="border-top: 1px solid '+cimNewsBorderColor+'; width:'+cimContainerWidth+'px; height: 0px; overflow: hidden;padding-top: 3px">');
	write('<style type="text/css" media="screen">');
	write('ul#cimFeedList{ margin: 0px; padding: 0px 0px 0px 17px; letter-spacing: -0.2px; line-height: 14.2px; text-align: left; font: bold 12px/14px Arial, Helvetica, sans-serif;}');
	write('ul#cimFeedList li{ list-style: none outside url('+cimArrow+'); margin-bottom: 4px; }');
	write('ul#cimFeedList li:hover{ list-style: none outside url('+cimArrowOver+'); }');
	write('ul#cimFeedList li a{ color: '+cimItemColor+'; text-decoration: none;}');
	write('ul#cimFeedList li a:hover{ color: '+cimItemColorOver+';');
	write('');
	write('');
	write('</style>');
	write('\t <ul id="cimFeedList">');
}

for (var i=0; i < cimFeed.items.length; i++) {	document.write('\t\t <li class="cimNewsItem"><a href="'+ cimFeed.items[i].link +'">'+ cimFeed.items[i].title + '</a></li>');};

with(document){
	write('\t </ul>');
	write('\t </div>');
	
	if (cimContainerWidth == 166){
		write('<a href="'+ cimFeedUrl +'" style="border:0; margin: 27px 0px 0px 154px; height: 16px; width: 16px; display: none;" id="cimRssLink"><img src="http://rss.newjournalist.org/img/rssIcon.gif" alt="rssIcon" style="border:0;"/></a>');
	} else {
		write('<a href="'+ cimFeedUrl +'" style="border:0; margin: 18px 0px 0px 165px; height: 24px; width: 24px; display: none;" id="cimRssLink"><img src="'+rssIcon+'" alt="rssIcon" style="border:0;"/></a>');
	}
	

	
	

	write('<!-- feed updated: '+cimFeed.channel.lastbuilddate+' -->')
	write('</div>');
}



var cimLis = document.getElementsByClassName('cimNewsItem');
var cimHeight = 0;
cimLis.each(function(cimLi){
	cimHeight += cimLi.scrollHeight+4;
	if (cimHeight >cimMaxHeight){
		cimLi.style.display="none";
	}
});
$('cimNewsBox').style.height= cimMaxHeight+"px";
$('cimRssLink').style.display= "block";

