// ==UserScript==
// @name           autoShrink
// @namespace      http://tuzemec.com
// @description    Auto-shrinks the long entries and design enchancer for http://blogosfera.dnevnik.bg/ 
// @include        http://blogosfera.dnevnik.bg/
// ==/UserScript==

// by tuzemec@tuzemec.com

	GM_addStyle ("body {background: #fff !important}");
	GM_addStyle (".blogosfera {width: auto; margin: 0 1em;}");
	GM_addStyle ("#content {margin-right: 320px; width: auto !important;}");
	GM_addStyle ("#blogholder {position: relative; }");
	GM_addStyle ("#sidebar {float: none; right: 16px; position: absolute; }");
	GM_addStyle (".post-contents {width: auto !important}");

	var asLimit = 600; // height limit in pixels
	var w = unsafeWindow;
	var jq = w.jQuery;
	
	w.initSingleShowRegime = function () {}; // overwrite the initSingleShowRegime function to prevent initialization
			
	jq(".entry").each(function(i, el) {
		if ( el.offsetHeight > asLimit)
			w.setSingleShowRegime( jq("span.commlink2 > a:first", el)[0] );
	});		

	

