PageSourceSearch

https://lazer-maxima.ru/bitrix/cache/js/s1/aspro-medc2/template_3d…421e051474635279cc3d_v1.js?1751886181434396

js lazer-maxima.ru collected 2026-10-04 00:18:51 UTC 434,396 bytes, 8,066 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:67:"/local/templates/aspro-medc2/js/jquery.actual.min.js?16569236381101";s:6:"source";s:52:"/local/templates/aspro-medc2/js/jquery.actual.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3/* Copyright 2012, Ben Lin (http://dreamerslab.com/)
4 * Licensed under the MIT License (LICENSE.txt).
5 *
6 * Version: 1.0.15
7 *
8 * Requires: jQuery >= 1.2.3
9 */
10(function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf;a.fn.extend({actual:function(b,l){if(!this[b]){throw'$.actual => The jQuery method "'+b+'" you called does not exist';}var f={absolute:false,clone:false,includeMargin:false};var i=a.extend(f,l);var e=this.eq(0);var h,j;if(i.clone===true){h=function(){var m="position: absolute !important; top: -1000 !important; ";e=e.clone().attr("style",m).appendTo("body");};j=function(){e.remove();};}else{var g=[];var d="";var c;h=function(){c=e.parents().addBack().filter(":hidden");d+="visibility: hidden !important; display: block !important; ";if(i.absolute===true){d+="position: absolute !important; ";}c.each(function(){var m=a(this);g.push(m.attr("style"));m.attr("style",d);});};j=function(){c.each(function(m){var o=a(this);var n=g[m];if(n===undefined){o.removeAttr("style");}else{o.attr("style",n);}});};}h();var k=/(outer)/.test(b)?e[b](i.includeMargin):e[b]();j();return k;}});})(jQuery);
11/* End */
12;
13; /* Start:"a:4:{s:4:"full";s:66:"/local/templates/aspro-medc2/js/jquery.fancybox.js?165692363848706";s:6:"source";s:50:"/local/templates/aspro-medc2/js/jquery.fancybox.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
14/*!
15 * fancyBox - jQuery Plugin
16 * version: 2.1.5 (Fri, 14 Jun 2013)
17 * @requires jQuery v1.6 or later
18 *
19 * Examples at http://fancyapps.com/fancybox/
20 * License: www.fancyapps.com/fancybox/#license
21 *
22 * Copyright 2012 Janis Skarnelis - [email protected]
23 *
24 */
25
26(function (window, document, $, undefined) {
27	"use strict";
28
29	var H = $("html"),
30		W = $(window),
31		D = $(document),
32		F = $.fancybox = function () {
33			F.open.apply( this, arguments );
34		},
35		IE =  navigator.userAgent.match(/msie/i),
36		didUpdate	= null,
37		isTouch		= document.createTouch !== undefined,
38
39		isQuery	= function(obj) {
40			return obj && obj.hasOwnProperty && obj instanceof $;
41		},
42		isString = function(str) {
43			return str && $.type(str) === "string";
44		},
45		isPercentage = function(str) {
46			return isString(str) && str.indexOf('%') > 0;
47		},
48		isScrollable = function(el) {
49			return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
50		},
51		getScalar = function(orig, dim) {
52			var value = parseInt(orig, 10) || 0;
53
54			if (dim && isPercentage(orig)) {
55				value = F.getViewport()[ dim ] / 100 * value;
56			}
57
58			return Math.ceil(value);
59		},
60		getValue = function(value, dim) {
61			return getScalar(value, dim) + 'px';
62		};
63
64	$.extend(F, {
65		// The current version of fancyBox
66		version: '2.1.5',
67
68		defaults: {
69			padding : 15,
70			margin  : 20,
71
72			width     : 800,
73			height    : 600,
74			minWidth  : 100,
75			minHeight : 100,
76			maxWidth  : 9999,
77			maxHeight : 9999,
78			pixelRatio: 1, // Set to 2 for retina display support
79
80			autoSize   : true,
81			autoHeight : false,
82			autoWidth  : false,
83
84			autoResize  : true,
85			autoCenter  : !isTouch,
86			fitToView   : true,
87			aspectRatio : false,
88			topRatio    : 0.5,
89			leftRatio   : 0.5,
90
91			scrolling : 'auto', // 'auto', 'yes' or 'no'
92			wrapCSS   : '',
93
94			arrows     : true,
95			closeBtn   : true,
96			closeClick : false,
97			nextClick  : false,
98			mouseWheel : true,
99			autoPlay   : false,
100			playSpeed  : 3000,
101			preload    : 3,
102			modal      : false,
103			loop       : true,
104
105			ajax  : {
106				dataType : 'html',
107				headers  : { 'X-fancyBox': true }
108			},
109			iframe : {
110				scrolling : 'auto',
111				preload   : true
112			},
113			swf : {
114				wmode: 'transparent',
115				allowfullscreen   : 'true',
116				allowscriptaccess : 'always'
117			},
118
119			keys  : {
120				next : {
121					13 : 'left', // enter
122					34 : 'up',   // page down
123					39 : 'left', // right arrow
124					40 : 'up'    // down arrow
125				},
126				prev : {
127					8  : 'right',  // backspace
128					33 : 'down',   // page up
129					37 : 'right',  // left arrow
130					38 : 'down'    // up arrow
131				},
132				close  : [27], // escape key
133				play   : [32], // space - start/stop slideshow
134				toggle : [70]  // letter "f" - toggle fullscreen
135			},
136
137			direction : {
138				next : 'left',
139				prev : 'right'
140			},
141
142			scrollOutside  : true,
143
144			// Override some properties
145			index   : 0,
146			type    : null,
147			href    : null,
148			content : null,
149			title   : null,
150
151			// HTML templates
152			tpl: {
153				wrap     : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
154				image    : '<img class="fancybox-image" src="{href}" alt="" />',
155				iframe   : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
156				error    : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
157				closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
158				next     : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
159				prev     : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
160			},
161
162			// Properties for each animation type
163			// Opening fancyBox
164			openEffect  : 'fade', // 'elastic', 'fade' or 'none'
165			openSpeed   : 250,
166			openEasing  : 'swing',
167			openOpacity : true,
168			openMethod  : 'zoomIn',
169
170			// Closing fancyBox
171			closeEffect  : 'fade', // 'elastic', 'fade' or 'none'
172			closeSpeed   : 250,
173			closeEasing  : 'swing',
174			closeOpacity : true,
175			closeMethod  : 'zoomOut',
176
177			// Changing next gallery item
178			nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
179			nextSpeed  : 250,
180			nextEasing : 'swing',
181			nextMethod : 'changeIn',
182
183			// Changing previous gallery item
184			prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
185			prevSpeed  : 250,
186			prevEasing : 'swing',
187			prevMethod : 'changeOut',
188
189			// Enable default helpers
190			helpers : {
191				overlay : true,
192				title   : true
193			},
194
195			// Callbacks
196			onCancel     : $.noop, // If canceling
197			beforeLoad   : $.noop, // Before loading
198			afterLoad    : $.noop, // After loading
199			beforeShow   : $.noop, // Before changing in current item
200			afterShow    : $.noop, // After opening
201			beforeChange : $.noop, // Before changing gallery item
202			beforeClose  : $.noop, // Before closing
203			afterClose   : $.noop  // After closing
204		},
205
206		//Current state
207		group    : {}, // Selected group
208		opts     : {}, // Group options
209		previous : null,  // Previous element
210		coming   : null,  // Element being loaded
211		current  : null,  // Currently loaded element
212		isActive : false, // Is activated
213		isOpen   : false, // Is currently open
214		isOpened : false, // Have been fully opened at least once
215
216		wrap  : null,
217		skin  : null,
218		outer : null,
219		inner : null,
220
221		player : {
222			timer    : null,
223			isActive : false
224		},
225
226		// Loaders
vendor: 12,016 bytes, lines 227-774
227		ajaxLoad   : null,
228		imgPreload : null,
229
230		// Some collections
231		transitions : {},
232		helpers     : {},
233
234		/*
235		 *	Static methods
236		 */
237
238		open: function (group, opts) {
239			if (!group) {
240				return;
241			}
242
243			if (!$.isPlainObject(opts)) {
244				opts = {};
245			}
246
247			// Close if already active
248			if (false === F.close(true)) {
249				return;
250			}
251
252			// Normalize group
253			if (!$.isArray(group)) {
254				group = isQuery(group) ? $(group).get() : [group];
255			}
256
257			// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
258			$.each(group, function(i, element) {
259				var obj = {},
260					href,
261					title,
262					content,
263					type,
264					rez,
265					hrefParts,
266					selector;
267
268				if ($.type(element) === "object") {
269					// Check if is DOM element
270					if (element.nodeType) {
271						element = $(element);
272					}
273
274					if (isQuery(element)) {
275						obj = {
276							href    : element.data('fancybox-href') || element.attr('href'),
277							title   : element.data('fancybox-title') || element.attr('title'),
278							isDom   : true,
279							element : element
280						};
281
282						if ($.metadata) {
283							$.extend(true, obj, element.metadata());
284						}
285
286					} else {
287						obj = element;
288					}
289				}
290
291				href  = opts.href  || obj.href || (isString(element) ? element : null);
292				title = opts.title !== undefined ? opts.title : obj.title || '';
293
294				content = opts.content || obj.content;
295				type    = content ? 'html' : (opts.type  || obj.type);
296
297				if (!type && obj.isDom) {
298					type = element.data('fancybox-type');
299
300					if (!type) {
301						rez  = element.prop('class').match(/fancybox\.(\w+)/);
302						type = rez ? rez[1] : null;
303					}
304				}
305
306				if (isString(href)) {
307					// Try to guess the content type
308					if (!type) {
309						if (F.isImage(href)) {
310							type = 'image';
311
312						} else if (F.isSWF(href)) {
313							type = 'swf';
314
315						} else if (href.charAt(0) === '#') {
316							type = 'inline';
317
318						} else if (isString(element)) {
319							type    = 'html';
320							content = element;
321						}
322					}
323
324					// Split url into two pieces with source url and content selector, e.g,
325					// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
326					if (type === 'ajax') {
327						hrefParts = href.split(/\s+/, 2);
328						href      = hrefParts.shift();
329						selector  = hrefParts.shift();
330					}
331				}
332
333				if (!content) {
334					if (type === 'inline') {
335						if (href) {
336							content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
337
338						} else if (obj.isDom) {
339							content = element;
340						}
341
342					} else if (type === 'html') {
343						content = href;
344
345					} else if (!type && !href && obj.isDom) {
346						type    = 'inline';
347						content = element;
348					}
349				}
350
351				$.extend(obj, {
352					href     : href,
353					type     : type,
354					content  : content,
355					title    : title,
356					selector : selector
357				});
358
359				group[ i ] = obj;
360			});
361
362			// Extend the defaults
363			F.opts = $.extend(true, {}, F.defaults, opts);
364
365			// All options are merged recursive except keys
366			if (opts.keys !== undefined) {
367				F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
368			}
369
370			F.group = group;
371
372			return F._start(F.opts.index);
373		},
374
375		// Cancel image loading or abort ajax request
376		cancel: function () {
377			var coming = F.coming;
378
379			if (!coming || false === F.trigger('onCancel')) {
380				return;
381			}
382
383			F.hideLoading();
384
385			if (F.ajaxLoad) {
386				F.ajaxLoad.abort();
387			}
388
389			F.ajaxLoad = null;
390
391			if (F.imgPreload) {
392				F.imgPreload.onload = F.imgPreload.onerror = null;
393			}
394
395			if (coming.wrap) {
396				coming.wrap.stop(true, true).trigger('onReset').remove();
397			}
398
399			F.coming = null;
400
401			// If the first item has been canceled, then clear everything
402			if (!F.current) {
403				F._afterZoomOut( coming );
404			}
405		},
406
407		// Start closing animation if is open; remove immediately if opening/closing
408		close: function (event) {
409			F.cancel();
410
411			if (false === F.trigger('beforeClose')) {
412				return;
413			}
414
415			F.unbindEvents();
416
417			if (!F.isActive) {
418				return;
419			}
420
421			if (!F.isOpen || event === true) {
422				$('.fancybox-wrap').stop(true).trigger('onReset').remove();
423
424				F._afterZoomOut();
425
426			} else {
427				F.isOpen = F.isOpened = false;
428				F.isClosing = true;
429
430				$('.fancybox-item, .fancybox-nav').remove();
431
432				F.wrap.stop(true, true).removeClass('fancybox-opened');
433
434				F.transitions[ F.current.closeMethod ]();
435			}
436		},
437
438		// Manage slideshow:
439		//   $.fancybox.play(); - toggle slideshow
440		//   $.fancybox.play( true ); - start
441		//   $.fancybox.play( false ); - stop
442		play: function ( action ) {
443			var clear = function () {
444					clearTimeout(F.player.timer);
445				},
446				set = function () {
447					clear();
448
449					if (F.current && F.player.isActive) {
450						F.player.timer = setTimeout(F.next, F.current.playSpeed);
451					}
452				},
453				stop = function () {
454					clear();
455
456					D.unbind('.player');
457
458					F.player.isActive = false;
459
460					F.trigger('onPlayEnd');
461				},
462				start = function () {
463					if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
464						F.player.isActive = true;
465
466						D.bind({
467							'onCancel.player beforeClose.player' : stop,
468							'onUpdate.player'   : set,
469							'beforeLoad.player' : clear
470						});
471
472						set();
473
474						F.trigger('onPlayStart');
475					}
476				};
477
478			if (action === true || (!F.player.isActive && action !== false)) {
479				start();
480			} else {
481				stop();
482			}
483		},
484
485		// Navigate to next gallery item
486		next: function ( direction ) {
487			var current = F.current;
488
489			if (current) {
490				if (!isString(direction)) {
491					direction = current.direction.next;
492				}
493
494				F.jumpto(current.index + 1, direction, 'next');
495			}
496		},
497
498		// Navigate to previous gallery item
499		prev: function ( direction ) {
500			var current = F.current;
501
502			if (current) {
503				if (!isString(direction)) {
504					direction = current.direction.prev;
505				}
506
507				F.jumpto(current.index - 1, direction, 'prev');
508			}
509		},
510
511		// Navigate to gallery item by index
512		jumpto: function ( index, direction, router ) {
513			var current = F.current;
514
515			if (!current) {
516				return;
517			}
518
519			index = getScalar(index);
520
521			F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
522			F.router    = router || 'jumpto';
523
524			if (current.loop) {
525				if (index < 0) {
526					index = current.group.length + (index % current.group.length);
527				}
528
529				index = index % current.group.length;
530			}
531
532			if (current.group[ index ] !== undefined) {
533				F.cancel();
534
535				F._start(index);
536			}
537		},
538
539		// Center inside viewport and toggle position type to fixed or absolute if needed
540		reposition: function (e, onlyAbsolute) {
541			var current = F.current,
542				wrap    = current ? current.wrap : null,
543				pos;
544
545			if (wrap) {
546				pos = F._getPosition(onlyAbsolute);
547
548				if (e && e.type === 'scroll') {
549					delete pos.position;
550
551					wrap.stop(true, true).animate(pos, 200);
552
553				} else {
554					wrap.css(pos);
555
556					current.pos = $.extend({}, current.dim, pos);
557				}
558			}
559		},
560
561		update: function (e) {
562			var type = (e && e.type),
563				anyway = !type || type === 'orientationchange';
564
565			if (anyway) {
566				clearTimeout(didUpdate);
567
568				didUpdate = null;
569			}
570
571			if (!F.isOpen || didUpdate) {
572				return;
573			}
574
575			didUpdate = setTimeout(function() {
576				var current = F.current;
577
578				if (!current || F.isClosing) {
579					return;
580				}
581
582				F.wrap.removeClass('fancybox-tmp');
583
584				if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
585					F._setDimension();
586				}
587
588				if (!(type === 'scroll' && current.canShrink)) {
589					F.reposition(e);
590				}
591
592				F.trigger('onUpdate');
593
594				didUpdate = null;
595
596			}, (anyway && !isTouch ? 0 : 300));
597		},
598
599		// Shrink content to fit inside viewport or restore if resized
600		toggle: function ( action ) {
601			if (F.isOpen) {
602				F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
603
604				// Help browser to restore document dimensions
605				if (isTouch) {
606					F.wrap.removeAttr('style').addClass('fancybox-tmp');
607
608					F.trigger('onUpdate');
609				}
610
611				F.update();
612			}
613		},
614
615		hideLoading: function () {
616			D.unbind('.loading');
617
618			$('#fancybox-loading').remove();
619		},
620
621		showLoading: function () {
622			var el, viewport;
623
624			F.hideLoading();
625
626			el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');
627
628			// If user will press the escape-button, the request will be canceled
629			D.bind('keydown.loading', function(e) {
630				if ((e.which || e.keyCode) === 27) {
631					e.preventDefault();
632
633					F.cancel();
634				}
635			});
636
637			if (!F.defaults.fixed) {
638				viewport = F.getViewport();
639
640				el.css({
641					position : 'absolute',
642					top  : (viewport.h * 0.5) + viewport.y,
643					left : (viewport.w * 0.5) + viewport.x
644				});
645			}
646		},
647
648		getViewport: function () {
649			var locked = (F.current && F.current.locked) || false,
650				rez    = {
651					x: W.scrollLeft(),
652					y: W.scrollTop()
653				};
654
655			if (locked) {
656				rez.w = locked[0].clientWidth;
657				rez.h = locked[0].clientHeight;
658
659			} else {
660				// See http://bugs.jquery.com/ticket/6724
661				rez.w = isTouch && window.innerWidth  ? window.innerWidth  : W.width();
662				rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
663			}
664
665			return rez;
666		},
667
668		// Unbind the keyboard / clicking actions
669		unbindEvents: function () {
670			if (F.wrap && isQuery(F.wrap)) {
671				F.wrap.unbind('.fb');
672			}
673
674			D.unbind('.fb');
675			W.unbind('.fb');
676		},
677
678		bindEvents: function () {
679			var current = F.current,
680				keys;
681
682			if (!current) {
683				return;
684			}
685
686			// Changing document height on iOS devices triggers a 'resize' event,
687			// that can change document height... repeating infinitely
688			W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
689
690			keys = current.keys;
691
692			if (keys) {
693				D.bind('keydown.fb', function (e) {
694					var code   = e.which || e.keyCode,
695						target = e.target || e.srcElement;
696
697					// Skip esc key if loading, because showLoading will cancel preloading
698					if (code === 27 && F.coming) {
699						return false;
700					}
701
702					// Ignore key combinations and key events within form elements
703					if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
704						$.each(keys, function(i, val) {
705							if (current.group.length > 1 && val[ code ] !== undefined) {
706								F[ i ]( val[ code ] );
707
708								e.preventDefault();
709								return false;
710							}
711
712							if ($.inArray(code, val) > -1) {
713								F[ i ] ();
714
715								e.preventDefault();
716								return false;
717							}
718						});
719					}
720				});
721			}
722
723			if ($.fn.mousewheel && current.mouseWheel) {
724				F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
725					var target = e.target || null,
726						parent = $(target),
727						canScroll = false;
728
729					while (parent.length) {
730						if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
731							break;
732						}
733
734						canScroll = isScrollable( parent[0] );
735						parent    = $(parent).parent();
736					}
737
738					if (delta !== 0 && !canScroll) {
739						if (F.group.length > 1 && !current.canShrink) {
740							if (deltaY > 0 || deltaX > 0) {
741								F.prev( deltaY > 0 ? 'down' : 'left' );
742
743							} else if (deltaY < 0 || deltaX < 0) {
744								F.next( deltaY < 0 ? 'up' : 'right' );
745							}
746
747							e.preventDefault();
748						}
749					}
750				});
751			}
752		},
753
754		trigger: function (event, o) {
755			var ret, obj = o || F.coming || F.current;
756
757			if (!obj) {
758				return;
759			}
760
761			if ($.isFunction( obj[event] )) {
762				ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
763			}
764
765			if (ret === false) {
766				return false;
767			}
768
769			if (obj.helpers) {
770				$.each(obj.helpers, function (helper, opts) {
771					if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
772						F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
773					}
774				});
vendor: 8,050 bytes, lines 774-1133
774
775			}
776
777			D.trigger(event);
778		},
779
780		isImage: function (str) {
781			return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
782		},
783
784		isSWF: function (str) {
785			return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
786		},
787
788		_start: function (index) {
789			var coming = {},
790				obj,
791				href,
792				type,
793				margin,
794				padding;
795
796			index = getScalar( index );
797			obj   = F.group[ index ] || null;
798
799			if (!obj) {
800				return false;
801			}
802
803			coming = $.extend(true, {}, F.opts, obj);
804
805			// Convert margin and padding properties to array - top, right, bottom, left
806			margin  = coming.margin;
807			padding = coming.padding;
808
809			if ($.type(margin) === 'number') {
810				coming.margin = [margin, margin, margin, margin];
811			}
812
813			if ($.type(padding) === 'number') {
814				coming.padding = [padding, padding, padding, padding];
815			}
816
817			// 'modal' propery is just a shortcut
818			if (coming.modal) {
819				$.extend(true, coming, {
820					closeBtn   : false,
821					closeClick : false,
822					nextClick  : false,
823					arrows     : false,
824					mouseWheel : false,
825					keys       : null,
826					helpers: {
827						overlay : {
828							closeClick : false
829						}
830					}
831				});
832			}
833
834			// 'autoSize' property is a shortcut, too
835			if (coming.autoSize) {
836				coming.autoWidth = coming.autoHeight = true;
837			}
838
839			if (coming.width === 'auto') {
840				coming.autoWidth = true;
841			}
842
843			if (coming.height === 'auto') {
844				coming.autoHeight = true;
845			}
846
847			/*
848			 * Add reference to the group, so it`s possible to access from callbacks, example:
849			 * afterLoad : function() {
850			 *     this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
851			 * }
852			 */
853
854			coming.group  = F.group;
855			coming.index  = index;
856
857			// Give a chance for callback or helpers to update coming item (type, title, etc)
858			F.coming = coming;
859
860			if (false === F.trigger('beforeLoad')) {
861				F.coming = null;
862
863				return;
864			}
865
866			type = coming.type;
867			href = coming.href;
868
869			if (!type) {
870				F.coming = null;
871
872				//If we can not determine content type then drop silently or display next/prev item if looping through gallery
873				if (F.current && F.router && F.router !== 'jumpto') {
874					F.current.index = index;
875
876					return F[ F.router ]( F.direction );
877				}
878
879				return false;
880			}
881
882			F.isActive = true;
883
884			if (type === 'image' || type === 'swf') {
885				coming.autoHeight = coming.autoWidth = false;
886				coming.scrolling  = 'visible';
887			}
888
889			if (type === 'image') {
890				coming.aspectRatio = true;
891			}
892
893			if (type === 'iframe' && isTouch) {
894				coming.scrolling = 'scroll';
895			}
896
897			// Build the neccessary markup
898			coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
899
900			$.extend(coming, {
901				skin  : $('.fancybox-skin',  coming.wrap),
902				outer : $('.fancybox-outer', coming.wrap),
903				inner : $('.fancybox-inner', coming.wrap)
904			});
905
906			$.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
907				coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
908			});
909
910			F.trigger('onReady');
911
912			// Check before try to load; 'inline' and 'html' types need content, others - href
913			if (type === 'inline' || type === 'html') {
914				if (!coming.content || !coming.content.length) {
915					return F._error( 'content' );
916				}
917
918			} else if (!href) {
919				return F._error( 'href' );
920			}
921
922			if (type === 'image') {
923				F._loadImage();
924
925			} else if (type === 'ajax') {
926				F._loadAjax();
927
928			} else if (type === 'iframe') {
929				F._loadIframe();
930
931			} else {
932				F._afterLoad();
933			}
934		},
935
936		_error: function ( type ) {
937			$.extend(F.coming, {
938				type       : 'html',
939				autoWidth  : true,
940				autoHeight : true,
941				minWidth   : 0,
942				minHeight  : 0,
943				scrolling  : 'no',
944				hasError   : type,
945				content    : F.coming.tpl.error
946			});
947
948			F._afterLoad();
949		},
950
951		_loadImage: function () {
952			// Reset preload image so it is later possible to check "complete" property
953			var img = F.imgPreload = new Image();
954
955			img.onload = function () {
956				this.onload = this.onerror = null;
957
958				F.coming.width  = this.width / F.opts.pixelRatio;
959				F.coming.height = this.height / F.opts.pixelRatio;
960
961				F._afterLoad();
962			};
963
964			img.onerror = function () {
965				this.onload = this.onerror = null;
966
967				F._error( 'image' );
968			};
969
970			img.src = F.coming.href;
971
972			if (img.complete !== true) {
973				F.showLoading();
974			}
975		},
976
977		_loadAjax: function () {
978			var coming = F.coming;
979
980			F.showLoading();
981
982			F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
983				url: coming.href,
984				error: function (jqXHR, textStatus) {
985					if (F.coming && textStatus !== 'abort') {
986						F._error( 'ajax', jqXHR );
987
988					} else {
989						F.hideLoading();
990					}
991				},
992				success: function (data, textStatus) {
993					if (textStatus === 'success') {
994						coming.content = data;
995
996						F._afterLoad();
997					}
998				}
999			}));
1000		},
1001
1002		_loadIframe: function() {
1003			var coming = F.coming,
1004				iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
1005					.attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
1006					.attr('src', coming.href);
1007
1008			// This helps IE
1009			$(coming.wrap).bind('onReset', function () {
1010				try {
1011					$(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
1012				} catch (e) {}
1013			});
1014
1015			if (coming.iframe.preload) {
1016				F.showLoading();
1017
1018				iframe.one('load', function() {
1019					$(this).data('ready', 1);
1020
1021					// iOS will lose scrolling if we resize
1022					if (!isTouch) {
1023						$(this).bind('load.fb', F.update);
1024					}
1025
1026					// Without this trick:
1027					//   - iframe won't scroll on iOS devices
1028					//   - IE7 sometimes displays empty iframe
1029					$(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
1030
1031					F._afterLoad();
1032				});
1033			}
1034
1035			coming.content = iframe.appendTo( coming.inner );
1036
1037			if (!coming.iframe.preload) {
1038				F._afterLoad();
1039			}
1040		},
1041
1042		_preloadImages: function() {
1043			var group   = F.group,
1044				current = F.current,
1045				len     = group.length,
1046				cnt     = current.preload ? Math.min(current.preload, len - 1) : 0,
1047				item,
1048				i;
1049
1050			for (i = 1; i <= cnt; i += 1) {
1051				item = group[ (current.index + i ) % len ];
1052
1053				if (item.type === 'image' && item.href) {
1054					new Image().src = item.href;
1055				}
1056			}
1057		},
1058
1059		_afterLoad: function () {
1060			var coming   = F.coming,
1061				previous = F.current,
1062				placeholder = 'fancybox-placeholder',
1063				current,
1064				content,
1065				type,
1066				scrolling,
1067				href,
1068				embed;
1069
1070			F.hideLoading();
1071
1072			if (!coming || F.isActive === false) {
1073				return;
1074			}
1075
1076			if (false === F.trigger('afterLoad', coming, previous)) {
1077				coming.wrap.stop(true).trigger('onReset').remove();
1078
1079				F.coming = null;
1080
1081				return;
1082			}
1083
1084			if (previous) {
1085				F.trigger('beforeChange', previous);
1086
1087				previous.wrap.stop(true).removeClass('fancybox-opened')
1088					.find('.fancybox-item, .fancybox-nav')
1089					.remove();
1090			}
1091
1092			F.unbindEvents();
1093
1094			current   = coming;
1095			content   = coming.content;
1096			type      = coming.type;
1097			scrolling = coming.scrolling;
1098
1099			$.extend(F, {
1100				wrap  : current.wrap,
1101				skin  : current.skin,
1102				outer : current.outer,
1103				inner : current.inner,
1104				current  : current,
1105				previous : previous
1106			});
1107
1108			href = current.href;
1109
1110			switch (type) {
1111				case 'inline':
1112				case 'ajax':
1113				case 'html':
1114					if (current.selector) {
1115						content = $('<div>').html(content).find(current.selector);
1116
1117					} else if (isQuery(content)) {
1118						if (!content.data(placeholder)) {
1119							content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() );
1120						}
1121
1122						content = content.show().detach();
1123
1124						current.wrap.bind('onReset', function () {
1125							if ($(this).find(content).length) {
1126								content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
1127							}
1128						});
1129					}
1130				break;
1131
1132				case 'image':
1133					content = current.tpl.image.replace(
vendor: 14,919 bytes, lines 1133-1702
1133'{href}', href);
1134				break;
1135
1136				case 'swf':
1137					content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>';
1138					embed   = '';
1139
1140					$.each(current.swf, function(name, val) {
1141						content += '<param name="' + name + '" value="' + val + '"></param>';
1142						embed   += ' ' + name + '="' + val + '"';
1143					});
1144
1145					content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
1146				break;
1147			}
1148
1149			if (!(isQuery(content) && content.parent().is(current.inner))) {
1150				current.inner.append( content );
1151			}
1152
1153			// Give a chance for helpers or callbacks to update elements
1154			F.trigger('beforeShow');
1155
1156			// Set scrolling before calculating dimensions
1157			current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
1158
1159			// Set initial dimensions and start position
1160			F._setDimension();
1161
1162			F.reposition();
1163
1164			F.isOpen = false;
1165			F.coming = null;
1166
1167			F.bindEvents();
1168
1169			if (!F.isOpened) {
1170				$('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
1171
1172			} else if (previous.prevMethod) {
1173				F.transitions[ previous.prevMethod ]();
1174			}
1175
1176			F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
1177
1178			F._preloadImages();
1179		},
1180
1181		_setDimension: function () {
1182			var viewport   = F.getViewport(),
1183				steps      = 0,
1184				canShrink  = false,
1185				canExpand  = false,
1186				wrap       = F.wrap,
1187				skin       = F.skin,
1188				inner      = F.inner,
1189				current    = F.current,
1190				width      = current.width,
1191				height     = current.height,
1192				minWidth   = current.minWidth,
1193				minHeight  = current.minHeight,
1194				maxWidth   = current.maxWidth,
1195				maxHeight  = current.maxHeight,
1196				scrolling  = current.scrolling,
1197				scrollOut  = current.scrollOutside ? current.scrollbarWidth : 0,
1198				margin     = current.margin,
1199				wMargin    = getScalar(margin[1] + margin[3]),
1200				hMargin    = getScalar(margin[0] + margin[2]),
1201				wPadding,
1202				hPadding,
1203				wSpace,
1204				hSpace,
1205				origWidth,
1206				origHeight,
1207				origMaxWidth,
1208				origMaxHeight,
1209				ratio,
1210				width_,
1211				height_,
1212				maxWidth_,
1213				maxHeight_,
1214				iframe,
1215				body;
1216
1217			// Reset dimensions so we could re-check actual size
1218			wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
1219
1220			wPadding = getScalar(skin.outerWidth(true)  - skin.width());
1221			hPadding = getScalar(skin.outerHeight(true) - skin.height());
1222
1223			// Any space between content and viewport (margin, padding, border, title)
1224			wSpace = wMargin + wPadding;
1225			hSpace = hMargin + hPadding;
1226
1227			origWidth  = isPercentage(width)  ? (viewport.w - wSpace) * getScalar(width)  / 100 : width;
1228			origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
1229
1230			if (current.type === 'iframe') {
1231				iframe = current.content;
1232
1233				if (current.autoHeight && iframe.data('ready') === 1) {
1234					try {
1235						if (iframe[0].contentWindow.document.location) {
1236							inner.width( origWidth ).height(9999);
1237
1238							body = iframe.contents().find('body');
1239
1240							if (scrollOut) {
1241								body.css('overflow-x', 'hidden');
1242							}
1243
1244							origHeight = body.outerHeight(true);
1245						}
1246
1247					} catch (e) {}
1248				}
1249
1250			} else if (current.autoWidth || current.autoHeight) {
1251				inner.addClass( 'fancybox-tmp' );
1252
1253				// Set width or height in case we need to calculate only one dimension
1254				if (!current.autoWidth) {
1255					inner.width( origWidth );
1256				}
1257
1258				if (!current.autoHeight) {
1259					inner.height( origHeight );
1260				}
1261
1262				if (current.autoWidth) {
1263					origWidth = inner.width();
1264				}
1265
1266				if (current.autoHeight) {
1267					origHeight = inner.height();
1268				}
1269
1270				inner.removeClass( 'fancybox-tmp' );
1271			}
1272
1273			width  = getScalar( origWidth );
1274			height = getScalar( origHeight );
1275
1276			ratio  = origWidth / origHeight;
1277
1278			// Calculations for the content
1279			minWidth  = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
1280			maxWidth  = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
1281
1282			minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
1283			maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
1284
1285			// These will be used to determine if wrap can fit in the viewport
1286			origMaxWidth  = maxWidth;
1287			origMaxHeight = maxHeight;
1288
1289			if (current.fitToView) {
1290				maxWidth  = Math.min(viewport.w - wSpace, maxWidth);
1291				maxHeight = Math.min(viewport.h - hSpace, maxHeight);
1292			}
1293
1294			maxWidth_  = viewport.w - wMargin;
1295			maxHeight_ = viewport.h - hMargin;
1296
1297			if (current.aspectRatio) {
1298				if (width > maxWidth) {
1299					width  = maxWidth;
1300					height = getScalar(width / ratio);
1301				}
1302
1303				if (height > maxHeight) {
1304					height = maxHeight;
1305					width  = getScalar(height * ratio);
1306				}
1307
1308				if (width < minWidth) {
1309					width  = minWidth;
1310					height = getScalar(width / ratio);
1311				}
1312
1313				if (height < minHeight) {
1314					height = minHeight;
1315					width  = getScalar(height * ratio);
1316				}
1317
1318			} else {
1319				width = Math.max(minWidth, Math.min(width, maxWidth));
1320
1321				if (current.autoHeight && current.type !== 'iframe') {
1322					inner.width( width );
1323
1324					height = inner.height();
1325				}
1326
1327				height = Math.max(minHeight, Math.min(height, maxHeight));
1328			}
1329
1330			// Try to fit inside viewport (including the title)
1331			if (current.fitToView) {
1332				inner.width( width ).height( height );
1333
1334				wrap.width( width + wPadding );
1335
1336				// Real wrap dimensions
1337				width_  = wrap.width();
1338				height_ = wrap.height();
1339
1340				if (current.aspectRatio) {
1341					while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
1342						if (steps++ > 19) {
1343							break;
1344						}
1345
1346						height = Math.max(minHeight, Math.min(maxHeight, height - 10));
1347						width  = getScalar(height * ratio);
1348
1349						if (width < minWidth) {
1350							width  = minWidth;
1351							height = getScalar(width / ratio);
1352						}
1353
1354						if (width > maxWidth) {
1355							width  = maxWidth;
1356							height = getScalar(width / ratio);
1357						}
1358
1359						inner.width( width ).height( height );
1360
1361						wrap.width( width + wPadding );
1362
1363						width_  = wrap.width();
1364						height_ = wrap.height();
1365					}
1366
1367				} else {
1368					width  = Math.max(minWidth,  Math.min(width,  width  - (width_  - maxWidth_)));
1369					height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
1370				}
1371			}
1372
1373			if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
1374				width += scrollOut;
1375			}
1376
1377			inner.width( width ).height( height );
1378
1379			wrap.width( width + wPadding );
1380
1381			width_  = wrap.width();
1382			height_ = wrap.height();
1383
1384			canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
1385			canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
1386
1387			$.extend(current, {
1388				dim : {
1389					width	: getValue( width_ ),
1390					height	: getValue( height_ )
1391				},
1392				origWidth  : origWidth,
1393				origHeight : origHeight,
1394				canShrink  : canShrink,
1395				canExpand  : canExpand,
1396				wPadding   : wPadding,
1397				hPadding   : hPadding,
1398				wrapSpace  : height_ - skin.outerHeight(true),
1399				skinSpace  : skin.height() - height
1400			});
1401
1402			if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
1403				inner.height('auto');
1404			}
1405		},
1406
1407		_getPosition: function (onlyAbsolute) {
1408			var current  = F.current,
1409				viewport = F.getViewport(),
1410				margin   = current.margin,
1411				width    = F.wrap.width()  + margin[1] + margin[3],
1412				height   = F.wrap.height() + margin[0] + margin[2],
1413				rez      = {
1414					position: 'absolute',
1415					top  : margin[0],
1416					left : margin[3]
1417				};
1418
1419			if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
1420				rez.position = 'fixed';
1421
1422			} else if (!current.locked) {
1423				rez.top  += viewport.y;
1424				rez.left += viewport.x;
1425			}
1426
1427			rez.top  = getValue(Math.max(rez.top,  rez.top  + ((viewport.h - height) * current.topRatio)));
1428			rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width)  * current.leftRatio)));
1429
1430			return rez;
1431		},
1432
1433		_afterZoomIn: function () {
1434			var current = F.current;
1435
1436			if (!current) {
1437				return;
1438			}
1439
1440			F.isOpen = F.isOpened = true;
1441
1442			F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
1443
1444			F.update();
1445
1446			// Assign a click event
1447			if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
1448				F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
1449					if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
1450						e.preventDefault();
1451
1452						F[ current.closeClick ? 'close' : 'next' ]();
1453					}
1454				});
1455			}
1456
1457			// Create a close button
1458			if (current.closeBtn) {
1459				$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
1460					e.preventDefault();
1461
1462					F.close();
1463				});
1464			}
1465
1466			// Create navigation arrows
1467			if (current.arrows && F.group.length > 1) {
1468				if (current.loop || current.index > 0) {
1469					$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
1470				}
1471
1472				if (current.loop || current.index < F.group.length - 1) {
1473					$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
1474				}
1475			}
1476
1477			F.trigger('afterShow');
1478
1479			// Stop the slideshow if this is the last item
1480			if (!current.loop && current.index === current.group.length - 1) {
1481				F.play( false );
1482
1483			} else if (F.opts.autoPlay && !F.player.isActive) {
1484				F.opts.autoPlay = false;
1485
1486				F.play();
1487			}
1488		},
1489
1490		_afterZoomOut: function ( obj ) {
1491			obj = obj || F.current;
1492
1493			$('.fancybox-wrap').trigger('onReset').remove();
1494
1495			$.extend(F, {
1496				group  : {},
1497				opts   : {},
1498				router : false,
1499				current   : null,
1500				isActive  : false,
1501				isOpened  : false,
1502				isOpen    : false,
1503				isClosing : false,
1504				wrap   : null,
1505				skin   : null,
1506				outer  : null,
1507				inner  : null
1508			});
1509
1510			F.trigger('afterClose', obj);
1511		}
1512	});
1513
1514	/*
1515	 *	Default transitions
1516	 */
1517
1518	F.transitions = {
1519		getOrigPosition: function () {
1520			var current  = F.current,
1521				element  = current.element,
1522				orig     = current.orig,
1523				pos      = {},
1524				width    = 50,
1525				height   = 50,
1526				hPadding = current.hPadding,
1527				wPadding = current.wPadding,
1528				viewport = F.getViewport();
1529
1530			if (!orig && current.isDom && element.is(':visible')) {
1531				orig = element.find('img:first');
1532
1533				if (!orig.length) {
1534					orig = element;
1535				}
1536			}
1537
1538			if (isQuery(orig)) {
1539				pos = orig.offset();
1540
1541				if (orig.is('img')) {
1542					width  = orig.outerWidth();
1543					height = orig.outerHeight();
1544				}
1545
1546			} else {
1547				pos.top  = viewport.y + (viewport.h - height) * current.topRatio;
1548				pos.left = viewport.x + (viewport.w - width)  * current.leftRatio;
1549			}
1550
1551			if (F.wrap.css('position') === 'fixed' || current.locked) {
1552				pos.top  -= viewport.y;
1553				pos.left -= viewport.x;
1554			}
1555
1556			pos = {
1557				top     : getValue(pos.top  - hPadding * current.topRatio),
1558				left    : getValue(pos.left - wPadding * current.leftRatio),
1559				width   : getValue(width  + wPadding),
1560				height  : getValue(height + hPadding)
1561			};
1562
1563			return pos;
1564		},
1565
1566		step: function (now, fx) {
1567			var ratio,
1568				padding,
1569				value,
1570				prop       = fx.prop,
1571				current    = F.current,
1572				wrapSpace  = current.wrapSpace,
1573				skinSpace  = current.skinSpace;
1574
1575			if (prop === 'width' || prop === 'height') {
1576				ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
1577
1578				if (F.isClosing) {
1579					ratio = 1 - ratio;
1580				}
1581
1582				padding = prop === 'width' ? current.wPadding : current.hPadding;
1583				value   = now - padding;
1584
1585				F.skin[ prop ](  getScalar( prop === 'width' ?  value : value - (wrapSpace * ratio) ) );
1586				F.inner[ prop ]( getScalar( prop === 'width' ?  value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
1587			}
1588		},
1589
1590		zoomIn: function () {
1591			var current  = F.current,
1592				startPos = current.pos,
1593				effect   = current.openEffect,
1594				elastic  = effect === 'elastic',
1595				endPos   = $.extend({opacity : 1}, startPos);
1596
1597			// Remove "position" property that breaks older IE
1598			delete endPos.position;
1599
1600			if (elastic) {
1601				startPos = this.getOrigPosition();
1602
1603				if (current.openOpacity) {
1604					startPos.opacity = 0.1;
1605				}
1606
1607			} else if (effect === 'fade') {
1608				startPos.opacity = 0.1;
1609			}
1610
1611			F.wrap.css(startPos).animate(endPos, {
1612				duration : effect === 'none' ? 0 : current.openSpeed,
1613				easing   : current.openEasing,
1614				step     : elastic ? this.step : null,
1615				complete : F._afterZoomIn
1616			});
1617		},
1618
1619		zoomOut: function () {
1620			var current  = F.current,
1621				effect   = current.closeEffect,
1622				elastic  = effect === 'elastic',
1623				endPos   = {opacity : 0.1};
1624
1625			if (elastic) {
1626				endPos = this.getOrigPosition();
1627
1628				if (current.closeOpacity) {
1629					endPos.opacity = 0.1;
1630				}
1631			}
1632
1633			F.wrap.animate(endPos, {
1634				duration : effect === 'none' ? 0 : current.closeSpeed,
1635				easing   : current.closeEasing,
1636				step     : elastic ? this.step : null,
1637				complete : F._afterZoomOut
1638			});
1639		},
1640
1641		changeIn: function () {
1642			var current   = F.current,
1643				effect    = current.nextEffect,
1644				startPos  = current.pos,
1645				endPos    = { opacity : 1 },
1646				direction = F.direction,
1647				distance  = 200,
1648				field;
1649
1650			startPos.opacity = 0.1;
1651
1652			if (effect === 'elastic') {
1653				field = direction === 'down' || direction === 'up' ? 'top' : 'left';
1654
1655				if (direction === 'down' || direction === 'right') {
1656					startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
1657					endPos[ field ]   = '+=' + distance + 'px';
1658
1659				} else {
1660					startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
1661					endPos[ field ]   = '-=' + distance + 'px';
1662				}
1663			}
1664
1665			// Workaround for http://bugs.jquery.com/ticket/12273
1666			if (effect === 'none') {
1667				F._afterZoomIn();
1668
1669			} else {
1670				F.wrap.css(startPos).animate(endPos, {
1671					duration : current.nextSpeed,
1672					easing   : current.nextEasing,
1673					complete : F._afterZoomIn
1674				});
1675			}
1676		},
1677
1678		changeOut: function () {
1679			var previous  = F.previous,
1680				effect    = previous.prevEffect,
1681				endPos    = { opacity : 0.1 },
1682				direction = F.direction,
1683				distance  = 200;
1684
1685			if (effect === 'elastic') {
1686				endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
1687			}
1688
1689			previous.wrap.animate(endPos, {
1690				duration : effect === 'none' ? 0 : previous.prevSpeed,
1691				easing   : previous.prevEasing,
1692				complete : function () {
1693					$(this).trigger('onReset').remove();
1694				}
1695			});
1696		}
1697	};
1698
1699	/*
1700	 *	Overlay helper
1701	 */
1702
1703	F.helpers.overlay = {
1704		defaults : {
1705			closeClick : true,      // if true, fancyBox will be closed when user clicks on the overlay
1706			speedOut   : 200,       // duration of fadeOut animation
1707			showEarly  : true,      // indicates if should be opened immediately or wait until the content is ready
1708			css        : {},        // custom CSS properties
1709			locked     : !isTouch,  // if true, the content will be locked into overlay
1710			fixed      : true       // if false, the overlay CSS position property will not be set to "fixed"
1711		},
1712
1713		overlay : null,      // current handle
1714		fixed   : false,     // indicates if the overlay has position "fixed"
1715		el      : $('html'), // element that contains "the lock"
1716
1717		// Public methods
1718		create : function(opts) {
1719			opts = $.extend({}, this.defaults, opts);
1720
1721			if (this.overlay) {
1722				this.close();
1723			}
1724
1725			this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( F.coming ? F.coming.parent : opts.parent );
1726			this.fixed   = false;
1727
1728			if (opts.fixed && F.defaults.fixed) {
1729				this.overlay.addClass('fancybox-overlay-fixed');
1730
1731				this.fixed = true;
1732			}
1733		},
1734
1735		open : function(opts) {
1736			var that = this;
1737
1738			opts = $.extend({}, this.defaults, opts);
1739
1740			if (this.overlay) {
1741				this.overlay.unbind('.overlay').width('auto').height('auto');
1742
1743			} else {
1744				this.create(opts);
1745			}
1746
1747			if (!this.fixed) {
1748				W.bind('resize.overlay', $.proxy( this.update, this) );
1749
1750				this.update();
1751			}
1752
1753			if (opts.closeClick) {
1754				this.overlay.bind('click.overlay', function(e) {
1755					if ($(e.target).hasClass('fancybox-overlay')) {
1756						if (F.isActive) {
1757							F.close();
1758						} else {
1759							that.close();
1760						}
1761
1762						return false;
1763					}
1764				});
1765			}
1766
1767			this.overlay.css( opts.css ).show();
1768		},
1769
1770		close : function() {
1771			var scrollV, scrollH;
1772
1773			W.unbind('resize.overlay');
1774
1775			if (this.el.hasClass('fancybox-lock')) {
1776				$('.fancybox-margin').removeClass('fancybox-margin');
1777
1778				scrollV = W.scrollTop();
1779				scrollH = W.scrollLeft();
1780
1781				this.el.removeClass('fancybox-lock');
1782
1783				W.scrollTop( scrollV ).scrollLeft( scrollH );
1784			}
1785
1786			$('.fancybox-overlay').remove().hide();
1787
1788			$.extend(this, {
1789				overlay : null,
1790				fixed   : false
1791			});
1792		},
1793
1794		// Private, callbacks
1795
1796		update : function () {
1797			var width = '100%', offsetWidth;
1798
1799			// Reset width/height so it will not mess
1800			this.overlay.width(width).height('100%');
1801
1802			// jQuery does not return reliable result for IE
1803			if (IE) {
1804				offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
1805
1806				if (D.width() > offsetWidth) {
1807					width = D.width();
1808				}
1809
1810			} else if (D.width() > W.width()) {
1811				width = D.width();
1812			}
1813
1814			this.overlay.width(width).height(D.height());
1815		},
1816
1817		// This is where we can manipulate DOM, because later it would cause iframes to reload
1818		onReady : function (opts, obj) {
1819			var overlay = this.overlay;
1820
1821			$('.fancybox-overlay').stop(true, true);
1822
1823			if (!overlay) {
1824				this.create(opts);
1825			}
1826
1827			if (opts.locked && this.fixed && obj.fixed) {
1828				if (!overlay) {
1829					this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
1830				}
1831
1832				obj.locked = this.overlay.append( obj.wrap );
1833				obj.fixed  = false;
1834			}
1835
1836			if (opts.showEarly === true) {
1837				this.beforeShow.apply(this, arguments);
1838			}
1839		},
1840
1841		beforeShow : function(opts, obj) {
1842			var scrollV, scrollH;
1843
1844			if (obj.locked) {
1845				if (this.margin !== false) {
1846					$('*').filter(function(){
1847						return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
1848					}).addClass('fancybox-margin');
1849
1850					this.el.addClass('fancybox-margin');
1851				}
1852
1853				scrollV = W.scrollTop();
1854				scrollH = W.scrollLeft();
1855
1856				this.el.addClass('fancybox-lock');
1857
1858				W.scrollTop( scrollV ).scrollLeft( scrollH );
1859			}
1860
1861			this.open(opts);
1862		},
1863
1864		onUpdate : function() {
1865			if (!this.fixed) {
1866				this.update();
1867			}
1868		},
1869
1870		afterClose: function (opts) {
1871			// Remove overlay if exists and fancyBox is not opening
1872			// (e.g., it is not being open using afterClose callback)
1873			//if (this.overlay && !F.isActive) {
1874			if (this.overlay && !F.coming) {
1875				this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
1876			}
1877		}
1878	};
1879
1880	/*
1881	 *	Title helper
1882	 */
1883
1884	F.helpers.title = {
1885		defaults : {
1886			type     : 'float', // 'float', 'inside', 'outside' or 'over',
1887			position : 'bottom' // 'top' or 'bottom'
1888		},
1889
1890		beforeShow: function (opts) {
1891			var current = F.current,
1892				text    = current.title,
1893				type    = opts.type,
1894				title,
1895				target;
1896
1897			if ($.isFunction(text)) {
1898				text = text.call(current.element, current);
1899			}
1900
1901			if (!isString(text) || $.trim(text) === '') {
1902				return;
1903			}
1904
1905			title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">
vendor: 4,765 bytes, lines 1905-2065
1905' + text + '</div>');
1906
1907			switch (type) {
1908				case 'inside':
1909					target = F.skin;
1910				break;
1911
1912				case 'outside':
1913					target = F.wrap;
1914				break;
1915
1916				case 'over':
1917					target = F.inner;
1918				break;
1919
1920				default: // 'float'
1921					target = F.skin;
1922
1923					title.appendTo('body');
1924
1925					if (IE) {
1926						title.width( title.width() );
1927					}
1928
1929					title.wrapInner('<span class="child"></span>');
1930
1931					//Increase bottom margin so this title will also fit into viewport
1932					F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
1933				break;
1934			}
1935
1936			title[ (opts.position === 'top' ? 'prependTo'  : 'appendTo') ](target);
1937		}
1938	};
1939
1940	// jQuery plugin initialization
1941	$.fn.fancybox = function (options) {
1942		var index,
1943			that     = $(this),
1944			selector = this.selector || '',
1945			run      = function(e) {
1946				var what = $(this).blur(), idx = index, relType, relVal;
1947
1948				if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
1949					relType = options.groupAttr || 'data-fancybox-group';
1950					relVal  = what.attr(relType);
1951
1952					if (!relVal) {
1953						relType = 'rel';
1954						relVal  = what.get(0)[ relType ];
1955					}
1956
1957					if (relVal && relVal !== '' && relVal !== 'nofollow') {
1958						what = selector.length ? $(selector) : that;
1959						what = what.filter('[' + relType + '="' + relVal + '"]');
1960						idx  = what.index(this);
1961					}
1962
1963					options.index = idx;
1964
1965					// Stop an event from bubbling if everything is fine
1966					if (F.open(what, options) !== false) {
1967						e.preventDefault();
1968					}
1969				}
1970			};
1971
1972		options = options || {};
1973		index   = options.index || 0;
1974
1975		if (!selector || options.live === false) {
1976			that.unbind('click.fb-start').bind('click.fb-start', run);
1977
1978		} else {
1979			D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
1980		}
1981
1982		this.filter('[data-fancybox-start=1]').trigger('click');
1983
1984		return this;
1985	};
1986
1987	// Tests that need a body at doc ready
1988	D.ready(function() {
1989		var w1, w2;
1990
1991		if ( $.scrollbarWidth === undefined ) {
1992			// http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
1993			$.scrollbarWidth = function() {
1994				var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
1995					child  = parent.children(),
1996					width  = child.innerWidth() - child.height( 99 ).innerWidth();
1997
1998				parent.remove();
1999
2000				return width;
2001			};
2002		}
2003
2004		if ( $.support.fixedPosition === undefined ) {
2005			$.support.fixedPosition = (function() {
2006				var elem  = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
2007					fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
2008
2009				elem.remove();
2010
2011				return fixed;
2012			}());
2013		}
2014
2015		$.extend(F.defaults, {
2016			scrollbarWidth : $.scrollbarWidth(),
2017			fixed  : $.support.fixedPosition,
2018			parent : $('body')
2019		});
2020
2021		//Get real width of page scroll-bar
2022		w1 = $(window).width();
2023
2024		H.addClass('fancybox-lock-test');
2025
2026		w2 = $(window).width();
2027
2028		H.removeClass('fancybox-lock-test');
2029
2030		$("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
2031	});
2032
2033}(window, document, jQuery));
2034/* End */
2035;
2036; /* Start:"a:4:{s:4:"full";s:67:"/local/templates/aspro-medc2/vendor/jquery.easing.js?16569236378097";s:6:"source";s:52:"/local/templates/aspro-medc2/vendor/jquery.easing.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2037/*
2038 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
2039 *
2040 * Uses the built in easing capabilities added In jQuery 1.1
2041 * to offer multiple easing options
2042 *
2043 * TERMS OF USE - jQuery Easing
2044 * 
2045 * Open source under the BSD License. 
2046 * 
2047 * Copyright © 2008 George McGinley Smith
2048 * All rights reserved.
2049 * 
2050 * Redistribution and use in source and binary forms, with or without modification, 
2051 * are permitted provided that the following conditions are met:
2052 * 
2053 * Redistributions of source code must retain the above copyright notice, this list of 
2054 * conditions and the following disclaimer.
2055 * Redistributions in binary form must reproduce the above copyright notice, this list 
2056 * of conditions and the following disclaimer in the documentation and/or other materials 
2057 * provided with the distribution.
2058 * 
2059 * Neither the name of the author nor the names of contributors may be used to endorse 
2060 * or promote products derived from this software without specific prior written permission.
2061 * 
2062 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
2063 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2064 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
2065 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
vendor: 5,091 bytes, lines 2066-2211
2066 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
2067 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
2068 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2069 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
2070 * OF THE POSSIBILITY OF SUCH DAMAGE. 
2071 *
2072*/
2073
2074// t: current time, b: begInnIng value, c: change In value, d: duration
2075jQuery.easing['jswing'] = jQuery.easing['swing'];
2076
2077jQuery.extend( jQuery.easing,
2078{
2079	def: 'easeOutQuad',
2080	swing: function (x, t, b, c, d) {
2081		//alert(jQuery.easing.default);
2082		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
2083	},
2084	easeInQuad: function (x, t, b, c, d) {
2085		return c*(t/=d)*t + b;
2086	},
2087	easeOutQuad: function (x, t, b, c, d) {
2088		return -c *(t/=d)*(t-2) + b;
2089	},
2090	easeInOutQuad: function (x, t, b, c, d) {
2091		if ((t/=d/2) < 1) return c/2*t*t + b;
2092		return -c/2 * ((--t)*(t-2) - 1) + b;
2093	},
2094	easeInCubic: function (x, t, b, c, d) {
2095		return c*(t/=d)*t*t + b;
2096	},
2097	easeOutCubic: function (x, t, b, c, d) {
2098		return c*((t=t/d-1)*t*t + 1) + b;
2099	},
2100	easeInOutCubic: function (x, t, b, c, d) {
2101		if ((t/=d/2) < 1) return c/2*t*t*t + b;
2102		return c/2*((t-=2)*t*t + 2) + b;
2103	},
2104	easeInQuart: function (x, t, b, c, d) {
2105		return c*(t/=d)*t*t*t + b;
2106	},
2107	easeOutQuart: function (x, t, b, c, d) {
2108		return -c * ((t=t/d-1)*t*t*t - 1) + b;
2109	},
2110	easeInOutQuart: function (x, t, b, c, d) {
2111		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
2112		return -c/2 * ((t-=2)*t*t*t - 2) + b;
2113	},
2114	easeInQuint: function (x, t, b, c, d) {
2115		return c*(t/=d)*t*t*t*t + b;
2116	},
2117	easeOutQuint: function (x, t, b, c, d) {
2118		return c*((t=t/d-1)*t*t*t*t + 1) + b;
2119	},
2120	easeInOutQuint: function (x, t, b, c, d) {
2121		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
2122		return c/2*((t-=2)*t*t*t*t + 2) + b;
2123	},
2124	easeInSine: function (x, t, b, c, d) {
2125		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
2126	},
2127	easeOutSine: function (x, t, b, c, d) {
2128		return c * Math.sin(t/d * (Math.PI/2)) + b;
2129	},
2130	easeInOutSine: function (x, t, b, c, d) {
2131		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
2132	},
2133	easeInExpo: function (x, t, b, c, d) {
2134		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
2135	},
2136	easeOutExpo: function (x, t, b, c, d) {
2137		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
2138	},
2139	easeInOutExpo: function (x, t, b, c, d) {
2140		if (t==0) return b;
2141		if (t==d) return b+c;
2142		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
2143		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
2144	},
2145	easeInCirc: function (x, t, b, c, d) {
2146		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
2147	},
2148	easeOutCirc: function (x, t, b, c, d) {
2149		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
2150	},
2151	easeInOutCirc: function (x, t, b, c, d) {
2152		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
2153		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
2154	},
2155	easeInElastic: function (x, t, b, c, d) {
2156		var s=1.70158;var p=0;var a=c;
2157		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
2158		if (a < Math.abs(c)) { a=c; var s=p/4; }
2159		else var s = p/(2*Math.PI) * Math.asin (c/a);
2160		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
2161	},
2162	easeOutElastic: function (x, t, b, c, d) {
2163		var s=1.70158;var p=0;var a=c;
2164		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
2165		if (a < Math.abs(c)) { a=c; var s=p/4; }
2166		else var s = p/(2*Math.PI) * Math.asin (c/a);
2167		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
2168	},
2169	easeInOutElastic: function (x, t, b, c, d) {
2170		var s=1.70158;var p=0;var a=c;
2171		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
2172		if (a < Math.abs(c)) { a=c; var s=p/4; }
2173		else var s = p/(2*Math.PI) * Math.asin (c/a);
2174		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
2175		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
2176	},
2177	easeInBack: function (x, t, b, c, d, s) {
2178		if (s == undefined) s = 1.70158;
2179		return c*(t/=d)*t*((s+1)*t - s) + b;
2180	},
2181	easeOutBack: function (x, t, b, c, d, s) {
2182		if (s == undefined) s = 1.70158;
2183		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
2184	},
2185	easeInOutBack: function (x, t, b, c, d, s) {
2186		if (s == undefined) s = 1.70158; 
2187		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
2188		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
2189	},
2190	easeInBounce: function (x, t, b, c, d) {
2191		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
2192	},
2193	easeOutBounce: function (x, t, b, c, d) {
2194		if ((t/=d) < (1/2.75)) {
2195			return c*(7.5625*t*t) + b;
2196		} else if (t < (2/2.75)) {
2197			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
2198		} else if (t < (2.5/2.75)) {
2199			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
2200		} else {
2201			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
2202		}
2203	},
2204	easeInOutBounce: function (x, t, b, c, d) {
2205		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
2206		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
2207	}
2208});
2209
2210/*
2211 *
2212 * TERMS OF USE - EASING EQUATIONS
2213 * 
2214 * Open source under the BSD License. 
2215 * 
2216 * Copyright © 2001 Robert Penner
2217 * All rights reserved.
2218 * 
2219 * Redistribution and use in source and binary forms, with or without modification, 
2220 * are permitted provided that the following conditions are met:
2221 * 
2222 * Redistributions of source code must retain the above copyright notice, this list of 
2223 * conditions and the following disclaimer.
2224 * Redistributions in binary form must reproduce the above copyright notice, this list 
2225 * of conditions and the following disclaimer in the documentation and/or other materials 
2226 * provided with the distribution.
2227 * 
2228 * Neither the name of the author nor the names of contributors may be used to endorse 
2229 * or promote products derived from this software without specific prior written permission.
2230 * 
2231 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
2232 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2233 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
2234 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2235 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
2236 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
2237 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2238 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
2239 * OF THE POSSIBILITY OF SUCH DAMAGE. 
2240 *
2241 */
2242/* End */
2243;
2244; /* Start:"a:4:{s:4:"full";s:67:"/local/templates/aspro-medc2/vendor/jquery.appear.js?16569236373188";s:6:"source";s:52:"/local/templates/aspro-medc2/vendor/jquery.appear.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2245/*
2246 * jQuery.appear
2247 * https://github.com/bas2k/jquery.appear/
2248 * http://code.google.com/p/jquery-appear/
2249 *
2250 * Copyright (c) 2009 Michael Hixson
2251 * Copyright (c) 2012 Alexander Brovikov
2252 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
2253 */
2254(function($) {
2255	$.fn.appear = function(fn, options) {
2256
2257		var settings = $.extend({
2258
2259			//arbitrary data to pass to fn
2260			data: undefined,
2261
2262			//call fn only on the first appear?
2263			one: true,
2264
2265			// X & Y accuracy
2266			accX: 0,
2267			accY: 0
2268
2269		}, options);
2270
2271		return this.each(function() {
2272
2273			var t = $(this);
2274
2275			//whether the element is currently visible
2276			t.appeared = false;
2277
2278			if (!fn) {
2279
2280				//trigger the custom event
2281				t.trigger('appear', settings.data);
2282				return;
2283			}
2284
2285			var w = $(window);
2286
2287			//fires the appear event when appropriate
2288			var check = function() {
2289
2290				//is the element hidden?
2291				if (!t.is(':visible')) {
2292
2293					//it became hidden
2294					t.appeared = false;
2295					return;
2296				}
2297
2298				//is the element inside the visible window?
2299				var a = w.scrollLeft();
2300				var b = w.scrollTop();
2301				var o = t.offset();
2302				var x = o.left;
2303				var y = o.top;
2304
2305				var ax = settings.accX;
2306				var ay = settings.accY;
2307				var th = t.height();
2308				var wh = w.height();
2309				var tw = t.width();
2310				var ww = w.width();
2311
2312				if (y + th + ay >= b &&
2313					y <= b + wh + ay &&
2314					x + tw + ax >= a &&
2315					x <= a + ww + ax) {
2316
2317					//trigger the custom event
2318					if (!t.appeared) t.trigger('appear', settings.data);
2319
2320				} else {
2321
2322					//it scrolled out of view
2323					t.appeared = false;
2324				}
2325			};
2326
2327			//create a modified fn with some additional logic
2328			var modifiedFn = function() {
2329
2330				//mark the element as visible
2331				t.appeared = true;
2332
2333				//is this supposed to happen only once?
2334				if (settings.one) {
2335
2336					//remove the check
2337					w.unbind('scroll', check);
2338					var i = $.inArray(check, $.fn.appear.checks);
2339					if (i >= 0) $.fn.appear.checks.splice(i, 1);
2340				}
2341
2342				//trigger the original fn
2343				fn.apply(this, arguments);
2344			};
2345
2346			//bind the modified fn to the element
2347			if (settings.one) t.one('appear', settings.data, modifiedFn);
2348			else t.bind('appear', settings.data, modifiedFn);
2349
2350			//check whenever the window scrolls
2351			w.scroll(check);
2352
2353			//check whenever the dom changes
2354			$.fn.appear.checks.push(check);
2355
2356			//check now
2357			(check)();
2358		});
2359	};
2360
2361	//keep a queue of appearance checks
2362	$.extend($.fn.appear, {
2363
2364		checks: [],
2365		timeout: null,
2366
2367		//process the queue
2368		checkAll: function() {
2369			var length = $.fn.appear.checks.length;
2370			if (length >
2370 0) while (length--) ($.fn.appear.checks[length])();
2371		},
2372
2373		//check the queue asynchronously
2374		run: function() {
2375			if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
2376			$.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20);
2377		}
2378	});
2379
2380	//run checks when these methods are called
2381	$.each(['append', 'prepend', 'after', 'before', 'attr',
2382		'removeAttr', 'addClass', 'removeClass', 'toggleClass',
2383		'remove', 'css', 'show', 'hide'], function(i, n) {
2384		var old = $.fn[n];
2385		if (old) {
2386			$.fn[n] = function() {
2387				var r = old.apply(this, arguments);
2388				$.fn.appear.run();
2389				return r;
2390			}
2391		}
2392	});
2393
2394})(jQuery);
2395/* End */
2396;
2397; /* Start:"a:4:{s:4:"full";s:67:"/local/templates/aspro-medc2/vendor/jquery.cookie.js?16569236372247";s:6:"source";s:52:"/local/templates/aspro-medc2/vendor/jquery.cookie.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2398/*!
2399 * jQuery Cookie Plugin v1.3.1
2400 * https://github.com/carhartl/jquery-cookie
2401 *
2402 * Copyright 2013 Klaus Hartl
2403 * Released under the MIT license
2404 */
2405(function (factory) {
2406	if (typeof define === 'function' && define.amd && define.amd.jQuery) {
2407		// AMD. Register as anonymous module.
2408		define(['jquery'], factory);
2409	} else {
2410		// Browser globals.
2411		factory(jQuery);
2412	}
2413}(function ($) {
2414
2415	var pluses = /\+/g;
2416
2417	function raw(s) {
2418		return s;
2419	}
2420
2421	function decoded(s) {
2422		return decodeURIComponent(s.replace(pluses, ' '));
2423	}
2424
2425	function converted(s) {
2426		if (s.indexOf('"') === 0) {
2427			// This is a quoted cookie as according to RFC2068, unescape
2428			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
2429		}
2430		try {
2431			return config.json ? JSON.parse(s) : s;
2432		} catch(er) {}
2433	}
2434
2435	var config = $.cookie = function (key, value, options) {
2436
2437		// write
2438		if (value !== undefined) {
2439			options = $.extend({}, config.defaults, options);
2440
2441			if (typeof options.expires === 'number') {
2442				var days = options.expires, t = options.expires = new Date();
2443				t.setDate(t.getDate() + days);
2444			}
2445
2446			value = config.json ? JSON.stringify(value) : String(value);
2447
2448			return (document.cookie = [
2449				encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
2450				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
2451				options.path    ? '; path=' + options.path : '',
2452				options.domain  ? '; domain=' + options.domain : '',
2453				options.secure  ? '; secure' : ''
2454			].join(''));
2455		}
2456
2457		// read
2458		var decode = config.raw ? raw : decoded;
2459		var cookies = document.cookie.split('; ');
2460		var result = key ? undefined : {};
2461		for (var i = 0, l = cookies.length; i < l; i++) {
2462			var parts = cookies[i].split('=');
2463			var name = decode(parts.shift());
2464			var cookie = decode(parts.join('='));
2465
2466			if (key && key === name) {
2467				result = converted(cookie);
2468				break;
2469			}
2470
2471			if (!key) {
2472				result[name] = converted(cookie);
2473			}
2474		}
2475
2476		return result;
2477	};
2478
2479	config.defaults = {};
2480
2481	$.removeCookie = function (key, options) {
2482		if ($.cookie(key) !== undefined) {
2483			$.cookie(key, '', $.extend(options, { expires: -1 }));
2484			return true;
2485		}
2486		return false;
2487	};
2488
2489}));
2490
2491/* End */
2492;
2493; /* Start:"a:4:{s:4:"full";s:64:"/local/templates/aspro-medc2/vendor/bootstrap.js?165692363727908";s:6:"source";s:48:"/local/templates/aspro-medc2/vendor/bootstrap.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2494/*!
2495 * Bootstrap v3.0.0
2496 *
2497 * Copyright 2013 Twitter, Inc
2498 * Licensed under the Apache License v2.0
2499 * http://www.apache.org/licenses/LICENSE-2.0
2500 *
2501 * Designed and built with all the love in the world @twitter by @mdo and @fat.
2502 */
2503
2504+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function f(){e.trigger("closed.bs.alert").remove()}var c=a(this),d=c.attr("data-target");d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));var e=a(d);b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger(b=a.Event("close.bs.alert"));if(b.isDefaultPrevented())return;e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.one(a.support.transition.end,f).emulateTransitionEnd(150):f()};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),typeof b=="string"&&e[b].call(
2504d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");b.prop("type")==="radio"&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f=typeof c=="object"&&c;e||d.data("bs.button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();if(b>this.$items.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){if(this.sliding)return;return this.slide("next")},b.prototype.prev=function(){if(this.sliding)return;return this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(e.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")}));if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(j);if(j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{this.$element.trigger(j);if(j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),typeof c=="object"&&c),g=typeof c=="string"?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),typeof c=="number"?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this}
2504,a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),c.data()),g=c.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=c.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){function e(){a(b).remove(),a(c).each(function(b){var c=f(a(this));if(!c.hasClass("open"))return;c.trigger(b=a.Event("hide.bs.dropdown"));if(b.isDefaultPrevented())return;c.removeClass("open").trigger("hidden.bs.dropdown")})}function f(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}"use strict";var b=".dropdown-backdrop",c="[data-toggle=dropdown]",d=function(b){var c=a(b).on("click.bs.dropdown",this.toggle)};d.prototype.toggle=function(b){var c=a(this);if(c.is(".disabled, :disabled"))return;var d=f(c),g=d.hasClass("open");e();if(!g){"ontouchstart"in document.documentElement&&!d.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",e),d.trigger(b=a.Event("show.bs.dropdown"));if(b.isDefaultPrevented())return;d.toggleClass("open").trigger("shown.bs.dropdown"),c.focus()}return!1},d.prototype.keydown=function(b){if(!/(38|40|27)/.test(b.keyCode))return;var d=a(this);b.preventDefault(),b.stopPropagation();if(d.is(".disabled, :disabled"))return;var e=f(d),g=e.hasClass("open");if(!g||g&&b.keyCode==27)return b.which==27&&e.find(c).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",e);if(!h.length)return;var i=h.index(h.filter(":focus"));b.keyCode==38&&i>0&&i--,b.keyCode==40&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),e=c.data("dropdown");e||c.data("dropdown",e=new d(this)),typeof b=="string"&&e[b].call(c)})},a.fn.dropdown.Constructor=d,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",c,d.prototype.toggle).on("keydown.bs.dropdown.data-api",c+", [role=menu]",d.prototype.keydown)}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d);if(this.isShown||d.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show(),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)})},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b);if(!this.isShown||b.isDefaultPrevented())return;this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]!==a.target&&!this.$element.has(a.target).length&&this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){a.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){if
2504(a.target!==a.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!b)return;e?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),typeof c=="object"&&c);f||e.data("bs.modal",f=new b(this,g)),typeof c=="string"?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);var e=this.options.trigger.split(" ");for(var f=e.length;f--;){var g=e[f];if(g=="click")this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if(g!="manual"){var h=g=="hover"?"mouseenter":"focus",i=g=="hover"?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(c.timeout),c.hoverState="in";if(!c.options.delay||!c.options.delay.show)return c.show();c.timeout=setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show)},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(c.timeout),c.hoverState="out";if(!c.options.delay||!c.options.delay.hide)return c.hide();c.timeout=setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide)},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);if(b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d=typeof this.options.placement=="function"?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m=this.options.container=="body"?window.innerWidth:j.outerWidth(),n=this.options.container=="body"?window.innerHeight:j.outerHeight(),o=this.options.container=="body"?0:j.offset().left;d=d=="bottom"&&g.top+g.height+i-l>n?"top":d=="top"&&g.top-l-i<0?"bottom":d=="right"&&g.right+h>
2504m?"left":d=="left"&&g.left-h<o?"right":d,c.removeClass(k).addClass(d)}var p=this.getCalculatedOffset(d,g,h,i);this.applyPlacement(p,d),this.$element.trigger("shown.bs."+this.type)}},b.prototype.applyPlacement=function(a,b){var c,d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),a.top=a.top+g,a.left=a.left+h,d.offset(a).addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;b=="top"&&j!=f&&(c=!0,a.top=a.top+f-j);if(/bottom|top/.test(b)){var k=0;a.left<0&&(k=a.left*-2,a.left=0,d.offset(a),i=d[0].offsetWidth,j=d[0].offsetHeight),this.replaceArrow(k-e+i,i,"left")}else this.replaceArrow(j-f,j,"top");c&&d.offset(a)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function e(){b.hoverState!="in"&&c.detach()}var b=this,c=this.tip(),d=a.Event("hide.bs."+this.type);this.$element.trigger(d);if(d.isDefaultPrevented())return;return c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?c.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),this.$element.trigger("hidden.bs."+this.type),this},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},typeof b.getBoundingClientRect=="function"?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return a=="bottom"?{top:b.top+b.height,left:b.left+b.width/2-c/2}:a=="top"?{top:b.top-d,left:b.left+b.width/2-c/2}:a=="left"?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f=typeof c=="object"&&c;e||d.data("bs.tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||(typeof b.content=="function"?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f=typeof c=="object"&&c;e||d.data("bs.popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});b.trigger(f);if(f.isDefaultPrevented())return;var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})},b.prototype.activate=function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g).emulateTransitionEnd(150):g(),e.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;typeof f!="object"&&(h=g=f),typeof g=="function"&&(g=f.top()),typeof h=="function"&&(h=f.bottom());var i=this.unpin!=null&&d+this.unpin<=e.top?!1:h!=null&&e.top+this.$element.height()>=c-h?"bottom":g!=null&&d<=g?"top":!1;if(this.affixed===i)return;this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin=i=="bottom"?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),i=="bottom"&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()})};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f=typeof c=="object"&&c;
2504e||d.data("bs.affix",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(this.transitioning||this.$element.hasClass("in"))return;var b=a.Event("show.bs.collapse");this.$element.trigger(b);if(b.isDefaultPrevented())return;var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])},b.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("in"))return;var b=a.Event("hide.bs.collapse");this.$element.trigger(b);if(b.isDefaultPrevented())return;var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};if(!a.support.transition)return d.call(this);this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350)},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),typeof c=="object"&&c);e||d.data("bs.collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":c.data(),i=c.attr("data-parent"),j=i&&a(i);if(!g||!g.transitioning)j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(c).addClass("collapsed"),c[f.hasClass("in")?"addClass":"removeClass"]("collapsed");f.collapse(h)})}(window.jQuery),+function(a){function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}"use strict",b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this,d=this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,c=b-this.$scrollElement.height(),d=this.offsets,e=this.targets,f=this.activeTarget,g;if(a>=c)return f!=(g=e.last()[0])&&this.activate(g);for(g=d.length;g--;)f!=e[g]&&a>=d[g]&&(!d[g+1]||a<=d[g+1])&&this.activate(e[g])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f=typeof c=="object"&&c;e||d.data("bs.scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(a.style[c]!==undefined)return{end:b[c]}}"use strict",a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery)
2505/* End */
2506;
2507; /* Start:"a:4:{s:4:"full";s:87:"/local/templates/aspro-medc2/vendor/flexslider/jquery.flexslider.min.js?165692363722334";s:6:"source";s:71:"/local/templates/aspro-medc2/vendor/flexslider/jquery.flexslider.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2508/*
2509 * jQuery FlexSlider v2.6.3
2510 * Copyright 2012 WooThemes
2511 * Contributing Author: Tyler Smith
2512 */!function($){var e=!0;$.flexslider=function(t,a){var n=$(t);n.vars=$.extend({},$.flexslider.defaults,a);var i=n.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,r=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&n.vars.touch,o="click touchend MSPointerUp keyup",l="",c,d="vertical"===n.vars.direction,u=n.vars.reverse,v=n.vars.itemWidth>0,p="fade"===n.vars.animation,m=""!==n.vars.asNavFor,f={};$.data(t,"flexslider",n),f={init:function(){n.animating=!1,n.currentSlide=parseInt(n.vars.startAt?n.vars.startAt:0,10),isNaN(n.
vendor: 4,106 bytes, line 2512
2512currentSlide)&&(n.currentSlide=0),n.animatingTo=n.currentSlide,n.atEnd=0===n.currentSlide||n.currentSlide===n.last,n.containerSelector=n.vars.selector.substr(0,n.vars.selector.search(" ")),n.slides=$(n.vars.selector,n),n.container=$(n.containerSelector,n),n.count=n.slides.length,n.syncExists=$(n.vars.sync).length>0,"slide"===n.vars.animation&&(n.vars.animation="swing"),n.prop=d?"top":"marginLeft",n.args={},n.manualPause=!1,n.stopped=!1,n.started=!1,n.startTimeout=null,n.transitions=!n.vars.video&&!p&&n.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var a in t)if(void 0!==e.style[t[a]])return n.pfx=t[a].replace("Perspective","").toLowerCase(),n.prop="-"+n.pfx+"-transform",!0;return!1}(),n.ensureAnimationEnd="",""!==n.vars.controlsContainer&&(n.controlsContainer=$(n.vars.controlsContainer).length>0&&$(n.vars.controlsContainer)),""!==n.vars.manualControls&&(n.manualControls=$(n.vars.manualControls).length>0&&$(n.vars.manualControls)),""!==n.vars.customDirectionNav&&(n.customDirectionNav=2===$(n.vars.customDirectionNav).length&&$(n.vars.customDirectionNav)),n.vars.randomize&&(n.slides.sort(function(){return Math.round(Math.random())-.5}),n.container.empty().append(n.slides)),n.doMath(),n.setup("init"),n.vars.controlNav&&f.controlNav.setup(),n.vars.directionNav&&f.directionNav.setup(),n.vars.keyboard&&(1===$(n.containerSelector).length||n.vars.multipleKeyboard)&&$(document).bind("keyup",function(e){var t=e.keyCode;if(!n.animating&&(39===t||37===t)){var a=39===t?n.getTarget("next"):37===t?n.getTarget("prev"):!1;n.flexAnimate(a,n.vars.pauseOnAction)}}),n.vars.mousewheel&&n.bind("mousewheel",function(e,t,a,i){e.preventDefault();var s=0>t?n.getTarget("next"):n.getTarget("prev");n.flexAnimate(s,n.vars.pauseOnAction)}),n.vars.pausePlay&&f.pausePlay.setup(),n.vars.slideshow&&n.vars.pauseInvisible&&f.pauseInvisible.init(),n.vars.slideshow&&(n.vars.pauseOnHover&&n.hover(function(){n.manualPlay||n.manualPause||n.pause()},function(){n.manualPause||n.manualPlay||n.stopped||n.play()}),n.vars.pauseInvisible&&f.pauseInvisible.isHidden()||(n.vars.initDelay>0?n.startTimeout=setTimeout(n.play,n.vars.initDelay):n.play())),m&&f.asNav.setup(),r&&n.vars.touch&&f.touch(),(!p||p&&n.vars.smoothHeight)&&$(window).bind("resize orientationchange focus",f.resize),n.find("img").attr("draggable","false"),setTimeout(function(){n.vars.start(n)},200)},asNav:{setup:function(){n.asNav=!0,n.animatingTo=Math.floor(n.currentSlide/n.move),n.currentItem=n.currentSlide,n.slides.removeClass(i+"active-slide").eq(n.currentItem).addClass(i+"active-slide"),s?(t._slider=n,n.slides.each(function(){var e=this;e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",function(e){e.preventDefault(),e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1),e.addEventListener("MSGestureTap",function(e){e.preventDefault();var t=$(this),a=t.index();$(n.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(n.direction=n.currentItem<a?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction,!1,!0,!0))})})):n.slides.on(o,function(e){e.preventDefault();var t=$(this),a=t.index(),s=t.offset().left-$(n).scrollLeft();0>=s&&t.hasClass(i+"active-slide")?n.flexAnimate(n.getTarget("prev"),!0):$(n.vars.asNavFor).data("flexslider").animating||t.hasClass(i+"active-slide")||(n.direction=n.currentItem<a?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){n.manualControls?f.controlNav.setupManual():f.controlNav.setupPaging()},setupPaging:function(){var e="thumbnails"===n.vars.controlNav?"control-thumbs":"control-paging",t=1,a,s;if(n.controlNavScaffold=$('<ol class="'+i+"control-nav "+i+e+'"></ol>'),n.pagingCount>1)for(var r=0;r<n.pagingCount;r++){s=n.slides.eq(r),void 0===s.attr("data-thumb-alt")&&s.attr("data-thumb-alt","");var c=""!==s.attr("data-thumb-alt")?c=' alt="'+s.attr("data-thumb-alt")+'"':"";if(a="thumbnails"===n.vars.controlNav?'<img src="'+s.attr("data-thumb")+'"'+c+"/>":'<a href="#">'+t+"</a>
2512","thumbnails"===n.vars.controlNav&&!0===n.vars.thumbCaptions){var d=s.attr("data-thumbcaption");""!==d&&void 0!==d&&(a+='<span class="'+i+'caption">'+d+"</span>")}n.controlNavScaffold.append("<li>"+a+"</li>"),t++}n.controlsContainer?$(n.controlsContainer).append(n.controlNavScaffold):n.append(n.controlNavScaffold),f.controlNav.set(),f.controlNav.active(),n.controlNavScaffold.delegate("a, img",o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(n.direction=a>n.currentSlide?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},setupManual:function(){n.controlNav=n.manualControls,f.controlNav.active(),n.controlNav.bind(o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(a>n.currentSlide?n.direction="next":n.direction="prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},set:function(){var e="thumbnails"===n.vars.controlNav?"img":"a";n.controlNav=$("."+i+"control-nav li "+e,n.controlsContainer?n.controlsContainer:n)},active:function(){n.controlNav.removeClass(i+"active").eq(n.animatingTo).addClass(i+"active")},update:function(e,t){n.pagingCount>1&&"add"===e?n.controlNavScaffold.append($('<li><a href="#">'+n.count+"</a></li>")):1===n.pagingCount?n.controlNavScaffold.find("li").remove():n.
vendor: 12,385 bytes, line 2512
2512controlNav.eq(t).closest("li").remove(),f.controlNav.set(),n.pagingCount>1&&n.pagingCount!==n.controlNav.length?n.update(t,e):f.controlNav.active()}},directionNav:{setup:function(){var e=$('<ul class="'+i+'direction-nav"><li class="'+i+'nav-prev"><a class="'+i+'prev" href="#">'+n.vars.prevText+'</a></li><li class="'+i+'nav-next"><a class="'+i+'next" href="#">'+n.vars.nextText+"</a></li></ul>");n.customDirectionNav?n.directionNav=n.customDirectionNav:n.controlsContainer?($(n.controlsContainer).append(e),n.directionNav=$("."+i+"direction-nav li a",n.controlsContainer)):(n.append(e),n.directionNav=$("."+i+"direction-nav li a",n)),f.directionNav.update(),n.directionNav.bind(o,function(e){e.preventDefault();var t;""!==l&&l!==e.type||(t=$(this).hasClass(i+"next")?n.getTarget("next"):n.getTarget("prev"),n.flexAnimate(t,n.vars.pauseOnAction)),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";1===n.pagingCount?n.directionNav.addClass(e).attr("tabindex","-1"):n.vars.animationLoop?n.directionNav.removeClass(e).removeAttr("tabindex"):0===n.animatingTo?n.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):n.animatingTo===n.last?n.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):n.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var e=$('<div class="'+i+'pauseplay"><a href="#"></a></div>');n.controlsContainer?(n.controlsContainer.append(e),n.pausePlay=$("."+i+"pauseplay a",n.controlsContainer)):(n.append(e),n.pausePlay=$("."+i+"pauseplay a",n)),f.pausePlay.update(n.vars.slideshow?i+"pause":i+"play"),n.pausePlay.bind(o,function(e){e.preventDefault(),""!==l&&l!==e.type||($(this).hasClass(i+"pause")?(n.manualPause=!0,n.manualPlay=!1,n.pause()):(n.manualPause=!1,n.manualPlay=!0,n.play())),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(e){"play"===e?n.pausePlay.removeClass(i+"pause").addClass(i+"play").html(n.vars.playText):n.pausePlay.removeClass(i+"play").addClass(i+"pause").html(n.vars.pauseText)}},touch:function(){function e(e){e.stopPropagation(),n.animating?e.preventDefault():(n.pause(),t._gesture.addPointer(e.pointerId),T=0,c=d?n.h:n.w,f=Number(new Date),l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c)}function a(e){e.stopPropagation();var a=e.target._slider;if(a){var n=-e.translationX,i=-e.translationY;return T+=d?i:n,m=T,y=d?Math.abs(T)<Math.abs(-n):Math.abs(T)<Math.abs(-i),e.detail===e.MSGESTURE_FLAG_INERTIA?void setImmediate(function(){t._gesture.stop()}):void((!y||Number(new Date)-f>500)&&(e.preventDefault(),!p&&a.transitions&&(a.vars.animationLoop||(m=T/(0===a.currentSlide&&0>T||a.currentSlide===a.last&&T>0?Math.abs(T)/c+2:1)),a.setProps(l+m,"setTouch"))))}}function i(e){e.stopPropagation();var t=e.target._slider;if(t){if(t.animatingTo===t.currentSlide&&!y&&null!==m){var a=u?-m:m,n=a>0?t.getTarget("next"):t.getTarget("prev");t.canAdvance(n)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?t.flexAnimate(n,t.vars.pauseOnAction):p||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}r=null,o=null,m=null,l=null,T=0}}var r,o,l,c,m,f,g,h,S,y=!1,x=0,b=0,T=0;s?(t.style.msTouchAction="none",t._gesture=new MSGesture,t._gesture.target=t,t.addEventListener("MSPointerDown",e,!1),t._slider=n,t.addEventListener("MSGestureChange",a,!1),t.addEventListener("MSGestureEnd",i,!1)):(g=function(e){n.animating?e.preventDefault():(window.navigator.msPointerEnabled||1===e.touches.length)&&(n.pause(),c=d?n.h:n.w,f=Number(new Date),x=e.touches[0].pageX,b=e.touches[0].pageY,l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c,r=d?b:x,o=d?x:b,t.addEventListener("touchmove",h,!1),t.addEventListener("touchend",S,!1))},h=function(e){x=e.touches[0].pageX,b=e.touches[0].pageY,m=d?r-b:r-x,y=d?Math.abs(m)<Math.abs(x-o):Math.abs(m)<Math.abs(b-o);var t=500;(!y||Number(new Date)-f>t)&&(e.preventDefault(),!p&&n.transitions&&(n.vars.animationLoop||(m/=0===n.currentSlide&&0>m||n.currentSlide===n.last&&m>0?Math.abs(m)/c+2:1),n.setProps(l+m,"setTouch")))},S=function(e){if(t.removeEventListener("touchmove",h,!1),n.animatingTo===n.currentSlide&&!y&&null!==m){var a=u?-m:m,i=a>0?n.getTarget("next"):n.getTarget("prev");n.canAdvance(i)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?n.flexAnimate(i,n.vars.pauseOnAction):p||n.flexAnimate(n.currentSlide,n.vars.pauseOnAction,!0)}t.removeEventListener("touchend",S,!1),r=null,o=null,m=null,l=null},t.addEventListener("touchstart",g,!1))},resize:function(){!n.animating&&n.is(":visible")&&(v||n.doMath(),p?f.smoothHeight():v?(n.slides.width(n.computedW),n.update(n.pagingCount),n.setProps()):d?(n.viewport.height(n.h),n.setProps(n.h,"setTotal")):(n.vars.smoothHeight&&f.smoothHeight(),n.newSlides.width(n.computedW),n.setProps(n.computedW,"setTotal")))},smoothHeight:function(e){if(!d||p){var t=p?n:n.viewport;e?t.animate({height:n.slides.eq(n.animatingTo).innerHeight()},e):t.innerHeight(n.slides.eq(n.animatingTo).innerHeight())}},sync:function(e){var t=$(n.vars.sync).data("flexslider"),a=n.animatingTo;switch(e){case"animate":t.flexAnimate(a,n.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=$(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=f.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){f.pauseInvisible.isHidden()?n.startTimeout?clearTimeout(n.startTimeout):n.pause():n.started?n.play():n.vars.initDelay>0?setTimeout(n.play,n.vars.initDelay):n.play()})}},isHidden:function(){var e=f.pauseInvisible.getHiddenProp();return e?document[e]:!1},getHiddenProp:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}},setToClearWatchedEvent:function(){clearTimeout(c),c=setTimeout(function(){l=""},3e3)}},n.flexAnimate=function(e,t,a,s,o){if(n.vars.animationLoop||e===n.currentSlide||(n.direction=e>n.currentSlide?"next":"prev"),m&&1===n.pagingCount&&(n.direction=n.currentItem<e?"next":"prev"),!n.animating&&(n.canAdvance(e,o)||a)&&n.is(":visible")){if(m&&s){var l=$(n.vars.asNavFor).data("flexslider");if(n.atEnd=0===e||e===n.count-1,l.flexAnimate(e,!0,!1,!0,o),n.direction=n.currentItem<e?"next":"prev",l.direction=n.direction,Math.ceil((e+1)/n.visible)-1===n.currentSlide||0===e)return n.currentItem=e,n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),!1;n.currentItem=e,n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),e=Math.floor(e/n.visible)}if(n.animating=!0,n.animatingTo=e,t&&n.pause(),n.vars.before(n),n.syncExists&&!o&&f.sync("animate"),n.vars.controlNav&&f.controlNav.active(),v||n.slides.removeClass(i+"active-slide").eq(e).addClass(i+"active-slide"),n.atEnd=0===e||e===n.last,n.vars.directionNav&&f.directionNav.update(),e===n.last&&(n.vars.end(n),n.vars.animationLoop||n.pause()),p)r?(n.slides.eq(n.currentSlide).css({opacity:0,zIndex:1}),n.slides.eq(e).css({opacity:1,zIndex:2}),n.wrapup(c)):(n.slides.eq(n.currentSlide).css({zIndex:1}).animate({opacity:0},n.vars.animationSpeed,n.vars.easing),n.slides.eq(e).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing,n.wrapup));else{var c=d?n.slides.filter(":first").height():n.computedW,g,h,S;v?(g=n.vars.itemMargin,S=(n.itemW+g)*n.move*n.animatingTo,h=S>n.limit&&1!==n.visible?n.limit:S):h=0===n.currentSlide&&e===n.count-1&&n.vars.animationLoop&&"next"!==n.direction?u?(n.count+n.cloneOffset)*c:0:n.currentSlide===n.last&&0===e&&n.vars.animationLoop&&"prev"!==n.direction?u?0:(n.count+1)*c:u?(n.count-1-e+n.cloneOffset)*c:(e+n.cloneOffset)*c,n.setProps(h,"",n.vars.animationSpeed),n.transitions?(n.vars.animationLoop&&n.atEnd||(n.animating=!1,n.currentSlide=n.animatingTo),n.container.unbind("webkitTransitionEnd transitionend"),n.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(n.ensureAnimationEnd),n.wrapup(c)}),clearTimeout(n.ensureAnimationEnd),n.ensureAnimationEnd=setTimeout(function(){n.wrapup(c)},n.vars.animationSpeed+100)):n.container.animate(n.args,n.vars.animationSpeed,n.vars.easing,function(){n.wrapup(c)})}n.vars.smoothHeight&&f.smoothHeight(n.vars.animationSpeed)}},n.wrapup=function(e){p||v||(0===n.currentSlide&&n.animatingTo===n.last&&n.vars.animationLoop?n.setProps(e,"jumpEnd"):n.currentSlide===n.last&&0===n.animatingTo&&n.vars.animationLoop&&n.setProps(e,"jumpStart")),n.animating=!1,n.currentSlide=n.animatingTo,n.vars.after(n)},n.animateSlides=function(){!n.animating&&e&&n.flexAnimate(n.getTarget("next"))},n.pause=function(){clearInterval(n.animatedSlides),n.animatedSlides=null,n.playing=!1,n.vars.pausePlay&&f.pausePlay.update("play"),n.syncExists&&f.sync("pause")},n.play=function(){n.playing&&clearInterval(n.animatedSlides),n.animatedSlides=n.animatedSlides||setInterval(n.animateSlides,n.vars.slideshowSpeed),n.started=n.playing=!0,n.vars.pausePlay&&f.pausePlay.update("pause"),n.syncExists&&f.sync("play")},n.stop=function(){n.pause(),n.stopped=!0},n.canAdvance=function(e,t){var a=m?n.pagingCount-1:n.last;return t?!0:m&&n.currentItem===n.count-1&&0===e&&"prev"===n.direction?!0:m&&0===n.currentItem&&e===n.pagingCount-1&&"next"!==n.direction?!1:e!==n.currentSlide||m?n.vars.animationLoop?!0:n.atEnd&&0===n.currentSlide&&e===a&&"next"!==n.direction?!1:!n.atEnd||n.currentSlide!==a||0!==e||"next"!==n.direction:!1},n.getTarget=function(e){return n.direction=e,"next"===e?n.currentSlide===n.last?0:n.currentSlide+1:0===n.currentSlide?n.last:n.currentSlide-1},n.setProps=function(e,t,a){var i=function(){var a=e?e:(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo,i=function(){if(v)return"setTouch"===t?e:u&&n.animatingTo===n.last?0:u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:n.animatingTo===n.last?n.limit:a;switch(t){case"setTotal":return u?(n.count-1-n.currentSlide+n.cloneOffset)*e:(n.currentSlide+n.cloneOffset)*e;case"setTouch":return u?e:e;case"jumpEnd":return u?e:n.count*e;case"jumpStart":return u?n.count*e:e;default:return e}}();return-1*i+"px"}();n.transitions&&(i=d?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)",a=void 0!==a?a/1e3+"s":"0s",n.container.css("-"+n.pfx+"-transition-duration",a),n.container.css("transition-duration",a)),n.args[n.prop]=i,(n.transitions||void 0===a)&&n.container.css(n.args),n.container.css("transform",i)},n.setup=function(e){if(p)n.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(r?n.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+n.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(n.currentSlide).css({opacity:1,zIndex:2}):0==n.vars.fadeFirstSlide?n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).css({opacity:1}):n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing)),n.vars.smoothHeight&&f.smoothHeight();else{var t,a;"init"===e&&(n.viewport=$('<div class="'+i+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(n).append(n.container),n.cloneCount=0,n.cloneOffset=0,u&&(a=$.makeArray(n.slides).reverse(),n.slides=$(a),n.container.empty().append(n.slides))),n.vars.animationLoop&&!v&&(n.cloneCount=2,n.cloneOffset=1,"init"!==e&&n.container.find(".clone").remove(),n.container.append(f.uniqueID(n.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(f.uniqueID(n.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),n.newSlides=$(n.vars.selector,n),t=u?n.count-1-n.currentSlide+n.cloneOffset:n.currentSlide+n.cloneOffset,d&&!v?(n.container.height(200*(n.count+n.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){n.newSlides.css({display:"block"}),n.doMath(),n.viewport.height(n.h),n.setProps(t*n.h,"init")}
2512,"init"===e?100:0)):(n.container.width(200*(n.count+n.cloneCount)+"%"),n.setProps(t*n.computedW,"init"),setTimeout(function(){n.doMath(),n.newSlides.css({width:n.computedW,marginRight:n.computedM,"float":"left",display:"block"}),n.vars.smoothHeight&&f.smoothHeight()},"init"===e?100:0))}v||n.slides.removeClass(i+"active-slide").eq(n.currentSlide).addClass(i+"active-slide"),n.vars.init(n)},n.doMath=function(){var e=n.slides.first(),t=n.vars.itemMargin,a=n.vars.minItems,i=n.vars.maxItems;n.w=void 0===n.viewport?n.width():n.viewport.width(),n.h=e.height(),n.boxPadding=e.outerWidth()-e.width(),v?(n.itemT=n.vars.itemWidth+t,n.itemM=t,n.minW=a?a*n.itemT:n.w,n.maxW=i?i*n.itemT-t:n.w,n.itemW=n.minW>n.w?(n.w-t*(a-1))/a:n.maxW<n.w?(n.w-t*(i-1))/i:n.vars.itemWidth>n.w?n.w:n.vars.itemWidth,n.visible=Math.floor(n.w/n.itemW),n.move=n.vars.move>0&&n.vars.move<n.visible?n.vars.move:n.visible,n.pagingCount=Math.ceil((n.count-n.visible)/n.move+1),n.last=n.pagingCount-1,n.limit=1===n.pagingCount?0:n.vars.itemWidth>n.w?n.itemW*(n.count-1)+t*(n.count-1):(n.itemW+t)*n.count-n.w-t):(n.itemW=n.w,n.itemM=t,n.pagingCount=n.count,n.last=n.count-1),n.computedW=n.itemW-n.boxPadding,n.computedM=n.itemM},n.update=function(e,t){n.doMath(),v||(e<n.currentSlide?n.currentSlide+=1:e<=n.currentSlide&&0!==e&&(n.currentSlide-=1),n.animatingTo=n.currentSlide),n.vars.controlNav&&!n.manualControls&&("add"===t&&!v||n.pagingCount>n.controlNav.length?f.controlNav.update("add"):("remove"===t&&!v||n.pagingCount<n.controlNav.length)&&(v&&n.currentSlide>n.last&&(n.currentSlide-=1,n.animatingTo-=1),f.controlNav.update("remove",n.last))),n.vars.directionNav&&f.directionNav.update()},n.addSlide=function(e,t){var a=$(e);n.count+=1,n.last=n.count-1,d&&u?void 0!==t?n.slides.eq(n.count-t).after(a):n.container.prepend(a):void 0!==t?n.slides.eq(t).before(a):n.container.append(a),n.update(t,"add"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.added(n)},n.removeSlide=function(e){var t=isNaN(e)?n.slides.index($(e)):e;n.count-=1,n.last=n.count-1,isNaN(e)?$(e,n.slides).remove():d&&u?n.slides.eq(n.last).remove():n.slides.eq(e).remove(),n.doMath(),n.update(t,"remove"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.removed(n)},f.init()},$(window).blur(function(t){e=!1}).focus(function(t){e=!0}),$.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,fadeFirstSlide:!0,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",customDirectionNav:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){}},$.fn.flexslider=function(e){if(void 0===e&&(e={}),"object"==typeof e)return this.each(function(){var t=$(this),a=e.selector?e.selector:".slides > li",n=t.find(a);1===n.length&&e.allowOneSlide===!1||0===n.length?(n.fadeIn(400),e.start&&e.start(t)):void 0===t.data("flexslider")&&new $.flexslider(this,e)});var t=$(this).data("flexslider");switch(e){case"play":t.play();break;case"pause":t.pause();break;case"stop":t.stop();break;case"next":t.flexAnimate(t.getTarget("next"),!0);break;case"prev":case"previous":t.flexAnimate(t.getTarget("prev"),!0);break;default:"number"==typeof e&&t.flexAnimate(e,!0)}}}(jQuery);
2513/* End */
2514;
2515; /* Start:"a:4:{s:4:"full";s:74:"/local/templates/aspro-medc2/vendor/jquery.validate.min.js?165692363722254";s:6:"source";s:58:"/local/templates/aspro-medc2/vendor/jquery.validate.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2516/*! jQuery Validation Plugin - v1.13.1 - 10/14/2014
2517 * http://jqueryvalidation.org/
2518 * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
2519!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d,e;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element
2519(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers
2519)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled], [readonly]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.val
2519idClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\])/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.n
2519ame],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);
2519return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){/*return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())*/ /*customized!!!*/ var check = false,re=new RegExp((typeof(VALIDATE_DATE_MASK)!=='undefined'?VALIDATE_DATE_MASK:'^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}$')),adata,gg,mm,aaaa,xdata;if(re.test(a)){adata=a.split('.');if(adata.length===1){adata=a.split('-');if(adata.length===1){adata=a.split(' ');
2519if(adata.length===1){adata=a.split('/');if(adata.length===1){adata=a.split(':');}}}}gg=parseInt(adata[0],10);mm=parseInt(adata[1],10);aaaa=parseInt(adata[2],10);xdata=new Date(aaaa,mm-1,gg,12,0,0,0);if((xdata.getUTCFullYear()===aaaa)&&(xdata.getUTCMonth()===mm-1)&&(xdata.getUTCDate()===gg)){check = true;}else{check = false;}}else{check = false;}return this.optional(b)||check;},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});
2520/* End */
2521;
2522; /* Start:"a:4:{s:4:"full";s:68:"/local/templates/aspro-medc2/js/jquery.uniform.min.js?16569236388308";s:6:"source";s:53:"/local/templates/aspro-medc2/js/jquery.uniform.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2523(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("<div />"),r=e("<span />"),s.autoHide&&t.is(":hidden")&&"none"===t.css("display")&&i.hide(),a.divClass&&i.addClass(a.divClass),s.wrapperClass&&i.addClass(s.wrapperClass),a.spanClass&&r.addClass(a.spanClass),l=n(t,"id"),s.useID&&l&&n(i,"id",s.idPrefix+"-"+l),a.spanHtml&&r.html(a.spanHtml),i=o(t,i,a.divWrap),r=o(t,r,a.spanWrap),u(i,t,s),{div:i,span:r}}function d(t,n){var s;return n.wrapperClass?(s=e("<span />").addClass(n.wrapperClass),s=o(t,s,"wrap")):null}function f(){var t,n,s,a;return a="rgb(120,2,153)",n=e('<div style="width:0;height:0;color:'+a+'">'),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("<span />").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;
vendor: 4,406 bytes, line 2523
2523for(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("<span />").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:"Cho
2523ose 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);
2524/* End */
2525;
2526; /* Start:"a:4:{s:4:"full";s:58:"/local/templates/aspro-medc2/js/jqModal.js?165692363811022";s:6:"source";s:42:"/local/templates/aspro-medc2/js/jqModal.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2527/*
2528 * jqModal - Minimalist Modaling with jQuery
2529 *
2530 * Copyright (c) 2007-2014 Brice Burgess @iceburg_net
2531 * Dual licensed under the MIT and GPL licenses:
2532 *   http://www.opensource.org/licenses/mit-license.php
2533 *   http://www.gnu.org/licenses/gpl.html
2534 * 
2535 * $Version: 1.0.2 (2014.04.10 +r19)
2536 * Requires: jQuery 1.2.3+
2537 */
2538
2539(function($) {
2540	
2541	/**
2542	 * Initialize a set of elements as "modals". Modals typically are popup dialogs,
2543	 * notices, modal windows, &c. 
2544	 * 
2545	 * @name jqm
2546	 * @param options user defined options, augments defaults.
2547	 * @type jQuery
2548	 * @cat Plugins/jqModal
2549	 */
2550	
2551	$.fn.jqm=function(options){
2552		
2553		var o = $.extend({}, $.jqm.params, options);
2554
2555		return this.each(function(){
2556			var e = $(this),
2557				jqm = $(this).data('jqm');
2558			
2559			if(!jqm) jqm = {ID: I++};
2560			
2561			// add/extend options to modal and mark as initialized
2562			e.data('jqm',$.extend(o,jqm)).addClass('jqm-init');
2563			
2564			// ... Attach events to trigger showing of this modal
2565			o.trigger&&$(this).jqmAddTrigger(o.trigger);
2566		});
2567	};
2568	
2569	
2570	/**
2571	 * Matching modals will have their jqmShow() method fired by attaching a
2572	 *   onClick event to elements matching `trigger`.
2573	 * 
2574	 * @name jqmAddTrigger
2575	 * @param trigger a selector String, jQuery collection of elements, or a DOM element.
2576	 */
2577	$.fn.jqmAddTrigger=function(trigger){
2578		return this.each(function(){
2579			if(!addTrigger($(this), 'jqmShow', trigger))
2580				err("jqmAddTrigger must be called on initialized modals")
2581		});
2582	};
2583	
2584	
2585	/**
2586	 * Matching modals will have their jqmHide() method fired by attaching an
2587	 *   onClick event to elements matching `trigger`.
2588	 * 
2589	 * @name jqmAddClose
2590	 * @param trigger a selector String, jQuery collection of elements, or a DOM element.
2591	 */
2592	$.fn.jqmAddClose=function(trigger){
2593		return this.each(function(){
2594			if(!addTrigger($(this), 'jqmHide', trigger))
2595				err("jqmAddClose must be called on initialized modals")
2596		});
2597	};
2598	
2599	
2600	/**
2601	 * Open matching modals (if not shown)
2602	 */
2603	$.fn.jqmShow=function(trigger){
2604		return this.each(function(){ !this._jqmShown&&show($(this), trigger); });
2605	};
2606	
2607	/**
2608	 * Close matching modals
2609	 */
2610	$.fn.jqmHide=function(trigger){
2611		return this.each(function(){ this._jqmShown&&hide($(this), trigger); });
2612	};
2613	
2614	
2615	// utility functions
2616	
2617	var
2618		err = function(msg){
2619			if(window.console && window.console.error) window.console.error(msg);
2620		
2621		
2622	}, show = function(e, t){
2623		
2624		/**
2625		 * e = modal element (as jQuery object)
2626		 * t = triggering element
2627		 * 
2628		 * o = options
2629		 * z = z-index of modal
2630		 * v = overlay element (as jQuery object)
2631		 * h = hash (for jqModal <= r15 compatibility)
2632		 */
2633		
2634		var o = e.data('jqm'),
2635			t = t || window.event,
2636			z = (parseInt(e.css('z-index'))),
2637			z = (z > 0) ? z : 3000,
2638			v = $('<div></div>').addClass(o.overlayClass).css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:o.overlay/100}),
2639		
2640			// maintain legacy "hash" construct
2641			h = {w: e, c: o, o: v, t: t};
2642			
2643		e.css('z-index',z);
2644
2645		if(o.ajax){
2646			var target = o.target || e,
2647				url = o.ajax;
2648			
2649			target = (typeof target == 'string') ? $(target,e) : $(target);
2650			if(url.substr(0,1) == '@') url = $(t).attr(url.substring(1));
2651			
2652			 // Load the Ajax Content (and once loaded);
2653			   // Fire the onLoad callback (if exists),
2654			   // Attach closing events to elements inside the modal that match the closingClass,
2655			   // and Execute the jqModal default Open Callback
2656			target.html(o.ajaxText).load(url,function(){
2657				o.onLoad && o.onLoad.call(this,h);
2658				open(h);
2659			});	
2660		}
2661		else { open(h); }
2662		
2663	}, hide = function(e, t){
2664		/**
2665		 * e = modal element (as jQuery object)
2666		 * t = triggering element
2667		 * 
2668		 * o = options
2669		 * h = hash (for jqModal <= r15 compatibility)
2670		 */
2671		
2672		var o = e.data('jqm'),
2673			t = t || window.event,
2674		
2675		// maintain legacy "hash" construct
2676		h = {w: e, c: o, o: e.data('jqmv'), t: t};
2677		
2678		close(h);
2679		
2680	}, onShow = function(hash){
2681		// onShow callback. Responsible for showing a modal and overlay.
2682		//  return false to stop opening modal. 
2683		
2684		// hash object;
2685	    //  w: (jQuery object) The modal element
2686	    //  c: (object) The modal's options object 
2687	    //  o: (jQuery object) The overlay element
2688	    //  t: (DOM object) The triggering element
2689		
2690		// display the overlay (prepend to body) if not disabled
2691		
2692		// prevent double click
2693		if( hash.w[0]._jqmShown )
2694			return false;
2695			
2696		if(hash.c.overlay > 0)
2697			hash.o.prependTo('body');
2698			
2699		// make modal visible
2700		hash.w.show();
2701		
2702		// call focusFunc (attempts to focus on first input in modal)
2703		$.jqm.focusFunc(hash.w);
2704		
2705		return true;
2706		
2707		
2708	}, onHide = function(hash){
2709		// onHide callback. Responsible for hiding a modal and overlay.
2710		//  return false to stop closing modal. 
2711		
2712		// hash object;
2713	    //  w: (jQuery object) The modal element
2714	    //  c: (object) The modal's options object 
2715	    //  o: (jQuery object) The overlay element
2716	    //  t: (DOM object) The triggering element
2717		
2718		// hide modal and if overlay, remove overlay.
2719		hash.w.hide() && hash.o && hash.o.remove();
2720		
2721		return true;
2722		
2723		
2724	},  addTrigger = function(e, key, trigger){
2725		// addTrigger: Adds a jqmShow or jqmHide (key) for a modal (e) 
2726		//  all elements that match trigger string (trigger)\
2727		
2728		// return false if e is not an initialized modal element
2729		if(!e.data('jqm')) return false;
2730		
2731		return $(trigger).each(function(){
2732			// register modal to trigger elements
2733			this[key] = this[key] || [];
2734			this[key].push(e);
2735			
2736		}).click(function(){
2737			
2738			var trigger = this;
2739			
2740			// foreadh modal registered to this trigger, call jqmShow || 
2741			//   jqmHide (key) on modal passing trigger element (e)
2742			$.each(this[key], function(i, e){ e[key](trigger); });
2743			
2744			// stop trigger click event from bubbling
2745			return false;
2746		});
2747		
2748		
2749	},  open = function(h){
2750		// open: executes the onOpen callback + performs common tasks if successful
2751
2752		// transform legacy hash into new var shortcuts 
2753		 var e = h.w,
2754		 	v = h.o,
2755		 	o = h.c;	
2756
2757		// execute onShow callback
2758		if(o.onShow(h) !== false){
2759			// mark modal as shown
2760			e[0]._jqmShown = true;
2761			
2762			// if modal dialog 
2763			//
2764			// Bind the Keep Focus Function [F] if no other Modals are open (!A[0]) +
2765			// Add this modal to the opened modals stack (A) for nested modal support
2766			// 
2767			// else, close dialog when overlay is clicked
2768			if(o.modal){ !A[0]&&F('bind'); A.push(e); }
2769            else e.jqmAddClose(v);
2770			
2771			//  Attach closing events to elements inside the modal that match the closingClass
2772			o.closeClass&&e.jqmAddClose($('.' + o.closeClass,e));
2773			
2774			// IF toTop is true and overlay exists;
2775			//  Add placeholder element <span id="jqmP#ID_of_modal"/> before modal to
2776			//  remember it's position in the DOM and move it to a child of the body tag (after overlay)
2777			o.toTop&&v&&e.before('<span id="jqmP'+o.ID+'"></span>').insertAfter(v);
2778			
2779			// remember overlay (for closing function)
2780			e.data('jqmv',v);
2781		}
2782		
2783		
2784	},  close = function(h){
2785		// close: executes the onHide callback + performs common tasks if successful
2786
2787		// transform legacy hash into new var shortcuts 
2788		 var e = h.w,
2789		 	v = h.o,
2790		 	o = h.c;
2791
2792		// execute onShow callback
2793		if(o.onHide(h) !== false){
2794			// mark modal as !shown
2795			e[0]._jqmShown = false;
2796			
2797			 // If modal, remove from modal stack.
2798			 // If no modals in modal stack, unbind the Keep Focus Function
2799			 if(o.modal){A.pop();!A[0]&&F('unbind');}
2800			 
2801			 // IF toTop was passed and an overlay exists;
2802			 //  Move modal back to its "remembered" position.
2803			 o.toTop&&v&&$('#jqmP'+o.ID).after(e).remove();
2804		}
2805		
2806		
2807	},  F = function(t){
2808		// F: The Keep Focus Function (for modal: true dialos)
2809		// Binds or Unbinds (t) the Focus Examination Function (X) to keypresses and clicks
2810		
2811		$(document)[t]("keypress keydown mousedown",X);
2812		
2813		
2814	}, X = function(e){
2815		// X: The Focus Examination Function (for modal: true dialogs)
2816
2817		var modal = $(e.target).data('jqm') || $(e.target).parents('.jqm-init:first').data('jqm'),
2818			activeModal = A[A.length-1].data('jqm');
2819		
2820		// allow bubbling if event target is within active modal dialog
2821		if(modal && modal.ID == activeModal.ID) return true; 
2822
2823		// else, trigger focusFunc (focus on first input element and halt bubbling)
2824		return $.jqm.focusFunc(activeModal);
2825	}, 
2826	
2827	I = 0,   // modal ID increment (for nested modals) 
2828	A = [];  // array of active modals (used to lock interactivity to appropriate modal)
2829	
2830	
2831	// $.jqm, overridable defaults
2832	$.jqm = {
2833		/**
2834		 *  default options
2835		 *    
2836		 * (Integer)   overlay      - [0-100] Translucency percentage (opacity) of the body covering overlay. Set to 0 for NO overlay, and up to 100 for a 100% opaque overlay.  
2837		 * (String)    overlayClass - Applied to the body covering overlay. Useful for controlling overlay look (tint, background-image, &c) with CSS.
2838		 * (String)    closeClass   - Children of the modal element matching `closeClass` will fire the onHide event (to close the modal).
2839		 * (Mixed)     trigger      - Matching elements will fire the onShow event (to display the modal). Trigger can be a selector String, a jQuery collection of elements, a DOM element, or a False boolean.
2840		 * (String)    ajax         - URL to load content from via an AJAX request. False to disable ajax. If ajax begins with a "@", the URL is extracted from the attribute of the triggering element (e.g. use '@data-url' for; <a href="#" class="jqModal" data-url="modal.html">...)	                
2841		 * (Mixed)     target       - Children of the modal element to load the ajax response into. If false, modal content will be overwritten by ajax response. Useful for retaining modal design. 
2842		 *                            Target may be a selector string, jQuery collection of elements, or a DOM element -- and MUST exist as a child of the modal element.
2843		 * (String)    ajaxText     - Text shown while waiting for ajax return. Replaces HTML content of `target` element.
2844		 * (Boolean)   modal        - If true, user interactivity will be locked to the modal window until closed.
2845		 * (Boolean)   toTop        - If true, modal will be posistioned as a first child of the BODY element when opened, and its DOM posistion restored when closed. Useful for overcoming z-Index container issues.
2846		 * (Function)  onShow       - User defined callback function fired when modal opened.
2847		 * (Function)  onHide       - User defined callback function fired when modal closed.
2848		 * (Function)  onLoad       - User defined callback function fired when ajax content loads.
2849		 */
2850		params: {
2851			overlay: 50,
2852			overlayClass: 'jqmOverlay',
2853			closeClass: 'jqmClose',
2854			trigger: '.jqModal',
2855			ajax: false,
2856			target: false,
2857			ajaxText: '',
2858			modal: false,
2859			toTop: false,
2860			onShow: onShow,
2861			onHide: onHide,
2862			onLoad: false
2863		},
2864		
2865		// focusFunc is fired when a modal is shown, or when interaction occurs outside
2866		// a modal enabled dialog. Passed the modal element. 
2867		focusFunc: function(e) { $(':input:visible:first',e).focus(); return false; }
2868	};
2869	
2870})( jQuery );
2871/* End */
2872;
2873; /* Start:"a:4:{s:4:"full";s:69:"/local/templates/aspro-medc2/js/detectmobilebrowser.js?16569236382203";s:6:"source";s:54:"/local/templates/aspro-medc2/js/detectmobilebrowser.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2874/**
2875 * jQuery.browser.mobile (http://detectmobilebrowser.com/)
2876 *
2877 * jQuery.browser.mobile will be true if the browser is a mobile device
2878 *
2879 **/
2880(function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
2880sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);
2881/* End */
2882;
2883; /* Start:"a:4:{s:4:"full";s:60:"/local/templates/aspro-medc2/js/matchMedia.js?16569236381700";s:6:"source";s:45:"/local/templates/aspro-medc2/js/matchMedia.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2884/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
2885
2886window.matchMedia || (window.matchMedia = function() {
2887    "use strict";
2888
2889    // For browsers that support matchMedium api such as IE 9 and webkit
2890    var styleMedia = (window.styleMedia || window.media);
2891
2892    // For those that don't support matchMedium
2893    if (!styleMedia) {
2894        var style       = document.createElement('style'),
2895            script      = document.getElementsByTagName('script')[0],
2896            info        = null;
2897
2898        style.type  = 'text/css';
2899        style.id    = 'matchmediajs-test';
2900
2901        script.parentNode.insertBefore(style, script);
2902
2903        // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
2904        info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
2905
2906        styleMedia = {
2907            matchMedium: function(media) {
2908                var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
2909
2910                // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
2911                if (style.styleSheet) {
2912                    style.styleSheet.cssText = text;
2913                } else {
2914                    style.textContent = text;
2915                }
2916
2917                // Test if media query is true or false
2918                return info.width === '1px';
2919            }
2920        };
2921    }
2922
2923    return function(media) {
2924        return {
2925            matches: styleMedia.matchMedium(media || 'all'),
2926            media: media || 'all'
2927        };
2928    };
2929}());
2930
2931/* End */
2932;
2933; /* Start:"a:4:{s:4:"full";s:70:"/local/templates/aspro-medc2/js/jquery.waypoints.min.js?16569236388044";s:6:"source";s:55:"/local/templates/aspro-medc2/js/jquery.waypoints.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2934// Generated by CoffeeScript 1.6.2
2935/*
2936jQuery Waypoints - v2.0.3
2937Copyright (c) 2011-2013 Caleb Troughton
2938Dual licensed under the MIT license and GPL license.
2939https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
2940*/
2941(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(this,function(n,r){var i,o,l,s,f,u,a,c,h,d,p,y,v,w,g,m;i=n(r);c=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHe
2941ight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t,e){t.each(function(){var t;t=l.getWaypointsByElement(this);return n.each(t,function(t,n){n[e]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(a,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=a[n(t).data(u)])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);
2941return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
2942/* End */
2943;
2944; /* Start:"a:4:{s:4:"full";s:66:"/local/templates/aspro-medc2/js/jquery.counterup.js?16569236381069";s:6:"source";s:51:"/local/templates/aspro-medc2/js/jquery.counterup.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2945/*!
2946* jquery.counterup.js 1.0
2947*
2948* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal
2949* Released under the GPL v2 License
2950*
2951* Date: Nov 26, 2013
2952*/
2953!function(t){"use strict";t.fn.counterUp=function(e){var n=t.extend({time:400,delay:10},e);return this.each(function(){var e=t(this),u=n,a=function(){var t=u.time/u.delay,n=e.attr("data-value"),a=[n],r=/[0-9]+,[0-9]+/.test(n);n=n.replace(/,/g,"");for(var o=(/^[0-9]+$/.test(n),/^[0-9]+\.[0-9]+$/.test(n)),c=o?(n.split(".")[1]||[]).length:0,d=t;d>=1;d--){var i=parseInt(n/t*d);if(o&&(i=parseFloat(n/t*d).toFixed(c)),r)for(;/(\d+)(\d{3})/.test(i.toString());)i=i.toString().replace(/(\d+)(\d{3})/,"$1,$2");a.unshift(i)}e.data("counterup-nums",a),e.text("0");var s=function(){e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?setTimeout(e.data("counterup-func"),u.delay):(delete e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null))};e.data("counterup-func",s),setTimeout(e.data("counterup-func"),u.delay)};e.waypoint(a,{offset:"100%",triggerOnce:!0})})}}(jQuery);
2954/* End */
2955;
2956; /* Start:"a:4:{s:4:"full";s:69:"/local/templates/aspro-medc2/js/jquery.alphanumeric.js?16569236381972";s:6:"source";s:54:"/local/templates/aspro-medc2/js/jquery.alphanumeric.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
2957(function ($) {
2958    $.fn.alphanumeric = function (p) {
2959        var input = $(this),
2960            az = "abcdefghijklmnopqrstuvwxyz",
2961            options = $.extend({
2962                ichars: '!@#$%^&*()+=[]\\\';,/{}|":<>?~`.- _',
2963                nchars: '',
2964                allow: ''
2965            }, p),
2966            s = options.allow.split(''),
2967            i = 0,
2968            ch,
2969            regex;
2970
2971        for (i; i < s.length; i++) {
2972            if (options.ichars.indexOf(s[i]) != -1) {
2973                s[i] = '\\' + s[i];
2974            }
2975        }
2976
2977        if (options.nocaps) {
2978            options.nchars += az.toUpperCase();
2979        }
2980        if (options.allcaps) {
2981            options.nchars += az;
2982        }
2983
2984        options.allow = s.join('|');
2985
2986        regex = new RegExp(options.allow, 'gi');
2987        ch = (options.ichars + options.nchars).replace(regex, '');
2988
2989        input.keypress(function (e) {
2990            var key = String.fromCharCode(!e.charCode ? e.which : e.charCode);
2991
2992            if (ch.indexOf(key) != -1 && !e.ctrlKey) {
2993                e.preventDefault();
2994            }
2995        });
2996
2997        input.blur(function () {
2998            var value = input.val(),
2999                j = 0;
3000
3001            for (j; j < value.length; j++) {
3002                if (ch.indexOf(value[j]) != -1) {
3003                    input.val('');
3004                    return false;
3005                }
3006            }
3007            return false;
3008        });
3009
3010        return input;
3011    };
3012
3013    $.fn.numeric = function (p) {
3014        var az = 'abcdefghijklmnopqrstuvwxyz',
3015            aZ = az.toUpperCase();
3016
3017        return this.each(function () {
3018            $(this).alphanumeric($.extend({ nchars: az + aZ }, p));
3019        });
3020    };
3021
3022    $.fn.alpha = function (p) {
3023        var nm = '1234567890';
3024        return this.each(function () {
3025            $(this).alphanumeric($.extend({ nchars: nm }, p));
3026        });
3027    };
3028})(jQuery);
3029/* End */
3030;
3031; /* Start:"a:4:{s:4:"full";s:80:"/local/templates/aspro-medc2/js/jquery.mobile.custom.touch.min.js?16569236387784";s:6:"source";s:65:"/local/templates/aspro-medc2/js/jquery.mobile.custom.touch.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3032/*! jQuery Mobile v1.4.5 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */
3033
3034(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function C(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function k(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function L(){g=!1}function A(){g=!0}function O(){E=0,v.length=0,m=!1,A()}function M(){L()}function _(){D(),c=setTimeout(function(){c=0,O()},e.vmouse.resetTimerDuration)}function D(){c&&(clearTimeout(c),c=0)}function P(t,n,r){var i;if(r&&r[t]||!r&&k(n.target,t))i=N(n,t),e(n.target).trigger(i);return i}function H(t){var n=e.data(t.target,s),r;!m&&(!E||E!==n)&&(r=P("v"+t.type,t),r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function B(t){var n=T(t).touches,r,i,o;n&&n.length===1&&(r=t.target,i=C(r),i.hasVirtualBinding&&(E=w++,e.data(r,s,E),D(),M(),d=!1,o=T(t).touches[0],h=o.pageX,p=o.pageY,P("vmouseover",t,i),P("vmousedown",t,i)))}function j(e){if(g)return;
vendor: 4,463 bytes, line 3034
3034d||P("vmousecancel",e,C(e.target)),d=!0,_()}function F(t){if(g)return;var n=T(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=C(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;x<o.length;x++)e.event.special[o[x]]=U(o[x]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,i,s){var o=i.type;i.type=n,s?e.event.trigger(i,r,t):e.event.dispatch.call(t,i),i.type=o}var i=e(n),s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})},teardown:function(){e(this).unbind(o)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),r=!1;n.bind("vmousedown",function(s){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),!r&&o===e.target?l(t,"tap",e):r&&e.preventDefault()}r=!1;if(s.which&&s.which!==1)return!1;var o=s.target,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(r=!0),l(t,"taphold",e.Event("taphold",{target:o}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),i.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var n=t.pageXOffset,r=t.pageYOffset,i=e.clientX,s=e.clientY;if(e.pageY===0&&Math.floor(s)>Math.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(s<e.pageY-r||i<e.pageX-n)i=e.pageX-n,s=e.pageY-r;return{x:i,y:s}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y]}},handleSwipe:function(t,n,r,i){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.
3034coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var s=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o||t.isDefaultPrevented())return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)});
3035/* End */
3036;
3037; /* Start:"a:4:{s:4:"full";s:67:"/local/templates/aspro-medc2/js/jquery.autoresize.js?16569236383993";s:6:"source";s:52:"/local/templates/aspro-medc2/js/jquery.autoresize.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3038/*
3039 * jQuery autoResize (textarea auto-resizer)
3040 * @copyright James Padolsey http://james.padolsey.com
3041 * @version 1.04
3042 */
3043
3044(function($){
3045    
3046    $.fn.autoResize = function(options) {
3047        
3048        // Just some abstracted details,
3049        // to make plugin users happy:
3050        var settings = $.extend({
3051            onResize : function(){
3052				 
3053			},
3054            animate : true,
3055            animateDuration : 150,
3056            animateCallback : function(){},
3057            extraSpace : 20,
3058            limit: 1000
3059        }, options);
3060        
3061        // Only textarea's auto-resize:
3062        this.filter('textarea').each(function(){
3063            
3064                // Get rid of scrollbars and disable WebKit resizing:
3065            var textarea = $(this).css({resize:'none','overflow-y':'hidden'}),
3066            
3067                // Cache original height, for use later:
3068                origHeight = textarea.height(),
3069				
3070				                
3071                // Need clone of textarea, hidden off screen:
3072                clone = (function(){
3073
3074                    // Properties which may effect space taken up by chracters:
3075                    var props = ['height','width','lineHeight','textDecoration','letterSpacing'],
3076                        propOb = {};
3077  
3078                    // Create object of styles to apply:
3079                    $.each(props, function(i, prop){
3080                        propOb[prop] = textarea.css(prop);
3081                    });
3082                    
3083                    // Clone the actual textarea removing unique properties
3084                    // and insert before original textarea:
3085                    return textarea.clone().removeAttr('id').removeAttr('name').css({
3086                        position: 'absolute',
3087                        top: 0,
3088                        left: -9999
3089                    }).css(propOb).attr('tabIndex','-1').insertBefore(textarea);
3090					
3091                })(),
3092                lastScrollTop = null,
3093                updateSize = function() {
3094					
3095					if ($.browser.msie && $.browser.version == 6) {
3096					
3097						var obj = jQuery(this).get(0);
3098						var m = obj.createTextRange().boundingHeight;
3099						if(m<origHeight) m=origHeight;
3100						m+=settings.extraSpace;
3101						jQuery(this).css("height",m+'px');
3102					}
3103					
3104					else{
3105					
3106                    // Prepare the clone:
3107                    clone.height(0).val($(this).val()).scrollTop(10000);
3108					
3109                    // Find the height of text:
3110                    var scrollTop = Math.max(clone.scrollTop(), origHeight) + settings.extraSpace,
3111                        toChange = $(this).add(clone);
3112						
3113                    // Don't do anything if scrollTip hasen't changed:
3114                    if (lastScrollTop === scrollTop) { return; }
3115                    lastScrollTop = scrollTop;
3116					
3117                    // Check for limit:
3118                    if ( scrollTop >= settings.limit ) {
3119                        $(this).css('overflow-y','');
3120                        return;
3121                    }
3122                    // Fire off callback:
3123                    settings.onResize.call(this);
3124					
3125                    // Either animate or directly apply height:
3126                   settings.animate && textarea.css('display') === 'block' ?
3127                        toChange.stop().animate({height:scrollTop}, settings.animateDuration, settings.animateCallback)
3128                        : toChange.height(scrollTop);
3129					}
3130					
3131                };
3132                                  
3133            // Bind namespaced handlers to appropriate events:
3134            textarea
3135                .unbind('.dynSiz')
3136                .bind('keyup.dynSiz', updateSize)
3137                .bind('keydown.dynSiz', updateSize)
3138                .bind('change.dynSiz', updateSize);
3139            
3140        });
3141        
3142        // Chain:
3143        return this;
3144        
3145    };
3146    
3147    
3148    
3149})(jQuery);
3150/* End */
3151;
3152; /* Start:"a:4:{s:4:"full";s:79:"/local/templates/aspro-medc2/js/bootstrap-datetimepicker.min.js?165692363839213";s:6:"source";s:63:"/local/templates/aspro-medc2/js/bootstrap-datetimepicker.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
vendor: 39,213 bytes, line 3153
3153(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof exports==="object"){a(require("jquery"))}else{a(jQuery)}}}(function(d,f){if(!("indexOf" in Array.prototype)){Array.prototype.indexOf=function(k,j){if(j===f){j=0}if(j<0){j+=this.length}if(j<0){j=0}for(var l=this.length;j<l;j++){if(j in this&&this[j]===k){return j}}return -1}}function a(){var q,k,p,l,j,n,m,o;k=(new Date()).toString();p=((m=k.split("(")[1])!=null?m.slice(0,-1):0)||k.split(" ");if(p instanceof Array){n=[];for(var l=0,j=p.length;l<j;l++){o=p[l];if((q=(m=o.match(/\b[A-Z]+\b/))!==null)?m[0]:0){n.push(q)}}p=n.pop()}return p}function h(){return new Date(Date.UTC.apply(Date,arguments))}var g=function(k,j){var m=this;this.element=d(k);this.container=j.container||"body";this.language=j.language||this.element.data("date-language")||"en";this.language=this.language in e?this.language:this.language.split("-")[0];this.language=this.language in e?this.language:"en";this.isRTL=e[this.language].rtl||false;this.formatType=j.formatType||this.element.data("format-type")||"standard";this.format=c.parseFormat(j.format||this.element.data("date-format")||e[this.language].format||c.getDefaultFormat(this.formatType,"input"),this.formatType);this.isInline=false;this.isVisible=false;this.isInput=this.element.is("input");this.fontAwesome=j.fontAwesome||this.element.data("font-awesome")||false;this.bootcssVer=j.bootcssVer||(this.isInput?(this.element.is(".form-control")?3:2):(this.bootcssVer=this.element.is(".input-group")?3:2));this.component=this.element.is(".date")?(this.bootcssVer===3?this.element.find(".input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-remove, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o").parent():this.element.find(".add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar, .add-on .fa-calendar, .add-on .fa-clock-o").parent()):false;this.componentReset=this.element.is(".date")?(this.bootcssVer===3?this.element.find(".input-group-addon .glyphicon-remove, .input-group-addon .fa-times").parent():this.element.find(".add-on .icon-remove, .add-on .fa-times").parent()):false;this.hasInput=this.component&&this.element.find("input").length;if(this.component&&this.component.length===0){this.component=false}this.linkField=j.linkField||this.element.data("link-field")||false;this.linkFormat=c.parseFormat(j.linkFormat||this.element.data("link-format")||c.getDefaultFormat(this.formatType,"link"),this.formatType);this.minuteStep=j.minuteStep||this.element.data("minute-step")||5;this.pickerPosition=j.pickerPosition||this.element.data("picker-position")||"bottom-right";this.showMeridian=j.showMeridian||this.element.data("show-meridian")||false;this.initialDate=j.initialDate||new Date();this.zIndex=j.zIndex||this.element.data("z-index")||f;this.title=typeof j.title==="undefined"?false:j.title;this.timezone=j.timezone||a();this.icons={leftArrow:this.fontAwesome?"fa-arrow-left":(this.bootcssVer===3?"glyphicon-arrow-left":"icon-arrow-left"),rightArrow:this.fontAwesome?"fa-arrow-right":(this.bootcssVer===3?"glyphicon-arrow-right":"icon-arrow-right")};this.icontype=this.fontAwesome?"fa":"glyphicon";this._attachEvents();this.clickedOutside=function(n){if(d(n.target).closest(".datetimepicker").length===0){m.hide()}};this.formatViewType="datetime";if("formatViewType" in j){this.formatViewType=j.formatViewType}else{if("formatViewType" in this.element.data()){this.formatViewType=this.element.data("formatViewType")}}this.minView=0;if("minView" in j){this.minView=j.minView}else{if("minView" in this.element.data()){this.minView=this.element.data("min-view")}}this.minView=c.convertViewMode(this.minView);this.maxView=c.modes.length-1;if("maxView" in j){this.maxView=j.maxView}else{if("maxView" in this.element.data()){this.maxView=this.element.data("max-view")}}this.maxView=c.convertViewMode(this.maxView);this.wheelViewModeNavigation=false;if("wheelViewModeNavigation" in j){this.wheelViewModeNavigation=j.wheelViewModeNavigation}else{if("wheelViewModeNavigation" in this.element.data()){this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")}}this.wheelViewModeNavigationInverseDirection=false;if("wheelViewModeNavigationInverseDirection" in j){this.wheelViewModeNavigationInverseDirection=j.wheelViewModeNavigationInverseDirection}else{if("wheelViewModeNavigationInverseDirection" in this.element.data()){this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")}}this.wheelViewModeNavigationDelay=100;if("wheelViewModeNavigationDelay" in j){this.wheelViewModeNavigationDelay=j.wheelViewModeNavigationDelay}else{if("wheelViewModeNavigationDelay" in this.element.data()){this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")}}this.startViewMode=2;if("startView" in j){this.startViewMode=j.startView}else{if("startView" in this.element.data()){this.startViewMode=this.element.data("start-view")}}this.startViewMode=c.convertViewMode(this.startViewMode);this.viewMode=this.startViewMode;this.viewSelect=this.minView;if("viewSelect" in j){this.viewSelect=j.viewSelect}else{if("viewSelect" in this.element.data()){this.viewSelect=this.element.data("view-select")}}this.viewSelect=c.convertViewMode(this.viewSelect);this.forceParse=true;if("forceParse" in j){this.forceParse=j.forceParse}else{if("dateForceParse" in this.element.data()){this.forceParse=this.element.data("date-force-parse")}}var l=this.bootcssVer===3?c.templateV3:c.template;while(l.indexOf("{iconType}")!==-1){l=l.replace("{iconType}",this.icontype)}while(l.indexOf("{leftArrow}")!==-1){l=l.replace("{leftArrow}",this.icons.leftArrow)}while(l.indexOf("{rightArrow}")!==-1){l=l.replace("{rightArrow}",this.icons.rightArrow)}this.picker=d(l).appendTo(this.isInline?this.element:this.container).on({click:d.proxy(this.click,this),mousedown:d.proxy(this.mousedown,this)});if(this.wheelViewModeNavigation){if(d.fn.mousewheel){this.picker.on({mousewheel:d.proxy(this.mousewheel,this)})}else{console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")}}if(this.isInline){this.picker.addClass("datetimepicker-inline")}else{this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu")}if(this.isRTL){this.picker.addClass("datetimepicker-rtl");var i=this.bootcssVer===3?".prev span, .next span":".prev i, .next i";this.picker.find(i).toggleClass(this.icons.leftArrow+" "+this.icons.rightArrow)}d(document).on("mousedown touchend",this.clickedOutside);this.autoclose=false;if("autoclose" in j){this.autoclose=j.autoclose}else{if("dateAutoclose" in this.element.data()){this.autoclose=this.element.data("date-autoclose")}}this.keyboardNavigation=true;if("keyboardNavigation" in j){this.keyboardNavigation=j.keyboardNavigation}else{if("dateKeyboardNavigation" in this.element.data()){this.keyboardNavigation=this.element.data("date-keyboard-navigation")}}this.todayBtn=(j.todayBtn||this.element.data("date-today-btn")||false);this.clearBtn=(j.clearBtn||this.element.data("date-clear-btn")||false);this.todayHighlight=(j.todayHighlight||this.element.data("date-today-highlight")||false);this.weekStart=0;if(typeof j.weekStart!=="undefined"){this.weekStart=j.weekStart}else{if(typeof this.element.data("date-weekstart")!=="undefined"){this.weekStart=this.element.data("date-weekstart")}else{if(typeof e[this.language].weekStart!=="undefined"){this.weekStart=e[this.language].weekStart}}}this.weekStart=this.weekStart%7;this.weekEnd=((this.weekStart+6)%7);this.onRenderDay=function(n){var p=(j.onRenderDay||function(){return[]})(n);if(typeof p==="string"){p=[p]}var o=["day"];return o.concat((p?p:[]))};this.onRenderHour=function(n){var p=(j.onRenderHour||function(){return[]})(n);var o=["hour"];if(typeof p==="string"){p=[p]}return o.concat((p?p:[]))};this.onRenderMinute=function(n){var p=(j.onRenderMinute||function(){return[]})(n);var o=["minute"];if(typeof p==="string"){p=[p]}if(n<this.startDate||n>this.endDate){o.push("disabled")}else{if(Math.floor(this.date.getUTCMinutes()/this.minuteStep)===Math.floor(n.getUTCMinutes()/this.minuteStep)){o.push("active")}}return o.concat((p?p:[]))};this.onRenderYear=function(o){var q=(j.onRenderYear||function(){return[]})(o);var p=["year"];if(typeof q==="string"){q=[q]}if(this.date.getUTCFullYear()===o.getUTCFullYear()){p.push("active")}var n=o.getUTCFullYear();var r=this.endDate.getUTCFullYear();if(o<this.startDate||n>r){p.push("disabled")}return p.concat((q?q:[]))};this.onRenderMonth=function(n){var p=(j.onRenderMonth||function(){return[]})(n);var o=["month"];if(typeof p==="string"){p=[p]}return o.concat((p?p:[]))};this.startDate=new Date(-8639968443048000);this.endDate=new Date(8639968443048000);this.datesDisabled=[];this.daysOfWeekDisabled=[];this.setStartDate(j.startDate||this.element.data("date-startdate"));this.setEndDate(j.endDate||this.element.data("date-enddate"));this.setDatesDisabled(j.datesDisabled||this.element.data("date-dates-disabled"));this.setDaysOfWeekDisabled(j.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled"));this.setMinutesDisabled(j.minutesDisabled||this.element.data("date-minute-disabled"));this.setHoursDisabled(j.hoursDisabled||this.element.data("date-hour-disabled"));this.fillDow();this.fillMonths();this.update();this.showMode();if(this.isInline){this.show()}};g.prototype={constructor:g,_events:[],_attachEvents:function(){this._detachEvents();if(this.isInput){this._events=[[this.element,{focus:d.proxy(this.show,this),keyup:d.proxy(this.update,this),keydown:d.proxy(this.keydown,this)}]]}else{if(this.component&&this.hasInput){this._events=[[this.element.find("input"),{focus:d.proxy(this.show,this),keyup:d.proxy(this.update,this),keydown:d.proxy(this.keydown,this)}],[this.component,{click:d.proxy(this.show,this)}]];if(this.componentReset){this._events.push([this.componentReset,{click:d.proxy(this.reset,this)}])}}else{if(this.element.is("div")){this.isInline=true}else{this._events=[[this.element,{click:d.proxy(this.show,this)}]]}}}for(var j=0,k,l;j<this._events.length;j++){k=this._events[j][0];l=this._events[j][1];k.on(l)}},_detachEvents:function(){for(var j=0,k,l;j<this._events.length;j++){k=this._events[j][0];l=this._events[j][1];k.off(l)}this._events=[]},show:function(i){this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();if(this.forceParse){this.update()}this.place();d(window).on("resize",d.proxy(this.place,this));if(i){i.stopPropagation();i.preventDefault()}this.isVisible=true;this.element.trigger({type:"show",date:this.date})},hide:function(){if(!this.isVisible){return}if(this.isInline){return}this.picker.hide();d(window).off("resize",this.place);this.viewMode=this.startViewMode;this.showMode();if(!this.isInput){d(document).off("mousedown",this.hide)}if(this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())){this.setValue()}this.isVisible=false;this.element.trigger({type:"hide",date:this.date})},remove:function(){this._detachEvents();d(document).off("mousedown",this.clickedOutside);this.picker.remove();delete this.picker;delete this.element.data().datetimepicker},getDate:function(){var i=this.getUTCDate();if(i===null){return null}return new Date(i.getTime()+(i.getTimezoneOffset()*60000))},getUTCDate:function(){return this.date},getInitialDate:function(){return this.initialDate},setInitialDate:function(i){this.initialDate=i},setDate:function(i){this.setUTCDate(new Date(i.getTime()-(i.getTimezoneOffset()*60000)))},setUTCDate:function(i){if(i>=this.startDate&&i<=this.endDate){this.date=i;this.setValue();this.viewDate=this.date;this.fill()}else{this.element.trigger({type:"outOfRange",date:i,startDate:this.startDate,endDate:this.endDate})}},setFormat:function(j){this.format=c.parseFormat(j,this.formatType);var i;if(this.isInput){i=this.element}else{if(this.component){i=this.element.find("input")}}if(i&&i.val()){this.setValue()}},setValue:function(){var i=this.getFormattedDate();if(!this.isInput){if(this.component){this.element.find("input").val(i)}this.element.data("date",i)}else{this.element.val(i)}if(this.linkField){d("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))}},getFormattedDate:function(i){i=i||this.format;return c.formatDate(this.date,i,this.language,this.formatType,this.timezone)},setStartDate:function(i){this.startDate=i||this.startDate;if(this.startDate.valueOf()!==8639968443048000){this.startDate=c.parseDate(this.startDate,this.format,this.language,this.formatType,this.timezone)}this.update();this.updateNavArrows()},setEndDate:function(i){this.endDate=i||this.endDate;if(this.endDate.valueOf()!==8639968443048000){this.endDate=c.parseDate(this.endDate,this.format,this.language,this.formatType,this.timezone)}this.update();this.updateNavArrows()},setDatesDisabled:function(j){this.datesDisabled=j||[];if(!d.isArray(this.datesDisabled)){this.datesDisabled=this.datesDisabled.split(/,\s*/)}var i=this;this.datesDisabled=d.map(this.datesDisabled,function(k){return c.parseDate(k,i.format,i.language,i.formatType,i.timezone).toDateString()});this.update();this.updateNavArrows()},setTitle:function(i,j){return this.picker.find(i).find("th:eq(1)").text(this.title===false?j:this.title)},setDaysOfWeekDisabled:function(i){this.daysOfWeekDisabled=i||[];if(!d.isArray(this.daysOfWeekDisabled)){this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)}this.daysOfWeekDisabled=d.map(this.daysOfWeekDisabled,function(j){return parseInt(j,10)});this.update();this.updateNavArrows()},setMinutesDisabled:function(i){this.minutesDisabled=i||[];if(!d.isArray(this.minutesDisabled)){this.minutesDisabled=this.minutesDisabled.split(/,\s*/)}this.minutesDisabled=d.map(this.minutesDisabled,function(j){return parseInt(j,10)});this.update();this.updateNavArrows()},setHoursDisabled:function(i){this.hoursDisabled=i||[];if(!d.isArray(this.hoursDisabled)){this.hoursDisabled=this.hoursDisabled.split(/,\s*/)}this.hoursDisabled=d.map(this.hoursDisabled,function(j){return parseInt(j,10)});this.update();this.updateNavArrows()},place:function(){if(this.isInline){return}if(!this.zIndex){var j=0;d("div").each(function(){var o=parseInt(d(this).css("zIndex"),10);if(o>j){j=o}});this.zIndex=j+10}var n,m,l,k;if(this.container instanceof d){k=this.container.offset()}else{k=d(this.container).offset()}if(this.component){n=this.component.offset();l=n.left;if(this.pickerPosition==="bottom-left"||this.pickerPosition==="top-left"){l+=this.component.outerWidth()-this.picker.outerWidth()}}else{n=this.element.offset();l=n.left;if(this.pickerPosition==="bottom-left"||this.pickerPosition==="top-left"){l+=this.element.outerWidth()-this.picker.outerWidth()}}var i=document.body.clientWidth||window.innerWidth;if(l+220>i){l=i-220}if(this.pickerPosition==="top-left"||this.pickerPosition==="top-right"){m=n.top-this.picker.outerHeight()}else{m=n.top+this.height}m=m-k.top;l=l-k.left;this.picker.css({top:m,left:l,zIndex:this.zIndex})},hour_minute:"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]",update:function(){var i,j=false;if(arguments&&arguments.length&&(typeof arguments[0]==="string"||arguments[0] instanceof Date)){i=arguments[0];j=true}else{i=(this.isInput?this.element.val():this.element.find("input").val())||this.element.data("date")||this.initialDate;if(typeof i==="string"){i=i.replace(/^\s+|\s+$/g,"")}}if(!i){i=new Date();j=false}if(typeof i==="string"){if(new RegExp(this.hour_minute).test(i)||new RegExp(this.hour_minute+":[0-5][0-9]").test(i)){i=this.getDate()}}this.date=c.parseDate(i,this.format,this.language,this.formatType,this.timezone);if(j){this.setValue()}if(this.date<this.startDate){this.viewDate=new Date(this.startDate)}else{if(this.date>this.endDate){this.viewDate=new Date(this.endDate)}else{this.viewDate=new Date(this.date)}}this.fill()},fillDow:function(){var i=this.weekStart,j="<tr>";while(i<this.weekStart+7){j+='<th class="dow">'+e[this.language].daysMin[(i++)%7]+"</th>"}j+="</tr>";this.picker.find(".datetimepicker-days thead").append(j)},fillMonths:function(){var l="";var m=new Date(this.viewDate);for(var k=0;k<12;k++){m.setUTCMonth(k);var j=this.onRenderMonth(m);l+='<span class="'+j.join(" ")+'">'+e[this.language].monthsShort[k]+"</span>"}this.picker.find(".datetimepicker-months td").html(l)},fill:function(){if(!this.date||!this.viewDate){return}var E=new Date(this.viewDate),t=E.getUTCFullYear(),G=E.getUTCMonth(),n=E.getUTCDate(),A=E.getUTCHours(),w=this.startDate.getUTCFullYear(),B=this.startDate.getUTCMonth(),p=this.endDate.getUTCFullYear(),x=this.endDate.getUTCMonth()+1,q=(new h(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate())).valueOf(),D=new Date();this.setTitle(".datetimepicker-days",e[this.language].months[G]+" "+t);if(this.formatViewType==="time"){var k=this.getFormattedDate();this.setTitle(".datetimepicker-hours",k);this.setTitle(".datetimepicker-minutes",k)}else{this.setTitle(".datetimepicker-hours",n+" "+e[this.language].months[G]+" "+t);this.setTitle(".datetimepicker-minutes",n+" "+e[this.language].months[G]+" "+t)}this.picker.find("tfoot th.today").text(e[this.language].today||e.en.today).toggle(this.todayBtn!==false);this.picker.find("tfoot th.clear").text(e[this.language].clear||e.en.clear).toggle(this.clearBtn!==false);this.updateNavArrows();this.fillMonths();var I=h(t,G-1,28,0,0,0,0),z=c.getDaysInMonth(I.getUTCFullYear(),I.getUTCMonth());I.setUTCDate(z);I.setUTCDate(z-(I.getUTCDay()-this.weekStart+7)%7);var j=new Date(I);j.setUTCDate(j.getUTCDate()+42);j=j.valueOf();var r=[];var F;while(I.valueOf()<j){if(I.getUTCDay()===this.weekStart){r.push("<tr>")}F=this.onRenderDay(I);if(I.getUTCFullYear()<t||(I.getUTCFullYear()===t&&I.getUTCMonth()<G)){F.push("old")}else{if(I.getUTCFullYear()>t||(I.getUTCFullYear()===t&&I.getUTCMonth()>G)){F.push("new")}}if(this.todayHighlight&&I.getUTCFullYear()===D.getFullYear()&&I.getUTCMonth()===D.getMonth()&&I.getUTCDate()===D.getDate()){F.push("today")}if(I.valueOf()===q){F.push("active")}if((I.valueOf()+86400000)<=this.startDate||I.valueOf()>this.endDate||d.inArray(I.getUTCDay(),this.daysOfWeekDisabled)!==-1||d.inArray(I.toDateString(),this.datesDisabled)!==-1){F.push("disabled")}r.push('<td class="'+F.join(" ")+'">'+I.getUTCDate()+"</td>");if(I.getUTCDay()===this.weekEnd){r.push("</tr>")}I.setUTCDate(I.getUTCDate()+1)}this.picker.find(".datetimepicker-days tbody").empty().append(r.join(""));r=[];var u="",C="",s="";var l=this.hoursDisabled||[];E=new Date(this.viewDate);for(var y=0;y<24;y++){E.setUTCHours(y);F=this.onRenderHour(E);if(l.indexOf(y)!==-1){F.push("disabled")}var v=h(t,G,n,y);if((v.valueOf()+3600000)<=this.startDate||v.valueOf()>this.endDate){F.push("disabled")}else{if(A===y){F.push("active")}}if(this.showMeridian&&e[this.language].meridiem.length===2){C=(y<12?e[this.language].meridiem[0]:e[this.language].meridiem[1]);if(C!==s){if(s!==""){r.push("</fieldset>")}r.push('<fieldset class="hour"><legend>'+C.toUpperCase()+"</legend>")}s=C;u=(y%12?y%12:12);if(y<12){F.push("hour_am")}else{F.push("hour_pm")}r.push('<span class="'+F.join(" ")+'">'+u+"</span>");if(y===23){r.push("</fieldset>")}}else{u=y+":00";r.push('<span class="'+F.join(" ")+'">'+u+"</span>")}}this.picker.find(".datetimepicker-hours td").html(r.join(""));r=[];u="";C="";s="";var m=this.minutesDisabled||[];E=new Date(this.viewDate);for(var y=0;y<60;y+=this.minuteStep){if(m.indexOf(y)!==-1){continue}E.setUTCMinutes(y);E.setUTCSeconds(0);F=this.onRenderMinute(E);if(this.showMeridian&&e[this.language].meridiem.length===2){C=(A<12?e[this.language].meridiem[0]:e[this.language].meridiem[1]);if(C!==s){if(s!==""){r.push("</fieldset>")}r.push('<fieldset class="minute"><legend>'+C.toUpperCase()+"</legend>")}s=C;u=(A%12?A%12:12);r.push('<span class="'+F.join(" ")+'">'+u+":"+(y<10?"0"+y:y)+"</span>");if(y===59){r.push("</fieldset>")}}else{u=y+":00";r.push('<span class="'+F.join(" ")+'">'+A+":"+(y<10?"0"+y:y)+"</span>")}}this.picker.find(".datetimepicker-minutes td").html(r.join(""));var J=this.date.getUTCFullYear();var o=this.setTitle(".datetimepicker-months",t).end().find(".month").removeClass("active");if(J===t){o.eq(this.date.getUTCMonth()).addClass("active")}if(t<w||t>p){o.addClass("disabled")}if(t===w){o.slice(0,B).addClass("disabled")}if(t===p){o.slice(x).addClass("disabled")}r="";t=parseInt(t/10,10)*10;var H=this.setTitle(".datetimepicker-years",t+"-"+(t+9)).end().find("td");t-=1;E=new Date(this.viewDate);for(var y=-1;y<11;y++){E.setUTCFullYear(t);F=this.onRenderYear(E);if(y===-1||y===10){F.push(b)}r+='<span class="'+F.join(" ")+'">'+t+"</span>";t+=1}H.html(r);this.place()},updateNavArrows:function(){var m=new Date(this.viewDate),k=m.getUTCFullYear(),l=m.getUTCMonth(),j=m.getUTCDate(),i=m.getUTCHours();switch(this.viewMode){case 0:if(k<=this.startDate.getUTCFullYear()&&l<=this.startDate.getUTCMonth()&&j<=this.startDate.getUTCDate()&&i<=this.startDate.getUTCHours()){this.picker.find(".prev").css({visibility:"hidden"})}else{this.picker.find(".prev").css({visibility:"visible"})}if(k>=this.endDate.getUTCFullYear()&&l>=this.endDate.getUTCMonth()&&j>=this.endDate.getUTCDate()&&i>=this.endDate.getUTCHours()){this.picker.find(".next").css({visibility:"hidden"})}else{this.picker.find(".next").css({visibility:"visible"})}break;case 1:if(k<=this.startDate.getUTCFullYear()&&l<=this.startDate.getUTCMonth()&&j<=this.startDate.getUTCDate()){this.picker.find(".prev").css({visibility:"hidden"})}else{this.picker.find(".prev").css({visibility:"visible"})}if(k>=this.endDate.getUTCFullYear()&&l>=this.endDate.getUTCMonth()&&j>=this.endDate.getUTCDate()){this.picker.find(".next").css({visibility:"hidden"})}else{this.picker.find(".next").css({visibility:"visible"})}break;case 2:if(k<=this.startDate.getUTCFullYear()&&l<=this.startDate.getUTCMonth()){this.picker.find(".prev").css({visibility:"hidden"})}else{this.picker.find(".prev").css({visibility:"visible"})}if(k>=this.endDate.getUTCFullYear()&&l>=this.endDate.getUTCMonth()){this.picker.find(".next").css({visibility:"hidden"})}else{this.picker.find(".next").css({visibility:"visible"})}break;case 3:case 4:if(k<=this.startDate.getUTCFullYear()){this.picker.find(".prev").css({visibility:"hidden"})}else{this.picker.find(".prev").css({visibility:"visible"})}if(k>=this.endDate.getUTCFullYear()){this.picker.find(".next").css({visibility:"hidden"})}else{this.picker.find(".next").css({visibility:"visible"})}break}},mousewheel:function(j){j.preventDefault();j.stopPropagation();if(this.wheelPause){return}this.wheelPause=true;var i=j.originalEvent;var l=i.wheelDelta;var k=l>0?1:(l===0)?0:-1;if(this.wheelViewModeNavigationInverseDirection){k=-k}this.showMode(k);setTimeout(d.proxy(function(){this.wheelPause=false},this),this.wheelViewModeNavigationDelay)},click:function(m){m.stopPropagation();m.preventDefault();var n=d(m.target).closest("span, td, th, legend");if(n.is("."+this.icontype)){n=d(n).parent().closest("span, td, th, legend")}if(n.length===1){if(n.is(".disabled")){this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});return}switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var i=c.modes[this.viewMode].navStep*(n[0].className==="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,i);break;case 1:this.viewDate=this.moveDate(this.viewDate,i);break;case 2:this.viewDate=this.moveMonth(this.viewDate,i);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,i);break}this.fill();this.element.trigger({type:n[0].className+":"+this.convertViewModeText(this.viewMode),date:this.viewDate,startDate:this.startDate,endDate:this.endDate});break;case"clear":this.reset();if(this.autoclose){this.hide()}break;case"today":var j=new Date();j=h(j.getFullYear(),j.getMonth(),j.getDate(),j.getHours(),j.getMinutes(),j.getSeconds(),0);if(j<this.startDate){j=this.startDate}else{if(j>this.endDate){j=this.endDate}}this.viewMode=this.startViewMode;this.showMode(0);this._setDate(j);this.fill();if(this.autoclose){this.hide()}break}break;case"span":if(!n.is(".disabled")){var p=this.viewDate.getUTCFullYear(),o=this.viewDate.getUTCMonth(),q=this.viewDate.getUTCDate(),r=this.viewDate.getUTCHours(),k=this.viewDate.getUTCMinutes(),s=this.viewDate.getUTCSeconds();if(n.is(".month")){this.viewDate.setUTCDate(1);o=n.parent().find("span").index(n);q=this.viewDate.getUTCDate();this.viewDate.setUTCMonth(o);this.element.trigger({type:"changeMonth",date:this.viewDate});if(this.viewSelect>=3){this._setDate(h(p,o,q,r,k,s,0))}}else{if(n.is(".year")){this.viewDate.setUTCDate(1);p=parseInt(n.text(),10)||0;this.viewDate.setUTCFullYear(p);this.element.trigger({type:"changeYear",date:this.viewDate});if(this.viewSelect>=4){this._setDate(h(p,o,q,r,k,s,0))}}else{if(n.is(".hour")){r=parseInt(n.text(),10)||0;if(n.hasClass("hour_am")||n.hasClass("hour_pm")){if(r===12&&n.hasClass("hour_am")){r=0}else{if(r!==12&&n.hasClass("hour_pm")){r+=12}}}this.viewDate.setUTCHours(r);this.element.trigger({type:"changeHour",date:this.viewDate});if(this.viewSelect>=1){this._setDate(h(p,o,q,r,k,s,0))}}else{if(n.is(".minute")){k=parseInt(n.text().substr(n.text().indexOf(":")+1),10)||0;this.viewDate.setUTCMinutes(k);this.element.trigger({type:"changeMinute",date:this.viewDate});if(this.viewSelect>=0){this._setDate(h(p,o,q,r,k,s,0))}}}}}if(this.viewMode!==0){var l=this.viewMode;this.showMode(-1);this.fill();if(l===this.viewMode&&this.autoclose){this.hide()}}else{this.fill();if(this.autoclose){this.hide()}}}break;case"td":if(n.is(".day")&&!n.is(".disabled")){var q=parseInt(n.text(),10)||1;var p=this.viewDate.getUTCFullYear(),o=this.viewDate.getUTCMonth(),r=this.viewDate.getUTCHours(),k=this.viewDate.getUTCMinutes(),s=this.viewDate.getUTCSeconds();if(n.is(".old")){if(o===0){o=11;p-=1}else{o-=1}}else{if(n.is(".new")){if(o===11){o=0;p+=1}else{o+=1}}}this.viewDate.setUTCFullYear(p);this.viewDate.setUTCMonth(o,q);this.element.trigger({type:"changeDay",date:this.viewDate});if(this.viewSelect>=2){this._setDate(h(p,o,q,r,k,s,0))}}var l=this.viewMode;this.showMode(-1);this.fill();if(l===this.viewMode&&this.autoclose){this.hide()}break}}},_setDate:function(i,k){if(!k||k==="date"){this.date=i}if(!k||k==="view"){this.viewDate=i}this.fill();this.setValue();var j;if(this.isInput){j=this.element}else{if(this.component){j=this.element.find("input")}}if(j){j.change()}this.element.trigger({type:"changeDate",date:this.getDate()});if(i===null){this.date=this.viewDate}},moveMinute:function(j,i){if(!i){return j}var k=new Date(j.valueOf());k.setUTCMinutes(k.getUTCMinutes()+(i*this.minuteStep));return k},moveHour:function(j,i){if(!i){return j}var k=new Date(j.valueOf());k.setUTCHours(k.getUTCHours()+i);return k},moveDate:function(j,i){if(!i){return j}var k=new Date(j.valueOf());k.setUTCDate(k.getUTCDate()+i);return k},moveMonth:function(j,k){if(!k){return j}var n=new Date(j.valueOf()),r=n.getUTCDate(),o=n.getUTCMonth(),m=Math.abs(k),q,p;k=k>0?1:-1;if(m===1){p=k===-1?function(){return n.getUTCMonth()===o}:function(){return n.getUTCMonth()!==q};q=o+k;n.setUTCMonth(q);if(q<0||q>11){q=(q+12)%12}}else{for(var l=0;l<m;l++){n=this.moveMonth(n,k)}q=n.getUTCMonth();n.setUTCDate(r);p=function(){return q!==n.getUTCMonth()}}while(p()){n.setUTCDate(--r);n.setUTCMonth(q)}return n},moveYear:function(j,i){return this.moveMonth(j,i*12)},dateWithinRange:function(i){return i>=this.startDate&&i<=this.endDate},keydown:function(o){if(this.picker.is(":not(:visible)")){if(o.keyCode===27){this.show()}return}var k=false,j,i,n;switch(o.keyCode){case 27:this.hide();o.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation){break}j=o.keyCode===37?-1:1;var m=this.viewMode;if(o.ctrlKey){m+=2}else{if(o.shiftKey){m+=1}}if(m===4){i=this.moveYear(this.date,j);n=this.moveYear(this.viewDate,j)}else{if(m===3){i=this.moveMonth(this.date,j);n=this.moveMonth(this.viewDate,j)}else{if(m===2){i=this.moveDate(this.date,j);n=this.moveDate(this.viewDate,j)}else{if(m===1){i=this.moveHour(this.date,j);n=this.moveHour(this.viewDate,j)}else{if(m===0){i=this.moveMinute(this.date,j);n=this.moveMinute(this.viewDate,j)}}}}}if(this.dateWithinRange(i)){this.date=i;this.viewDate=n;this.setValue();this.update();o.preventDefault();k=true}break;case 38:case 40:if(!this.keyboardNavigation){break}j=o.keyCode===38?-1:1;m=this.viewMode;if(o.ctrlKey){m+=2}else{if(o.shiftKey){m+=1}}if(m===4){i=this.moveYear(this.date,j);n=this.moveYear(this.viewDate,j)}else{if(m===3){i=this.moveMonth(this.date,j);n=this.moveMonth(this.viewDate,j)}else{if(m===2){i=this.moveDate(this.date,j*7);n=this.moveDate(this.viewDate,j*7)}else{if(m===1){if(this.showMeridian){i=this.moveHour(this.date,j*6);n=this.moveHour(this.viewDate,j*6)}else{i=this.moveHour(this.date,j*4);n=this.moveHour(this.viewDate,j*4)}}else{if(m===0){i=this.moveMinute(this.date,j*4);n=this.moveMinute(this.viewDate,j*4)}}}}}if(this.dateWithinRange(i)){this.date=i;this.viewDate=n;this.setValue();this.update();o.preventDefault();k=true}break;case 13:if(this.viewMode!==0){var p=this.viewMode;this.showMode(-1);this.fill();if(p===this.viewMode&&this.autoclose){this.hide()}}else{this.fill();if(this.autoclose){this.hide()}}o.preventDefault();break;case 9:this.hide();break}if(k){var l;if(this.isInput){l=this.element}else{if(this.component){l=this.element.find("input")}}if(l){l.change()}this.element.trigger({type:"changeDate",date:this.getDate()})}},showMode:function(i){if(i){var j=Math.max(0,Math.min(c.modes.length-1,this.viewMode+i));if(j>=this.minView&&j<=this.maxView){this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:j});this.viewMode=j}}this.picker.find(">div").hide().filter(".datetimepicker-"+c.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()},reset:function(){this._setDate(null,"date")},convertViewModeText:function(i){switch(i){case 4:return"decade";case 3:return"year";case 2:return"month";case 1:return"day";case 0:return"hour"}}};var b=d.fn.datetimepicker;d.fn.datetimepicker=function(k){var i=Array.apply(null,arguments);i.shift();var j;this.each(function(){var n=d(this),m=n.data("datetimepicker"),l=typeof k==="object"&&k;if(!m){n.data("datetimepicker",(m=new g(this,d.extend({},d.fn.datetimepicker.defaults,l))))}if(typeof k==="string"&&typeof m[k]==="function"){j=m[k].apply(m,i);if(j!==f){return false}}});if(j!==f){return j}else{return this}};d.fn.datetimepicker.defaults={};d.fn.datetimepicker.Constructor=g;var e=d.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today",clear:"Clear"}};var c={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(i){return(((i%4===0)&&(i%100!==0))||(i%400===0))},getDaysInMonth:function(i,j){return[31,(c.isLeapYear(i)?29:28),31,30,31,30,31,31,30,31,30,31][j]},getDefaultFormat:function(i,j){if(i==="standard"){if(j==="input"){return"yyyy-mm-dd hh:ii"}else{return"yyyy-mm-dd hh:ii:ss"}}else{if(i==="php"){if(j==="input"){return"Y-m-d H:i"}else{return"Y-m-d H:i:s"}}else{throw new Error("Invalid format type.")}}},validParts:function(i){if(i==="standard"){return/t|hh?|HH?|p|P|z|Z|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g}else{if(i==="php"){return/[dDjlNwzFmMnStyYaABgGhHis]/g}else{throw new Error("Invalid format type.")}}},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(l,j){var i=l.replace(this.validParts(j),"\0").split("\0"),k=l.match(this.validParts(j));if(!i||!i.length||!k||k.length===0){throw new Error("Invalid date format.")}return{separators:i,parts:k}},parseDate:function(A,y,v,j,r){if(A instanceof Date){var u=new Date(A.valueOf()-A.getTimezoneOffset()*60000);u.setMilliseconds(0);return u}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(A)){y=this.parseFormat("yyyy-mm-dd",j)}if(/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(A)){y=this.parseFormat("yyyy-mm-dd hh:ii",j)}if(/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(A)){y=this.parseFormat("yyyy-mm-dd hh:ii:ss",j)}if(/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(A)){var l=/([-+]\d+)([dmwy])/,q=A.match(/([-+]\d+)([dmwy])/g),t,p;A=new Date();for(var x=0;x<q.length;x++){t=l.exec(q[x]);p=parseInt(t[1]);switch(t[2]){case"d":A.setUTCDate(A.getUTCDate()+p);break;case"m":A=g.prototype.moveMonth.call(g.prototype,A,p);break;case"w":A.setUTCDate(A.getUTCDate()+p*7);break;case"y":A=g.prototype.moveYear.call(g.prototype,A,p);break}}return h(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate(),A.getUTCHours(),A.getUTCMinutes(),A.getUTCSeconds(),0)}var q=A&&A.toString().match(this.nonpunctuation)||[],A=new Date(0,0,0,0,0,0,0),m={},z=["hh","h","ii","i","ss","s","yyyy","yy","M","MM","m","mm","D","DD","d","dd","H","HH","p","P","z","Z"],o={hh:function(s,i){return s.setUTCHours(i)},h:function(s,i){return s.setUTCHours(i)},HH:function(s,i){return s.setUTCHours(i===12?0:i)},H:function(s,i){return s.setUTCHours(i===12?0:i)},ii:function(s,i){return s.setUTCMinutes(i)},i:function(s,i){return s.setUTCMinutes(i)},ss:function(s,i){return s.setUTCSeconds(i)},s:function(s,i){return s.setUTCSeconds(i)},yyyy:function(s,i){return s.setUTCFullYear(i)},yy:function(s,i){return s.setUTCFullYear(2000+i)},m:function(s,i){i-=1;while(i<0){i+=12}i%=12;s.setUTCMonth(i);while(s.getUTCMonth()!==i){if(isNaN(s.getUTCMonth())){return s}else{s.setUTCDate(s.getUTCDate()-1)}}return s},d:function(s,i){return s.setUTCDate(i)},p:function(s,i){return s.setUTCHours(i===1?s.getUTCHours()+12:s.getUTCHours())},z:function(){return r}},B,k,t;o.M=o.MM=o.mm=o.m;o.dd=o.d;o.P=o.p;o.Z=o.z;A=h(A.getFullYear(),A.getMonth(),A.getDate(),A.getHours(),A.getMinutes(),A.getSeconds());if(q.length===y.parts.length){for(var x=0,w=y.parts.length;x<w;x++){B=parseInt(q[x],10);t=y.parts[x];if(isNaN(B)){switch(t){case"MM":k=d(e[v].months).filter(function(){var i=this.slice(0,q[x].length),s=q[x].slice(0,i.length);return i===s});B=d.inArray(k[0],e[v].months)+1;break;case"M":k=d(e[v].monthsShort).filter(function(){var i=this.slice(0,q[x].length),s=q[x].slice(0,i.length);return i.toLowerCase()===s.toLowerCase()});B=d.inArray(k[0],e[v].monthsShort)+1;break;case"p":case"P":B=d.inArray(q[x].toLowerCase(),e[v].meridiem);break;case"z":case"Z":r;break}}m[t]=B}for(var x=0,n;x<z.length;x++){n=z[x];if(n in m&&!isNaN(m[n])){o[n](A,m[n])}}}return A},formatDate:function(l,q,m,p,o){if(l===null){return""}var k;if(p==="standard"){k={t:l.getTime(),yy:l.getUTCFullYear().toString().substring(2),yyyy:l.getUTCFullYear(),m:l.getUTCMonth()+1,M:e[m].monthsShort[l.getUTCMonth()],MM:e[m].months[l.getUTCMonth()],d:l.getUTCDate(),D:e[m].daysShort[l.getUTCDay()],DD:e[m].days[l.getUTCDay()],p:(e[m].meridiem.length===2?e[m].meridiem[l.getUTCHours()<12?0:1]:""),h:l.getUTCHours(),i:l.getUTCMinutes(),s:l.getUTCSeconds(),z:o};if(e[m].meridiem.length===2){k.H=(k.h%12===0?12:k.h%12)}else{k.H=k.h}k.HH=(k.H<10?"0":"")+k.H;k.P=k.p.toUpperCase();k.Z=k.z;k.hh=(k.h<10?"0":"")+k.h;k.ii=(k.i<10?"0":"")+k.i;k.ss=(k.s<10?"0":"")+k.s;k.dd=(k.d<10?"0":"")+k.d;k.mm=(k.m<10?"0":"")+k.m}else{if(p==="php"){k={y:l.getUTCFullYear().toString().substring(2),Y:l.getUTCFullYear(),F:e[m].months[l.getUTCMonth()],M:e[m].monthsShort[l.getUTCMonth()],n:l.getUTCMonth()+1,t:c.getDaysInMonth(l.getUTCFullYear(),l.getUTCMonth()),j:l.getUTCDate(),l:e[m].days[l.getUTCDay()],D:e[m].daysShort[l.getUTCDay()],w:l.getUTCDay(),N:(l.getUTCDay()===0?7:l.getUTCDay()),S:(l.getUTCDate()%10<=e[m].suffix.length?e[m].suffix[l.getUTCDate()%10-1]:""),a:(e[m].meridiem.length===2?e[m].meridiem[l.getUTCHours()<12?0:1]:""),g:(l.getUTCHours()%12===0?12:l.getUTCHours()%12),G:l.getUTCHours(),i:l.getUTCMinutes(),s:l.getUTCSeconds()};k.m=(k.n<10?"0":"")+k.n;k.d=(k.j<10?"0":"")+k.j;k.A=k.a.toString().toUpperCase();k.h=(k.g<10?"0":"")+k.g;k.H=(k.G<10?"0":"")+k.G;k.i=(k.i<10?"0":"")+k.i;k.s=(k.s<10?"0":"")+k.s}else{throw new Error("Invalid format type.")}}var l=[],r=d.extend([],q.separators);for(var n=0,j=q.parts.length;n<j;n++){if(r.length){l.push(r.shift())}l.push(k[q.parts[n]])}if(r.length){l.push(r.shift())}return l.join("")},convertViewMode:function(i){switch(i){case 4:case"decade":i=4;break;case 3:case"year":i=3;break;case 2:case"month":i=2;break;case 1:case"day":i=1;break;case 0:case"hour":i=0;break}return i},headTemplate:'<thead><tr><th class="prev"><i class="{iconType} {leftArrow}"/></th><th colspan="5" class="switch"></th><th class="next"><i class="{iconType} {rightArrow}"/></th></tr></thead>',headTemplateV3:'<thead><tr><th class="prev"><span class="{iconType} {leftArrow}"></span> </th><th colspan="5" class="switch"></th><th class="next"><span class="{iconType} {rightArrow}"></span> </th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};c.template='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+c.headTemplate+"<tbody></tbody>"+c.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+"</table></div></div>";c.templateV3='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+c.headTemplateV3+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+c.headTemplateV3+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+c.headTemplateV3+"<tbody></tbody>"+c.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+c.headTemplateV3+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+c.headTemplateV3+c.contTemplate+c.footTemplate+"</table></div></div>";d.fn.datetimepicker.DPGlobal=c;d.fn.datetimepicker.noConflict=function(){d.fn.datetimepicker=b;return this};d(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(j){var i=d(this);if(i.data("datetimepicker")){return}j.preventDefault();i.datetimepicker("show")});d(function(){d('[data-provide="datetimepicker-inline"]').datetimepicker()})}));
3153
3154/* End */
3155;
3156; /* Start:"a:4:{s:4:"full";s:77:"/local/templates/aspro-medc2/js/bootstrap-datetimepicker.ru.js?16569236381336";s:6:"source";s:62:"/local/templates/aspro-medc2/js/bootstrap-datetimepicker.ru.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3157/**
3158 * Russian translation for bootstrap-datetimepicker
3159 * Victor Taranenko <[email protected]>
3160 */
3161;(function($){
3162	$.fn.datetimepicker.dates['ru'] = {
3163		days: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье"],
3164		daysShort: ["Вск", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Вск"],
3165		daysMin: [BX.message('DATE_TIME_DAYS_7'), BX.message('DATE_TIME_DAYS_1'), BX.message('DATE_TIME_DAYS_2'), BX.message('DATE_TIME_DAYS_3'), BX.message('DATE_TIME_DAYS_4'), BX.message('DATE_TIME_DAYS_5'), BX.message('DATE_TIME_DAYS_6'), BX.message('DATE_TIME_DAYS_7')],
3166		months: [BX.message('DATE_TIME_MOUNTH_1'), BX.message('DATE_TIME_MOUNTH_2'), BX.message('DATE_TIME_MOUNTH_3'), BX.message('DATE_TIME_MOUNTH_4'), BX.message('DATE_TIME_MOUNTH_5'), BX.message('DATE_TIME_MOUNTH_6'), BX.message('DATE_TIME_MOUNTH_7'), BX.message('DATE_TIME_MOUNTH_8'), BX.message('DATE_TIME_MOUNTH_9'), BX.message('DATE_TIME_MOUNTH_10'), BX.message('DATE_TIME_MOUNTH_11'), BX.message('DATE_TIME_MOUNTH_12')],
3167		monthsShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"],
3168		today: BX.message('DATE_TIME_TODAY'),
3169		suffix: [],
3170		meridiem: []
3171	};
3172}(jQuery));
3173/* End */
3174;
3175; /* Start:"a:4:{s:4:"full";s:59:"/local/templates/aspro-medc2/js/general.js?1656923638107092";s:6:"source";s:42:"/local/templates/aspro-medc2/js/general.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3176getRandomInt = function(min, max){
3177	return Math.floor(Math.random() * (max - min)) + min;
3178}
3179
3180ShowOverlay = function(){
3181	$('<div class="jqmOverlay waiting"></div>').appendTo('body');
3182}
3183
3184HideOverlay = function(){
3185	$('.jqmOverlay').detach();
3186}
3187
3188CheckBodyPadding = function(){
3189	if($('body').hasClass('with_banner')){
3190		var bannerHeight = $('.banner_warning').outerHeight(true, true);
3191		$('body.with_banner').css('padding-bottom', bannerHeight);
3192	}
3193}
3194
3195$(document).on('change', '.uploader input[type=file]', function(){
3196    if(!$(this).next().length || !$(this).next().hasClass('resetfile')){
3197        $('<span class="resetfile"><svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewB
3197ox="0 0 11 11"><path d="M1345.19,376.484l4.66,4.659a0.492,0.492,0,0,1,0,.707,0.5,0.5,0,0,1-.71,0l-4.66-4.659-4.65,4.659a0.5,0.5,0,0,1-.71,0,0.492,0.492,0,0,1,0-.707l4.66-4.659-4.66-4.659a0.492,0.492,0,0,1,0-.707,0.5,0.5,0,0,1,.71,0l4.65,4.659,4.66-4.659a0.5,0.5,0,0,1,.71,0,0.492,0.492,0,0,1,0,.707Z" transform="translate(-1339 -371)"/></svg></span>').insertAfter($(this));
3198    }
3199});
3200
3201$(document).on('click', '.uploader input[type=file] + .resetfile', function(){
3202    var $input = $(this).prev();
3203    $input.val('');
3204    $.uniform.update($input);
3205    $(this).remove();
3206});
3207
3208CheckTopMenuDotted = function(){
3209	if(window.matchMedia('(max-width:991px)').matches)
3210		return;
3211
3212	var menu = $('nav.mega-menu.sliced');
3213
3214	if(menu.length)
3215	{
3216		menu.each(function(){
3217			var menuMoreItem = $(this).find('td.js-dropdown');
3218			if($(this).parents('.collapse').css('display') == 'none'){
3219				return false;
3220			}
3221
3222			var block_w = $(this).closest('div').actual('width');
3223			var	menu_w = $(this).find('table').actual('outerWidth');
3224			var afterHide = false;
3225
3226			while(menu_w > block_w) {
3227				menuItemOldSave = $(this).find('td').not('.nosave').last();
3228				if(menuItemOldSave.length){
3229					menuMoreItem.show();
3230					menuItemNewSave = '<li class="' + (menuItemOldSave.hasClass('dropdown') ? 'dropdown-submenu ' : '') + (menuItemOldSave.hasClass('active') ? 'active ' : '') + '" data-hidewidth="' + menu_w + '">' + menuItemOldSave.find('.wrap').html() + '</li>';
3231					menuItemOldSave.remove();
3232					menuMoreItem.find('> .wrap > .dropdown-menu').prepend(menuItemNewSave);
3233					menu_w = $(this).find('table').actual('width');
3234					afterHide = true;
3235				}
3236				else{
3237					break;
3238				}
3239			}
3240
3241			if(!afterHide) {
3242				do {
3243					var menuItemOldSaveCnt = menuMoreItem.find('.dropdown-menu').find('li').length;
3244					menuItemOldSave = menuMoreItem.find('.dropdown-menu').find('li').first();
3245					if(!menuItemOldSave.length) {
3246						menuMoreItem.hide();
3247						break;
3248					}
3249					else {
3250						var hideWidth = menuItemOldSave.attr('data-hidewidth');
3251						if(hideWidth > block_w) {
3252							break
3253						}
3254						else {
3255							menuItemNewSave = '<td class="' + (menuItemOldSave.hasClass('dropdown-submenu') ? 'dropdown ' : '') + (menuItemOldSave.hasClass('active') ? 'active ' : '') + '" data-hidewidth="' + block_w + '"><div class="wrap">' + menuItemOldSave.html() + '</div></td>';
3256							menuItemOldSave.remove();
3257							$(menuItemNewSave).insertBefore($(this).find('td.js-dropdown'));
3258							if(!menuItemOldSaveCnt) {
3259								menuMoreItem.hide();
3260								break;
3261							}
3262						}
3263					}
3264					menu_w = $(this).find('table').actual('width');
3265				}
3266				while(menu_w <= block_w);
3267			}
3268			$(this).find('td').css('visibility', 'visible');
3269			$(this).find('td').removeClass('unvisible');
3270			$(this).css('overflow', 'visible');
3271
3272			markerNav();
3273		}).promise().done(function(){
3274			$('.menu-row.bgcolored .mega-menu .table-menu').css('overflow', 'visible');
3275		});
3276	}
3277	return false;
3278}
3279
3280CheckTopVisibleMenu = function(that) {
3281	var dropdownMenu = $('.dropdown-menu:visible').last();
3282
3283	if(dropdownMenu.length){
3284		dropdownMenu.find('a').css('white-space', '');
3285		dropdownMenu.css('left', '');
3286		dropdownMenu.css('right', '');
3287		dropdownMenu.removeClass('toright');
3288
3289		var dropdownMenu_left = dropdownMenu.offset().left;
3290		if(typeof(dropdownMenu_left) != 'undefined'){
3291			var menu = dropdownMenu.parents('.mega-menu');
3292			if(!menu.length)
3293				menu = dropdownMenu.closest('.logo-row');
3294			var menu_width = menu.outerWidth();
3295			var menu_left = menu.offset().left;
3296			var menu_right = menu_left + menu_width;
3297			var isToRight = dropdownMenu.parents('.toright').length > 0;
3298			var parentsDropdownMenus = dropdownMenu.parents('.dropdown-menu');
3299			var isHasParentDropdownMenu = parentsDropdownMenus.length > 0;
3300			if(isHasParentDropdownMenu){
3301				var parentDropdownMenu_width = parentsDropdownMenus.first().outerWidth();
3302				var parentDropdownMenu_left = parentsDropdownMenus.first().offset().left;
3303				var parentDropdownMenu_right = parentDropdownMenu_width + parentDropdownMenu_left;
3304			}
3305
3306			if(parentDropdownMenu_right + dropdownMenu.outerWidth() > menu_right){
3307				dropdownMenu.find('a').css('white-space', 'normal');
3308			}
3309
3310			var dropdownMenu_width = dropdownMenu.outerWidth();
3311			var dropdownMenu_right = dropdownMenu_left + dropdownMenu_width;
3312
3313			if(dropdownMenu_right > menu_right || isToRight){
3314				var addleft = 0;
3315				addleft = menu_right - dropdownMenu_right;
3316				if(isHasParentDropdownMenu || isToRight){
3317					dropdownMenu.css('left', 'auto');
3318					dropdownMenu.css('right', '100%');
3319					dropdownMenu.addClass('toright');
3320				}
3321				else{
3322					var dropdownMenu_curLeft = parseInt(dropdownMenu.css('left'));
3323					dropdownMenu.css('left', (dropdownMenu_curLeft + addleft) + 'px');
3324				}
3325			}
3326		}
3327	}
3328}
3329
3330InitTopestMenuGummi = function(){
3331	//if(!isOnceInited){
3332		function _init(){
3333			var arItems = $menuTopest.find('>div:not(.more)');
3334			var cntItems = arItems.length;
3335			if(cntItems){
3336				var itemsWidth = 0;
3337				for(var i = 0; i < cntItems; ++i){
3338					var item = arItems.eq(i);
3339					var itemWidth = item.actual('outerWidth',{includeMargin: true});
3340					arItemsHideWidth[i] = (itemsWidth += itemWidth) + (i !== (cntItems - 1) ? moreWidth : 0);
3341				}
3342			}
3343		}
3344
3345		function _gummi(){
3346			var rowWidth = $menuTopest.actual('innerWidth');
3347			var arItems = $menuTopest.find('>div:not(.more),.more>.dropdown>.wrap>div');
3348			var cntItems = arItems.length;
3349			if(cntItems){
3350				var bMore = false;
3351				for(var i = cntItems - 1; i >= 0; --i){
3352					var item = arItems.eq(i);
3353					var bInMore = item.parents('.more').length > 0;
3354					if(!bInMore){
3355						if(arItemsHideWidth[i] > rowWidth){
3356							if(!bMore){
3357								bMore = true;
3358								more.removeClass('hidden');
3359							}
3360							var clone = item.clone();
3361							clone.prependTo(moreDropdown);
3362							item.addClass('cloned');
3363						}
3364					}
3365				}
3366				for(var i = 0; i < cntItems; ++i){
3367					var item = arItems.eq(i);
3368					var bInMore = item.parents('.more').length > 0;
3369					if(bInMore){
3370						if(arItemsHideWidth[i] <= rowWidth){
3371							if(i === (cntItems - 1)){
3372								bMore = false;
3373								more.addClass('hidden');
3374							}
3375							var clone = item.clone();
3376							clone.find('>a').removeClass('dark_font');
3377							clone.insertBefore(more);
3378							item.addClass('cloned');
3379						}
3380					}
3381				}
3382				$menuTopest.find('div.cloned').remove();
3383			}
3384		}
3385
3386		var $menuTopest = $('.menu.topest');
3387		var more = $menuTopest.find('>.more');
3388		var moreDropdown = more.find('>.dropdown>.wrap');
3389		var moreWidth = more.actual('outerWidth',{includeMargin: true});
3390		var arItemsHideWidth = [];
3391
3392		ignoreResize.push(true);
3393		_init();
3394		_gummi();
3395		ignoreResize.pop();
3396
3397		$(window).resize(function(){
3398			ignoreResize.push(true);
3399			_gummi();
3400			ignoreResize.pop();
3401		});
3402	//}
3403}
3404
3405MegaMenuFixed = function(){
3406	var animationTime = 150;
3407
3408	$('.burger').on('click', function(){
3409		$('.mega_fixed_menu').fadeIn(animationTime);
3410	});
3411
3412	$('.mega_fixed_menu .svg.svg-close').on('click', function(){
3413		$(this).closest('.mega_fixed_menu').fadeOut(animationTime);
3414	});
3415
3416	$('.mega_fixed_menu .dropdown-menu .arrow').on('click', function(e){
3417		e.preventDefault();
3418		e.stopPropagation();
3419		$(this).closest('.dropdown-submenu').find('.dropdown-menu').slideToggle(animationTime);
3420		$(this).closest('.dropdown-submenu').toggleClass('opened');
3421	});
3422}
3423
3424CheckPopupTop = function(){
3425	var popup = $('.jqmWindow.show');
3426	if(popup.length){
3427		var documentScollTop = $(document).scrollTop();
3428		var windowHeight = $(window).height();
3429		var popupTop = parseInt(popup.css('top'));
3430		var popupHeight = popup.height();
3431
3432		if(windowHeight >= popupHeight){
3433			// center
3434			popupTop = (windowHeight - popupHeight) / 2;
3435		}
3436		else{
3437			if(documentScollTop > documentScrollTopLast){
3438				// up
3439				popupTop -= documentScollTop - documentScrollTopLast;
3440			}
3441			else if(documentScollTop < documentScrollTopLast){
3442				// down
3443				popupTop += documentScrollTopLast - documentScollTop;
3444			}
3445
3446			if(popupTop + popupHeight < windowHeight){
3447				// bottom
3448				popupTop = windowHeight - popupHeight;
3449			}
3450			else if(popupTop > 0){
3451				// top
3452				popupTop = 0;
3453			}
3454		}
3455		popup.css('top', popupTop + 'px');
3456	}
3457}
3458
3459CheckMainBannerSliderVText = function(slider){
3460	if(slider.parents('.banners-big').length){
3461		var sh = slider.height();
3462		slider.parents('.banners-big').find('.item').each(function() {
3463			var curSlideTextInner = $(this).find('.text .inner');
3464			if(curSlideTextInner.length){
3465				var ith = curSlideTextInner.actual('height');
3466				var p = (ith >= sh ? 0 : Math.floor((sh - ith) / 2));
3467				curSlideTextInner.css('padding-top', p + 'px');
3468			}
3469		});
3470	}
3471}
3472
3473CheckStickyFooter = function() {
3474	BX.addCustomEvent('onWindowResize', function(eventdata){
3475		if(!isMobile)
3476		{
3477			try{
3478				/*var footerHeight = $('footer').outerHeight();
3479				ignoreResize.push(true);
3480				$('footer').css('margin-top', '-' + footerHeight + 'px');
3481				$('.body').css('margin-bottom', '-' + footerHeight + 'px');
3482				$('.main').css('padding-bottom', footerHeight + 0 + 'px');*/
3483				var bodyHeight = $('.body').outerHeight(true, true),
3484					footeHeight = $('footer').outerHeight(true, true),
3485					headerHeight = $('header').outerHeight(true, true),
3486					topHeaderHeight = ($('.top-block').length ? $('.top-block').outerHeight(true, true) : 0),
3487					panelHeight = ($('#panel').length ? $('#panel').outerHeight(true, true) : 0),
3488					windowHeight = $(window).height(),
3489					minBodyHeight = windowHeight - footeHeight - panelHeight - headerHeight - topHeaderHeight;
3490
3491				$('.body').css('min-height', minBodyHeight);
3492				ignoreResize.pop();
3493			}
3494			catch(e){}
3495		}
3496	});
3497}
3498
3499verticalAlign = function(class_name){
3500	if(typeof class_name == "undefined")
3501		class_name = 'auto_align';
3502    if($('.'+class_name).length)
3503    {
3504	    maxHeight = 0;
3505	    $('.'+class_name).each(function(){
3506	        if ($(this).height()> maxHeight){
3507	            maxHeight = $(this).height();
3508	        };
3509	    });
3510	    $('.'+class_name).each(function(){
3511
3512	            delta = Math.round((maxHeight - $(this).height())/2);
3513	            $(this).css({'padding-top': delta+'px', 'padding-bottom': delta+'px'});
3514	    });
3515	}
3516}
3517
3518getGridSize = function(counts, custom_counts) {
3519	var z = parseInt($('.body_media').css('top'));
3520	if(typeof(custom_counts) != 'undefined')
3521	{
3522		if(window.matchMedia('(max-width: 700px)').matches)
3523			return (counts[3] ? counts[3] : counts[2]);
3524		else if(window.matchMedia('(max-width: 767px)').matches)
3525			return counts[2];
3526		else if(window.matchMedia('(max-width: 1100px)').matches)
3527			return counts[1];
3528		else
3529			return counts[0];
3530	}
3531	else
3532	{
3533		if(window.matchMedia('(max-width: 600px)').matches)
3534		{
3535			return (counts[3] ? counts[3] : counts[2]);
3536		}
3537		else
3538			return (z == 2 ? counts[0] : z == 1 ? counts[1] : counts[2]);
3539	}
3540}
3541
3542CheckFlexSlider = function(){
3543	$('.flexslider:not(.thmb):visible').each(function(){
3544		var slider = $(this);
3545		slider.resize();
3546		var counts = slider.data('flexslider').vars.counts,
3547			slide_counts = slider.data('flexslider').vars.slide_counts;
3548		if(typeof(counts) != 'undefined'){
3549			var cnt = getGridSize(counts, slider.data('flexslider').vars.customGrid);
3550			var to0 = (cnt != slider.data('flexslider').vars.minItems || cnt != slider.data('flexslider').vars.maxItems || cnt != slider.data('flexslider').vars.move);
3551			if(to0){
3552				slider.data('flexslider').vars.minItems = cnt;
3553				slider.data('flexslider').vars.maxItems = cnt;
3554				if(typeof(slide_counts) != 'undefined')
3555					slider.data('flexslider').vars.move = slide_counts;
3556				else
3557					slider.data('flexslider').vars.move = cnt;
3558
3559				slider.flexslider(0);
3560				slider.resize();
3561				slider.resize(); // twise!
3562			}
3563		}
3564	});
3565}
3566
3567CheckHeaderFixed = function(){
3568	var header_fixed = $('#headerfixed');
3569		header = $('header').first();
3570	if(header_fixed.length){
3571		if(header.length)
3572		{
3573			var isHeaderFixed = false,
3574				headerCanFix = true,
3575				headerFixedHeight = header_fixed.actual('outerHeight'),
3576				headerNormalHeight = header.actual('outerHeight'),
3577				headerDiffHeight = headerNormalHeight - headerFixedHeight,
3578				mobileBtnMenu = $('.btn.btn-responsive-nav'),
3579				headerTop = $('#panel:visible').actual('outerHeight');
3580				topBlock = $('.TOP_HEADER').first();
3581
3582			if(headerDiffHeight <= 0)
3583				headerDiffHeight = 0;
3584			if(topBlock.length)
3585				headerTop += topBlock.actual('outerHeight');
3586
3587			$(window).scroll(function(){
3588				if(!isMobile)
3589				{
3590					var scrollTop = $(window).scrollTop();
3591					headerCanFix = !mobileBtnMenu.is(':visible')/* && !$('.dropdown-menu:visible').length*/;
3592
3593					var current_is = $('.search-wrapper .search-input:visible'),
3594						title_search_result = $('.title-search-result.'+current_is.attr('id')),
3595						pos, pos_input;
3596
3597					if(!isHeaderFixed)
3598					{
3599						if((scrollTop > headerNormalHeight + headerTop) && headerCanFix)
3600						{
3601							isHeaderFixed = true;
3602							header_fixed.css('top', '-' + headerNormalHeight + 'px');
3603							header_fixed.addClass('fixed');
3604							// header_fixed.stop(0).animate({top: '0'}, 300);
3605
3606							header_fixed.animate({top: '0'}, {duration:300, complete:
3607								function(){}
3608							});
3609							markerNav();
3610							CheckTopMenuDotted();
3611						}
3612					}
3613					else if(isHeaderFixed || !headerCanFix)
3614					{
3615						if((scrollTop <= headerDiffHeight + headerTop) || !headerCanFix)
3616						{
3617							isHeaderFixed = false;
3618							header_fixed.removeClass('fixed');
3619						}
3620					}
3621				}
3622			});
3623		}
3624	}
3625}
3626
3627CheckObjectsSizes = function() {
3628	$('.container iframe,.container object,.container video').each(function() {
3629		var height_attr = $(this).attr('height');
3630		var width_attr = $(this).attr('width');
3631		if (height_attr && width_attr) {
3632			$(this).css('height', $(this).outerWidth() * height_attr / width_attr);
3633		}
3634	});
3635}
3636
3637scrollToTop = function(){
3638	if(arMedc2Options['THEME']['SCROLLTOTOP_TYPE'] !== 'NONE'){
3639		var _isScrolling = false;
3640		// Append Button
3641		$('body').append($('<a />').addClass('scroll-to-top ' + arMedc2Options['THEME']['SCROLLTOTOP_TYPE'] + ' ' + arMedc2Options['THEME']['SCROLLTOTOP_POSITION']).attr({'href': '#', 'id': 'scrollToTop'}));
3642		$('#scrollToTop').click(function(e){
3643			e.preventDefault();
3644			$('body, html').animate({scrollTop : 0}, 500);
3645			return false;
3646		});
3647		// Show/Hide Button on Window Scroll event.
3648		$(window).scroll(function(){
3649			if(!_isScrolling) {
3650				_isScrolling = true;
3651				var bottom = 23,
3652					scrollVal = $(window).scrollTop(),
3653					windowHeight = $(window).height();
3654
3655				var footerOffset = 0;
3656				if ($('footer').get(0)) {
3657					footerOffset = $('footer').offset().top;
3658				}
3659				if(scrollVal > 150){
3660					$('#scrollToTop').stop(true, true).addClass('visible');
3661					_isScrolling = false;
3662				}
3663				else{
3664					$('#scrollToTop').stop(true, true).removeClass('visible');
3665					_isScrolling = false;
3666				}
3667				CheckScrollToTop();
3668			}
3669		});
3670	}
3671}
3672
3673CheckScrollToTop = function(){
3674	var bottom = 23,
3675		scrollVal = $(window).scrollTop(),
3676		windowHeight = $(window).height();
3677	if($('footer').length)
3678		var footerOffset = $('footer').offset().top;
3679
3680	if(scrollVal + windowHeight > footerOffset){
3681		$('#scrollToTop').css('bottom', bottom + scrollVal + windowHeight - footerOffset);
3682	}
3683	else if(parseInt($('#scrollToTop').css('bottom')) > bottom){
3684		$('#scrollToTop').css('bottom', bottom);
3685	}
3686}
3687
3688var isMobile = jQuery.browser.mobile;
3689var players = {};
3690
3691if(isMobile){
3692	document.documentElement.className += ' mobile';
3693}
3694
3695function startMainBannerSlideVideo($slide){
3696	if($('.banners-big').length)
3697	{
3698		if(typeof(CoverPlayer) === 'undefined'){
3699			CoverPlayer = function(){
3700				var $videoCover = $('.video.cover');
3701				if($videoCover.length){
3702					var bannersHeight = $('.banners-big').height()
3703					var bannersWidth = $('.banners-big').width()
3704					var windowWidth = $(window).width()
3705					var height = windowWidth * 9 / 16
3706
3707					$videoCover.each(function(i, node){
3708						node.style.height = height + 'px'
3709						node.style.marginTop = ((bannersHeight - height) / 2) + 'px'
3710					})
3711				}
3712			}
3713			$(window).resize(function() {
3714				if($('.video.cover').length){
3715					CoverPlayer();
3716				}
3717			});
3718		}
3719
3720		var slideActiveIndex = $slide.attr('data-slide_index')
3721		var $slides = $slide.closest('.items').find('.item[data-slide_index="'+ slideActiveIndex +'"]')
3722		var videoSource = $slide.attr('data-video_source')
3723
3724		if(videoSource){
3725			var videoPlayerSrc = $slide.attr('data-video_src')
3726			var videoSoundDisabled = $slide.attr('data-video_disable_sound')
3727			var bVideoSoundDisabled = videoSoundDisabled == 1
3728			var videoLoop = $slide.attr('data-video_loop')
3729			var bVideoLoop = videoLoop == 1
3730			var videoCover = $slide.attr('data-video_cover')
3731			var bVideoCover = videoCover == 1 && !isMobile
3732			var videoUnderText = $slide.attr('data-video_under_text')
3733			var bVideoUnderText = videoUnderText == 1
3734			if(videoSource === 'LINK'){
3735				var videoPlayer = $slide.attr('data-video_player')
3736				var bVideoPlayerYoutube = videoPlayer === 'YOUTUBE'
3737				var bVideoPlayerVimeo = videoPlayer === 'VIMEO'
3738
3739				if(videoPlayerSrc && !$slide.find('iframe.video').length){
3740					$slides.each(function(i, node){
3741						var $_slide = $(node);
3742						var videoID = getRandomInt(100, 1000);
3743						if(bVideoPlayerVimeo){
3744							videoPlayerSrc += '&player_id=vimeoplayer';
3745						}
3746						pauseMainBanner();
3747						$_slide.prepend('<iframe id="player_' + videoID + '" class="video' + (bVideoCover == true ? ' cover' : '') + '" src="'+ videoPlayerSrc +'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>');
3748						if(typeof(players) !== 'undefined' && players){
3749							players[videoID] = {id: 'player_' + videoID, mute: (bVideoSoundDisabled ? '1' : '0'), loop: (bVideoLoop ? '1' : '0'), cover: (bVideoCover ? '1' : '0')};
3750							if(bVideoPlayerYoutube){
3751								waitYTPlayer(150, function(){
3752								//setTimeout(function(){
3753									window[players[videoID].id] = new YT.Player(
3754										players[videoID].id, {
3755											events: {
3756												'onReady': onYoutubePlayerReady
3757											}
3758										}
3759									);
3760									if(bVideoSoundDisabled){
3761										window[players[videoID].id].addEventListener('onReady', muteYoutubePlayer);
3762									}
3763									if(bVideoLoop){
3764										window[players[videoID].id].addEventListener('onStateChange', loopYoutubePlayer);
3765									}
3766								//},150);
3767								});
3768							}
3769							else if(bVideoPlayerVimeo){
3770								var iframe = $('#'+players[videoID].id)
3771								if(iframe.length){
3772									setTimeout(function(){
3773										iframe.closest('.item').addClass('started')
3774										pauseMainBanner()
3775									},150)
3776									var player = iframe[0].childNodes
3777									// console.log(iframe, player)
3778									/*player.addEvent('play', function() {
3779										console.log('play')
3780									});*/
3781								}
3782							}
3783						}
3784					});
3785				}
3786			}
3787			if(videoPlayerSrc && !$slide.find('.video').length){
3788				$slides.each(function(i, node){
3789					var $_slide = $(node);
3790					var videoID = getRandomInt(100, 1000);
3791					$_slide.prepend('<video id="player_' + videoID + '" class="video' + (bVideoCover == true ? ' cover' : '') + '"' + (bVideoLoop == true ? ' loop ' : '') + (bVideoSoundDisabled == true ? ' muted ' : '') + ' autoplay><source src="'+ videoPlayerSrc +'" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' /><p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video</p></iframe>');
3792					if(typeof(players) !== 'undefined' && players){
3793						players[videoID] = {id: 'player_' + videoID, mute: (bVideoSoundDisabled ? '1' : '0'), loop: (bVideoLoop ? '1' : '0'), cover: (bVideoCover ? '1' : '0')};
3794						// if(bVideoCover){
3795							document.getElementById(players[videoID].id).addEventListener('play', onHtml5PlayerPlay);
3796						// }
3797					}
3798				});
3799			}
3800		}
3801	}
3802}
3803
3804function muteYoutubePlayer(e) {
3805	e.target.mute()
3806}
3807
3808function loopYoutubePlayer(e) {
3809	if(e.data === YT.PlayerState.ENDED){
3810		e.target.playVideo()
3811	}
3812}
3813
3814function onYoutubePlayerReady(e) {
3815    e.target.playVideo()
3816    var videoID = e.target.a.id.replace('player_', '')
3817    if(videoID){
3818    	var $slide = $('#player_' + videoID).closest('.item')
3819    	$slide.addClass('started')
3820    	pauseMainBanner()
3821    	//setMainBannerSlideVerticalCenter($slide)
3822		var cover = players[videoID].cover
3823		if(cover){
3824	    	CoverPlayer()
3825	    }
3826    }
3827}
3828
3829function onHtml5PlayerPlay(e){
3830    var videoID = e.target.id.replace('player_', '')
3831    if(videoID){
3832    	var $slide = $('#player_' + videoID).closest('.item')
3833    	$slide.addClass('started')
3834    	pauseMainBanner()
3835    	// setMainBannerSlideVerticalCenter($slide)
3836		var cover = players[videoID].cover
3837		if(cover){
3838	    	CoverPlayer()
3839	    }
3840    }
3841}
3842
3843function pauseMainBanner(){
3844	$('.banners-big .flexslider').flexslider('pause');
3845}
3846
3847$.fn.equalizeHeights = function( outer, classNull, minHeight ){
3848	var maxHeight = this.map( function( i, e ){
3849		var minus_height=0,
3850			calc_height=0;
3851		if(classNull!==false){
3852			minus_height=parseInt($(e).find(classNull).actual('outerHeight'));
3853		}
3854		if(minus_height)
3855			minus_height+=12;
3856
3857		$(e).css('height', '');
3858		if( outer == true ){
3859			calc_height=$(e).actual('outerHeight')-minus_height;
3860		}else{
3861			calc_height=$(e).actual('height')-minus_height;
3862		}
3863		if(minHeight!==false){
3864			if(calc_height<minHeight){
3865				calc_height+=(minHeight-calc_height);
3866			}
3867			if(window.matchMedia('(max-width: 520px)').matches){
3868				calc_height=300;
3869			}
3870			if(window.matchMedia('(max-width: 400px)').matches){
3871				calc_height=200;
3872			}
3873		}
3874		return calc_height;
3875	}).get();
3876
3877	for(var i = 0, c = maxHeight.length; i < c; ++i){
3878		if(maxHeight[i] % 2){
3879			--maxHeight[i];
3880		}
3881	}
3882
3883	return this.height( Math.max.apply( this, maxHeight ) );
3884}
3885
3886$.fn.getFloatWidth = function(){
3887	var width = 0
3888
3889	if($(this).length){
3890		var rect = $(this)[0].getBoundingClientRect()
3891		if(!(width = rect.width)){
3892			width = rect.right - rect.left
3893		}
3894	}
3895
3896	return width
3897}
3898
3899$.fn.sliceHeight = function( options ){
3900	function _slice(el){
3901		el.each(function() {
3902			$(this).css('line-height', '');
3903			$(this).css('height', '');
3904
3905		});
3906		if(typeof(options.autoslicecount) == 'undefined' || options.autoslicecount !== false){
3907			var elsw=(typeof(options.row) !== 'undefined' && options.row.length) ?  el.first().parents(options.row).getFloatWidth() : el.first().parents('.items').getFloatWidth(),
3908				elw=(typeof(options.item) !== 'undefined' && options.item.length) ? $(options.item).first().getFloatWidth() : (el.first().hasClass('item') ? el.first().getFloatWidth() : el.first().parents('.item').getFloatWidth());
3909
3910			if(!elsw){
3911				elsw = el.first().parents('.row').getFloatWidth();
3912			}
3913			if(elw && options.fixWidth)
3914				elw -= options.fixWidth;
3915
3916			if(elsw && elw){
3917				options.slice = Math.floor(elsw / elw);
3918			}
3919		}
3920		if(typeof(options.typeResize) == 'undefined' || options.typeResize == false)
3921		{
3922			if(options.slice){
3923				for(var i = 0; i < el.length; i += options.slice){
3924					$(el.slice(i, i + options.slice)).equalizeHeights(options.outer, options.classNull, options.minHeight, options.typeResize, options.typeValue);
3925				}
3926			}
3927			if(options.lineheight){
3928				var lineheightAdd = parseInt(options.lineheight);
3929				if(isNaN(lineheightAdd)){
3930					lineheightAdd = 0;
3931				}
3932				el.each(function() {
3933					$(this).css('line-height', ($(this).actual('height') + lineheightAdd) + 'px');
3934				});
3935			}
3936		}
3937	}
3938	var options = $.extend({
3939		slice: null,
3940		outer: false,
3941		lineheight: false,
3942		autoslicecount: true,
3943		classNull: false,
3944		minHeight: false,
3945		row:false,
3946		item:false,
3947		typeResize:false,
3948		typeValue:false,
3949		fixWidth:0,
3950	}, options);
3951
3952	var el = $(this);
3953	ignoreResize.push(true);
3954	_slice(el);
3955	ignoreResize.pop();
3956
3957	BX.addCustomEvent('onWindowResize', function(eventdata) {
3958		ignoreResize.push(true);
3959		_slice(el);
3960		ignoreResize.pop();
3961	});
3962}
3963
3964waitingExists = function(selector, delay, callback){
3965	if(typeof(callback) !== 'undefined' && selector.length && delay > 0){
3966		delay = parseInt(delay);
3967		delay = (delay < 0 ? 0 : delay);
3968
3969		if(!$(selector).length){
3970			setTimeout(function(){
3971				waitingExists(selector, delay, callback);
3972			}, delay);
3973		}
3974		else{
3975			callback();
3976		}
3977	}
3978}
3979
3980waitingNotExists = function(selectorExists, selectorNotExists, delay, callback){
3981	if(typeof(callback) !== 'undefined' && selectorExists.length && selectorNotExists.length && delay > 0){
3982		delay = parseInt(delay);
3983		delay = (delay < 0 ? 0 : delay);
3984
3985		setTimeout(function(){
3986			if(selectorExists.length && !$(selectorNotExists).length){
3987				callback();
3988			}
3989		}, delay);
3990	}
3991}
3992
3993function onLoadjqm(hash){
3994	var name = $(hash.t).data('name'),
3995		top = (($(window).height() > hash.w.height()) ? Math.floor(($(window).height() - hash.w.height()) / 2) : 0) + 'px';
3996
3997	if($('.popup textarea').length){
3998		$('textarea').each(function(){
3999			$(this).autoResize();
4000		});
4001	}
4002
4003	$.each($(hash.t).get(0).attributes, function(index, attr){
4004		if(/^data\-autoload\-(.+)$/.test(attr.nodeName)){
4005			var key = attr.nodeName.match(/^data\-autoload\-(.+)$/)[1];
4006			var el = ($('[name="'+key.toUpperCase()+'"]').length ? $('[name="'+key.toUpperCase()+'"]') : $('.form-group [data-sid="'+key.toUpperCase()+'"]')) ;//$('[name="'+key.toUpperCase()+'"]');
4007			//console.log(el);
4008			var ID = $(hash.t).data('autoload-'+key);
4009			el.val( $(hash.t).data('autoload-'+key) );
4010			el.closest('.form-group').addClass('input-filed');
4011
4012			if(typeof(el[0]) !== 'undefined' && typeof(el[0].tagName) !== 'undefined' && el[0].tagName == 'SELECT'){
4013				el.find('option[data-id='+ID+']').attr('selected', true);
4014				if(ID){
4015					$(el).closest('form').find('select option').each(function(){
4016						var dataID = $(this).data('id').toString(),
4017							arDataID = (dataID.indexOf(',') != -1 ? dataID.split(',') : [dataID]);
4018
4019						if(arDataID.indexOf(ID.toString()) != -1){
4020							$(this).show();
4021						}
4022						else{
4023							$(this).hide();
4024						}
4025
4026						/*if(!showSelect){
4027							$(this).closest('[data-sid]').hide();
4028						}
4029						else{
4030							$(this).closest('[data-sid]').show();
4031						}*/
4032					});
4033				}
4034				el.closest('.row[data-sid]').show();
4035			}
4036			else{
4037				el.attr('title', el.val());
4038				el.attr('readonly', 'readonly')
4039			}
4040
4041		}
4042	});
4043
4044	var eventdata = {action:'loadForm'};
4045	BX.onCustomEvent('onCompleteAction', [eventdata, $(hash.t)[0]]);
4046
4047	if($(hash.t).data('autohide')){
4048		$(hash.w).data('autohide', $(hash.t).data('autohide'));
4049	}
4050	if(name == 'order_product'){
4051		if($(hash.t).data('product')) {
4052			$('input[name="PRODUCT"]').closest('.form-group').addClass('input-filed');
4053			$('input[name="PRODUCT"]').val($(hash.t).data('product')).attr('readonly', 'readonly').attr('title', $('input[name="PRODUCT"]').val());
4054		}
4055	}
4056	if(name == 'question'){
4057		if($(hash.t).data('product')) {
4058			$('input[name="NEED_PRODUCT"]').closest('.form-group').addClass('input-filed');
4059			$('input[name="NEED_PRODUCT"]').val($(hash.t).data('product')).attr('readonly', 'readonly').attr('title', $('input[name="NEED_PRODUCT"]').val());
4060		}
4061	}
4062	hash.w.addClass('show').css({'margin-left': '-' + Math.floor(hash.w.width() / 2) + 'px', 'top': top, 'opacity': 1});
4063}
4064
4065function onHide(hash){
4066	if($(hash.w).data('autohide')){
4067		eval($(hash.w).data('autohide'));
4068	}
4069	// hash.w.css('opacity', 0).hide();
4070	hash.w.animate({'opacity': 0}, 200, function(){
4071		hash.w.hide();
4072		hash.w.empty();
4073		hash.o.remove();
4074		hash.w.removeClass('show');
4075	});
4076}
4077
4078function parseUrlQuery() {
4079	var data = {};
4080	if(location.search) {
4081		var pair = (location.search.substr(1)).split('&');
4082		for(var i = 0; i < pair.length; i ++) {
4083			var param = pair[i].split('=');
4084			data[param[0]] = param[1];
4085		}
4086	}
4087	return data;
4088}
4089
4090$.fn.jqmEx = function(){
4091	$(this).each(function(){
4092		var _this = $(this);
4093		var name = _this.data('name');
4094
4095		if(name.length){
4096			var script = arMedc2Options['SITE_DIR'] + 'ajax/form.php';
4097			var paramsStr = ''; var trigger = ''; var arTriggerAttrs = {};
4098			$.each(_this.get(0).attributes, function(index, attr){
4099				var attrName = attr.nodeName;
4100				var attrValue = _this.attr(attrName);
4101				trigger += '[' + attrName + '=\"' + attrValue + '\"]';
4102				arTriggerAttrs[attrName] = attrValue;
4103				if(/^data\-param\-(.+)$/.test(attrName)){
4104					var key = attrName.match(/^data\-param\-(.+)$/)[1];
4105					paramsStr += key + '=' + attrValue + '&';
4106				}
4107			});
4108			var triggerAttrs = JSON.stringify(arTriggerAttrs);
4109			var encTriggerAttrs = encodeURIComponent(triggerAttrs);
4110			if(name == 'auth')
4111				script += '?' + paramsStr + 'auth=Y';
4112			else
4113				script += '?' + paramsStr + 'data-trigger=' + encTriggerAttrs;
4114
4115			if(!$('.' + name + '_frame[data-trigger="' + encTriggerAttrs + '"]').length){
4116				if(_this.attr('disabled') != 'disabled'){
4117					$('body').find('.' + name + '_frame[data-trigger="' + encTriggerAttrs + '"]').remove();
4118					$('body').append('<div class="' + name + '_frame jqmWindow" style="width:560px" data-trigger="' + encTriggerAttrs + '"></div>');
4119					$('.' + name + '_frame[data-trigger="' + encTriggerAttrs + '"]').jqm({trigger: trigger, onLoad: function(hash){onLoadjqm(hash);}, onHide: function(hash){onHide(hash);}, ajax:script});
4120				}
4121			}
4122		}
4123	});
4124}
4125
4126InitFlexSlider = function() {
4127	$('.flexslider:not(.thmb):visible').each(function(){
4128		var slider = $(this);
4129		var options;
4130		var defaults = {
4131			animationLoop: false,
4132			controlNav: false,
4133			directionNav: true,
4134			animation: "slide"
4135		}
4136		var config = $.extend({}, defaults, options, slider.data('plugin-options'));
4137		if(typeof(config.counts) != 'undefined' && config.direction !== 'vertical'){
4138			var slide_counts = '';
4139			if(typeof(slider.data('plugin-options')) != 'undefined')
4140			{
4141				if('slide_counts' in slider.data('plugin-options'))
4142					slide_counts = slider.data('plugin-options').slide_counts;
4143			}
4144			config.maxItems =  getGridSize(config.counts);
4145			config.minItems = getGridSize(config.counts);
4146
4147			if(slide_counts)
4148				config.move = slide_counts;
4149			else
4150				config.move = getGridSize(config.counts);
4151
4152			config.itemWidth = 200;
4153		}
4154
4155		// custom direction nav
4156		if(typeof(config.customDirection) != 'undefined')
4157			config.customDirectionNav = $(config.customDirection);
4158
4159		config.prevText = BX.message("FANCY_PREV"),           //String: Set the text for the "previous" directionNav item
4160		config.nextText = BX.message("FANCY_NEXT"),
4161
4162		config.start = function(slider){
4163			var eventdata = {slider: slider};
4164			BX.onCustomEvent('onSliderStart', [eventdata]);
4165			BX.onCustomEvent('onSlide', [eventdata]);
4166		}
4167
4168		config.after = function(slider){
4169			var eventdata = {slider: slider};
4170			BX.onCustomEvent('onSlide', [eventdata]);
4171		}
4172
4173		config.end = function(slider){
4174			var eventdata = {slider: slider};
4175			BX.onCustomEvent('onSlideEnd', [eventdata]);
4176		}
4177
4178		config.before = function(slider){
4179			var eventdata = {slider: slider};
4180			BX.onCustomEvent('onSlideBefore', [eventdata]);
4181		}
4182
4183		slider.addClass('dark-nav');
4184		slider.flexslider(config).addClass('flexslider-init');
4185		if(config.controlNav)
4186			slider.addClass('flexslider-control-nav');
4187		if(config.directionNav)
4188			slider.addClass('flexslider-direction-nav');
4189
4190		if(config.customPagination){
4191
4192		}
4193	});
4194}
4195
4196InitFlexSliderClass = function(class_name) {
4197	//$('.flexslider:not(.thmb):not(.flexslider-init)').each(function(){
4198
4199		var slider = $(class_name);
4200		var options;
4201		var defaults = {
4202			animationLoop: false,
4203			controlNav: false,
4204			directionNav: true,
4205			animation: "slide"
4206		}
4207		var config = $.extend({}, defaults, options, slider.data('plugin-options'));
4208
4209		var slide_counts = '';
4210		if(typeof(slider.data('plugin-options')) != 'undefined')
4211		{
4212			if('slide_counts' in slider.data('plugin-options'))
4213				slide_counts = slider.data('plugin-options').slide_counts;
4214		}
4215
4216		if(typeof(config.counts) != 'undefined' && config.direction !== 'vertical'){
4217			config.maxItems =  getGridSize(config.counts);
4218			config.minItems = getGridSize(config.counts);
4219			config.move = getGridSize(config.counts);
4220
4221			config.itemWidth = 200;
4222		}
4223		if(slide_counts)
4224			config.move = slide_counts;
4225
4226		// custom direction nav
4227		if(typeof(config.customDirection) != 'undefined')
4228			config.customDirectionNav = $(config.customDirection);
4229
4230		config.prevText = BX.message("FANCY_PREV"),           //String: Set the text for the "previous" directionNav item
4231		config.nextText = BX.message("FANCY_NEXT"),
4232
4233		config.after = config.start = function(slider){
4234			var eventdata = {slider: slider};
4235			BX.onCustomEvent('onSlide', [eventdata]);
4236		}
4237
4238		config.end = function(slider){
4239			var eventdata = {slider: slider};
4240			BX.onCustomEvent('onSlideEnd', [eventdata]);
4241		}
4242
4243		slider.flexslider(config).addClass('flexslider-init');
4244		if(config.controlNav)
4245			slider.addClass('flexslider-control-nav');
4246		if(config.directionNav)
4247			slider.addClass('flexslider-direction-nav');
4248	//});
4249}
4250
4251SliceHeightBlocks = function(){
4252	$('*[data-slice="Y"]').each(function(){
4253		var slice_els = $(this).find('*[data-slice-block="Y"]');
4254		if(slice_els.length)
4255		{
4256			var slice_params = {};
4257			if(slice_els.data('slice-params'))
4258				slice_params = slice_els.data('slice-params');
4259			slice_els.sliceHeight(slice_params);
4260		}
4261	})
4262}
4263
4264createTableCompare = function(originalTable, appendDiv, cloneTable){
4265	try{
4266		if($('.tarifs .head-block:visible').length){
4267			var clone = originalTable.clone().addClass('clone');
4268			if(cloneTable.length){
4269				cloneTable.remove();
4270				appendDiv.html('');
4271				appendDiv.html(clone);
4272			}else{
4273				appendDiv.append(clone);
4274			}
4275		}
4276	}
4277	catch(e){}
4278	finally{}
4279}
4280
4281CheckHeaderFixedMenu = function(){
4282	if(arMedc2Options['THEME']['HEADER_FIXED'] == 2 && $('#headerfixed .js-nav').length && window.matchMedia('(min-width: 992px)').matches)
4283	{
4284		$('#headerfixed .js-nav').css('width','0');
4285		var all_width = 0,
4286			cont_width = $('#headerfixed .maxwidth-theme').actual('width'),
4287			padding_menu = $('#headerfixed .logo-row.v2 .menu-block').actual('outerWidth')-$('#headerfixed .logo-row.v2 .menu-block').actual('width');
4288		$('#headerfixed .logo-row.v2 > .inner-table-block').each(function(){
4289			if(!$(this).hasClass('menu-block'))
4290				all_width += $(this).actual('outerWidth');
4291		})
4292		$('#headerfixed .js-nav').width(cont_width-all_width-padding_menu);
4293	}
4294}
4295
4296CheckTopMenuPadding = function(){
4297	if($('.logo_and_menu-row .right-icons .wrap_icon').length && $('.logo_and_menu-row .menu-row').length){
4298		var menuPosition = $('.menu-row .menu-only').position().left,
4299			maxWidth = $('.logo_and_menu-row .maxwidth-theme').width() - 32,
4300			leftPadding = 0,
4301			rightPadding = 0;
4302
4303		$('.logo_and_menu-row .menu-row>div').each(function(indx){
4304			if(!$(this).hasClass('menu-only')){
4305				var elementPosition = $(this).position().left,
4306					elementWidth = $(this).outerWidth();
4307
4308				if(elementPosition > menuPosition){
4309					rightPadding += elementWidth + 1;
4310				}else{
4311					leftPadding += elementWidth + 1;
4312				}
4313			}
4314		}).promise().done(function(){
4315			$('.logo_and_menu-row .menu-only').css({'padding-left': leftPadding, 'padding-right': rightPadding});
4316		});
4317	}
4318}
4319
4320CheckTopMenuOncePadding = function(){
4321	if($('.menu-row.sliced .right-icons .wrap_icon').length){
4322		var menuPosition = $('.menu-row .menu-only').position().left,
4323			maxWidth = $('.logo_and_menu-row .maxwidth-theme').width() - 32,
4324			leftPadding = 0,
4325			rightPadding = 0;
4326
4327		$('.menu-row.sliced .maxwidth-theme>div>div').each(function(indx){
4328			if(!$(this).hasClass('menu-only')){
4329				var elementPosition = $(this).position().left,
4330					elementWidth = $(this).outerWidth();
4331
4332				if(elementPosition > menuPosition){
4333					rightPadding += elementWidth + 1;
4334				}else{
4335					leftPadding += elementWidth + 1;
4336				}
4337			}
4338		}).promise().done(function(){
4339			$('.menu-row.sliced .menu-only').css({'padding-left': leftPadding, 'padding-right': rightPadding});
4340		});
4341	}
4342}
4343
4344CheckSearchWidth = function(){
4345	if($('.logo_and_menu-row .search_wrap').length){
4346		var searchPosition = $('.logo_and_menu-row .search_wrap').position().left,
4347			maxWidth = $('.logo_and_menu-row .maxwidth-theme').width() - 32;
4348			width = 0;
4349
4350		$('.logo_and_menu-row .maxwidth-theme>div').each(function(){
4351			if(!$(this).hasClass('search_wrap')){
4352				var elementWidth = $(this).outerWidth();
4353
4354				width = (width ? width - elementWidth : maxWidth - elementWidth);
4355			}
4356		}).promise().done(function(){
4357			$('.logo_and_menu-row .search_wrap').outerWidth(width).css({'opacity': 1, 'visibility': 'visible'});
4358		});
4359	}
4360}
4361
4362waitCounter = function(idCounter, delay, callback){
4363	var obCounter = window['yaCounter' + idCounter];
4364	if(typeof obCounter == 'object')
4365	{
4366		if(typeof callback == 'function')
4367			callback();
4368
4369	}
4370	else
4371	{
4372		setTimeout(function(){
4373			waitCounter(idCounter, delay, callback);
4374		}, delay);
4375	}
4376}
4377
4378waitYTPlayer = function(delay, callback){
4379	if((typeof YT !== "undefined") && YT && YT.Player)
4380	{
4381		if(typeof callback == 'function')
4382			callback();
4383	}
4384	else
4385	{
4386		setTimeout(function(){
4387			waitYTPlayer(delay, callback);
4388		}, delay);
4389	}
4390}
4391
4392openerFunc = function(el, selectorHideBlock){
4393	var $this = el,
4394		$item = $this.closest('.item'),
4395		$hiddenBlock = (selectorHideBlock ? $item.find(selectorHideBlock) : $item.find('.hidden-block')),
4396		openText = (typeof($this.data('open_text')) !== 'undefined' ? $this.data('open_text') : ''),
4397		closeText = (typeof($this.data('close_text')) !== 'undefined' ? $this.data('close_text') : ''),
4398		btn = ($this.find('.btn').length ? $this.find('.btn') : $this);
4399
4400
4401	$hiddenBlock.slideToggle(200);
4402	$item.toggleClass('opened');
4403
4404	if(!btn.hasClass('opened')){
4405		btn.addClass('opened').removeClass('closed');
4406
4407		if(openText.length){
4408			$this.find('.text').text(openText);
4409		}
4410	}
4411	else if(btn.hasClass('opened')){
4412		btn.addClass('closed').removeClass('opened');
4413
4414		if(closeText.length){
4415			$this.find('.text').text(closeText);
4416		}
4417	}
4418}
4419
4420HoverStaffSliderItem = function(el){
4421	el.find('.item').hover(function(){
4422		var $this = $(this),
4423			$parent = $this.closest('.flex-viewport'),
4424			thisHeight = $this.find('>.wrap').height(),
4425			parentHeight = $parent.data('height'),
4426			deltaHeight = $this.data('delta_height');
4427
4428		$parent.height(parentHeight + deltaHeight);
4429		//$this.find('>.wrap').height(thisHeight + deltaHeight);
4430	}, function(){
4431		var $this = $(this),
4432			$parent = $this.closest('.flex-viewport'),
4433			thisHeight = $this.find('>.wrap').height(),
4434			parentHeight = $parent.data('height'),
4435			deltaHeight = $this.data('delta_height');
4436
4437		//$this.find('>.wrap').height(thisHeight - deltaHeight);
4438		$parent.height(parentHeight);
4439	});
4440}
4441
4442$(document).ready(function(){
4443	scrollToTop();
4444
4445	if(!jQuery.browser.safari){
4446		CheckTopMenuPadding();
4447		CheckTopMenuOncePadding();
4448		CheckTopMenuDotted();
4449		CheckHeaderFixed();
4450		setTimeout(function() {$(window).resize();}, 150); // need to check resize flexslider & menu
4451		setTimeout(function() {$(window).scroll();}, 250); // need to check position fixed ask block
4452	}
4453	else{
4454		setTimeout(function(){
4455			$(window).resize(); // need to check resize flexslider & menu
4456			setTimeout(function(){
4457				CheckTopMenuPadding();
4458				CheckTopMenuOncePadding();
4459				CheckTopMenuDotted();
4460				CheckHeaderFixed();
4461
4462				setTimeout(function(){
4463					$(window).scroll();
4464				}, 50);
4465			}, 50);
4466		}, 350);
4467	}
4468	CheckStickyFooter();
4469	MegaMenuFixed();
4470	CheckSearchWidth();
4471	InitTopestMenuGummi();
4472
4473	// $(window).scroll();
4474
4475	$('.accordion .item .accordion-head').on('click', function(){
4476		$(this).find('.arrow-open').toggleClass('open');
4477	});
4478
4479	if(arMedc2Options['THEME']['USE_DEBUG_GOALS'] === 'Y'){
4480		$.cookie('_ym_debug', '1');
4481	}
4482	else{
4483		$.cookie('_ym_debug', null);
4484	}
4485
4486	if($('textarea').length){
4487		$('textarea').each(function(){
4488			$(this).autoResize();
4489		});
4490	}
4491
4492	$(document).on("click",'*[data-trigger=opener]',function(e) {
4493		e.preventDefault();
4494		if(!$(e.target).hasClass('record')){
4495			openerFunc($(this));
4496		}
4497	});
4498
4499	if($('.banners-content').length){
4500		$('.logo_and_menu-row .logo-row, .eye_version_black_color .menu-row:not(.bgcolored) .menu-only, .eye_version_black_color .menu-row.bgcolored .menu-only').css('border', 'none');
4501	}
4502
4503	/*  --- Bind mobile menu  --- */
4504	var $mobileMenu = $("#mobilemenu")
4505	if($mobileMenu.length){
4506		$mobileMenu.isLeftSide = $mobileMenu.hasClass('leftside')
4507		$mobileMenu.isOpen = $mobileMenu.hasClass('show')
4508		$mobileMenu.isDowndrop = $mobileMenu.find('>.scroller').hasClass('downdrop')
4509
4510		$('#mobileheader .burger').click(function(){
4511			SwipeMobileMenu()
4512		})
4513
4514		if($mobileMenu.isLeftSide){
4515			$mobileMenu.parent().append('<div id="mobilemenu-overlay"></div>')
4516			var $mobileMenuOverlay = $('#mobilemenu-overlay')
4517
4518			$mobileMenuOverlay.click(function(){
4519				if($mobileMenu.isOpen){
4520					CloseMobileMenu()
4521				}
4522			});
4523
4524			$(document).swiperight(function(e) {
4525				if(!$(e.target).closest('.flexslider').length && !$(e.target).closest('.swipeignore').length){
4526					OpenMobileMenu()
4527				}
4528			});
4529
4530			$(document).swipeleft(function(e) {
4531				if(!$(e.target).closest('.flexslider').length && !$(e.target).closest('.swipeignore').length){
4532					CloseMobileMenu()
4533				}
4534			});
4535		}
4536		else{
4537			$('#mobileheader').click(function(e){
4538				if(!$(e.target).closest('#mobilemenu').length && !$(e.target).closest('.burger').length && $mobileMenu.isOpen){
4539					CloseMobileMenu()
4540				}
4541			});
4542		}
4543
4544		$('#mobilemenu .menu a,#mobilemenu .social-icons a').click(function(e){
4545			var $this = $(this)
4546			if($this.hasClass('parent')){
4547				e.preventDefault()
4548
4549				if(!$mobileMenu.isDowndrop){
4550					$this.closest('li').addClass('expanded')
4551					MoveMobileMenuWrapNext()
4552				}
4553				else{
4554					if(!$this.closest('li').hasClass('expanded')){
4555						$this.closest('li').addClass('expanded')
4556					}
4557					else{
4558						$this.closest('li').removeClass('expanded')
4559					}
4560				}
4561			}
4562			else{
4563				if($this.closest('li').hasClass('counters')){
4564					var href = $this.attr('href')
4565					if(typeof href !== 'undefined'){
4566						window.location.href = href
4567						window.location.reload()
4568					}
4569				}
4570
4571				if(!$this.closest('.menu_back').length){
4572					CloseMobileMenu()
4573				}
4574			}
4575		})
4576
4577		$('#mobilemenu .dropdown .menu_back').click(function(e){
4578			e.preventDefault()
4579			var $this = $(this)
4580			MoveMobileMenuWrapPrev()
4581			setTimeout(function(){
4582				$this.closest('.expanded').removeClass('expanded')
4583			}, 400)
4584		})
4585
4586		OpenMobileMenu = function(){
4587			if(!$mobileMenu.isOpen){
4588				// hide styleswitcher
4589				if($('.style-switcher').hasClass('active')){
4590					$('.style-switcher .switch').trigger('click')
4591				}
4592				$('.style-switcher .switch').hide()
4593
4594				if($mobileMenu.isLeftSide){
4595					// show overlay
4596					setTimeout(function(){
4597						$mobileMenuOverlay.fadeIn('fast')
4598					}, 100)
4599				}
4600				else{
4601					// scroll body to top & set fixed
4602					$('body').scrollTop(0).css({position: 'fixed'})
4603
4604					// set menu top = bottom of header
4605					$mobileMenu.css({top: + ($('#mobileheader').height() + $('#mobileheader').offset().top) + 'px'})
4606
4607					// change burger icon
4608					$('#mobileheader .burger').addClass('c')
4609				}
4610
4611				// show menu
4612				$mobileMenu.addClass('show')
4613				$mobileMenu.isOpen = true
4614
4615				if(!$mobileMenu.isDowndrop){
4616					var $wrap = $mobileMenu.find('.wrap').first()
4617					var params =  $wrap.data('params')
4618					if(typeof params === 'undefined'){
4619						params = {
4620							depth: 0,
4621							scroll: {},
4622							height: {}
4623						}
4624					}
4625					$wrap.data('params', params)
4626				}
4627			}
4628		}
4629
4630		CloseMobileMenu = function(){
4631			if($mobileMenu.isOpen){
4632				// hide menu
4633				$mobileMenu.removeClass('show');
4634				$mobileMenu.isOpen = false;
4635				$('.mega_fixed_menu').hide();
4636
4637				// show styleswitcher
4638				$('.style-switcher .switch').show()
4639
4640				if($mobileMenu.isLeftSide){
4641					// hide overlay
4642					setTimeout(function(){
4643						$mobileMenuOverlay.fadeOut('fast')
4644					}, 100)
4645				}
4646				else{
4647					// change burger icon
4648					$('#mobileheader .burger').removeClass('c')
4649
4650					// body unset fixed
4651					$('body').css({position: ''})
4652				}
4653
4654				if(!$mobileMenu.isDowndrop){
4655					setTimeout(function(){
4656						var $scroller = $mobileMenu.find('.scroller').first()
4657						var $wrap = $mobileMenu.find('.wrap').first()
4658						var params =  $wrap.data('params')
4659						params.depth = 0
4660						$wrap.data('params', params).attr('style', '')
4661						$mobileMenu.scrollTop(0)
4662						$scroller.css('height', '')
4663					}, 400)
4664				}
4665			}
4666		}
4667
4668		SwipeMobileMenu = function(){
4669			if($mobileMenu.isOpen){
4670				CloseMobileMenu()
4671			}
4672			else{
4673				OpenMobileMenu()
4674			}
4675		}
4676
4677		function MoveMobileMenuWrapNext(){
4678			if(!$mobileMenu.isDowndrop){
4679				var $scroller = $mobileMenu.find('.scroller').first()
4680				var $wrap = $mobileMenu.find('.wrap').first()
4681				if($wrap.length){
4682					var params =  $wrap.data('params')
4683					var $dropdownNext = $mobileMenu.find('.expanded>.dropdown').eq(params.depth)
4684					if($dropdownNext.length){
4685						// save scroll position
4686						params.scroll[params.depth] = parseInt($mobileMenu.scrollTop())
4687
4688						// height while move animating
4689						params.height[params.depth + 1] = Math.max($dropdownNext.height(), (!params.depth ? $wrap.height() : $mobileMenu.find('.expanded>.dropdown').eq(params.depth - 1).height()))
4690						$scroller.css('height', params.height[params.depth + 1] + 'px')
4691
4692						// inc depth
4693						++params.depth
4694
4695						// translateX for move
4696						$wrap.css('transform', 'translateX(' + -100 * params.depth + '%)')
4697
4698						// scroll to top
4699						setTimeout(function() {
4700							$mobileMenu.animate({scrollTop : 0}, 200);
4701						}, 100)
4702
4703						// height on enimating end
4704						var h = $dropdownNext.height()
4705						setTimeout(function() {
4706							if(h){
4707								$scroller.css('height', h + 'px')
4708							}
4709							else{
4710								$scroller.css('height', '')
4711							}
4712						}, 200)
4713					}
4714
4715					$wrap.data('params', params)
4716				}
4717			}
4718		}
4719
4720		function MoveMobileMenuWrapPrev(){
4721			if(!$mobileMenu.isDowndrop){
4722				var $scroller = $mobileMenu.find('.scroller').first()
4723				var $wrap = $mobileMenu.find('.wrap').first()
4724				if($wrap.length){
4725					var params =  $wrap.data('params')
4726					if(params.depth > 0){
4727						var $dropdown = $mobileMenu.find('.expanded>.dropdown').eq(params.depth - 1)
4728						if($dropdown.length){
4729							// height while move animating
4730							$scroller.css('height', params.height[params.depth] + 'px')
4731
4732							// dec depth
4733							--params.depth
4734
4735							// translateX for move
4736							$wrap.css('transform', 'translateX(' + -100 * params.depth + '%)')
4737
4738							// restore scroll position
4739							setTimeout(function() {
4740								$mobileMenu.animate({scrollTop : params.scroll[params.depth]}, 200);
4741							}, 100)
4742
4743							// height on enimating end
4744							var h = (!params.depth ? false : $mobileMenu.find('.expanded>.dropdown').eq(params.depth - 1).height())
4745							setTimeout(function() {
4746								if(h){
4747									$scroller.css('height', h + 'px')
4748								}
4749								else{
4750									$scroller.css('height', '')
4751								}
4752							}, 200)
4753						}
4754					}
4755
4756					$wrap.data('params', params)
4757				}
4758			}
4759		}
4760	}
4761	/*  --- END Bind mobile menu  --- */
4762
4763
4764	/* change type2 menu for fixed */
4765	if($('#headerfixed .js-nav').length)
4766	{
4767		if(arMedc2Options['THEME']['HEADER_FIXED'] == 2)
4768			CheckHeaderFixedMenu();
4769
4770		setTimeout(function(){
4771			$('#headerfixed .js-nav').addClass('opacity1');
4772		},350);
4773	}
4774
4775	/* close search block */
4776	$("html, body").on('mousedown', function(e){
4777		e.stopPropagation();
4778		var search_target = $(e.target).closest('.bx_searche');
4779		if(!$(e.target).hasClass('inline-search-block') && !$(e.target).hasClass('svg') && !search_target.length)
4780		{
4781			$('.inline-search-block').removeClass('show');
4782			$('.title-search-result').hide();
4783			if(arMedc2Options['THEME']['TYPE_SEARCH'] == 'fixed')
4784				$('.jqmOverlay.search').detach();
4785		}
4786
4787		if(isMobile)
4788		{
4789			if(search_target.length)
4790				location.href = search_target.attr('href');
4791		}
4792		var class_name = $(e.target).attr('class');
4793		if(typeof(class_name) == 'undefined' || class_name.indexOf('tooltip') < 0) //tooltip link
4794			$('.tooltip-link').tooltip('hide');
4795	});
4796	$('.inline-search-block').find('*').on('mousedown', function(e){
4797		e.stopPropagation();
4798	});
4799
4800
4801	$('.filter-action').on('click', function(){
4802		$(this).toggleClass('active');
4803		$(this).find('.svg').toggleClass('white');
4804		if($('.text_before_items').length)
4805		{
4806			var top_pos = $('.filters-wrap').position();
4807			$('.bx_filter').css({'top':top_pos.top+40});
4808		}
4809		$('.bx_filter').slideToggle();
4810	})
4811
4812	waitingNotExists('#bx-composite-banner .bx-composite-btn', '#footer .col-sm-3.hidden-md.hidden-lg #bx-composite-banner .bx-composite-btn', 500, function() {
4813		$('#footer .col-sm-3.hidden-md.hidden-lg #bx-composite-banner').html($('#bx-composite-banner .bx-composite-btn').parent().html());
4814	});
4815
4816	$.extend( $.validator.messages, {
4817		required: BX.message('JS_REQUIRED'),
4818		email: BX.message('JS_FORMAT'),
4819		equalTo: BX.message('JS_PASSWORD_COPY'),
4820		minlength: BX.message('JS_PASSWORD_LENGTH'),
4821		remote: BX.message('JS_ERROR')
4822	});
4823
4824	$.validator.addMethod(
4825		'regexp', function( value, element, regexp ){
4826			var re = new RegExp( regexp );
4827			return this.optional( element ) || re.test( value );
4828		},
4829		BX.message('JS_FORMAT')
4830	);
4831
4832	$.validator.addMethod(
4833		'filesize', function( value, element, param ){
4834			return this.optional( element ) || ( element.files[0].size <= param )
4835		},
4836		BX.message('JS_FILE_SIZE')
4837	);
4838
4839	$.validator.addMethod(
4840		'date', function( value, element, param ) {
4841			var status = false;
4842			if((!value || value.length <= 0) && $(element).hasClass('required')){
4843				status = false;
4844			}
4845			else{
4846				var re = new RegExp('^([0-9]{2})(.)([0-9]{2})(.)([0-9]{4})$');
4847				var matches = re.exec(value);
4848				if(matches){
4849					var composedDate = new Date(matches[5], (matches[3] - 1), matches[1]);
4850					status = ((composedDate.getMonth() == (matches[3] - 1)) && (composedDate.getDate() == matches[1]) && (composedDate.getFullYear() == matches[5]));
4851				}
4852
4853				if(!$(element).hasClass('required') && !value){
4854					status = true;
4855				}
4856			}
4857			return status;
4858		}, BX.message('JS_DATE')
4859	);
4860
4861	$.validator.addMethod(
4862		'datetime', function( value, element, param ) {
4863			var status = false;
4864			if(!value || value.length <= 0){
4865				status = false;
4866			}
4867			else{
4868				var re = new RegExp('^([0-9]{2})(.)([0-9]{2})(.)([0-9]{4}) ([0-9]{1,2}):([0-9]{1,2})$');
4869				var matches = re.exec(value);
4870				if(matches){
4871					var composedDate = new Date(matches[5], (matches[3] - 1), matches[1], matches[6], matches[7]);
4872					status = ((composedDate.getMonth() == (matches[3] - 1)) && (composedDate.getDate() == matches[1]) && (composedDate.getFullYear() == matches[5]) && (composedDate.getHours() == matches[6]) && (composedDate.getMinutes() == matches[7]));
4873				}
4874			}
4875			return status;
4876		}, BX.message('JS_DATETIME')
4877	);
4878
4879	$.validator.addMethod(
4880		'extension', function(value, element, param){
4881			param = typeof param === 'string' ? param.replace(/,/g, '|') : 'png|jpe?g|gif';
4882			return this.optional(element) || value.match(new RegExp('.(' + param + ')$', 'i'));
4883		}, BX.message('JS_FILE_EXT')
4884	);
4885
4886	$.validator.addMethod(
4887		'captcha', function( value, element, params ){
4888			return $.validator.methods.remote.call(this, value, element,{
4889				url: arMedc2Options['SITE_DIR'] + 'ajax/check-captcha.php',
4890				type: 'post',
4891				data:{
4892					captcha_word: value,
4893					captcha_sid: function(){
4894						return $(element).closest('form').find('input[name="captcha_sid"]').val();
4895					}
4896				}
4897			});
4898		},
4899		BX.message('JS_ERROR')
4900    );
4901
4902	/*reload captcha*/
4903	$('body').on( 'click', '.refresh', function(e){
4904		e.preventDefault();
4905		$.ajax({
4906			url: arMedc2Options['SITE_DIR'] + 'ajax/captcha.php'
4907		}).done(function(text){
4908			if($('.captcha_sid').length)
4909			{
4910				$('.captcha_sid').val(text);
4911				$('.captcha_img').attr('src', '/bitrix/tools/captcha.php?captcha_sid=' + text);
4912			}
4913		});
4914	});
4915
4916	$.validator.addClassRules({
4917		'phone':{
4918			regexp: arMedc2Options['THEME']['VALIDATE_PHONE_MASK']
4919		},
4920		'confirm_password':{
4921			equalTo: 'input.password',
4922			minlength: 6
4923		},
4924		'password':{
4925			minlength: 6
4926		},
4927		'inputfile':{
4928			extension: arMedc2Options['THEME']['VALIDATE_FILE_EXT'],
4929			filesize: 5000000
4930		},
4931		'datetime':{
4932			datetime: ''
4933		},
4934		'date':{
4935			date: ''
4936		},
4937		'captcha':{
4938			captcha: ''
4939		}
4940	});
4941
4942	$.validator.setDefaults({
4943	   highlight: function( element ){
4944			$(element).parent().addClass('error');
4945		},
4946		unhighlight: function( element ){
4947			$(element).parent().removeClass('error');
4948		}
4949	});
4950
4951	InitFlexSlider();
4952
4953	// for check flexslider bug in composite mode
4954	waitingNotExists('.detail .galery #slider', '.detail .galery #slider .flex-viewport', 1000, function() {
4955		InitFlexSlider();
4956		setTimeout(function() {
4957			$(window).resize();
4958		}, 350);
4959	});
4960
4961	/*check mobile device*/
4962	if(jQuery.browser.mobile){
4963		$('.hint span').remove();
4964
4965		$(document).on('click', '*[data-event="jqm"]' , function(e){
4966			e.preventDefault();
4967			var _this = $(this);
4968			var name = _this.data('name');
4969
4970			if(name.length){
4971				var script = arMedc2Options['SITE_DIR'] + 'form/';
4972				var paramsStr = ''; var arTriggerAttrs = {};
4973				$.each(_this.get(0).attributes, function(index, attr){
4974					var attrName = attr.nodeName;
4975					var attrValue = _this.attr(attrName);
4976					arTriggerAttrs[attrName] = attrValue;
4977					if(/^data\-param\-(.+)$/.test(attrName)){
4978						var key = attrName.match(/^data\-param\-(.+)$/)[1];
4979						paramsStr += key + '=' + attrValue + '&';
4980					}
4981				});
4982
4983				var triggerAttrs = JSON.stringify(arTriggerAttrs);
4984				var encTriggerAttrs = encodeURIComponent(triggerAttrs);
4985				script += '?name=' + name + '&' + paramsStr + 'data-trigger=' + encTriggerAttrs;
4986				location.href = script;
4987			}
4988		});
4989
4990		$('.fancybox').removeClass('fancybox');
4991	}
4992	else{
4993		$(document).on('click', '*[data-event="jqm"]', function(e){
4994			e.preventDefault();
4995			e.stopPropagation();
4996			$(this).jqmEx();
4997			$(this).trigger('click');
4998
4999		});
5000	}
5001
5002	$('.animate-load').on('click', function(){
5003		$(this).parent().addClass('loadings');
5004	});
5005
5006	BX.addCustomEvent('onCompleteAction', function(eventdata, _this){
5007		try{
5008			if(eventdata.action === 'loadForm')
5009			{
5010				$(_this).parent().removeClass('loadings');
5011			}
5012			else if(eventdata.action === 'loadBasket')
5013			{
5014				var basket_link = $('.basket-link');
5015				if(basket_link.length)
5016				{
5017					basket_link.attr('title', $(_this).find('a').attr('title'));
5018					if($(_this).find('a .count').length){
5019						var count = basket_link.find('.count').length ? $(_this).find('.count').text() : $(_this).find('.count').text();
5020						basket_link.find('.prices').text($(_this).find('.icon').data('summ'));
5021						if(basket_link.find('.count').length)
5022						{
5023							basket_link.find('.count').text(count);
5024							if(count)
5025								basket_link.addClass('basket-count');
5026							else
5027								basket_link.removeClass('basket-count');
5028						}
5029						else
5030						{
5031							basket_link.find('.js-basket-block').append($(_this).find('.count'));
5032							basket_link.addClass('basket-count');
5033							CheckHeaderFixedMenu();
5034						}
5035
5036						$('#mobilemenu .menu .ready .count').text(count);
5037						if(count){
5038							$('#mobilemenu .menu .ready .count').removeClass('empted');
5039						}
5040						else{
5041							$('#mobilemenu .menu .ready .count').addClass('empted');
5042						}
5043					}
5044					else
5045					{
5046						basket_link.find('.count').remove();
5047						basket_link.removeClass('basket-count');
5048						CheckHeaderFixedMenu();
5049					}
5050				}
5051			}
5052			else if(eventdata.action === 'loadRSS')
5053			{
5054			}
5055		}
5056		catch(e){
5057			console.error(e)
5058		}
5059	})
5060
5061	BX.addCustomEvent('onCounterGoals', function(eventdata){
5062		if(arMedc2Options['THEME']['YA_GOLAS'] == 'Y' && arMedc2Options['THEME']['YA_COUNTER_ID'])
5063		{
5064			var idCounter = arMedc2Options['THEME']['YA_COUNTER_ID'];
5065			idCounter = parseInt(idCounter);
5066
5067			if(typeof eventdata != 'object')
5068				eventdata = {goal: 'undefined'};
5069
5070			if(typeof eventdata.goal != 'string')
5071				eventdata.goal = 'undefined';
5072
5073			if(idCounter)
5074			{
5075				try
5076				{
5077					waitCounter(idCounter, 50, function(){
5078						var obCounter = window['yaCounter' + idCounter];
5079						if(typeof obCounter == 'object'){
5080							obCounter.reachGoal(eventdata.goal);
5081						}
5082					});
5083				}
5084				catch(e)
5085				{
5086					console.error(e)
5087				}
5088			}
5089			else
5090			{
5091				console.info('Bad counter id!', idCounter);
5092			}
5093		}
5094	})
5095
5096	/* show print */
5097	if(arMedc2Options['THEME']['PRINT_BUTTON'] == 'Y')
5098	{
5099		setTimeout(function(){
5100			if($('.page-top .rss-block.top').length)
5101			{
5102				$('<div class="print-link"><i class="svg svg-print"></i></div>').insertAfter($('.page-top .rss'));
5103			}
5104			else if($('.page-top .rss').length)
5105			{
5106				$('<div class="print-link"><i class="svg svg-print"></i></div>').insertAfter($('.page-top .rss'));
5107			}
5108			else if($('.page-top h1').length)
5109				$('<div class="print-link"><i class="svg svg-print"></i></div>').insertBefore($('.page-top h1'));
5110			// else
5111				// $('footer .print-block').html('<div class="print-link"><i class="svg svg-print"><svg id="Print.svg" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path class="cls-1" d="M1553,287h-2v3h-8v-3h-2a2,2,0,0,1-2-2v-5a2,2,0,0,1,2-2h2v-4h8v4h2a2,2,0,0,1,2,2v5A2,2,0,0,1,1553,287Zm-8,1h4v-4h-4v4Zm4-12h-4v2h4v-2Zm4,4h-12v5h2v-3h8v3h2v-5Z" transform="translate(-1539 -274)"/></svg></i></div>');
5112		},150);
5113	}
5114
5115	$(document).on('click', '.print-link', function(){
5116		window.print();
5117	});
5118
5119	$(document).on('click', '.eye-link', function(){
5120		if($(this).hasClass('show_eye_version')){
5121			$.cookie('MEDC2_EYE_VERSION_VALUE', '', {path: arMedc2Options['SITE_DIR'], expires: 365});
5122		}
5123		else{
5124			$.cookie('MEDC2_EYE_VERSION_VALUE', 'Y', {path: arMedc2Options['SITE_DIR'], expires: 365});
5125		}
5126
5127		window.location.href = window.location.href;
5128	});
5129
5130	$('.head-block .item-link').on('click', function(){
5131		var _this = $(this);
5132		_this.siblings().removeClass('active');
5133		_this.addClass('active');
5134	});
5135
5136	$('table.table').each(function(){
5137		var _this = $(this),
5138			first_td = _this.find('thead tr th');
5139		if(!first_td.length)
5140			first_td = _this.find('thead tr td');
5141		if(first_td.length)
5142		{
5143			var j = 0;
5144			_this.find('tbody tr td').each(function(i){
5145				if(j > first_td.length-1)
5146					j = 0;
5147
5148				$('<div class="th-mobile">'+first_td[j].textContent+'</div>').appendTo($(this));
5149				j++;
5150			})
5151		}
5152	});
5153
5154	// menu marker
5155	$(document).on('mouseenter', 'table td .wrap > a', function(){
5156		/*$(this).stop(true, true);
5157		var itemParentPos = $(this).closest('td').position().left,
5158			itemPos = $(this).position().left,
5159			mainPos = itemParentPos + itemPos + parseInt($(this).css('padding-left'));
5160		$(this).closest('.mega-menu').find('.marker-nav').css('left', mainPos);
5161		$(this).closest('.mega-menu').find('.marker-nav').css('width', $(this).find('.line-wrapper').actual('outerWidth'));*/
5162	});
5163
5164	$(document).on('mouseleave', '.mega-menu', function(){
5165		markerNav();
5166	});
5167
5168	$('a.fancybox').fancybox();
5169
5170	/* flex pagination */
5171	$('.flex-viewport .item').on('mouseenter', function(){
5172		$(this).closest('.flexslider').find('.flex-control-nav').toggleClass('noz');
5173		$(this).closest('.flexslider').find('.flex-control-nav').css('z-index','0');
5174	})
5175	$('.flex-viewport .item').on('mouseleave', function(){
5176		$(this).closest('.flexslider').find('.flex-control-nav').toggleClass('noz');
5177		$(this).closest('.flexslider').find('.flex-control-nav').css('z-index','2');
5178	})
5179
5180	/* ajax more items */
5181	$(document).on('click', '.ajax_load_btn', function(){
5182		var url=$(this).closest('.bottom_nav').find('.module-pagination .flex-direction-nav .flex-next').attr('href'),
5183			th=$(this).find('.more_text_ajax');
5184		if(!th.hasClass('loading'))
5185		{
5186			th.addClass('loading');
5187
5188			$.ajax({
5189				url: url,
5190				data: {"AJAX_REQUEST": "Y"},
5191				success: function(html){
5192
5193					if($('.banners-small.front').length)
5194					{
5195						$('.banners-small .items.row').append(html);
5196						$('.bottom_nav').html($('.banners-small .items.row .bottom_nav').html());
5197						$('.banners-small .items.row .bottom_nav').remove();
5198					}
5199					else
5200					{
5201						$(html).insertBefore($('.blog .bottom_nav'));
5202						$('.bottom_nav').html($('.blog .bottom_nav:hidden').html());
5203						$('.blog .bottom_nav:hidden').remove();
5204					}
5205
5206					var eventdata = {action:'ajaxContentLoaded'};
5207					BX.onCustomEvent('onCompleteAction', [eventdata, th[0]]);
5208
5209					setTimeout(function(){
5210						$('.banners-small .item.normal-block').sliceHeight();
5211						th.removeClass('loading');
5212					}, 100);
5213				}
5214			})
5215		}
5216	});
5217
5218	$(document).on('click', '.ajax_load_btn_pagination', function(){
5219		var $this = $(this),
5220			url = $this.closest('.pagination_nav').find('.pagination .next a').attr('href');
5221
5222		if($('[detail-pagination]').length) {
5223			var wrapperId = $this.closest('.tab-pane').attr('id');
5224		}
5225
5226
5227		
5228		if(!$this.hasClass('loadings')){
5229			$this.addClass('loadings');
5230			$.ajax({
5231				url: url,
5232				data: {"AJAX_REQUEST": "Y"},
5233				success: function(html){
5234
5235					//$(html).insertBefore($('.item-views .bottom_nav'));
5236					var htmlPagination = $(html).find('.pagination_nav').html(),
5237						htmlContent = $(html).find('.items').html();
5238
5239					if($(html).find('[detail-pagination]').length) {
5240						var htmlPagination = $(html).find($(html).find('#'+wrapperId+'[detail-pagination]').data('page-module')).html();
5241						var container = $(html).find('#'+wrapperId+'[detail-pagination]').attr('detail-pagination');
5242						var htmlContent = $(html).find(container).html();
5243						$this.closest('.tabs').find(container).append(htmlContent);
5244						$this.closest('.item-views').find('.pagination_nav').html(htmlPagination);
5245					} else if($(html).find('[data-list-parent]').length) {
5246						var htmlPagination = $(html).find($(html).find('[data-list-parent]').data('page-module')).html();
5247						var contParent = $(html).find('[data-list-parent]').attr('data-list-parent');
5248						var contCihld = $(html).find('[data-list-child]').attr('data-list-child');
5249						var htmlContent = $('<div>').append($(html).find(contCihld)).html();
5250						$this.closest('.item-views').find(contParent).append(htmlContent);
5251						$this.closest('.item-views').find('.pagination_nav').html(htmlPagination);
5252					}
5253					else {
5254						$this.closest('.item-views').find('.items').append(htmlContent);
5255						$this.closest('.item-views').find('.pagination_nav').html(htmlPagination);
5256					}
5257
5258
5259
5260					var eventdata = {action:'ajaxContentLoaded'};
5261					BX.onCustomEvent('onCompleteAction', [eventdata, $(this).find('.more_text_ajax')[0]]);
5262					BX.onCustomEvent('onCompleteActionComponent', [eventdata, $(this).find('.more_text_ajax')[0]]);
5263					$this.removeClass('loadings');
5264				}
5265			});
5266		}
5267	});
5268
5269	$(document).on('click', '.front.sections .ajax_btn .btn', function(){
5270		var $this = $(this),
5271			parent = $(this).parent(),
5272			params = $this.data('params'),
5273			template = $this.data('template');
5274		console.log(template);
5275		if(!parent.hasClass('loadings')){
5276			parent.addClass('loadings');
5277
5278			$.ajax({
5279				data: {AJAX_POST: 'Y', AJAX_PARAMS: params, TEMPLATE: template},
5280				type: 'POST',
5281				url: arMedc2Options['SITE_DIR'] + 'include/mainpage/comp_sections.php',
5282				success: function(html){
5283					$('#ajax_reload_sections').html(html);
5284					$('.sections.item-views.front .item').sliceHeight();
5285				}
5286			});
5287		}
5288	});
5289
5290	/* bug fix in ff*/
5291	$('img').removeAttr('draggable');
5292
5293	$('.detail .nav-tabs>li a').on('click', function(){
5294		var $this = $(this),
5295			$parent = $this.parent(),
5296			thisIndex = $parent.index();
5297
5298			if(!$parent.hasClass('active')){
5299			$this.closest('.tabs').find('.tab-pane .title-tab-heading .btn').removeClass('opened open').addClass('closed');
5300			$this.closest('.tabs').find('.tab-pane').eq(thisIndex).find('.toggle-block').show();
5301			$this.closest('.tabs').find('.tab-content>.tab-pane').eq(thisIndex).find('.title-tab-heading .btn').removeClass('closed').addClass('opened');
5302		}
5303	});
5304
5305	$('.title-tab-heading').on('click', function(){
5306		var $this = $(this),
5307			$parent = $this.parent(),
5308			$toggleBlock = $parent.find('.toggle-block'),
5309			animationTime = 200;
5310
5311		if(!$parent.hasClass('active')){
5312			var thisIndex = $parent.index();
5313
5314			$this.closest('.tabs').find('.nav-tabs>li').removeClass('active');
5315			$this.closest('.tabs').find('.nav-tabs>li').eq(thisIndex).addClass('active');
5316			$this.closest('.tab-content').find('.toggle-block').slideUp(animationTime);
5317			$this.closest('.tab-content').find('.tab-pane').removeClass('active');
5318			$this.closest('.tab-content').find('.title-tab-heading .btn').each(function(){
5319				if($(this).hasClass('opened') || $(this).hasClass('open')){
5320					$(this).removeClass('opened open').addClass('closed');
5321				}
5322			});
5323			$this.closest('.tab-content').find('.title-tab-heading .btn').removeClass('opened open').addClass('closed');
5324			$this.find('.btn').removeClass('closed').addClass('opened');
5325			$toggleBlock.slideDown(animationTime, function(){
5326				$parent.addClass('active');
5327				var offsetTop = $this.offset().top;
5328
5329				$('html, body').animate({scrollTop: offsetTop}, 200);
5330			});
5331		}
5332		else{
5333			$this.find('.btn').removeClass('opened open').addClass('closed');
5334			$toggleBlock.slideUp(animationTime, function(){
5335				$parent.removeClass('active');
5336			});
5337		}
5338	});
5339
5340	// Responsive Menu Events
5341	var addActiveClass = false;
5342	$('#mainMenu li.dropdown > a > i, #mainMenu li.dropdown-submenu > a > i').on('click', function(e){
5343		e.preventDefault();
5344		if($(window).width() > 979) return;
5345		addActiveClass = $(this).closest('li').hasClass('resp-active');
5346		// $('#mainMenu').find('.resp-active').removeClass('resp-active');
5347		if(!addActiveClass){
5348			$(this).closest("li").addClass("resp-active");
5349		}else{
5350			$(this).closest("li").removeClass("resp-active");
5351		}
5352	});
5353
5354	/*animate increment*/
5355	$('.spincrement').counterUp({
5356		delay: 160,
5357    	time: 750,
5358	});
5359
5360	$('.bx_filter_input_container input[type=text]').numeric({allow:"."});
5361
5362	/* search sync */
5363	$(document).on('keyup', '.search-input-div input', function(e){
5364		var inputValue = $(this).val();
5365		$('.search-input-div input').val(inputValue);
5366
5367		if($(this).closest('#headerfixed').length)
5368		{
5369			if(e.keyCode == 13)
5370				$('.search form').submit();
5371		}
5372	});
5373	$(document).on('click', '.search-button-div button', function(e){
5374		if($(this).closest('#headerfixed').length)
5375			$('.search form').submit();
5376	});
5377
5378	$('.inline-search-show, .inline-search-hide').on('click', function(e){
5379		if(window.matchMedia('(min-width: 600px)').matches)
5380		{
5381			if(typeof($(this).data('type_search')) != 'undefined' && $(this).data('type_search') == 'fixed')
5382				$('.inline-search-block').addClass('fixed');
5383
5384			$('.inline-search-block').toggleClass('show');
5385
5386			if(arMedc2Options['THEME']['TYPE_SEARCH'] != 'fixed')
5387			{
5388				var height_block = 0;
5389				if(!$('header > .top-block').length)
5390				{
5391					height_block = $('.inline-search-block.fixed.show .search-wrapper').actual('outerHeight');//$(this).closest('.maxwidth-theme').actual('outerHeight');
5392					console.log(height_block);
5393					if($(this).closest('.top-block').length)
5394						height_block = $(this).closest('.top-block').actual('outerHeight');
5395					else if($(this).closest('header.header-v8').length)
5396						height_block = $(this).closest('header.header-v8').actual('outerHeight');
5397					/*$('.inline-search-block').css({
5398						'height': height_block,
5399						'line-height': height_block-4+'px',
5400						'top': -height_block
5401					})*/
5402				}
5403			}
5404
5405
5406
5407			if($('.inline-search-block').hasClass('show')){
5408				$('.inline-search-block').find('.search-input').focus();
5409			}
5410
5411			if($('.top-block').length)
5412			{
5413				if($('.inline-search-block').hasClass('show'))
5414					$('.inline-search-block').css('background', $('.top-block').css('background-color'));
5415				else
5416					$('.inline-search-block').css('background', '#fff');
5417			}
5418			if(arMedc2Options['THEME']['TYPE_SEARCH'] == 'fixed')
5419			{
5420				if($('.inline-search-block').hasClass('show'))
5421					$('<div class="jqmOverlay search"></div>').appendTo('body');
5422				else
5423					$('.jqmOverlay').detach();
5424			}
5425		}
5426		else
5427			location.href = arMedc2Options['SITE_DIR'] + 'search/';
5428	})
5429
5430	if($('.styled-block .row > div.col-md-3').length){
5431		BX.addCustomEvent('onWindowResize', function(eventdata) {
5432			try{
5433				ignoreResize.push(true);
5434				$('.styled-block .row > div.col-md-3').each(function() {
5435					$(this).css({'height': '', 'line-height': ''});
5436					var z = parseInt($('.body_media').css('top'));
5437					if(z > 0){
5438						var rowHeight = $(this).parents('.row').first().actual('outerHeight');
5439						$(this).css({'height': rowHeight + 'px', 'line-height' : rowHeight + 'px'});
5440					}
5441				});
5442			}
5443			catch(e){}
5444			finally{
5445				ignoreResize.pop();
5446			}
5447		});
5448	}
5449
5450	if($('.order-block').length){
5451		BX.addCustomEvent('onWindowResize', function(eventdata) {
5452			try{
5453				ignoreResize.push(true);
5454				$('.order-block').each(function() {
5455					var cols = $(this).find('.row > div');
5456					if(cols.length){
5457						var colFirst = cols.first();
5458						var colLast = cols.last();
5459						var colText = colFirst.find('.text');
5460						var bText = colText.length;
5461						var bOnlyText = cols.length === 1 && bText;
5462						var bPrice = colFirst.find('.price').length;
5463						var z = parseInt($('.body_media').css('top'));
5464
5465						cols.css({'height': '', 'padding-top': '', 'padding-bottom': ''});
5466						colText.css({'height': '', 'padding-top': '', 'padding-bottom': ''});
5467						if((!bPrice && z > 0) || (bPrice && z > 1)){
5468							var minHeight = 83;
5469
5470							if(!bOnlyText){
5471								var colLast_height = colLast.outerHeight();
5472								colLast_height = colLast_height >= minHeight ? colLast_height : minHeight;
5473							}
5474
5475							if(bText){
5476								var colFirst_height = colFirst.outerHeight();
5477								colFirst_height = colFirst_height >= minHeight ? colFirst_height : minHeight;
5478							}
5479
5480							var colMax_height = (bText ? (!bOnlyText ? (colLast_height >= colFirst_height ? colLast_height : colFirst_height) : colLast_height) : colFirst_height);
5481
5482							if(!bOnlyText){
5483								var textPadding = 41 + (colMax_height - colFirst.outerHeight()) / 2;
5484								colLast.find('.btns').css({'padding-top': textPadding + 'px', 'padding-bottom': textPadding + 'px', 'height': colMax_height + 'px'});
5485							}
5486							if(bText){
5487								colLast.css({'height': colMax_height + 'px'});
5488								var textPadding = 41 + (colMax_height - colText.outerHeight()) / 2;
5489								colText.css({'padding-top': textPadding + 'px', 'padding-bottom': textPadding + 'px', 'height': colMax_height + 'px'});
5490							}
5491						}
5492					}
5493				});
5494			}
5495			catch(e){}
5496			finally{
5497				ignoreResize.pop();
5498			}
5499		});
5500	}
5501
5502	if($('.equal-padding').length)
5503	{
5504		BX.addCustomEvent('onWindowResize', function(eventdata){
5505			try{
5506				ignoreResize.push(true);
5507				$('.equal-padding').each(function() {
5508					$(this).find('.text').css({'padding-top': '0px', 'padding-bottom': '0px'});
5509					var equal_block = $(this).siblings('.equals'),
5510						height = $(this).actual('outerHeight');
5511
5512					delta = Math.round((equal_block.actual('outerHeight') - height)/2);
5513					if(delta)
5514						$(this).find('.text').css({'padding-top': delta+'px', 'padding-bottom': delta+'px'});
5515				})
5516			}
5517			catch(e){}
5518			finally{
5519				ignoreResize.pop();
5520			}
5521		});
5522	}
5523
5524	$(document).on('click', '.mega-menu .dropdown-menu', function(e){
5525		e.stopPropagation()
5526	});
5527
5528	$(document).on('click', '.mega-menu .dropdown-toggle.more-items', function(e){
5529		e.preventDefault();
5530	});
5531
5532	$('.table-menu .dropdown,.table-menu .dropdown-submenu,.table-menu .dropdown-toggle').on('mouseenter', function() {
5533		CheckTopVisibleMenu();
5534	});
5535
5536	$('.mega-menu .search-item .search-icon, .menu-row #title-search .fa-close').on('click', function(e) {
5537		e.preventDefault();
5538		$('.menu-row #title-search').toggleClass('hide');
5539	});
5540
5541	$('.mega-menu ul.nav .search input').on('keyup', function(e) {
5542		var inputValue = $(this).val();
5543		$('.menu-row > .search input').val(inputValue);
5544		if(e.keyCode == 13){
5545			$('.menu-row > .search form').submit();
5546		}
5547	});
5548
5549	$('.menu-row > .search input').on('keyup', function(e) {
5550		var inputValue = $(this).val();
5551		$('.mega-menu ul.nav .search input').val(inputValue);
5552		if(e.keyCode == 13){
5553			$('.menu-row > .search form').submit();
5554		}
5555	});
5556
5557	$('.mega-menu ul.nav .search button').on('click', function(e) {
5558		e.preventDefault();
5559		var inputValue = $(this).parents('.search').find('input').val();
5560		$('.menu-and-search .search input').val(inputValue);
5561		$('.menu-row > .search form').submit();
5562	});
5563
5564	$('.filter .calendar').on('click', function() {
5565		var button = $(this).next();
5566		if(button.hasClass('calendar-icon')){
5567			button.trigger('click');
5568		}
5569	});
5570
5571	/*sliceheights*/
5572	if($('.banners-small .item.normal-block').length)
5573		$('.banners-small .item.normal-block').sliceHeight();
5574	if($('.sections .item').length)
5575		$('.sections .item').sliceHeight();
5576	if($('.teasers .item').length)
5577		$('.teasers .item').sliceHeight();
5578	if($('.wrap-portfolio-front .row.items > div').length)
5579		$('.wrap-portfolio-front .row.items > div').sliceHeight({'row': '.row.items', 'item': '.item1'});
5580
5581	SliceHeightBlocks();
5582
5583	/* toggle */
5584	var $this = this,
5585		previewParClosedHeight = 25;
5586
5587	$('section.toggle > label').prepend($('<i />').addClass('fa fa-plus'));
5588	$('section.toggle > label').prepend($('<i />').addClass('fa fa-minus'));
5589	$('section.toggle.active > p').addClass('preview-active');
5590	$('section.toggle.active > div.toggle-content').slideDown(350, function() {});
5591
5592	$('section.toggle > label').click(function(e){
5593		var parentSection = $(this).parent(),
5594			parentWrapper = $(this).parents('div.toogle'),
5595			previewPar = false,
5596			isAccordion = parentWrapper.hasClass('toogle-accordion');
5597
5598		if(isAccordion && typeof(e.originalEvent) != 'undefined') {
5599			parentWrapper.find('section.toggle.active > label').trigger('click');
5600		}
5601
5602		parentSection.toggleClass('active');
5603
5604		// Preview Paragraph
5605		if( parentSection.find('> p').get(0) ){
5606			previewPar = parentSection.find('> p');
5607			var previewParCurrentHeight = previewPar.css('height');
5608			previewPar.css('height', 'auto');
5609			var previewParAnimateHeight = previewPar.css('height');
5610			previewPar.css('height', previewParCurrentHeight);
5611		}
5612
5613		// Content
5614		var toggleContent = parentSection.find('> div.toggle-content');
5615
5616		if( parentSection.hasClass('active') ){
5617			$(previewPar).animate({
5618				height: previewParAnimateHeight
5619			}, 350, function() {
5620				$(this).addClass('preview-active');
5621			});
5622			toggleContent.slideDown(350, function() {});
5623		}
5624		else{
5625			$(previewPar).animate({
5626				height: previewParClosedHeight
5627			}, 350, function() {
5628				$(this).removeClass('preview-active');
5629			});
5630			toggleContent.slideUp(350, function() {});
5631		}
5632	});
5633
5634	/* accordion */
5635	$('.accordion-head').on('click', function(e){
5636		e.preventDefault();
5637		if(!$(this).next().hasClass('collapsing')){
5638			$(this).toggleClass('accordion-open');
5639			$(this).toggleClass('accordion-close');
5640		}
5641	});
5642
5643	/* progress bar */
5644	$('[data-appear-progress-animation]').each(function(){
5645		var $this = $(this);
5646		$this.appear(function(){
5647			var delay = ($this.attr('data-appear-animation-delay') ? $this.attr('data-appear-animation-delay') : 1);
5648			if( delay > 1 )
5649				$this.css('animation-delay', delay + 'ms');
5650			$this.addClass($this.attr('data-appear-animation'));
5651
5652			setTimeout(function(){
5653				$this.animate({
5654					width: $this.attr('data-appear-progress-animation')
5655				}, 1500, 'easeOutQuad', function() {
5656					$this.find('.progress-bar-tooltip').animate({
5657						opacity: 1
5658					}, 500, 'easeOutQuad');
5659				});
5660			}, delay);
5661		}
5661, {accX: 0, accY: -50});
5662	});
5663
5664	/* portfolio item */
5665	$('.item.animated-block').appear(function(){
5666		var $this = $(this);
5667
5668		$this.addClass($this.data('animation')).addClass('visible');
5669
5670	}, {accX: 0, accY: 150})
5671
5672	$('a[rel=tooltip]').tooltip();
5673	$('span[data-toggle=tooltip]').tooltip();
5674
5675	$('select.sort').on('change', function(){
5676		location.href = $(this).val();
5677	});
5678
5679	setTimeout(function(th){
5680		$('.catalog.group.list .item').each(function(){
5681			var th = $(this);
5682			if((tmp = th.find('.image').outerHeight() - th.find('.text_info').outerHeight()) > 0){
5683				th.find('.text_info .titles').height(th.find('.text_info .titles').outerHeight() + tmp);
5684			}
5685		})
5686	}, 50);
5687
5688	/* ajax tabs*/
5689	$('.tabs_ajax .head-block .item-link').on('click', function(){
5690		var index = $(this).index(),
5691			body_block = $(this).closest('.tabs_ajax').find('.body-block'),
5692			obQuery = parseUrlQuery(),
5693			url_post = arMedc2Options['SITE_DIR'] + 'include/mainpage/comp_catalog_ajax.php';
5694		$(this).siblings().removeClass('active');
5695		$(this).addClass('active');
5696
5697		if('clear_cache' in obQuery)
5698			url_post += '?clear_cache='+obQuery.clear_cache;
5699
5700		if(!$(this).hasClass('clicked'))
5701		{
5702			$.ajax({
5703				url: url_post,
5704				type: 'POST',
5705				data: {AJAX_POST: 'Y', AJAX_PARAMS: $(this).closest('.item-views.catalog').find('.request-data').data('value'), GLOBAL_FILTER: body_block.find('.item-block:eq('+index+')').data('filter')},
5706			}).success(function(html){
5707				body_block.find('.item-block:eq('+index+')').html(html);
5708
5709				InitFlexSliderClass(body_block.find('.item-block:eq('+index+')').find('.flexslider')); //reinit flexslider
5710
5711				body_block.css('height', body_block.find('.item-block.active').actual('outerHeight'));
5712
5713				body_block.find('.item-block').removeClass('active').removeClass('opacity1').addClass('opacity0');
5714				body_block.find('.item-block:eq('+index+')').addClass('active');
5715
5716				setTimeout(function(){
5717					body_block.css('height', 'auto');
5718
5719					//recalculate height
5720					body_block.find('.item-block:eq('+index+') .catalog.item-views.table .item .title').sliceHeight();
5721					body_block.find('.item-block:eq('+index+') .catalog.item-views.table .item .cont').sliceHeight();
5722					body_block.find('.item-block:eq('+index+') .catalog.item-views.table .item .slice_price').sliceHeight();
5723					body_block.find('.item-block:eq('+index+') .catalog.item-views.table .item').sliceHeight({classNull: '.footer-button'});
5724
5725					body_block.find('.item-block:eq('+index+')').removeClass('opacity0').addClass('opacity1');
5726				},100)
5727			});
5728		}
5729		else
5730		{
5731			body_block.find('.item-block').removeClass('active').removeClass('opacity1').addClass('opacity0');
5732			body_block.find('.item-block:eq('+index+')').addClass('active').removeClass('opacity0').addClass('opacity1');
5733		}
5734		$(this).addClass('clicked');
5735	})
5736
5737	/*item galery*/
5738	$('.thumbs .item a').on('click', function(e){
5739		e.preventDefault();
5740		$('.thumbs .item').removeClass('current');
5741		$(this).closest('.item').toggleClass('current');
5742		$('.slides li' + $(this).attr('href')).addClass('current').siblings().removeClass('current');
5743	});
5744
5745	$('header.fixed .btn-responsive-nav').on('click', function() {
5746		$('html, body').animate({scrollTop: 0}, 400);
5747	});
5748
5749	$('body').on('click', '.form .refresh-page', function(){
5750		location.href = location.href;
5751	});
5752
5753
5754
5755	$(document).on('click', '.basket.fly .opener', function(){
5756		if(window.matchMedia('(max-width: 767px)').matches)
5757			location.href = arMedc2Options['THEME']['URL_BASKET_SECTION'];
5758		else
5759			$(this).closest('.ajax_basket').toggleClass('opened');
5760	})
5761
5762	$(document).on('click', '.basket.fly .close_block', function()
5763	{
5764		$('.basket.fly .opener').trigger('click');
5765	})
5766
5767
5768	if($('.form-control').length){
5769		$('.form-control').each(function(){
5770			var value = $(this).val();
5771
5772			if(value){
5773				$(this).closest('.animated-labels').addClass('input-filed');
5774			}
5775		});
5776	}
5777	/* animated labels */
5778	$(document).on("focus", ".animated-labels input,.animated-labels textarea", function(){
5779		$(this).closest(".animated-labels").addClass("input-filed");
5780	}).on("focusout", ".animated-labels input,.animated-labels textarea", function(){
5781		if("" != $(this).val())
5782			$(this).closest(".animated-labels").addClass("input-filed");
5783		else
5784			$(this).closest(".animated-labels").removeClass("input-filed");
5785	});
5786
5787	$(document).on('click', '.animated-labels select', function(){
5788		var $input = $(this).closest('.animated-labels');
5789
5790		if(!$input.hasClass('input-filed') && !$input.hasClass('changed')){
5791			$(this).closest('.animated-labels').addClass('input-filed');
5792		}
5793
5794		$(this).closest('.animated-labels').removeClass('changed');
5795	});
5796
5797	$(document).on('change', '.animated-labels select', function(){
5798		var value = $(this).val();
5799		if(!value){
5800			$(this).closest('.animated-labels').removeClass('input-filed').addClass('changed');
5801		}
5802	});
5803
5804	$(document).on('blur', '.animated-labels select', function(){
5805		var value = $(this).val();
5806
5807		if(!value){
5808			$(this).closest('.animated-labels').removeClass('input-filed').addClass('changed');
5809		}
5810	});
5811
5812	/* accordion action*/
5813	$('.panel-collapse').on('hidden.bs.collapse', function(){
5814		$(this).parent().toggleClass('opened');
5815	})
5816	$('.panel-collapse').on('show.bs.collapse', function(){
5817		$(this).parent().toggleClass('opened');
5818	})
5819
5820	// MEDC2 BASKET
5821	// - basket fly close
5822	$(document).on('click', function(){
5823		if($('.basket.fly').length && $('.ajax_basket').hasClass('opened')){
5824			$('.ajax_basket').removeClass('opened');
5825		}
5826	});
5827
5828	$(document).on('click', '.basket.fly', function(e){
5829		e.stopPropagation();
5830	});
5831
5832	// - COUNTER
5833	var timerBasketCounter = false;
5834
5835	// -- keyup input
5836	$(document).on('keydown', '.count', function(e){
5837		// Allow: backspace, delete, tab, escape, enter and .
5838		if($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
5839			 // Allow: Ctrl+A, Command+A
5840			(e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
5841			 // Allow: home, end, left, right, down, up
5842			(e.keyCode >= 35 && e.keyCode <= 40)) {
5843				 // let it happen, don't do anything
5844				 return;
5845		}
5846		// Ensure that it is a number and stop the keypress
5847		if((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)){
5848			e.preventDefault();
5849		}
5850	});
5851	$(document).on('keyup', '.count', function(e){
5852		var $this = $(this),
5853			counterInputValueNew = $this.val(),
5854			price = $this.closest('.item').find('input[name=PRICE]').val();
5855
5856		Summ($this, counterInputValueNew, price);
5857	});
5858
5859	// -- scroll after apply option
5860	if($('.instagram_ajax').length)
5861	{
5862		BX.addCustomEvent('onCompleteAction', function(eventdata){
5863			if(eventdata.action === 'instagrammLoaded')
5864				scrollPreviewBlock();
5865		});
5866	}
5867	else
5868		scrollPreviewBlock();
5869
5870	$('select.region').on('change', function(){
5871		var val = parseInt($(this).val());
5872		if($('select.city').length)
5873		{
5874			if(val)
5875			{
5876				$('select.city').removeAttr('disabled');
5877				$('select.city option').hide();
5878				$('select.city option[data-parent_section='+val+']').show();
5879			}
5880			else
5881				$('select.city').attr('disabled', 'disabled');
5882		}
5883	})
5884
5885	$('select.city, select.region').on('change', function(){
5886		var _this = $(this),
5887			val = parseInt(_this.val());
5888		if(_this.hasClass('region'))
5889		{
5890			$('select.city option:eq(0)').show();
5891			$('select.city').val(0);
5892		}
5893
5894		if((_this.hasClass('region') && !val) || _this.hasClass('city'))
5895		{
5896			$.ajax({
5897				type: 'POST',
5898				data: {ID: val},
5899			}).success(function(html){
5900				var ob = BX.processHTML(html);
5901				$('.ajax_items')[0].innerHTML = ob.HTML;
5902				BX.ajax.processScripts(ob.SCRIPT);
5903			})
5904		}
5905	})
5906
5907	// -- blur input
5908	$(document).on('blur', '.count', function(){
5909		BasketCounter($(this));
5910	});
5911
5912	// -- click minus, plus button
5913	$(document).on('click', '.minus, .plus', function(e){
5914		e.stopPropagation();
5915		BasketCounter($(this));
5916	});
5917
5918	// - Add2Basket
5919	$(document).on('click', '.to_cart', function(e){
5920		e.stopPropagation();
5921		var item = $(this).closest('[data-item]'),
5922			_this = $(this),
5923			itemData = item.data('item'),
5924			buyBlock = item.find('.buy_block'),
5925			counter = buyBlock.find('.counter'),
5926			buttonToCart = buyBlock.find('.to_cart'),
5927			itemQuantity = parseFloat(buttonToCart.data('quantity')),
5928			countItem = ($('.basket').length ? parseInt($('.basket .count').text()) : parseInt($('.basket_top:visible .count').text()));
5929
5930		$('.basket_top .count').text(countItem + 1).removeClass('empted');
5931		$('.basket .count').text(countItem + 1).removeClass('empted');
5932
5933		if(typeof(arMedc2Options['THEME']['ORDER_BASKET_VIEW']) !== 'undefined')
5934		{
5935			if($.trim(arMedc2Options['THEME']['ORDER_BASKET_VIEW']) === 'HEADER' && $('.basket_top').length)
5936				var bBasketTop = true;
5937			else if($('.basket.fly').length)
5938				var bBasketFly = true;
5939		}
5940
5941		if(isNaN(itemQuantity) || itemQuantity <= 0){
5942			itemQuantity = 1;
5943		}
5944
5945		if(!isNaN(itemData.ID) && parseInt(itemData.ID) > 0){
5946			buyBlock.addClass('in');
5947
5948			$.ajax({
5949				url: arMedc2Options['SITE_DIR'] + 'include/footer/site-basket.php',
5950				type: 'POST',
5951				data: {itemData: itemData, quantity: itemQuantity},
5952			}).success(function(html){
5953				var eventdata = {action:'loadForm'};
5954				BX.onCustomEvent('onCompleteAction', [eventdata, _this[0]]);
5955
5956				if(bBasketTop){
5957					$('.ajax_basket').html(html);
5958					var eventdata = {action:'loadBasket'};
5959					BX.onCustomEvent('onCompleteAction', [eventdata, $('.ajax_basket')[0]]);
5960				}
5961
5962				if(bBasketFly){
5963					if($('.basket.fly').length){
5964						$('.ajax_basket').html(html);
5965						setTimeout(function(){
5966							if(!$('.ajax_basket').hasClass('opened')){
5967								$('.ajax_basket').addClass('opened');
5968							}
5969						}, 50);
5970					}
5971				}
5972
5973				if(arMedc2Options['THEME']['USE_SALE_GOALS'] != 'N')
5974				{
5975					var eventdata = {goal: 'goal_basket_add', params: {itemData: itemData, quantity: itemQuantity}};
5976					BX.onCustomEvent('onCounterGoals', [eventdata]);
5977				}
5978			});
5979		}
5980		else{
5981			return;
5982		}
5983	});
5984
5985	// - Remove9Basket
5986	$(document).on('click', '.remove', function(){
5987		var item = $(this).closest('[data-item]'),
5988			itemData = item.data('item'),
5989			bRemove = 'Y',
5990			bRemoveAll = ($.trim($(this).closest('[data-remove_all]').data('remove_all')) === 'Y' ? 'Y' : false);
5991			getCurUri = $.trim($('input[name=getPageUri]').val()),
5992			countItem = ($('.basket').length ? parseInt($('.basket .item').length) : parseInt($('.basket_top:visible .item').length)),
5993			bOneItem = (countItem - 1 <= 0),
5994			scrollTop = ($('.basket.fly').length ? $('.basket.fly .items_wrap').scrollTop() : ($('.basket_top:visible').length ? $('.basket_top .items:visible').scrollTop() : ''));
5995
5996		var _ajax = function(){
5997			$.ajax({
5998				url: arMedc2Options['SITE_DIR'] + 'include/footer/site-basket.php',
5999				data: {itemData: itemData, remove: bRemove, removeAll: bRemoveAll},
6000			}).success(function(html){
6001
6002				if(bBasketTop){
6003					$('.ajax_basket').html(html);
6004					$('.basket_top .items').scrollTop(scrollTop);
6005				}
6006
6007				if(getCurUri){
6008					$.ajax({
6009						url: getCurUri,
6010						type: 'POST',
6011					}).success(function(html){
6012						if($('.basket.default').length){
6013							$('.basket.default').html(html);
6014						}
6015					});
6016				}
6017
6018				if(bBasketFly){
6019					$('.ajax_basket').html(html);
6020					$('.ajax_basket').addClass('opened');
6021					$('.basket.fly .items_wrap').scrollTop(scrollTop);
6022				}
6023
6024				if(arMedc2Options['THEME']['USE_SALE_GOALS'] != 'N')
6025				{
6026					var eventdata = {goal: 'goal_basket_remove', params: {itemData: itemData, remove: bRemove, removeAll: bRemoveAll}};
6027					BX.onCustomEvent('onCounterGoals', [eventdata]);
6028				}
6029			});
6030		}
6031
6032		if(typeof(arMedc2Options['THEME']['ORDER_BASKET_VIEW']) !== 'undefined')
6033		{
6034			if($.trim(arMedc2Options['THEME']['ORDER_BASKET_VIEW']) === 'HEADER' && $('.basket_top').length)
6035				var bBasketTop = true;
6036			else if($('.basket.fly').length)
6037				var bBasketFly = true;
6038		}
6039
6040		if(typeof(itemData) !== 'undefined' && (!isNaN(itemData.ID) && itemData.ID > 0) || bRemoveAll){
6041			if(bRemoveAll){
6042				$('.buy_block').removeClass('in');
6043				$('.basket .count').text(0).addClass('empted');
6044				$('.basket_top .count').text(0).addClass('empted');
6045				$('#mobilemenu .menu .ready .count').text(0).addClass('empted');
6046			}
6047			else{
6048				$('[data-item]').each(function(){
6049					if($(this).data('item').ID == itemData.ID){
6050						$(this).find('.buy_block').removeClass('in');
6051					}
6052				});
6053				if($('.basket').length){
6054					if($('.basket_top .count').length)
6055						$('.basket_top .count').text(parseFloat($('.basket_top:visible .count').text()) - 1);
6056					else
6057					{
6058						$('.basket .count').text(parseFloat($('.basket .count').text()) - 1);
6059						$('.basket_top .count').text(parseFloat($('.basket .count').text()) - 1);
6060					}
6061				}
6062				else{
6063					$('.basket_top .count').text(parseFloat($('.basket_top:visible .count').text()) - 1);
6064				}
6065
6066				$('#mobilemenu .menu .ready .count').text(parseFloat($('#mobilemenu .menu .ready .count').text()) - 1);
6067			}
6068
6069			if(bOneItem && !bRemoveAll){
6070				if(item.closest('.basket_top').length){
6071					item.closest('.dropdown').animate({opacity: 0}, 200, function(){
6072						_ajax();
6073					});
6074				}
6075				else{
6076					item.closest('.basket').find('.count').addClass('empted');
6077					item.closest('.basket_wrap').fadeOut(200, function(){
6078						item.closest('.basket').find('.basket_empty').fadeIn(200, function(){
6079							_ajax();
6080						});
6081					});
6082				}
6083			}
6084			else if(bRemoveAll){
6085				$('.basket_wrap').fadeOut(200, function(){
6086					$('.remove.all').remove();
6087					$('.basket').find('.basket_empty').fadeIn(200, function(){
6088						_ajax();
6089					});
6090				});
6091			}
6092			else if(!bOneItem){
6093				item.animate({opacity: 0}, 200).slideUp(200, function(){
6094					_ajax();
6095				});
6096			}
6097		}
6098		else{
6099			return;
6100		}
6101	});
6102	$(document).on('click', '.print', function(){
6103		window.print();
6104	});
6105
6106	$('.choise').on('click', function(){
6107		var _this = $(this);
6108		if(typeof(_this.data('block')) != 'undefined')
6109		{
6110			scrollToBlock(_this.data('block'));
6111		}
6112	});
6113
6114	if($('#bx-composite-banner .bx-composite-btn').length){
6115		$('footer .confidentiality').css('padding-right', '236px');
6116		$('footer.footer-v2 .menu-bottom-wrap').css('padding-left', '226px');
6117		$('footer.footer-v3 .menu-bottom-wrap').css('padding-left', '226px');
6118	}
6119});
6120
6121scrollPreviewBlock = function(){
6122	if(typeof($.cookie('scoll_block')) != 'undefined' && $.cookie('scoll_block'))
6123	{
6124		var scoll_block = $($.cookie('scoll_block'));
6125		if(scoll_block.length)
6126		{
6127			$('body, html').animate({scrollTop: scoll_block.offset().top}, 500);
6128			$.cookie('scoll_block', null);
6129		}
6130	}
6131}
6132
6133scrollToBlock = function(block){
6134	if($(block).length)
6135	{
6136		var offset = $(block).offset().top;
6137		if(typeof($(block).data('toggle')) != 'undefined')
6138			$(block).click();
6139
6140		if(typeof($(block).data('offset')) != 'undefined')
6141			offset += $(block).data('offset');
6142		$('body, html').animate({scrollTop: offset}, 500);
6143	}
6144}
6145
6146// START VIDEO BUTTON
6147$(document).on('click', '.banners-big .item .btn-video', function(){
6148	$(this).addClass('loading');
6149	$(this).closest('.item').addClass('loading');
6150	startMainBannerSlideVideo($(this).closest('.item'));
6151});
6152
6153//MEDC2 BASKET
6154function number_format(number, decimals, dec_point, thousands_sep) {
6155	number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
6156	var n = !isFinite(+number) ? 0 : +number,
6157	prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
6158	sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
6159	dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
6160	s = '',
6161	toFixedFix = function(n, prec){
6162		var k = Math.pow(10, prec);
6163		return '' + (Math.round(n*k)/k).toFixed(prec);
6164	};
6165
6166	// Fix for IE parseFloat(0.55).toFixed(0) = 0;
6167	s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
6168
6169	if (s[0].length > 3) {
6170		s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
6171	}
6172
6173	if ((s[1] || '')
6174		.length < prec) {
6175		s[1] = s[1] || '';
6176		s[1] += new Array(prec - s[1].length + 1).join('0');
6177	}
6178
6179	return s.join(dec);
6180}
6181
6182
6183setBasketItemsClasses = function(){
6184	if(typeof(arBasketItems) !== 'undefined' && typeof(arBasketItems) !== 'string'){
6185		if(Object.keys(arBasketItems).length){
6186			for(var key in arBasketItems){
6187				$('[data-item]').each(function(){
6188					if($(this).data('item').ID == key){
6189						$(this).find('.buy_block').addClass('in');
6190					}
6191				});
6192			}
6193		}
6194	}
6195}
6196
6197function Summ(el, counterInputValueNew, price){
6198	if(counterInputValueNew <= 0){
6199		counterInputValueNew = 1;
6200	}
6201
6202	var summ = number_format(counterInputValueNew*price, 0, '.', ' '),
6203		allSumm = 0;
6204
6205	el.closest('.items').find('.item').each(function(){
6206		var $this = $(this),
6207			price = parseFloat($this.find('input[name=PRICE]').val()),
6208			count =  parseFloat($this.find('input.count').val());
6209
6210		if(count <= 0){
6211			count = 1;
6212		}
6213
6214		if(!isNaN(price) && !isNaN(count)){
6215			allSumm += count*price;
6216		}
6217	});
6218
6219	allSumm = number_format(parseFloat(allSumm), 0, '.', ' ');
6220
6221	el.closest('.item').find('.summ .price_val').text(summ);
6222	el.closest('.basket').find('.foot .total>span').text(allSumm);
6223}
6224
6225var timerBasketUpdate = false;
6226// - COUNTER
6227BasketCounter = function(el){
6228	var elClass = $.trim(el.attr('class')),
6229		bClassMinus = (elClass.indexOf('minus') > -1),
6230		bClassPlus = (elClass.indexOf('plus') > -1),
6231		bClassCount = (elClass.indexOf('count') > -1),
6232		getCurUri = $.trim($('input[name=getPageUri]').val()),
6233		buyBlock = el.closest('.buy_block'),
6234		buttonToCart = buyBlock.find('.to_cart'),
6235		counterInput = el.closest('.counter').find('input.count'),
6236		counterInputValue = parseFloat($.trim(counterInput.val())),
6237		price = parseFloat(buyBlock.find('input[name=PRICE]').val()),
6238		counterInputMaxCount = Math.pow(10, parseInt(counterInput.attr('maxlength'))) - 1;
6239
6240	// class minus button
6241	if(bClassMinus){
6242		var counterInputValueNew = counterInputValue - 1;
6243
6244		if(counterInputValueNew <= 0){
6245			counterInputValueNew = 1;
6246		}
6247
6248		counterInput.val(counterInputValueNew);
6249
6250		Summ(el, counterInputValueNew, price);
6251
6252		if(timerBasketUpdate){
6253			clearTimeout(timerBasketUpdate);
6254			timerBasketUpdate = false;
6255		}
6256
6257		timerBasketUpdate = setTimeout(function(){
6258			BasketUpdate(el, counterInputValueNew);
6259			timerBasketUpdate = false;
6260		}, 700);
6261	}
6262	// class plus button
6263	else if(bClassPlus){
6264		var counterInputValueNew = counterInputValue + 1;
6265
6266		if(counterInputValueNew > counterInputMaxCount){
6267			counterInputValueNew = counterInputMaxCount;
6268		}
6269
6270		counterInput.val(counterInputValueNew);
6271		Summ(el, counterInputValueNew, price);
6272
6273		if(timerBasketUpdate){
6274			clearTimeout(timerBasketUpdate);
6275			timerBasketUpdate = false;
6276		}
6277
6278		timerBasketUpdate = setTimeout(function(){
6279			BasketUpdate(el, counterInputValueNew);
6280			timerBasketUpdate = false;
6281		}, 700);
6282	}
6283	// class input
6284	else if(bClassCount){
6285		var counterInputValueNew = counterInputValue;
6286
6287		if(counterInputValueNew <= 0 || isNaN(counterInputValueNew)){
6288			counterInputValueNew = 1;
6289		}
6290		el.val(counterInputValueNew);
6291		BasketUpdate(el, counterInputValueNew);
6292	}
6293
6294	if(!getCurUri && !el.closest('.basket.fly').length){
6295		buttonToCart.data('quantity', counterInputValueNew);
6296	}
6297}
6298
6299BasketUpdate = function(el, counterInputValueNew){
6300	var	itemData = el.closest('[data-item]').data('item'),
6301		itemData = (typeof(arBasketItems) === 'object' && typeof(arBasketItems[itemData.ID]) === 'object' ? arBasketItems[itemData.ID] : itemData),
6302		buyBlock = el.closest('.buy_block'),
6303		buttonToCart = buyBlock.find('.to_cart'),
6304		getCurUri = $.trim($('input[name=getPageUri]').val())
6305		scrollTop = ($('.basket.fly').length ? $('.basket.fly .items_wrap').scrollTop() : ($('.basket_top:visible').length ? $('.basket_top .items:visible').scrollTop() : ''));
6306
6307	if(typeof(arMedc2Options['THEME']['ORDER_BASKET_VIEW']) !== 'undefined' && $.trim(arMedc2Options['THEME']['ORDER_BASKET_VIEW']) === 'FLY' && $('.basket.fly').length){
6308		var bBasketFly = true;
6309	}
6310
6311	if(typeof(arMedc2Options['THEME']['ORDER_BASKET_VIEW']) !== 'undefined' && $.trim(arMedc2Options['THEME']['ORDER_BASKET_VIEW']) === 'HEADER' && $('.basket_top').length){
6312		var bBasketTop = true;
6313	}
6314
6315	else{
6316		if(typeof(itemData) != 'undefined' && !isNaN(itemData.ID) && itemData.ID > 0){
6317			$.ajax({
6318				// url: arMedc2Options['SITE_DIR'] + 'ajax/basket_items.php',
6319				url: arMedc2Options['SITE_DIR'] + 'include/footer/site-basket.php',
6320				data: {itemData: itemData, quantity: counterInputValueNew},
6321			}).success(function(data){
6322				if(typeof(data) === 'object'){
6323					arBasketItems = data;
6324				}
6325				if(bBasketTop){
6326					$.ajax({
6327						url: arMedc2Options['SITE_DIR'] + 'include/footer/site-basket.php',
6328						type: 'POST',
6329						data: {'ajaxPost': 'Y'},
6330					}).success(function(html){
6331						buyBlock.removeClass('in');
6332						$('.ajax_basket').html(html);
6333
6334						/*if(!getCurUri){
6335							setTimeout(function(){
6336								$('.basket_top .dropdown').addClass('expanded');
6337							}, 100);
6338
6339							setTimeout(function(){
6340								$('.basket_top .dropdown').removeClass('expanded');
6341							}, 1000);
6342						}*/
6343					});
6344				}
6345
6346				if(bBasketFly){
6347					$.ajax({
6348						url: arMedc2Options['SITE_DIR'] + 'include/footer/site-basket.php',
6349						type: 'POST',
6350						data: {'ajaxPost': 'Y'},
6351					}).success(function(html){
6352						if($('.basket.fly').length){
6353							$('.ajax_basket').html(html);
6354							$('.basket.fly .items_wrap').scrollTop(scrollTop);
6355						}
6356					});
6357				}
6358
6359				if(getCurUri){
6360					$.ajax({
6361						url: getCurUri,
6362						type: 'POST',
6363					}).success(function(html){
6364						if($('.basket.default').length){
6365							$('.basket.default').html(html);
6366						}
6367					});
6368				}
6369			});
6370		}
6371		else{
6372			return;
6373		}
6374	}
6375}
6376
6377CheckTabActive = function(){
6378	if(typeof(clicked_tab) && clicked_tab)
6379	{
6380		if(window.matchMedia('(min-width: 768px)').matches)
6381		{
6382			clicked_tab--;
6383			$('.catalog.detail .nav.nav-tabs li:eq('+clicked_tab+')').addClass('active');
6384			$('.catalog.detail .tab-content .tab-pane:eq('+clicked_tab+')').addClass('active');
6385			$('.catalog.detail .tab-content .tab-pane .title-tab-heading').next().removeAttr('style');
6386			clicked_tab = 0;
6387		}
6388	}
6389}
6390
6391/* menu marker */
6392markerNav= function(){
6393	/*if($('table td.active .wrap > a').length > 0)
6394	{
6395		$('table td.active .wrap > a').each(function(){
6396			var item = $(this),
6397				itemParentPos = item.closest('td').position().left,
6398				itemPos = item.position().left,
6399				mainPos = itemParentPos + itemPos + parseInt(item.css('padding-left'))
6400				nav = item.closest('.mega-menu').find('.marker-nav');
6401
6402			nav.css('left', mainPos);
6403			if(window.matchMedia('(min-width: 992px)').matches)
6404				nav.css('width', item.find('.line-wrapper').actual('outerWidth'));
6405		})
6406	}
6407	else
6408		$('.marker-nav').css('width', 0);
6409
6410	if(!$('.marker-nav').hasClass('opacity1'))
6411	{
6412		setTimeout(function(){
6413			$('.marker-nav').addClass('opacity1');
6414		}, 100);
6415	}*/
6416}
6417
6418/* parallax bg */
6419ParallaxBg = function(){
6420	if($('*[data-type=parallax-bg]').length)
6421	{
6422		var x = $(window).scrollTop()/$(document).height();
6423		x=parseInt(-x * 280);
6424		$('*[data-type=parallax-bg]').stop().animate({'background-position-y':  x + 'px'}, 400, 'swing');
6425	}
6426}
6427SetFixedAskBlock = function(){
6428	if($('.ask_a_question_wrapper').length)
6429	{
6430		var offset = $('.ask_a_question_wrapper').offset(),
6431			block = $('.ask_a_question_wrapper').find('.ask_a_question'),
6432			block_offset = BX.pos(block[0]),
6433			block_height = block_offset.bottom-block_offset.top,
6434			diff_top_scroll = $('#headerfixed').height() + 20;
6435
6436		if(/*offset.top+*/block_height+130 > block.closest('.fixed_wrapper').height())
6437			block.addClass('nonfixed');
6438		else
6439			block.removeClass('nonfixed');
6440
6441		if($('footer').length && block_height+diff_top_scroll+documentScrollTopLast + 130 > $('footer').offset().top)
6442		{
6443			block.removeClass('fixed').css({'top': 'auto', 'width': 'auto', 'bottom': 0});
6444			block.parent().css('position', 'static');
6445			block.parent().parent().css('position', 'static');
6446		}
6447		else
6448		{
6449			block.parent().removeAttr('style');
6450			block.parent().parent().removeAttr('style');
6451
6452			if(documentScrollTopLast + diff_top_scroll > offset.top)
6453				block.addClass('fixed').css({'top': diff_top_scroll, 'bottom': 'auto', 'width': $('.fixed_block_fix').width()});
6454			else
6455				block.removeClass('fixed').css({'top': 0, 'width': $('.fixed_block_fix').width()});
6456		}
6457	}
6458}
6459
6460
6461// Events
6462var timerScroll = false, ignoreScroll = [], documentScrollTopLast = $(document).scrollTop();
6463var bMenuResize = false;
6464$(window).scroll(function(){
6465	CheckPopupTop();
6466	SetFixedAskBlock();
6467	if(!ignoreScroll.length){
6468		if(timerScroll){
6469			clearTimeout(timerScroll);
6470			timerScroll = false;
6471		}
6472		timerScroll = setTimeout(function(){
6473			BX.onCustomEvent('onWindowScroll', false);
6474		}, 100);
6475	}
6476	documentScrollTopLast = $(document).scrollTop();
6477
6478	if($('#headerfixed').hasClass('fixed') && !bMenuResize){
6479		$(window).resize();
6480		bMenuResize = true;
6481	}
6482	else if(!$('#headerfixed').hasClass('fixed')){
6483		bMenuResize = false;
6484	}
6485});
6486
6487var timerResize = false, ignoreResize = [];
6488
6489$(window).resize(function(){
6490	CheckBodyPadding();
6491	CheckPopupTop();
6492	CheckScrollToTop();
6493	if(!ignoreResize.length){
6494		if(timerResize){
6495			clearTimeout(timerResize);
6496			timerResize = false;
6497		}
6498		timerResize = setTimeout(function(){
6499			BX.onCustomEvent('onWindowResize', false);
6500		}, 100);
6501	}
6502	documentScrollTopLast = $(document).scrollTop();
6503});
6504
6505BX.addCustomEvent('onWindowScroll', function(eventdata) {
6506	try{
6507		ignoreScroll.push(true);
6508		ParallaxBg();
6509
6510		if(arMedc2Options['THEME']['TYPE_SEARCH'] != 'fixed')
6511		{
6512			if(!$('header > .top-block').length)
6513			{
6514				var height_block = 0,
6515					scrollVal = $(window).scrollTop();
6516				height_block = $('.logo_and_menu-row').actual('outerHeight');
6517				if(!scrollVal)
6518				{
6519					$('.inline-search-block').css({
6520						'height': height_block,
6521						'line-height': height_block-4+'px',
6522						'top': -height_block
6523					})
6524				}
6525			}
6526		}
6527
6528	}
6529	catch(e){}
6530	finally{
6531		ignoreScroll.pop();
6532	}
6533});
6534
6535BX.addCustomEvent('onWindowResize', function(eventdata) {
6536	try{
6537		ignoreResize.push(true);
6538
6539		CheckHeaderFixedMenu();
6540		CheckTopMenuDotted();
6541		CheckTopVisibleMenu();
6542		CheckFlexSlider();
6543		CheckMainBannerSliderVText($('.banners-big .flexslider'));
6544		CheckMainBannerSliderVText($('.banners-content .maxwidth-banner'));
6545		CheckObjectsSizes();
6546		verticalAlign();
6547		CheckTabActive();
6548		setTimeout(function(){
6549			createTableCompare($('.main-block .items .title-block:not(.clone) .item'), $('.prop_title_table'), $('.main-block .prop_title_table .item.clone'));
6550		}, 100);
6551		SliceHeightBlocks();
6552	}
6553	catch(e){}
6554	finally{
6555		ignoreResize.pop();
6556	}
6557});
6558
6559BX.addCustomEvent('onSliderStart', function(eventdata) {
6560	try{
6561		ignoreResize.push(true);
6562		if(eventdata){
6563			var slider = eventdata.slider;
6564			if(slider){
6565				if(slider.closest('.staff-type-2').length){
6566					var sliderHeight = slider.outerHeight(true, true) - 3;
6567
6568					//$parent.height(parentHeight);
6569					slider.height(sliderHeight);
6570					slider.find('.flex-viewport').height(sliderHeight);
6571
6572					slider.find('.flex-viewport').data('height', sliderHeight + 1);
6573					slider.find('.item').each(function(){
6574						var deltaSliderHeight = $(this).find('.bottom-block').outerHeight();
6575						$(this).data('delta_height', deltaSliderHeight);
6576					});
6577
6578					$(slider).each(function(){
6579						if($(this).closest('.staff-type-2').length){
6580							HoverStaffSliderItem($(this).closest('.staff-type-2'));
6581						}
6582					});
6583				}
6584			}
6585		}
6586	}
6587	catch(e){}
6588	finally{
6589		ignoreResize.pop();
6590	}
6591})
6592
6593BX.addCustomEvent('onSlide', function(eventdata) {
6594	try{
6595		ignoreResize.push(true);
6596		if(eventdata){
6597			var slider = eventdata.slider;
6598			if(slider){
6599				// add classes .curent & .shown to slide
6600				slider.find('.item').removeClass('current');
6601				var curSlide = slider.find('.item.flex-active-slide');
6602				var curSlideId = curSlide.attr('id');
6603				curSlide.addClass('current');
6604
6605				slider.find('.item').css('opacity', '1');
6606
6607				if(curSlide.hasClass('shown')){
6608					slider.find('.item.clone[id=' + curSlideId + '_clone]').addClass('shown');
6609				}
6610
6611				curSlide.addClass('shown');
6612				//slider.resize();
6613
6614				// set main banners text vertical center
6615				CheckMainBannerSliderVText(slider);
6616
6617				//video
6618				var videoAutoPlay = curSlide.attr('data-video_autoplay')
6619				var bVideoAutoPlay = videoAutoPlay == 1
6620
6621				if(typeof(window["players"]) == 'object' && curSlide.length) // pause video
6622				{
6623					for(var j in window["players"])
6624					{
6625						var curVideoSlide = $('iframe[id='+window["players"][j].id+']').closest('.item'),
6626							videoPlayer = curVideoSlide.attr('data-video_player'),
6627							bVideoPlayerYoutube = videoPlayer === 'YOUTUBE',
6628							bVideoPlayerVimeo = videoPlayer === 'VIMEO';
6629
6630						if(!curVideoSlide.hasClass('current') && bVideoPlayerYoutube)
6631						{
6632							window[window["players"][j].id].pauseVideo();
6633						}
6634					}
6635				}
6636
6637				if(bVideoAutoPlay){
6638					startMainBannerSlideVideo(curSlide)
6639				}
6640				if(!slider.find('.flex-control-nav li').length && slider.hasClass('normal'))
6641				{
6642					slider.find('.flex-direction-nav li a').addClass('flex-disabled');
6643				}
6644
6645				if(!slider.hasClass('flexslider-init-slice') && slider.hasClass('nav-title') && $('.gallery-block').closest('.tab-pane').hasClass('active'))
6646				{
6647					slider.find('.item').sliceHeight({'lineheight': -3});
6648					slider.addClass('flexslider-init-slice');
6649				}
6650				if(slider.find('.flex-direction-nav').length){
6651					if(slider.find('.flex-direction-nav').find('a.flex-disabled').length)
6652						slider.find('.flex-direction-nav').removeClass('opacity1').addClass('opacity0');
6653					else
6654						slider.find('.flex-direction-nav').removeClass('opacity0').addClass('opacity1');
6655				}
6656
6657				if(slider.closest('.galerys-block').find('.title.big-gallery').length){
6658					var indexActiveSlide = slider.data('flexslider').currentSlide + 1;
6659					slider.closest('.galerys-block').find('.title.big-gallery .slide-number').text(indexActiveSlide);
6660				}
6661			}
6662		}
6663	}
6664	catch(e){}
6665	finally{
6666		ignoreResize.pop();
6667	}
6668});
6669
6670BX.addCustomEvent('onSlideEnd', function(eventdata) {
6671	try{
6672		ignoreResize.push(true);
6673		if(eventdata){
6674			var slider = eventdata.slider;
6675			if(slider){
6676
6677			}
6678		}
6679	}
6680	catch(e){}
6681	finally{
6682		ignoreResize.pop();
6683	}
6684});
6685
6686
6687$(window).resize(function(){
6688	SetFixedAskBlock();
6689	CheckTopMenuPadding();
6690	CheckTopMenuOncePadding();
6691	CheckSearchWidth();
6692
6693
6694	$('.flexslider').each(function(indx){
6695		var $this = $(this);
6696		setTimeout(function(){
6697			
6698			if(!!$this.data('flexslider')){
6699				var pluginOptions = $this.data('plugin-options'),
6700					indexActiveSlide = $this.data('flexslider').currentSlide,
6701					sliderHeight = $this.find('.item').eq(indexActiveSlide).outerHeight(true, true);
6702					
6703				if(pluginOptions.smoothHeight === true){
6704					$this.find('.flex-viewport').height(sliderHeight);			
6705				}
6706			}			
6707		}, 300);
6708	});
6709
6710	if(window.matchMedia('(min-width: 768px)').matches){
6711		$('.detail .tabs').each(function(){
6712			var $this = $(this),
6713				indexTabActive = $this.find('.nav-tabs li.active').index();
6714
6715			$this.find('.tab-pane').eq(indexTabActive).addClass('active');
6716			$this.find('.tab-pane').eq(indexTabActive).find('.toggle-block').show();
6717		});
6718	}
6719	else{
6720		$('.detail .tabs').each(function(){
6721			var $this = $(this),
6722				indexTabActive = $this.find('.nav-tabs li.active').index();
6723
6724			$this.find('.tab-pane').each(function(indx){
6725				if($(this).index() != indexTabActive){
6726					$(this).remove('active');
6727					$(this).find('.toggle-block').hide();
6728				}
6729			});
6730		});
6731	}
6732});
6733
6734BX.addCustomEvent('onSubmitForm', function(eventdata){
6735	try{
6736		if(!window.renderRecaptchaById || !window.asproRecaptcha || !window.asproRecaptcha.key)
6737		{
6738			eventdata.form.submit();
6739			$(eventdata.form).closest('.form').addClass('sending');
6740			return true;
6741		}
6742		if(window.asproRecaptcha.params.recaptchaSize == 'invisible' && typeof grecaptcha != 'undefined')
6743		{
6744			if($(eventdata.form).find('.g-recaptcha-response').val())
6745			{
6746				eventdata.form.submit();
6747				$(eventdata.form).closest('.form').addClass('sending');
6748			}
6749			else
6750			{
6751				grecaptcha.execute($(eventdata.form).find('.g-recaptcha').data('widgetid'));
6752				return false;
6753			}
6754		}
6755		else
6756		{
6757			console.log($(eventdata.form));
6758			eventdata.form.submit();
6759			$(eventdata.form).closest('.form').addClass('sending');
6760		}
6761
6762		return true;
6763	}catch (e){
6764		console.error(e);
6765		return true;
6766	}
6767});
6768/* End */
6769;
6770; /* Start:"a:4:{s:4:"full";s:55:"/local/templates/aspro-medc2/js/custom.js?1707475749256";s:6:"source";s:41:"/local/templates/aspro-medc2/js/custom.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
6771/* Add here all your JS customizations */
6772
6773 var $ = jQuery.noConflict();
6774$(document).ready(function() {
6775
6776
6777
6778    $('.showvlad').click(function() {
6779    $('.hidevlad').removeClass('hidevlad'); 
6780
6781    $('.showvlad').remove(); 
6782        return false;
6783  });
6784
6785
6786
6787
6788});
6789/* End */
6790;
6791; /* Start:"a:4:{s:4:"full";s:64:"/local/templates/aspro-medc2/js/on-off-switch.js?165692363813287";s:6:"source";s:48:"/local/templates/aspro-medc2/js/on-off-switch.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
6792/**
6793 * DHTMLGoodies.com, Alf Magne Kalleland, September 7th, 2015
6794 */
6795if (!DG)var DG = {};
6796
6797
6798DG.switches = {};
6799DG.OnOffSwitchProperties = ["textOn", "textOff", "width", "height", "heightTrack", "trackColorOn", "trackColorOff",
6800    "textColorOn", "textColorOff", "listener", "trackBorderColor", "textSizeRatio"];
6801DG.OnOffSwitch = function (config) {
6802    if (config.el != undefined) {
6803        this.inputEl = $(config.el);
6804
6805
6806        this.name = this.inputEl.attr("name");
6807        DG.switches[this.name] = this;
6808        DG.switches["#" + this.inputEl.attr("id")] = this;
6809        var t = this.inputEl.attr("type");
6810        this.isCheckbox = t && t.toLowerCase() == "checkbox";
6811        if(this.isCheckbox){
6812            this.checked = this.inputEl.is(":checked");
6813        }else{
6814            this.checked = this.inputEl.val() == 1;
6815        }
6816
6817    }
6818
6819    var properties = DG.OnOffSwitchProperties;
6820    for (var i = 0; i < properties.length; i++) {
6821        if (config[properties[i]] != undefined) {
6822            this[properties[i]] = config[properties[i]];
6823        }
6824    }
6825    this.render();
6826};
6827
6828
6829
6830$.extend(DG.OnOffSwitch.prototype, {
6831
6832    inputEl: undefined,
6833
6834    listener: undefined,
6835    trackBorderColor: undefined,
6836
6837    checked: false,
6838
6839    width: 0,
6840    height: 30,
6841    heightTrack: 12,
6842
6843    trackBorderWidth: 1,
6844
6845    textSizeRatio: 0.40,
6846
6847    trackColorOn: undefined,
6848    trackColorOff: '#EEE',
6849
6850    textColorOn: undefined,
6851    textColorOff: undefined,
6852
6853
6854    el: undefined,
6855    track: undefined,
6856    thumb: undefined,
6857    thumbColor: undefined,
6858    onTextEl: undefined,
6859    offTextEl: undefined,
6860    onOffTrackContainer: undefined,
6861
6862    textOn: "",
6863    textOff: "",
6864
6865    minX: 0,
6866    maxX: 0,
6867
6868    trackOn: undefined,
6869    trackOff: undefined,
6870
6871
6872    innerTrackWidth: 0,
6873
6874    name: undefined,
6875
6876    dragCurrentX: 0,
6877    borderSize: 0,
6878    isCheckbox:false,
6879
6880    render: function () {
6881
6882        if (this.width == 0) {
6883            var ratio = this.textSizeRatio / 2;
6884            var widthFactor = 2 + Math.max(this.textOff.length * ratio, this.textOn.length * ratio);
6885            this.width = this.height * widthFactor;
6886        }
6887
6888        this.inputEl.css("display", "none");
6889        this.el = $('<div class="on-off-switch" style="width:' + this.width + 'px;height:' + this.height + 'px"></div>');
6890        this.inputEl.after(this.el);
6891
6892        this.inputEl.on("change", this.listenToClickEvent.bind(this));
6893
6894        this.renderTrack();
6895        this.renderThumb();
6896
6897        this.applyStyles();
6898
6899
6900        this.track.on("click", this.toggle.bind(this));
6901        this.track.on("touchend", this.toggle.bind(this));
6902
6903        this.addEvents();
6904    },
6905
6906    listenToClickEvent : function(){
6907
6908        if (this.inputEl.is(':checked')) {
6909            if(!this.checked)this.toggle();
6910        }else{
6911            if(this.checked)this.toggle();
6912        }
6913
6914    },
6915
6916    addEvents: function () {
6917
6918        this.thumb.on("mousedown", this.startDragging.bind(this));
6919        this.thumb.on("touchstart", this.startDragging.bind(this));
6920
6921        this.thumb.on("mouseenter", this.enterThumb.bind(this));
6922        this.thumb.on("mouseleave", this.leaveThumb.bind(this));
6923
6924        $(document.documentElement).on("touchmove", this.drag.bind(this));
6925        $(document.documentElement).on("mousemove", this.drag.bind(this));
6926        $(document.documentElement).on("mouseup", this.endDrag.bind(this));
6927        $(document.documentElement).on("touchend", this.endDrag.bind(this));
6928    },
6929
6930    enterThumb: function () {
6931        this.thumbColor.addClass("on-off-switch-thumb-over");
6932    },
6933
6934    leaveThumb: function () {
6935        this.thumbColor.removeClass("on-off-switch-thumb-over");
6936    },
6937
6938    renderTrack: function () {
6939        var trackWidth = this.width - (this.trackBorderWidth * 2);
6940        var innerTrackWidth = trackWidth - (this.height / 2);
6941        this.innerTrackWidth = trackWidth;
6942        var trackHeight = this.height - (this.trackBorderWidth * 2);
6943        var trackHeightOuter = this.heightTrack;
6944        var borderWidth = this.height / 2;
6945
6946
6947        this.track = $('<div class="on-off-switch-track" style="border-radius:' + borderWidth + 'px;border-width:' + this.trackBorderWidth + 'px;' +
6948            'width:' + trackWidth + 'px;' +
6949            'margin-top:' + (-((trackHeightOuter/2)+1)) + 'px;' +
6950            'height:' + trackHeightOuter + 'px"></div>');
6951
6952        if (this.trackBorderColor) {
6953            this.track.css("border-color", this.trackBorderColor);
6954        }
6955        this.el.append(this.track);
6956
6957        this.onOffTrackContainer = $('<
6957div style="position:absolute;height:' + trackHeight + 'px;width:' + (innerTrackWidth * 2) + 'px"></div>');
6958        this.track.append(this.onOffTrackContainer);
6959
6960
6961        this.trackOn = $('<div class="on-off-switch-track-on" style="border-radius:' + borderWidth + 'px;border-width:' + this.trackBorderWidth + 'px;width:' + innerTrackWidth + 'px;height:' + trackHeightOuter + 'px"><div class="track-on-gradient"></div></div>');
6962        this.onOffTrackContainer.append(this.trackOn);
6963        this.onTextEl = $('<div class="on-off-switch-text on-off-switch-text-on">' + this.textOn + '</div>');
6964        this.trackOn.append(this.onTextEl);
6965
6966        if (this.textColorOn) {
6967            this.onTextEl.css("color", this.textColorOn);
6968        }
6969
6970        this.trackOff = $('<div class="on-off-switch-track-off" style="overflow:hidden;left:' + (innerTrackWidth - (this.height / 2)) + 'px;border-radius:' + borderWidth + 'px;border-width:' + this.trackBorderWidth + 'px;width:' + this.width + 'px;height:' + trackHeightOuter + 'px"><div class="track-off-gradient"></div></div>');
6971        this.offTextEl = $('<div class="on-off-switch-text on-off-switch-text-off">' + this.textOff + '</div>');
6972        this.onOffTrackContainer.append(this.trackOff);
6973        this.trackOff.append(this.offTextEl);
6974
6975        if (this.textColorOff) {
6976            this.offTextEl.css("color", this.textColorOff);
6977        }
6978
6979        this.styleText(this.onTextEl);
6980        this.styleText(this.offTextEl);
6981
6982        var whiteHeight = this.height / 2;
6983        var whiteBorderRadius = whiteHeight / 2;
6984        var horizontalOffset = whiteBorderRadius / 2;
6985        var whiteWidth = this.width - (horizontalOffset * 2);
6986
6987        var whiteEl = $('<div class="on-off-switch-track-white" style="left:' + horizontalOffset + 'px;width:' + whiteWidth + 'px;height:' + whiteHeight + 'px;border-radius:' + whiteBorderRadius + 'px"></div>');
6988        var whiteEl2 = $('<div class="on-off-switch-track-white" style="left:' + horizontalOffset + 'px;width:' + whiteWidth + 'px;height:' + whiteHeight + 'px;border-radius:' + whiteBorderRadius + 'px"></div>');
6989        whiteEl.css("top", this.height / 2);
6990        whiteEl2.css("top", this.height / 2);
6991        this.trackOn.append(whiteEl);
6992        this.trackOff.append(whiteEl2);
6993
6994
6995        this.maxX = this.width - this.height;
6996    },
6997
6998    styleText: function (el) {
6999        var textHeight = Math.round(this.height * this.textSizeRatio);
7000        var textWidth = Math.round(this.width - this.height);
7001
7002        el.css("line-height", (this.height - (this.trackBorderWidth * 2)) + "px");
7003        el.css("font-size", textHeight + "px");
7004        el.css("left", (this.height / 2) + "px");
7005        el.css("width", textWidth + "px");
7006    },
7007
7008    renderThumb: function () {
7009
7010        var borderSize = this.getBorderSize();
7011
7012        var size = this.height - (borderSize * 2);
7013        var borderRadius = (this.height - this.height % 2) / 2;
7014
7015
7016        this.thumb = $('<div class="on-off-switch-thumb" style="width:' + this.height + 'px;height:' + this.height + 'px"></div>');
7017
7018
7019        var shadow = $('<div class="on-off-switch-thumb-shadow" style="border-radius:' + borderRadius + 'px;width:' + size + 'px;height:'
7020            + size + 'px;border-width:' + borderSize + 'px;"></div>');
7021
7022        this.thumb.append(shadow);
7023
7024        this.thumbColor = $('<div class="on-off-switch-thumb-color" style="border-radius:' + borderRadius + 'px;width:' + size + 'px;height:' + size +
7025            'px;left:' + borderSize + 'px;top:' + borderSize + 'px"></div>');
7026        this.thumb.append(this.thumbColor);
7027
7028        if (this.trackColorOff) {
7029            this.trackOff.css("background-color", this.trackColorOff);
7030        }
7031        if (this.trackColorOn) {
7032            this.trackOn.css("background-color", this.trackColorOn);
7033        }
7034
7035        this.el.append(this.thumb);
7036    },
7037
7038
7039    getBorderSize: function () {
7040        if (this.borderSize == 0) {
7041            this.borderSize = Math.round(this.height / 40);
7042        }
7043        return this.borderSize;
7044    },
7045
7046    applyStyles: function () {
7047
7048        this.thumbColor.removeClass("on-off-switch-thumb-on");
7049        this.thumbColor.removeClass("on-off-switch-thumb-off");
7050        this.thumbColor.removeClass("on-off-switch-thumb-over");
7051
7052
7053        if (this.checked) {
7054            this.thumbColor.addClass("on-off-switch-thumb-on");
7055            this.thumb.css("left", this.width - this.height);
7056            this.onOffTrackContainer.css("left", -1);
7057        }
7058        else {
7059            this.onOffTrackContainer.css("left", this.getTrackPosUnchecked());
7060            this.thumbColor.addClass("on-off-switch-thumb-off");
7061            this.thumb.css("left", -1);
7062        }
7063        if(this.isCheckbox){
7064            this.inputEl.prop('checked', this.checked);
7065        }else{
7066            this.inputEl.val(this.checked ? 1 : 0);
7067        }
7068    },
7069
7070    isDragging: false,
7071    hasBeenDragged: false,
7072    startDragging: function (e) {
7073
7074
7075        this.isDragging = true;
7076        this.hasBeenDragged = false;
7077        var position = this.thumb.position();
7078
7079        this.startCoordinates = {
7080            x: this.getX(e),
7081            elX: position.left,
7082        };
7083        return false;
7084    },
7085
7086    drag: function (e) {
7087        if (!this.isDragging) {
7088            return true;
7089        }
7090
7091        this.hasBeenDragged = true;
7092        var x = this.startCoordinates.elX + this.getX(e) - this.startCoordinates.x;
7093
7094        if (x < this.minX)x = this.minX;
7095        if (x > this.maxX)x = this.maxX;
7096
7097        this.onOffTrackContainer.css("left", x - this.width + (this.height));
7098
7099        if(!x)
7100            x = -1;
7101        this.thumb.css("left", x);
7102        return false;
7103    },
7104
7105    getX: function (e) {
7106        var x = e.pageX;
7107
7108        if (e.type && (e.type == "touchstart" || e.type == "touchmove")) {
7109            x = e.originalEvent.touches[0].pageX;
7110        }
7111
7112        this.dragCurrentX = x;
7113
7114        return x;
7115
7116    },
7117
7118    endDrag: function () {
7119        if (!this.isDragging)return true;
7120
7121        if (!this.hasBeenDragged) {
7122            this.toggle();
7123        } else {
7124            var center = this.width / 2 - (this.height / 2);
7125            var x = this.startCoordinates.elX + this.dragCurrentX - this.startCoordinates.x;
7126            if (x < center) {
7127                this.animateLeft();
7128            } else {
7129                this.animateRight();
7130            }
7131        }
7132        this.isDragging = false;
7133    },
7134
7135    getTrackPosUnchecked: function () {
7136        return 0 - this.width + this.height;
7137    },
7138
7139    animateLeft: function () {
7140        this.onOffTrackContainer.animate({left: this.getTrackPosUnchecked()}, 100);
7141        this.thumb.animate({left: -1}, 100,"swing", this.uncheck.bind(this));
7142    },
7143
7144    animateRight: function () {
7145        this.onOffTrackContainer.animate({left: 0}, 100);
7146        this.thumb.animate({left: this.maxX}, 100, "swing", this.check.bind(this));
7147    },
7148
7149    check: function () {
7150        if (!this.checked) {
7151            this.checked = true;
7152            this.notifyListeners();
7153        }
7154        this.applyStyles();
7155    },
7156
7157    uncheck: function () {
7158        if (this.checked){
7159            this.checked = false;
7160            this.notifyListeners();
7161        }
7162        this.applyStyles();
7163    },
7164
7165    toggle: function () {
7166        if (!this.checked) {
7167            this.checked = true;
7168            this.animateRight();
7169        } else {
7170            this.checked = false;
7171            this.animateLeft();
7172        }
7173
7174        this.notifyListeners();
7175    },
7176
7177    notifyListeners: function () {
7178        if (this.listener != undefined) {
7179            this.listener.call(this, this.name, this.checked);
7180        }
7181    },
7182
7183    getValue: function () {
7184        return this.checked;
7185    }
7186});
7187
7188DG.OnOffSwitchAuto = function (config) {
7189
7190    var properties = DG.OnOffSwitchProperties;
7191
7192    // $( document ).ready(function() {
7193        if(config.cls){
7194            var els = $(config.cls);
7195            var index = 0;
7196            for(var i=0,len=els.length;i<len;i++){
7197                var elementConfig = jQuery.extend({}, config);
7198                var el = $(els[i]);
7199                if(!els[i].id){
7200                    els[i].id = "dg-switch-" + index;
7201                    index++;
7202                }
7203                elementConfig.el = "#" + els[i].id
7204
7205                for(var j=0;j<properties.length;j++){
7206                    var attr = "data-"+ properties[j];
7207                    var val = el.attr(attr);
7208                    if(val){
7209                        if(properties[j] == 'height')
7210                            val = parseInt(val);
7211                        elementConfig[properties[j]] = val;
7212                    }
7213                }
7214                new DG.OnOffSwitch(
7215                    elementConfig
7216                );
7217            }
7218        }
7219    // });
7220
7221
7222};
7223/* End */
7224;
7225; /* Start:"a:4:{s:4:"full";s:63:"/bitrix/components/bitrix/search.title/script.js?16166753689847";s:6:"source";s:48:"/bitrix/components/bitrix/search.title/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
7226function JCTitleSearch(arParams)
7227{
7228	var _this = this;
7229
7230	this.arParams = {
7231		'AJAX_PAGE': arParams.AJAX_PAGE,
7232		'CONTAINER_ID': arParams.CONTAINER_ID,
7233		'INPUT_ID': arParams.INPUT_ID,
7234		'MIN_QUERY_LEN': parseInt(arParams.MIN_QUERY_LEN)
7235	};
7236	if(arParams.WAIT_IMAGE)
7237		this.arParams.WAIT_IMAGE = arParams.WAIT_IMAGE;
7238	if(arParams.MIN_QUERY_LEN <= 0)
7239		arParams.MIN_QUERY_LEN = 1;
7240
7241	this.cache = [];
7242	this.cache_key = null;
7243
7244	this.startText = '';
7245	this.running = false;
7246	this.runningCall = false;
7247	this.currentRow = -1;
7248	this.RESULT = null;
7249	this.CONTAINER = null;
7250	this.INPUT = null;
7251	this.WAIT = null;
7252
7253	this.ShowResult = function(result)
7254	{
7255		if(BX.type.isString(result))
7256		{
7257			_this.RESULT.innerHTML = result;
7258		}
7259
7260		_this.RESULT.style.display = _this.RESULT.innerHTML !== '' ? 'block' : 'none';
7261		var pos = _this.adjustResultNode();
7262
7263		//adjust left column to be an outline
7264		var res_pos;
7265		var th;
7266		var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true);
7267		if(tbl)
7268		{
7269			th = BX.findChild(tbl, {'tag':'th'}, true);
7270		}
7271
7272		if(th)
7273		{
7274			var tbl_pos = BX.pos(tbl);
7275			tbl_pos.width = tbl_pos.right - tbl_pos.left;
7276
7277			var th_pos = BX.pos(th);
7278			th_pos.width = th_pos.right - th_pos.left;
7279			th.style.width = th_pos.width + 'px';
7280
7281			_this.RESULT.style.width = (pos.width + th_pos.width) + 'px';
7282
7283			//Move table to left by width of the first column
7284			_this.RESULT.style.left = (pos.left - th_pos.width - 1)+ 'px';
7285
7286			//Shrink table when it's too wide
7287			if((tbl_pos.width - th_pos.width) > pos.width)
7288				_this.RESULT.style.width = (pos.width + th_pos.width -1) + 'px';
7289
7290			//Check if table is too wide and shrink result div to it's width
7291			tbl_pos = BX.pos(tbl);
7292			res_pos = BX.pos(_this.RESULT);
7293			if(res_pos.right > tbl_pos.right)
7294			{
7295				_this.RESULT.style.width = (tbl_pos.right - tbl_pos.left) + 'px';
7296			}
7297		}
7298
7299		var fade;
7300		if(tbl) fade = BX.findChild(_this.RESULT, {'class':'title-search-fader'}, true);
7301		if(fade && th)
7302		{
7303			res_pos = BX.pos(_this.RESULT);
7304			fade.style.left = (res_pos.right - res_pos.left - 18) + 'px';
7305			fade.style.width = 18 + 'px';
7306			fade.style.top = 0 + 'px';
7307			fade.style.height = (res_pos.bottom - res_pos.top) + 'px';
7308			fade.style.display = 'block';
7309		}
7310	};
7311
7312	this.onKeyPress = function(keyCode)
7313	{
7314		var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true);
7315		if(!tbl)
7316			return false;
7317
7318		var i;
7319		var cnt = tbl.rows.length;
7320
7321		switch (keyCode)
7322		{
7323		case 27: // escape key - close search div
7324			_this.RESULT.style.display = 'none';
7325			_this.currentRow = -1;
7326			_this.UnSelectAll();
7327		return true;
7328
7329		case 40: // down key - navigate down on search results
7330			if(_this.RESULT.style.display == 'none')
7331				_this.RESULT.style.display = 'block';
7332
7333			var first = -1;
7334			for(i = 0; i < cnt; i++)
7335			{
7336				if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true))
7337				{
7338					if(first == -1)
7339						first = i;
7340
7341					if(_this.currentRow < i)
7342					{
7343						_this.currentRow = i;
7344						break;
7345					}
7346					else if(tbl.rows[i].className == 'title-search-selected')
7347					{
7348						tbl.rows[i].className = '';
7349					}
7350				}
7351			}
7352
7353			if(i == cnt && _this.currentRow != i)
7354				_this.currentRow = first;
7355
7356			tbl.rows[_this.currentRow].className = 'title-search-selected';
7357		return true;
7358
7359		case 38: // up key - navigate up on search results
7360			if(_this.RESULT.style.display == 'none')
7361				_this.RESULT.style.display = 'block';
7362
7363			var last = -1;
7364			for(i = cnt-1; i >= 0; i--)
7365			{
7366				if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true))
7367				{
7368					if(last == -1)
7369						last = i;
7370
7371					if(_this.currentRow > i)
7372					{
7373						_this.currentRow = i;
7374						break;
7375					}
7376					else if(tbl.rows[i].className == 'title-search-selected')
7377					{
7378						tbl.rows[i].className = '';
7379					}
7380				}
7381			}
7382
7383			if(i < 0 && _this.currentRow != i)
7384				_this.currentRow = last;
7385
7386			tbl.rows[_this.currentRow].className = 'title-search-selected';
7387		return true;
7388
7389		case 13: // enter key - choose current search result
7390			if(_this.RESULT.style.display == 'block')
7391			{
7392				for(i = 0; i < cnt; i++)
7393				{
7394					if(_this.currentRow == i)
7395					{
7396						if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true))
7397						{
7398							var a = BX.findChild(tbl.rows[i], {'tag':'a'}, true);
7399							if(a)
7400							{
7401								window.location = a.href;
7402								return true;
7403							}
7404						}
7405					}
7406				}
7407			}
7408		return false;
7409		}
7410
7411		return false;
7412	};
7413
7414	this.onTimeout = function()
7415	{
7416		_this.onChange(function(){
7417			setTimeout(_this.onTimeout, 500);
7418		});
7419	};
7420
7421	this.onChange = function(callback)
7422	{
7423		if (_this.running)
7424		{
7425			_this.runningCall = true;
7426			return;
7427		}
7428		_this.running = true;
7429
7430		if(_this.INPUT.value != _this.oldValue && _this.INPUT.value != _this.startText)
7431		{
7432			_this.oldValue = _this.INPUT.value;
7433			if(_this.INPUT.value.length >= _this.arParams.MIN_QUERY_LEN)
7434			{
7435				_this.cache_key = _this.arParams.INPUT_ID + '|' + _this.INPUT.value;
7436				if(_this.cache[_this.cache_key] == null)
7437				{
7438					if(_this.WAIT)
7439					{
7440						var pos = BX.pos(_this.INPUT);
7441						var height = (pos.bottom - pos.top)-2;
7442						_this.WAIT.style.top = (pos.top+1) + 'px';
7443						_this.WAIT.style.height = height + 'px';
7444						_this.WAIT.style.width = height + 'px';
7445						_this.WAIT.style.left = (pos.right - height + 2) + 'px';
7446						_this.WAIT.style.display = 'block';
7447					}
7448
7449					BX.ajax.post(
7450						_this.arParams.AJAX_PAGE,
7451						{
7452							'ajax_call':'y',
7453							'INPUT_ID':_this.arParams.INPUT_ID,
7454							'q':_this.INPUT.value,
7455							'l':_this.arParams.MIN_QUERY_LEN
7456						},
7457						function(result)
7458						{
7459							_this.cache[_this.cache_key] = result;
7460							_this.ShowResult(result);
7461							_this.currentRow = -1;
7462							_this.EnableMouseEvents();
7463							if(_this.WAIT)
7464								_this.WAIT.style.display = 'none';
7465							if (!!callback)
7466								callback();
7467							_this.running = false;
7468							if (_this.runningCall)
7469							{
7470								_this.runningCall = false;
7471								_this.onChange();
7472							}
7473						}
7474					);
7475					return;
7476				}
7477				else
7478				{
7479					_this.ShowResult(_this.cache[_this.cache_key]);
7480					_this.currentRow = -1;
7481					_this.EnableMouseEvents();
7482				}
7483			}
7484			else
7485			{
7486				_this.RESULT.style.display = 'none';
7487				_this.currentRow = -1;
7488				_this.UnSelectAll();
7489			}
7490		}
7491		if (!!callback)
7492			callback();
7493		_this.running = false;
7494	};
7495
7496	this.onScroll = function ()
7497	{
7498		if(BX.type.isElementNode(_this.RESULT)
7499			&& _this.RESULT.style.display !== "none"
7500			&& _this.RESULT.innerHTML !== ''
7501		)
7502		{
7503			_this.adjustResultNode();
7504		}
7505	};
7506
7507	this.UnSelectAll = function()
7508	{
7509		var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true);
7510		if(tbl)
7511		{
7512			var cnt = tbl.rows.length;
7513			for(var i = 0; i < cnt; i++)
7514				tbl.rows[i].className = '';
7515		}
7516	};
7517
7518	this.EnableMouseEvents = function()
7519	{
7520		var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true);
7521		if(tbl)
7522		{
7523			var cnt = tbl.rows.length;
7524			for(var i = 0; i < cnt; i++)
7525				if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true))
7526				{
7527					tbl.rows[i].id = 'row_' + i;
7528					tbl.rows[i].onmouseover = function (e) {
7529						if(_this.currentRow != this.id.substr(4))
7530						{
7531							_this.UnSelectAll();
7532							this.className = 'title-search-selected';
7533							_this.currentRow = this.id.substr(4);
7534						}
7535					};
7536					tbl.rows[i].onmouseout = function (e) {
7537						this.className = '';
7538						_this.currentRow = -1;
7539					};
7540				}
7541		}
7542	};
7543
7544	this.onFocusLost = function(hide)
7545	{
7546		setTimeout(function(){_this.RESULT.style.display = 'none';}, 250);
7547	};
7548
7549	this.onFocusGain = function()
7550	{
7551		if(_this.RESULT.innerHTML.length)
7552			_this.ShowResult();
7553	};
7554
7555	this.onKeyDown = function(e)
7556	{
7557		if(!e)
7558			e = window.event;
7559
7560		if (_this.RESULT.style.display == 'block')
7561		{
7562			if(_this.onKeyPress(e.keyCode))
7563				return BX.PreventDefault(e);
7564		}
7565	};
7566
7567	this.adjustResultNode = function()
7568	{
7569		if(!(BX.type.isElementNode(_this.RESULT)
7570			&& BX.type.isElementNode(_this.CONTAINER))
7571		)
7572		{
7573			return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
7574		}
7575
7576		var pos = BX.pos(_this.CONTAINER);
7577
7578		_this.RESULT.style.position = 'absolute';
7579		_this.RESULT.style.top = (pos.bottom + 2) + 'px';
7580		_this.RESULT.style.left = pos.left + 'px';
7581		_this.RESULT.style.width = pos.width + 'px';
7582
7583		return pos;
7584	};
7585
7586	this._onContainerLayoutChange = function()
7587	{
7588		if(BX.type.isElementNode(_this.RESULT)
7589			&& _this.RESULT.style.display !== "none"
7590			&& _this.RESULT.innerHTML !== ''
7591		)
7592		{
7593			_this.adjustResultNode();
7594		}
7595	};
7596	this.Init = function()
7597	{
7598		this.CONTAINER = document.getElementById(this.arParams.CONTAINER_ID);
7599		BX.addCustomEvent(this.CONTAINER, "OnNodeLayoutChange", this._onContainerLayoutChange);
7600
7601		this.RESULT = document.body.appendChild(document.createElement("DIV"));
7602		this.RESULT.className = 'title-search-result';
7603		this.INPUT = document.getElementById(this.arParams.INPUT_ID);
7604		this.startText = this.oldValue = this.INPUT.value;
7605		BX.bind(this.INPUT, 'focus', function() {_this.onFocusGain()});
7606		BX.bind(this.INPUT, 'blur', function() {_this.onFocusLost()});
7607		this.INPUT.onkeydown = this.onKeyDown;
7608
7609		if(this.arParams.WAIT_IMAGE)
7610		{
7611			this.WAIT = document.body.appendChild(document.createElement("DIV"));
7612			this.WAIT.style.backgroundImage = "url('" + this.arParams.WAIT_IMAGE + "')";
7613			if(!BX.browser.IsIE())
7614				this.WAIT.style.backgroundRepeat = 'none';
7615			this.WAIT.style.display = 'none';
7616			this.WAIT.style.position = 'absolute';
7617			this.WAIT.style.zIndex = '1100';
7618		}
7619
7620		BX.bind(this.INPUT, 'bxchange', function() {_this.onChange()});
7621
7622		var fixedParent = BX.findParent(this.CONTAINER, BX.is_fixed);
7623		if(BX.type.isElementNode(fixedParent))
7624		{
7625			BX.bind(window, 'scroll', BX.throttle(this.onScroll, 100, this));
7626		}
7627	};
7628	BX.ready(function (){_this.Init(arParams)});
7629}
7630
7631/* End */
7632;
7633; /* Start:"a:4:{s:4:"full";s:90:"/local/templates/aspro-medc2/components/bitrix/search.title/fixed/script.
7633js?16569236389866";s:6:"source";s:75:"/local/templates/aspro-medc2/components/bitrix/search.title/fixed/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
7634function JCTitleSearch2(arParams)
7635{
7636	var _this = this;
7637
7638	this.arParams = {
7639		'AJAX_PAGE': arParams.AJAX_PAGE,
7640		'CONTAINER_ID': arParams.CONTAINER_ID,
7641		'INPUT_ID': arParams.INPUT_ID,
7642		'MIN_QUERY_LEN': parseInt(arParams.MIN_QUERY_LEN)
7643	};
7644	if(arParams.WAIT_IMAGE)
7645		this.arParams.WAIT_IMAGE = arParams.WAIT_IMAGE;
7646	if(arParams.MIN_QUERY_LEN <= 0)
7647		arParams.MIN_QUERY_LEN = 1;
7648
7649	this.cache = [];
7650	this.cache_key = null;
7651
7652	this.startText = '';
7653	this.running = false;
7654	this.currentRow = -1;
7655	this.RESULT = null;
7656	this.CONTAINER = null;
7657	this.INPUT = null;
7658	this.WAIT = null;
7659
7660	this.ShowResult = function(result)
7661	{
7662		if(BX.type.isString(result))
7663		{
7664			_this.RESULT.innerHTML = result;
7665		}
7666
7667		_this.RESULT.style.display = _this.RESULT.innerHTML !== '' ? 'block' : 'none';
7668		var pos = _this.adjustResultNode();
7669
7670		//adjust left column to be an outline
7671		var res_pos;
7672		var th;
7673		var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true);
7674		if(tbl)
7675		{
7676			th = BX.findChild(tbl, {'tag':'th'}, true);
7677		}
7678		if(th)
7679		{
7680			var tbl_pos = BX.pos(tbl);
7681			tbl_pos.width = tbl_pos.right - tbl_pos.left;
7682
7683			var th_pos = BX.pos(th);
7684			th_pos.width = th_pos.right - th_pos.left;
7685			th.style.width = th_pos.width + 'px';
7686
7687			_this.RESULT.style.width = (pos.width + th_pos.width) + 'px';
7688
7689			//Move table to left by width of the first column
7690			_this.RESULT.style.left = (pos.left - th_pos.width - 1)+ 'px';
7691
7692			//Shrink table when it's too wide
7693			if((tbl_pos.width - th_pos.width) > pos.width)
7694				_this.RESULT.style.width = (pos.width + th_pos.width -1) + 'px';
7695
7696			//Check if table is too wide and shrink result div to it's width
7697			tbl_pos = BX.pos(tbl);
7698			res_pos = BX.pos(_this.RESULT);
7699			if(res_pos.right > tbl_pos.right)
7700			{
7701				_this.RESULT.style.width = (tbl_pos.right - tbl_pos.left) + 'px';
7702			}
7703		}
7704
7705		var fade;
7706		if(tbl) fade = BX.findChild(_this.RESULT, {'class':'title-search-fader'}, true);
7707		if(fade && th)
7708		{
7709			res_pos = BX.pos(_this.RESULT);
7710			fade.style.left = (res_pos.right - res_pos.left - 18) + 'px';
7711			fade.style.width = 18 + 'px';
7712			fade.style.top = 0 + 'px';
7713			fade.style.height = (res_pos.bottom - res_pos.top) + 'px';
7714			fade.style.display = 'block';
7715		}
7716	};
7717
7718	this.onKeyPress = function(keyCode)
7719	{
7720		var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true);
7721		if(!tbl)
7722			return false;
7723
7724		var i;
7725		var cnt = tbl.rows.length;
7726
7727		switch (keyCode)
7728		{
7729		case 27: // escape key - close search div
7730			_this.RESULT.style.display = 'none';
7731			_this.currentRow = -1;
7732			_this.UnSelectAll();
7733		return true;
7734
7735		case 40: // down key - navigate down on search results
7736			if(_this.RESULT.style.display == 'none')
7737				_this.RESULT.style.display = 'block';
7738
7739			var first = -1;
7740			for(i = 0; i < cnt; i++)
7741			{
7742				if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true))
7743				{
7744					if(first == -1)
7745						first = i;
7746
7747					if(_this.currentRow < i)
7748					{
7749						_this.currentRow = i;
7750						break;
7751					}
7752					else if(tbl.rows[i].className == 'title-search-selected')
7753					{
7754						tbl.rows[i].className = '';
7755					}
7756				}
7757			}
7758
7759			if(i == cnt && _this.currentRow != i)
7760				_this.currentRow = first;
7761
7762			tbl.rows[_this.currentRow].className = 'title-search-selected';
7763		return true;
7764
7765		case 38: // up key - navigate up on search results
7766			if(_this.RESULT.style.display == 'none')
7767				_this.RESULT.style.display = 'block';
7768
7769			var last = -1;
7770			for(i = cnt-1; i >= 0; i--)
7771			{
7772				if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true))
7773				{
7774					if(last == -1)
7775						last = i;
7776
7777					if(_this.currentRow > i)
7778					{
7779						_this.currentRow = i;
7780						break;
7781					}
7782					else if(tbl.rows[i].className == 'title-search-selected')
7783					{
7784						tbl.rows[i].className = '';
7785					}
7786				}
7787			}
7788
7789			if(i < 0 && _this.currentRow != i)
7790				_this.currentRow = last;
7791
7792			tbl.rows[_this.currentRow].className = 'title-search-selected';
7793		return true;
7794
7795		case 13: // enter key - choose current search result
7796			if(_this.RESULT.style.display == 'block')
7797			{
7798				for(i = 0; i < cnt; i++)
7799				{
7800					if(_this.currentRow == i)
7801					{
7802						if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true))
7803						{
7804							var a = BX.findChild(tbl.rows[i], {'tag':'a'}, true);
7805							if(a)
7806							{
7807								window.location = a.href;
7808								return true;
7809							}
7810						}
7811					}
7812				}
7813			}
7814		return false;
7815		}
7816
7817		return false;
7818	};
7819
7820	this.onTimeout = function()
7821	{
7822		_this.onChange(function(){
7823			setTimeout(_this.onTimeout, 500);
7824		});
7825	};
7826
7827	this.onChange = function(callback)
7828	{
7829		if (_this.running)
7830			return;
7831		_this.running = true;
7832
7833		if(_this.INPUT.value != _this.oldValue && _this.INPUT.value != _this.startText)
7834		{
7835			_this.oldValue = _this.INPUT.value;
7836			if(_this.INPUT.value.length >= _this.arParams.MIN_QUERY_LEN)
7837			{
7838				_this.cache_key = _this.arParams.INPUT_ID + '|' + _this.INPUT.value;
7839				if(_this.cache[_this.cache_key] == null)
7840				{
7841					if(_this.WAIT)
7842					{
7843						var pos = BX.pos(_this.INPUT);
7844						var height = (pos.bottom - pos.top)-2;
7845						_this.WAIT.style.top = (pos.top+1) + 'px';
7846						_this.WAIT.style.height = height + 'px';
7847						_this.WAIT.style.width = height + 'px';
7848						_this.WAIT.style.left = (pos.right - height + 2) + 'px';
7849						_this.WAIT.style.display = 'block';
7850					}
7851
7852					BX.ajax.post(
7853						_this.arParams.AJAX_PAGE,
7854						{
7855							'ajax_call':'y',
7856							'INPUT_ID':_this.arParams.INPUT_ID,
7857							'q':_this.INPUT.value,
7858							'l':_this.arParams.MIN_QUERY_LEN
7859						},
7860						function(result)
7861						{
7862							_this.cache[_this.cache_key] = result;
7863							_this.ShowResult(result);
7864							_this.currentRow = -1;
7865							_this.EnableMouseEvents();
7866							if(_this.WAIT)
7867								_this.WAIT.style.display = 'none';
7868							if (!!callback)
7869								callback();
7870							_this.running = false;
7871						}
7872					);
7873					return;
7874				}
7875				else
7876				{
7877					_this.ShowResult(_this.cache[_this.cache_key]);
7878					_this.currentRow = -1;
7879					_this.EnableMouseEvents();
7880				}
7881			}
7882			else
7883			{
7884				_this.RESULT.style.display = 'none';
7885				_this.currentRow = -1;
7886				_this.UnSelectAll();
7887			}
7888		}
7889		if (!!callback)
7890			callback();
7891		_this.running = false;
7892	};
7893
7894	this.UnSelectAll = function()
7895	{
7896		var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true);
7897		if(tbl)
7898		{
7899			var cnt = tbl.rows.length;
7900			for(var i = 0; i < cnt; i++)
7901				tbl.rows[i].className = '';
7902		}
7903	};
7904
7905	this.EnableMouseEvents = function()
7906	{
7907		var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true);
7908		if(tbl)
7909		{
7910			var cnt = tbl.rows.length;
7911			for(var i = 0; i < cnt; i++)
7912				if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true))
7913				{
7914					tbl.rows[i].id = 'row_' + i;
7915					tbl.rows[i].onmouseover = function (e) {
7916						if(_this.currentRow != this.id.substr(4))
7917						{
7918							_this.UnSelectAll();
7919							this.className = 'title-search-selected';
7920							_this.currentRow = this.id.substr(4);
7921						}
7922					};
7923					tbl.rows[i].onmouseout = function (e) {
7924						this.className = '';
7925						_this.currentRow = -1;
7926					};
7927				}
7928		}
7929	};
7930
7931	this.onFocusLost = function(hide)
7932	{
7933		setTimeout(function(){_this.RESULT.style.display = 'none';}, 150);
7934		// _this.RESULT.style.display = 'none';
7935	};
7936
7937	this.onFocusGain = function()
7938	{
7939		if(_this.RESULT.innerHTML.length)
7940			_this.ShowResult();
7941	};
7942
7943	this.onKeyDown = function(e)
7944	{
7945		if(!e)
7946			e = window.event;
7947
7948		if (_this.RESULT.style.display == 'block')
7949		{
7950			if(_this.onKeyPress(e.keyCode))
7951				return BX.PreventDefault(e);
7952		}
7953	};
7954
7955	this.adjustResultNode = function()
7956	{
7957		var pos, pos_input;
7958		var fixedParent = BX.findParent(_this.CONTAINER, BX.is_fixed);
7959		if(!!fixedParent)
7960		{
7961			_this.RESULT.style.position = 'fixed';
7962			_this.RESULT.style.zIndex = BX.style(fixedParent, 'z-index') + 2;
7963			pos = BX.pos(_this.CONTAINER, true);
7964		}
7965		else
7966		{
7967			_this.RESULT.style.position = 'absolute';
7968			pos = BX.pos(_this.CONTAINER);
7969		}
7970		pos_input = BX.pos(_this.INPUT);
7971
7972		pos.width = pos.right - pos.left;
7973		_this.RESULT.style.top = (pos.bottom + 2) + 'px';
7974		_this.RESULT.style.left = pos_input.left + 'px';
7975
7976		if($(_this.INPUT).closest('.inline-search-block.with-close').length)
7977			_this.RESULT.style.width = pos_input.width + 'px';
7978		else
7979			_this.RESULT.style.width = pos.width + 'px';
7980		return pos;
7981	};
7982
7983	this._onContainerLayoutChange = function()
7984	{
7985		if(_this.RESULT.style.display !== "none" && _this.RESULT.innerHTML !== '')
7986		{
7987			_this.adjustResultNode();
7988		}
7989	};
7990	this.Init = function()
7991	{
7992		this.CONTAINER = document.getElementById(this.arParams.CONTAINER_ID);
7993		BX.addCustomEvent(this.CONTAINER, "OnNodeLayoutChange", this._onContainerLayoutChange);
7994
7995		this.RESULT = document.body.appendChild(document.createElement("DIV"));
7996
7997		this.RESULT.className = 'title-search-result '+this.arParams.INPUT_ID;
7998		if(this.arParams.INPUT_ID != 'title-search-input_fixed')
7999			this.RESULT.className += ' '+arMedc2Options['THEME']['TYPE_SEARCH']+'_type';
8000
8001		this.INPUT = document.getElementById(this.arParams.INPUT_ID);
8002		this.startText = this.oldValue = this.INPUT.value;
8003		BX.bind(this.INPUT, 'focus', function() {_this.onFocusGain()});
8004		BX.bind(this.INPUT, 'blur', function() {_this.onFocusLost()});
8005
8006		if(BX.browser.IsSafari() || BX.browser.IsIE())
8007			this.INPUT.onkeydown = this.onKeyDown;
8008		else
8009			this.INPUT.onkeypress = this.onKeyDown;
8010
8011		if(this.arParams.WAIT_IMAGE)
8012		{
8013			this.WAIT = document.body.appendChild(document.createElement("DIV"));
8014			this.WAIT.style.backgroundImage = "url('" + this.arParams.WAIT_IMAGE + "')";
8015			if(!BX.browser.IsIE())
8016				this.WAIT.style.backgroundRepeat = 'none';
8017			this.WAIT.style.display = 'none';
8018			this.WAIT.style.position = 'absolute';
8019			this.WAIT.style.zIndex = '1100';
8020		}
8021
8022		BX.bind(this.INPUT, 'bxchange', function() {_this.onChange()});
8023	};
8024	BX.ready(function (){_this.Init(arParams)});
8025}
8026
8027/* End */
8028;
8029; /* Start:"a:4:{s:4:"full";s:78:"/local/templates/aspro-medc2/js/jquery.inputmask.bundle.min.js?165692363863835";s:6:"source";s:62:"/local/templates/aspro-medc2/js/jquery.inputmask.bundle.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
8030/*!
8031* jquery.inputmask.bundle
8032* http://github.com/RobinHerbots/jquery.inputmask
8033* Copyright (c) 2010 - 2015 Robin Herbots
8034* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
8035* Version: 3.1.64-73
8036*/
8037!function(a){function b(b){this.el=void 0,this.opts=a.extend(!0,{},this.defaults,b),this.noMasksCache=b&&void 0!==b.definitions,this.userOptions=b||{},e(this.opts.alias,b,this.opts)}function c(a){var b=document.createElement("input"),c="on"+a,d=c in b;return d||(b.setAttribute(c,"return;"),d="function"==typeof b[c]),b=null,d}function d(a){var b="text"==a||"tel"==a||"password"==a;if(!b){var c=document.createElement("input");c.setAttribute("type",a),b="text"===c.type,c=null}return b}function e(b,c,d){var f=d.aliases[b];return f?(f.alias&&e(f.alias,void 0,d),a.extend(!0,d,f),a.extend(!0,d,c),!0):(void 0==d.mask&&(d.mask=b),!1)}function f(b,c,d){var f=a(b),g=f.data("inputmask");if(g&&""!=g)try{g=g.replace(new RegExp("'","g"),'"');var h=a.parseJSON("{"+g+"}");a.extend(!0,d,h)}catch(i){}for(var j in c){var k=f.data("inputmask-"+j.toLowerCase());void 0!=k&&(k="boolean"==typeof k?k:k.toString(),"mask"==j&&0==k.indexOf("[")?(d[j]=k.replace(/[\s[\]]/g,"").split("','"),d[j][0]=d[j][0].replace("'",""),d[j][d[j].length-1]=d[j][d[j].length-1].replace("'","")):d[j]=k)}return d.alias?e(d.alias,d,c):a.extend(!0,c,d),c}function g(c,d){function e(b){function d(a,b,c,d){this.matches=[],this.isGroup=a||!1,this.isOptional=b||!1,this.isQuantifier=c||!1,this.isAlternator=d||!1,this.quantifier={min:1,max:1}}function e(b,d,e){var f=c.definitions[d],g=0==b.matches.length;if(e=void 0!=e?e:b.matches.length,f&&!m){f.placeholder=a.isFunction(f.placeholder)?f.placeholder.call(this,c):f.placeholder;
8037for(var h=f.prevalidator,i=h?h.length:0,j=1;j<f.cardinality;j++){var k=i>=j?h[j-1]:[],l=k.validator,n=k.cardinality;b.matches.splice(e++,0,{fn:l?"string"==typeof l?new RegExp(l):new function(){this.test=l}:new RegExp("."),cardinality:n?n:1,optionality:b.isOptional,newBlockMarker:g,casing:f.casing,def:f.definitionSymbol||d,placeholder:f.placeholder,mask:d})}b.matches.splice(e++,0,{fn:f.validator?"string"==typeof f.validator?new RegExp(f.validator):new function(){this.test=f.validator}:new RegExp("."),cardinality:f.cardinality,optionality:b.isOptional,newBlockMarker:g,casing:f.casing,def:f.definitionSymbol||d,placeholder:f.placeholder,mask:d})}else b.matches.splice(e++,0,{fn:null,cardinality:0,optionality:b.isOptional,newBlockMarker:g,casing:null,def:d,placeholder:void 0,mask:d}),m=!1}for(var f,g,h,i,j,k,l=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})\??|[^.?*+^${[]()|\\]+|./g,m=!1,n=new d,o=[],p=[];f=l.exec(b);)switch(g=f[0],g.charAt(0)){case c.optionalmarker.end:case c.groupmarker.end:if(h=o.pop(),o.length>0){if(i=o[o.length-1],i.matches.push(h),i.isAlternator){j=o.pop();for(var q=0;q<j.matches.length;q++)j.matches[q].isGroup=!1;o.length>0?(i=o[o.length-1],i.matches.push(j)):n.matches.push(j)}}else n.matches.push(h);break;case c.optionalmarker.start:o.push(new d(!1,!0));break;case c.groupmarker.start:o.push(new d(!0));break;case c.quantifiermarker.start:var r=new d(!1,!1,!0);g=g.replace(/[{}]/g,"");var s=g.split(","),t=isNaN(s[0])?s[0]:parseInt(s[0]),u=1==s.length?t:isNaN(s[1])?s[1]:parseInt(s[1]);if(("*"==u||"+"==u)&&(t="*"==u?0:1),r.quantifier={min:t,max:u},o.length>0){var v=o[o.length-1].matches;if(f=v.pop(),!f.isGroup){var w=new d(!0);w.matches.push(f),f=w}v.push(f),v.push(r)}else{if(f=n.matches.pop(),!f.isGroup){var w=new d(!0);w.matches.push(f),f=w}n.matches.push(f),n.matches.push(r)}break;case c.escapeChar:m=!0;break;case c.alternatormarker:o.length>0?(i=o[o.length-1],k=i.matches.pop()):k=n.matches.pop(),k.isAlternator?o.push(k):(j=new d(!1,!1,!1,!0),j.matches.push(k),o.push(j));break;default:if(o.length>0){if(i=o[o.length-1],i.matches.length>0&&!i.isAlternator&&(k=i.matches[i.matches.length-1],k.isGroup&&(k.isGroup=!1,e(k,c.groupmarker.start,0),e(k,c.groupmarker.end))),e(i,g),i.isAlternator){j=o.pop();for(var q=0;q<j.matches.length;q++)j.matches[q].isGroup=!1;o.length>0?(i=o[o.length-1],i.matches.push(j)):n.matches.push(j)}}else n.matches.length>0&&(k=n.matches[n.matches.length-1],k.isGroup&&(k.isGroup=!1,e(k,c.groupmarker.start,0),e(k,c.groupmarker.end))),e(n,g)}return n.matches.length>0&&(k=n.matches[n.matches.length-1],k.isGroup&&(k.isGroup=!1,e(k,c.groupmarker.start,0),e(k,c.groupmarker.end)),p.push(n)),p}function f(f,g){if(void 0==f||""==f)return void 0;if(1==f.length&&0==c.greedy&&0!=c.repeat&&(c.placeholder=""),c.repeat>0||"*"==c.repeat||"+"==c.repeat){var h="*"==c.repeat?0:"+"==c.repeat?1:c.repeat;f=c.groupmarker.start+f+c.groupmarker.end+c.quantifiermarker.start+h+","+c.repeat+c.quantifiermarker.end}var i;return void 0==b.prototype.masksCache[f]||d===!0?(i={mask:f,maskToken:e(f),validPositions:{},_buffer:void 0,buffer:void 0,tests:{},metadata:g},d!==!0&&(b.prototype.masksCache[f]=i)):i=a.extend(!0,{},b.prototype.masksCache[f]),i}function g(a){if(a=a.toString(),c.numericInput){a=a.split("").reverse();for(var b=0;b<a.length;b++)a[b]==c.optionalmarker.start?a[b]=c.optionalmarker.end:a[b]==c.optionalmarker.end?a[b]=c.optionalmarker.start:a[b]==c.groupmarker.start?a[b]=c.groupmarker.end:a[b]==c.groupmarker.end&&(a[b]=c.groupmarker.start);a=a.join("")}return a}var h=void 0;if(a.isFunction(c.mask)&&(c.mask=c.mask.call(this,c)),a.isArray(c.mask)){if(c.mask.length>1){c.keepStatic=void 0==c.keepStatic?!0:c.keepStatic;var i="(";return a.each(c.mask,function(b,c){i.length>1&&(i+=")|("),i+=g(void 0==c.mask||a.isFunction(c.mask)?c:c.mask)}),i+=")",f(i,c.mask)}c.mask=c.mask.pop()}return c.mask&&(h=void 0==c.mask.mask||a.isFunction(c.mask.mask)?f(g(c.mask),c.mask):f(g(c.mask.mask),c.mask)),h}function h(e,f,g){function h(a,b,c){b=b||0;var d,e,f,g=[],h=0;do{if(a===!0&&i().validPositions[h]){var j=i().validPositions[h];
8037e=j.match,d=j.locator.slice(),g.push(c===!0?j.input:H(h,e))}else f=r(h,d,h-1),e=f.match,d=f.locator.slice(),g.push(H(h,e));h++}while((void 0==fa||fa>h-1)&&null!=e.fn||null==e.fn&&""!=e.def||b>=h);return g.pop(),g}function i(){return f}function n(a){var b=i();b.buffer=void 0,b.tests={},a!==!0&&(b._buffer=void 0,b.validPositions={},b.p=0)}function o(a,b){var c=i(),d=-1,e=c.validPositions;void 0==a&&(a=-1);var f=d,g=d;for(var h in e){var j=parseInt(h);e[j]&&(b||null!=e[j].match.fn)&&(a>=j&&(f=j),j>=a&&(g=j))}return d=-1!=f&&a-f>1||a>g?f:g}function p(b,c,d){if(g.insertMode&&void 0!=i().validPositions[b]&&void 0==d){var e,f=a.extend(!0,{},i().validPositions),h=o();for(e=b;h>=e;e++)delete i().validPositions[e];i().validPositions[b]=c;var j,k=!0,l=i().validPositions;for(e=j=b;h>=e;e++){var m=f[e];if(void 0!=m)for(var n=j,p=-1;n<C()&&(null==m.match.fn&&l[e]&&(l[e].match.optionalQuantifier===!0||l[e].match.optionality===!0)||null!=m.match.fn);){if(null==m.match.fn||!g.keepStatic&&l[e]&&(void 0!=l[e+1]&&u(e+1,l[e].locator.slice(),e).length>1||void 0!=l[e].alternation)?n++:n=D(j),t(n,m.match.def)){k=A(n,m.input,!0,!0)!==!1,j=n;break}if(k=null==m.match.fn,p==n)break;p=n}if(!k)break}if(!k)return i().validPositions=a.extend(!0,{},f),!1}else i().validPositions[b]=c;return!0}function q(a,b,c,d){var e,f=a;i().p=a;for(e=f;b>e;e++)void 0!=i().validPositions[e]&&(c===!0||0!=g.canClearPosition(i(),e,o(),d,g))&&delete i().validPositions[e];for(n(!0),e=f+1;e<=o();){for(;void 0!=i().validPositions[f];)f++;var h=i().validPositions[f];f>e&&(e=f+1);var j=i().validPositions[e];void 0!=j&&void 0==h?(t(f,j.match.def)&&A(f,j.input,!0)!==!1&&(delete i().validPositions[e],e++),f++):e++}var k=o(),l=C();for(c!==!0&&void 0!=i().validPositions[k]&&i().validPositions[k].input==g.radixPoint&&delete i().validPositions[k],e=k+1;l>=e;e++)i().validPositions[e]&&delete i().validPositions[e];n(!0)}function r(a,b,c){var d=i().validPositions[a];if(void 0==d)for(var e=u(a,b,c),f=o(),h=i().validPositions[f]||u(0)[0],j=void 0!=h.alternation?h.locator[h.alternation].toString().split(","):[],k=0;k<e.length&&(d=e[k],!(d.match&&(g.greedy&&d.match.optionalQuantifier!==!0||(d.match.optionality===!1||d.match.newBlockMarker===!1)&&d.match.optionalQuantifier!==!0)&&(void 0==h.alternation||h.alternation!=d.alternation||void 0!=d.locator[h.alternation]&&z(d.locator[h.alternation].toString().split(","),j))));k++);return d}function s(a){return i().validPositions[a]?i().validPositions[a].match:u(a)[0].match}function t(a,b){for(var c=!1,d=u(a),e=0;e<d.length;e++)if(d[e].match&&d[e].match.def==b){c=!0;break}return c}function u(b,c,d,e){function f(c,d,e,g){function j(e,g,n){if(h>1e4)return alert("jquery.inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. "+i().mask),!0;if(h==b&&void 0==e.matches)return k.push({match:e,locator:g.reverse()}),!0;if(void 0!=e.matches){if(e.isGroup&&n!==!0){if(e=j(c.matches[m+1],g))return!0}else if(e.isOptional){var o=e;if(e=f(e,d,g,n)){var p=k[k.length-1].match,q=0==a.inArray(p,o.matches);if(!q)return!0;l=!0,h=b}}else if(e.isAlternator){var r,s=e,t=[],u=k.slice(),v=g.length,w=d.length>0?d.shift():-1;if(-1==w||"string"==typeof w){var x=h,y=d.slice(),z=[];"string"==typeof w&&(z=w.split(","));for(var A=0;A<s.matches.length;A++){if(k=[],e=j(s.matches[A],[A].concat(g),n)||e,e!==!0&&void 0!=e&&z[z.length-1]<s.matches.length){var B=c.matches.indexOf(e)+1;c.matches.length>B&&(e=j(c.matches[B],[B].concat(g.slice(1,g.length)),n),e&&(z.push(B.toString()),a.each(k,function(a,b){b.alternation=g.length-1})))}r=k.slice(),h=x,k=[];for(var C=0;C<y.length;C++)d[C]=y[C];for(var D=0;D<r.length;D++){var E=r[D];E.alternation=E.alternation||v;for(var F=0;F<t.length;F++){var G=t[F];if(E.match.mask==G.match.mask&&("string"!=typeof w||-1!=a.inArray(E.locator[E.alternation].toString(),z))){r.splice(D,1),D--,G.locator[E.alternation]=G.locator[E.alternation]+","+E.locator[E.alternation],G.alternation=E.alternation;break}}}t=t.concat(r)}"string"==typeof w&&(t=a.map(t,function(b,c){if(isFinite(c)){var d,e=b.alternation,f=b.locator[e].toString().split(",");b.locator[e]=void 0,b.alternation=void 0;for(var g=0;g<f.length;g++)d=-1!=a.inArray(f[g],z),d&&(void 0!=b.locator[e]?(b.locator[e]+=",",b.locator[e]+=f[g]):b.locator[e]=parseInt(f[g]),b.alternation=e);if(void 0!=b.locator[e])return b}})),k=u.concat(t),h=b,l=k.length>0}else e=s.matches[w]?j(s.matches[w],[w].concat(g),n):!1;if(e)return!0}else if(e.isQuantifier&&n!==!0)for(var H=e,I=d.length>0&&n!==!0?d.shift():0;I<(isNaN(H.quantifier.max)?I+1:H.quantifier.max)&&b>=h;I++){var J=c.matches[a.inArray(H,c.matches)-1];if(e=j(J,[I].concat(g),!0)){var p=k[k.length-1].match;p.optionalQuantifier=I>H.quantifier.min-1;var q=0==a.inArray(p,J.matches);if(q){if(I>H.quantifier.min-1){l=!0,h=b;break}return!0}return!0}}else if(e=f(e,d,g,n))return!0}else h++}for(var m=d.length>0?d.shift():0;m<c.matches.length;m++)if(c.matches[m].isQuantifier!==!0){var n=j(c.matches[m],[m].concat(e),g);
8037if(n&&h==b)return n;if(h>b)break}}var g=i().maskToken,h=c?d:0,j=c||[0],k=[],l=!1;if(e===!0&&i().tests[b])return i().tests[b];if(void 0==c){for(var m,n=b-1;void 0==(m=i().validPositions[n])&&n>-1&&(!i().tests[n]||void 0==(m=i().tests[n][0]));)n--;void 0!=m&&n>-1&&(h=n,j=m.locator.slice())}for(var o=j.shift();o<g.length;o++){var p=f(g[o],j,[o]);if(p&&h==b||h>b)break}return(0==k.length||l)&&k.push({match:{fn:null,cardinality:0,optionality:!0,casing:null,def:""},locator:[]}),i().tests[b]=a.extend(!0,[],k),i().tests[b]}function v(){return void 0==i()._buffer&&(i()._buffer=h(!1,1)),i()._buffer}function w(){return void 0==i().buffer&&(i().buffer=h(!0,o(),!0)),i().buffer}function x(a,b,c){if(c=c||w().slice(),a===!0)n(),a=0,b=c.length;else for(var d=a;b>d;d++)delete i().validPositions[d],delete i().tests[d];for(var d=a;b>d;d++)c[d]!=g.skipOptionalPartCharacter&&A(d,c[d],!0,!0)}function y(a,b){switch(b.casing){case"upper":a=a.toUpperCase();break;case"lower":a=a.toLowerCase()}return a}function z(b,c){for(var d=g.greedy?c:c.slice(0,1),e=!1,f=0;f<b.length;f++)if(-1!=a.inArray(b[f],d)){e=!0;break}return e}function A(b,c,d,e){function f(b,c,d,e){var f=!1;return a.each(u(b),function(h,j){for(var k=j.match,l=c?1:0,m="",r=(w(),k.cardinality);r>l;r--)m+=F(b-(r-1));if(c&&(m+=c),f=null!=k.fn?k.fn.test(m,i(),b,d,g):c!=k.def&&c!=g.skipOptionalPartCharacter||""==k.def?!1:{c:k.def,pos:b},f!==!1){var s=void 0!=f.c?f.c:c;s=s==g.skipOptionalPartCharacter&&null===k.fn?k.def:s;var t=b,u=w();if(void 0!=f.remove&&(a.isArray(f.remove)||(f.remove=[f.remove]),a.each(f.remove.sort(function(a,b){return b-a}),function(a,b){q(b,b+1,!0)})),void 0!=f.insert&&(a.isArray(f.insert)||(f.insert=[f.insert]),a.each(f.insert.sort(function(a,b){return a-b}),function(a,b){A(b.pos,b.c,!0)})),f.refreshFromBuffer){var v=f.refreshFromBuffer;if(d=!0,x(v===!0?v:v.start,v.end,u),void 0==f.pos&&void 0==f.c)return f.pos=o(),!1;if(t=void 0!=f.pos?f.pos:b,t!=b)return f=a.extend(f,A(t,s,!0)),!1}else if(f!==!0&&void 0!=f.pos&&f.pos!=b&&(t=f.pos,x(b,t),t!=b))return f=a.extend(f,A(t,s,!0)),!1;return 1!=f&&void 0==f.pos&&void 0==f.c?!1:(h>0&&n(!0),p(t,a.extend({},j,{input:y(s,k)}),e)||(f=!1),!1)}}),f}function h(b,c,d,e){for(var f,h,j,k,l=a.extend(!0,{},i().validPositions),m=o();m>=0&&(k=i().validPositions[m],!k||void 0==k.alternation||(f=m,h=i().validPositions[f].alternation,r(f).locator[k.alternation]==k.locator[k.alternation]));m--);if(void 0!=h){f=parseInt(f);for(var p in i().validPositions)if(p=parseInt(p),k=i().validPositions[p],p>=f&&void 0!=k.alternation){var q=i().validPositions[f].locator[h].toString().split(","),s=k.locator[h]||q[0];s.length>0&&(s=s.split(",")[0]);for(var t=0;t<q.length;t++)if(s<q[t]){for(var u,v,w=p;w>=0;w--)if(u=i().validPositions[w],void 0!=u){v=u.locator[h],u.locator[h]=parseInt(q[t]);break}if(s!=u.locator[h]){for(var x=[],y=0,z=p+1;z<o()+1;z++){var B=i().validPositions[z];B&&(null!=B.match.fn?x.push(B.input):b>z&&y++),delete i().validPositions[z],delete i().tests[z]}for(n(!0),g.keepStatic=!g.keepStatic,j=!0;x.length>0;){var C=x.shift();if(C!=g.skipOptionalPartCharacter&&!(j=A(o()+1,C,!1,!0)))break}if(u.alternation=h,u.locator[h]=v,j){for(var D=o(b)+1,E=0,z=p+1;z<o()+1;z++){var B=i().validPositions[z];B&&null==B.match.fn&&b>z&&E++}b+=E-y,j=A(b>D?D:b,c,d,e)}if(g.keepStatic=!g.keepStatic,j)return j;n(),i().validPositions=a.extend(!0,{},l)}}break}}return!1}function j(b,c){for(var d=i().validPositions[c],e=d.locator,f=e.length,g=b;c>g;g++)if(!B(g)){var h=u(g),j=h[0],k=-1;a.each(h,function(a,b){for(var c=0;f>c;c++)b.locator[c]&&z(b.locator[c].toString().split(","),e[c].toString().split(","))&&c>k&&(k=c,j=b)}),p(g,a.extend({},j,{input:j.match.def}),!0)}}d=d===!0;for(var k=w(),l=b-1;l>-1&&!i().validPositions[l];l--);for(l++;b>l;l++)void 0==i().validPositions[l]&&((!B(l)||k[l]!=H(l))&&u(l).length>1||k[l]==g.radixPoint||"0"==k[l]&&a.inArray(g.radixPoint,k)<l)&&f(l,k[l],!0);var m=b,s=!1,t=a.extend(!0,{},i().validPositions);if(m<C()&&(s=f(m,c,d,e),(!d||e)&&s===!1)){var v=i().validPositions[m];if(!v||null!=v.match.fn||v.match.def!=c&&c!=g.skipOptionalPartCharacter){if((g.insertMode||void 0==i().validPositions[D(m)])&&!B(m))for(var E=m+1,G=D(m);G>=E;E++)if(s=f(E,c,d,e),s!==!1){j(m,E),m=E;break}}else s={caret:D(m)}}if(s===!1&&g.keepStatic&&P(k)&&(s=h(b,c,d,e)),s===!0&&(s={pos:m}),a.isFunction(g.postValidation)&&0!=s&&!d){n(!0);var I=g.postValidation(w(),g);if(!I)return n(!0),i().validPositions=a.extend(!0,{},t),!1}return s}function B(a){var b=s(a);if(null!=b.fn)return b.fn;if(!g.keepStatic&&void 0==i().validPositions[a]){for(var c=u(a),d=!0,e=0;e<c.length;
8037e++)if(""!=c[e].match.def&&(void 0==c[e].alternation||c[e].locator[c[e].alternation].length>1)){d=!1;break}return d}return!1}function C(){var a;fa=ea.prop("maxLength"),-1==fa&&(fa=void 0);var b,c=o(),d=i().validPositions[c],e=void 0!=d?d.locator.slice():void 0;for(b=c+1;void 0==d||null!=d.match.fn||null==d.match.fn&&""!=d.match.def;b++)d=r(b,e,b-1),e=d.locator.slice();var f=s(b-1);return a=""!=f.def?b:b-1,void 0==fa||fa>a?a:fa}function D(a){var b=C();if(a>=b)return b;for(var c=a;++c<b&&!B(c)&&(g.nojumps!==!0||g.nojumpsThreshold>c););return c}function E(a){var b=a;if(0>=b)return 0;for(;--b>0&&!B(b););return b}function F(a){return void 0==i().validPositions[a]?H(a):i().validPositions[a].input}function G(b,c,d,e,f){if(e&&a.isFunction(g.onBeforeWrite)){var h=g.onBeforeWrite.call(b,e,c,d,g);if(h){if(h.refreshFromBuffer){var i=h.refreshFromBuffer;x(i===!0?i:i.start,i.end,h.buffer),n(!0),c=w()}d=h.caret||d}}b._valueSet(c.join("")),void 0!=d&&M(b,d),f===!0&&(ia=!0,a(b).trigger("input"))}function H(a,b){if(b=b||s(a),void 0!=b.placeholder)return b.placeholder;if(null==b.fn){if(!g.keepStatic&&void 0==i().validPositions[a]){for(var c,d=u(a),e=!1,f=0;f<d.length;f++){if(c&&""!=d[f].match.def&&d[f].match.def!=c.match.def&&(void 0==d[f].alternation||d[f].alternation==c.alternation)){e=!0;break}1!=d[f].match.optionality&&1!=d[f].match.optionalQuantifier&&(c=d[f])}if(e)return g.placeholder.charAt(a%g.placeholder.length)}return b.def}return g.placeholder.charAt(a%g.placeholder.length)}function I(b,c,d,e){function f(){var a=!1,b=v().slice(j,D(j)).join("").indexOf(h);if(-1!=b&&!B(j)){a=!0;for(var c=v().slice(j,j+b),d=0;d<c.length;d++)if(" "!=c[d]){a=!1;break}}return a}var g=void 0!=e?e.slice():b._valueGet().split(""),h="",j=0;if(n(),i().p=D(-1),c&&b._valueSet(""),!d){var k=v().slice(0,D(-1)).join(""),l=g.join("").match(new RegExp("^"+J(k),"g"));l&&l.length>0&&(g.splice(0,l.length*k.length),j=D(j))}a.each(g,function(c,e){var g=a.Event("keypress");g.which=e.charCodeAt(0),h+=e;var k=o(void 0,!0),l=i().validPositions[k],m=r(k+1,l?l.locator.slice():void 0,k);if(!f()||d){var n=d?c:null==m.match.fn&&m.match.optionality&&k+1<i().p?k+1:i().p;V.call(b,g,!0,!1,d,n),j=n+1,h=""}else V.call(b,g,!0,!1,!0,k+1)}),c&&G(b,w(),a(b).is(":focus")?D(o(0)):void 0,a.Event("checkval"))}function J(a){return b.escapeRegex(a)}function K(b){if(b[0].inputmask&&!b.hasClass("hasDatepicker")){var c=[],d=i().validPositions;for(var e in d)d[e].match&&null!=d[e].match.fn&&c.push(d[e].input);var f=(ga?c.reverse():c).join(""),h=(ga?w().slice().reverse():w()).join("");return a.isFunction(g.onUnMask)&&(f=g.onUnMask.call(b,h,f,g)||f),f}return b[0]._valueGet()}function L(a){if(ga&&"number"==typeof a&&(!g.greedy||""!=g.placeholder)){var b=w().length;a=b-a}return a}function M(b,c,d){var e,f=b.jquery&&b.length>0?b[0]:b;if("number"!=typeof c)return f.setSelectionRange?(c=f.selectionStart,d=f.selectionEnd):window.getSelection?(e=window.getSelection().getRangeAt(0),(e.commonAncestorContainer.parentNode==f||e.commonAncestorContainer==f)&&(c=e.startOffset,d=e.endOffset)):document.selection&&document.selection.createRange&&(e=document.selection.createRange(),c=0-e.duplicate().moveStart("character",-1e5),d=c+e.text.length),{begin:L(c),end:L(d)};if(c=L(c),d=L(d),d="number"==typeof d?d:c,a(f).is(":visible")){var h=a(f).css("font-size").replace("px","")*d;if(f.scrollLeft=h>f.scrollWidth?h:0,k||0!=g.insertMode||c!=d||d++,f.setSelectionRange)f.selectionStart=c,f.selectionEnd=d;else if(window.getSelection){if(e=document.createRange(),void 0==f.firstChild){var i=document.createTextNode("");f.appendChild(i)}e.setStart(f.firstChild,c<f._valueGet().length?c:f._valueGet().length),e.setEnd(f.firstChild,d<f._valueGet().length?d:f._valueGet().length),e.collapse(!0);var j=window.getSelection();j.removeAllRanges(),j.addRange(e)}else f.createTextRange&&(e=f.createTextRange(),e.collapse(!0),e.moveEnd("character",d),e.moveStart("character",c),e.select())}}function N(b){var c,d,e=w(),f=e.length,g=o(),h={},j=i().validPositions[g],k=void 0!=j?j.locator.slice():void 0;for(c=g+1;c<e.length;c++)d=r(c,k,c-1),k=d.locator.slice(),h[c]=a.extend(!0,{},d);var l=j&&void 0!=j.alternation?j.locator[j.alternation]:void 0;for(c=f-1;c>g&&(d=h[c],(d.match.optionality||d.match.optionalQuantifier||l&&(l!=h[c].locator[j.alternation]&&null!=d.match.fn||null==d.match.fn&&d.locator[j.alternation]&&z(d.locator[j.alternation].toString().split(","),l.split(","))&&""!=u(c)[0].def))&&e[c]==H(c,d.match));c--)f--;return b?{l:f,def:h[f]?h[f].match:void 0}:f}function O(a){for(var b=N(),c=a.length-1;c>b&&!B(c);c--);return a.splice(b,c+1-b),a}function P(b){if(a.isFunction(g.isComplete))return g.isComplete.call(ea,b,g);if("*"==g.repeat)return void 0;{var c=!1,d=N(!0),e=E(d.l);o()}if(void 0==d.def||d.def.newBlockMarker||d.def.optionality||d.def.optionalQuantifier){c=!0;for(var f=0;e>=f;f++){var h=r(f).match;if(null!=h.fn&&void 0==i().validPositions[f]&&h.optionality!==!0&&h.optionalQuantifier!==!0||null==h.fn&&b[f]!=H(f,h)){c=!1;break}}}return c}function Q(a,b){return ga?a-b>1||a-b==1&&g.insertMode:b-a>1||b-a==1&&g.insertMode}function R(c){var d=a._data(c).events,e=!1;a.each(d,function(c,d){a.each(d,function(a,c){if("inputmask"==c.namespace&&"setvalue"!=c.type){var d=c.handler;
8037c.handler=function(a){if(!(this.disabled||this.readOnly&&!("keydown"==a.type&&a.ctrlKey&&67==a.keyCode||a.keyCode==b.keyCode.TAB))){switch(a.type){case"input":if(ia===!0||e===!0)return ia=!1,a.preventDefault();break;case"keydown":ha=!1,e=!1;break;case"keypress":if(ha===!0)return a.preventDefault();ha=!0;break;case"compositionstart":e=!0;break;case"compositionupdate":ia=!0;break;case"compositionend":e=!1}return d.apply(this,arguments)}a.preventDefault()}}})})}function S(b){function c(b){if(void 0==a.valHooks[b]||1!=a.valHooks[b].inputmaskpatch){var c=a.valHooks[b]&&a.valHooks[b].get?a.valHooks[b].get:function(a){return a.value},d=a.valHooks[b]&&a.valHooks[b].set?a.valHooks[b].set:function(a,b){return a.value=b,a};a.valHooks[b]={get:function(b){a(b);if(b.inputmask){if(b.inputmask.opts.autoUnmask)return b.inputmask.unmaskedvalue();var d=c(b),e=b.inputmask.maskset,f=e._buffer;return f=f?f.join(""):"",d!=f?d:""}return c(b)},set:function(b,c){var e,f=a(b);return e=d(b,c),b.inputmask&&f.triggerHandler("setvalue.inputmask"),e},inputmaskpatch:!0}}}function d(){a(this);return this.inputmask?this.inputmask.opts.autoUnmask?this.inputmask.unmaskedvalue():g.call(this)!=v().join("")?g.call(this):"":g.call(this)}function e(b){h.call(this,b),this.inputmask&&a(this).triggerHandler("setvalue.inputmask")}function f(b){a(b).bind("mouseenter.inputmask",function(b){var c=a(this),d=this,e=d._valueGet();""!=e&&e!=w().join("")&&c.triggerHandler("setvalue.inputmask")});
8038//!! the bound handlers are executed in the order they where bound
8039var c=a._data(b).events,d=c.mouseover;if(d){for(var e=d[d.length-1],f=d.length-1;f>0;f--)d[f]=d[f-1];d[0]=e}}var g,h;if(!b._valueGet){var i;Object.getOwnPropertyDescriptor&&void 0==b.value?(g=function(){return this.textContent},h=function(a){this.textContent=a},Object.defineProperty(b,"value",{get:d,set:e})):((i=Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(b,"value"))&&i.configurable,document.__lookupGetter__&&b.__lookupGetter__("value")?(g=b.__lookupGetter__("value"),h=b.__lookupSetter__("value"),b.__defineGetter__("value",d),b.__defineSetter__("value",e)):(g=function(){return b.value},h=function(a){b.value=a},c(b.type),f(b))),b._valueGet=function(a){return ga&&a!==!0?g.call(this).split("").reverse().join(""):g.call(this)},b._valueSet=function(a){h.call(this,ga?a.split("").reverse().join(""):a)}}}function T(c,d,e,f){function h(){if(g.keepStatic){n(!0);var b,d=[],e=a.extend(!0,{},i().validPositions);for(b=o();b>=0;b--){var f=i().validPositions[b];if(f&&(null!=f.match.fn&&d.push(f.input),delete i().validPositions[b],void 0!=f.alternation&&f.locator[f.alternation]==r(b).locator[f.alternation]))break}if(b>-1)for(;d.length>0;){i().p=D(o());var h=a.Event("keypress");h.which=d.pop().charCodeAt(0),V.call(c,h,!0,!1,!1,i().p)}else i().validPositions=a.extend(!0,{},e)}}if((g.numericInput||ga)&&(d==b.keyCode.BACKSPACE?d=b.keyCode.DELETE:d==b.keyCode.DELETE&&(d=b.keyCode.BACKSPACE),ga)){var j=e.end;e.end=e.begin,e.begin=j}if(d==b.keyCode.BACKSPACE&&(e.end-e.begin<1||0==g.insertMode)?(e.begin=E(e.begin),void 0==i().validPositions[e.begin]||i().validPositions[e.begin].input!=g.groupSeparator&&i().validPositions[e.begin].input!=g.radixPoint||e.begin--):d==b.keyCode.DELETE&&e.begin==e.end&&(e.end=B(e.end)?e.end+1:D(e.end)+1,void 0==i().validPositions[e.begin]||i().validPositions[e.begin].input!=g.groupSeparator&&i().validPositions[e.begin].input!=g.radixPoint||e.end++),q(e.begin,e.end,!1,f),f!==!0){h();var k=o(e.begin);k<e.begin?(-1==k&&n(),i().p=D(k)):i().p=e.begin}}function U(d){var e=this,f=a(e),h=d.keyCode,k=M(e);h==b.keyCode.BACKSPACE||h==b.keyCode.DELETE||j&&127==h||d.ctrlKey&&88==h&&!c("cut")?(d.preventDefault(),88==h&&(aa=w().join("")),T(e,h,k),G(e,w(),i().p,d,aa!=w().join("")),e._valueGet()==v().join("")?f.trigger("cleared"):P(w())===!0&&f.trigger("complete"),g.showTooltip&&f.prop("title",i().mask)):h==b.keyCode.END||h==b.keyCode.PAGE_DOWN?setTimeout(function(){var a=D(o());g.insertMode||a!=C()||d.shiftKey||a--,M(e,d.shiftKey?k.begin:a,a)},0):h==b.keyCode.HOME&&!d.shiftKey||h==b.keyCode.PAGE_UP?M(e,0,d.shiftKey?k.begin:0):(g.undoOnEscape&&h==b.keyCode.ESCAPE||90==h&&d.ctrlKey)&&d.altKey!==!0?(I(e,!0,!1,aa.split("")),f.click()):h!=b.keyCode.INSERT||d.shiftKey||d.ctrlKey?0!=g.insertMode||d.shiftKey||(h==b.keyCode.RIGHT?setTimeout(function(){var a=M(e);M(e,a.begin)},0):h==b.keyCode.LEFT&&setTimeout(function(){var a=M(e);M(e,ga?a.begin+1:a.begin-1)},0)):(g.insertMode=!g.insertMode,M(e,g.insertMode||k.begin!=C()?k.begin:k.begin-1)),g.onKeyDown.call(this,d,w(),M(e).begin,g),ja=-1!=a.inArray(h,g.ignorables)}
8039function V(c,d,e,f,h){var j=this,k=a(j),l=c.which||c.charCode||c.keyCode;if(!(d===!0||c.ctrlKey&&c.altKey)&&(c.ctrlKey||c.metaKey||ja))return!0;if(l){46==l&&0==c.shiftKey&&","==g.radixPoint&&(l=44);var m,o=d?{begin:h,end:h}:M(j),q=String.fromCharCode(l),r=Q(o.begin,o.end);r&&(i().undoPositions=a.extend(!0,{},i().validPositions),T(j,b.keyCode.DELETE,o,!0),o.begin=i().p,g.insertMode||(g.insertMode=!g.insertMode,p(o.begin,f),g.insertMode=!g.insertMode),r=!g.multi),i().writeOutBuffer=!0;var s=ga&&!r?o.end:o.begin,t=A(s,q,f);if(t!==!1){if(t!==!0&&(s=void 0!=t.pos?t.pos:s,q=void 0!=t.c?t.c:q),n(!0),void 0!=t.caret)m=t.caret;else{var v=i().validPositions;m=!g.keepStatic&&(void 0!=v[s+1]&&u(s+1,v[s].locator.slice(),s).length>1||void 0!=v[s].alternation)?s+1:D(s)}i().p=m}if(e!==!1){var y=this;if(setTimeout(function(){g.onKeyValidation.call(y,t,g)},0),i().writeOutBuffer&&t!==!1){var z=w();G(j,z,d?void 0:g.numericInput?E(m):m,c,d!==!0),d!==!0&&setTimeout(function(){P(z)===!0&&k.trigger("complete")},0)}else r&&(i().buffer=void 0,i().validPositions=i().undoPositions)}else r&&(i().buffer=void 0,i().validPositions=i().undoPositions);if(g.showTooltip&&k.prop("title",i().mask),d&&a.isFunction(g.onBeforeWrite)){var B=g.onBeforeWrite.call(this,c,w(),m,g);if(B&&B.refreshFromBuffer){var C=B.refreshFromBuffer;x(C===!0?C:C.start,C.end,B.buffer),n(!0),B.caret&&(i().p=B.caret)}}c.preventDefault()}}function W(b){var c=this,d=a(c),e=c._valueGet(!0),f=M(c);if("propertychange"==b.type&&c._valueGet().length<=C())return!0;if("paste"==b.type){var h=e.substr(0,f.begin),i=e.substr(f.end,e.length);h==v().slice(0,f.begin).join("")&&(h=""),i==v().slice(f.end).join("")&&(i=""),window.clipboardData&&window.clipboardData.getData?e=h+window.clipboardData.getData("Text")+i:b.originalEvent&&b.originalEvent.clipboardData&&b.originalEvent.clipboardData.getData&&(e=h+b.originalEvent.clipboardData.getData("text/plain")+i)}var j=e;if(a.isFunction(g.onBeforePaste)){if(j=g.onBeforePaste.call(c,e,g),j===!1)return b.preventDefault(),!1;j||(j=e)}return I(c,!1,!1,ga?j.split("").reverse():j.split("")),G(c,w(),void 0,b,!0),d.click(),P(w())===!0&&d.trigger("complete"),!1}function X(b){var c=this;I(c,!0,!1),P(w())===!0&&a(c).trigger("complete"),b.preventDefault()}function Y(a){var b=this;aa=w().join(""),(""==ca||0!=a.originalEvent.data.indexOf(ca))&&(ba=M(b))}function Z(b){var c=this,d=M(c);0==b.originalEvent.data.indexOf(ca)&&(n(),d=ba);var e=b.originalEvent.data;M(c,d.begin,d.end);for(var f=0;f<e.length;f++){var h=a.Event("keypress");h.which=e.charCodeAt(f),ha=!1,ja=!1,V.call(c,h)}setTimeout(function(){var a=i().p;G(c,w(),g.numericInput?E(a):a)},0),ca=b.originalEvent.data}function $(a){}function _(c){ea=a(c),g.showTooltip&&ea.prop("title",i().mask),("rtl"==c.dir||g.rightAlign)&&ea.css("text-align","right"),("rtl"==c.dir||g.numericInput)&&(c.dir="ltr",ea.removeAttr("dir"),c.inputmask.isRTL=!0,ga=!0),ea.unbind(".inputmask"),(ea.is(":input")&&d(ea.attr("type"))||c.isContentEditable)&&(ea.closest("form").bind("submit",function(a){aa!=w().join("")&&ea.change(),g.clearMaskOnLostFocus&&ea[0]._valueGet&&ea[0]._valueGet()==v().join("")&&ea[0]._valueSet(""),g.removeMaskOnSubmit&&ea.inputmask("remove")}).bind("reset",function(){setTimeout(function(){ea.triggerHandler("setvalue.inputmask")},0)}),ea.bind("mouseenter.inputmask",function(){var b=a(this),c=this;la=!0,!b.is(":focus")&&g.showMaskOnHover&&c._valueGet()!=w().join("")&&G(c,w())}).bind("blur.inputmask",function(b){var c=a(this),d=this;if(d.inputmask){var e=d._valueGet(),f=w().slice();ka=!0,aa!=f.join("")&&setTimeout(function(){c.change(),aa=f.join("")},0),""!=e&&(g.clearMaskOnLostFocus&&(e==v().join("")?f=[]:O(f)),P(f)===!1&&(c.trigger("incomplete"),g.clearIncomplete&&(n(),f=g.clearMaskOnLostFocus?[]:v().slice())),G(d,f,void 0,b))}}).bind("focus.inputmask",function(b){var c=(a(this),this),d=c._valueGet();g.showMaskOnFocus&&(!g.showMaskOnHover||g.showMaskOnHover&&""==d)?c._valueGet()!=w().join("")&&G(c,w(),D(o())):la===!1&&M(c,D(o())),aa=w().join("")}).bind("mouseleave.inputmask",function(){var b=a(this),c=this;if(la=!1,g.clearMaskOnLostFocus){var d=w().slice(),e=c._valueGet();b.is(":focus")||e==b.attr("placeholder")||""==e||(e==v().join("")?d=[]:O(d),G(c,d))}}).bind("click.inputmask",function(){var b=a(this),c=this;if(b.is(":focus")){var d=M(c);if(d.begin==d.end)if(g.radixFocus&&""!=g.radixPoint&&-1!=a.inArray(g.radixPoint,w())&&(ka||w().join("")==v().join("")))M(c,a.inArray(g.radixPoint,w())),ka=!1;else{var e=L(d.begin),f=D(o(e));f>e?M(c,B(e)?e:D(e)):M(c,f)}}}).bind("dblclick.inputmask",function(){var a=this;setTimeout(function(){M(a,0,D(o()))},0)}).bind(m+".inputmask dragdrop.inputmask drop.inputmask",W).bind("cut.inputmask",function(c){ia=!0;var d=this,e=a(d),f=M(d);T(d,b.keyCode.DELETE,f),G(d,w(),i().p,c,aa!=w().join("")),d._valueGet()==v().join("")&&e.trigger("cleared"),g.showTooltip&&e.prop("title",i().mask)}).bind("complete.inputmask",g.oncomplete).bind("incomplete.inputmask",g.onincomplete).bind("cleared.inputmask",g.oncleared),ea.bind("keydown.inputmask",U).bind("keypress.inputmask",V),l||ea.bind("compositionstart.inputmask",Y).bind("compositionupdate.inputmask",Z).bind("compositionend.inputmask",$),"paste"===m&&ea.bind("input.inputmask",X)),ea.bind("setvalue.inputmask",function(){var b=this,c=b._valueGet();b._valueSet(a.isFunction(g.onBeforeMask)?g.onBeforeMask.call(b,c,g)||c:c),I(b,!0,!1),aa=w().join(""),(g.clearMaskOnLostFocus||g.clearIncomplete)&&b._valueGet()==v().join("")&&b._valueSet("")}),S(c);var e=a.isFunction(g.onBeforeMask)?g.onBeforeMask.call(c,c._valueGet(),g)||c._valueGet():c._valueGet();I(c,!0,!1,e.split(""));var f=w().slice();aa=f.join("");var h;try{h=document.activeElement}catch(j){}P(f)===!1&&g.clearIncomplete&&n(),g.clearMaskOnLostFocus&&(f.join("")==v().join("")?f=[]:O(f)),G(c,f),h===c&&M(c,D(o())),R(c)}var aa,ba,ca,da,ea,fa,ga=!1,ha=!1,ia=!1,ja=!1,ka=!0,la=!0;if(void 0!=e)switch(e.action){case"isComplete":return da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,P(e.buffer);case"unmaskedvalue":return da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,ga=da.inputmask.isRTL,K(ea);case"mask":aa=w().join(""),_(e.el);break;case"format":ea=a({}),ea[0].inputmask=new b,ea[0].inputmask.opts=g,ea[0].inputmask.el=ea[0],ea[0].inputmask.maskset=f,ea[0].inputmask.isRTL=g.numericInput,g.numericInput&&(ga=!0);var ma=(a.isFunction(g.onBeforeMask)?g.onBeforeMask.call(ea,e.value,g)||e.value:e.value).split("");
8039return I(ea,!1,!1,ga?ma.reverse():ma),a.isFunction(g.onBeforeWrite)&&g.onBeforeWrite.call(this,void 0,w(),0,g),e.metadata?{value:ga?w().slice().reverse().join(""):w().join(""),metadata:ea.inputmask("getmetadata")}:ga?w().slice().reverse().join(""):w().join("");case"isValid":ea=a({}),ea[0].inputmask=new b,ea[0].inputmask.opts=g,ea[0].inputmask.el=ea[0],ea[0].inputmask.maskset=f,ea[0].inputmask.isRTL=g.numericInput,g.numericInput&&(ga=!0);var ma=e.value.split("");I(ea,!1,!0,ga?ma.reverse():ma);for(var na=w(),oa=N(),pa=na.length-1;pa>oa&&!B(pa);pa--);return na.splice(oa,pa+1-oa),P(na)&&e.value==na.join("");case"getemptymask":return da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,v();case"remove":da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,da._valueSet(K(ea)),ea.unbind(".inputmask"),da.inputmask=void 0;var qa;Object.getOwnPropertyDescriptor&&(qa=Object.getOwnPropertyDescriptor(da,"value")),qa&&qa.get?da._valueGet&&Object.defineProperty(da,"value",{get:da._valueGet,set:da._valueSet}):document.__lookupGetter__&&da.__lookupGetter__("value")&&da._valueGet&&(da.__defineGetter__("value",da._valueGet),da.__defineSetter__("value",da._valueSet));try{delete da._valueGet,delete da._valueSet}catch(ra){da._valueGet=void 0,da._valueSet=void 0}break;case"getmetadata":if(da=e.el,ea=a(da),f=da.inputmask.maskset,g=da.inputmask.opts,a.isArray(f.metadata)){for(var sa,ta=o(),ua=ta;ua>=0;ua--)if(i().validPositions[ua]&&void 0!=i().validPositions[ua].alternation){sa=i().validPositions[ua].alternation;break}return void 0!=sa?f.metadata[i().validPositions[ta].locator[sa]]:f.metadata[0]}return f.metadata}}b.prototype={defaults:{placeholder:"_",optionalmarker:{start:"[",end:"]"},quantifiermarker:{start:"{",end:"}"},groupmarker:{start:"(",end:")"},alternatormarker:"|",escapeChar:"\\",mask:null,oncomplete:a.noop,onincomplete:a.noop,oncleared:a.noop,repeat:0,greedy:!0,autoUnmask:!1,removeMaskOnSubmit:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,aliases:{},alias:null,onKeyDown:a.noop,onBeforeMask:void 0,onBeforePaste:void 0,onBeforeWrite:void 0,onUnMask:void 0,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:a.noop,skipOptionalPartCharacter:" ",showTooltip:!1,numericInput:!1,rightAlign:!1,undoOnEscape:!0,radixPoint:"",groupSeparator:"",radixFocus:!1,nojumps:!1,nojumpsThreshold:0,keepStatic:void 0,definitions:{9:{validator:"[0-9]",cardinality:1,definitionSymbol:"*"},a:{validator:"[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1,definitionSymbol:"*"},"*":{validator:"[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1}},ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123],isComplete:void 0,canClearPosition:a.noop,postValidation:void 0},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},masksCache:{},mask:function(c){var d=c.jquery&&c.length>0?c[0]:c,e=a.extend(!0,{},this.opts);f(c,e,a.extend(!0,{},this.userOptions));var i=g(e,this.noMasksCache);return void 0!=i&&(d.inputmask=new b,d.inputmask.opts=e,d.inputmask.noMasksCache=this.noMasksCache,d.inputmask.el=d,d.inputmask.maskset=i,d.inputmask.isRTL=!1,h({action:"mask",el:d},i,d.inputmask.opts)),c},unmaskedvalue:function(){return this.el?h({action:"unmaskedvalue",el:this.el}):void 0},remove:function(){return this.el?(h({action:"remove",el:this.el}),this.el.inputmask=void 0,this.el):void 0},getemptymask:function(){return this.el?h({action:"getemptymask",el:this.el}):void 0},hasMaskedValue:function(){return!this.opts.autoUnmask},isComplete:function(){return this.el?h({action:"isComplete",buffer:this.el._valueGet().split(""),el:this.el}):void 0},getmetadata:function(){return this.el?h({action:"getmetadata",el:this.el}):void 0}},b.extendDefaults=function(c){a.extend(b.prototype.defaults,c)},b.extendDefinitions=function(c){a.extend(b.prototype.defaults.definitions,c)},b.extendAliases=function(c){a.extend(b.prototype.defaults.aliases,c)},b.format=function(c,d,f){var i=a.extend(!0,{},b.prototype.defaults,d);return e(i.alias,d,i),h({action:"format",value:c,metadata:f},g(i,d&&void 0!==d.definitions),i)},b.isValid=function(c,d){var f=a.extend(!0,{},b.prototype.defaults,d);return e(f.alias,d,f),h({action:"isValid",value:c},g(f,d&&void 0!==d.definitions),f)},b.escapeRegex=function(a){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^"];return a.replace(new RegExp("(\\"+b.join("|\\")+")","gim"),"\\$1")},b.keyCode={ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91};var i=navigator.userAgent,j=null!==i.match(new RegExp("iphone","i")),k=(null!==i.match(new RegExp("android.*safari.*","i")),null!==i.match(new RegExp("android.*chrome.*","i"))),l=null!==i.match(new RegExp("android.*firefox.*","i")),m=(/Kindle/i.test(i)||/Silk/i.test(i)||/KFTT/i.test(i)||/KFOT/i.test(i)||/KFJWA/i.test(i)||/KFJWI/i.test(i)||/KFSOWI/i.test(i)||/KFTHWA/i.test(i)||/KFTHWI/i.test(i)||/KFAPWA/i.test(i)||/KFAPWI/i.test(i),c("paste")?"paste":c("input")?"input":"propertychange");return window.inputmask=b,b}(jQuery),function(a){return void 0===a.fn.inputmask&&(a.fn.inputmask=function(b,c){var d;if(c=c||{},"string"==typeof b)switch(b){case"mask":return d=new inputmask(c),this.each(function(){d.mask(this)});case"unmaskedvalue":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.unmaskedvalue():a(e).val();case"remove":return this.each(function(){this.inputmask&&this.inputmask.remove()});case"getemptymask":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.getemptymask():"";case"hasMaskedValue":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.hasMaskedValue():!1;case"isComplete":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.isComplete():!0;case"getmetadata":var e=this.jquery&&this.length>0?this[0]:this;return e.inputmask?e.inputmask.getmetadata():void 0;default:return c.alias=b,d=new inputmask(c),this.each(function(){d.mask(this)})}else{if("object"==typeof b)return d=new inputmask(b),this.each(function(){d.mask(this)});if(void 0==b)return this.each(function(){d=new inputmask(c),d.mask(this)})}}),a.fn.inputmask}(jQuery),function(a){return inputmask.extendDefinitions({h:{validator:"[01
8039][0-9]|2[0-3]",cardinality:2,prevalidator:[{validator:"[0-2]",cardinality:1}]},s:{validator:"[0-5][0-9]",cardinality:2,prevalidator:[{validator:"[0-5]",cardinality:1}]},d:{validator:"0[1-9]|[12][0-9]|3[01]",cardinality:2,prevalidator:[{validator:"[0-3]",cardinality:1}]},m:{validator:"0[1-9]|1[012]",cardinality:2,prevalidator:[{validator:"[01]",cardinality:1}]},y:{validator:"(19|20)\\d{2}",cardinality:4,prevalidator:[{validator:"[12]",cardinality:1},{validator:"(19|20)",cardinality:2},{validator:"(19|20)\\d",cardinality:3}]}}),inputmask.extendAliases({"dd/mm/yyyy":{mask:"1/2/y",placeholder:"dd/mm/yyyy",regex:{val1pre:new RegExp("[0-3]"),val1:new RegExp("0[1-9]|[12][0-9]|3[01]"),val2pre:function(a){var b=inputmask.escapeRegex.call(this,a);return new RegExp("((0[1-9]|[12][0-9]|3[01])"+b+"[01])")},val2:function(a){var b=inputmask.escapeRegex.call(this,a);return new RegExp("((0[1-9]|[12][0-9])"+b+"(0[1-9]|1[012]))|(30"+b+"(0[13-9]|1[012]))|(31"+b+"(0[13578]|1[02]))")}},leapday:"29/02/",separator:"/",yearrange:{minyear:1900,maxyear:2099},isInYearRange:function(a,b,c){if(isNaN(a))return!1;var d=parseInt(a.concat(b.toString().slice(a.length))),e=parseInt(a.concat(c.toString().slice(a.length)));return(isNaN(d)?!1:d>=b&&c>=d)||(isNaN(e)?!1:e>=b&&c>=e)},determinebaseyear:function(a,b,c){var d=(new Date).getFullYear();if(a>d)return a;if(d>b){for(var e=b.toString().slice(0,2),f=b.toString().slice(2,4);e+c>b;)e--;var g=e+f;return a>g?a:g}return d},onKeyDown:function(b,c,d,e){var f=a(this);if(b.ctrlKey&&b.keyCode==inputmask.keyCode.RIGHT){var g=new Date;f.val(g.getDate().toString()+(g.getMonth()+1).toString()+g.getFullYear().toString()),f.triggerHandler("setvalue.inputmask")}},getFrontValue:function(a,b,c){for(var d=0,e=0,f=0;f<a.length&&"2"!=a.charAt(f);f++){var g=c.definitions[a.charAt(f)];g?(d+=e,e=g.cardinality):e++}return b.join("").substr(d,e)},definitions:{1:{validator:function(a,b,c,d,e){var f=e.regex.val1.test(a);return d||f||a.charAt(1)!=e.separator&&-1=="-./".indexOf(a.charAt(1))||!(f=e.regex.val1.test("0"+a.charAt(0)))?f:(b.buffer[c-1]="0",{refreshFromBuffer:{start:c-1,end:c},pos:c,c:a.charAt(0)})},cardinality:2,prevalidator:[{validator:function(a,b,c,d,e){var f=a;isNaN(b.buffer[c+1])||(f+=b.buffer[c+1]);var g=1==f.length?e.regex.val1pre.test(f):e.regex.val1.test(f);if(!d&&!g){if(g=e.regex.val1.test(a+"0"))return b.buffer[c]=a,b.buffer[++c]="0",{pos:c,c:"0"};if(g=e.regex.val1.test("0"+a))return b.buffer[c]="0",c++,{pos:c}}return g},cardinality:1}]},2:{validator:function(a,b,c,d,e){var f=e.getFrontValue(b.mask,b.buffer,e);-1!=f.indexOf(e.placeholder[0])&&(f="01"+e.separator);var g=e.regex.val2(e.separator).test(f+a);if(!d&&!g&&(a.charAt(1)==e.separator||-1!="-./".indexOf(a.charAt(1)))&&(g=e.regex.val2(e.separator).test(f+"0"+a.charAt(0))))return b.buffer[c-1]="0",{refreshFromBuffer:{start:c-1,end:c},pos:c,c:a.charAt(0)};if(e.mask.indexOf("2")==e.mask.length-1&&g){var h=b.buffer.join("").substr(4,4)+a;if(h!=e.leapday)return!0;var i=parseInt(b.buffer.join("").substr(0,4),10);return i%4===0?i%100===0?i%400===0?!0:!1:!0:!1}return g},cardinality:2,prevalidator:[{validator:function(a,b,c,d,e){isNaN(b.buffer[c+1])||(a+=b.buffer[c+1]);var f=e.getFrontValue(b.mask,b.buffer,e);-1!=f.indexOf(e.placeholder[0])&&(f="01"+e.separator);var g=1==a.length?e.regex.val2pre(e.separator).test(f+a):e.regex.val2(e.separator).test(f+a);return d||g||!(g=e.regex.val2(e.separator).test(f+"0"+a))?g:(b.buffer[c]="0",c++,{pos:c})},cardinality:1}]},y:{validator:function(a,b,c,d,e){if(e.isInYearRange(a,e.yearrange.minyear,e.yearrange.maxyear)){var f=b.buffer.join("").substr(0,6);if(f!=e.leapday)return!0;var g=parseInt(a,10);return g%4===0?g%100===0?g%400===0?!0:!1:!0:!1}return!1},cardinality:4,prevalidator:[{validator:function(a,b,c,d,e){var f=e.isInYearRange(a,e.yearrange.minyear,e.yearrange.maxyear);if(!d&&!f){var g=e.determinebaseyear(e.yearrange.minyear,e.yearrange.maxyear,a+"0").toString().slice(0,1);if(f=e.isInYearRange(g+a,e.yearrange.minyear,e.yearrange.maxyear))return b.buffer[c++]=g.charAt(0),{pos:c};if(g=e.determinebaseyear(e.yearrange.minyear,e.yearrange.maxyear,a+"0").toString().slice(0,2),f=e.isInYearRange(g+a,e.yearrange.minyear,e.yearrange.maxyear))return b.buffer[c++]=g.charAt(0),b.buffer[c++]=g.charAt(1),{pos:c}}return f},cardinality:1},{validator:function(a,b,c,d,e){var f=e.isInYearRange(a,e.yearrange.minyear,e.yearrange.maxyear);if(!d&&!f){var g=e.determinebaseyear(e.yearrange.minyear,e.yearrange.maxyear,a).toString().slice(0,2);if(f=e.isInYearRange(a[0]+g[1]+a[1],e.yearrange.minyear,e.yearrange.maxyear))return b.buffer[c++]=g.charAt(1),{pos:c};if(g=e.determinebaseyear(e.yearrange.minyear,e.yearrange.maxyear,a).toString().slice(0,2),e.isInYearRange(g+a,e.yearrange.minyear,e.yearrange.maxyear)){var h=b.buffer.join("").substr(0,6);if(h!=e.leapday)f=!0;else{var i=parseInt(a,10);f=i%4===0?i%100===0?i%400===0?!0:!1:!0:!1}}else f=!1;if(f)return b.buffer[c-1]=g.charAt(0),b.buffer[c++]=g.charAt(1),b.buffer[c++]=a.charAt(0),{refreshFromBuffer:{start:c-3,end:c},pos:c}}return f},cardinality:2},{validator:function(a,b,c,d,e){return e.isInYearRange(a,e.yearrange.minyear,e.yearrange.maxyear)},cardinality:3}]}},insertMode:!1,autoUnmask:!1},"mm/dd/yyyy":{placeholder:"mm/dd/yyyy",alias:"dd/mm/yyyy",regex:{val2pre:function(a){var b=inputmask.escapeRegex.call(this,a);return new RegExp("((0[13-9]|1[012])"+b+"[0-3])|(02"+b+"[0-2])")},val2:function(a){var b=inputmask.escapeRegex.call(this,a);return new RegExp("((0[1-9]|1[012])"+b+"(0[1-9]|[12][0-9]))|((0[13-9]|1[012])"+b+"30)|((0[13578]|1[02])"+b+"31)")}
8039,val1pre:new RegExp("[01]"),val1:new RegExp("0[1-9]|1[012]")},leapday:"02/29/",onKeyDown:function(b,c,d,e){var f=a(this);if(b.ctrlKey&&b.keyCode==inputmask.keyCode.RIGHT){var g=new Date;f.val((g.getMonth()+1).toString()+g.getDate().toString()+g.getFullYear().toString()),f.triggerHandler("setvalue.inputmask")}}},"yyyy/mm/dd":{mask:"y/1/2",placeholder:"yyyy/mm/dd",alias:"mm/dd/yyyy",leapday:"/02/29",onKeyDown:function(b,c,d,e){var f=a(this);if(b.ctrlKey&&b.keyCode==inputmask.keyCode.RIGHT){var g=new Date;f.val(g.getFullYear().toString()+(g.getMonth()+1).toString()+g.getDate().toString()),f.triggerHandler("setvalue.inputmask")}}},"dd.mm.yyyy":{mask:"1.2.y",placeholder:"dd.mm.yyyy",leapday:"29.02.",separator:".",alias:"dd/mm/yyyy"},"dd-mm-yyyy":{mask:"1-2-y",placeholder:"dd-mm-yyyy",leapday:"29-02-",separator:"-",alias:"dd/mm/yyyy"},"mm.dd.yyyy":{mask:"1.2.y",placeholder:"mm.dd.yyyy",leapday:"02.29.",separator:".",alias:"mm/dd/yyyy"},"mm-dd-yyyy":{mask:"1-2-y",placeholder:"mm-dd-yyyy",leapday:"02-29-",separator:"-",alias:"mm/dd/yyyy"},"yyyy.mm.dd":{mask:"y.1.2",placeholder:"yyyy.mm.dd",leapday:".02.29",separator:".",alias:"yyyy/mm/dd"},"yyyy-mm-dd":{mask:"y-1-2",placeholder:"yyyy-mm-dd",leapday:"-02-29",separator:"-",alias:"yyyy/mm/dd"},datetime:{mask:"1/2/y h:s",placeholder:"dd/mm/yyyy hh:mm",alias:"dd/mm/yyyy",regex:{hrspre:new RegExp("[012]"),hrs24:new RegExp("2[0-4]|1[3-9]"),hrs:new RegExp("[01][0-9]|2[0-4]"),ampm:new RegExp("^[a|p|A|P][m|M]"),mspre:new RegExp("[0-5]"),ms:new RegExp("[0-5][0-9]")},timeseparator:":",hourFormat:"24",definitions:{h:{validator:function(a,b,c,d,e){if("24"==e.hourFormat&&24==p
8039arseInt(a,10))return b.buffer[c-1]="0",b.buffer[c]="0",{refreshFromBuffer:{start:c-1,end:c},c:"0"};var f=e.regex.hrs.test(a);if(!d&&!f&&(a.charAt(1)==e.timeseparator||-1!="-.:".indexOf(a.charAt(1)))&&(f=e.regex.hrs.test("0"+a.charAt(0))))return b.buffer[c-1]="0",b.buffer[c]=a.charAt(0),c++,{refreshFromBuffer:{start:c-2,end:c},pos:c,c:e.timeseparator};if(f&&"24"!==e.hourFormat&&e.regex.hrs24.test(a)){var g=parseInt(a,10);return 24==g?(b.buffer[c+5]="a",b.buffer[c+6]="m"):(b.buffer[c+5]="p",b.buffer[c+6]="m"),g-=12,10>g?(b.buffer[c]=g.toString(),b.buffer[c-1]="0"):(b.buffer[c]=g.toString().charAt(1),b.buffer[c-1]=g.toString().charAt(0)),{refreshFromBuffer:{start:c-1,end:c+6},c:b.buffer[c]}}return f},cardinality:2,prevalidator:[{validator:function(a,b,c,d,e){var f=e.regex.hrspre.test(a);return d||f||!(f=e.regex.hrs.test("0"+a))?f:(b.buffer[c]="0",c++,{pos:c})},cardinality:1}]},s:{validator:"[0-5][0-9]",cardinality:2,prevalidator:[{validator:function(a,b,c,d,e){var f=e.regex.mspre.test(a);return d||f||!(f=e.regex.ms.test("0"+a))?f:(b.buffer[c]="0",c++,{pos:c})},cardinality:1}]},t:{validator:function(a,b,c,d,e){return e.regex.ampm.test(a+"m")},casing:"lower",cardinality:1}},insertMode:!1,autoUnmask:!1},datetime12:{mask:"1/2/y h:s t\\m",placeholder:"dd/mm/yyyy hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"h:s t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm:ss":{mask:"h:s:s",placeholder:"hh:mm:ss",alias:"datetime",autoUnmask:!1},"hh:mm":{mask:"h:s",placeholder:"hh:mm",alias:"datetime",autoUnmask:!1},date:{alias:"dd/mm/yyyy"},"mm/yyyy":{mask:"1/y",placeholder:"mm/yyyy",leapday:"donotuse",separator:"/",alias:"mm/dd/yyyy"}}),inputmask}(jQuery),function(a){return inputmask.extendDefinitions({A:{validator:"[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1,casing:"upper"},"#":{validator:"[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1,casing:"upper"}}),inputmask.extendAliases({url:{mask:"ir",placeholder:"",separator:"",defaultPrefix:"http://",regex:{urlpre1:new RegExp("[fh]"),urlpre2:new RegExp("(ft|ht)"),urlpre3:new RegExp("(ftp|htt)"),urlpre4:new RegExp("(ftp:|http|ftps)"),urlpre5:new RegExp("(ftp:/|ftps:|http:|https)"),urlpre6:new RegExp("(ftp://|ftps:/|http:/|https:)"),urlpre7:new RegExp("(ftp://|ftps://|http://|https:/)"),urlpre8:new RegExp("(ftp://|ftps://|http://|https://)")},definitions:{i:{validator:function(a,b,c,d,e){return!0},cardinality:8,prevalidator:function(){for(var a=[],b=8,c=0;b>c;c++)a[c]=function(){var a=c;return{validator:function(b,c,d,e,f){if(f.regex["urlpre"+(a+1)]){var g,h=b;a+1-b.length>0&&(h=c.buffer.join("").substring(0,a+1-b.length)+""+h);var i=f.regex["urlpre"+(a+1)].test(h);if(!e&&!i){for(d-=a,g=0;g<f.defaultPrefix.length;g++)c.buffer[d]=f.defaultPrefix[g],d++;for(g=0;g<h.length-1;g++)c.buffer[d]=h[g],d++;return{pos:d}}return i}return!1},cardinality:a}}();return a}()},r:{validator:".",cardinality:50}},insertMode:!1,autoUnmask:!1},ip:{mask:"i[i[i]].i[i[i]].i[i[i]].i[i[i]]",definitions:{i:{validator:function(a,b,c,d,e){return c-1>-1&&"."!=b.buffer[c-1]?(a=b.buffer[c-1]+a,a=c-2>
8039-1&&"."!=b.buffer[c-2]?b.buffer[c-2]+a:"0"+a):a="00"+a,new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(a)},cardinality:1}}},email:{mask:"*{1,64}[.*{1,64}][.*{1,64}][.*{1,64}]@*{1,64}[.*{2,64}][.*{2,6}][.*{1,2}]",greedy:!1,onBeforePaste:function(a,b){return a=a.toLowerCase(),a.replace("mailto:","")},definitions:{"*":{validator:"[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]",cardinality:1,casing:"lower"}}}}),inputmask}(jQuery),function(a){return inputmask.extendAliases({numeric:{mask:function(a){function b(b){for(var c="",d=0;d<b.length;d++)c+=a.definitions[b[d]]?"\\"+b[d]:b[d];return c}if(0!==a.repeat&&isNaN(a.integerDigits)&&(a.integerDigits=a.repeat),a.repeat=0,a.groupSeparator==a.radixPoint&&("."==a.radixPoint?a.groupSeparator=",":","==a.radixPoint?a.groupSeparator=".":a.groupSeparator="")," "===a.groupSeparator&&(a.skipOptionalPartCharacter=void 0),a.autoGroup=a.autoGroup&&""!=a.groupSeparator,a.autoGroup&&("string"==typeof a.groupSize&&isFinite(a.groupSize)&&(a.groupSize=parseInt(a.groupSize)),isFinite(a.integerDigits))){var c=Math.floor(a.integerDigits/a.groupSize),d=a.integerDigits%a.groupSize;a.integerDigits=parseInt(a.integerDigits)+(0==d?c-1:c)}a.placeholder.length>1&&(a.placeholder=a.placeholder.charAt(0)),a.radixFocus=a.radixFocus&&"0"==a.placeholder,a.definitions[";"]=a.definitions["~"],a.definitions[";"].definitionSymbol="~";var e=b(a.prefix);return e+="[+]",e+="~{1,"+a.integerDigits+"}",void 0!=a.digits&&(isNaN(a.digits)||parseInt(a.digits)>0)&&(e+=a.digitsOptional?"["+(a.decimalProtect?":":a.radixPoint)+";{"+a.digits+"}]":(a.decimalProtect?":":a.radixPoint)+";{"+a.digits+"}"),""!=a.negationSymbol.back&&(e+="[-]"),e+=b(a.suffix),a.greedy=!1,e},placeholder:"",greedy:!1,digits:"*",digitsOptional:!0,radixPoint:".",radixFocus:!0,groupSize:3,autoGroup:!1,allowPlus:!0,allowMinus:!0,negationSymbol:{front:"-",back:""},integerDigits:"+",prefix:"",suffix:"",rightAlign:!0,decimalProtect:!0,min:void 0,max:void 0,step:1,insertMode:!0,autoUnmask:!1,unmaskAsNumber:!1,postFormat:function(b,c,d,e){var f=!1;b.length>=e.suffix.length&&b.join("").indexOf(e.suffix)==b.length-e.suffix.length&&(b.length=b.length-e.suffix.length,f=!0),c=c>=b.length?b.length-1:c<e.prefix.length?e.prefix.length:c;var g=!1,h=b[c];if(""==e.groupSeparator||-1!=a.inArray(e.radixPoint,b)&&c>a.inArray(e.radixPoint,b)||new RegExp("["+inputmask.escapeRegex(e.negationSymbol.front)+"+]").test(h)){if(f)for(var i=0,j=e.suffix.length;j>i;i++)b.push(e.suffix.charAt(i));return{pos:c}}var k=b.slice();h==e.groupSeparator&&(k.splice(c--,1),h=k[c]),d?h!=e.radixPoint&&(k[c]="?"):k.splice(c,0,"?");var l=k.join(""),m=l;if(l.length>0&&e.autoGroup||d&&-1!=l.indexOf(e.groupSeparator)){var n=inputmask.escapeRegex(e.groupSeparator);g=0==l.indexOf(e.groupSeparator),l=l.replace(new RegExp(n,"g"),"");var o=l.split(e.radixPoint);if(l=""==e.radixPoint?l:o[0],l!=e.prefix+"?0"&&l.length>=e.groupSize+e.prefix.length)for(var p=new RegExp("([-+]?[\\d?]+)([\\d?]{"+e.groupSize+"})");p.test(l);)l=l.replace(p,"$1"+e.groupSeparator+"$2"),l=l.replace(e.groupSeparator+e.groupSeparator,e.groupSeparator);""!=e.radixPoint&&o.length>1&&(l+=e.radixPoint+o[1])}g=m!=l,b.length=l.length;for(var i=0,j=l.length;j>i;i++)b[i]=l.charAt(i);var q=a.inArray("?",b);if(-1==q&&h==e.radixPoint&&(q=a.inArray(e.radixPoint,b)),d?b[q]=h:b.splice(q,1),!g&&f)for(var i=0,j=e.suffix.length;j>i;i++)b.push(e.suffix.charAt(i));return{pos:q,refreshFromBuffer:g,buffer:b}},onBeforeWrite:function(b,c,d,e){if(b&&"blur"==b.type){var f=c.join(""),g=f.replace(e.prefix,"");if(g=g.replace(e.suffix,""),g=g.replace(new RegExp(inputmask.escapeRegex(e.groupSeparator),"g"),""),","===e.radixPoint&&(g=g.replace(inputmask.escapeRegex(e.radixPoint),".")),isFinite(g)&&isFinite(e.min)&&parseFloat(g)<parseFloat(e.min))return a.extend(!0,{refreshFromBuffer:!0,buffer:(e.prefix+e.min).split("")},e.postFormat((e.prefix+e.min).split(""),0,!0,e));var h=""!=e.radixPoint?c.join("").split(e.radixPoint):[c.join("")],i=h[0].match(e.regex.integerPart(e)),j=2==h.length?h[1].match(e.regex.integerNPart(e)):void 0;!i||i[0]!=e.negationSymbol.front+"0"&&i[0]!=e.negationSymbol.front&&"+"!=i[0]||void 0!=j&&!j[0].match(/^0+$/)||c.splice(i.index,1);var k=a.inArray(e.radixPoint,c);if(-1!=k&&isFinite(e.digits)&&!e.digitsOptional){for(var l=1;l<=e.digits;
8039l++)(void 0==c[k+l]||c[k+l]==e.placeholder.charAt(0))&&(c[k+l]="0");return{refreshFromBuffer:!0,buffer:c}}}if(e.autoGroup){var m=e.postFormat(c,d-1,!0,e);return m.caret=d<=e.prefix.length?m.pos:m.pos+1,m}},regex:{integerPart:function(a){return new RegExp("["+inputmask.escapeRegex(a.negationSymbol.front)+"+]?\\d+")},integerNPart:function(a){return new RegExp("[\\d"+inputmask.escapeRegex(a.groupSeparator)+"]+")}},signHandler:function(a,b,c,d,e){if(!d&&e.allowMinus&&"-"===a||e.allowPlus&&"+"===a){var f=b.buffer.join("").match(e.regex.integerPart(e));if(f&&f[0].length>0)return b.buffer[f.index]==("-"===a?"+":e.negationSymbol.front)?"-"==a?""!=e.negationSymbol.back?{pos:f.index,c:e.negationSymbol.front,remove:f.index,caret:c,insert:{pos:b.buffer.length-e.suffix.length-1,c:e.negationSymbol.back}}:{pos:f.index,c:e.negationSymbol.front,remove:f.index,caret:c}:""!=e.negationSymbol.back?{pos:f.index,c:"+",remove:[f.index,b.buffer.length-e.suffix.length-1],
8040caret:c}:{pos:f.index,c:"+",remove:f.index,caret:c}:b.buffer[f.index]==("-"===a?e.negationSymbol.front:"+")?"-"==a&&""!=e.negationSymbol.back?{remove:[f.index,b.buffer.length-e.suffix.length-1],caret:c-1}:{remove:f.index,caret:c-1}:"-"==a?""!=e.negationSymbol.back?{pos:f.index,c:e.negationSymbol.front,caret:c+1,insert:{pos:b.buffer.length-e.suffix.length,c:e.negationSymbol.back}}:{pos:f.index,c:e.negationSymbol.front,caret:c+1}:{pos:f.index,c:a,caret:c+1}}return!1},radixHandler:function(b,c,d,e,f){if(!e&&b===f.radixPoint&&f.digits>0){var g=a.inArray(f.radixPoint,c.buffer),h=c.buffer.join("").match(f.regex.integerPart(f));if(-1!=g&&c.validPositions[g])return c.validPositions[g-1]?{caret:g+1}:{pos:h.index,c:h[0],caret:g+1};if(!h||"0"==h[0]&&h.index+1!=d)return c.buffer[h?h.index:d]="0",{pos:(h?h.index:d)+1}}return!1},leadingZeroHandler:function(b,c,d,e,f){var g=c.buffer.join("").match(f.regex.integerNPart(f)),h=a.inArray(f.radixPoint,c.buffer);if(g&&!e&&(-1==h||h>=d))if(0==g[0].indexOf("0")){d<f.prefix.length&&(d=g.index);var i=a.inArray(f.radixPoint,c._buffer),j=c._buffer&&c.buffer.slice(h).join("")==c._buffer.slice(i).join("")||0==parseInt(c.buffer.slice(h+1).join("")),k=c._buffer&&c.buffer.slice(g.index,h).join("")==c._buffer.slice(f.prefix.length,i).join("")||"0"==c.buffer.slice(g.index,h).join("");if(-1==h||j&&k)return c.buffer.splice(g.index,1),d=d>g.index?d-1:g.index,{pos:d,remove:g.index};if(g.index+1==d||"0"==b)return c.buffer.splice(g.index,1),d=g.index,{pos:d,remove:g.index}}else if("0"===b&&d<=g.index&&g[0]!=f.groupSeparator)return!1;return!0},postValidation:function(a,b){var c=!0,d=a.join(""),e=d.replace(b.prefix,"");return e=e.replace(b.suffix,""),e=e.replace(new RegExp(inputmask.escapeRegex(b.groupSeparator),"g"),""),","===b.radixPoint&&(e=e.replace(inputmask.escapeRegex(b.radixPoint),".")),e=e.replace(new RegExp("^"+inputmask.escapeRegex(b.negationSymbol.front)),"-"),e=e.replace(new RegExp(inputmask.escapeRegex(b.negationSymbol.back)+"$"),""),isFinite(e)&&isFinite(b.max)&&(c=parseFloat(e)<=parseFloat(b.max)),c},definitions:{"~":{validator:function(b,c,d,e,f){var g=f.signHandler(b,c,d,e,f);if(!g&&(g=f.radixHandler(b,c,d,e,f),!g&&(g=e?new RegExp("[0-9"+inputmask.escapeRegex(f.groupSeparator)+"]").test(b):new RegExp("[0-9]").test(b),g===!0&&(g=f.leadingZeroHandler(b,c,d,e,f),g===!0)))){var h=a.inArray(f.radixPoint,c.buffer);g=-1!=h&&f.digitsOptional===!1&&d>h&&!e?{pos:d,remove:d}:{pos:d}}return g},cardinality:1,prevalidator:null},"+":{validator:function(a,b,c,d,e){var f=e.signHandler(a,b,c,d,e);return!f&&(d&&e.allowMinus&&a===e.negationSymbol.front||e.allowMinus&&"-"==a||e.allowPlus&&"+"==a)&&(f="-"==a?""!=e.negationSymbol.back?{pos:c,c:"-"===a?e.negationSymbol.front:"+",caret:c+1,insert:{pos:b.buffer.length,c:e.negationSymbol.back}}:{pos:c,c:"-"===a?e.negationSymbol.front:"+",caret:c+1}:!0),f},cardinality:1,prevalidator:null,placeholder:""},"-":{validator:function(a,b,c,d,e){var f=e.signHandler(a,b,c,d,e);return!f&&d&&e.allowMinus&&a===e.negationSymbol.back&&(f=!0),f},cardinality:1,prevalidator:null,placeholder:""},":":{validator:function(a,b,c,d,e){var f=e.signHandler(a,b,c,d,e);if(!f){var g="["+inputmask.escapeRegex(e.radixPoint)+"]";f=new RegExp(g).test(a),f&&b.validPositions[c]&&b.validPositions[c].match.placeholder==e.radixPoint&&(f={caret:c+1})}return f},cardinality:1,prevalidator:null,placeholder:function(a){return a.radixPoint}}},onUnMask:function(a,b,c){var d=a.replace(c.prefix,"");return d=d.replace(c.suffix,""),d=d.replace(new RegExp(inputmask.escapeRegex(c.groupSeparator),"g"),""),c.unmaskAsNumber?(d=d.replace(inputmask.escapeRegex.call(this,c.radixPoint),"."),Number(d)):d},isComplete:function(a,b){var c=a.join(""),d=a.slice();if(b.postFormat(d,0,!0,b),d.join("")!=c)return!1;var e=c.replace(b.prefix,"");return e=e.replace(b.suffix,""),e=e.replace(new RegExp(inputmask.escapeRegex(b.groupSeparator),"g"),""),","===b.radixPoint&&(e=e.replace(inputmask.escapeRegex(b.radixPoint),".")),isFinite(e)},onBeforeMask:function(a,b){if(""!=b.radixPoint&&isFinite(a))a=a.toString().replace(".",b.radixPoint);else{var c=a.match(/,/g),d=a.match(/\./g);d&&c?d.length>c.length?(a=a.replace(/\./g,""),a=a.replace(",",b.radixPoint)):c.length>d.length?(a=a.replace(/,/g,""),a=a.replace(".",b.radixPoint)):a=a.indexOf(".")<a.indexOf(",")?a.replace(/\./g,""):a=a.replace(/,/g,""):a=a.replace(new RegExp(inputmask.escapeRegex(b.groupSeparator),"g"),"")}if(0==b.digits&&(-1!=a.indexOf(".")?a=a.substring(0,a.indexOf(".")):-1!=a.indexOf(",")&&(a=a.substring(0,a.indexOf(",")))),""!=b.radixPoint&&isFinite(b.digits)&&-1!=a.indexOf(b.radixPoint)){var e=a.split(b.radixPoint),f=e[1].match(new RegExp("\\d*"))[0];if(parseInt(b.digits)<f.toString().length){var g=Math.pow(10,parseInt(b.digits));a=Math.round(parseFloat(a)*g)/g}}return a.toString()},canClearPosition:function(b,c,d,e,f){var g=b.validPositions[c].input,h=g!=f.radixPoint&&isFinite(g)||c==d||g==f.groupSeparator||g==f.negationSymbol.front||g==f.negationSymbol.back;if(h&&isFinite(g)){var i;if(!e&&b.buffer){i=b.buffer.join("").substr(0,c).match(f.regex.integerNPart(f));var j=c+1,k=null==i||0==parseInt(i[0].replace(new RegExp(inputmask.escapeRegex(f.groupSeparator),"g"),""));if(k)for(;b.validPositions[j]&&(b.validPositions[j].input==f.groupSeparator||"0"==b.validPositions[j].input);)delete b.validPositions[j],j++}var l=[];for(var m in b.validPositions)l.push(b.validPositions[m].input);i=l.join("").match(f.regex.integerNPart(f));var n=a.inArray(f.radixPoint,b.buffer);if(i&&(-1==n||n>=c))if(0==i[0].indexOf("0"))h=i.index!=c||-1==n;else{var o=parseInt(i[0].replace(new RegExp(inputmask.escapeRegex(f.groupSeparator),"g"),""));-1!=n&&10>o&&(b.validPositions[c].input="0",b.p=f.prefix.length+1,h=!1)}}return h},onKeyDown:function(b,c,d,e){var f=a(this);if(b.ctrlKey)switch(b.keyCode){case inputmask.keyCode.UP:f.val(parseFloat(this.inputmask.unmaskedvalue())+parseInt(e.step)),f.triggerHandler("setvalue.inputmask");break;case inputmask.keyCode.DOWN:f.val(parseFloat(this.inputmask.unmaskedvalue())-parseInt(e.step)),f.triggerHandler("setvalue.inputmask")}}},currency:{prefix:"$ ",groupSeparator:",",alias:"numeric",placeholder:"0",autoGroup:!0,digits:2,digitsOptional:!1,clearMaskOnLostFocus:!1}
8040,decimal:{alias:"numeric"},integer:{alias:"numeric",digits:0,radixPoint:""},percentage:{alias:"numeric",digits:2,radixPoint:".",placeholder:"0",autoGroup:!1,min:0,max:100,suffix:" %",allowPlus:!1,allowMinus:!1}}),inputmask}(jQuery),function(a){return inputmask.extendAliases({phone:{url:"phone-codes/phone-codes.js",countrycode:"",mask:function(b){b.definitions["#"]=b.definitions[9];var c=[];return a.ajax({url:b.url,async:!1,dataType:"json",success:function(a){c=a},error:function(a,c,d){alert(d+" - "+b.url)}}),c=c.sort(function(a,b){return(a.mask||a)<(b.mask||b)?-1:1})},keepStatic:!1,nojumps:!0,nojumpsThreshold:1,onBeforeMask:function(a,b){var c=a.replace(/^0/g,"");return(c.indexOf(b.countrycode)>1||-1==c.indexOf(b.countrycode))&&(c="+"+b.countrycode+c),c}},phonebe:{alias:"phone",url:"phone-codes/phone-be.js",countrycode:"32",nojumpsThreshold:4}}),inputmask}(jQuery),function(a){return inputmask.extendAliases({Regex:{mask:"r",greedy:!1,repeat:"*",regex:null,regexTokens:null,tokenizer:/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,quantifierFilter:/[0-9]+[^,]/,isComplete:function(a,b){return new RegExp(b.regex).test(a.join(""))},definitions:{r:{validator:function(b,c,d,e,f){function g(a,b){this.matches=[],this.isGroup=a||!1,this.isQuantifier=b||!1,this.quantifier={min:1,max:1},this.repeaterPart=void 0}function h(){var a,b,c=new g,d=[];for(f.regexTokens=[];a=f.tokenizer.exec(f.regex);)switch(b=a[0],b.charAt(0)){case"(":d.push(new g(!0));break;case")":var e=d.pop();d.length>0?d[d.length-1].matches.push(e):c.matches.push(e);break;case"{":case"+":case"*":var h=new g(!1,!0);b=b.replace(/[{}]/g,"");var i=b.split(","),j=isNaN(i[0])?i[0]:parseInt(i[0]),k=1==i.length?j:isNaN(i[1])?i[1]:parseInt(i[1]);if(h.quantifier={min:j,max:k},d.length>0){var l=d[d.length-1].matches;if(a=l.pop(),!a.isGroup){var e=new g(!0);e.matches.push(a),a=e}l.push(a),l.push(h)}else{if(a=c.matches.pop(),!a.isGroup){var e=new g(!0);e.matches.push(a),a=e}c.matches.push(a),c.matches.push(h)}break;default:d.length>0?d[d.length-1].matches.push(b):c.matches.push(b)}c.matches.length>0&&f.regexTokens.push(c)}function i(b,c){var d=!1;c&&(k+="(",m++);for(var e=0;e<b.matches.length;e++){var f=b.matches[e];if(1==f.isGroup)d=i(f,!0);else if(1==f.isQuantifier){var g=a.inArray(f,b.matches),h=b.matches[g-1],j=k;if(isNaN(f.quantifier.max)){for(;f.repeaterPart&&f.repeaterPart!=k&&f.repeaterPart.length>k.length&&!(d=i(h,!0)););d=d||i(h,!0),d&&(f.repeaterPart=k),k=j+f.quantifier.max}else{for(var l=0,o=f.quantifier.max-1;o>l&&!(d=i(h,!0));l++);k=j+"{"+f.quantifier.min+","+f.quantifier.max+"}"}}else if(void 0!=f.matches)for(var p=0;p<f.length&&!(d=i(f[p],c));p++);else{var q;if("["==f.charAt(0)){q=k,q+=f;for(var r=0;m>r;r++)q+=")";var s=new RegExp("^("+q+")$");d=s.test(n)}else for(var t=0,u=f.length;u>t;t++)if("\\"!=f.charAt(t)){q=k,q+=f.substr(0,t+1),q=q.replace(/\|$/,"");for(var r=0;m>r;r++)q+=")";var s=new RegExp("^("+q+")$");if(d=s.test(n))break}k+=f}if(d)break}return c&&(k+=")",m--),d}null==f.regexTokens&&h();var j=c.buffer.slice(),k="",l=!1,m=0;j.splice(d,0,b);for(var n=j.join(""),o=0;o<f.regexTokens.length;o++){var g=f.regexTokens[o];if(l=i(g,g.isGroup))break}return l},cardinality:1}}}}),inputmask}(jQuery);
8041/* End */
8042;; /* /local/templates/aspro-medc2/js/jquery.actual.min.js?16569236381101*/
8043; /* /local/templates/aspro-medc2/js/jquery.fancybox.js?165692363848706*/
8044; /* /local/templates/aspro-medc2/vendor/jquery.easing.js?16569236378097*/
8045; /* /local/templates/aspro-medc2/vendor/jquery.appear.js?16569236373188*/
8046; /* /local/templates/aspro-medc2/vendor/jquery.cookie.js?16569236372247*/
8047; /* /local/templates/aspro-medc2/vendor/bootstrap.js?165692363727908*/
8048; /* /local/templates/aspro-medc2/vendor/flexslider/jquery.flexslider.min.js?165692363722334*/
8049; /* /local/templates/aspro-medc2/vendor/jquery.validate.min.js?165692363722254*/
8050; /* /local/templates/aspro-medc2/js/jquery.uniform.min.js?16569236388308*/
8051; /* /local/templates/aspro-medc2/js/jqModal.js?165692363811022*/
8052; /* /local/templates/aspro-medc2/js/detectmobilebrowser.js?16569236382203*/
8053; /* /local/templates/aspro-medc2/js/matchMedia.js?16569236381700*/
8054; /* /local/templates/aspro-medc2/js/jquery.waypoints.min.js?16569236388044*/
8055; /* /local/templates/aspro-medc2/js/jquery.counterup.js?16569236381069*/
8056;
8056 /* /local/templates/aspro-medc2/js/jquery.alphanumeric.js?16569236381972*/
8057; /* /local/templates/aspro-medc2/js/jquery.mobile.custom.touch.min.js?16569236387784*/
8058; /* /local/templates/aspro-medc2/js/jquery.autoresize.js?16569236383993*/
8059; /* /local/templates/aspro-medc2/js/bootstrap-datetimepicker.min.js?165692363839213*/
8060; /* /local/templates/aspro-medc2/js/bootstrap-datetimepicker.ru.js?16569236381336*/
8061; /* /local/templates/aspro-medc2/js/general.js?1656923638107092*/
8062; /* /local/templates/aspro-medc2/js/custom.js?1707475749256*/
8063; /* /local/templates/aspro-medc2/js/on-off-switch.js?165692363813287*/
8064; /* /bitrix/components/bitrix/search.title/script.js?16166753689847*/
8065; /* /local/templates/aspro-medc2/components/bitrix/search.title/fixed/script.js?16569236389866*/
8066; /* /local/templates/aspro-medc2/js/jquery.inputmask.bundle.min.js?165692363863835*/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.