var url_location = window.location.href;
var thumb_mouse_x=0;
var thumb_mouse_y=0;
var BigImagePreview;
var BigImagePreviewTip;
var jq_entered=0;

/*
function add_image_preview(tip_no)
{
	if (hide_image_preview==1) return;
	$("div.post-text-holder span.tip"+tip_no).hover(function(){
	        BigImagePreviewTip = $(this).find('.tip');
	        if (BigImagePreviewTip.length)
	        {
		        if (!BigImagePreviewTip.is(":visible")) 
		        {
	 				BigImagePreview = BigImagePreviewTip.find('img');
	  				var alt = BigImagePreview.attr('alt');
	  				BigImagePreview.attr('src', alt);
	
			        BigImagePreviewTip.show();
			        BigImagePreviewTip.css({ 'z-index': '999999', 'position': 'absolute', 'display': 'inline' });
			        
			        $(BigImagePreview).load(function() {
						var rez=0;
						var coef=0;
						var imgWidth = BigImagePreview.width();
						var imgHeight = BigImagePreview.height();
				        var winWidth = $(window).width();
				        var winHeight = $(window).height();
				        var winScrollTop = $(window).scrollTop();
				        var tipWidth = BigImagePreviewTip.width();
				        var tipHeight = BigImagePreviewTip.height();
				        var tipTop = BigImagePreviewTip.offset().top;
				        var mousey = winScrollTop - 205;
	
						if (mousey<205 && winScrollTop>205) mousey=205;
				        if (winScrollTop<205) mousey=0;
	
						if ( tipTop + tipHeight + 205 > winScrollTop + winHeight || tipTop + 205 < winScrollTop )
						{
							BigImagePreviewTip.css({ 'top': mousey });
							tipTop=mousey;
						}
						
						if (mousey==0)
						{
							winHeight=winHeight - (205 - winScrollTop);
						}

						if (imgWidth+40 > winWidth )
						{
							coef = imgWidth/(winWidth-40);
							imgWidth = imgWidth/coef;
							imgHeight = imgHeight/coef;
							rez=1;
						}
						if (imgHeight+40 > winHeight )
						{
							coef = imgHeight/(winHeight-40);
							imgHeight = imgHeight/coef;
							imgWidth = imgWidth/coef;
							rez=1;
						}
			
						if (rez)
						{
							BigImagePreviewTip.css({ 'left': 20, 'top': mousey });						
							BigImagePreview.css({ 'width': imgWidth, 'height': imgHeight });
						}
					});
	
		        }
	        }
	}, function() {
	        if (BigImagePreviewTip.length)
	        {
		        if (BigImagePreviewTip.is(":visible")) 
		        {
			        BigImagePreviewTip.hide();
			        thumb_mouse_x=0;
			        thumb_mouse_y=0;
		        }
	        }
	}).mousemove(function(e) {
		if (BigImagePreviewTip.length)
		{
			if (BigImagePreviewTip.is(":visible"))
			{
				if (thumb_mouse_x==0)
				{
					thumb_mouse_x=e.pageX;
					thumb_mouse_y=e.pageY;
				}
				else
				{
					var razlika_x = thumb_mouse_x - e.pageX;
					var razlika_y = thumb_mouse_y - e.pageY;
					if (razlika_x>160 || razlika_x<-160 || razlika_y>160 || razlika_y<-160)
					{
				        BigImagePreviewTip.hide();
				        thumb_mouse_x=0;
				        thumb_mouse_y=0;
				        return $(this);
					}
				}
		        var mousex = e.pageX + 20;
		        var winWidth = $(window).width();
		        var winHeight = $(window).height();
		        var tipWidth = BigImagePreviewTip.width();
		        var tipHeight = BigImagePreviewTip.height();
		        var tipTop = BigImagePreviewTip.offset().top;
		        var winScrollTop = $(window).scrollTop();
		        var mousey = winScrollTop-205;
	
		        var tipVisX = winWidth - (mousex + tipWidth);
		
		        if ( tipVisX < 20 ) {
		            mousex = 20;
		        }
				if  (mousey<205 && winScrollTop>205) mousey=205;
		        if (winScrollTop<205) mousey=0;
				if ( tipTop + tipHeight + 205 > winScrollTop + winHeight || tipTop + 205 < winScrollTop )
				{
					BigImagePreviewTip.css({ 'left': mousex, 'top': mousey });
					tipTop=mousey;
				}
				else BigImagePreviewTip.css({ 'left': mousex });
				
				if (mousey==0)
				{
					winHeight=winHeight - (205 - winScrollTop);
				}
				
				var rez=0;
				var coef=0;
				var imgWidth = BigImagePreview.width();
				var imgHeight = BigImagePreview.height();
	
				if (imgWidth+40 > winWidth )
				{
					coef = imgWidth/(winWidth-40);
					imgWidth = imgWidth/coef;
					imgHeight = imgHeight/coef;
					rez=1;
				}
				if (imgHeight+40 > winHeight )
				{
					coef = imgHeight/(winHeight-40);
					imgHeight = imgHeight/coef;
					imgWidth = imgWidth/coef;
					rez=1;
				}
	
				if (rez)
				{
					BigImagePreview.css({ 'width': imgWidth, 'height': imgHeight });
				}
	        }
	    }
	 });
}
*/
function resizeimg()
{
/*   if (document.getElementsByTagName)
   {
      for (i=0; i<document.getElementsByTagName('img').length; i++)
      {
         im = document.getElementsByTagName('img')[i];
         if (im.width > 470 && im.title != 'original_picture')
         {
            im.style.width = '470px';
            eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + "','gi ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")");
            eval("im.onclick = pop" + String(i) + ";");
            if (document.all) im.style.cursor = 'hand';
            if (!document.all) im.style.cursor = 'pointer';
            im.title = '[+] Klikni na sliku za punu rezoluciju';
         }
      }
   }
   */
/*	var imgsrc;
	$("div.post-text-holder img").each(function() {
		if ($(this).width()>470 && $(this).attr('title') != 'original_picture')
		{
			$(this).css({ 'width': 400 });
			if (hide_image_preview==1)
			{
				imgsrc=$(this).attr('src');
				$(this).wrap('<a target="_blank" href="'+imgsrc+'">');
			}
			if (hide_image_preview==0)
			{
				imgsrc=$(this).attr('src');
				$(this).wrap('<span class="tip3" style="display: inline;"><a target="_blank" href="'+imgsrc+'">');
				$(this).after('<span class="tip" style="display: none; z-index: 999999; position: absolute;"><img src="http://www.mycity.rs/templates/simplified/images/pixel.gif" alt="'+imgsrc+'" title="original_picture" style="padding: 5px; background-color: #FFFED1;" /></span>');
			}
		}
    });
*/
}

function prepare_image_preview()
{
/*	if (hide_image_preview==1) return;
   $("div.post-text-holder a.postlink").each(function() {
      var img = $(this).find('img');
      if (img.length)
      {
	      var imgsrc = img.attr('src');
	      var imgok=0;
	
	      if (imgsrc.indexOf("mycity.com/thumbs2")>0) imgok=1;
	      if (imgsrc.indexOf("mycity.rs/thumbs2")>0) imgok=1;
	      if (imgsrc.indexOf("mycity-military.com/thumbs2")>0) imgok=1;
	
	      if (imgok==1)
	      {
	          imgsrc=imgsrc.replace('thumbs2','imgs2').replace('_tmb','');
		      $(this).append('<span class="tip" style="display: none; z-index: 999999; position: absolute;"><img src="http://www.mycity.rs/templates/simplified/images/pixel.gif" alt="'+imgsrc+'" title="original_picture" style="padding: 5px; background-color: #FFFED1;" /></span>');
		      $(this).wrap('<span class="tip2" style="display: inline;">');
	      }
      }
    });
*/
}

$(window).load(function() {
/*	if (url_location.indexOf("modcp.php")>0) return $(this);
	jq_entered=1;
	resizeimg();
	if (hide_image_preview==0)
	{
		add_image_preview("3");
	}
*/
});

$(document).ready(function(){
//	if (url_location.indexOf("modcp.php")>0) return $(this);
	jq_entered=1;
    // Links / buttons fix
        $("button, a, span.button").focus(function () {$(this).blur();});

    // Adding rounded cornes to elements
//    if(jQuery.browser.opera)
//    {
//        $("table.forum-reply, forum-reply-border, table.forum-list, table.infoPanel, table.forum-logs").wrap("<div class='table-holder'></div>").parent().prepend('<span class="rounded-top-right"> </span>').prepend('<span class="rounded-top-left"> </span>');
//	}
//	else
//	{
//        $("table.forum-reply, forum-reply-border, table.forum-list, table.infoPanel, table.forum-logs").wrap("<div class='table-holder'></div>").parent().prepend('<span class="rounded-top-right"> </span>').prepend('<span class="rounded-top-left"> </span>');
//        $("table.forum-reply, forum-reply-border, table.forum-list, table.infoPanel, table.forum-posts, table.forum-logs").wrap("<div class='table-holder'></div>").parent().prepend('<span class="rounded-top-right"> </span>').prepend('<span class="rounded-top-left"> </span>');		
//	}
//        $("table.forum-list th:first-child").css({"text-align": "left"});

//        $("ul#news-list li.title, h2.sidebox, h2.sidebox2, h2.sidebox3, h2#profile").append('<span class="rounded-top-left"> </span>').prepend('<span class="rounded-top-right"> </span>');
         $("ul#navigation").append("<li class='last'> </li>")

//        $('h2.news-list').append('<span class="rounded-top-right"> </span>').prepend('<span class="rounded-top-left"> </span>');

//        $('#forumDesc').wrapInner('<div id="forumDesc-inner">');

//        if(!jQuery.browser.msie && !jQuery.browser.opera){
//           $('#forumDesc-inner').corner("3px").parent().corner("4px");
//            $('ul#navigation a, div.tags a, a.quicks, li.rank, .post-controls ul li, ul.socials li, div.qr-txt button').corner("2px");
//            $('span.avatar img, div#mc-network').corner("3px");
//        }
/*        if(jQuery.browser.opera)
        {
            $('ul#inbox-tabs a').css({'padding-left': '10px'});
        }
        $('ul#inbox-tabs a:not(.current)').addClass('normal');
        $('table.inbox-content tr:last td').css({'border-bottom': '1px solid #d8e0e5'});


        $('div.person-info, div.qr, ul.post-options li, ul.post-admin li, ul#profile-tabs li h3').corner("3px");
        if(!jQuery.browser.opera){$('ul#profile-controls li').corner("5px");}
        $('ul.profile-controls2 li, ul.profile-controls3 li').corner("5px");
        if (!jQuery.browser.opera) $('ul#inbox-tabs li a').corner("3px tr, 3px tl");
        $('h2#marketing a, div#registration a').corner("5px");
        $(".titleDesc").wrapInner("<div class='padder'></div>").prepend('<span class="toungue"></span>');
        $("div#profile").wrapInner('<div id="profile-inner" class="clearfix"></div>');
*/
/*        if (jQuery.browser.opera || jQuery.browser.msie)
        {
            $('ul#inbox-tabs a').css({'border-top': '1px solid #6286A4'});
            $('ul#inbox-tabs a').css({'border-left': '1px solid #6286A4'});
            $('ul#inbox-tabs a').css({'border-right': '1px solid #6286A4'});
        }

/*       var thirdsWidth = $("div#profile-inner").width()-202;
        $("ul#profile-tabs li").each( function(){
            if( $(this).hasClass('small') ){
                $(this).width(160);
            } else {
                $(this).width(thirdsWidth/2);
            }
            $(this).find('h3').append('<span class="tongue"></span>');
            $(this).find('h3:first').css({'marginTop': 0});
        });
*/
/* --
    // Forum description stuff - fancy look
        $("div.tags").hide();
        $('a.tags').click( function() { $("div.tags").slideToggle('fast'); } );

        $('span.admin-notify').each( function(){
            var tdPos = $(this).parent().position();
            $(this).css({"left": tdPos.left+1, "top": tdPos.top+1});
        });

    // Removing-adding paddings and magins for unnecessary elements
        $("#sidebar h2:first, ul#footinfo li h3:first, div.body-holder div.hr:first").css('margin-top', '0');
        $("ul#footinfo li:first").css("padding-right", "1%");
        $("ul#footinfo li:last").css("padding-left", "1%");
        $('td.infoIcon').css("padding", "0");
        $('td.post-body .hr:first-child').css("margin-top", "0");
        $('span.attach a:last-child').css("margin-right", "0");

*/
    // Getting same height for news elements
//    $("ul#news-list li").equalHeights();
    //$("ul#news-list li, ul#profile-tabs li").equalHeights();

    // Form stuff
        $(".forum-reply input[type='text'], .forum-reply input[type='password'], .quickSearch input, .quick-reply input.topic").addClass("passive");
        $(".forum-reply input[type='text'], .forum-reply input[type='password'], .quickSearch input, .quick-reply input.topic").focus(function() {
            $(this).removeClass("passive");
            if (this.value == this.defaultValue){
                this.value = '';
            }
            if(this.value != this.defaultValue){
                this.select();
            }
        });
        $(".forum-reply input[type='text'], .forum-reply input[type='password'], .quick-reply input.topic, .quickSearch input").blur(function() {
            $(this).addClass("passive");
            if ($.trim(this.value) == ''){
                this.value = (this.defaultValue ? this.defaultValue : '');
            }
        });
        $('input:checkbox').checkbox();
        $('input:radio').checkbox({cls:'jquery-radio'});

/*        $('#reply').markItUp(replyEditor); ????????? */
        $('ul#emoticons a').click(function() {
            emoticon = $(this).attr("title");
            $.markItUp( { replaceWith:emoticon } );
            return false;
        });

        /* Custom combo box hover behaviour */
        $(".customComboHolder select").hover(
           function () {$(this).parent().addClass("dropdown_over");},
           function () {$(this).parent().removeClass("dropdown_over");}
        );
        $(".customComboHolder select").siblings("div").html($(this).find(":selected").text());
        $(".customComboHolder select").change(function() {
           $(this).siblings("div").html($(this).find(":selected").text());
        });
        /* Custom combo box hover behaviour */
        $(".customComboHolder3 select").hover(
           function () {$(this).parent().addClass("dropdown_over");},
           function () {$(this).parent().removeClass("dropdown_over");}
        );
/*        $(".customComboHolder3 select").siblings("div").html($(this).find(":selected").text()); */
        $(".customComboHolder3 select").change(function() {
           $(this).siblings("div").html($(this).find(":selected").text());
        });
        /* Custom combo box hover behaviour */
        $(".customComboHolder4 select").hover(
           function () {$(this).parent().addClass("dropdown_over");},
           function () {$(this).parent().removeClass("dropdown_over");}
        );
/*        $(".customComboHolder4 select").siblings("div").html($(this).find(":selected").text()); */
        $(".customComboHolder4 select").change(function() {
           $(this).siblings("div").html($(this).find(":selected").text());
        });


/*        $('td.poll label:last').addClass('last');

        var maxWidth = 0;
        var fullWidth = 0;

        $("td.poll form label, ul#poll-result dt").each( function(){
            if ($(this).width() > maxWidth){
                maxWidth = $(this).width();
            }
        });

        $("td.poll form, ul#poll-result dt").width(maxWidth+10);
        $('ul#poll-result li dl').each( function(){
            if ($(this).width() > fullWidth){
                fullWidth = $(this).width();
            }
        });
        $("ul#poll-result li dl").width(fullWidth);

        $("ul#poll-result dd div").each( function(){
            if ($(this).width() > 0){
                $(this).append('<span class="bar-close"></span>');
            }
        });
*/

//        $('div.markItUpHeader ul li.markItUpButton a').not('.markItUpDropMenu li.markItUpButton a').tipsy({gravity: 's'});

    // Fluid textbox
  //      $('.quick-reply textarea, #reply').autogrow();


    // IE6 PNG Fix
//    if ($.browser.msie && $.browser.version.substr(0,1)<7) {
//        DD_belatedPNG.fix('.rounded-top-left, .rounded-top-right, span.icon-bday, span.icon-users, .avatar img');
//    }

   //MC Network
    var AnimHeight = $('div#mc-network ul').height();
    $('div#mc-network ul').hide();
    $("div#mc-network").hover(
        function(){
            $('div#mc-network ul').stop().css({
                'display': 'block',
                'height': '0'
                }).animate({"height": AnimHeight}, 250);
        }, function(){
            $('div#mc-network ul').stop().animate({"height": 0}, 100, function(){ $(this).hide(); });
        }
    );


/*        if (jQuery.browser.msie)
        {
            $('table.forum-list tbody td').css({'border-left': '1px solid #6286A4'});
        }
*/

    // Setting max width of posts (preventing spam lines)
/*    $('.post-text-holder').postLimiter();
    $('span.napomene').napomene();

    $(window).resize(function() {
        $('.post-text-holder').postLimiter();
        $('span.napomene').napomene();
    });
    
	if (hide_image_preview==0)
	{
		prepare_image_preview();
	    add_image_preview("2");
    }
*/
});

/**
 * Equal Heights Plugin
 */

/*
(function($) {
    $.fn.equalHeights = function(minHeight, maxHeight) {
        tallest = (minHeight) ? minHeight : 0;
        this.each(function() {
            if($(this).height() > tallest) {
                tallest = $(this).height();
            }
        });
        if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
        return this.each(function() {
            $(this).height(tallest).css("overflow","auto");
        });
    }
})(jQuery);
 */

/*
 * Auto Expanding Text Area
(function(jQuery) {

    var self = null;

    jQuery.fn.autogrow = function(o)
    {
        return this.each(function() {
            new jQuery.autogrow(this, o);
        });
    };



    jQuery.autogrow = function (e, o)
    {
        this.options            = o || {};
        this.dummy              = null;
        this.interval           = null;
        this.line_height        = this.options.lineHeight || parseInt(jQuery(e).css('line-height'));
        this.min_height         = this.options.minHeight || parseInt(jQuery(e).css('min-height'));
        this.max_height         = this.options.maxHeight || parseInt(jQuery(e).css('max-height'));;
        this.textarea           = jQuery(e);

        if (this.line_height == NaN)
        {
            this.line_height = 0;
        }

        if (this.min_height == NaN || this.min_height == 0)
        {
            this.min_height == this.textarea.height();
        }



        // Only one textarea activated at a time, the one being used
        this.init();
    };

    jQuery.autogrow.fn = jQuery.autogrow.prototype = {
    autogrow: '1.2.2'
  };

    jQuery.autogrow.fn.extend = jQuery.autogrow.extend = jQuery.extend;

    jQuery.autogrow.fn.extend({

        init: function() {
            var self = this;
            this.textarea.css({overflow: 'hidden', display: 'block'});
            this.textarea.bind('focus', function() { self.startExpand() } ).bind('blur', function() { self.stopExpand() });
            this.checkExpand();
        },

        startExpand: function() {
          var self = this;
            this.interval = window.setInterval(function() {self.checkExpand()}, 400);
        },

        stopExpand: function() {
            clearInterval(this.interval);
        },

        checkExpand: function() {

            if (this.dummy == null)
            {
                this.dummy = jQuery('<div></div>');
                this.dummy.css({
                                                'font-size'  : this.textarea.css('font-size'),
                                                'font-family': this.textarea.css('font-family'),
                                                'width'      : this.textarea.css('width'),
                                                'padding'    : this.textarea.css('padding'),
                                                'line-height': this.line_height + 'px',
                                                'overflow-x' : 'hidden',
                                                'position'   : 'absolute',
                                                'top'        : 0,
                                                'left'       : -9999
                                                }).appendTo('body');
            }

            // Strip HTML tags
            var html = this.textarea.val().replace(/(<|>)/g, '');

            // IE is different, as per usual
            if ($.browser.msie)
            {
                html = html.replace(/\n/g, '<BR>new');
            }
            else
            {
                html = html.replace(/\n/g, '<br>new');
            }

            if (this.dummy.html() != html)
            {
                this.dummy.html(html);

                if (this.max_height > 0 && (this.dummy.height() + this.line_height > this.max_height))
                {
                    this.textarea.css('overflow-y', 'auto');
                }
                else
                {
                    this.textarea.css('overflow-y', 'hidden');
                    if (this.textarea.height() < this.dummy.height() + this.line_height || (this.dummy.height() < this.textarea.height()))
                    {
                        this.textarea.animate({height: (this.dummy.height() + this.line_height) + 'px'}, 100);
                    }
                }
            }
        }

     });

})(jQuery);
 */

/*
 * jQuery custom checkboxes
 */
(function($){var i=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation()};$.fn.checkbox=function(f){try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}var g={cls:'jquery-checkbox',empty:'http://novi.mycity.rs/images/empty.png'};g=$.extend(g,f||{});var h=function(a){var b=a.checked;var c=a.disabled;var d=$(a);if(a.stateInterval)clearInterval(a.stateInterval);a.stateInterval=setInterval(function(){if(a.disabled!=c)d.trigger((c=!!a.disabled)?'disable':'enable');if(a.checked!=b)d.trigger((b=!!a.checked)?'check':'uncheck')},10);return d};return this.each(function(){var a=this;var b=h(a);if(a.wrapper)a.wrapper.remove();a.wrapper=$('<span class="'+g.cls+'"><span class="mark"><img src="'+g.empty+'" /></span></span>');a.wrapperInner=a.wrapper.children('span:eq(0)');a.wrapper.hover(function(e){a.wrapperInner.addClass(g.cls+'-hover');i(e)},function(e){a.wrapperInner.removeClass(g.cls+'-hover');i(e)});b.css({position:'absolute',zIndex:-1,visibility:'hidden'}).after(a.wrapper);var c=false;if(b.attr('id')){c=$('label[for='+b.attr('id')+']');if(!c.length)c=false}if(!c){c=b.closest?b.closest('label'):b.parents('label:eq(0)');if(!c.length)c=false}if(c){c.hover(function(e){a.wrapper.trigger('mouseover',[e])},function(e){a.wrapper.trigger('mouseout',[e])});c.click(function(e){b.trigger('click',[e]);i(e);return false})}a.wrapper.click(function(e){b.trigger('click',[e]);i(e);return false});b.click(function(e){i(e)});b.bind('disable',function(){a.wrapperInner.addClass(g.cls+'-disabled')}).bind('enable',function(){a.wrapperInner.removeClass(g.cls+'-disabled')});b.bind('check',function(){a.wrapper.addClass(g.cls+'-checked')}).bind('uncheck',function(){a.wrapper.removeClass(g.cls+'-checked')});$('img',a.wrapper).bind('dragstart',function(){return false}).bind('mousedown',function(){return false});if(window.getSelection)a.wrapper.css('MozUserSelect','none');if(a.checked)a.wrapper.addClass(g.cls+'-checked');if(a.disabled)a.wrapperInner.addClass(g.cls+'-disabled')})}})(jQuery);

/*
 * Tipsy - tooltips
(function($) {
    $.fn.tipsy = function(opts) {

        opts = $.extend({fade: false, gravity: 'n'}, opts || {});
        var tip = null, cancelHide = false;

        this.hover(function() {

            $.data(this, 'cancel.tipsy', true);

            var tip = $.data(this, 'active.tipsy');
            if (!tip) {
                tip = $('<div class="tipsy"><div class="tipsy-inner">' + $(this).attr('title') + '</div></div>');
                tip.css({position: 'absolute', zIndex: 999});
                $(this).attr('title', '');
                $.data(this, 'active.tipsy', tip);
            }

            var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});
            tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
            var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight;

            switch (opts.gravity.charAt(0)) {
                case 'n':
                    tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north');
                    break;
                case 's':
                    tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south');
                    break;
                case 'e':
                    tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}).addClass('tipsy-east');
                    break;
                case 'w':
                    tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}).addClass('tipsy-west');
                    break;
            }

            if (opts.fade) {
                tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 1});
            } else {
                tip.css({visibility: 'visible'});
            }

        }, function() {
            $.data(this, 'cancel.tipsy', false);
            var self = this;
            setTimeout(function() {
                if ($.data(this, 'cancel.tipsy')) return;
                var tip = $.data(self, 'active.tipsy');
                if (opts.fade) {
                    tip.stop().fadeOut(function() { $(this).remove(); });
                } else {
                    tip.remove();
                }
            }, 0);

        });

    };
})(jQuery);

(function($) {
$.fn.postLimiter = function(options) {

  if (!this.length) { return this; }

  var opts = $.extend(true, {}, $.fn.postLimiter.defaults, options);
  var mainColWidth=0;
  if ($('#main').length) mainColWidth = $('#main').width();
  else mainColWidth = $('#main-full').width();
  if (mainColWidth==0) return this;

  var i=0;

  var blog=0;
  if (url_location.indexOf("/Blog/")>0) blog=1;
  var stranica=0;
  if (url_location.indexOf("_")>0) stranica=1;

  this.each(function() {
    var $this = $(this);
    i++;
    
    var personInfoWidth = 220; // This is const value width all paddings
    if (blog==1 && i>1) personInfoWidth = 15;
    if (blog==1 && stranica==1) personInfoWidth = 15;

    $this.width(mainColWidth-personInfoWidth);
  });

  return this;
};
// default options
$.fn.postLimiter.defaults = {
};
})(jQuery);


(function($) {
$.fn.napomene = function(options) {

  if (!this.length) { return this; }

  var opts = $.extend(true, {}, $.fn.napomene.defaults, options);

  if (url_location.indexOf(".html")==-1) return this;

  var mainColWidth=0;
  if ($('#main').length) mainColWidth = $('#main').width();
  else mainColWidth = $('#main-full').width();
  if (mainColWidth==0) return this;


  this.each(function() {
    var $this = $(this);
    $this.width(mainColWidth-380);
  });

  return this;
};
// default options
$.fn.napomene.defaults = {
};
})(jQuery);

*/


