var NN=NN||{};(function(c,b,a){a.cookie=function(e,j,k){if(typeof j!=="undefined"){b.cookie=e+"="+encodeURIComponent(j)+"; expires="+k.toUTCString()}else{if(b.cookie){var h=b.cookie.split(";"),d=h.length;for(var g=0;g<d;g+=1){var f=c.trim(h[g]);if(f.substring(0,e.length+1)===(e+"=")){return decodeURIComponent(f.substring(e.length+1))}}}return null}};a.neoTick2=function(o){var w=this;var F=o;var E;var e=null;var A;var m=null;var q=null;var t=null;var y=null;var v=null;var z=10;var C;var u;var B=null;var r=null;var g=false;var l=o.tickerDisabled==="true";var k=function(G){if(l){j()}else{c.ajax({url:c(location).attr("href"),data:"type="+F.ajaxTypeNum+"&neotick2Disabled="+a.cookie("neotick2Disabled")||"",dataType:"html",context:w,success:function(H){c("body").append(H);x(true)}})}};var j=function(){c.ajax({url:c(location).attr("href"),data:"type="+F.ajaxTypeNum+"&neotick2Disabled="+a.cookie("neotick2Disabled")||"",dataType:"html",context:w,success:function(G){if(G){l=false;c("body").append(G);k()}else{r=setTimeout(function(){j()},F.refreshTimer)}}})};var x=function(H,G){E=c(F.id);e=E.outerWidth();if(H){clearInterval(r);A=c(F.id+" ul");m=A.outerWidth();A.detach();d()}else{clearInterval(B);clearInterval(r);E.find("ul").fadeOut(500,function(){c(this).remove()});C=undefined;u=undefined;A.remove();A=G;A.css("visibility","hidden");E.append(A);m=A.outerWidth();A.css("visibility","visible");A.detach()}t=e+z;q=0-m-z;y=e-m+z;v=t;A.css("left",t);if(A.length>0){n()}p()};var d=function(){E.bind("mouseover",function(){g=true});E.bind("mouseleave",function(){g=false});c("#"+F.disableId).bind("click",function(){D();return false});if(F.linkOver){E.find("ul a").live("mouseover",function(){if(F.linkOverAlways){f(this)}else{var H=c(this).closest("ul").position().left+c(this).position().left;var G=c(this).outerWidth();if(H<0||((H+G)>e)){f(this)}}});E.find("ul a").live("mouseleave",function(){i()})}};var f=function(L){c("body").append('<div id="'+F.popupId+'"><span>'+c(L).text()+"</span></div>");var H=c("#"+F.popupId);var G=c(L).offset();var J=c(L).outerWidth();var M=E.offset();var K=Math.round(G.left-(H.outerWidth()-J)/2);var I=Math.round(G.top+c(L).height()+z);K=Math.max(M.left,K);K=Math.min(M.left+e-H.outerWidth(),K);H.css("left",K);H.css("top",I)};var i=function(){c("#"+F.popupId).remove()};var n=function(){C=A.clone();E.append(C);B=setInterval(function(){h(C);if((typeof u!=undefined)&&(u!=null)){h(u)}},F.timer)};var h=function(H){if(H){if(g){return false}if(H.css("left")!=null){var G=H.css("left").replace("px","");if(G>q){H.css("left",G-F.steps)}else{H.remove();C=u;u=undefined}if(G==y){E.append(A.clone().css("left",t));u=E.find("ul:eq(1)")}}}};var p=function(){r=setInterval(function(){c.ajax({url:c(location).attr("href"),data:"type="+F.ajaxTypeNum+"&neotick2Disabled="+a.cookie("neotick2Disabled")||"",dataType:"html",context:w,success:function(H){var G=c(H).find(F.id+" ul");if(G.html()){if(G.html()!==A.html()){x(false,G)}}}})},F.refreshTimer)};var D=function(){s();clearInterval(B);clearInterval(r);c(F.parent).hide(500,function(){c(this).remove()});l=true;k()};var s=function(){var G=new Date();var H=G.getTime();var I=G.getTime()+(5*24*60*60*1000);G.setTime(I);a.cookie("neotick2Disabled",H,G)};k()}})(jQuery,document,NN);
