   var postImg_MaxWidth = screen.width - 202;
   var postImgAligned_MaxWidth = Math.round(screen.width/3);
   var attachImg_MaxWidth = screen.width - 280;
   var ExternalLinks_InNewWindow = '1';

  function copyText_writeLink(node)
  {
	if (!is_ie) return;
  	document.write('<p style="float: right;"><a class="txtb" onclick="if (ie_copyTextToClipboard('+node+')) alert(\'Кода е копиран в буфера за обмен\'); return false;" href="#">Копиране в буфера за обмен</a></p>');
  }
  function initPostBBCode(context)
  {
	initSpoilers(context);
  	imgFit_Onload(context);
  	initExternalLinks(context);
  }
  function initSpoilers(context)
  {
  	var context = context || 'body';
   	$('div.spoiler-head', $(context))
  		.click(function(){
  			$(this).toggleClass('unfolded');
    			$(this).next('div.spoiler-body').slideToggle('fast');
  		})
  	;
  }
  function initExternalLinks(context)
  {
	var context = context || 'body';
	if (ExternalLinks_InNewWindow) {
		$("a.postLink:not([href*='"+ window.location.hostname +"/'])", $(context))
			.bind("click", function(){ return !window.open(this.href); })
		;
	}
  }
  $(document).ready(function(){
  	initSpoilers('body');
  	initExternalLinks();
  });
<!--  $(window).load(function(){ imgFit_Onload('body'); });-->

