var $j = jQuery.noConflict();
/*======================================uniform=====================================*/
(function(e,t){"use strict";function n(e){var t=Array.prototype.slice.call(arguments,1);return e.prop?e.prop.apply(e,t):e.attr.apply(e,t)}function s(e,t,n){var s,a;for(s in n)n.hasOwnProperty(s)&&(a=s.replace(/ |$/g,t.eventNamespace),e.bind(a,n[s]))}function a(e,t,n){s(e,n,{focus:function(){t.addClass(n.focusClass)},blur:function(){t.removeClass(n.focusClass),t.removeClass(n.activeClass)},mouseenter:function(){t.addClass(n.hoverClass)},mouseleave:function(){t.removeClass(n.hoverClass),t.removeClass(n.activeClass)},"mousedown touchbegin":function(){e.is(":disabled")||t.addClass(n.activeClass)},"mouseup touchend":function(){t.removeClass(n.activeClass)}})}function i(e,t){e.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass)}function r(e,t,n){n?e.addClass(t):e.removeClass(t)}function l(e,t,n){var s="checked",a=t.is(":"+s);t.prop?t.prop(s,a):a?t.attr(s,s):t.removeAttr(s),r(e,n.checkedClass,a)}function u(e,t,n){r(e,n.disabledClass,t.is(":disabled"))}function o(e,t,n){switch(n){case"after":return e.after(t),e.next();case"before":return e.before(t),e.prev();case"wrap":return e.wrap(t),e.parent()}return null}function c(t,s,a){var i,r,l;return a||(a={}),a=e.extend({bind:{},divClass:null,divWrap:"wrap",spanClass:null,spanHtml:null,spanWrap:"wrap"},a),i=e("
'),e("body").append(n),s=n.get(0),t=window.getComputedStyle?window.getComputedStyle(s,"").color:(s.currentStyle||s.style||{}).color,n.remove(),t.replace(/ /g,"")!==a}function p(t){return t?e("
").text(t).html():""}function m(){return navigator.cpuClass&&!navigator.product}function v(){return window.XMLHttpRequest!==void 0?!0:!1}function h(e){var t;return e[0].multiple?!0:(t=n(e,"size"),!t||1>=t?!1:!0)}function C(){return!1}function w(e,t){var n="none";s(e,t,{"selectstart dragstart mousedown":C}),e.css({MozUserSelect:n,msUserSelect:n,webkitUserSelect:n,userSelect:n})}function b(e,t,n){var s=e.val();""===s?s=n.fileDefaultHtml:(s=s.split(/[\/\\]+/),s=s[s.length-1]),t.text(s)}function y(e,t,n){var s,a;for(s=[],e.each(function(){var e;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s.push({el:this,name:e,old:this.style[e]}),this.style[e]=t[e])}),n();s.length;)a=s.pop(),a.el.style[a.name]=a.old}function g(e,t){var n;n=e.parents(),n.push(e[0]),n=n.not(":visible"),y(n,{visibility:"hidden",display:"block",position:"absolute"},t)}function k(e,t){return function(){e.unwrap().unwrap().unbind(t.eventNamespace)}}var H=!0,x=!1,A=[{match:function(e){return e.is("a, button, :submit, :reset, input[type='button']")},apply:function(e,t){var r,l,o,d,f;return l=t.submitDefaultHtml,e.is(":reset")&&(l=t.resetDefaultHtml),d=e.is("a, button")?function(){return e.html()||l}:function(){return p(n(e,"value"))||l},o=c(e,t,{divClass:t.buttonClass,spanHtml:d()}),r=o.div,a(e,r,t),f=!1,s(r,t,{"click touchend":function(){var t,s,a,i;f||e.is(":disabled")||(f=!0,e[0].dispatchEvent?(t=document.createEvent("MouseEvents"),t.initEvent("click",!0,!0),s=e[0].dispatchEvent(t),e.is("a")&&s&&(a=n(e,"target"),i=n(e,"href"),a&&"_self"!==a?window.open(i,a):document.location.href=i)):e.click(),f=!1)}}),w(r,t),{remove:function(){return r.after(e),r.remove(),e.unbind(t.eventNamespace),e},update:function(){i(r,t),u(r,e,t),e.detach(),o.span.html(d()).append(e)}}}},{match:function(e){return e.is(":checkbox")},apply:function(e,t){var n,r,o;return n=c(e,t,{divClass:t.checkboxClass}),r=n.div,o=n.span,a(e,r,t),s(e,t,{"click touchend":function(){l(o,e,t)}}),l(o,e,t),{remove:k(e,t),update:function(){i(r,t),o.removeClass(t.checkedClass),l(o,e,t),u(r,e,t)}}}},{match:function(e){return e.is(":file")},apply:function(t,r){function l(){b(t,p,r)}var d,f,p,v;return d=c(t,r,{divClass:r.fileClass,spanClass:r.fileButtonClass,spanHtml:r.fileButtonHtml,spanWrap:"after"}),f=d.div,v=d.span,p=e("
").html(r.fileDefaultHtml),p.addClass(r.filenameClass),p=o(t,p,"after"),n(t,"size")||n(t,"size",f.width()/10),a(t,f,r),l(),m()?s(t,r,{click:function(){t.trigger("change"),setTimeout(l,0)}}):s(t,r,{change:l}),w(p,r),w(v,r),{remove:function(){return p.remove(),v.remove(),t.unwrap().unbind(r.eventNamespace)},update:function(){i(f,r),b(t,p,r),u(f,t,r)}}}},{match:function(e){if(e.is("input")){var t=(" "+n(e,"type")+" ").toLowerCase(),s=" color date datetime datetime-local email month number password search tel text time url week ";return s.indexOf(t)>=0}return!1},apply:function(e,t){var s,i;return s=n(e,"type"),e.addClass(t.inputClass),i=d(e,t),a(e,e,t),t.inputAddTypeAsClass&&e.addClass(s),{remove:function(){e.removeClass(t.inputClass),t.inputAddTypeAsClass&&e.removeClass(s),i&&e.unwrap()},update:C}}},{match:function(e){return e.is(":radio")},apply:function(t,r){var o,d,f;return o=c(t,r,{divClass:r.radioClass}),d=o.div,f=o.span,a(t,d,r),s(t,r,{"click touchend":function(){e.uniform.update(e(':radio[name="'+n(t,"name")+'"]'))}}),l(f,t,r),{remove:k(t,r),update:function(){i(d,r),l(f,t,r),u(d,t,r)}}}},{match:function(e){return e.is("select")&&!h(e)?!0:!1},apply:function(t,n){var r,l,o,d;return n.selectAutoWidth&&g(t,function(){d=t.width()}),r=c(t,n,{divClass:n.selectClass,spanHtml:(t.find(":selected:first")||t.find("option:first")).html(),spanWrap:"before"}),l=r.div,o=r.span,n.selectAutoWidth?g(t,function(){y(e([o[0],l[0]]),{display:"block"},function(){var e;e=o.outerWidth()-o.width(),l.width(d+e),o.width(d)})}):l.addClass("fixedWidth"),a(t,l,n),s(t,n,{change:function(){o.html(t.find(":selected").html()),l.removeClass(n.activeClass)},"click touchend":function(){var e=t.find(":selected").html();o.html()!==e&&t.trigger("change")},keyup:function(){o.html(t.find(":selected").html())}}),w(o,n),{remove:function(){return o.remove(),t.unwrap().unbind(n.eventNamespace),t},update:function(){n.selectAutoWidth?(e.uniform.restore(t),t.uniform(n)):(i(l,n),o.html(t.find(":selected").html()),u(l,t,n))}}}},{match:function(e){return e.is("select")&&h(e)?!0:!1},apply:function(e,t){var n;return e.addClass(t.selectMultiClass),n=d(e,t),a(e,e,t),{remove:function(){e.removeClass(t.selectMultiClass),n&&e.unwrap()},update:C}}},{match:function(e){return e.is("textarea")},apply:function(e,t){var n;return e.addClass(t.textareaClass),n=d(e,t),a(e,e,t),{remove:function(){e.removeClass(t.textareaClass),n&&e.unwrap()},update:C}}}];m()&&!v()&&(H=!1),e.uniform={defaults:{activeClass:"active",autoHide:!0,buttonClass:"button",checkboxClass:"checker",checkedClass:"checked",disabledClass:"disabled",eventNamespace:".uniform",fileButtonClass:"action",fileButtonHtml:"Choose File",fileClass:"uploader",fileDefaultHtml:"No file selected",filenameClass:"filename",focusClass:"focus",hoverClass:"hover",idPrefix:"uniform",inputAddTypeAsClass:!0,inputClass:"uniform-input",radioClass:"radio",resetDefaultHtml:"Reset",resetSelector:!1,selectAutoWidth:!0,selectClass:"selector",selectMultiClass:"uniform-multiselect",submitDefaultHtml:"Submit",textareaClass:"uniform",useID:!0,wrapperClass:null},elements:[]},e.fn.uniform=function(t){var n=this;return t=e.extend({},e.uniform.defaults,t),x||(x=!0,f()&&(H=!1)),H?(t.resetSelector&&e(t.resetSelector).mouseup(function(){window.setTimeout(function(){e.uniform.update(n)},10)}),this.each(function(){var n,s,a,i=e(this);if(i.data("uniformed"))return e.uniform.update(i),void 0;for(n=0;A.length>n;n+=1)if(s=A[n],s.match(i,t))return a=s.apply(i,t),i.data("uniformed",a),e.uniform.elements.push(i.get(0)),void 0})):this},e.uniform.restore=e.fn.uniform.restore=function(n){n===t&&(n=e.uniform.elements),e(n).each(function(){var t,n,s=e(this);n=s.data("uniformed"),n&&(n.remove(),t=e.inArray(this,e.uniform.elements),t>=0&&e.uniform.elements.splice(t,1),s.removeData("uniformed"))})},e.uniform.update=e.fn.uniform.update=function(n){n===t&&(n=e.uniform.elements),e(n).each(function(){var t,n=e(this);t=n.data("uniformed"),t&&t.update(n,t.options)})}})(jQuery);
/*======================================tipsy=======================================
tipsy, facebook style tooltips for jquery
version 1.0.0a
(c) 2008-2010 jason frame [jason@onehackoranother.com]
released under the MIT license
*/
/*(function(c){function k(b,d){this.$element=c(b);this.options=d;this.enabled=!0;this.fixTitle()}k.prototype={show:function(){var b=this.getTitle();if(b&&this.enabled){var d=this.tip();d.find(".tipsy-inner")[this.options.html?"html":"text"](b);d[0].className="tipsy";d.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var a=c.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),f=d[0].offsetWidth,g=d[0].offsetHeight,
b="function"==typeof this.options.gravity?this.options.gravity.call(this.$element[0]):this.options.gravity,e;switch(b.charAt(0)){case "n":e={top:a.top+a.height+this.options.offset,left:a.left+a.width/2-f/2};break;case "s":e={top:a.top-g-this.options.offset,left:a.left+a.width/2-f/2};break;case "e":e={top:a.top+a.height/2-g/2,left:a.left-f-this.options.offset};break;case "w":e={top:a.top+a.height/2-g/2,left:a.left+a.width+this.options.offset}}2==b.length&&("w"==b.charAt(1)?e.left=a.left+a.width/2-
15:e.left=a.left+a.width/2-f+15);"absolute"!=d.css("position")&&d.css("position","absolute");d.css(e).addClass("tipsy-"+b);this.options.fixedPosition&&(e=d.offset(),d.css("position","fixed"),d.offset(e));d.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+b.charAt(0);this.options.className&&d.addClass("function"==typeof this.options.className?this.options.className.call(this.$element[0]):this.options.className);this.options.fade?d.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):
d.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){c(this).remove()}):this.tip().remove()},fixTitle:function(){var b=this.$element;(b.attr("title")||"string"!=typeof b.attr("original-title"))&&b.attr("original-title",b.attr("title")||"").removeAttr("title")},getTitle:function(){var b,c=this.$element,a=this.options;this.fixTitle();a=this.options;"string"==typeof a.title?b=c.attr("title"==a.title?"original-title":a.title):
"function"==typeof a.title&&(b=a.title.call(c[0]));return(b=(""+b).replace(/(^\s*|\s*$)/,""))||a.fallback},tip:function(){this.$tip||(this.$tip=c('
').html('
'));return this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.options=this.$element=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}};c.fn.tipsy=function(b){function d(a){var d=
c.data(a,"tipsy");d||(d=new k(a,c.fn.tipsy.elementOptions(a,b)),c.data(a,"tipsy",d));return d}function a(){var a=d(this);a.hoverState="in";0==b.delayIn?a.show():(a.fixTitle(),setTimeout(function(){"in"==a.hoverState&&a.show()},b.delayIn))}function f(){var a=d(this);a.hoverState="out";0==b.delayOut?a.hide():setTimeout(function(){"out"==a.hoverState&&a.hide()},b.delayOut)}if(!0===b)return this.data("tipsy");if("string"==typeof b){var g=this.data("tipsy");if(g)g[b]();return this}b=c.extend({},c.fn.tipsy.defaults,
b);b.live||this.each(function(){d(this)});if("manual"!=b.trigger){var g=b.live?"live":"bind",e="hover"==b.trigger?"mouseleave":"blur";this[g]("hover"==b.trigger?"mouseenter":"focus",a)[g](e,f)}return this};c.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:0.8,title:"title",trigger:"hover"};c.fn.tipsy.elementOptions=function(b,d){return c.metadata?c.extend({},d,c(b).metadata()):d};c.fn.tipsy.autoNS=function(){return c(this).offset().top>
c(document).scrollTop()+c(window).height()/2?"s":"n"};c.fn.tipsy.autoWE=function(){return c(this).offset().left>c(document).scrollLeft()+c(window).width()/2?"e":"w"};c.fn.tipsy.autoBounds=function(b,d){return function(){var a=d[0],f=1
300&&(o=300),s.width(o),s.css("white-space","normal");var n,l=t.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),a=s[0].offsetWidth,f=s[0].offsetHeight,h=i(this.options.gravity,this.$element[0]);switch(h.charAt(0)){case"n":n={top:l.top+l.height+this.options.offset,left:l.left+l.width/2-a/2};break;case"s":n={top:l.top-f-this.options.offset,left:l.left+l.width/2-a/2};break;case"e":n={top:l.top+l.height/2-f/2,left:l.left-a-this.options.offset};break;case"w":n={top:l.top+l.height/2-f/2,left:l.left+l.width+this.options.offset}}if(2==h.length&&(n.left="w"==h.charAt(1)?l.left+l.width/2-15:l.left+l.width/2-a+15),"absolute"!=s.css("position")&&s.css("position","absolute"),s.css(n).addClass("tipsy-"+h),this.options.fixedPosition){var r=s.offset();s.css("position","fixed"),s.offset(r)}s.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+h.charAt(0),this.options.className&&s.addClass(i(this.options.className,this.$element[0])),this.options.fade?s.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):s.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){t(this).remove()}):this.tip().remove()},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("original-title"))&&t.attr("original-title",t.attr("title")||"").removeAttr("title")},getTitle:function(){var t,i=this.$element,e=this.options;this.fixTitle();var t,e=this.options;return"string"==typeof e.title?t=i.attr("title"==e.title?"original-title":e.title):"function"==typeof e.title&&(t=e.title.call(i[0])),t=(""+t).replace(/(^\s*|\s*$)/,""),t||e.fallback},tip:function(){return this.$tip||(this.$tip=t('').html('')),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},t.fn.tipsy=function(i){function s(s){var o=t.data(s,"tipsy");return o||(o=new e(s,t.fn.tipsy.elementOptions(s,i)),t.data(s,"tipsy",o)),o}function o(){var t=s(this);t.hoverState="in",0==i.delayIn?t.show():(t.fixTitle(),setTimeout(function(){"in"==t.hoverState&&t.show()},i.delayIn))}function n(){var t=s(this);t.hoverState="out",0==i.delayOut?t.hide():setTimeout(function(){"out"==t.hoverState&&t.hide()},i.delayOut)}if(i===!0)return this.data("tipsy");if("string"==typeof i){var l=this.data("tipsy");return l&&l[i](),this}if(i=t.extend({},t.fn.tipsy.defaults,i),i.live||this.each(function(){s(this)}),"manual"!=i.trigger){var a=i.live?"live":"bind",f="hover"==i.trigger?"mouseenter":"focus",h="hover"==i.trigger?"mouseleave":"blur";this[a](f,o)[a](h,n)}return this},t.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:1,title:"title",trigger:"hover"},t.fn.tipsy.elementOptions=function(i,e){return t.metadata?t.extend({},e,t(i).metadata()):e},t.fn.tipsy.autoNS=function(){return t(this).offset().top>t(document).scrollTop()+t(window).height()/2?"s":"n"},t.fn.tipsy.autoWE=function(){return t(this).offset().left>t(document).scrollLeft()+t(window).width()/2?"e":"w"},t.fn.tipsy.autoBounds=function(i,e){return function(){var s={ns:e[0],ew:e.length>1?e[1]:!1},o=t(document).scrollTop()+i,n=t(document).scrollLeft()+i,l=t(this);return l.offset().top'+et(exception)+'');
return;
}
var s = '';
s += '
';
s += ''+et(ls(3470))+'
';
s += '
';
s += '';
s += '
'+et(exception)+'
';
s += '
';
s += '';
s += '';
s += '
';
ajaxErrorDlg = barNewDialog({
'title': et(ls(2315)),
'content': s,
'width': 350,
'close': function() {
ajaxErrorDlg = null;
}
});
});
$j.datepicker.setDefaults({
defaultDate: new Date(),
dateFormat: 'dd.mm.yy',
monthNames: [ls(1711),ls(1712),ls(1713),ls(1714),ls(1715),ls(1716),ls(1717),ls(1718),ls(1719),ls(1720),ls(1721),ls(1722)],
dayNames: [ls(1709),ls(1703),ls(1704),ls(1705),ls(1706),ls(1707),ls(1708)],
firstDay: 1,
dayNamesMin: [ls(1709).substr(0,2),ls(1703).substr(0,2),ls(1704).substr(0,2),ls(1705).substr(0,2),ls(1706).substr(0,2),ls(1707).substr(0,2),ls(1708).substr(0,2)]
});
});
/***
* Pacth for dialog-fix ckeditor problem [ by ticket #4727 ]
* http://dev.jqueryui.com/ticket/4727
*/
$j.widget("ui.dialog", $j.ui.dialog, {
_allowInteraction: function( event ) {
var ret = !!$j( event.target ).closest( ".cke_dialog_body" ).length || !!$j( event.target ).closest( ".cke_skin_office2003" ).length || !!$j( event.target ).closest( ".cke" ).length || this._super( event );
return ret;
}
});
$j.widget("ui.dialog", $j.ui.dialog, {
_moveToTop: function (event, silent)
{
if (!event || !this.options.modal)
{
this._super(event, silent);
}
}
});
$j.fn.selectText = function() {
var range, selection;
return this.each(function() {
if (document.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(this);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(this);
selection.removeAllRanges();
selection.addRange(range);
}
});
};
function barFixYuiDialogs() {
$j('.yui-dialog').each(function() {
if ($j(this).css('z-index')<100) {
$j(this).css('z-index',$j(this).css('z-index')*1+100);
}
});
setTimeout('barFixYuiDialogs()',1000);
}
function barRefreshPage() {
$j(function(){ $j('.tips').tipsy({gravity: 's',html: true, delayIn: 200}); });
$j(function(){ $j('.tips-right').tipsy({gravity: 'w',html: true, delayIn: 200}); });
$j(function(){ $j('.tips-left').tipsy({gravity: 'e',html: true, delayIn: 200}); });
$j(function(){ $j('.tips-bottom').tipsy({gravity: 'n',html: true, delayIn: 200}); });
$j(function(){ $j('.tips-se').tipsy({gravity: 'se',html: true, delayIn: 500}); });
$j('.tipsy').css('position','fixed');
$j(".uniform").uniform({selectAutoWidth : true});
$j(".uniform").removeClass('uniform');
$j(document).off('click.dropDown');
$j(document).on('click.dropDown',
function(event) {
if ($j(event.target).closest('.dropDownBtn').length==0 && $j(event.target).closest('.dropDown').length==0) {
$j('.dropDown').fadeOut(150);
$j('.dropDownBtn').children('a').removeClass('icon-button-active');
$j('.dropDownBtn').removeClass('btnSelected');
}
}
);
$j('.dropDownBtn').off('click.dropDownBtn');
$j('.dropDownBtn').on('click.dropDownBtn',
function(event) {
if ($j(this).hasClass('disabled')) return;
var pos = false;
var dropDown = $j(this).children('.dropDown');
if (this.dataDropDown) {
// dropDown = this.dataDropDown;
} else {
pos = true;
}
this.dataDropDown = dropDown;
var that = this;
if (!$j(this).children('.dropDown').is(':visible') && !$j(this).children('a').hasClass('button-disabled')) {
$j('.dropDown').fadeOut(150);
$j('.dropDownBtn').removeClass('btnSelected');
if (dropDown.css('position') == 'fixed') {
var pos = $j(that).offset();
if (!dropDown.data('positioned')
|| dropDown.data('oldpos').top != pos.top
|| dropDown.data('oldpos').left != pos.left) {
var apos = {top: $j(window).scrollTop(),left: $j(window).scrollLeft()};
dropDown.css('top',(pos.top+$j(that).outerHeight()-apos.top)+'px');
dropDown.css('left',(pos.left-apos.left)+'px');
dropDown.data('positioned',true);
dropDown.data('oldpos',pos);
dropDown.closest('.ui-dialog-content').css('overflow','visible');
dropDown.closest('.ui-dialog').css('overflow','visible');
}
}
dropDown.fadeIn(150,function() {
$j(this).scrollTop(0);
if (dropDown.width()+dropDown.offset().left > $j(document).width()) {
dropDown.css('left',($j(document).width() - dropDown.width() - dropDown.offset().left)+'px');
}
if (dropDown.css('overflow-y') == 'auto' && (dropDown.css('max-height') == 'none' || dropDown.data('autoheight'))) {
var h = Math.max(200,$j(window).height() - (dropDown.offset().top - $j(window).scrollTop())-15);
dropDown.css('max-height', h+'px');
dropDown.data('autoheight',true);
}
var pos = $j(this).find('.dropDownPanel li.marked').position();
if (pos && pos.top) {
$j(this).scrollTop(Math.max(0,pos.top-($j(this).height()/2)));
}
});
$j(this).addClass('btnSelected');
$j(this).trigger('dropDownOpened',{});
if (typeof YAHOO != 'undefined' && YAHOO)
event.stopPropagation();
} else if ($j(event.target).closest('.dropDown').length==0) {
$j('.dropDown').fadeOut(150);
$j('.dropDownBtn').removeClass('btnSelected');
$j(this).trigger('dropDownClosed',{});
if (dropDown.css('position') == 'fixed') {
dropDown.closest('.ui-dialog-content').css('overflow','auto');
dropDown.closest('.ui-dialog').css('overflow','hidden');
}
}
}
);
$j('.ui-dialog-content form input[type="text"]').off('keydown.preventEnter');
$j('.ui-dialog-content form input[type="text"]').on('keydown.preventEnter',function(e) {
if (e.which == 13) e.preventDefault();
return e.which !== 13;
});
$j(".simple-tips .close").off('click.simpletips');
$j(".simple-tips .close").on('click.simpletips',function(){
$j(".simple-tips").slideToggle();
});
if (edubar) {
edubar.initSmartLinks($j('#bar_mainDiv'));
}
}
function barWndSize() {
var bh = $j('#edubar .edubarHeader').outerHeight();
var bw = $j('#edubar .edubarSidebar').width();
var h = $j(window).height() - (bh ? bh : 0);
var w = $j(window).width().w - (bw ? bw: 0);
return {width: w, height: h};
}
function barWndResize() {
var h = barWndSize().height;
if (document.getElementById('bar_mainDiv')) {
var elem = document.getElementById('bar_mainDiv');
//if ($j(elem).height() < h) {
$j(elem).css('min-height',h+'px');
//}
}
if (document.getElementById('fitheight') != null) {
if ($j('#fitheight').height() != h) {
$j('#fitheight').css('min-height',h+'px');
}
}
if ($j('#edubar div.edubarHeaderTitle').length > 0) {
$j('#edubar div.edubarHeaderTitle').width($j(window).width()-($j(window).width()-$j('#edubar .edubarQuickmenu').position().left)-$j('#edubar .edubarHeaderTitle').position().left-30);
}
}
function wndResize() {
barWndResize();
}
function wndSize() {
return barWndSize();
}
function barInitPage() {
barRefreshPage();
barWndResize();
barHandleHashAction();
$j(window).off('resize.edubar');
$j(window).on('resize.edubar',function() {
barWndResize();
});
}
/* ================================= edubar funkcie ======================================= */
function barRemoveDomElem(elem, sebaNie) {
var children = $j(elem).children();
for (var i=0;i');
barSrcLoading[src] = 'loading';
barInitializeJsLoad();
$j.ajax({
dataType: "script",
url: src,
success: function() {
barSrcLoading[src] = 'done';
barJsLoadingDone();
},
error: function(a,b,err) {
//console.log('error loading '+src+';'+err);
barSrcLoading[src] = 'done';
barJsLoadingDone();
}
});
}
window.barLoadedJsLibraries[src] = true;
} else {
if (onload) {
onload();
}
if (onalreadyloaded) {
onalreadyloaded();
}
}
}
function barCssLoad(src) {
if (!barJsLibraryIsLoaded(src)) {
$j.ajaxSetup({cache: true});
jQuery( document.createElement('link') ).attr({
href: src,
media: 'screen',
type: 'text/css',
rel: 'stylesheet'
}).appendTo('head');
window.barLoadedJsLibraries[src] = true;
}
}
function barSmartLoadPage(src, forceReload) {
if (!edubar) window.location = src;
edubar.smartLoadPage(src, forceReload, forceReload);
}
function barSmartReloadPage() {
if (!edubar) document.location.reload(true);
edubar.smartLoadPage(window.location.href, true, true);
}
function barSmartLoadScript(src, method) {
if (!edubar) {
src = src + (src.indexOf('?') == -1 ? '?' : '&') + 'barNoSkin=1&barContentOnly=1';
if (!method) method = 'GET';
$j.ajax({
type: method,
url: src,
data: {},
success: function(data) {
$j('body').append(''+data+'
');
}
});
return;
}
edubar.smartLoadScript(src, method);
}
function barShowSchoolYearSelector() {
$j('#edubarSchoolYear').show();
}
function barHideSchoolYearSelector() {
$j('#edubarSchoolYear').hide();
}
function barShowMessage(msg, duration) {
if (!duration) duration = 10000;
$j('body').children('.barMessageText').remove();
$j(''+msg+'
').appendTo($j('body')).fadeIn('fast').delay(duration).fadeOut('fast',function() {
$j(this).remove();
});
}
var barUrlToModule = {};
var edubar = null;
$j.widget('edupage.edubar',{
options: {
PSID: '',
portalMainUrl: '',
edupageUrl: '',
erid: '',
sessionPingInterval: 600,
sessionPingUrl: '',
somNaPortali: false,
urlToModule: {},
chatVisible: false,
loggedUser: '',
lang: '',
hasActiveModuleSkin: false,
syncIntervalMultiplier: 1
},
menuOpened: null,
defaultHeadHtml: '',
lastLoadedLocation: '',
lastSyncTime: 0,
lastSessionPingTime: 0,
openedChatWindows: {},
switchAccount: function(edudata) {
var thisObj = this;
window.location = thisObj.options.portalMainUrl+'/pauth.php?akcia=edupageChange&rid='+encodeURIComponent(edudata)+'&PSID='+thisObj.options.PSID+'&fe='+thisObj.options.edupage;
},
switchToAdmin: function() {
barNewDialog({
'source': '/portal/?cmd=SwitchToAdmin'
});
},
_create: function() {
var thisObj = this;
edubar = this;
barUrlToModule = this.options.urlToModule;
this.defaultHeadHtml = $j('head').html();
this.element.find('.edubarFeedbackBtn').on('click',function() {
barNewDialog({source: thisObj.options.edupageUrl+'/znamky/?jwgc=ZnamkyFeedbackDialog'});
});
this.element.find('.edubarChangeEdurowBtn').on('click',function() {
thisObj.switchAccount($j(this).attr('data-rowid'));
});
this.element.find('.switchToAdminBtn').on('click',function() {
thisObj.switchToAdmin();
});
this.element.find('.edubarChatBtn').on('click',function() {
thisObj.toggleChat();
});
this.element.find('ul.edubarMenulist.level1').each(function() {
$j(this).width($j(this).children('li').length*70);
});
this.element.find('ul.edubarMenulist > li').hoverIntent({
'over': function() {
$j(this).siblings('li').find('ul.edubarMenulist').hide();
$j(this).children('ul.edubarMenulist').show();
},
'out': function() {
$j(this).children('ul.edubarMenulist').hide();
},
'timeout': 250
});
this.element.find('ul.edubarMenulist > li').click(function() {
$j(this).siblings('li').find('ul.edubarMenulist').hide();
$j(this).children('ul.edubarMenulist').show();
});
this.element.find('.edubarProfilebox .display').on('click',function() {
thisObj.element.find('.edubarProfilebox .profilemenu').css('display','block');
$j(document).off('click.edubarProfilebox');
$j(document).on('click.edubarProfilebox',function(event) {
if ($j(event.target).closest('.edubarProfilebox').length==0) {
$j(document).off('click.edubarProfilebox');
thisObj.element.find('.edubarProfilebox .profilemenu').css('display','');
}
});
});
this.element.find('.edubarHideCalloutBtn').on('click',function() {
$j('#bar_protoUserCallout').fadeOut('fast');
});
this.element.find('#edubarNewItemBtn').on('click',function() {
var thisObj = this;
var dialog = barNewDialog({
title: ls(3278),
source: '/timeline/?cmd=creator',
dialogClass: 'whiteDialog',
height: 518
});
});
setTimeout(function() {
var btn = $j('#bar_protoUserCallout');
var kontoBtn = thisObj.element.find('.barKontoBtn');
if (kontoBtn.length>0) {
var pos = kontoBtn.offset();
btn.offset({left: pos.left-100, top: pos.top+20});
$j('#bar_protoUserCallout').fadeIn('slow');
}
},1000);
this.element.find('.edubarHideCalloutBtn').on('click',function() {
$j('#bar_protoUserCallout').fadeOut('fast');
});
this.element.find('.profilemenu a.switchChildBtn').on('click',function() {
var studentid = $j(this).attr('data-sid');
$j.get('/login/switchchild?studentid='+studentid, function(data) {
document.location.reload(true);
});
});
this.element.find('#edubarSchoolYear select').on('change',function() {
thisObj.switchSchoolYear($j(this).val());
});
this.hashChange();
this.initSmartLinks(this.element);
this.initGlobalEvents();
if (thisObj.options.sessionPingInterval > 0 && !thisObj.options.somNaPortali) {
setTimeout(function() {
thisObj.sessionPing();
},thisObj.options.sessionPingInterval*1000);
}
this.initCheckTimer();
if (this.options.syncIntervalMultiplier) {
this.syncIntervalMultiplier = Math.min(5,Math.max(0.5,parseFloat(this.options.syncIntervalMultiplier)));
}
this.lastLoadedLocation = window.location.pathname+window.location.search;
$j(window).on('load',function() {
thisObj.initSmartLinks($j('#bar_mainDiv'));
thisObj.initSyncInterval();
if (sessionStorage && sessionStorage.getItem('chatOpened') == '1') {
thisObj.openChat();
}
});
var pom = {};
for (var x in this.options.urlToModule) {
if (!pom[x]) pom[x] = {};
for (var url in this.options.urlToModule[x]) {
pom[x][barEncLink(url)] = 1;
}
}
for (var x in pom) {
for (var url in pom[x]) {
this.options.urlToModule[x][url] = 1;
}
}
this.selectModule([window.location.pathname+window.location.search]);
},
checkTimeoutId: null,
initCheckTimer: function() {
var self = this;
this.lastSessionPingTime = (new Date()).getTime();
this.checkTimerId = setTimeout(function() {
self.checkTimer();
}, 1000);
},
switchSchoolYear: function(year) {
var self = this;
this.element.find('#edubarSchoolYear').css('opacity','0.5');
$j.post('/znamky/?what=setyear',{znamky_yearid: year}, function(data) {
self.element.find('#edubarSchoolYear').css('opacity','1');
self.element.find('#edubarSchoolYear select').val(data);
barSmartReloadPage();
});
},
checkTimer: function() {
var self = this;
if ((new Date()).getTime() - this.lastSessionPingTime > this.options.sessionPingInterval*1000*1.3) {
this.sessionPing(true);
}
this.checkTimerId = setTimeout(function() {
self.checkTimer();
}, 1000);
},
initSmartLinks: function(elem) {
var thisObj = this;
elem.find('a.edubarSmartLink').off('click.smartlink');
elem.find('a.edubarSmartLink').on('click.smartlink',function(event) {
if (event.which != 1) return;
var src = $j(this).attr('href');
if (!src) return;
if (src == '/dashboard/eb.php?mode=reports') {
event.preventDefault();
thisObj.smartLoadScript(src);
return;
}
if ($j(this).hasClass('edubarLinkToSkin')) return;
if (!$j(this).hasClass('edubarLinkToSkin') && thisObj.options.hasActiveModuleSkin) return;
event.preventDefault();
thisObj.smartLoadPage(src);
});
elem.find('form.edubarSmartLoadFrm').off('submit.smartlink');
elem.find('form.edubarSmartLoadFrm').on('submit.smartlink',function(event) {
event.preventDefault();
var src = $j(this).attr('action');
src += (src.indexOf('?') == -1 ? '?' : '&')+$j(this).serialize();
thisObj.smartLoadPage(barEncLink(src));
return false;
});
},
initGlobalEvents: function() {
var thisObj = this;
$j(document).off('click.edubar');
$j(document).on('click.edubar',function(event) {
if ($j(event.target).closest('ul.edubarMenulist').length == 0) {
thisObj.element.find('ul.edubarMenulist.level1').hide();
}
});
$j(window).off('hashchange.edubar');
$j(window).on('hashchange.edubar',function(e) {
thisObj.hashChange();
});
$j(window).off('popstate.edubar');
$j(window).on('popstate.edubar',function(e) {
if (thisObj.smartLinksHashChanged) {
thisObj.smartLinksHashChanged = false;
return;
}
if (!e.originalEvent.state || !e.originalEvent.state.eduSmartHref) {
setTimeout(function() {
if (thisObj.smartLinksHashChanged) {
thisObj.smartLinksHashChanged = false;
return;
}
if (!e.cancelBarHandler) {
thisObj.smartLoadPage(window.location.pathname+window.location.search, true);
e.stopImmediatePropagation();
} else {
thisObj.lastLoadedLocation = window.location.pathname+window.location.search;
}
},100);
return;
}
var href = e.originalEvent.state.eduSmartHref;
thisObj.smartLoadPage(href, true);
e.stopImmediatePropagation();
});
$j(window).off('storage.edubar');
$j(window).on('storage.edubar',function(event) {
thisObj.handleStorageEvent(event);
});
},
smartLoadPage: function(href, doNotStoreState, forceReaload) {
var startTime = new Date();
var thisObj = this;
if (this.lastLoadedLocation == href && !forceReaload) return;
var buevent = jQuery.Event( "beforeunload" );
buevent.originalEvent = {'returnValue': ''};
$j(window).trigger(buevent);
if (buevent.isDefaultPrevented()) return;
if (buevent.originalEvent.returnValue != '') {
if (!confirm(buevent.originalEvent.returnValue)) {
return;
}
}
$j('#edubar').find('#quickIntroBtn').remove();
var hashPos = href.indexOf('#');
var hash = '';
if (hashPos != -1) {
hash = href.substr(hashPos+1);
href = href.substr(0,hashPos);//+'?'+hash;
}
src = href + (href.indexOf('?') == -1 ? '?' : '&') + 'barNoSkin=1';
$j('#edubarLogo').fadeOut('fast');
barHideSchoolYearSelector();
$j('body').append('');
$j('body').append(''+ls(3358)+'
');
$j.get(src, function(data) {
barTrackTiming('EdubarPageLoad', 'data downloaded', ((new Date()).getTime()-startTime.getTime()), src);
var hstart = data.indexOf('%%%head%%%');
var hend = hstart == -1 ? -1 : data.indexOf('%%%head%%%', hstart+10);
var headCnt = '';
if (hstart != -1 && hend != -1) {
var headCnt = data.substr(hstart+10, hend == -1 ? 0 : hend-hstart-10);
data = data.substr(0,hstart)+data.substr(hend+10);
$j('head').html(thisObj.defaultHeadHtml+headCnt);
}
if (!doNotStoreState) {
if (window.history.pushState) {
window.history.pushState({'eduSmartHref': href}, null, href);
}
}
thisObj.selectModule([href]);
//$j(document).off(); //kvoli tomu blblo jquery draggable
$j(window).off();
$j('body').off('keypress');
$j('body').off('keydown');
var bodyElems = $j('body').children();
for (var i=0;i ');
$j('body').append('