    (function($){
$.fn.menu2=function(_2){
if(this.length>1){
this.each(function(){
$(this).menu2(_2);
});
return this;
}
var _3=this.eq(0),_4=_3[0];
var p,i;
_4.menu2=_2=$.extend({panelHandle:"ul",itemHandle:"li",effect:"show",speed:350,delay:350,position:true,excludePos:"exclude",horizontal:"horizontal",active:"active"},_2);
var _7=_3.find(_2.panelHandle);
if(_2.position){
_7.not("."+_2.excludePos).css({position:"absolute",visibility:"hidden"}).show();
}
_7.each(function(){
var t=this,$t=$(t);
t.parentItem=$t.parents(_2.itemHandle)[0];
t.parentItem.childPanel=t;
t.root=_4;
t.show=panelShow;
t.hide=panelHide;
t.hideNow=panelHideNow;
$t.hover(panelShow,panelHide);
if(_2.position&&!$t.hasClass(_2.excludePos)){
var _a=$(t.parentItem).offset(),_b=$t.offsetParent().offset();
_a.left-=_b.left;
_a.top-=_b.top;
if($(t.parentItem).hasClass(_2.horizontal)){
_a.top+=$(t.parentItem).height();
}else{
_a.left+=$(t.parentItem).width();
}
$t.css(_a).trigger("menu2.position");
}
});
_7.css("visibility","visible").hide();
_3.find(_2.itemHandle).each(function(){
var t=this,$t=$(t);
t.root=_4;
$t.hover(itemActivate, itemDeactivate);
/*
var $a=$t.find("a").not(_2.panelHandle+" a");
if($a.length){
$t.attr("title",$a.attr("title")).bind("click",function(_f){
window.location=$a.attr("href");
_f.preventDefault();
});

}
*/
});
return this;
};
function panelShow(evt){
var m2=this.root.menu2;
clearTimer(this);
$(m2.panelHandle,this.root).filter("."+m2.active).not($(this).parents().andSelf().add($(this).find(m2.panelHandle))).each(panelHideNow);
applyEffect($(this).filter(":hidden").addClass(m2.active).trigger("menu2.open"),m2.effect,true,m2.speed);
}
function panelHide(evt){
var t=this;
clearTimer(this);
this.timer=setInterval(function(){
panelHideNow.call(t);
},this.root.menu2.delay);
}
function panelHideNow(){
var m2=this.root.menu2;
clearTimer(this);
applyEffect($(this).filter(":visible").removeClass(m2.active).trigger("menu2.close"),m2.effect,false,m2.speed);
}
function itemActivate(evt){
var m2=this.root.menu2;
clearTimer(this);
$(m2.itemHandle,this.root).filter("."+m2.active).not($(this).parents().andSelf().add($(this).find(m2.itemHandle))).each(itemDeactivateNow);
$(this).not("."+m2.active).addClass(m2.active).trigger("menu2.activate");
if(this.childPanel){
this.childPanel.show();
}
}
function itemDeactivate(evt){
var t=this;
clearTimer(this);
this.timer=setInterval(function(){
itemDeactivateNow.call(t);
},this.root.menu2.delay);
}
function itemDeactivateNow(){
var m2=this.root.menu2;
clearTimer(this);
$(this).filter("."+m2.active).removeClass(m2.active).trigger("menu2.deactivate");
if(this.childPanel){
this.childPanel.hideNow();
}
}
function applyEffect(_1a,_1b,_1c,_1d){
_1a.stop();
switch(_1b){
case "slide":
_1c?_1a.slideDown(_1d):_1a.slideUp(_1d);
break;
case "fade":
_1c?_1a.fadeIn(_1d):_1a.fadeOut(_1d);
break;
case "show":
default:
_1c?_1a.show():_1a.hide();
break;
}
}
function clearTimer(obj){
if(obj.timer!=null){
clearInterval(obj.timer);
obj.timer=null;
}
}
})(jQuery);


function init() {
	if( $.browser.msie )
		$( document.body ).append( $( "#mainMenu" ).remove().css( "position", "absolute" ).css( $( "#navigacija-menu" ).offset() ) );
	$( "#mainMenu" ).menu2( { panelHandle: "div.panel", delay: 350 } );
	$( "#crvenaTraka" ).css( { left: $( "#navigacija-menu" ).offset().left + 27 } );
	var crvPos = $( "#crvenaTraka" ).offset().left,
		crvWidth = $( "#crvenaTraka" ).width();
	$( "#mainMenu > li" ).bind( "menu2.activate", function( evt ) {
// console.log("activate: %s", $( evt.target ).offset().left);
		/*
				ulovi opciju menija za crvenu traku
		*/
		var crvx = $( evt.target ).offset().left + 10;
		$( "#crvenaTraka" ).stop().animate( { left: crvx, width: $( evt.target ).width() + 3 }, 800 );
		$( "#crnaTraka" ).css( { left: crvx -9 } ).stop().animate( { height: 21 }, 700 );
	} ).bind( "menu2.deactivate", function( evt ) {
// console.log("deactivate: %s", $( evt.target ).offset().left);
		/*
				vrati crvenu traku
		*/
		$( "#crvenaTraka" ).stop().animate( { left: crvPos, width: crvWidth }, 800 );
		$( "#crnaTraka" ).stop().animate( { height: 0 }, 700 );
	} );
	
	
}

$( init );


function arrowSwapUp() {}