
function getQuery(s) {
  var query = {};

  s.replace(/\b([^&=]*)=([^&=]*)\b/g, function (m, a, d) {
    if (typeof query[a] != 'undefined') {
      query[a] += ',' + d;
    } else {
      query[a] = d;
    }
  });
  return query;
}

function getLastChild(el) {
  return (el.lastChild && el.lastChild.nodeName != '#text') ? getLastChild(el.lastChild) : el;
}

var query = getQuery(getLastChild(document.lastChild).getAttribute('src').replace(/.*\?/, ''));

var gw_backgroundColor = '#'+query['bkgcolor'];
var gw_textColor = '#'+query['text_color'];
var gw_borderColor = '#'+query['border_color'];
var gw_width = query['width'].replace(/__/,'%');
var gw_fontFace = query['fontfam'];
var gw_fontSize = query['fontsize'];
var gw_fontSizePlus = parseFloat(gw_fontSize) + 3;
var gw_fontSizeDoublePlus = parseFloat(gw_fontSize) + 6;
var love_groups = query['love_groups'];

var css = '<style type="text/css">'+
'#gw_main { width: ' + gw_width + '; }'+
'#g_widget { color: ' + gw_textColor + '; border: 1px solid ' + gw_borderColor + '; padding: 1px; font: ' + gw_fontSize + 'px/' + gw_fontSizeDoublePlus + 'px ' + gw_fontFace + '; color: ' + gw_textColor + '; }'+
'#g_widget a { color: ' + gw_textColor + '; }'+
'	.clear { clear: both; }'+
'	#gw_header { border-top: 0; padding: 5px; border-bottom: 1px solid ' + gw_borderColor + '; }'+
'	#gw_site { text-decoration: none; font-size: ' + gw_fontSizePlus + 'px; font-weight: bold; }'+
'	#gw_site:hover { text-decoration: underline; }'+
'	#gw_logo img { float: right; margin: 0 0 0 10px; border: 0; }'+
'	#gw_content { }'+
'	.gw_section { background: ' + gw_backgroundColor + '; border-bottom: 1px solid ' + gw_borderColor + '; padding: 5px; }'+
'	.gw_section a { text-decoration: underline; }'+
'	.gw_section a:hover { text-decoration: none; }'+
'	.gw_section p { margin: 0 0 5px 0; padding: 0; }'+
'	.gw_picture_list, .gw_list { margin: 0 0 0 0px; padding: 0; }'+
'	.gw_list li { list-style: square; margin: 0 0 0 20px; }'+
'	.gw_picture_list li { background-repeat: no-repeat; padding: 0 0 0 20px; list-style: none; }'+
'	.gw_thumbs img { border: 1px solid ' + gw_borderColor + '; padding: 1px; }'+
'	#gw_footer { border-bottom: 0; padding: 5px; font-size: ' + gw_fontSizePlus + 'px; font-weight: bold; text-align: center; }'+
'	#gw_footer a { text-decoration: none; }'+
'	#gw_footer a:hover { text-decoration: underline; }'+
'	#gw_groups { border-top: 1px solid ' + gw_borderColor + '; background: #fff; padding: 1px 0 0 0; }'+
'	#gw_groups a { background: url(http://grou.ps/images/banner_love_groups_small.png) no-repeat; display: block; height: 23px; text-indent: -9999px; }'+
'	#gw_share { text-indent: -99999px; height: 11px; }'+
'	#gw_share a { width: 65px; height: 10px; display: block; float: right; border: 1px solid ' + gw_borderColor + '; background: url(http://grou.ps/images/add_this.png) no-repeat; border-bottom: 0; }'+
'</style>';

var html = '<div id="gw_main">';

html += '<div id="gw_share">'+
'		<a href="javascript:;" onclick=window.open("http://grou.ps/gw_prep.php?group_id=12830&width=196px&fontfam=arial,%20helvetica,%20sans-serif&fontsize=11&bkgcolor=D4F5BD&text_color=666&border_color=a4a4a4&gw_m_people=1&gw_m_people_amount=3&gw_m_blogs=1&gw_m_blogs_amount=3&gw_m_talks=1&gw_m_talks_amount=3&gw_m_photos=1&gw_m_photos_amount=3&gw_m_links=1&gw_m_links_amount=3&gw_m_wiki=1&gw_m_wiki_amount=3&gw_m_calendar=1&gw_m_calendar_amount=0&gw_m_groups=1&gw_m_groups_amount=0&gw_m_videos=1&gw_m_videos_amount=0&gw_m_files=1&gw_m_files_amount=0&gw_m_latest=1&gw_m_latest_amount=3&love_groups=1","gw","menubar=no,width=820,height=500,toolbar=no,scrollbars=yes")>Get this on your blog</a>'+
'	</div>';

html += '<div id="g_widget">'+
'	<div id="gw_header" class="gw_section">'+
'		<div id="gw_logo"><a href="http://grou.ps/thecurrins"><img src="http://grou.ps/wysiwyg_files/GroupLogos/thecurrins/80.png?5355300" width="45" height="45" alt="Currin Family and friends with Mei and John," /></a></div>'+
'		<a href="http://grou.ps/thecurrins" id="gw_site">Currin Family and friends with Mei and John,</a><br />'+
'		Finding  Currin Families & their friends wherever they may be<br /><em>22 members and counting</em>'+
'		<div class="clear"></div>'+
'	</div>'+
'	<div id="gw_content">'+
'		<div class="gw_section" id="gw_latest_activities">'+
'			<p><strong>Latest Activities</strong></p>'+
'			<ul class=\"gw_picture_list\">		<li  style=\"background-image:url(http://grou.ps/images/famfamfam/comment.png);\">			<a href=\"http://grou.ps/thecurrins/people/ewoletbuauatnwwpw\" title=\"njohncurrin\">njohncurrin</a> Enjoying the sun but outside is cool at -10c <small>3 days ago</small></li>		<li  style=\"background-image:url(http://grou.ps/images/famfamfam/page_white_text.png);\">			<a href=\"http://grou.ps/thecurrins/people/ewoletbuauatnwwpw\" title=\"njohncurrin\">njohncurrin</a> added a new <a href=\"http://grou.ps/thecurrins/blogs/76492\" title=\"Some funnies\">blog entry</a>. <small>13 days ago</small></li>		<li  style=\"background-image:url(http://grou.ps/images/famfamfam/page_white_text.png);\">			<a href=\"http://grou.ps/thecurrins/people/ewoletbuauatnwwpw\" title=\"njohncurrin\">njohncurrin</a> added a new <a href=\"http://grou.ps/thecurrins/blogs/76363\" title=\"Mysterious hole in the roof\">blog entry</a>. <small>13 days ago</small></li></ul>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_people">'+
'			<p><strong>Members</strong></p>'+
'			<div class="gw_thumbs">'+
'				<a href=\"http://grou.ps/thecurrins/people/person/ruorkamonmquzlrdc\" title=\"Jane McGrath\"><img src=\"http://s3.amazonaws.com/silo.grou.ps/avatars/2942088/80.png?574296488\" width=\"32\" height=\"32\" border=\"0\" alt=\"Jane McGrath\" style=\"\"  /></a> <a href=\"http://grou.ps/thecurrins/people/person/wwgvdawyfenrlujkz\" title=\"Shane Radcliffe\"><img src=\"http://s3.amazonaws.com/silo.grou.ps/avatars/2834843/80.png?1738828764\" width=\"32\" height=\"32\" border=\"0\" alt=\"Shane Radcliffe\" style=\"\"  /></a> <a href=\"http://grou.ps/thecurrins/people/person/eplgpbyffvwgzcwte\" title=\"Mei\"><img src=\"http://s3.amazonaws.com/silo.grou.ps/avatars/1452728/80.png?1145104486\" width=\"32\" height=\"32\" border=\"0\" alt=\"Mei\" style=\"\"  /></a>  '+
'			</div>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_files">'+
'			<p><strong>Latest Files</strong></p>'+
'			<ul class="gw_list"></ul>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_photos">'+
'			<p><strong>Latest Photos</strong></p>'+
'			<div class="gw_thumbs">'+
'				<a href=\"http://grou.ps/thecurrins/photos/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vc2lsby5ncm91LnBzL3VzZXJpbWFnZXMvdGhlY3Vycmlucy8yMDA4MDYyOTIzMjQxNy1ld29sZXRidWF1YXRud3dwdy5qcGc,\"><img height=\"45\" src=\"http://s3.amazonaws.com/silo.grou.ps/userimages/thecurrins/t/20080629232417-ewoletbuauatnwwpw.jpg\" alt=\"\" /></a>  '+
'			</div>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_videos">'+
'			<p><strong>Latest Videos</strong></p>'+
'			<div class="gw_thumbs">'+
'				<a href=\"http://grou.ps/thecurrins/videos/47457\"><img height=\"45\" src=\"http://i.ytimg.com/vi/aEJq98WDiF0/default.jpg\" alt=\"Part 3\" /></a> <a href=\"http://grou.ps/thecurrins/videos/47452\"><img height=\"45\" src=\"http://i.ytimg.com/vi/I4gEkSerU9Q/default.jpg\" alt=\"Part 2\" /></a> <a href=\"http://grou.ps/thecurrins/videos/47442\"><img height=\"45\" src=\"http://i.ytimg.com/vi/KhJ5tWq7Fcg/default.jpg\" alt=\"john as Santa\" /></a>  '+
'			</div>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_blogs">'+
'			<p><strong>Latest Blogs</strong></p>'+
'			<ul class="gw_list">'+
'				<li><a href=\"http://johnandmei.spaces.live.com/Blog/cns!E1EDE0AA905EF741!1364.entry\">Early morning start</a></li> <li><a href=\"http://cid-e1ede0aa905ef741.skydrive.live.com/browse.aspx/.res/E1EDE0AA905EF741!1355?ct=photos\">Snow this morning</a></li> <li><a href=\"http://share.ovi.com/media/jcinanshan.public/jcinanshan.13608\">Recently Updated.wmv</a></li> 		'+
'			</ul>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_links">'+
'			<p><strong>Latest Links</strong></p>'+
'			<ul class="gw_list">'+
'				<li><a href=\"http://friendfeed.com/john-currin\">Friendfeed</a></li> <li><a href=\"http://www.myebook.com/jcinanshan/\">Trying to put a book of my life together</a></li> <li><a href=\"http://www.imeem.com/jcinanshan\">Music, pics and videos on Imeem</a></li> 	'+
'			</ul>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_talks">'+
'			<p><strong>Latest Talks</strong></p>'+
'			<ul class="gw_list">'+
'				<li><a href=\"http://grou.ps/thecurrins/talks/191952\">Currin people and friends - join us here</a></li> 	'+
'			</ul>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_wiki">'+
'			<p><strong>Latest Wiki Pages</strong></p>'+
'			<ul class="gw_list">'+
'				<li><a href=\"http://grou.ps/thecurrins/wiki/138293\">John and Meis videos on Viddler</a></li> <li><a href=\"http://grou.ps/thecurrins/wiki/111473\">John and Mei\'s video\'s on Vimeo</a></li> <li><a href=\"http://grou.ps/thecurrins/wiki/111468\">John and Meis videos on Viddler</a></li>  		'+
'			</ul>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_events">'+
'			<p><strong>Upcoming Events</strong></p>'+
'			<ul class="gw_list">'+
'				<li><a href=\"http://grou.ps/thecurrins/calendar/event/3807\">Currin Family reunion</a></li> '+
'			</ul>'+
'		</div>'+
'		<div class="gw_section" id="gw_m_groups">'+
'			<p><strong>Latest Groups</strong></p>'+
'			<ul class="gw_list">'+
'				<li><a href=\"http://grou.ps/thecurrins/groups/4602\">Currin Family in New Zealand</a></li> 	'+
'			</ul>'+
'		</div>'+

'	</div>';
html +='	<div id="gw_footer" class="gw_section">'+
'		<a href="http://grou.ps/thecurrins/join" target="_blank">Join Our Group</a>'+
'	</div>';
if(love_groups==1) {
html +='	<div id="gw_groups">'+
'		<a href="http://grou.ps">Powered by GROU.PS</a>'+
'	</div>';
}
html += '</div></div>';


document.write(css + html);

