PageSourceSearch

https://www.vb.kg/cache/35faadc0385dad549c1ae66de7388173_1615966251.js

js vb.kg collected 2026-10-01 08:48:03 UTC 562,829 bytes, 7,438 lines download raw bytes

1/*! _tools v0.1, 2013 - 
2* @version 0.1.2
3* @author [email protected]
4*/
5
6if(!console){
7	console = {
8		log:function(){},
9		warn:function(){},
10		error:function(){}
11	};
12}
13// Object.defineProperty(Object.prototype, "extend", {
14    // enumerable: false,
15    // value: function(from) {
16        // var props = Object.getOwnPropertyNames(from);
17        // var dest = this;
18        // props.forEach(function(name) {
19            // if (name in dest) {
20                // var destination = Object.getOwnPropertyDescriptor(from, name);
21                // Object.defineProperty(dest, name, destination);
22            // }
23        // });
24        // return this;
25    // }
26// });
27if(!JSON){
28	var JSON;JSON||(JSON={});
29	(function(){function k(a){return 10>a?"0"+a:a}function o(a){p.lastIndex=0;return p.test(a)?'"'+a.replace(p,function(a){var c=r[a];
30	return"string"===typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function m(a,j){var c,d,h,n,g=e,
31	f,b=j[a];b&&("object"===typeof b&&"function"===typeof b.toJSON)&&(b=b.toJSON(a));"function"===typeof i&&(b=i.call(j,a,b));switch(
32	typeof b){case "string":return o(b);case "number":return isFinite(b)?""+b:"null";case "boolean":case "null":return""+b;case "object":
33	if(!b)return"null";e+=l;f=[];if("[object Array]"===Object.prototype.toString.apply(b)){n=b.length;for(c=0;c<n;c+=1)f[c]=m(c,b)||
34	"null";h=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+g+"]":"["+f.join(",")+"]";e=g;return h}if(i&&"object"===typeof i){n=i.length;
35	for(c=0;c<n;c+=1)"string"===typeof i[c]&&(d=i[c],(h=m(d,b))&&f.push(o(d)+(e?": ":":")+h))}else for(d in b)Object.prototype.hasOwnProperty.call(b,d)
36	&&(h=m(d,b))&&f.push(o(d)+(e?": ":":")+h);h=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+e)+"\n"+g+"}":"{"+f.join(",")+"}";e=g;return h}}"function"
37	!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(
38	this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":
39	null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var q=
40	/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,l,r=
41	{"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;"function"!==typeof JSON.stringify&&(
42	JSON.stringify=function(a,j,c){var d;l=e="";if(typeof c==="number")for(d=0;d<c;d=d+1)l=l+" ";
42else typeof c==="string"&&(l=c);
43	if((i=j)&&typeof j!=="function"&&(typeof j!=="object"||typeof j.length!=="number"))throw Error("JSON.stringify");return m("",{
44	"":a})});"function"!==typeof JSON.parse&&(JSON.parse=function(a,e){function c(a,d){var g,f,b=a[d];if(b&&typeof b==="object")for(g in 
45	b)if(Object.prototype.hasOwnProperty.call(b,g)){f=c(b,g);f!==void 0?b[g]=f:delete b[g]}return e.call(a,d,b)}var d,a=""+a;q.lastIndex=
46	0;q.test(a)&&(a=a.replace(q,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(
47	a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(
48	/(?:^|:|,)(?:\s*\[)+/g,""))){d=eval("("+a+")");return typeof e==="function"?c({"":d},""):d}throw new SyntaxError("JSON.parse");})})();
49}
50
51var _tools = (function(lang_code,d,w){
52	var lang = {
53		'ru': {
54			date:{
55				weekdays: ["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],
56				months:  ["","Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря"]
57			},
58			convert:{
59				byteToString: ['байт', 'Кб', 'Мб', 'Гб', 'Тб', 'Пб']
60			},
61			localstore: {
62				NOT_SUPPORT: "Браузер не поддерживает локальное хранилище",
63				NAME_IS_NOT_STRING: "В качестве имени переменной может быть только строка",
64				SET_VALUE: "Не удалось записать переменную в локальное хранилище, возможно переменная слишком большая"
65			}
66		},
67		'en': {
68			date:{
69				weekdays: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
70				months:  ["","January","February","March","April","May","June","July","August","September","October","November","December"]
71			},
72			convert:{
73				byteToString: ['byte', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb']
74			},
75			localstore: {
76				NOT_SUPPORT: "Browser not support local store",
77				NAME_IS_NOT_STRING: "The name of the variable can only be a string",
78				SET_VALUE: "Failed to write the variable to the localstore, may variable is too large"
79			}
80		}
81	}
82	if(typeof(lang[lang_code]) == 'undefined'){
83		lang_code = 'ru';
84	}
85	lang = lang[lang_code];
86
87	var tools = {};
88
89	//===========================================================
90	//Работа с куками
91	var cookie = function(){
92		var obj = {
93			set: function(name,value,props){
94				props = props instanceof Object ? props : {};
95				var exp = props.expires;
96				if (typeof exp == "number") {
97					var date = new Date();
98					date.setTime(date.getTime() + exp*1000);
99					exp = props.expires = date;
100				}
101				if(exp && exp.toUTCString){
102					props.expires = exp.toUTCString();
103				}
104				value = encodeURIComponent(value);
105				var updatedCookie = name + "=" + value;
106				if(typeof(props['path']) == 'undefined'){
107					props['path'] = '/';
108				}
109				for(var propName in props){
110					updatedCookie += ";" + propName;
111					var propValue = props[propName];
112					if(propValue!==true){
113						updatedCookie+="="+propValue;
114					};
115				}
116				d.cookie = updatedCookie;
117			},
118			get:function(name){
119				var matches=d.cookie.match(new RegExp("(?:^|; )"+name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,'\\$1')+"=([^;]*)"));
120				return matches?decodeURIComponent(matches[1]):undefined;
121			},
122			remove: function(name){
123				obj.set(name, '', {expires: 'Thu, 01 Jan 1970 00:00:01 GMT', 'Max-Age': 0});
124			},
125			list:function(){
126				var str = d.cookie,
127					arr = str.split('; '),
128					r = [];
129				for(var i in arr){
130					var temp = arr[i].split('=');
131					r[temp[0]] = typeof(temp[1]) !== 'undefined' ? decodeURIComponent(temp[1]) : '';
132				}
133				return r;
134			}
135		}
136		return obj;
137	}()
138	//-------------
139	tools.cookie 		= {};
140	tools.cookie.get 	= cookie.get; 	//(name)
141	tools.cookie.set 	= cookie.set; 	//(name,value,{})
142	tools.cookie.remove = cookie.remove;//(name)
143	tools.cookie.list 	= cookie.list;	//()
144	
145	//===========================================================
146	//Работа с локальным хранилищем
147	var Localstore = (function(){
148		var support = false;
149		if(typeof(localStorage) !== 'undefined'){
150			support = true;
151		}else{
152			console.log(lang.localstore.NOT_SUPPORT);
153		}
154		var Localstore = function(){
155		}
156		
157		Localstore.prototype.valid = function(n){
158			if(!support){
159				return;
160			}
161			if(typeof(n) != 'string'){
162				throw new Error(lang.localstore.NAME_IS_NOT_STRING);
163			}
164		}
165
166		Localstore.prototype.names = function(){
167			if(!support){
168				return;
169			}
170			var n = [];
171			for(var i=0; i < localStorage.length; i++){
172				n.push(localStorage.key(i));
173			}
174			return n;
175		}
176
177		//Установить переменную в хранилище
178		Localstore.prototype.set = function(name, val){
179			if(!support){
180				return;
181			}
182			this.valid(name);
183			if(typeof(val) === 'undefined' || val === null){
184				this.remove(name);
185				return;
186			}
187			try {
188				localStorage.setItem(name, JSON.stringify(val));
189			}
190			catch (e) {
191				throw new Error(lang.localstore.SET_VALUE);
192			}
193		}
194		//Получить переменную из хранилища
195		Localstore.prototype.get = function(name){
196			if(!support){
197				return;
198			}
199			this.valid(name);
200			return JSON.parse(localStorage.getItem(name));
201		}
202		//Установлено-ли значение
203		Localstore.prototype.isset = function(name){
204			if(!support){
205				return;
206			}
207			this.valid(name);
208			var val = localStorage.getItem(name);
209			if(typeof(val) === 'undefined' || val === null){
210				return false;
211			}else{
212				return true;
213			}
214		}
215		//Удалить переменную из хранилища
216		Localstore.prototype.remove = function(name){
217			if(!support){
218				return;
219			}
220			this.Valid(name);
221			localStorage.removeItem(name);
222		}
223
224		//Удалить все переменные из хранилища
225		Localstore.prototype.clear = function(){
226			if(!support){
227				return;
228			}
229			localStorage.clear();
230		}
231		Localstore.prototype.support = support;
232		var instance = new Localstore();
233		return instance;
234	}());
235	//-------------
236	tools.localstore 		= Localstore;
237	tools.localstore.get 	= Localstore.get; 	//(name)
238	tools.localstore.set 	= Localstore.set; 	//(name,value)
239	tools.localstore.remove = Localstore.remove;//(name)
240	tools.localstore.isset  = Localstore.isset; //(name)
241	tools.localstore.names 	= Localstore.names;	//()
242	tools.localstore.clear 	= Localstore.clear;	//()
243	 
244	
245	//===========================================================
246	//toString()
247	var byte_to_size = function(count_byte, exponent_names, round_len){
248		round_len = round_len || 2;
249		count_byte = count_byte|0;
250		var exponent = 1;
251		for(var i = 1; i <= round_len; i++){
252			exponent *= 10;
253		}
254		if(count_byte == 0 || count_byte < 0){
255			return '0 ' + exponent_names[0];
256		}
257		var me_exponent = Math.floor(Math.log(count_byte)/Math.log(1024));
258		var ret = (parseInt((count_byte / Math.pow(1024, me_exponent)) * exponent ,10) / exponent) + ' ' + exponent_names[me_exponent];
259		return ret;
260	};
261	
262	var strtotime = function (str, now) {
263		// version: 1109.2015
264		// discuss at: http://phpjs.org/functions/strtotime    // +   original by: Caio Ariede (http://caioariede.com)
265		// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
266		// +      input by: David
267		// +   improved by: Caio Ariede (http://caioariede.com)
268		// +   improved by: Brett Zamir (http://brett-zamir.me)    // +   bugfixed by: Wagner B. Soares
269		// +   bugfixed by: Artur Tchernychev
270		var i, match, s, strTmp = '',
271			parse = '';
272	 
273		strTmp = str;    strTmp = strTmp.replace(/\s{2,}|^\s|\s$/g, ' '); // unecessary spaces
274		strTmp = strTmp.replace(/[\t\r\n]/g, ''); // unecessary chars
275		if (strTmp == 'now') {
276			return (new Date()).getTime() / 1000; // Return seconds, not milli-seconds
277		} else if (!isNaN(parse = Date.parse(strTmp))) {        return (parse / 1000);
278		} else if (now) {
279			now = new Date(now * 1000); // Accept PHP-style seconds
280		} else {
281			now = new Date();    }
282	 
283		strTmp = strTmp.toLowerCase();
284	 
285		var __is = {
286			day: {'sun': 0,'mon': 1,'tue': 2,'wed': 3,'thu': 4,'fri': 5,'sat': 6},
287			mon: {'jan': 0,'feb': 1,'mar': 2,'apr': 3,'may': 4,'jun': 5,'jul': 6,'aug': 7,'sep': 8,'oct': 9,'nov': 10,'dec': 11}
288		};
289		 var process = function(m){
290			var ago = (m[2] && m[2] == 'ago');
291			var num = (num = m[0] == 'last' ? -1 : 1) * (ago ? -1 : 1);
292	 
293			switch (m[0]) {
294			case 'last':
295			case 'next':
296				switch (m[1].substring(0, 3)) {
297					case 'yea': now.setFullYear(now.getFullYear() + num); break;
298					case 'mon': now.setMonth(now.getMonth() + num); break;
299					case 'wee': now.setDate(now.getDate() + (num * 7)); break;
300					case 'day': now.setDate(now.getDate() + num); break;
301					case 'hou': now.setHours(now.getHours() + num); break;
302					case 'min': now.setMinutes(now.getMinutes() + num); break;
303					case 'sec': now.setSeconds(now.getSeconds() + num); break;
304					default:
305						var day;
306						if (typeof(day = __is.day[m[1].substring(0, 3)]) != 'undefined') {
307							var diff = day - now.getDay();
308							if (diff == 0){
309								diff = 7 * num;
310							}else if(diff > 0){
311								if (m[0] == 'last'){
312									diff -= 7;
313								}
314							}else{
315								if (m[0] == 'next') {
316									diff += 7;
317								}
318							}
319							now.setDate(now.getDate() + diff);               
320						}
321				}
322				break;
323			default: if (/\d+/.test(m[0])){
324					num *= parseInt(m[0], 10);
325					switch (m[1].substring(0, 3)) {
326						case 'yea': now.setFullYear(now.getFullYear() + num); break;
327						case 'mon': now.setMonth(now.getMonth() + num);	break;
328						case 'wee': now.setDate(now.getDate() + (num * 7)); break;
329						case 'day': now.setDate(now.getDate() + num); break;
330						case 'hou': now.setHours(now.getHours() + num); break;
331						case 'min': now.setMinutes(now.getMinutes() + num); break;
332						case 'sec': now.setSeconds(now.getSeconds() + num); break;
333					}
334				} else {
335					return false;
336				}
337				break;
338			}
339			return true;
340		};
341	 
342		match = strTmp.match(/^(\d{2,4}-\d{2}-\d{2})(?:\s(\d{1,2}:\d{2}(:\d{2})?)?(?:\.(\d+))?)?$/);    if (match != null) {
343			if (!match[2]) {
344				match[2] = '00:00:00';
345			} else if (!match[3]) {
346				match[2] += ':00';        }
347	 
348			s = match[1].split(/-/g);
349	 
350			for (i in __is.mon) {            if (__is.mon[i] == s[1] - 1) {
351					s[1] = i;
352				}
353			}
354			s[0] = parseInt(s[0], 10); 
355			s[0] = (s[0] >= 0 && s[0] <= 69) ? '20' + (s[0] < 10 ? '0' + s[0] : s[0] + '') : (s[0] >= 70 && s[0] <= 99) ? '19' + s[0] : s[0] + '';
356			return parseInt(this.strtotime(s[2] + ' ' + s[1] + ' ' + s[0] + ' ' + match[2]) + (match[4] ? match[4] / 1000 : ''), 10);
357		}
358		 var regex = '([+-]?\\d+\\s(years?|months?|weeks?|days?|hour' +
359		 ' s?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monda' +
360		 'y|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\' +
361		 '.?|friday|sat\\.?|saturday)|(last|next)\\s(years?|months?|' +
362		 'weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sund' +
363		 'ay|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.' +
364		 '?|thursday|fri\\.?|friday|sat\\.?|saturday))(\\sago)?';
365	 
366		match = strTmp.match(new RegExp(regex, 'gi'));
367		if (match == null){
368			return false;
369		}
370	 
371		for (i = 0; i < match.length; i++){
372			if (!process(match[i].split(' '))){
373				return false;
374			}
375		}
376	 
377		return (now.getTime() / 1000);
378	}
379	//-------------
380	tools.convert = {};
381	tools.convert.byteToString = function(count_byte, round_len){return byte_to_size(count_byte, lang.convert.byteToString, round_len);}
382	tools.convert.strToTime = strtotime;
383	
384	//===========================================================
385	var get_mime = function(filename){
386		var extensionToType = {
387			'ez'        : 'application/andrew-inset',
388			'atom'      : 'application/atom+xml',
389			'jar'       : 'application/java-archive',
390			'hqx'       : 'application/mac-binhex40',
391			'cpt'       : 'application/mac-compactpro',
392			'mathml'    : 'application/mathml+xml',
393			'doc'       : 'application/msword',
394			'dat'       : 'application/octet-stream',
395			'oda'       : 'application/oda',
396			'ogg'       : 'application/ogg',
397			'pdf'       : 'application/pdf',
398			'ai'        : 'application/postscript',
399			'eps'       : 'application/postscript',
400			'ps'        : 'application/postscript',
401			'rdf'       : 'application/rdf+xml',
402			'rss'       : 'application/rss+xml',
403			'smi'       : 'application/smil',
404			'smil'      : 'application/smil',
405			'gram'      : 'application/srgs',
406			'grxml'     : 'application/srgs+xml',
407			'kml'       : 'application/vnd.google-earth.kml+xml',
408			'kmz'       : 'application/vnd.google-earth.kmz',
409			'mif'       : 'application/vnd.mif',
410			'xul'       : 'application/vnd.mozilla.xul+xml',
411			'xls'       : 'application/vnd.ms-excel',
412			'xlb'       : 'application/vnd.ms-excel',
413			'xlt'       : 'application/vnd.ms-excel',
414			'xlam'      : 'application/vnd.ms-excel.addin.macroEnabled.12',
415			'xlsb'      : 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
416			'xlsm'      : 'application/vnd.ms-excel.sheet.macroEnabled.12',
417			'xltm'      : 'application/vnd.ms-excel.template.macroEnabled.12',
418			'docm'      : 'application/vnd.ms-word.document.macroEnabled.12',
419			'dotm'      : 'application/vnd.ms-word.template.macroEnabled.12',
420			'ppam'      : 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
421			'pptm'      : 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
422			'ppsm'      : 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
423			'potm'      : 'application/vnd.ms-powerpoint.template.macroEnabled.12',
424			'ppt'       : 'application/vnd.ms-powerpoint',
425			'pps'       : 'application/vnd.ms-powerpoint',
426			'odc'       : 'application/vnd.oasis.opendocument.chart',
427			'odb'       : 'application/vnd.oasis.opendocument.database',
428			'odf'       : 'application/vnd.oasis.opendocument.formula',
429			'odg'       : 'application/vnd.oasis.opendocument.graphics',
430			'otg'       : 'application/vnd.oasis.opendocument.graphics-template',
431			'odi'       : 'application/vnd.oasis.opendocument.image',
432			'odp'       : 'application/vnd.oasis.opendocument.presentation',
433			'otp'       : 'application/vnd.oasis.opendocument.presentation-template',
434			'ods'       : 'application/vnd.oasis.opendocument.spreadsheet',
435			'ots'       : 'application/vnd.oasis.opendocument.spreadsheet-template',
436			'odt'       : 'application/vnd.oasis.opendocument.text',
437			'odm'       : 'application/vnd.oasis.opendocument.text-master',
438			'ott'       : 'application/vnd.oasis.opendocument.text-template',
439			'oth'       : 'application/vnd.oasis.opendocument.text-web',
440			'potx'      : 'application/vnd.openxmlformats-officedocument.presentationml.template',
441			'ppsx'      : 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
442			'pptx'      : 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
443			'xlsx'      : 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
444			'xltx'      : 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
445			'docx'      : 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
446			'dotx'      : 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
447			'vsd'       : 'application/vnd.visio',
448			'wbxml'     : 'application/vnd.wap.wbxml',
449			'wmlc'      : 'application/vnd.wap.wmlc',
450			'wmlsc'     : 'application/vnd.wap.wmlscriptc',
451			'vxml'      : 'application/voicexml+xml',
452			'bcpio'     : 'application/x-bcpio',
453			'vcd'       : 'application/x-cdlink',
454			'pgn'       : 'application/x-chess-pgn',
455			'cpio'      : 'application/x-cpio',
456			'csh'       : 'application/x-csh',
457			'dcr'       : 'application/x-director',
458			'dir'       : 'application/x-director',
459			'dxr'       : 'application/x-director',
460			'dvi'       : 'application/x-dvi',
461			'spl'       : 'application/x-futuresplash',
462			'tgz'       : 'application/x-gtar',
463			'gtar'      : 'application/x-gtar',
464			'hdf'       : 'application/x-hdf',
465			'js'        : 'application/x-javascript',
466			'skp'       : 'application/x-koan',
467			'skd'       : 'application/x-koan',
468			'skt'       : 'application/x-koan',
469			'skm'       : 'application/x-koan',
470			'latex'     : 'application/x-latex',
471			'nc'        : 'application/x-netcdf',
472			'cdf'       : 'application/x-netcdf',
473			'sh'        : 'application/x-sh',
474			'shar'      : 'application/x-shar',
475			'swf'       : 'application/x-shockwave-flash',
476			'sit'       : 'application/x-stuffit',
477			'sv4cpio'   : 'application/x-sv4cpio',
478			'sv4crc'    : 'application/x-sv4crc',
479			'tar'       : 'application/x-tar',
480			'tcl'       : 'application/x-tcl',
481			'tex'       : 'application/x-tex',
482			'texinfo'   : 'application/x-texinfo',
483			'texi'      : 'application/x-texinfo',
484			't'         : 'application/x-troff',
485			'tr'        : 'application/x-troff',
486			'roff'      : 'application/x-troff',
487			'man'       : 'application/x-troff-man',
488			'me'        : 'application/x-troff-me',
489			'ms'        : 'application/x-troff-ms',
490			'ustar'     : 'application/x-ustar',
491			'src'       : 'application/x-wais-source',
492			'xhtml'     : 'application/xhtml+xml',
493			'xht'       : 'application/xhtml+xml',
494			'xslt'      : 'application/xslt+xml',
495			'xml'       : 'application/xml',
496			'xsl'       : 'application/xml',
497			'dtd'       : 'application/xml-dtd',
498			'zip'       : 'application/zip',
499			'au'        : 'audio/basic',
500			'snd'       : 'audio/basic',
501			'mid'       : 'audio/midi',
502			'midi'      : 'audio/midi',
503			'kar'       : 'audio/midi',
504			'mpga'      : 'audio/mpeg',
505			'mp2'       : 'audio/mpeg',
506			'mp3'       : 'audio/mpeg',
507			'aif'       : 'audio/x-aiff',
508			'aiff'      : 'audio/x-aiff',
509			'aifc'      : 'audio/x-aiff',
510			'm3u'       : 'audio/x-mpegurl',
511			'wma'       : 'audio/x-ms-wma',
512			'wax'       : 'audio/x-ms-wax',
513			'ram'       : 'audio/x-pn-realaudio',
514			'ra'        : 'audio/x-pn-realaudio',
515			'rm'        : 'application/vnd.rn-realmedia',
516			'wav'       : 'audio/x-wav',
517			'pdb'       : 'chemical/x-pdb',
518			'xyz'       : 'chemical/x-xyz',
519			'bmp'       : 'image/bmp',
520			'cgm'       : 'image/cgm',
521			'gif'       : 'image/gif',
522			'ief'       : 'image/ief',
523			'jpeg'      : 'image/jpeg',
524			'jpg'       : 'image/jpeg',
525			'jpe'       : 'image/jpeg',
526			'png'       : 'image/png',
527			'svg'       : 'image/svg+xml',
528			'tiff'      : 'image/tiff',
529			'tif'       : 'image/tiff',
530			'djvu'      : 'image/vnd.djvu',
531			'djv'       : 'image/vnd.djvu',
532			'wbmp'      : 'image/vnd.wap.wbmp',
533			'ras'       : 'image/x-cmu-raster',
534			'ico'       : 'image/x-icon',
535			'pnm'       : 'image/x-portable-anymap',
536			'pbm'       : 'image/x-portable-bitmap',
537			'pgm'       : 'image/x-portable-graymap',
538			'ppm'       : 'image/x-portable-pixmap',
539			'rgb'       : 'image/x-rgb',
540			'xbm'       : 'image/x-xbitmap',
541			'psd'       : 'image/x-photoshop',
542			'xpm'       : 'image/x-xpixmap',
543			'xwd'       : 'image/x-xwindowdump',
544			'eml'       : 'message/rfc822',
545			'igs'       : 'model/iges',
546			'iges'      : 'model/iges',
547			'msh'       : 'model/mesh',
548			'mesh'      : 'model/mesh',
549			'silo'      : 'model/mesh',
550			'wrl'       : 'model/vrml',
551			'vrml'      : 'model/vrml',
552			'ics'       : 'text/calendar',
553			'ifb'       : 'text/calendar',
554			'css'       : 'text/css',
555			'csv'       : 'text/csv',
556			'html'      : 'text/html',
557			'htm'       : 'text/html',
558			'txt'       : 'text/plain',
559			'asc'       : 'text/plain',
560			'rtx'       : 'text/richtext',
561			'rtf'       : 'text/rtf',
562			'sgml'      : 'text/sgml',
563			'sgm'       : 'text/sgml',
564			'tsv'       : 'text/tab-separated-values',
565			'wml'       : 'text/vnd.wap.wml',
566			'wmls'      : 'text/vnd.wap.wmlscript',
567			'etx'       : 'text/x-setext',
568			'mpeg'      : 'video/mpeg',
569			'mpg'       : 'video/mpeg',
570			'mpe'       : 'video/mpeg',
571			'qt'        : 'video/quicktime',
572			'mov'       : 'video/quicktime',
573			'mxu'       : 'video/vnd.mpegurl',
574			'm4u'       : 'video/vnd.mpegurl',
575			'flv'       : 'video/x-flv',
576			'asf'       : 'video/x-ms-asf',
577			'asx'       : 'video/x-ms-asf',
578			'wmv'       : 'video/x-ms-wmv',
579			'wm'        : 'video/x-ms-wm',
580			'wmx'       : 'video/x-ms-wmx',
581			'webm'		: 'video/webm',
582			'avi'       : 'video/x-msvideo',
583			'mp4'		: 'video/mp4',
584			'ogv'       : 'video/ogg',
585			'movie'     : 'video/x-sgi-movie',
586			'ice'       : 'x-conference/x-cooltalk'
587		};
588
589		var ext = filename.split('.').reverse()[0];
590		if(typeof extensionToType[ext] != "undefined"){
591			return extensionToType[ext];
592		}else{
593			return 'data/bin';
594		}
595	}
596	
597	//===========================================================
598	//Browser info
599	tools.info 				= {};
600	tools.info.mime 		= get_mime;
601	tools.info.ua			= navigator.userAgent || navigator.vendor || w.opera;
602	tools.info.is 			= {};
603	tools.info.is.android 	= tools.info.ua.indexOf('Android') != -1;
604	tools.info.is.ipad 		= tools.info.ua.indexOf('iPad') != -1;
605	tools.info.is.iphone 	= tools.info.ua.indexOf('iPhone') != -1;
606	tools.info.is.firefox 	= tools.info.ua.indexOf('Firefox') != -1;
607	tools.info.is.chrome 	= tools.info.ua.toLowerCase().indexOf('chrome') != -1;
608	tools.info.is.opera 	= tools.info.ua.indexOf('Opera') != -1;
609	tools.info.is.ie 		= !tools.info.is.opera && tools.info.ua.indexOf('msie') != -1;
610	tools.info.is.ns4 		= !!(d.layers);
611	tools.info.is.ie4 		= !!(d.all);
612	
613	//------------------
614	var is_mobile_browse = (function(){
615		
616		var a = navigator.userAgent||navigator.vendor||w.opera;
617		var reg1 = new RegExp(
618			'(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |'+
619			'maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo'+
620			'|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino'
621		,'i');
622		var reg2 = new RegExp(
623			'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'+
624			'|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'+
625			'\-|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|z'+
626			'e)|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(\-| '+
627			'|_|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|'+
628			'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'+
629			'|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|'+
630			'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'+
631			'|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\/|'+
632			'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)|s'+
633			'o(ft|ny)|sp(01|h\-|v\-|v )|sy(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)'+
634			'|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(\-| )|w'+
635			'ebc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-'
636		,'i');
637		if(reg1.test(a)||reg2.test(a.substr(0,4))){
638			return true;
639		}else{
640			return false;
641		}
642	}());
643	//------------------
644	var is_tablet = (function(){
645		var tablet = false;
646		if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
647			return true;
648		}else{
649			return false
650		}
651	}());
652	//------------------
653	tools.info.is.tablet 		= is_tablet;
654	tools.info.is.mobile 		= is_mobile_browse;
655	
656	
657	
658	//===========================================================
659	(function(d,w){
660		var mouse_x = 0,
661			mouse_y = 0;
662		
663		var init_mouse = function() {
664			if (tools.info.is.ns4) {d.captureEvents(w.Event.MOUSEMOVE);}
665			d.onmousemove=mousemove;
666		}
667		
668		var mousemove = function(event) {
669			if (d.attachEvent != null) {
670				mouse_x = w.event.clientX;
671				mouse_y = w.event.clientY;
672			} else if (!d.attachEvent && d.addEventListener) {
673				mouse_x = event.clientX;
674				mouse_y = event.clientY;
675			}
676		}
677		init_mouse();
678		
679		var scrollTop = function(){
680			return w.document.body.scrollTop ? w.document.body.scrollTop : d.documentElement.scrollTop;
681		}
682		var scrollLeft = function(){
683			return w.document.body.scrollLeft ? w.document.body.scrollLeft : d.documentElement.scrollLeft;
684		}
685		
686
687
688		var viewportHeight = function(){
689			return ((d.compatMode || tools.info.is.ie) && !tools.info.is.opera) ? ((d.compatMode == 'CSS1Compat') ? d.documentElement.clientHeight : d.body.clientHeight) : (d.parentWindow || d.defaultView).innerHeight;
690		}
691		var windowHeight = function(){
692			return Math.max(d.compatMode != 'CSS1Compat' ? d.body.scrollHeight : d.documentElement.scrollHeight, viewportHeight());
693		}
694		var viewportWidth = function(){
695			return ((d.compatMode || tools.info.is.ie) && !tools.info.is.opera) ? ((d.compatMode == 'CSS1Compat') ? d.documentElement.clientWidth : d.body.clientWidth) : (d.parentWindow || d.defaultView).innerWidth;
696		}
697		var windowWidth = function(){
698			return Math.max(d.compatMode != 'CSS1Compat' ? d.body.scrollWidth : d.documentElement.scrollWidth, viewportWidth());
699		}
700		
701		
702		var getStyle = function(el, name){
703			var ret;
704			if (window.getComputedStyle){//Normal
705				try{
706					if (name == 'float') name = 'cssFloat';
707					var computed = window.getComputedStyle(el, null);
708					if(computed){
709						ret = computed.getPropertyValue(name) || computed[name];
710					}
711				}catch(e){}
712			}else{
713				if (el.currentStyle){//IE
714					if (name == 'float') name = 'styleFloat';
715					name = name.replace(/\-(\w)/g, function (strMatch, p1){
716						return p1.toUpperCase();
717					});
718					return el.currentStyle[name];
719				}
720			}
721			return ret;
722		
723			// var strValue = "";
724			// if(oElm.currentStyle){
725				// strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
726					// return p1.toUpperCase();
727				// });
728				// strValue = oElm.currentStyle[strCssRule];
729			// }
730			// else if(document.defaultView && document.defaultView.getComputedStyle){
731				// strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
732			// }
733			// return strValue;
734		}
735		
736		var addEvent = function(elem, type, eventHandle) {
737			if (elem == null || elem == undefined) return;
738			if ( elem.addEventListener ) {
739				elem.addEventListener( type, eventHandle, false );
740			} else if ( elem.attachEvent ) {
741				elem.attachEvent( "on" + type, eventHandle );
742			} else {
743				elem["on"+type]=eventHandle;
744			}
745		};
746		
747		
748		var elemScrollTop = function(el){
749			return el.scrollTop || 0;
750		}
751		var elemScrollLeft = function(el){
752			return el.scrollLeft || 0;
753		}
754		
755		var offsetLeft = function(el){
756			var offsetLeft = 0, cur = el;
757			while(cur){
758				offsetLeft += cur.offsetLeft;
759				cur = cur.offsetParent;
760			}
761			return offsetLeft;
762		}
763		var offsetTop = function(el){
764			var offsetTop = 0, cur = el;
765			while(cur){
766				offsetTop += cur.offsetTop;
767				cur = cur.offsetParent;
768			}
769			return offsetTop;
770		}
771		
772		var elemCursorY = function(el){
773			return (mouse_y + scrollTop() - offsetTop(el));
774		}
775		var elemCursorX = function(el){
776			return (mouse_x + scrollLeft() - offsetLeft(el));
777		}
778		
779		//------------------
780		tools.window 				= {};
781		tools.window.height 		= function(){return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;};
782		tools.window.width 			= function(){return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;};
783		tools.window.cursor			= {};
784		tools.window.cursor.x		= function(){return mouse_x;};
785		tools.window.cursor.y		= function(){return mouse_y;};
786		
787		tools.document 				= {};
788		tools.document.height 		= windowHeight;
789		tools.document.width 		= windowWidth;
790		tools.document.cursor		= {};
791		tools.document.cursor.x		= function(){return mouse_x + scrollLeft();};
792		tools.document.cursor.y		= function(){return mouse_y + scrollTop();};
793		tools.document.scroll		= {};
794		tools.document.scroll.top	= scrollTop;
795		tools.document.scroll.left	= scrollLeft;
796		
797		tools.element 				= {};
798		tools.element.width			= function(el){return el.offsetWidth || 0;};
799		tools.element.height		= function(el){return el.offsetHeight || 0;};
800		tools.element.style			= getStyle;
801		tools.element.event			= addEvent;
802		tools.element.top			= offsetTop;
803		tools.element.left			= offsetLeft;
804		tools.element.scroll		= {};
805		tools.element.scroll.top	= elemScrollTop;
806		tools.element.scroll.left	= elemScrollLeft;
807		tools.element.cursor		= {};
808		tools.element.cursor.x		= elemCursorX;
809		tools.element.cursor.y		= elemCursorY;
810	}(d,w));
811	
812	
813	
814	
815	//===========================================================
816	//Текстовое поле
817	function getCaretPosition(el){
818		el.focus();
819		if(d.selection){
820			var sel = d.selection.createRange();
821			var clone = sel.duplicate();
822			sel.collapse(true);
823			clone.moveToElementText(el);
824			clone.setEndPoint('EndToEnd', sel);
825			return clone.text.length;
826		}
827		else if (el.selectionStart){
828			return el.selectionStart;
829		}
830		return el.value.length-1;
831	}
832	function setCaretPosition(el, start, stop){
833		start = start || 0;
834		stop = stop || start;
835		if(stop < start){
836			var temp = start;
837			start = stop;
838			stop = start;
839		}
840		if (el.createTextRange){
841			var range = el.createTextRange();
842			range.collapse(true);
843			range.moveStart('character', start);
844			range.moveEnd('character', stop - start);
845			range.select();
846			el.focus();
847		}else if (typeof(el.selectionStart) == "number"){
848			el.selectionStart = start;
849			el.selectionEnd = stop;
850			el.focus();
851		}
852	}
853	function replaceSelectedText(el, Text){
854		el.focus();
855		if (d.selection){
856			var s = d.selection.createRange();
857			var start = getCaretPosition(el);
858			if (s.text){
859				var old = s.text;
860				var len = s.text.length;
861				s.text=Text;
862				s.moveStart("character",-Text.length);
863				s.select();
864				return old;
865			}
866		}
867		else if (typeof(el.selectionStart)=="number"){
868			var start = el.selectionStart;
869			var end = el.selectionEnd;
870			var old = el.value.substr(start, end-start);
871			el.value = el.value.substr(0,start) + Text + el.value.substr(end);
872			setCaretPosition(el, start, start + Text.length);
873			return old;
874		}
875		return false;
876	}
877	function getSelectedText(el){
878		el.focus();
879		if (d.selection){
880			var s = d.selection.createRange();
881			if (s.text){
882				return s.text;
883			}
884		}
885		else if (typeof(el.selectionStart)=="number"){
886			var start = el.selectionStart;
887			var end = el.selectionEnd;
888			return el.value.substr(start,end-start);
889		}
890		return false;
891	}
892	tools.element.caret = {};
893	tools.element.caret.getPosition = getCaretPosition;
894	tools.element.caret.setPosition = setCaretPosition;
895	tools.element.caret.replaceSelect = replaceSelectedText;
896	tools.element.caret.getSelect = getSelectedText;
897	
898	
899	//===========================================================
900	//
901	var Sorter2D = function(){
902		// @author dimagolov
903		// +   original by: dimagolov (http://phpclub.ru/talk/threads/58517/)
904		// +   improved by: [email protected]
905	};
906	Sorter2D.prototype = {
907		aSortFunc:{
908			"string":function(a,b,Idx,asc){
909				var v1=a[Idx].toLowerCase(),
910					v2=b[Idx].toLowerCase();
911				if(v1==v2)return 0;
912				return (asc?v1<v2:v1>v2)?-1:1;
913			}, 
914			"number":function(a,b,Idx,asc){return asc?a[Idx]-b[Idx]:b[Idx]-a[Idx];}, 
915			"date":function(a,b,Idx,asc){
916				var sec = b[Idx].getTime()-a[Idx].getTime();
917				return sec==0?0:(asc?(sec<0?-1:1):(sec<0?1:-1));
918			} 
919		},                
920		SortUnorderedColumn:function(aArray,SortColumn,SortType,asc){ 
921			var t=this; 
922			if(!aArray||aArray.length<2||!t.aSortFunc[SortType])return; 
923			aArray=aArray.sort(function(a,b){return t.aSortFunc[SortType].apply(t,[a,b,SortColumn,asc]);}); 
924		} 
925	};
926	var sorter2D = new Sorter2D();
927	var sortFoo = function(a, asc, column, type){
928		asc = asc === false ? false : true;
929		type = (type||'').toLowerCase();
930		if(typeof sorter2D.aSortFunc[type] == 'undefined'){
931			type = 'string';
932		}
933		sorter2D.SortUnorderedColumn(a, column, type, asc);
934	};
935	tools.sort = sortFoo;
936	
937	//===========================================================
938	var date = function( format, timestamp ) {
939		// Format a local time/date
940		// 
941		// +   original by: Carlos R. L. Rodrigues
942		// +	  parts by: Peter-Paul Koch (http://www.quirksmode.org/js/beat.html)
943		// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
944		// +   improved by: MeEtc (http://yass.meetcweb.com)
945		// +   improved by: Brad Touesnard
946		var a, jsdate = new Date(timestamp ? timestamp * 1000 : null);
947		var pad = function(n, c){
948			if( (n = n + "").length < c ) {
949				return new Array(++c - n.length).join("0") + n;
950			} else {
951				return n;
952			}
953		};
954
955		var date_ordin = {1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"}
956		var f = {
957			d: function(){return pad(f.j(), 2);},
958			D: function(){t = f.l(); return t.substr(0,3);},
959			j: function(){return jsdate.getDate();},
960			l: function(){return lang.date.weekdays[f.w()];},
961			N: function(){return f.w() + 1;},
962			S: function(){return date_ordin[f.j()] ? date_ordin[f.j()] : 'th';},
963			w: function(){return jsdate.getDay();},
964			z: function(){return (jsdate - new Date(jsdate.getFullYear() + "/1/1")) / 864e5 >> 0;},
965			F: function(){return lang.date.months[f.n()];},
966			m: function(){return pad(f.n(), 2);},
967			M: function(){t = f.F(); return t.substr(0,3);},
968			n: function(){return jsdate.getMonth() + 1;},
969			L: function(){var y = f.Y();return (!(y & 3) && (y % 1e2 || !(y % 4e2))) ? 1 : 0;},
970			Y: function(){return jsdate.getFullYear();},
971			y: function(){return (jsdate.getFullYear() + "").slice(2);},
972			a: function(){return jsdate.getHours() > 11 ? "pm" : "am";},
973			A: function(){return f.a().toUpperCase();},
974			g: function(){return jsdate.getHours() % 12 || 12;},
975			G: function(){return jsdate.getHours();},
976			h: function(){return pad(f.g(), 2);},
977			H: function(){return pad(jsdate.getHours(), 2);},
978			i: function(){return pad(jsdate.getMinutes(), 2);},
979			s: function(){return pad(jsdate.getSeconds(), 2);},
980			U: function(){return Math.round(jsdate.getTime()/1000);},
981			P: function(){var O = f.O();return (O.substr(0, 3) + ":" + O.substr(3, 2));},
982			c: function(){return f.Y() + "-" + f.m() + "-" + f.d() + "T" + f.h() + ":" + f.i() + ":" + f.s() + f.P();},
983			W: function(){
984				var a = f.z(), b = 364 + f.L() - a;
985				var nd2, nd = (new Date(jsdate.getFullYear() + "/1/1").getDay() || 7) - 1;
986
987				if(b <= 2 && ((jsdate.getDay() || 7) - 1) <= 2 - b){
988					return 1;
989				} else{
990
991					if(a <= 2 && nd >= 4 && a >= (6 - nd)){
992						nd2 = new Date(jsdate.getFullYear() - 1 + "/12/31");
993						return date("W", Math.round(nd2.getTime()/1000));
994					} else{
995						return (1 + (nd <= 3 ? ((a + nd) / 7) : (a - (7 - nd)) / 7) >> 0);
996					}
997				}
998			},
999			t: function(){
1000				var n;
1001				if( (n = jsdate.getMonth() + 1) == 2 ){
1002					return 28 + f.L();
1003				} else{
1004					if( n & 1 && n < 8 || !(n & 1) && n > 7 ){
1005						return 31;
1006					} else{
1007						return 30;
1008					}
1009				}
1010			},
1011			B: function(){
1012				var off = (jsdate.getTimezoneOffset() + 60)*60;
1013				var theSeconds = (jsdate.getHours() * 3600) +
1014								 (jsdate.getMinutes() * 60) +
1015								  jsdate.getSeconds() + off;
1016				var beat = Math.floor(theSeconds/86.4);
1017				if (beat > 1000) beat -= 1000;
1018				if (beat < 0) beat += 1000;
1019				if ((String(beat)).length == 1) beat = "00"+beat;
1020				if ((String(beat)).length == 2) beat = "0"+beat;
1021				return beat;
1022			},
1023			O: function(){
1024			   var t = pad(Math.abs(jsdate.getTimezoneOffset()/60*100), 4);
1025			   if (jsdate.getTimezoneOffset() > 0) t = "-" + t; else t = "+" + t;
1026			   return t;
1027			}
1028		};
1029
1030		return format.replace(/[\\]?([a-zA-Z])/g, function(t, s){
1031			var ret = s;
1032			if( t!=s )		ret = s;
1033			else if(f[s])	ret = f[s]();
1034			return ret;
1035		});
1036	}
1037	tools.date = date;
1038	
1039
1040	
1041	return tools;
1042})('ru', document, window);
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
vendor: 34,139 bytes, lines 1053-1055
1053/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
1054!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)
1055},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}
vendor: 7,763 bytes, line 1055
1055});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}}
vendor: 42,343 bytes, lines 1055-1056
1055,n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))
1056},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n});
1057
1058/*!
1059 * @preserve
1060 * jquery.scrolldepth.js | v0.7.2
1061 * Copyright (c) 2015 Rob Flaherty (@robflaherty)
1062 * Licensed under the MIT and GPL licenses.
1063 */
1064!function(e,n,t){"use strict";var o,r,a,l={minHeight:0,elements:[],percentage:!0,userTiming:!0,pixelDepth:!0,nonInteraction:!0},i=e(n),c=[],u=0;e.scrollDepth=function(h){function p(e){a?a({event:"ScrollDistance",eventCategory:"Scroll Depth",eventAction:e,eventLabel:"Baseline",eventValue:1,eventNonInteraction:!0}):(o&&ga("send","event","Scroll Depth",e,"Baseline",1,{nonInteraction:!0}),r&&_gaq.push(["_trackEvent","Scroll Depth",e,"Baseline",1,!0]))}function g(e,n,t,l){a?(a({event:"ScrollDistance",eventCategory:"Scroll Depth",eventAction:e,eventLabel:n,eventValue:1,eventNonInteraction:h.nonInteraction}),h.pixelDepth&&arguments.length>2&&t>u&&(u=t,a({event:"ScrollDistance",eventCategory:"Scroll Depth",eventAction:"Pixel Depth",eventLabel:D(t),eventValue:1,eventNonInteraction:h.nonInteraction})),h.userTiming&&arguments.length>3&&a({event:"ScrollTiming",eventCategory:"Scroll Depth",eventAction:e,eventLabel:n,eventTiming:l})):(o&&(ga("send","event","Scroll Depth",e,n,1,{nonInteraction:h.nonInteraction}),h.pixelDepth&&arguments.length>2&&t>u&&(u=t,ga("send","event","Scroll Depth","Pixel Depth",D(t),1,{nonInteraction:h.nonInteraction})),h.userTiming&&arguments.length>3&&ga("send","timing","Scroll Depth",e,l,n)),r&&(_gaq.push(["_trackEvent","Scroll Depth",e,n,1,h.nonInteraction]),h.pixelDepth&&arguments.length>2&&t>u&&(u=t,_gaq.push(["_trackEvent","Scroll Depth","Pixel Depth",D(t),1,h.nonInteraction])),h.userTiming&&arguments.length>3&&_gaq.push(["_trackTiming","Scroll Depth",e,l,n,100])))}function s(e){return{"25%":parseInt(.25*e,10),"50%":parseInt(.5*e,10),"75%":parseInt(.75*e,10),"100%":e-5}}function v(n,t,o){e.each(n,function(n,r){-1===e.inArray(n,c)&&t>=r&&(g("Percentage",n,t,o),c.push(n))})}function f(n,t,o){e.each(n,function(n,r){-1===e.inArray(r,c)&&e(r).length&&t>=e(r).offset().top&&(g("Elements",r,t,o),c.push(r))})}function D(e){return(250*Math.floor(e/250)).toString()}function m(e,n){var t,o,r,a=null,l=0,i=function(){l=new Date,a=null,r=e.apply(t,o)};return function(){var c=new Date;l||(l=c);var u=n-(c-l);return t=this,o=arguments,0>=u?(clearTimeout(a),a=null,l=c,r=e.apply(t,o)):a||(a=setTimeout(i,u)),r}}var d=+new Date;h=e.extend({},l,h),e(t).height()<h.minHeight||("function"==typeof ga&&(o=!0),"undefined"!=typeof _gaq&&"function"==typeof _gaq.push&&(r=!0),"function"==typeof h.eventHandler?a=h.eventHandler:"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(a=function(e){dataLayer.push(e)}),h.percentage?p("Percentage"):h.elements&&p("Elements"),i.on("scroll.scrollDepth",m(function(){var o=e(t).height(),r=n.innerHeight?n.innerHeight:i.height(),a=i.scrollTop()+r,l=s(o),u=+new Date-d;return c.length>=4+h.elements.length?void i.off("scroll.scrollDepth"):(h.elements&&f(h.elements,a,u),void(h.percentage&&v(l,a,u)))},500)))}}(jQuery,window,document);
1065/*!
1066 * @preserve
1067 * Screentime.js | v0.1
1068 * Copyright (c) 2014 Rob Flaherty (@robflaherty)
1069 * Licensed under the MIT and GPL licenses.
1070 */
1071(function(f,c,t){var u={fields:[],percentOnScreen:"50%",reportInterval:10,googleAnalytics:!1,callback:function(){}};f.screentime=function(e){function v(a){this.selector=a.selector;$elem=this.$elem=f(a.selector);this.name=a.name;this.top=$elem.offset().top;this.height=$elem.height();this.bottom=this.top+this.height;this.width=$elem.width()}function w(){var a=f(c);this.top=a.scrollTop();this.height=a.height();this.bottom=this.top+this.height;this.width=a.width()}function k(){var a=new w;f.each(l,function(m,
1072d){var c;a:if(d.bottom<=a.bottom&&d.top>=a.top)c=!0;else{if(d.height>a.height&&(c=a.bottom-d.top>a.height/2&&d.bottom-a.top>a.height/2)){c=!0;break a}c=e.percentOnScreen/100*d.height;c=a.bottom-c>=d.top&&d.bottom-c>a.top}c&&(g[m]+=1)})}function x(){var a={};f.each(g,function(c,d){0<d&&(a[c]=d,g[c]=0,e.googleAnalytics&&(n&&ga("send","event","Screentime","Time on Screen",c,parseInt(d,10),{nonInteraction:!0}),p&&_gaq.push(["_trackEvent","Screentime","Time on Screen",c,parseInt(d,10),!0])))});f.isEmptyObject(a)||
1073e.callback.call(this,a)}function q(){r||(k(),r=!0);h=setInterval(function(){k()},1E3);reporter=setInterval(function(){x()},1E3*e.reportInterval)}function y(){f.each(e.fields,function(a,c){if(f(c.selector).length){var d=new v(c);l[d.name]=d;g[d.name]=0}});q();visibly.onHidden(function(){clearInterval(h);clearInterval(reporter)});visibly.onVisible(function(){clearInterval(h);clearInterval(reporter);q()})}e=f.extend({},u,e);e.percentOnScreen=parseInt(e.percentOnScreen.replace("%",""),10);var g={},l=
1074{},h=null,r=!1,n,p;e.fields.length&&(e.googleAnalytics&&("function"===typeof ga&&(n=!0),"undefined"!==typeof _gaq&&"function"===typeof _gaq.pu
1074sh&&(p=!0)),function(){c.visibly={q:t,p:void 0,prefixes:["webkit","ms","o","moz","khtml"],props:["VisibilityState","visibilitychange","Hidden"],m:["focus","blur"],visibleCallbacks:[],hiddenCallbacks:[],genericCallbacks:[],_callbacks:[],cachedPrefix:"",fn:null,onVisible:function(a){"function"==typeof a&&this.visibleCallbacks.push(a)},onHidden:function(a){"function"==
1075typeof a&&this.hiddenCallbacks.push(a)},getPrefix:function(){if(!this.cachedPrefix)for(var a=0;b=this.prefixes[a++];)if(b+this.props[2]in this.q)return this.cachedPrefix=b},visibilityState:function(){return this._getProp(0)},hidden:function(){return this._getProp(2)},visibilitychange:function(a){"function"==typeof a&&this.genericCallbacks.push(a);var c=this.genericCallbacks.length;if(c)if(this.cachedPrefix)for(;c--;)this.genericCallbacks[c].call(this,this.visibilityState());else for(;c--;)this.genericCallbacks[c].call(this,
1076a)},isSupported:function(a){return this.cachedPrefix+this.props[2]in this.q},_getProp:function(a){return this.q[this.cachedPrefix+this.props[a]]},_execute:function(a){if(a)for(this._callbacks=1==a?this.visibleCallbacks:this.hiddenCallbacks,a=this._callbacks.length;a--;)this._callbacks[a]()},_visible:function(){c.visibly._execute(1);c.visibly.visibilitychange.call(c.visibly,"visible")},_hidden:function(){c.visibly._execute(2);c.visibly.visibilitychange.call(c.visibly,"hidden")},_nativeSwitch:function(){this[this._getProp(2)?
1077"_hidden":"_visible"]()},_listen:function(){try{this.isSupported()?this.q.addEventListener(this.cachedPrefix+this.props[1],function(){c.visibly._nativeSwitch.apply(c.visibly,arguments)},1):this.q.addEventListener?(c.addEventListener(this.m[0],this._visible,1),c.addEventListener(this.m[1],this._hidden,1)):this.q.attachEvent&&(this.q.attachEvent("onfocusin",this._visible),this.q.attachEvent("onfocusout",this._hidden))}catch(a){}},init:function(){this.getPrefix();this._listen()}};this.visibly.init()}(),
1078y())}})(jQuery,window,document);
1079;(function(){
1080	if(typeof $_PARAM.branding == "undefined"){
1081		return;
1082	}
1083	// $('body').addClass("branding");
1084	$_PARAM.branding_url = $_PARAM.url_static + 'branding/' + $_PARAM.branding + '/';
1085	
1086	var old;
1087	
1088	// var link = document.createElement('link');
1089	// link.rel = "stylesheet";
1090	// link.type = "text/css";
1091	// link.href = $_PARAM.branding_url + 'style.css';
1092
1093	var script = document.createElement('script');
1094	script.async = 1;
1095	script.src = $_PARAM.branding_url + 'js.js';
1096	
1097	var load = function(){
1098		var head = document.getElementsByTagName('head');
1099		if(typeof head == "undefined"){
1100			setTimeout(function(){
1101				load();
1102			}, 10);
1103			return;
1104		}
1105		//head[0].appendChild(link);
1106		head[0].appendChild(script);
1107	}
1108	load();
1109}());
1110/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
1111 * Licensed under the MIT License (LICENSE.txt).
1112 *
1113 * Version: 3.1.12
1114 *
1115 * Requires: jQuery 1.2.2+
1116 */
1117!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>
1117=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
1118/*!
1119 * jQuery Form Plugin
1120 * version: 3.51.0-2014.06.20
1121 * Requires jQuery v1.5 or later
1122 * Copyright (c) 2014 M. Alsup
1123 * Examples and documentation at: http://malsup.com/jquery/form/
1124 * Project repository: https://github.com/malsup/form
1125 * Dual licensed under the MIT and GPL licenses.
1126 * https://github.com/malsup/form#copyright-and-license
1127 */
1128/*global ActiveXObject */
1129
1130// AMD support
1131(function (factory) {
1132    "use strict";
1133    if (typeof define === 'function' && define.amd) {
1134        // using AMD; register as anon module
1135        define(['jquery'], factory);
1136    } else {
1137        // no AMD; invoke directly
1138        factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
1139    }
1140}
1141
1142(function($) {
1143"use strict";
1144
1145/*
1146    Usage Note:
1147    -----------
1148    Do not use both ajaxSubmit and ajaxForm on the same form.  These
1149    functions are mutually exclusive.  Use ajaxSubmit if you want
1150    to bind your own submit handler to the form.  For example,
1151
1152    $(document).ready(function() {
1153        $('#myForm').on('submit', function(e) {
1154            e.preventDefault(); // <-- important
1155            $(this).ajaxSubmit({
1156                target: '#output'
1157            });
1158        });
1159    });
1160
1161    Use ajaxForm when you want the plugin to manage all the event binding
1162    for you.  For example,
1163
1164    $(document).ready(function() {
1165        $('#myForm').ajaxForm({
1166            target: '#output'
1167        });
1168    });
1169
1170    You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
1171    form does not have to exist when you invoke ajaxForm:
1172
1173    $('#myForm').ajaxForm({
1174        delegation: true,
1175        target: '#output'
1176    });
1177
1178    When using ajaxForm, the ajaxSubmit function will be invoked for you
1179    at the appropriate time.
1180*/
1181
1182/**
1183 * Feature detection
1184 */
1185var feature = {};
1186feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
1187feature.formdata = window.FormData !== undefined;
1188
1189var hasProp = !!$.fn.prop;
1190
1191// attr2 uses prop when it can but checks the return type for
1192// an expected string.  this accounts for the case where a form 
1193// contains inputs with names like "action" or "method"; in those
1194// cases "prop" returns the element
1195$.fn.attr2 = function() {
1196    if ( ! hasProp ) {
1197        return this.attr.apply(this, arguments);
1198    }
1199    var val = this.prop.apply(this, arguments);
1200    if ( ( val && val.jquery ) || typeof val === 'string' ) {
1201        return val;
1202    }
1203    return this.attr.apply(this, arguments);
1204};
1205
1206/**
1207 * ajaxSubmit() provides a mechanism for immediately submitting
1208 * an HTML form using AJAX.
1209 */
1210$.fn.ajaxSubmit = function(options) {
1211    /*jshint scripturl:true */
1212
1213    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
1214    if (!this.length) {
1215        log('ajaxSubmit: skipping submit process - no element selected');
1216        return this;
1217    }
1218
1219    var method, action, url, $form = this;
1220
1221    if (typeof options == 'function') {
1222        options = { success: options };
1223    }
1224    else if ( options === undefined ) {
1225        options = {};
1226    }
1227
1228    method = options.type || this.attr2('method');
1229    action = options.url  || this.attr2('action');
1230
1231    url = (typeof action === 'string') ? $.trim(action) : '';
1232    url = url || window.location.href || '';
1233    if (url) {
1234        // clean url (don't include hash vaue)
1235        url = (url.match(/^([^#]+)/)||[])[1];
1236    }
1237
1238    options = $.extend(true, {
1239        url:  url,
1240        success: $.ajaxSettings.success,
1241        type: method || $.ajaxSettings.type,
1242        iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
1243    }, options);
1244
1245    // hook for manipulating the form data before it is extracted;
1246    // convenient for use with rich editors like tinyMCE or FCKEditor
1247    var veto = {};
1248    this.trigger('form-pre-serialize', [this, options, veto]);
1249    if (veto.veto) {
1250        log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
1251        return this;
1252    }
1253
1254    // provide opportunity to alter form data before it is serialized
1255    if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
1256        log('ajaxSubmit: submit aborted via beforeSerialize callback');
1257        return this;
1258    }
1259
1260    var traditional = options.traditional;
1261    if ( traditional === undefined ) {
1262        traditional = $.ajaxSettings.traditional;
1263    }
1264
1265    var elements = [];
1266    var qx, a = this.formToArray(options.semantic, elements);
1267    if (options.data) {
1268        options.extraData = options.data;
1269        qx = $.param(options.data, traditional);
1270    }
1271
1272    // give pre-submit callback an opportunity to abort the submit
1273    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
1274        log('ajaxSubmit: submit aborted via beforeSubmit callback');
1275        return this;
1276    }
1277
1278    // fire vetoable 'validate' event
1279    this.trigger('form-submit-validate', [a, this, options, veto]);
1280    if (veto.veto) {
1281        log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
1282        return this;
1283    }
1284
1285    var q = $.param(a, traditional);
1286    if (qx) {
1287        q = ( q ? (q + '&' + qx) : qx );
1288    }
1289    if (options.type.toUpperCase() == 'GET') {
1290        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
1291        options.data = null;  // data is null for 'get'
1292    }
1293    else {
1294        options.data = q; // data is the query string for 'post'
1295    }
1296
1297    var callbacks = [];
1298    if (options.resetForm) {
1299        callbacks.push(function() { $form.resetForm(); });
1300    }
1301    if (options.clearForm) {
1302        callbacks.push(function() { $form.clearForm(options.includeHidden); });
1303    }
1304
1305    // perform a load on the target only if dataType is not provided
1306    if (!options.dataType && options.target) {
1307        var oldSuccess = options.success || function(){};
1308        callbacks.push(function(data) {
1309            var fn = options.replaceTarget ? 'replaceWith' : 'html';
1310            $(options.target)[fn](data).each(oldSuccess, arguments);
1311        });
1312    }
1313    else if (options.success) {
1314        callbacks.push(options.success);
1315    }
1316
1317    options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
1318        var context = options.context || this ;    // jQuery 1.4+ supports scope context
1319        for (var i=0, max=callbacks.length; i < max; i++) {
1320            callbacks[i].apply(context, [data, status, xhr || $form, $form]);
1321        }
1322    };
1323
1324    if (options.error) {
1325        var oldError = options.error;
1326        options.error = function(xhr, status, error) {
1327            var context = options.context || this;
1328            oldError.apply(context, [xhr, status, error, $form]);
1329        };
1330    }
1331
1332     if (options.complete) {
1333        var oldComplete = options.complete;
1334        options.complete = function(xhr, status) {
1335            var context = options.context || this;
1336            oldComplete.apply(context, [xhr, status, $form]);
1337        };
1338    }
1339
1340    // are there files to upload?
1341
1342    // [value] (issue #113), also see comment:
1343    // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
1344    var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; });
1345
1346    var hasFileInputs = fileInputs.length > 0;
1347    var mp = 'multipart/form-data';
1348    var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
1349
1350    var fileAPI = feature.fileapi && feature.formdata;
1351    log("fileAPI :" + fileAPI);
1352    var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
1353
1354    var jqxhr;
1355
1356    // options.iframe allows user to force iframe mode
1357    // 06-NOV-09: now defaulting to iframe mode if file input is detected
1358    if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
1359        // hack to fix Safari hang (thanks to Tim Molendijk for this)
1360        // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
1361        if (options.closeKeepAlive) {
1362            $.get(options.closeKeepAlive, function() {
1363                jqxhr = fileUploadIframe(a);
1364            });
1365        }
1366        else {
1367            jqxhr = fileUploadIframe(a);
1368        }
1369    }
1370    else if ((hasFileInputs || multipart) && fileAPI) {
1371        jqxhr = fileUploadXhr(a);
1372    }
1373    else {
1374        jqxhr = $.ajax(options);
1375    }
1376
1377    $form.removeData('jqxhr').data('jqxhr', jqxhr);
1378
1379    // clear element array
1380    for (var k=0; k < elements.length; k++) {
1381        elements[k] = null;
1382    }
1383
1384    // fire 'notify' event
1385    this.trigger('form-submit-notify', [this, options]);
1386    return this;
1387
1388    // utility fn for deep serialization
1389    function deepSerialize(extraData){
1390        var serialized = $.param(extraData, options.traditional).split('&');
1391        var len = serialized.length;
1392        var result = [];
1393        var i, part;
1394        for (i=0; i < len; i++) {
1395            // #252; undo param space replacement
1396            serialized[i] = serialized[i].replace(/\+/g,' ');
1397            part = serialized[i].split('=');
1398            // #278; use array instead of object storage, favoring array serializations
1399            result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
1400        }
1401        return result;
1402    }
1403
1404     // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
1405    function fileUploadXhr(a) {
1406        var formdata = new FormData();
1407
1408        for (var i=0; i < a.length; i++) {
1409            formdata.append(a[i].name, a[i].value);
1410        }
1411
1412        if (options.extraData) {
1413            var serializedData = deepSerialize(options.extraData);
1414            for (i=0; i < serializedData.length; i++) {
1415                if (serializedData[i]) {
1416                    formdata.append(serializedData[i][0], serializedData[i][1]);
1417                }
1418            }
1419        }
1420
1421        options.data = null;
1422
1423        var s = $.extend(true, {}, $.ajaxSettings, options, {
1424            contentType: false,
1425            processData: false,
1426            cache: false,
1427            type: method || 'POST'
1428        });
1429
1430        if (options.uploadProgress) {
1431            // workaround because jqXHR does not expose upload property
1432            s.xhr = function() {
1433                var xhr = $.ajaxSettings.xhr();
1434                if (xhr.upload) {
1435                    xhr.upload.addEventListener('progress', function(event) {
1436                        var percent = 0;
1437                        var position = event.loaded || event.position; /*event.position is deprecated*/
1438                        var total = event.total;
1439                        if (event.lengthComputable) {
1440                            percent = Math.ceil(position / total * 100);
1441                        }
1442                        options.uploadProgress(event, position, total, percent);
1443                    }, false);
1444                }
1445                return xhr;
1446            };
1447        }
1448
1449        s.data = null;
1450        var beforeSend = s.beforeSend;
1451        s.beforeSend = function(xhr, o) {
1452            //Send FormData() provided by user
1453            if (options.formData) {
1454                o.data = options.formData;
1455            }
1456            else {
1457                o.data = formdata;
1458            }
1459            if(beforeSend) {
1460                beforeSend.call(this, xhr, o);
1461            }
1462        };
1463        return $.ajax(s);
1464    }
1465
1466    // private function for handling file uploads (hat tip to YAHOO!)
1467    function fileUploadIframe(a) {
1468        var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
1469        var deferred = $.Deferred();
1470
1471        // #341
1472        deferred.abort = function(status) {
1473            xhr.abort(status);
1474        };
1475
1476        if (a) {
1477            // ensure that every serialized input is still enabled
1478            for (i=0; i < elements.length; i++) {
1479                el = $(elements[i]);
1480                if ( hasProp ) {
1481                    el.prop('disabled', false);
1482                }
1483                else {
1484                    el.removeAttr('disabled');
1485                }
1486            }
1487        }
1488
1489        s = $.extend(true, {}, $.ajaxSettings, options);
1490        s.context = s.context || s;
1491        id = 'jqFormIO' + (new Date().getTime());
1492        if (s.iframeTarget) {
1493            $io = $(s.iframeTarget);
1494            n = $io.attr2('name');
1495            if (!n) {
1496                $io.attr2('name', id);
1497            }
1498            else {
1499                id = n;
1500            }
1501        }
1502        else {
1503            $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
1504            $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
1505        }
1506        io = $io[0];
1507
1508
1509        xhr = { // mock object
1510            aborted: 0,
1511            responseText: null,
1512            responseXML: null,
1513            status: 0,
1514            statusText: 'n/a',
1515            getAllResponseHeaders: function() {},
1516            getResponseHeader: function() {},
1517            setRequestHeader: function() {},
1518            abort: function(status) {
1519                var e = (status === 'timeout' ? 'timeout' : 'aborted');
1520                log('aborting upload... ' + e);
1521                this.aborted = 1;
1522
1523                try { // #214, #257
1524                    if (io.contentWindow.document.execCommand) {
1525                        io.contentWindow.document.execCommand('Stop');
1526                    }
1527                }
1528                catch(ignore) {}
1529
1530                $io.attr('src', s.iframeSrc); // abort op in progress
1531                xhr.error = e;
1532                if (s.error) {
1533                    s.error.call(s.context, xhr, e, status);
1534                }
1535                if (g) {
1536                    $.event.trigger("ajaxError", [xhr, s, e]);
1537                }
1538                if (s.complete) {
1539                    s.complete.call(s.context, xhr, e);
1540                }
1541            }
1542        };
1543
1544        g = s.global;
1545        // trigger ajax global events so that activity/block indicators work like normal
1546        if (g && 0 === $.active++) {
1547            $.event.trigger("ajaxStart");
1548        }
1549        if (g) {
1550            $.event.trigger("ajaxSend", [xhr, s]);
1551        }
1552
1553        if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
1554            if (s.global) {
1555                $.active--;
1556            }
1557            deferred.reject();
1558            return deferred;
1559        }
1560        if (xhr.aborted) {
1561            deferred.reject();
1562            return deferred;
1563        }
1564
1565        // add submitting element to data if we know it
1566        sub = form.clk;
1567        if (sub) {
1568            n = sub.name;
1569            if (n && !sub.disabled) {
1570                s.extraData = s.extraData || {};
1571                s.extraData[n] = sub.value;
1572                if (sub.type == "image") {
1573                    s.extraData[n+'.x'] = form.clk_x;
1574                    s.extraData[n+'.y'] = form.clk_y;
1575                }
1576            }
1577        }
1578
1579        var CLIENT_TIMEOUT_ABORT = 1;
1580        var SERVER_ABORT = 2;
1581                
1582        function getDoc(frame) {
1583            /* it looks like contentWindow or contentDocument do not
1584             * carry the protocol property in ie8, when running under ssl
1585             * frame.document is the only valid response document, since
1586             * the protocol is know but not on the other two objects. strange?
1587             * "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy
1588             */
1589            
1590            var doc = null;
1591            
1592            // IE8 cascading access check
1593            try {
1594                if (frame.contentWindow) {
1595                    doc = frame.contentWindow.document;
1596                }
1597            } catch(err) {
1598                // IE8 access denied under ssl & missing protocol
1599                log('cannot get iframe.contentWindow document: ' + err);
1600            }
1601
1602            if (doc) { // successful getting content
1603                return doc;
1604            }
1605
1606            try { // simply checking may throw in ie8 under ssl or mismatched protocol
1607                doc = frame.contentDocument ? frame.contentDocument : frame.document;
1608            } catch(err) {
1609                // last attempt
1610                log('cannot get iframe.contentDocument: ' + err);
1611                doc = frame.document;
1612            }
1613            return doc;
1614        }
1615
1616        // Rails CSRF hack (thanks to Yvan Barthelemy)
1617        var csrf_token = $('meta[name=csrf-token]').attr('content');
1618        var csrf_param = $('meta[name=csrf-param]').attr('content');
1619        if (csrf_param && csrf_token) {
1620            s.extraData = s.extraData || {};
1621            s.extraData[csrf_param] = csrf_token;
1622        }
1623
1624        // take a breath so that pending repaints get some cpu time before the upload starts
1625        function doSubmit() {
1626            // make sure form attrs are set
1627            var t = $form.attr2('target'), 
1628                a = $form.attr2('action'), 
1629                mp = 'multipart/form-data',
1630                et = $form.attr('enctype') || $form.attr('encoding') || mp;
1631
1632            // update form attrs in IE friendly way
1633            form.setAttribute('target',id);
1634            if (!method || /post/i.test(method) ) {
1635                form.setAttribute('method', 'POST');
1636            }
1637            if (a != s.url) {
1638                form.setAttribute('action', s.url);
1639            }
1640
1641            // ie borks in some cases when setting encoding
1642            if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
1643                $form.attr({
1644                    encoding: 'multipart/form-data',
1645                    enctype:  'multipart/form-data'
1646                });
1647            }
1648
1649            // support timout
1650            if (s.timeout) {
1651                timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
1652            }
1653
1654            // look for server aborts
1655            function checkState() {
1656                try {
1657                    var state = getDoc(io).readyState;
1658                    log('state = ' + state);
1659                    if (state && state.toLowerCase() == 'uninitialized') {
1660                        setTimeout(checkState,50);
1661                    }
1662                }
1663                catch(e) {
1664                    log('Server abort: ' , e, ' (', e.name, ')');
1665                    cb(SERVER_ABORT);
1666                    if (timeoutHandle) {
1667                        clearTimeout(timeoutHandle);
1668                    }
1669                    timeoutHandle = undefined;
1670                }
1671            }
1672
1673            // add "extra" data to form if provided in options
1674            var extraInputs = [];
1675            try {
1676                if (s.extraData) {
1677                    for (var n in s.extraData) {
1678                        if (s.extraData.hasOwnProperty(n)) {
1679                           // if using the $.param format that allows for multiple values with the same name
1680                           if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
1681                               extraInputs.push(
1682                               $('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value)
1683                                   .appendTo(form)[0]);
1684                           } else {
1685                               extraInputs.push(
1686                               $('<input type="hidden" name="'+n+'">').val(s.extraData[n])
1687                                   .appendTo(form)[0]);
1688                           }
1689                        }
1690                    }
1691                }
1692
1693                if (!s.iframeTarget) {
1694                    // add iframe to doc and submit the form
1695                    $io.appendTo('body');
1696                }
1697                if (io.attachEvent) {
1698                    io.attachEvent('onload', cb);
1699                }
1700                else {
1701                    io.addEventListener('load', cb, false);
1702                }
1703                setTimeout(checkState,15);
1704
1705                try {
1706                    form.submit();
1707                } catch(err) {
1708                    // just in case form has element with name/id of 'submit'
1709                    var submitFn = document.createElement('form').submit;
1710                    submitFn.apply(form);
1711                }
1712            }
1713            finally {
1714                // reset attrs and remove "extra" input elements
1715                form.setAttribute('action',a);
1716                form.setAttribute('enctype', et); // #380
1717                if(t) {
1718                    form.setAttribute('target', t);
1719                } else {
1720                    $form.removeAttr('target');
1721                }
1722                $(extraInputs).remove();
1723            }
1724        }
1725
1726        if (s.forceSync) {
1727            doSubmit();
1728        }
1729        else {
1730            setTimeout(doSubmit, 10); // this lets dom updates render
1731        }
1732
1733        var data, doc, domCheckCount = 50, callbackProcessed;
1734
1735        function cb(e) {
1736            if (xhr.aborted || callbackProcessed) {
1737                return;
1738            }
1739            
1740            doc = getDoc(io);
1741            if(!doc) {
1742                log('cannot access response document');
1743                e = SERVER_ABORT;
1744            }
1745            if (e === CLIENT_TIMEOUT_ABORT && xhr) {
1746                xhr.abort('timeout');
1747                deferred.reject(xhr, 'timeout');
1748                return;
1749            }
1750            else if (e == SERVER_ABORT && xhr) {
1751                xhr.abort('server abort');
1752                deferred.reject(xhr, 'error', 'server abort');
1753                return;
1754            }
1755
1756            if (!doc || doc.location.href == s.iframeSrc) {
1757                // response not received yet
1758                if (!timedOut) {
1759                    return;
1760                }
1761            }
1762            if (io.detachEvent) {
1763                io.detachEvent('onload', cb);
1764            }
1765            else {
1766                io.removeEventListener('load', cb, false);
1767            }
1768
1769            var status = 'success', errMsg;
1770            try {
1771                if (timedOut) {
1772                    throw 'timeout';
1773                }
1774
1775                var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
1776                log('isXml='+isXml);
1777                if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
1778                    if (--domCheckCount) {
1779                        // in some browsers (Opera) the iframe DOM is not always traversable when
1780                        // the onload callback fires, so we loop a bit to accommodate
1781                        log('requeing onLoad callback, DOM not available');
1782                        setTimeout(cb, 250);
1783                        return;
1784                    }
1785                    // let this fall through because server response could be an empty document
1786                    //log('Could not access iframe DOM after mutiple tries.');
1787                    //throw 'DOMException: not available';
1788                }
1789
1790                //log('response detected');
1791                var docRoot = doc.body ? doc.body : doc.documentElement;
1792                xhr.responseText = docRoot ? docRoot.innerHTML : null;
1793                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
1794                if (isXml) {
1795                    s.dataType = 'xml';
1796                }
1797                xhr.getResponseHeader = function(header){
1798                    var headers = {'content-type': s.dataType};
1799                    return headers[header.toLowerCase()];
1800                };
1801                // support for XHR 'status' & 'statusText' emulation :
1802                if (docRoot) {
1803                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
1804                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
1805                }
1806
1807                var dt = (s.dataType || '').toLowerCase();
1808                var scr = /(json|script|text)/.test(dt);
1809                if (scr || s.textarea) {
1810                    // see if user embedded response in textarea
1811                    var ta = doc.getElementsByTagName('textarea')[0];
1812                    if (ta) {
1813                        xhr.responseText = ta.value;
1814                        // support for XHR 'status' & 'statusText' emulation :
1815                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
1816                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
1817                    }
1818                    else if (scr) {
1819                        // account for browsers injecting pre around json response
1820                        var pre = doc.getElementsByTagName('pre')[0];
1821                        var b = doc.getElementsByTagName('body')[0];
1822                        if (pre) {
1823                            xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
1824                        }
1825                        else if (b) {
1826                            xhr.responseText = b.textContent ? b.textContent : b.innerText;
1827                        }
1828                    }
1829                }
1830                else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
1831                    xhr.responseXML = toXml(xhr.responseText);
1832                }
1833
1834                try {
1835                    data = httpData(xhr, dt, s);
1836                }
1837                catch (err) {
1838                    status = 'parsererror';
1839                    xhr.error = errMsg = (err || status);
1840                }
1841            }
1842            catch (err) {
1843                log('error caught: ',err);
1844                status = 'error';
1845                xhr.error = errMsg = (err || status);
1846            }
1847
1848            if (xhr.aborted) {
1849                log('upload aborted');
1850                status = null;
1851            }
1852
1853            if (xhr.status) { // we've set xhr.status
1854                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
1855            }
1856
1857            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
1858            if (status === 'success') {
1859                if (s.success) {
1860                    s.success.call(s.context, data, 'success', xhr);
1861                }
1862                deferred.resolve(xhr.responseText, 'success', xhr);
1863                if (g) {
1864                    $.event.trigger("ajaxSuccess", [xhr, s]);
1865                }
1866            }
1867            else if (status) {
1868                if (errMsg === undefined) {
1869                    errMsg = xhr.statusText;
1870                }
1871                if (s.error) {
1872                    s.error.call(s.context, xhr, status, errMsg);
1873                }
1874                deferred.reject(xhr, 'error', errMsg);
1875                if (g) {
1876                    $.event.trigger("ajaxError", [xhr, s, errMsg]);
1877                }
1878            }
1879
1880            if (g) {
1881                $.event.trigger("ajaxComplete", [xhr, s]);
1882            }
1883
1884            if (g && ! --$.active) {
1885                $.event.trigger("ajaxStop");
1886            }
1887
1888            if (s.complete) {
1889                s.complete.call(s.context, xhr, status);
1890            }
1891
1892            callbackProcessed = true;
1893            if (s.timeout) {
1894                clearTimeout(timeoutHandle);
1895            }
1896
1897            // clean up
1898            setTimeout(function() {
1899                if (!s.iframeTarget) {
1900                    $io.remove();
1901                }
1902                else { //adding else to clean up existing iframe response.
1903                    $io.attr('src', s.iframeSrc);
1904                }
1905                xhr.responseXML = null;
1906            }, 100);
1907        }
1908
1909        var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
1910            if (window.ActiveXObject) {
1911                doc = new ActiveXObject('Microsoft.XMLDOM');
1912                doc.async = 'false';
1913                doc.loadXML(s);
1914            }
1915            else {
1916                doc = (new DOMParser()).parseFromString(s, 'text/xml');
1917            }
1918            return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
1919        };
1920        var parseJSON = $.parseJSON || function(s) {
1921            /*jslint evil:true */
1922            return window['eval']('(' + s + ')');
1923        };
1924
1925        var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
1926
1927            var ct = xhr.getResponseHeader('content-type') || '',
1928                xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
1929                data = xml ? xhr.responseXML : xhr.responseText;
1930
1931            if (xml && data.documentElement.nodeName === 'parsererror') {
1932                if ($.error) {
1933                    $.error('parsererror');
1934                }
1935            }
1936            if (s && s.dataFilter) {
1937                data = s.dataFilter(data, type);
1938            }
1939            if (typeof data === 'string') {
1940                if (type === 'json' || !type && ct.indexOf('json') >= 0) {
1941                    data = parseJSON(data);
1942                } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
1943                    $.globalEval(data);
1944                }
1945            }
1946            return data;
1947        };
1948
1949        return deferred;
1950    }
1951};
1952
1953/**
1954 * ajaxForm() provides a mechanism for fully automating form submission.
1955 *
1956 * The advantages of using this method instead of ajaxSubmit() are:
1957 *
1958 * 1: This method will include coordinates for <input type="image" /> elements (if the element
1959 *    is used to submit the form).
1960 * 2. This method will include the submit element's name/value data (for the element that was
1961 *    used to submit the form).
1962 * 3. This method binds the submit() method to the form for you.
1963 *
1964 * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
1965 * passes the options argument along after properly binding events for submit elements and
1966 * the form itself.
1967 */
1968$.fn.ajaxForm = function(options) {
1969    options = options || {};
1970    options.delegation = options.delegation && $.isFunction($.fn.on);
1971
1972    // in jQuery 1.3+ we can fix mistakes with the ready state
1973    if (!options.delegation && this.length === 0) {
1974        var o = { s: this.selector, c: this.context };
1975        if (!$.isReady && o.s) {
1976            log('DOM not ready, queuing ajaxForm');
1977            $(function() {
1978                $(o.s,o.c).ajaxForm(options);
1979            });
1980            return this;
1981        }
1982        // is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
1983        log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
1984        return this;
1985    }
1986
1987    if ( options.delegation ) {
1988        $(document)
1989            .off('submit.form-plugin', this.selector, doAjaxSubmit)
1990            .off('click.form-plugin', this.selector, captureSubmittingElement)
1991            .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
1992            .on('click.form-plugin', this.selector, options, captureSubmittingElement);
1993        return this;
1994    }
1995
1996    return this.ajaxFormUnbind()
1997        .bind('submit.form-plugin', options, doAjaxSubmit)
1998        .bind('click.form-plugin', options, captureSubmittingElement);
1999};
2000
2001// private event handlers
2002function doAjaxSubmit(e) {
2003    /*jshint validthis:true */
2004    var options = e.data;
2005    if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
2006        e.preventDefault();
2007        $(e.target).ajaxSubmit(options); // #365
2008    }
2009}
2010
2011function captureSubmittingElement(e) {
2012    /*jshint validthis:true */
2013    var target = e.target;
2014    var $el = $(target);
2015    if (!($el.is("[type=submit],[type=image]"))) {
2016        // is this a child element of the submit el?  (ex: a span within a button)
2017        var t = $el.closest('[type=submit]');
2018        if (t.length === 0) {
2019            return;
2020        }
2021        target = t[0];
2022    }
2023    var form = this;
2024    form.clk = target;
2025    if (target.type == 'image') {
2026        if (e.offsetX !== undefined) {
2027            form.clk_x = e.offsetX;
2028            form.clk_y = e.offsetY;
2029        } else if (typeof $.fn.offset == 'function') {
2030            var offset = $el.offset();
2031            form.clk_x = e.pageX - offset.left;
2032            form.clk_y = e.pageY - offset.top;
2033        } else {
2034            form.clk_x = e.pageX - target.offsetLeft;
2035            form.clk_y = e.pageY - target.offsetTop;
2036        }
2037    }
2038    // clear form vars
2039    setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
2040}
2041
2042
2043// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
2044$.fn.ajaxFormUnbind = function() {
2045    return this.unbind('submit.form-plugin click.form-plugin');
2046};
2047
2048/**
2049 * formToArray() gathers form element data into an array of objects that can
2050 * be passed to any of the following ajax functions: $.get, $.post, or load.
2051 * Each object in the array has both a 'name' and 'value' property.  An example of
2052 * an array for a simple login form might be:
2053 *
2054 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
2055 *
2056 * It is this array that is passed to pre-submit callback functions provided to the
2057 * ajaxSubmit() and ajaxForm() methods.
2058 */
2059$.fn.formToArray = function(semantic, elements) {
2060    var a = [];
2061    if (this.length === 0) {
2062        return a;
2063    }
2064
2065    var form = this[0];
2066    var formId = this.attr('id');
2067    var els = semantic ? form.getElementsByTagName('*') : form.elements;
2068    var els2;
2069
2070    if (els && !/MSIE [678]/.test(navigator.userAgent)) { // #390
2071        els = $(els).get();  // convert to standard array
2072    }
2073
2074    // #386; account for inputs outside the form which use the 'form' attribute
2075    if ( formId ) {
2076        els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet
2077        if ( els2.length ) {
2078            els = (els || []).concat(els2);
2079        }
2080    }
2081
2082    if (!els || !els.length) {
2083        return a;
2084    }
2085
2086    var i,j,n,v,el,max,jmax;
2087    for(i=0, max=els.length; i < max; i++) {
2088        el = els[i];
2089        n = el.name;
2090        if (!n || el.disabled) {
2091            continue;
2092        }
2093
2094        if (semantic && form.clk && el.type == "image") {
2095            // handle image inputs on the fly when semantic == true
2096            if(form.clk == el) {
2097                a.push({name: n, value: $(el).val(), type: el.type });
2098                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
2099            }
2100            continue;
2101        }
2102
2103        v = $.fieldValue(el, true);
2104        if (v && v.constructor == Array) {
2105            if (elements) {
2106                elements.push(el);
2107            }
2108            for(j=0, jmax=v.length; j < jmax; j++) {
2109                a.push({name: n, value: v[j]});
2110            }
2111        }
2112        else if (feature.fileapi && el.type == 'file') {
2113            if (elements) {
2114                elements.push(el);
2115            }
2116            var files = el.files;
2117            if (files.length) {
2118                for (j=0; j < files.length; j++) {
2119                    a.push({name: n, value: files[j], type: el.type});
2120                }
2121            }
2122            else {
2123                // #180
2124                a.push({ name: n, value: '', type: el.type });
2125            }
2126        }
2127        else if (v !== null && typeof v != 'undefined') {
2128            if (elements) {
2129                elements.push(el);
2130            }
2131            a.push({name: n, value: v, type: el.type, required: el.required});
2132        }
2133    }
2134
2135    if (!semantic && form.clk) {
2136        // input type=='image' are not found in elements array! handle it here
2137        var $input = $(form.clk), input = $input[0];
2138        n = input.name;
2139        if (n && !input.disabled && input.type == 'image') {
2140            a.push({name: n, value: $input.val()});
2141            a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
2142        }
2143    }
2144    return a;
2145};
2146
2147/**
2148 * Serializes form data into a 'submittable' string. This method will return a string
2149 * in the format: name1=value1&amp;name2=value2
2150 */
2151$.fn.formSerialize = function(semantic) {
2152    //hand off to jQuery.param for proper encoding
2153    return $.param(this.formToArray(semantic));
2154};
2155
2156/**
2157 * Serializes all field elements in the jQuery object into a query string.
2158 * This method will return a string in the format: name1=value1&amp;name2=value2
2159 */
2160$.fn.fieldSerialize = function(successful) {
2161    var a = [];
2162    this.each(function() {
2163        var n = this.name;
2164        if (!n) {
2165            return;
2166        }
2167        var v = $.fieldValue(this, successful);
2168        if (v && v.constructor == Array) {
2169            for (var i=0,max=v.length; i < max; i++) {
2170                a.push({name: n, value: v[i]});
2171            }
2172        }
2173        else if (v !== null && typeof v != 'undefined') {
2174            a.push({name: this.name, value: v});
2175        }
2176    });
2177    //hand off to jQuery.param for proper encoding
2178    return $.param(a);
2179};
2180
2181/**
2182 * Returns the value(s) of the element in the matched set.  For example, consider the following form:
2183 *
2184 *  <form><fieldset>
2185 *      <input name="A" type="text" />
2186 *      <input name="A" type="text" />
2187 *      <input name="B" type="checkbox" value="B1" />
2188 *      <input name="B" type="checkbox" value="B2"/>
2189 *      <input name="C" type="radio" value="C1" />
2190 *      <input name="C" type="radio" value="C2" />
2191 *  </fieldset></form>
2192 *
2193 *  var v = $('input[type=text]').fieldValue();
2194 *  // if no values are entered into the text inputs
2195 *  v == ['','']
2196 *  // if values entered into the text inputs are 'foo' and 'bar'
2197 *  v == ['foo','bar']
2198 *
2199 *  var v = $('input[type=checkbox]').fieldValue();
2200 *  // if neither checkbox is checked
2201 *  v === undefined
2202 *  // if both checkboxes are checked
2203 *  v == ['B1', 'B2']
2204 *
2205 *  var v = $('input[type=radio]').fieldValue();
2206 *  // if neither radio is checked
2207 *  v === undefined
2208 *  // if first radio is checked
2209 *  v == ['C1']
2210 *
2211 * The successful argument controls whether or not the field element must be 'successful'
2212 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
2213 * The default value of the successful argument is true.  If this value is false the value(s)
2214 * for each element is returned.
2215 *
2216 * Note: This method *always* returns an array.  If no valid value can be determined the
2217 *    array will be empty, otherwise it will contain one or more values.
2218 */
2219$.fn.fieldValue = function(successful) {
2220    for (var val=[], i=0, max=this.length; i < max; i++) {
2221        var el = this[i];
2222        var v = $.fieldValue(el, successful);
2223        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
2224            continue;
2225        }
2226        if (v.constructor == Array) {
2227            $.merge(val, v);
2228        }
2229        else {
2230            val.push(v);
2231        }
2232    }
2233    return val;
2234};
2235
2236/**
2237 * Returns the value of the field element.
2238 */
2239$.fieldValue = function(el, successful) {
2240    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
2241    if (successful === undefined) {
2242        successful = true;
2243    }
2244
2245    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
2246        (t == 'checkbox' || t == 'radio') && !el.checked ||
2247        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
2248        tag == 'select' && el.selectedIndex == -1)) {
2249            return null;
2250    }
2251
2252    if (tag == 'select') {
2253        var index = el.selectedIndex;
2254        if (index < 0) {
2255            return null;
2256        }
2257        var a = [], ops = el.options;
2258        var one = (t == 'select-one');
2259        var max = (one ? index+1 : ops.length);
2260        for(var i=(one ? index : 0); i < max; i++) {
2261            var op = ops[i];
2262            if (op.selected) {
2263                var v = op.value;
2264                if (!v) { // extra pain for IE...
2265                    v = (op.attributes && op.attributes.value && !(op.attributes.value.specified)) ? op.text : op.value;
2266                }
2267                if (one) {
2268                    return v;
2269                }
2270                a.push(v);
2271            }
2272        }
2273        return a;
2274    }
2275    return $(el).val();
2276};
2277
2278/**
2279 * Clears the form data.  Takes the following actions on the form's input fields:
2280 *  - input text fields will have their 'value' property set to the empty string
2281 *  - select elements will have their 'selectedIndex' property set to -1
2282 *  - checkbox and radio inputs will have their 'checked' property set to false
2283 *  - inputs of type submit, button, reset, and hidden will *not* be effected
2284 *  - button elements will *not* be effected
2285 */
2286$.fn.clearForm = function(includeHidden) {
2287    return this.each(function() {
2288        $('input,select,textarea', this).clearFields(includeHidden);
2289    });
2290};
2291
2292/**
2293 * Clears the selected form elements.
2294 */
2295$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
2296    var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
2297    return this.each(function() {
2298        var t = this.type, tag = this.tagName.toLowerCase();
2299        if (re.test(t) || tag == 'textarea') {
2300            this.value = '';
2301        }
2302        else if (t == 'checkbox' || t == 'radio') {
2303            this.checked = false;
2304        }
2305        else if (tag == 'select') {
2306            this.selectedIndex = -1;
2307        }
2308        else if (t == "file") {
2309            if (/MSIE/.test(navigator.userAgent)) {
2310                $(this).replaceWith($(this).clone(true));
2311            } else {
2312                $(this).val('');
2313            }
2314        }
2315        else if (includeHidden) {
2316            // includeHidden can be the value true, or it can be a selector string
2317            // indicating a special test; for example:
2318            //  $('#myForm').clearForm('.special:hidden')
2319            // the above would clean hidden inputs that have the class of 'special'
2320            if ( (includeHidden === true && /hidden/.test(t)) ||
2321                 (typeof includeHidden == 'string' && $(this).is(includeHidden)) ) {
2322                this.value = '';
2323            }
2324        }
2325    });
2326};
2327
2328/**
2329 * Resets the form data.  Causes all form elements to be reset to their original value.
2330 */
2331$.fn.resetForm = function() {
2332    return this.each(function() {
2333        // guard against an input with the name of 'reset'
2334        // note that IE reports the reset function as an 'object'
2335        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
2336            this.reset();
2337        }
2338    });
2339};
2340
2341/**
2342 * Enables or disables any matching elements.
2343 */
2344$.fn.enable = function(b) {
2345    if (b === undefined) {
2346        b = true;
2347    }
2348    return this.each(function() {
2349        this.disabled = !b;
2350    });
2351};
2352
2353/**
2354 * Checks/unchecks any matching checkboxes or radio buttons and
2355 * selects/deselects and matching option elements.
2356 */
2357$.fn.selected = function(select) {
2358    if (select === undefined) {
2359        select = true;
2360    }
2361    return this.each(function() {
2362        var t = this.type;
2363        if (t == 'checkbox' || t == 'radio') {
2364            this.checked = select;
2365        }
2366        else if (this.tagName.toLowerCase() == 'option') {
2367            var $sel = $(this).parent('select');
2368            if (select && $sel[0] && $sel[0].type == 'select-one') {
2369                // deselect all other options
2370                $sel.find('option').selected(false);
2371            }
2372            this.selected = select;
2373        }
2374    });
2375};
2376
2377// expose debug var
2378$.fn.ajaxSubmit.debug = false;
2379
2380// helper fn for console logging
2381function log() {
2382    if (!$.fn.ajaxSubmit.debug) {
2383        return;
2384    }
2385    var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
2386    if (window.console && window.console.log) {
2387        window.console.log(msg);
2388    }
2389    else if (window.opera && window.opera.postError) {
2390        window.opera.postError(msg);
2391    }
2392}
2393
2394}));
2395
2396/*! WysiBB - WYSIWYG BBCode editor - v1.4.2 - 2013-04-06
2397 * http://www.wysibb.com
2398 * Copyright (c) 2013 Vadim Dobroskok; Licensed MIT, GPL */
2399typeof WBBLANG == "undefined" && (WBBLANG = {}), WBBLANG.ru = CURLANG = {
2400        bold: "Полужирный",
2401        italic: "Курсив",
2402        underline: "Подчеркнутый",
2403        strike: "Зачеркнутый",
2404        link: "Ссылка",
2405        img: "Изображение",
2406        sup: "Надстрочный текст",
2407        sub: "Подстрочный текст",
2408        justifyleft: "Текст по левому краю",
2409        justifycenter: "Текст по центру",
2410        justifyright: "Текст по правому краю",
2411        table: "Вставить таблицу",
2412        bullist: "Обычный список",
2413        numlist: "Нумерованный список",
2414        quote: "Цитата",
2415        offtop: "Оффтоп",
2416        code: "Код",
2417        spoiler: "Сворачиваемый текст",
2418        fontcolor: "Цвет текста",
2419        fontsize: "Размер текста",
2420        fontfamily: "Шрифт текста",
2421        fs_verysmall: "Очень маленький",
2422        fs_small: "Маленький",
2423        fs_normal: "Нормальный",
2424        fs_big: "Большой",
2425        fs_verybig: "Очень большой",
2426        smilebox: "Вставить смайл",
2427        video: "Вставить видео",
2428        removeFormat: "Удалить форматирование",
2429        modal_link_title: "Вставить ссылку",
2430        modal_link_text: "Отображаемый текст",
2431        modal_link_url: "URL ссылки",
2432        modal_email_text: "Отображаемый эл.адрес",
2433        modal_email_url: "Email",
2434        modal_link_tab1: "Вставить URL",
2435        modal_img_title: "Вставить изображение",
2436        modal_img_tab1: "Ввести URL",
2437        modal_img_tab2: "Загрузить файл",
2438        modal_imgsrc_text: "Введите адрес изображения",
2439        modal_img_btn: "Выберите файл для загрузки",
2440        add_attach: "Добавить вложение",
2441        modal_video_text: "Введите URL видео",
2442        close: "Закрыть",
2443        save: "Сохранить",
2444        cancel: "Отмена",
2445        remove: "Удалить",
2446        validation_err: "Введенные данные некорректны",
2447        error_onupload: "Ошибка во время загрузки файла или такое расширение файла не поддерживается",
2448        fileupload_text1: "Перетащите файл сюда",
2449        fileupload_text2: "или",
2450        loading: "Загрузка",
2451        auto: "Авто",
2452        views: "Просмотров",
2453        downloads: "Скачиваний",
2454        sm1: "Улыбка",
2455        sm2: "Смех",
2456        sm3: "Подмигивание",
2457        sm4: "Спасибо, класс",
2458        sm5: "Ругаю",
2459        sm6: "Шок",
2460        sm7: "Злой",
2461        sm8: "Огорчение",
2462        sm9: "Тошнит"
2463    }, wbbdebug = !1,
2464    function(e) {
2465        "use strict";
2466        e.wysibb = function(t, n) {
2467            e(t).data("wbb", this), n && n.deflang && typeof WBBLANG[n.deflang] != "undefined" && (CURLANG = WBBLANG[n.deflang]), n && n.lang && typeof WBBLANG[n.lang] != "undefined" && (CURLANG = WBBLANG[n.lang]), this.txtArea = t, this.$txtArea = e(t);
2468            var r = this.$txtArea.attr("id") || this.setUID(this.txtArea);
2469            this.options = {
2470                bbmode: !1,
2471                onlyBBmode: !1,
2472                themeName: "default",
2473                bodyClass: "",
2474                lang: "ru",
2475                tabInsert: !0,
2476                imgupload: !0,
2477                img_uploadurl: "/iupload.php",
2478                img_maxwidth: 800,
2479                img_maxheight: 800,
2480                hotkeys: !0,
2481                showHotkeys: !0,
2482                autoresize: !0,
2483                resize_maxheight: 800,
2484                loadPageStyles: !0,
2485                traceTextarea: !0,
2486                smileConversion: !0,
2487                buttons: "bold,italic,underline,strike,sup,sub,|,img,video,link,|,bullist,numlist,smilebox,|,fontcolor,fontsize,fontfamily,|,justifyleft,justifycenter,justifyright,|,quote,code,offtop,table,removeFormat",
2488                allButtons: {
2489                    bold: {
2490                        title: CURLANG.bold,
2491                        buttonHTML: '<span class="fonticon ve-tlb-bold1"></span>',
2492                        excmd: "bold",
2493                        hotkey: "ctrl+b",
2494                        transform: {
2495                            "<b>{SELTEXT}</b>": "[b]{SELTEXT}[/b]",
2496                            "<strong>{SELTEXT}</strong>": "[b]{SELTEXT}[/b]"
2497                        }
2498                    },
2499                    italic: {
2500                        title: CURLANG.italic,
2501                        buttonHTML: '<span class="fonticon ve-tlb-italic1"></span>',
2502                        excmd: "italic",
2503                        hotkey: "ctrl+i",
2504                        transform: {
2505                            "<i>{SELTEXT}</i>": "[i]{SELTEXT}[/i]",
2506                            "<em>{SELTEXT}</em>": "[i]{SELTEXT}[/i]"
2507                        }
2508                    },
2509                    underline: {
2510                        title: CURLANG.underline,
2511                        buttonHTML: '<span class="fonticon ve-tlb-underline1"></span>',
2512                        excmd: "underline",
2513                        hotkey: "ctrl+u",
2514                        transform: {
2515                            "<u>{SELTEXT}</u>": "[u]{SELTEXT}[/u]"
2516                        }
2517                    },
2518                    strike: {
2519                        title: CURLANG.strike,
2520                        buttonHTML: '<span class="fonticon fi-stroke1 ve-tlb-strike1"></span>',
2521                        excmd: "strikeThrough",
2522                        transform: {
2523                            "<strike>{SELTEXT}</strike>": "[s]{SELTEXT}[/s]",
2524                            "<s>{SELTEXT}</s>": "[s]{SELTEXT}[/s]"
2525                        }
2526                    },
2527                    sup: {
2528                        title: CURLANG.sup,
2529                        buttonHTML: '<span class="fonticon ve-tlb-sup1"></span>',
2530                        excmd: "superscript",
2531                        transform: {
2532                            "<sup>{SELTEXT}</sup>": "[sup]{SELTEXT}[/sup]"
2533                        }
2534                    },
2535                    sub: {
2536                        title: CURLANG.sub,
2537                        buttonHTML: '<span class="fonticon ve-tlb-sub1"></span>',
2538                        excmd: "subscript",
2539                        transform: {
2540                            "<sub>{SELTEXT}</sub>": "[sub]{SELTEXT}[/sub]"
2541                        }
2542                    },
2543                    link: {
2544                        title: CURLANG.link,
2545                        buttonHTML: '<span class="fonticon ve-tlb-link1"></span>',
2546                        hotkey: "ctrl+shift+2",
2547                        modal: {
2548                            title: CURLANG.modal_link_title,
2549                            width: "500px",
2550                            tabs: [{
2551                                input: [{
2552                                    param: "SELTEXT",
2553                                    title: CURLANG.modal_link_text,
2554                                    type: "div"
2555                                }, {
2556                                    param: "URL",
2557                                    title: CURLANG.modal_link_url,
2558                                    validation: "^http(s)?://"
2559                                }]
2560                            }]
2561                        },
2562                        transform: {
2563                            '<a href="{URL}">{SELTEXT}</a>': "[url={URL}]{SELTEXT}[/url]",
2564                            '<a href="{URL}">
2564{URL}</a>': "[url]{URL}[/url]"
2565                        }
2566                    },
2567                    img: {
2568                        title: CURLANG.img,
2569                        buttonHTML: '<span class="fonticon ve-tlb-img1"></span>',
2570                        hotkey: "ctrl+shift+1",
2571                        modal: {
2572                            title: CURLANG.modal_img_title,
2573                            width: "600px",
2574                            tabs: [{
2575                                title: CURLANG.modal_img_tab1,
2576                                input: [{
2577                                    param: "SRC",
2578                                    title: CURLANG.modal_imgsrc_text,
2579                                    validation: "^http(s)?://.*?.(jpg|png|gif|jpeg)$"
2580                                }]
2581                            }, {
2582                                title: CURLANG.modal_img_tab2,
2583                                html: '<div id="imguploader"> <form id="fupform" class="upload" action="{img_uploadurl}" method="post" enctype="multipart/form-data" target="fupload"><input type="hidden" name="iframe" value="1"/><input type="hidden" name="idarea" value="' + r + '" /><div class="fileupload"><input id="fileupl" class="file" type="file" name="img" /><button id="nicebtn" class="wbb-button">' + CURLANG.modal_img_btn + '</button> </div> </form> </div><iframe id="fupload" name="fupload" src="about:blank" frameborder="0" style="width:0px;height:0px;display:none"></iframe></div>'
2584                            }],
2585                            onLoad: this.imgLoadModal
2586                        },
2587                        transform: {
2588                            '<img src="{SRC}" />': "[img]{SRC}[/img]",
2589                            '<img src="{SRC}" width="{WIDTH}" height="{HEIGHT}"/>': "[img width={WIDTH},height={HEIGHT}]{SRC}[/img]"
2590                        }
2591                    },
2592                    bullist: {
2593                        title: CURLANG.bullist,
2594                        buttonHTML: '<span class="fonticon ve-tlb-list1"></span>',
2595                        excmd: "insertUnorderedList",
2596                        transform: {
2597                            "<ul>{SELTEXT}</ul>": "[list]{SELTEXT}[/list]",
2598                            "<li>{SELTEXT}</li>": "[*]{SELTEXT}[/*]"
2599                        }
2600                    },
2601                    numlist: {
2602                        title: CURLANG.numlist,
2603                        buttonHTML: '<span class="fonticon ve-tlb-numlist1"></span>',
2604                        excmd: "insertOrderedList",
2605                        transform: {
2606                            "<ol>{SELTEXT}</ol>": "[list=1]{SELTEXT}[/list]",
2607                            "<li>{SELTEXT}</li>": "[*]{SELTEXT}[/*]"
2608                        }
2609                    },
2610                    quote: {
2611                        title: CURLANG.quote,
2612                        buttonHTML: '<span class="fonticon ve-tlb-quote1"></span>',
2613                        hotkey: "ctrl+shift+3",
2614                        transform: {
2615                            '<div class="quote">{SELTEXT}</div>': "[quote]{SELTEXT}[/quote]"
2616                        }
2617                    },
2618                    code: {
2619                        title: CURLANG.code,
2620                        buttonText: "[code]",
2621                        hotkey: "ctrl+shift+4",
2622                        onlyClearText: !0,
2623                        transform: {
2624                            '<div class="codewrap"><div class="codetop" contenteditable="false">Код:</div><div class="codemain">{SELTEXT}</div></div>': "[code]{SELTEXT}[/code]"
2625                        }
2626                    },
2627                    offtop: {
2628                        title: CURLANG.offtop,
2629                        buttonText: "offtop",
2630                        transform: {
2631                            '<span style="font-size:10px;color:#ccc">{SELTEXT}</span>': "[offtop]{SELTEXT}[/offtop]"
2632                        }
2633                    },
2634                    fontcolor: {
2635                        type: "colorpicker",
2636                        title: CURLANG.fontcolor,
2637                        excmd: "foreColor",
2638                        valueBBname: "color",
2639                        subInsert: !0,
2640                        colors: "#000000,#444444,#666666,#999999,#b6b6b6,#cccccc,#d8d8d8,#efefef,#f4f4f4,#ffffff,-, 							 #ff0000,#980000,#ff7700,#ffff00,#00ff00,#00ffff,#1e84cc,#0000ff,#9900ff,#ff00ff,-, 							 #f4cccc,#dbb0a7,#fce5cd,#fff2cc,#d9ead3,#d0e0e3,#c9daf8,#cfe2f3,#d9d2e9,#ead1dc, 							 #ea9999,#dd7e6b,#f9cb9c,#ffe599,#b6d7a8,#a2c4c9,#a4c2f4,#9fc5e8,#b4a7d6,#d5a6bd, 							 #e06666,#cc4125,#f6b26b,#ffd966,#93c47d,#76a5af,#6d9eeb,#6fa8dc,#8e7cc3,#c27ba0, 							 #cc0000,#a61c00,#e69138,#f1c232,#6aa84f,#45818e,#3c78d8,#3d85c6,#674ea7,#a64d79, 							 #900000,#85200C,#B45F06,#BF9000,#38761D,#134F5C,#1155Cc,#0B5394,#351C75,#741B47, 							 #660000,#5B0F00,#783F04,#7F6000,#274E13,#0C343D,#1C4587,#073763,#20124D,#4C1130",
2641                        transform: {
2642                            '<font color="{COLOR}">{SELTEXT}</font>': "[color={COLOR}]{SELTEXT}[/color]"
2643                        }
2644                    },
2645                    table: {
2646                        type: "table",
2647                        title: CURLANG.table,
2648                        cols: 10,
2649                        rows: 10,
2650                        cellwidth: 15,
2651                        transform: {
2652                            "<td>{SELTEXT}</td>": "[td]{SELTEXT}[/td]",
2653                            "<tr>{SELTEXT}</tr>": "[tr]{SELTEXT}[/tr]",
2654                            '<table class="wbb-table">{SELTEXT}</table>': "[table]{SELTEXT}[/table]"
2655                        },
2656                        skipRules: !0
2657                    },
2658                    fontsize: {
2659                        type: "select",
2660                        title: CURLANG.fontsize,
2661                        options: "fs_verysmall,fs_small,fs_normal,fs_big,fs_verybig"
2662                    },
2663                    fontfamily: {
2664                        type: "select",
2665                        title: CURLANG.fontfamily,
2666                        excmd: "fontName",
2667                        valueBBname: "font",
2668                        options: [{
2669                            title: "Arial",
2670                            exvalue: "Arial"
2671                        }, {
2672                            title: "Comic Sans MS",
2673                            exvalue: "Comic Sans MS"
2674                        }, {
2675                            title: "Courier New",
2676                            exvalue: "Courier New"
2677                        }, {
2678                            title: "Georgia",
2679                            exvalue: "Georgia"
2680                        }, {
2681                            title: "Lucida Sans Unicode",
2682                            exvalue: "Lucida Sans Unicode"
2683                        }, {
2684                            title: "Tahoma",
2685                            exvalue: "Tahoma"
2686                        }, {
2687                            title: "Times New Roman",
2688                            exvalue: "Times New Roman"
2689                        }, {
2690                            title: "Trebuchet MS",
2691                            exvalue: "Trebuchet MS"
2692                        }, {
2693                            title: "Verdana",
2694                            exvalue: "Verdana"
2695                        }],
2696                        transform: {
2697                            '<font face="{FONT}">{SELTEXT}</font>': "[font={FONT}]{SELTEXT}[/font]"
2698                        }
2699                    },
2700                    smilebox: {
2701                        type: "smilebox",
2702                        title: CURLANG.smilebox,
2703                        buttonHTML: '<span class="fonticon ve-tlb-smilebox1"></span>'
2704                    },
2705                    justifyleft: {
2706                        title: CURLANG.justifyleft,
2707                        buttonHTML: '<span class="fonticon ve-tlb-textleft1"></span>',
2708                        groupkey: "align",
2709                        transform: {
2710                            '<p style="text-align:left">{SELTEXT}</p>': "[left]{SELTEXT}[/left]"
2711                        }
2712                    },
2713                    justifyright: {
2714                        title: CURLANG.justifyright,
2715                        buttonHTML: '<span class="fonticon ve-tlb-textright1"></span>',
2716                        groupkey: "align",
2717                        transform: {
2718                            '<p style="text-align:right">{SELTEXT}</p>': "[right]{SELTEXT}[/right]"
2719                        }
2720                    },
2721                    justifycenter: {
2722                        title: CURLANG.justifycenter,
2723                        buttonHTML: '<span class="fonticon ve-tlb-textcenter1"></span>',
2724                        groupkey: "align",
2725                        transform: {
2726                            '<p style="text-align:center">{SELTEXT}</p>': "[center]{SELTEXT}[/center]"
2727                        }
2728                    },
2729                    video: {
2730                        title: CURLANG.video,
2731                        buttonHTML: '<span class="fonticon ve-tlb-video1"></span>',
2732                        modal: {
2733                            title: CURLANG.video,
2734                            width: "600px",
2735                            tabs: [{
2736                                title: CURLANG.video,
2737                                input: [{
2738                                    param: "SRC",
2739                                    title: CURLANG.modal_video_text
2740                                }]
2741                            }],
2742                            onSubmit: function(e, t, n) {
2743                                var r = this.$modal.find('input[name="SRC"]').val();
2744                                r && (r = r.replace(/^\s+/, "").replace(/\s+$/, ""));
2745                                var i;
2746                                r.indexOf("youtu.be") != -1 ? i = r.match(/^http:\/\/youtu\.be\/([a-z0-9_-]+)/i) : i = r.match(/^http:\/\/www\.youtube\.com\/watch\?.*?v=([a-z0-9_-]+)/i);
2747                                if (i && i.length == 2) {
2748                                    var s = i[1];
2749                                    this.insertAtCursor(this.getCodeByCommand(e, {
2750                                        src: s
2751                                    }))
2752                                }
2753                                return this.closeModal(), this.updateUI(), !1
2754                            }
2755                        },
2756                        transform: {
2757                            '<iframe src="http://www.youtube.com/embed/{SRC}" width="640" height="480" frameborder="0"></iframe>': "[video]{SRC}[/video]"
2758                        }
2759                    },
2760                    fs_verysmall: {
2761                        title: CURLANG.fs_verysmall,
2762                        buttonText: "fs1",
2763                        excmd: "fontSize",
2764                        exvalue: "1",
2765                        transform: {
2766                            '<font size="1">{SELTEXT}</font>': "[size=50]{SELTEXT}[/size]"
2767                        }
2768                    },
2769                    fs_small: {
2770                        title: CURLANG.fs_small,
2771                        buttonText: "fs2",
2772                        excmd: "fontSize",
2773                        exvalue: "2",
2774                        transform: {
2775                            '<font size="2">{SELTEXT}</font>': "[size=85]{SELTEXT}[/size]"
2776                        }
2777                    },
2778                    fs_normal: {
2779                        title: CURLANG.fs_normal,
2780                        buttonText: "fs3",
2781                        excmd: "fontSize",
2782                        exvalue: "3",
2783                        transform: {
2784                            '<font size="3">{SELTEXT}</font>': "[size=100]{SELTEXT}[/size]"
2785                        }
2786                    },
2787                    fs_big: {
2788                        title: CURLANG.fs_big,
2789                        buttonText: "fs4",
2790                        excmd: "fontSize",
2791                        exvalue: "4",
2792                        transform: {
2793                            '<font size="4">{SELTEXT}</font>': "[size=150]{SELTEXT}[/size]"
2794                        }
2795                    },
2796                    fs_verybig: {
2797                        title: CURLANG.fs_verybig,
2798                        buttonText: "fs5",
2799                        excmd: "fontSize",
2800                        exvalue: "6",
2801                        transform: {
2802                            '<font size="6">{SELTEXT}</font>': "[size=200]{SELTEXT}[/size]"
2803                        }
2804                    },
2805                    removeformat: {
2806                        title: CURLANG.removeFormat,
2807                        buttonHTML: '<span class="fonticon ve-tlb-removeformat1"></span>',
2808                        excmd: "removeFormat"
2809                    }
2810                },
2811                systr: {
2812                    "<br/>": "\n",
2813                    '<span class="wbbtab">{SELTEXT}</span>': "   {SELTEXT}"
2814                },
2815                customRules: {
2816                    td: [
2817                        ["[td]{SELTEXT}[/td]", {
2818                            seltext: {
2819                                rgx: !1,
2820                                attr: !1,
2821                                sel: !1
2822                            }
2823                        }]
2824                    ],
2825                    tr: [
2826                        ["[tr]{SELTEXT}[/tr]", {
2827                            seltext: {
2828                                rgx: !1,
2829                                attr: !1,
2830                                sel: !1
2831                            }
2832                        }]
2833                    ],
2834                    table: [
2835                        ["[table]{SELTEXT}[/table]", {
2836                            seltext: {
2837                                rgx: !1,
2838                                attr: !1,
2839                                sel: !1
2840                            }
2841                        }]
2842                    ]
2843                },
2844                smileList: [{
2845                    title: CURLANG.sm1,
2846                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm1.png" class="sm">',
2847                    bbcode: ":)"
2848                }, {
2849                    title: CURLANG.sm8,
2850                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm8.png" class="sm">',
2851                    bbcode: ":("
2852                }, {
2853                    title: CURLANG.sm1,
2854                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm2.png" class="sm">',
2855                    bbcode: ":D"
2856                }, {
2857                    title: CURLANG.sm3,
2858                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm3.png" class="sm">',
2859                    bbcode: ";)"
2860                }, {
2861                    title: CURLANG.sm4,
2862                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm4.png" class="sm">',
2863                    bbcode: ":up:"
2864                }, {
2865                    title: CURLANG.sm5,
2866                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm5.png" class="sm">',
2867                    bbcode: ":down:"
2868                }, {
2869                    title: CURLANG.sm6,
2870                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm6.png" class="sm">',
2871                    bbcode: ":shock:"
2872                }, {
2873                    title: CURLANG.sm7,
2874                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm7.png" class="sm">',
2875                    bbcode: ":angry:"
2876                }, {
2877                    title: CURLANG.sm9,
2878                    img: '<img src="{themePrefix}{themeName}/img/smiles/sm9.png" class="sm">',
2879                    bbcode: ":sick:"
2880                }],
2881                attrWrap: ["src", "color", "href"]
2882            }, this.inited = this.options.onlyBBmode, this.options.themePrefix || e("link").each(e.proxy(function(t, n) {
2883                var r = e(n).get(0).href.match(/(.*\/)(.*)\/wbbtheme\.css.*$/);
2884                r !== null && (this.options.themeName = r[2], this.options.themePrefix = r[1])
2885            }, this)), typeof WBBPRESET != "undefined" && (WBBPRESET.allButtons && e.each(WBBPRESET.allButtons, e.proxy(function(e, t) {
2886                t.transform && this.options.allButtons[e] && delete this.options.allButtons[e].transform
2887            }, this)), e.extend(!0, this.options, WBBPRESET)), n && n.allButtons && e.each(n.allButtons, e.proxy(function(e, t) {
2888                t.transform && this.options.allButtons[e] && delete this.options.allButtons[e].transform
2889            }, this)), e.extend(!0, this.options, n), this.init()
2890        }, e.wysibb.prototype = {
2891            lastid: 1,
2892            init: function() {
2893                e.log("Init", this), this.isMobile = function(e) {
2894                    /android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|meego.+mobile|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(e)
2895                }(navigator.userAgent || navigator.vendor || window.opera), this.isMobile && (this.options.onlyBBmode = this.options.bbmode = !0), this.options.onlyBBmode === !0 && (this.options.bbmode = !0), this.controllers = [], this.options.buttons = this.options.buttons.toLowerCase(), this.options.buttons = this.options.buttons.split(","), this.options.allButtons._systr = {}, this.options.allButtons._systr.transform = this.options.systr, this.smileFind(), this.initTransforms(), this.build(), this.initModal(), this.options.hotkeys === !0 && !this.isMobile && this.initHotkeys(), this.options.smileList && this.options.smileList.length > 0 && this.options.smileList.sort(function(e, t) {
2896                    return t.bbcode.length - e.bbcode.length
2897                }), this.$txtArea.parents("form").bind("submit", e.proxy(function() {
2898                    return this.sync(), !0
2899                }, this)), this.$txtArea.parents("form").find("input[id*='preview'],input[id*='submit'],input[class*='preview'],input[class*='submit'],input[name*='preview'],input[name*='submit']").bind("mousedown", e.proxy(function() {
2900                    this.sync(), setTimeout(e.proxy(function() {
2901                        this.options.bbmode === !1 && this.$txtArea.removeAttr("wbbsync").val("")
2902                    }, this), 1e3)
2903                }, this)), this.options.initCallback && this.options.initCallback.call(this), e.log(this)
2904            },
2905            initTransforms: function() {
2906                e.log("Create rules for transform HTML=>BB");
2907                var t = this.options;
2908                t.rules || (t.rules = {}), t.groups || (t.groups = {});
2909                var n = t.buttons.slice();
2910                n.push("_systr");
2911                for (var r = 0; r < n.length; r++) {
2912                    var i = t.allButtons[n[r]];
2913                    if (!i) continue;
2914                    i.en = !0, i.simplebbcode && e.isArray(i.simplebbcode) && i.simplebbcode.length == 2 && (i.bbcode = i.html = i.simplebbcode[0] + "{SELTEXT}" + i.simplebbcode[1], i.transform && delete i.transform, i.modal && delete i.modal);
2915                    if (i.type == "select" && typeof i.options == "string") {
2916                        var s = i.options.split(",");
2917                        e.each(s, function(t, r) {
2918                            e.inArray(r, n) == -1 && n.push(r)
2919                        })
2920                    }
2921                    if (i.transform && i.skipRules !== !0) {
2922                        var o = e.extend({}, i.transform);
2923                        for (var u in o) {
2924                            var a = u,
2925                                f = i.transform[u];
2926                            i.bbSelector || (i.bbSelector = []), e.inArray(f, i.bbSelector) == -1 && i.bbSelector.push(f);
2927                            if (this.options.onlyBBmode === !1) {
2928                                u = this.wrapAttrs(u);
2929                                var l = e(document.createElement("DIV")).append(e(this.elFromString(u, document))),
2930                                    c = this.filterByNode(l.children());
2931                                if (c == "div" || typeof t.rules[c] != "undefined") {
2932                                    e.log("create unique selector: " + c), this.setUID(l.children()), c = this.filterByNode(l.children());
2933                                    var h = l.html();
2934                                    h = this.unwrapAttrs(h);
2935                                    var p = this.unwrapAttrs(u);
2936                                    i.transform[h] = f, delete i.transform[p], u = h, a = h
2937                                }
2938                                i.excmd || (i.rootSelector || (i.rootSelector = []), i.rootSelector.push(c)), typeof t.rules[c] == "undefined" && (t.rules[c] = []);
2939                                var d = {};
2940                                if (u.match(/\{\S+?\}/)) {
2941                                    l.find("*").each(e.proxy(function(t, n) {
2942                                        var r = this.getAttributeList(n);
2943                                        e.each(r, e.proxy(function(t, r) {
2944                                            var i = e(n).attr(r);
2945                                            r.substr(0, 1) == "_" && (r = r.substr(1));
2946                                            var s = i.match(/\{\S+?\}/g);
2947                                            if (s)
2948                                                for (var o = 0; o < s.length; o++) {
2949                                                    var u = s[o].substr(1, s[o].length - 2);
2950                                                    u = u.replace(this.getValidationRGX(u), "");
2951                                                    var a = this.relFilterByNode(n, c),
2952                                                        f = i != s[o] ? this.getRegexpReplace(i, s[o]) : !1;
2953                                                    d[u.toLowerCase()] = {
2954                                                        sel: a ? e.trim(a) : !1,
2955                                                        attr: r,
2956                                                        rgx: f
2957                                                    }
2958                                                }
2959                                        }, this));
2960                                        var i = [];
2961                                        e(n).is("iframe") || e(n).contents().filter(function() {
2962                                            return this.nodeType === 3
2963                                        }).each(e.proxy(function(t, r) {
2964                                            var s = r.textContent || r.data;
2965                                            if (typeof s == "undefined") return !0;
2966                                            var o = s.match(/\{\S+?\}/g);
2967                                            if (o)
2968                                                for (var u = 0; u < o.length; u++) {
2969                                                    var a = o[u].substr(1, o[u].length - 2);
2970                                                    a = a.replace(this.getValidationRGX(a), "");
2971                                                    var f = this.relFilterByNode(n, c),
2972                                                        l = s != o[u] ? this.getRegexpReplace(s, o[u]) : !1,
2973                                                        h = f ? e.trim(f) : !1;
2974                                                    if (e.inArray(h, i) > -1 || e(r).parent().contents().size() > 1) {
2975                                                        var p = e("<span>").html("{" + a + "}");
2976                                                        this.setUID(p, "wbb");
2977                                                        var v = s.indexOf(a) + a.length + 1,
2978                                                            m = s.substr(v, s.length - v);
2979                                                        r.data = s.substr(0, s.indexOf(a) - 1), e(r).after(this.elFromString(m, document)).after(p), h = (h ? h + " " : "") + this.filterByNode(p), l = !1
2980                                                    }
2981                                                    d[a.toLowerCase()] = {
2982                                                        sel: h,
2983                                                        attr: !1,
2984                                                        rgx: l
2985                                                    }, i[i.length] = h
2986                                                }
2987                                        }, this)), i = null
2988                                    }, this));
2989                                    var v = l.html();
2990                                    v = this.unwrapAttrs(v), a != v && (delete i.transform[a], i.transform[v] = f, u = v)
2991                                }
2992                                t.rules[c].push([f, d]), i.onlyClearText === !0 && (this.cleartext || (this.cleartext = {}), this.cleartext[c] = n[r]), i.groupkey && (t.groups[i.groupkey] || (t.groups[i.groupkey] = []), t.groups[i.groupkey].push(c))
2993                            }
2994                        }
2995                        i.rootSelector && this.sortArray(i.rootSelector, -1);
2996                        var m = e.map(i.transform, function(e, t) {
2997                            return t
2998                        }).sort(function(e, t) {
2999                            return (t[0] || "").length - (e[0] || "").length
3000                        });
3001                        i.bbcode = i.transform[m[0]], i.html = m[0]
3002                    }
3003                }
3004                this.options.btnlist = n, e.extend(t.rules, this.options.customRules), t.srules = {}, this.options.smileList && e.each(t.smileList, e.proxy(function(n, r) {
3005                    var i = e(this.strf(r.img, t)),
3006                        s = this.filterByNode(i);
3007                    t.srules[s] = [r.bbcode, r.img]
3008                }, this));
3009                for (var g in t.rules) this.options.rules[g].sort(function(e, t) {
3010                    return t[0].length - e[0].length
3011                });
3012                this.rsellist = [];
3013                for (var g in this.options.rules) this.rsellist.push(g);
3014                this.sortArray(this.rsellist, -1)
3015            },
3016            build: function() {
3017                e.log("Build editor"), this.$editor = e("<div>").addClass("wysibb"), this.options.direction && this.$editor.css("direction", this.options.direction), this.$editor.insertAfter(this.txtArea).append(this.txtArea), this.startHeight = this.$txtArea.outerHeight(), this.$txtArea.addClass("wysibb-texarea"), this.buildToolbar(), this.$txtArea.wrap('<div class="wysibb-text">');
3018                if (this.options.onlyBBmode === !1) {
3019                    var t = this.options.minheight || this.$txtArea.outerHeight(),
3020                        n = this.options.resize_maxheight,
3021  
3021                      r = this.options.autoresize === !0 ? this.options.resize_maxheight : t;
3022                    this.$body = e(this.strf('<div class="wysibb-text-editor" style="max-height:{maxheight}px;min-height:{height}px"></iframe>', {
3023                        maxheight: r,
3024                        height: t
3025                    })).insertAfter(this.$txtArea), this.body = this.$body[0], this.$txtArea.hide(), e.log("WysiBB loaded"), this.$body.addClass("wysibb-body").addClass(this.options.bodyClass), this.options.direction && this.$body.css("direction", this.options.direction);
3026                    if ("contentEditable" in this.body) {
3027                        this.body.contentEditable = !0;
3028                        try {
3029                            document.execCommand("StyleWithCSS", !1, !1), this.$body.append("<span></span>")
3030                        } catch (i) {}
3031                    } else this.options.onlyBBmode = this.options.bbmode = !0;
3032                    this.txtArea.value.length > 0 && this.txtAreaInitContent(), this.$body.bind("keydown", e.proxy(function(t) {
3033                        if (t.which == 86 && 
3034							(t.ctrlKey == 1 || t.metaKey == 1) || t.which == 45 && 
3035							(t.shiftKey == 1 || t.metaKey == 1)
3036						)
3037							return this.$pasteBlock || (
3038								this.saveRange(), 
3039								this.$pasteBlock = e(this.elFromString('<div style="opacity:0;" contenteditable="true"></div>')), 
3040								this.$pasteBlock.appendTo(this.body), 
3041								e.support.htmlSerialize || this.$pasteBlock.focus(), 
3042								setTimeout(e.proxy(function() {
3043									this.clearPaste(this.$pasteBlock);
3044									var e = "<span>" + this.$pasteBlock.html() + "</span>";
3045									this.$body.attr("contentEditable", "true"), this.$pasteBlock.blur().remove(), this.body.focus(), this.cleartext && this.isInClearTextBlock() && (e = this.toBB(e).replace(/\n/g, "<br/>").replace(/\s{3}/g, '<span class="wbbtab"></span>')), e = e.replace(/\t/g, '<span class="wbbtab"></span>'), this.selectRange(this.lastRange), this.insertAtCursor(e, !1), this.lastRange = !1, this.$pasteBlock = !1
3046								}, this), 1), 
3047								this.selectNode(this.$pasteBlock[0])
3048							), !0
3049                    }, this)), this.$body.bind("keydown", e.proxy(function(e) {
3050                        if (e.which == 13) {
3051                            var t = this.isContain(this.getSelectNode(), "li");
3052                            t || (e.preventDefault && e.preventDefault(), this.checkForLastBR(this.getSelectNode()), this.insertAtCursor("<br/>", !1))
3053                        }
3054                    }, this)), this.options.tabInsert === !0 && this.$body.bind("keydown", e.proxy(this.pressTab, this)), this.$body.bind("mouseup keyup", e.proxy(this.updateUI, this)), this.$body.bind("mousedown", e.proxy(function(e) {
3055                        this.clearLastRange(), this.checkForLastBR(e.target)
3056                    }, this)), this.options.traceTextarea === !0 && (e(document).bind("mousedown", e.proxy(this.traceTextareaEvent, this)), this.$txtArea.val("")), this.options.hotkeys === !0 && this.$body.bind("keydown", e.proxy(this.presskey, this)), this.options.smileConversion === !0 && this.$body.bind("keyup", e.proxy(this.smileConversion, this)), this.inited = !0, this.options.autoresize === !0 && (this.$bresize = e(this.elFromString('<div class="bottom-resize-line"></div>')).appendTo(this.$editor).wdrag({
3057                        scope: this,
3058                        axisY: !0,
3059                        height: t
3060                    }))
3061                }
3062                this.$txtArea.bind("mouseup keyup", e.proxy(function() {
3063                    clearTimeout(this.uitimer), this.uitimer = setTimeout(e.proxy(this.updateUI, this), 100)
3064                }, this)), this.options.hotkeys === !0 && e(document).bind("keydown", e.proxy(this.presskey, this))
3065            },
3066            buildToolbar: function() {
3067                if (this.options.toolbar === !1) return !1;
3068                this.$toolbar = e("<div>").addClass("wysibb-toolbar").prependTo(this.$editor);
3069                var t;
3070                e.each(this.options.buttons, e.proxy(function(n, r) {
3071                    var i = this.options.allButtons[r];
3072                    if (n == 0 || r == "|" || r == "-") r == "-" && this.$toolbar.append("<div>"), t = e('<div class="wysibb-toolbar-container">').appendTo(this.$toolbar);
3073                    i && (i.type == "colorpicker" ? this.buildColorpicker(t, r, i) : i.type == "table" ? this.buildTablepicker(t, r, i) : i.type == "select" ? this.buildSelect(t, r, i) : i.type == "smilebox" ? this.buildSmilebox(t, r, i) : this.buildButton(t, r, i))
3074                }, this)), this.$toolbar.find(".btn-tooltip").hover(function() {
3075                    e(this).parent().css("overflow", "hidden")
3076                }, function() {
3077                    e(this).parent().css("overflow", "visible")
3078                });
3079                var n = e(document.createElement("div")).addClass("wysibb-toolbar-container modeSwitch").html('<div class="wysibb-toolbar-btn mswitch" unselectable="on"><span class="btn-inner modesw" unselectable="on">[BBcode]</span></div>').appendTo(this.$toolbar);
3080                this.options.bbmode == 1 && n.children(".wysibb-toolbar-btn").addClass("on"), this.options.onlyBBmode === !1 && n.children(".wysibb-toolbar-btn").click(e.proxy(function(t, start) {
3081                    e(t.currentTarget).toggleClass("on"),
3082					this.modeSwitch(start)
3083                }, this)), e.support.htmlSerialize && this.$toolbar.find("*").attr("unselectable", "on")
3084            },
3085            buildButton: function(t, n, r) {
3086                typeof t != "object" && (t = this.$toolbar);
3087                var i = r.buttonHTML ? e(this.strf(r.buttonHTML, this.options)).addClass("btn-inner") : this.strf('<span class="btn-inner btn-text">{text}</span>', {
3088                        text: r.buttonText.replace(/</g, "&lt;")
3089                    }),
3090                    s = this.options.hotkeys === !0 && this.options.showHotkeys === !0 && r.hotkey ? ' <span class="tthotkey">[' + r.hotkey + "]</span>" : "",
3091                    o = e('<div class="wysibb-toolbar-btn wbb-' + n + '">').appendTo(t).append(i).append(this.strf('<span class="btn-tooltip">{title}<ins/>{hotkey}</span>', {
3092                        title: r.title,
3093                        hotkey: s
3094                    }));
3095                this.controllers.push(o), o.bind("queryState", e.proxy(function(t) {
3096                    this.queryState(n) ? e(t.currentTarget).addClass("on") : e(t.currentTarget).removeClass("on")
3097                }, this)), o.mousedown(e.proxy(function(t) {
3098                    t.preventDefault(), this.execCommand(n, r.exvalue || !1), e(t.currentTarget).trigger("queryState")
3099                }, this))
3100            },
3101            buildColorpicker: function(t, n, r) {
3102                var i = e('<div class="wysibb-toolbar-btn wbb-dropdown wbb-cp">').appendTo(t).append('<div class="ve-tlb-colorpick"><span class="fonticon"></span><span class="cp-line"></span></div><ins class="fonticon ar"></ins>').append(this.strf('<span class="btn-tooltip">{title}<ins/></span>', {
3103                        title: r.title
3104                    })),
3105                    s = i.find(".cp-line"),
3106                    o = e('<div class="wbb-list">').appendTo(i);
3107                o.append('<div class="nc">' + CURLANG.auto + "</div>");
3108                var u = r.colors ? r.colors.split(",") : [];
3109                for (var a = 0; a < u.length; a++) u[a] = e.trim(u[a]), u[a] == "-" ? o.append('<span class="pl"></span>') : o.append(this.strf('<div class="sc" style="background:{color}" title="{color}"></div>', {
3110                    color: u[a]
3111                }));
3112                var f = e(document.body).css("color");
3113                this.controllers.push(i), i.bind("queryState", e.proxy(function(e) {
3114                    s.css("background-color", f);
3115                    var t = this.queryState("fontcolor", !0);
3116                    t && (s.css("background-color", this.options.bbmode ? t.color : t), i.find(".ve-tlb-colorpick span.fonticon").css("color", this.options.bbmode ? t.color : t))
3117                }, this)), i.mousedown(e.proxy(function(e) {
3118                    e.preventDefault(), this.dropdownclick(".wbb-cp", ".wbb-list", e)
3119                }, this)), i.find(".sc").mousedown(e.proxy(function(t) {
3120                    t.preventDefault(), this.selectLastRange();
3121                    var n = e(t.currentTarget).attr("title");
3122                    this.execCommand("fontcolor", n), i.trigger("queryState")
3123                }, this)), i.find(".nc").mousedown(e.proxy(function(e) {
3124                    e.preventDefault(), this.selectLastRange(), this.execCommand("fontcolor", f), i.trigger("queryState")
3125                }, this)), i.mousedown(function(e) {
3126                    e.preventDefault && e.preventDefault()
3127                })
3128            },
3129            buildTablepicker: function(t, n, r) {
3130                var i = e('<div class="wysibb-toolbar-btn wbb-dropdown wbb-tbl">').appendTo(t).append('<span class="btn-inner fonticon ve-tlb-table1"></span><ins class="fonticon ar"></ins>').append(this.strf('<span class="btn-tooltip">{title}<ins/></span>', {
3131                        title: r.title
3132                    })),
3133                    s = e('<div class="wbb-list">').appendTo(i),
3134                    o = r.rows || 10,
3135                    u = r.cols || 10,
3136                    a = o * u;
3137                s.css("width", u * r.cellwidth + 2 + "px").css("height", o * r.cellwidth + 2 + "px");
3138                for (var f = 1; f <= u; f++)
3139                    for (var l = 1; l <= o; l++) {
3140                        var c = '<div class="tbl-sel" style="width:' + f * r.cellwidth + "px;height:" + l * r.cellwidth + "px;z-index:" + --a + '" title="' + l + "," + f + '"></div>';
3141                        s.append(c)
3142                    }
3143                i.find(".tbl-sel").mousedown(e.proxy(function(t) {
3144                    t.preventDefault();
3145                    var n = e(t.currentTarget).attr("title"),
3146                        r = n.split(","),
3147                        i = this.options.bbmode ? "[table]" : '<table class="wbb-table" cellspacing="5" cellpadding="0">';
3148                    for (var s = 1; s <= r[0]; s++) {
3149                        i += this.options.bbmode ? " [tr]\n" : "<tr>";
3150                        for (var o = 1; o <= r[1]; o++) i += this.options.bbmode ? "  [td][/td]\n" : "<td></td>";
3151                        i += this.options.bbmode ? "[/tr]\n" : "</tr>"
3152                    }
3153                    i += this.options.bbmode ? "[/table]" : "</table>", this.insertAtCursor(i)
3154                }, this)), i.mousedown(e.proxy(function(e) {
3155                    e.preventDefault(), this.dropdownclick(".wbb-tbl", ".wbb-list", e)
3156                }, this))
3157            },
3158            buildSelect: function(t, n, r) {
3159                var i = e('<div class="wysibb-toolbar-btn wbb-select wbb-' + n + '">').appendTo(t).append(this.strf('<span class="val">{title}</span><ins class="fonticon sar"></ins>', r)).append(this.strf('<span class="btn-tooltip">{title}<ins/></span>', {
3160                        title: r.title
3161                    })),
3162                    s = e('<div class="wbb-list">').appendTo(i),
3163                    o = i.find("span.val"),
3164                    u = e.isArray(r.options) ? r.options : r.options.split(",");
3165                for (var a = 0; a < u.length; a++) {
3166                    var f = u[a];
3167                    if (typeof f == "string") {
3168                        var l = this.options.allButtons[f];
3169                        l && (l.html ? e("<span>").addClass("option").attr("oid", f).attr("cmdvalue", l.exvalue).appendTo(s).append(this.strf(l.html, {
3170                            seltext: l.title
3171                        })) : s.append(this.strf('<span class="option" oid="' + f + '" cmdvalue="' + l.exvalue + '">{title}</span>', l)))
3172                    } else {
3173                        var c = {
3174                            seltext: f.title
3175                        };
3176                        c[r.valueBBname] = f.exvalue, e("<span>").addClass("option").attr("oid", n).attr("cmdvalue", f.exvalue).appendTo(s).append(this.strf(r.html, c))
3177                    }
3178                }
3179                this.controllers.push(i), i.bind("queryState", e.proxy(function(t) {
3180                    o.text(r.title), i.find(".option.selected").removeClass("selected"), i.find(".option").each(e.proxy(function(t, n) {
3181                        var r = e(n),
3182                            i = this.queryState(r.attr("oid"), !0),
3183                            s = r.attr("cmdvalue");
3184                        if (s && i == r.attr("cmdvalue") || !s && i) return o.text(r.text()), r.addClass("selected"), !1
3185                    }, this))
3186                }, this)), i.mousedown(e.proxy(function(e) {
3187                    e.preventDefault(), this.dropdownclick(".wbb-select", ".wbb-list", e)
3188                }, this)), i.find(".option").mousedown(e.proxy(function(t) {
3189                    t.preventDefault();
3190                    var n = e(t.currentTarget).attr("oid"),
3191                        r = e(t.currentTarget).attr("cmdvalue"),
3192                        i = this.options.allButtons[n];
3193                    this.execCommand(n, i.exvalue || r || !1), e(t.currentTarget).trigger("queryState")
3194                }, this))
3195            },
3196            buildSmilebox: function(t, n, r) {
3197                if (this.options.smileList && this.options.smileList.length > 0) {
3198                    var i = e(this.strf(r.buttonHTML, r)).addClass("btn-inner"),
3199                        s = e('<div class="wysibb-toolbar-btn wbb-smilebox wbb-' + n + '">').appendTo(t).append(i).append(this.strf('<span class="btn-tooltip">{title}<ins/></span>', {
3200                            title: r.title
3201                        })),
3202                        o = e('<div class="wbb-list">').appendTo(s);
3203                    e.isArray(this.options.smileList) && e.each(this.options.smileList, e.proxy(function(t, n) {
3204                        e("<span>").addClass("smile").appendTo(o).append(e(this.strf(n.img, this.options)).attr("title", n.title))
3205                    }, this)), s.mousedown(e.proxy(function(e) {
3206                        e.preventDefault(), this.dropdownclick(".wbb-smilebox", ".wbb-list", e)
3207                    }
3207, this)), s.find(".smile").mousedown(e.proxy(function(t) {
3208                        t.preventDefault(), this.insertAtCursor(this.options.bbmode ? this.toBB(e(t.currentTarget).html()) : e(e(t.currentTarget).html()))
3209                    }, this))
3210                }
3211            },
3212            updateUI: function(t) {
3213                (!t || t.which >= 8 && t.which <= 46 || t.which > 90 || t.type == "mouseup") && e.each(this.controllers, e.proxy(function(e, t) {
3214                    t.trigger("queryState")
3215                }, this)), this.disNonActiveButtons()
3216            },
3217            initModal: function() {
3218                this.$modal = e("#wbbmodal"), this.$modal.size() == 0 && (e.log("Init modal"), this.$modal = e("<div>").attr("id", "wbbmodal").prependTo(document.body).html('<div class="wbbm"><div class="wbbm-title"><span class="wbbm-title-text"></span><span class="wbbclose" title="' + CURLANG.close + '">×</span></div><div class="wbbm-content"></div><div class="wbbm-bottom"><button id="wbbm-submit" class="wbb-button">' + CURLANG.save + '</button><button id="wbbm-cancel" class="wbb-cancel-button">' + CURLANG.cancel + '</button><button id="wbbm-remove" class="wbb-remove-button">' + CURLANG.remove + "</button></div></div>").hide(), this.$modal.find("#wbbm-cancel,.wbbclose").click(e.proxy(this.closeModal, this)), this.$modal.bind("click", e.proxy(function(t) {
3219                    e(t.target).parents(".wbbm").size() == 0 && this.closeModal()
3220                }, this)), e(document).bind("keydown", e.proxy(this.escModal, this)))
3221            },
3222            initHotkeys: function() {
3223                e.log("initHotkeys"), this.hotkeys = [];
3224                var t = "0123456789       abcdefghijklmnopqrstuvwxyz";
3225                e.each(this.options.allButtons, e.proxy(function(n, r) {
3226                    if (r.hotkey) {
3227                        var i = r.hotkey.split("+");
3228                        if (i && i.length >= 2) {
3229                            var s = 0,
3230                                o = i.pop();
3231                            e.each(i, function(t, n) {
3232                                switch (e.trim(n.toLowerCase())) {
3233                                    case "ctrl":
3234                                        s += 1;
3235                                        break;
3236                                    case "shift":
3237                                        s += 4;
3238                                        break;
3239                                    case "alt":
3240                                        s += 7
3241                                }
3242                            }), s > 0 && (this.hotkeys["m" + s] || (this.hotkeys["m" + s] = []), this.hotkeys["m" + s]["k" + (t.indexOf(o) + 48)] = n)
3243                        }
3244                    }
3245                }, this))
3246            },
3247            presskey: function(e) {
3248                if (e.ctrlKey == 1 || e.shiftKey == 1 || e.altKey == 1) {
3249                    var t = (e.ctrlKey == 1 ? 1 : 0) + (e.shiftKey == 1 ? 4 : 0) + (e.altKey == 1 ? 7 : 0);
3250                    if (this.hotkeys["m" + t] && this.hotkeys["m" + t]["k" + e.which]) return this.execCommand(this.hotkeys["m" + t]["k" + e.which], !1), e.preventDefault(), !1
3251                }
3252            },
3253            execCommand: function(t, n) {
3254                e.log("execCommand: " + t);
3255                var r = this.options.allButtons[t];
3256                if (r.en !== !0) return !1;
3257                var i = this.queryState(t, n),
3258                    s = this.isInClearTextBlock();
3259                if (s && s != t) return;
3260                if (r.excmd)
3261                    if (this.options.bbmode) {
3262                        e.log("Native command in bbmode: " + t);
3263                        if (i && r.subInsert != 1) this.wbbRemoveCallback(t, n);
3264                        else {
3265                            var o = {};
3266                            r.valueBBname && n && (o[r.valueBBname] = n), this.insertAtCursor(this.getBBCodeByCommand(t, o))
3267                        }
3268                    } else this.execNativeCommand(r.excmd, n || !1);
3269                else r.cmd ? r.cmd.call(this, t, n, i) : this.wbbExecCommand.call(this, t, n, i);
3270                this.updateUI()
3271            },
3272            queryState: function(t, n) {
3273                var r = this.options.allButtons[t];
3274                if (r.en !== !0) return !1;
3275                if (this.options.bbmode) {
3276                    if (r.bbSelector)
3277                        for (var i = 0; i < r.bbSelector.length; i++) {
3278                            var s = this.isBBContain(r.bbSelector[i]);
3279                            if (s) return this.getParams(s, r.bbSelector[i], s[1])
3280                        }
3281                    return !1
3282                }
3283                if (!r.excmd) {
3284                    if (e.isArray(r.rootSelector))
3285                        for (var i = 0; i < r.rootSelector.length; i++) {
3286                            var a = this.isContain(this.getSelectNode(), r.rootSelector[i]);
3287                            if (a) return this.getParams(a, r.rootSelector[i])
3288                        }
3289                    return !1
3290                }
3291                if (n) try {
3292                    var o = (document.queryCommandValue(r.excmd) + "").replace(/\'/g, "");
3293                    return r.excmd == "foreColor" && (o = this.rgbToHex(o)), o
3294                } catch (u) {
3295                    return !1
3296                } else try {
3297                    return document.queryCommandState(r.excmd)
3298                } catch (u) {
3299                    return !1
3300                }
3301            },
3302            wbbExecCommand: function(t, n, r) {
3303                e.log("wbbExecCommand");
3304                var i = this.options.allButtons[t];
3305                if (i)
3306                    if (i.modal) e.isFunction(i.modal) ? i.modal.call(this, t, i.modal, r) : this.showModal.call(this, t, i.modal, r);
3307                    else if (r && i.subInsert != 1) this.wbbRemoveCallback(t);
3308                else {
3309                    if (i.groupkey) {
3310                        var s = this.options.groups[i.groupkey];
3311                        if (s) {
3312                            var o = this.getSelectNode();
3313                            e.each(s, e.proxy(function(t, n) {
3314                                var r = this.isContain(o, n);
3315                                if (r) {
3316                                    var i = e("<span>").html(r.innerHTML),
3317                                        s = this.setUID(i);
3318                                    return e(r).replaceWith(i), this.selectNode(this.$editor.find("#" + s)[0]), !1
3319                                }
3320                            }, this))
3321                        }
3322                    }
3323                    this.wbbInsertCallback(t, n)
3324                }
3325            },
3326            wbbInsertCallback: function(t, n) {
3327                typeof n != "object" && (n = {}), e.log("wbbInsertCallback: " + t);
3328                var r = this.getCodeByCommand(t, n);
3329                this.insertAtCursor(r);
3330                if (this.seltextID && r.indexOf(this.seltextID) != -1) {
3331                    var i = this.$body.find("#" + this.seltextID)[0];
3332                    this.selectNode(i), e(i).removeAttr("id"), this.seltextID = !1
3333                }
3334            },
3335            wbbRemoveCallback: function(t, n) {
3336                e.log("wbbRemoveCallback: " + t);
3337                var r = this.options.allButtons[t];
3338                if (this.options.bbmode) {
3339                    var i = this.getCursorPosBB(),
3340                        s = 0;
3341                    e.each(r.bbSelector, e.proxy(function(t, r) {
3342                        var i = r.match(/\{[\s\S]+?\}/g);
3343                        e.each(i, function(e, t) {
3344                            if (t.toLowerCase() == "{seltext}") return s = e, !1
3345                        });
3346                        var o = this.isBBContain(r);
3347                        if (o) return this.txtArea.value = this.txtArea.value.substr(0, o[1]) + this.txtArea.value.substr(o[1], this.txtArea.value.length - o[1]).replace(o[0][0], n === !0 ? "" : o[0][s + 1]), this.setCursorPosBB(o[1]), !1
3348                    }, this))
3349                } else {
3350                    var o = this.getSelectNode();
3351                    e.each(r.rootSelector, e.proxy(function(i, s) {
3352                        var u = this.isContain(o, s);
3353                        if (!u) return !0;
3354                        var a = e(u),
3355                            f = this.options.rules[s][0][1];
3356                        if (a.is("span[wbb]") || !a.is("span,font")) {
3357                            if (n === !0) a.remove();
3358                            else if (f && f.seltext && f.seltext.sel) {
3359                                var l = a.find(f.seltext.sel).html();
3360                                r.onlyClearText === !0 && (l = this.getHTML(l, !0, !0), l = l.replace(/\&#123;/g, "{").replace(/\&#125;/g, "}")), a.replaceWith(l)
3361                            } else {
3362                                var l = a.html();
3363                                r.onlyClearText === !0 && (l = this.getHTML(l, !0), l = l.replace(/\&lt;/g, "<").replace(/\&#123;/g, "{").replace(/\&#125;/g, "}")), a.replaceWith(l)
3364                            }
3365                            return !1
3366                        }
3367                        var c = this.getRange(),
3368                            h = this.getSelectText(),
3369                            p = this.getSelectNode();
3370                        e.log("selHTML: " + h), h == "" ? h = "" : h = this.clearFromSubInsert(h, t);
3371                        var d = this.elFromString(h),
3372                            v = window.getSelection ? c.cloneRange() : this.body.createTextRange(),
3373                            m = window.getSelection ? c.cloneRange() : this.body.createTextRange();
3374                        if (window.getSelection) {
3375                            this.insertAtCursor('<span id="wbbdivide"></span>');
3376                            var g = a.find("span#wbbdivide").get(0);
3377                            v.setStart(u.firstChild, 0), v.setEndBefore(g), m.setStartAfter(g), m.setEndAfter(u.lastChild)
3378                        } else v.moveToElementText(u), m.moveToElementText(u), v.setEndPoint("EndToStart", c), m.setEndPoint("StartToEnd", c);
3379                        var y = this.getSelectText(!1, v),
3380                            b = this.getSelectText(!1, m);
3381                        if (b != "") {
3382                            var w = a.clone().html(b);
3383                            a.after(w)
3384                        }
3385                        return n !== !0 && a.after(d), window.getSelection ? (a.html(y), n !== !0 && this.selectNode(d)) : a.replaceWith(y), !1
3386                    }, this))
3387                }
3388            },
3389            execNativeCommand: function(t, n) {
3390                this.body.focus();
3391                if (t == "insertHTML" && !window.getSelection) {
3392                    var r = this.lastRange ? this.lastRange : document.selection.createRange();
3393                    r.pasteHTML(n);
3394                    var i = e("<div>").html(n).text(),
3395                        s = i.indexOf("");
3396                    s > -1 && (r.moveStart("character", -1 * (i.length - s)), r.select()), this.lastRange = !1
3397                } else if (t == "insertHTML") {
3398                    var o = this.getSelection(),
3399                        u = this.elFromString(n),
3400                        a = this.lastRange ? this.lastRange : this.getRange();
3401                    a.deleteContents(), a.insertNode(u), a.collapse(!1), o.removeAllRanges(), o.addRange(a)
3402                } else typeof n == "undefined" && (n = !1), this.lastRange && (e.log("Last range select"), this.selectLastRange()), document.execCommand(t, !1, n)
3403            },
3404            getCodeByCommand: function(e, t) {
3405                return this.options.bbmode ? this.getBBCodeByCommand(e, t) : this.getHTMLByCommand(e, t)
3406            },
3407            getBBCodeByCommand: function(t, n) {
3408                if (!this.options.allButtons[t]) return "";
3409                typeof n == "undefined" && (n = {}), n = this.keysToLower(n), n.seltext || (n.seltext = this.getSelectText(!0));
3410                var r = this.options.allButtons[t].bbcode;
3411                r = r.replace(/\{(.*?)(\[.*?\])*\}/g, function(e, t, r) {
3412                    if (r) {
3413                        var i;
3414                        r && (i = new RegExp(r + "+", "i"));
3415                        if (typeof n[t.toLowerCase()] != "undefined" && n[t.toLowerCase()].toString().match(i) === null) return ""
3416                    }
3417                    return typeof n[t.toLowerCase()] == "undefined" ? "" : n[t.toLowerCase()]
3418                });
3419                var i = null,
3420                    s = 0;
3421                if (this.options.allButtons[t].transform) {
3422                    var o = [];
3423                    e.each(this.options.allButtons[t].transform, function(e, t) {
3424                        o.push(t)
3425                    }), o = this.sortArray(o, -1), e.each(o, function(e, t) {
3426                        var r = !0,
3427                            o = 0,
3428                            u = {};
3429                        t = t.replace(/\{(.*?)(\[.*?\])*\}/g, function(e, t, i) {
3430                            var s;
3431                            t = t.toLowerCase(), i && (s = new RegExp(i + "+", "i"));
3432                            if (typeof n[t.toLowerCase()] == "undefined" || i && n[t.toLowerCase()].toString().match(s) === null) r = !1;
3433                            return typeof n[t] != "undefined" && !u[t] && (u[t] = 1, o++), typeof n[t.toLowerCase()] == "undefined" ? "" : n[t.toLowerCase()]
3434                        }), r && o > s && (i = t, s = o)
3435                    })
3436                }
3437                return i || r
3438            },
3439            getHTMLByCommand: function(t, n) {
3440                if (!this.options.allButtons[t]) return "";
3441                n = this.keysToLower(n), typeof n == "undefined" && (n = {}), n.seltext || (n.seltext = this.getSelectText(!1), n["seltext"] == "" ? n.seltext = "" : (n.seltext = this.clearFromSubInsert(n.seltext, t), this.options.allButtons[t].onlyClearText === !0 && (n.seltext = this.toBB(n.seltext).replace(/\</g, "&lt;").replace(/\n/g, "<br/>").replace(/\s{3}/g, '<span class="wbbtab"></span>'))));
3442                var r = "";
3443                this.seltextID = "wbbid_" + ++this.lastid, t != "link" && t != "img" ? n.seltext = '<span id="' + this.seltextID + '">' + n.seltext + "</span>" : r = '<span id="' + this.seltextID + '"></span>';
3444                var i = this.options.allButtons[t].html;
3445                i = i.replace(/\{(.*?)(\[.*?\])*\}/g, function(e, t, r) {
3446                    if (r) {
3447                        var i = new RegExp(r + "+", "i");
3448                        if (typeof n[t.toLowerCase()] != "undefined" && n[t.toLowerCase()].toString().match(i) === null) return ""
3449                    }
3450                    return typeof n[t.toLowerCase()] == "undefined" ? "" : n[t.toLowerCase()]
3451                });
3452                var s = null,
3453                    o = 0;
3454                if (this.options.allButtons[t].transform) {
3455                    var u = [];
3456                    e.each(this.options.allButtons[t].transform, function(e, t) {
3457                        u.push(e)
3458                    }), u = this.sortArray(u, -1), e.each(u, function(e, t) {
3459                        var r = !0,
3460                            i = 0,
3461                            u = {};
3462                        t = t.replace(/\{(.*?)(\[.*?\])*\}/g, function(e, t, s) {
3463                            var o;
3464                            t = t.toLowerCase(), s && (o = new RegExp(s + "+", "i"));
3465                            if (typeof n[t] == "undefined" || s && n[t].toString().match(o) === null) r = !1;
3466                            return typeof n[t] != "undefined" && !u[t] && (u[t] = 1, i++), typeof n[t] == "undefined" ? "" : n[t]
3467                        }), r && i > o && (s = t, o = i)
3468                    })
3469                }
3470                return (s || i) + r
3471            },
3472            getSelection: function() {
3473                if (window.getSelection) return window.getSelection();
3474                if (document.selection) return this.options.bbmode ? document.selection.createRange() : document.selection.createRange()
3475            },
3476            getSelectText: function(t, n) {
3477                if (t) {
3478                    this.txtArea.focus();
3479                    if ("selectionStart" in this.txtArea) {
3480                        var r = this.txtArea.selectionEnd - this.txtArea.selectionStart;
3481                        return this.txtArea.value.substr(this.txtArea.selectionStart, r)
3482                    }
3483                    var i = document.selection.createRange();
3484                    return i.text
3485                }
3486                return this.body.focus(), n || (n = this.getRange()), window.getSelection ? n ? e("<div>").append(n.cloneContents()).html() : "" : n.htmlText
3487            },
3488            getRange: function() {
3489                if (!window.getSelection) return this.options.bbmode === !0 ? document.selection.createRange() : document.selection.createRange();
3490                var e = this.getSelection();
3491                if (e.getRangeAt && e.rangeCount > 0) return e.getRangeAt(0);
3492                if (e.anchorNode) {
3493                    var t = this.options.bbmode ? document.createRange() : document.createRange();
3494                    return t.setStart(e.anchorNode, e.anchorOffset), t.setEnd(e.focusNode, e.focusOffset), t
3495                }
3496            },
3497            insertAtCursor: function(t, n) {
3498                typeof t != "string" && (t = e("<div>").append(t).html());
3499                if (this.options.bbmode && typeof n == "undefined" || n === !0) {
3500                    var r = t.replace(/.*(\[\/\S+?\])$/, "$1"),
3501                        i = this.getCursorPosBB() + (t.indexOf(r) != -1 && t.match(/\[.*\]/) ? t.indexOf(r) : t.length);
3502                    if (document.selection) this.txtArea.focus(), this.getSelection().text = t;
3503                    else if (this.txtArea.selectionStart || this.txtArea.selectionStart == "0") this.txtArea.value = this.txtArea.value.substring(0, this.txtArea.selectionStart) + t + this.txtArea.value.substring(this.txtArea.selectionEnd, this.txtArea.value.length);
3504                    i < 0 && (i = 0), this.setCursorPosBB(i)
3505                } else {
3506                    this.execNativeCommand("insertHTML", t);
3507                    var s = this.getSelectNode();
3508                    e(s).closest("table,tr,td") || this.splitPrevNext(s)
3509                }
3510            },
3511            getSelectNode: function(e) {
3512                return this.body.focus(), e || (e = this.getRange()), e ? window.getSelection ? e.commonAncestorContainer : e.parentElement() : this.$body
3513            },
3514            getCursorPosBB: function() {
3515                var e = 0;
3516                if ("selectionStart" in this.txtArea) e = this.txtArea.selectionStart;
3517                else {
3518                    this.txtArea.focus();
3519                    var t = this.getRange(),
3520                        n = document.body.createTextRange();
3521                    n.moveToElementText(this.txtArea), n.setEndPoint("EndToStart", t), e = n.text.length
3522                }
3523                return e
3524            },
3525            setCursorPosBB: function(e) {
3526                if (this.options.bbmode)
3527                    if (window.getSelection) this.txtArea.selectionStart = e, this.txtArea.selectionEnd = e;
3528                    else {
3529                        var t = this.txtArea.createTextRange();
3530                        t.collapse(!0), t.move("character", e), t.select()
3531                    }
3532            },
3533            selectNode: function(e, t) {
3534                t || (t = this.getRange());
3535                if (!t) return;
3536                if (window.getSelection) {
3537                    var n = this.getSelection();
3538                    t.selectNodeContents(e), n.removeAllRanges(), n.addRange(t)
3539                } else t.moveToElementText(e), t.select()
3540            },
3541            selectRange: function(e) {
3542                if (e)
3543                    if (!window.getSelection) e.select();
3544                    else {
3545                        var t = this.getSelection();
3546                        t.removeAllRanges(), t.addRange(e)
3547                    }
3548            },
3549            cloneRange: function(e) {
3550                if (e) return window.getSelection ? e.cloneRange() : e.duplicate()
3551            },
3552            getRangeClone: function() {
3553                return this.cloneRange(this.getRange())
3554            },
3555            saveRange: function() {
3556                this.setBodyFocus(), this.lastRange = this.getRangeClone()
3557            },
3558            selectLastRange: function() {
3559                this.lastRange && (this.body.focus(), this.selectRange(this.lastRange), this.lastRange = !1)
3560            },
3561            setBodyFocus: function() {
3562                return;
3563                e.log("Set focus to WysiBB editor"), this.options.bbmode ? this.$txtArea.is(":focus") || this.$txtArea.focus() : this.$body.is(":focus") || this.$body.focus()
3564            },
3565            clearLastRange: function() {
3566                this.lastRange = !1
3567            },
3568            filterByNode: function(t) {
3569                var n = e(t),
3570                    r = n.get(0).tagName.toLowerCase(),
3571                    i = r,
3572                    s = this.getAttributeList(n.get(0));
3573                e.each(s, e.proxy(function(t, r) {
3574                    var s = n.attr(r);
3575                    r.substr(0, 1) == "_" && (r = r.substr(1, r.length));
3576                    if (s && !s.match(/\{.*?\}/))
3577                        if (r == "style") {
3578                            var s = n.attr(r),
3579                                o = s.split(";");
3580                            e.each(o, function(t, n) {
3581                                n && n.length > 0 && (i += "[" + r + '*="' + e.trim(n) + '"]')
3582                            })
3583                        } else i += "[" + r + '="' + s + '"]';
3584                    else if (s && r == "style") {
3585                        var u = s.substr(0, s.indexOf("{"));
3586                        if (u && u != "") {
3587                            var s = s.substr(0, s.indexOf("{")),
3588                                o = s.split(";");
3589                            e.each(o, function(e, t) {
3590                                i += "[" + r + '*="' + t + '"]'
3591                            })
3592                        }
3593                    } else i += "[" + r + "]"
3594                }, this));
3595                var o = n.parent().children(i).index(n);
3596                return o > 0 && (i += ":eq(" + n.index() + ")"), i
3597            },
3598            relFilterByNode: function(t, n) {
3599                var r = "";
3600                e.each(this.options.attrWrap, function(e, t) {
3601                    n = n.replace("[" + t, "[_" + t)
3602                });
3603                while (t && t.tagName != "BODY" && !e(t).is(n)) r = this.filterByNode(t) + " " + r, t && (t = t.parentNode);
3604                return r
3605            },
3606            getRegexpReplace: function(e, t) {
3607                return e = e.replace(/(\(|\)|\[|\]|\.|\*|\?|\:|\\)/g, "\\$1").replace(/\s+/g, "\\s+").replace(t.replace(/(\(|\)|\[|\]|\.|\*|\?|\:|\\)/g, "\\$1"), "(.+)").replace(/\{\S+?\}/g, ".*"), e
3608            },
3609            getBBCode: function() {
3610                return this.options.rules ? this.options.bbmode ? this.$txtArea.val() : (this.clearEmpty(), this.removeLastBodyBR(), this.toBB(this.$body.html())) : this.$txtArea.val()
3611            },
3612            toBB: function(t) {
3613                if (!t) return "";
3614                var n = typeof t == "string" ? e("<span>").html(t) : e(t);
3615                n.find("div,blockquote,p").each(function() {
3616                    this.nodeType != 3 && this.lastChild && this.lastChild.tagName == "BR" && e(this.lastChild).remove()
3617                }), n.is("div,blockquote,p") && n[0].nodeType != 3 && n[0].lastChild && n[0].lastChild.tagName == "BR" && e(n[0].lastChild).remove(), n.find("ul > br, table > br, tr > br").remove();
3618                var r = "";
3619                return e.each(this.options.srules, e.proxy(function(e, t) {
3620                    n.find(e).replaceWith(t[0])
3621                }, this)), n.contents().each(e.proxy(function(t, n) {
3622                    var i = e(n);
3623                    if (n.nodeType === 3) r += n.data.replace(/\n+/, "").replace(/\t/g, "   ");
3624                    else {
3625                        var s, o = !1;
3626                        for (var u = 0; u < this.rsellist.length; u++) {
3627                            var a = this.rsellist[u];
3628                            if (i && i.is(a)) {
3629                                var f = this.options.rules[a];
3630                                for (var t = 0; t < f.length; t++) {
3631                                    var l = f[t][0],
3632                                        c = f[t][1],
3633                                        h = !1,
3634                                        p = !1,
3635                                        d = !1;
3636                                    i.is("br") || (l = l.replace(/\n/g, "<br>")), l = l.replace(/\{(.*?)(\[.*?\])*\}/g, e.proxy(function(t, r, s) {
3637                                        var o = c[r.toLowerCase()];
3638                                        typeof o == "undefined" && (e.log("Param: {" + r + "} not found in HTML representation."), h = !0);
3639                                        var u = o.sel ? e(n).find(o.sel) : e(n);
3640                                        if (o.attr && !u.attr(o.attr)) return h = !0, r;
3641                                        var a = o.attr ? u.attr(o.attr) : u.html();
3642                                        if (typeof a == "undefined" || a == null) return h = !0, r;
3643                                        var f = o.rgx;
3644                                        f && o.attr == "style" && f.substr(f.length - 1, 1) != ";" && (f += ";"), o.attr == "style" && a && a.substr(a.length - 1, 1) != ";" && (a += ";");
3645                                        var l = f ? new RegExp(f, "") : !1;
3646                                        if (l)
3647                                            if (a.match(l)) {
3648                                                var v = a.match(l);
3649                                                v && v.length == 2 && (a = v[1])
3650                                            } else a = "";
3651                                        if (o.attr && h === !1)
3652                                            if (o.attr == "style") {
3653                                                p = !0;
3654                                                var m = "",
3655                                                    g = o.rgx.replace(/^\.\*\?/, "").replace(/\.\*$/, "").replace(/;$/, "");
3656                                                e(u.attr("style").split(";")).each(function(e, t) {
3657                                                    t && t != "" && (t.match(g) || (m += t + ";"))
3658                                                }), m == "" ? u.removeAttr("style") : u.attr("style", m)
3659                                            } else o.rgx === !1 && (p = !0, d = !0, u.removeAttr(o.attr));
3660                                        return i.is("table,tr,td,font") && (p = !0), a || ""
3661                                    }, this));
3662                                    if (h) continue;
3663                                    if (i.is("img,br,hr")) {
3664                                        r += l, i = null;
3665                                        break
3666                                    }
3667                                    if (!p || !!i.attr("notkeep")) {
3668                                        i.is("iframe") ? r += l : (i.empty().html(l), r += this.toBB(i), i = null);
3669                                        break
3670                                    }
3671                                    i.is("table,tr,td") ? (l = this.fixTableTransform(l), r += this.toBB(e("<span>
3671").html(l)), i = null) : e.support.htmlSerialize ? i.empty().append(e("<span>").html(l)) : i.empty().html("<span>" + l + "</span>")
3672                                }
3673                            }
3674                        }
3675                        if (!i || i.is("iframe,img")) return !0;
3676                        r += this.toBB(i)
3677                    }
3678                }, this)), r
3679            },
3680            getHTML: function(t, n, r) {
3681                if (!this.options.bbmode && !n) return this.$body.html();
3682                r || (t = t.replace(/</g, "&lt;").replace(/\{/g, "&#123;").replace(/\}/g, "&#125;")), t = t.replace(/\[code\]([\s\S]*?)\[\/code\]/g, function(e) {
3683                    return e = e.substr("[code]".length, e.length - "[code]".length - "[/code]".length).replace(/\[/g, "&#91;").replace(/\]/g, "&#93;"), "[code]" + e + "[/code]"
3684                }), e.each(this.options.btnlist, e.proxy(function(n, r) {
3685                    if (r != "|" && r != "-") {
3686                        var i = !0;
3687                        if (!this.options.allButtons[r] || !this.options.allButtons[r].transform) return !0;
3688                        e.each(this.options.allButtons[r].transform, e.proxy(function(n, r) {
3689                            n = n.replace(/\n/g, "");
3690                            var i = [];
3691                            r = r.replace(/(\(|\)|\[|\]|\.|\*|\?|\:|\\|\\)/g, "\\$1"), r = r.replace(/\{(.*?)(\\\[.*?\\\])*\}/gi, e.proxy(function(e, t, n) {
3692                                return i.push(t), n ? (n = n.replace(/\\/g, ""), "(" + n + "*?)") : "([\\s\\S]*?)"
3693                            }, this));
3694                            var s = 0,
3695                                o;
3696                            while ((o = (new RegExp(r, "mgi")).exec(t)) != null)
3697                                if (o) {
3698                                    var u = {};
3699                                    e.each(i, e.proxy(function(e, t) {
3700                                        u[t] = o[e + 1]
3701                                    }, this));
3702                                    var a = n;
3703                                    a = a.replace(/\{(.*?)(\[.*?\])\}/g, "{$1}"), a = this.strf(a, u), t = t.replace(o[0], a)
3704                                }
3705                        }, this))
3706                    }
3707                }, this)), e.each(this.options.systr, function(e, n) {
3708                    n = n.replace(/(\(|\)|\[|\]|\.|\*|\?|\:|\\|\\)/g, "\\$1").replace(" ", "\\s"), t = t.replace(new RegExp(n, "g"), e)
3709                });
3710                var i = e(this.elFromString("<div>" + t + "</div>"));
3711                return this.getHTMLSmiles(i), i.html()
3712            },
3713            getHTMLSmiles: function(t) {
3714                e(t).contents().filter(function() {
3715                    return this.nodeType == 3
3716                }).each(e.proxy(this.smileRPL, this))
3717            },
3718            smileRPL: function(t, n) {
3719                var r = n.data;
3720                e.each(this.options.smileList, e.proxy(function(t, i) {
3721                    var s = r.indexOf(i.bbcode);
3722                    if (s != -1) {
3723                        var o = r.substring(s + i.bbcode.length, r.length),
3724                            u = document.createTextNode(o);
3725                        return n.data = r = n.data.substr(0, s), e(n).after(u).after(this.strf(i.img, this.options)), this.getHTMLSmiles(n.parentNode), !1
3726                    }
3727                    this.getHTMLSmiles(n)
3728                }, this))
3729            },
3730            setUID: function(t, n) {
3731                var r = "wbbid_" + ++this.lastid;
3732                return t && e(t).attr(n || "id", r), r
3733            },
3734            keysToLower: function(t) {
3735                return e.each(t, function(e, n) {
3736                    e != e.toLowerCase() && (delete t[e], t[e.toLowerCase()] = n)
3737                }), t
3738            },
3739            strf: function(t, n) {
3740                return n = this.keysToLower(e.extend({}, n)), t.replace(/\{([\w\.]*)\}/g, function(t, r) {
3741                    r = r.toLowerCase();
3742                    var i = r.split("."),
3743                        s = n[i.shift().toLowerCase()];
3744                    return e.each(i, function() {
3745                        s = s[this]
3746                    }), s === null || s === undefined ? "" : s
3747                })
3748            },
3749            elFromString: function(t) {
3750                if (t.indexOf("<") != -1 && t.indexOf(">") != -1) {
3751                    var n = document.createElement("SPAN");
3752                    return e(n).html(t), this.setUID(n, "wbb"), e(n).contents().size() > 1 ? n : n.firstChild
3753                }
3754                return document.createTextNode(t)
3755            },
3756            isContain: function(t, n) {
3757                while (t && !e(t).hasClass("wysibb")) {
3758                    if (e(t).is(n)) return t;
3759                    if (!t) return null;
3760                    t = t.parentNode
3761                }
3762            },
3763            isBBContain: function(e) {
3764                var t = this.getCursorPosBB(),
3765                    n = this.prepareRGX(e),
3766                    r = new RegExp(n, "g"),
3767                    i, s = 0;
3768                while ((i = r.exec(this.txtArea.value)) != null) {
3769                    var o = this.txtArea.value.indexOf(i[0], s);
3770                    if (t > o && t < o + i[0].length) return [i, o];
3771                    s = o + 1
3772                }
3773            },
3774            prepareRGX: function(e) {
3775                return e.replace(/(\[|\]|\)|\(|\.|\*|\?|\:|\||\\)/g, "\\$1").replace(/\{.*?\}/g, "([\\s\\S]*?)")
3776            },
3777            checkForLastBR: function(t) {
3778                t || (n = this.body), t.nodeType == 3 && (t = t.parentNode);
3779                var n = e(t);
3780                n.is("span[id*='wbbid']") && (n = n.parent());
3781                if (this.options.bbmode === !1 && n.is("div,blockquote,code") && n.contents().size() > 0) {
3782                    var r = n[0].lastChild;
3783                    (!r || r && r.tagName != "BR") && n.append("<br/>")
3784                }
3785                this.$body.contents().size() > 0 && this.body.lastChild.tagName != "BR" && this.$body.append("<br/>")
3786            },
3787            getAttributeList: function(t) {
3788                var n = [];
3789                return e.each(t.attributes, function(e, t) {
3790                    t.specified && n.push(t.name)
3791                }), n
3792            },
3793            clearFromSubInsert: function(t, n) {
3794                if (this.options.allButtons[n] && this.options.allButtons[n].rootSelector) {
3795                    var r = e("<div>").html(t);
3796                    return e.each(this.options.allButtons[n].rootSelector, e.proxy(function(t, n) {
3797                        var i = !1;
3798                        typeof this.options.rules[n][0][1]["seltext"] != "undefined" && (i = this.options.rules[n][0][1].seltext.sel);
3799                        var s = !0;
3800                        return r.find("*").each(function() {
3801                            e(this).is(n) && (i && i.sel ? e(this).replaceWith(e(this).find(i.sel.toLowerCase()).html()) : e(this).replaceWith(e(this).html()), s = !1)
3802                        }), s
3803                    }, this)), r.html()
3804                }
3805                return t
3806            },
3807            splitPrevNext: function(t) {
3808                t.nodeType == 3 && (t = t.parentNode);
3809                var n = this.filterByNode(t).replace(/\:eq.*$/g, "");
3810                e(t.nextSibling).is(n) && (e(t).append(e(t.nextSibling).html()), e(t.nextSibling).remove()), e(t.previousSibling).is(n) && (e(t).prepend(e(t.previousSibling).html()), e(t.previousSibling).remove())
3811            },
3812            modeSwitch: function(start) {
3813				start = start || false;
3814                this.options.bbmode ? 
3815					(
3816						this.$body.html(this.getHTML(this.$txtArea.val())), 
3817						this.$txtArea.hide().removeAttr("wbbsync").val(""), 
3818						this.$body.css("min-height", this.$txtArea.height()).show(),
3819						(start ? true : this.$body.focus())
3820					) : (
3821						this.$txtArea.val(this.getBBCode()).css("min-height", this.$body.height()), 
3822						this.$body.hide(), 
3823						this.$txtArea.show(),
3824						(start ? true :this.$txtArea.focus())
3825					), 
3826					this.options.bbmode = !this.options.bbmode
3827            },
3828            clearEmpty: function() {
3829                function t() {
3830                    if (!e(this).is("span,font,a,b,i,u,s")) return !1;
3831                    if (!e(this).hasClass("wbbtab") && e.trim(e(this).html()).length == 0) return !0;
3832                    if (e(this).children().size() > 0) {
3833                        e(this).children().filter(t).remove();
3834                        if (e(this).html().length == 0 && this.tagName != "BODY") return !0
3835                    }
3836                }
3837                this.$body.children().filter(t).remove()
3838            },
3839            dropdownclick: function(t, n, r) {
3840                var i = e(r.currentTarget).closest(t);
3841                if (i.hasClass("dis")) return;
3842                i.attr("wbbshow") ? (i.removeAttr("wbbshow"), e(document).unbind("mousedown", this.dropdownhandler), document && e(document).unbind("mousedown", this.dropdownhandler), this.lastRange = !1) : (this.saveRange(), this.$editor.find("*[wbbshow]").each(function(t, n) {
3843                    e(n).removeClass("on").find(e(n).attr("wbbshow")).hide().end().removeAttr("wbbshow")
3844                }), i.attr("wbbshow", n), e(document.body).bind("mousedown", e.proxy(function(e) {
3845                    this.dropdownhandler(i, t, n, e)
3846                }, this)), this.$body && this.$body.bind("mousedown", e.proxy(function(e) {
3847                    this.dropdownhandler(i, t, n, e)
3848                }, this))), i.find(n).toggle(), i.toggleClass("on")
3849            },
3850            dropdownhandler: function(t, n, r, i) {
3851                e(i.target).parents(n).size() == 0 && (t.removeClass("on").find(r).hide(), e(document).unbind("mousedown", this.dropdownhandler), this.$body && this.$body.unbind("mousedown", this.dropdownhandler))
3852            },
3853            rgbToHex: function(e) {
3854                if (e.substr(0, 1) == "#") return e;
3855                if (e.indexOf("rgb") == -1) {
3856                    var t = parseInt(e);
3857                    return t = (t & 255) << 16 | t & 65280 | (t & 16711680) >>> 16, "#" + t.toString(16)
3858                }
3859                var n = /(.*?)rgb\((\d+),\s*(\d+),\s*(\d+)\)/.exec(e);
3860                return "#" + this.dec2hex(parseInt(n[2])) + this.dec2hex(parseInt(n[3])) + this.dec2hex(parseInt(n[4]))
3861            },
3862            dec2hex: function(e) {
3863                return e > 15 ? e.toString(16) : "0" + e.toString(16)
3864            },
3865            sync: function() {
3866                this.options.bbmode ? this.$body.html(this.getHTML(this.txtArea.value, !0)) : this.$txtArea.attr("wbbsync", 1).val(this.getBBCode())
3867            },
3868            clearPaste: function(t) {
3869                var n = e(t);
3870                e.each(this.options.rules, e.proxy(function(t, r) {
3871                    var i = n.find(t).attr("wbbkeep", 1);
3872                    if (i.size() > 0) {
3873                        var s = r[0][1];
3874                        e.each(s, function(e, t) {
3875                            t.sel && i.find(t.sel).attr("wbbkeep", 1)
3876                        })
3877                    }
3878                }, this)), n.find("*[wbbkeep!='1']").each(e.proxy(function(t, n) {
3879                    var r = e(n);
3880                    r.is("div,p") && (r.children().size() == 0 || n.lastChild.tagName != "BR") && r.after("<br/>")
3881                }, this)), n.find("*[wbbkeep]").removeAttr("wbbkeep").removeAttr("style"), e.log(n.html()), n.html(this.getHTML(this.toBB(n), !0)), e.log(n.html())
3882            },
3883            sortArray: function(e, t) {
3884                return e.sort(function(e, n) {
3885                    return (e.length - n.length) * (t || 1)
3886                }), e
3887            },
3888            smileFind: function() {
3889                if (this.options.smilefind) {
3890                    var t = e(this.options.smilefind).find("img[alt]");
3891                    t.size() > 0 && (this.options.smileList = [], t.each(e.proxy(function(t, n) {
3892                        var r = e(n);
3893                        this.options.smileList.push({
3894                            title: r.attr("title"),
3895                            bbcode: r.attr("alt"),
3896                            img: r.removeAttr("alt").removeAttr("title")[0].outerHTML
3897                        })
3898                    }, this)))
3899                }
3900            },
3901            destroy: function() {
3902                this.$editor.replaceWith(this.$txtArea), this.$txtArea.removeClass("wysibb-texarea").show(), this.$modal.remove(), this.$txtArea.data("wbb", null)
3903            },
3904            pressTab: function(e) {
3905                e && e.which == 9 && (e.preventDefault && e.preventDefault(), this.options.bbmode ? this.insertAtCursor("   ", !1) : this.insertAtCursor('<span class="wbbtab"></span>', !1))
3906            },
3907            removeLastBodyBR: function() {
3908                this.body.lastChild && this.body.lastChild.nodeType != 3 && this.body.lastChild.tagName == "BR" && (this.body.removeChild(this.body.lastChild), this.removeLastBodyBR())
3909            },
3910            traceTextareaEvent: function(t) {
3911                e(t.target).closest("div.wysibb").size() == 0 && (e(document.activeElement).is("div.wysibb-body") && this.saveRange(), setTimeout(e.proxy(function() {
3912                    var n = this.$txtArea.val();
3913                    this.options.bbmode === !1 && n != "" && e(t.target).closest("div.wysibb").size() == 0 && !this.$txtArea.attr("wbbsync") && (this.selectLastRange(), this.insertAtCursor(this.getHTML(n, !0)), this.$txtArea.val("")), e(document.activeElement).is("div.wysibb-body") && (this.lastRange = !1)
3914                }, this), 100))
3915            },
3916            txtAreaInitContent: function() {
3917                this.$body.html(this.getHTML(this.txtArea.value, !0))
3918            },
3919            getValidationRGX: function(e) {
3920                return e.match(/\[\S+\]/) ? e.replace(/.*(\\*\[\S+\]).*/, "$1") : ""
3921            },
3922            smileConversion: function() {
3923                var t = this.getSelectNode();
3924                if (t.nodeType == 3) {
3925                    var n = t.data;
3926                    n.length >= 2 && !this.isInClearTextBlock(t) && e(t).parents("a").size() == 0 && e.each(this.options.srules, e.proxy(function(r, i) {
3927                        var s = i[0],
3928                            o = n.indexOf(s);
3929                        if (o != -1) {
3930                            var u = n.substring(o + s.length, n.length),
3931                                a = document.createTextNode(u),
3932                                f = document.createElement("SPAN");
3933                            return t.data = t.data.substr(0, o), e(t).after(a).after(f).after(this.strf(i[1], this.options)), this.selectNode(f), !1
3934                        }
3935                    }, this))
3936                }
3937            },
3938            isInClearTextBlock: function() {
3939                if (this.cleartext) {
3940                    var t = !1;
3941                    return e.each(this.cleartext, e.proxy(function(e, n) {
3942                        if (this.queryState(n)) return t = n, !1
3943                    }, this)), t
3944                }
3945                return !1
3946            },
3947            wrapAttrs: function(t) {
3948                return e.each(this.options.attrWrap, function(e, n) {
3949                    t = t.replace(n + '="', "_" + n + '="')
3950                }), t
3951            },
3952            unwrapAttrs: function(t) {
3953                return e.each(this.options.attrWrap, function(e, n) {
3954                    t = t.replace("_" + n + '="', n + '="')
3955                }), t
3956            },
3957            disNonActiveButtons: function() {
3958                this.isInClearTextBlock() ? this.$toolbar.find(".wysibb-toolbar-btn:not(.on,.mswitch)").addClass("dis") : this.$toolbar.find(".wysibb-toolbar-btn.dis").removeClass("dis")
3959            },
3960            showModal: function(t, n, r) {
3961                e.log("showModal: " + t), this.saveRange();
3962                var i = this.$modal.find(".wbbm-content").html(""),
3963                    s = this.$modal.find(".wbbm").removeClass("hastabs");
3964                this.$modal.find("span.wbbm-title-text").html(n.title);
3965                if (n.tabs && n.tabs.length > 1) {
3966                    s.addClass("hastabs");
3967                    var o = e('<div class="wbbm-tablist">').appendTo(i).append("<ul>").children("ul");
3968                    e.each(n.tabs, e.proxy(function(e, t) {
3969                        e == 0 && (t.on = "on"), o.append(this.strf("<li class=\"{on}\" onClick=\"$(this).parent().find('.on').removeClass('on');$(this).addClass('on');$(this).parents('.wbbm-content').find('.tab-cont').hide();$(this).parents('.wbbm-content').find('.tab" + e + "').show()\">{title}</li>", t))
3970                    }, this))
3971                }
3972                n.width && s.css("width", n.width);
3973                var u = e('<div class="wbbm-cont">').appendTo(i);
3974                r ? s.find("#wbbm-remove").show() : s.find("#wbbm-remove").hide(), e.each(n.tabs, e.proxy(function(t, n) {
3975                    var i = e("<div>").addClass("tab-cont tab" + t).attr("tid", t).appendTo(u);
3976                    t > 0 && i.hide(), n.html ? i.html(this.strf(n.html, this.options)) : e.each(n.input, e.proxy(function(t, n) {
3977                        n.value = r[n.param.toLowerCase()], n.param.toLowerCase() == "seltext" && (!n.value || n["value"] == "") && (n.value = this.get
3977SelectText(this.options.bbmode)), n.value && n["value"].indexOf("<span id='wbbid") == 0 && e(n.value).is("span[id*='wbbid']") && (n.value = e(n.value).html()), n.type && n.type == "div" ? i.append(this.strf('<div class="wbbm-inp-row"><label>{title}</label><div class="inp-text div-modal-text" contenteditable="true" name="{param}">{value}</div></div>', n)) : i.append(this.strf('<div class="wbbm-inp-row"><label>{title}</label><input class="inp-text modal-text" type="text" name="{param}" value="{value}"/></div>', n))
3978                    }, this))
3979                }, this)), e.isFunction(n.onLoad) && n.onLoad.call(this, t, n, r), s.find("#wbbm-submit").click(e.proxy(function() {
3980                    if (e.isFunction(n.onSubmit)) {
3981                        var i = n.onSubmit.call(this, t, n, r);
3982                        if (i === !1) return
3983                    }
3984                    var s = {},
3985                        o = !0;
3986                    this.$modal.find(".wbbm-inperr").remove(), this.$modal.find(".wbbm-brdred").removeClass("wbbm-brdred"), e.each(this.$modal.find(".tab-cont:visible .inp-text"), e.proxy(function(t, r) {
3987                        var i = e(r).parents(".tab-cont").attr("tid"),
3988                            u = e(r).attr("name").toLowerCase(),
3989                            a = "";
3990                        e(r).is("input,textrea") ? a = e(r).val() : a = e(r).html();
3991                        var f = n.tabs[i].input[t].validation;
3992                        typeof f != "undefined" && (a.match(new RegExp(f, "i")) || (o = !1, e(r).after('<span class="wbbm-inperr">' + CURLANG.validation_err + "</span>").addClass("wbbm-brdred"))), s[u] = a
3993                    }, this)), o && (e.log("Last range: " + this.lastRange), this.selectLastRange(), r && this.wbbRemoveCallback(t, !0), this.wbbInsertCallback(t, s), this.closeModal(), this.updateUI())
3994                }, this)), s.find("#wbbm-remove").click(e.proxy(function() {
3995                    this.selectLastRange(), this.wbbRemoveCallback(t), this.closeModal(), this.updateUI()
3996                }, this)), e(document.body).css("overflow", "hidden"), e("body").height() > e(window).height() && e(document.body).css("padding-right", "18px"), this.$modal.show(), s.css("margin-top", (e(window).height() - s.outerHeight()) / 3 + "px"), setTimeout(e.proxy(function() {
3997                    this.$modal.find(".inp-text:visible")[0].focus()
3998                }, this), 10)
3999            },
4000            escModal: function(e) {
4001                e.which == 27 && this.closeModal()
4002            },
4003            closeModal: function() {
4004                return e(document.body).css("overflow", "auto").css("padding-right", "0").unbind("keyup", this.escModal), this.$modal.find("#wbbm-submit,#wbbm-remove").unbind("click"), this.$modal.hide(), this.lastRange = !1, this
4005            },
4006            getParams: function(t, n, r) {
4007                var i = {};
4008                if (this.options.bbmode) {
4009                    var s = n.match(/\{[\s\S]+?\}/g);
4010                    n = this.prepareRGX(n);
4011                    var o = new RegExp(n, "g"),
4012                        u = this.txtArea.value;
4013                    r > 0 && (u = u.substr(r, u.length - r));
4014                    var a = o.exec(u);
4015                    a && e.each(s, function(e, t) {
4016                        i[t.replace(/\{|\}/g, "").replace(/"/g, "'").toLowerCase()] = a[e + 1]
4017                    })
4018                } else {
4019                    var f = this.options.rules[n][0][1];
4020                    e.each(f, e.proxy(function(n, r) {
4021                        var s = "";
4022                        r.attr !== !1 ? s = e(t).attr(r.attr) : r.sel !== !1 ? s = e(t).find(r.sel).html() : s = e(t).html();
4023                        if (s) {
4024                            if (r.rgx !== !1) {
4025                                var o = s.match(new RegExp(r.rgx));
4026                                o && o.length == 2 && (s = o[1])
4027                            }
4028                            i[n] = s.replace(/"/g, "'")
4029                        }
4030                    }, this))
4031                }
4032                return i
4033            },
4034            imgLoadModal: function() {
4035                e.log("imgLoadModal"), this.options.imgupload === !0 ? (this.$modal.find("#imguploader").dragfileupload({
4036                    url: this.strf(this.options.img_uploadurl, this.options),
4037                    extraParams: {
4038                        maxwidth: this.options.img_maxwidth,
4039                        maxheight: this.options.img_maxheight
4040                    },
4041                    themePrefix: this.options.themePrefix,
4042                    themeName: this.options.themeName,
4043                    success: e.proxy(function(e) {
4044                        this.$txtArea.insertImage(e.image_link, e.thumb_link), this.closeModal(), this.updateUI()
4045                    }, this)
4046                }), e.support.htmlSerialize || (e.log("IE not posting form by security reason, show default file upload"), this.$modal.find("#nicebtn").hide(), this.$modal.find("#fileupl").css("opacity", 1)), this.$modal.find("#fileupl").bind("change", function() {
4047                    e("#fupform").submit()
4048                }), this.$modal.find("#fupform").bind("submit", e.proxy(function(t) {
4049                    e(t.target).parents("#imguploader").hide().after('<div class="loader"><img src="' + this.options.themePrefix + "/" + this.options.themeName + '/img/loader.gif" /><br/><span>' + CURLANG.loading + "</span></div>").parent().css("text-align", "center")
4050                }, this))) : (this.$modal.find(".hastabs").removeClass("hastabs"), this.$modal.find("#imguploader").parents(".tab-cont").remove(), this.$modal.find(".wbbm-tablist").remove())
4051            },
4052            imgSubmitModal: function() {
4053                e.log("imgSubmitModal")
4054            },
4055            printObjectInIE: function(t) {
4056                try {
4057                    e.log(JSON.stringify(t))
4058                } catch (n) {}
4059            },
4060            checkFilter: function(t, n) {
4061                e.log("node: " + e(t).get(0).outerHTML + " filter: " + n + " res: " + e(t).is(n.toLowerCase()))
4062            },
4063            debug: function(t) {
4064                if (this.options.debug === !0) {
4065                    var n = (new Date).getTime();
4066                    typeof console != "undefined" ? console.log(n - this.startTime + " ms: " + t) : e("#exlog").append("<p>" + (n - this.startTime) + " ms: " + t + "</p>"), this.startTime = n
4067                }
4068            },
4069            isChrome: function() {
4070                return window.chrome ? !0 : !1
4071            },
4072            fixTableTransform: function(t) {
4073                return t ? e.inArray("table", this.options.buttons) == -1 ? t.replace(/\<(\/*?(table|tr|td|tbody))[^>]*\>/ig, "") : t.replace(/\<(\/*?(table|tr|td))[^>]*\>/ig, "[$1]".toLowerCase()).replace(/\<\/*tbody[^>]*\>/ig, "") : ""
4074            }
4075        }, e.log = function(t) {
4076            typeof wbbdebug != "undefined" && wbbdebug === !0 && (typeof console != "undefined" ? console.log(t) : e("#exlog").append("<p>" + t + "</p>"))
4077        }, e.fn.wysibb = function(t) {
4078            return this.each(function() {
4079                var n = e(this).data("wbb");
4080                n || new e.wysibb(this, t)
4081            })
4082        }, e.fn.wdrag = function(t) {
4083            t.scope || (t.scope = this);
4084            var n = {
4085                    x: 0,
4086                    y: 0,
4087                    height: 0
4088                },
4089                r;
4090            t.scope.drag_mousedown = function(i) {
4091                i.preventDefault(), n = {
4092                    x: i.pageX,
4093                    y: i.pageY,
4094                    height: t.height,
4095                    sheight: t.scope.$body.height()
4096                }, r = !0, e(document).bind("mousemove", e.proxy(t.scope.drag_mousemove, this)), e(this).addClass("drag")
4097            }, t.scope.drag_mouseup = function(n) {
4098                r === !0 && (n.preventDefault(), e(document).unbind("mousemove", t.scope.drag_mousemove), e(this).removeClass("drag"), r = !1)
4099            }, t.scope.drag_mousemove = function(e) {
4100                e.preventDefault();
4101                var r = 0,
4102                    i = 0;
4103                t.axisX && (r = e.pageX - n.x), t.axisY && (i = e.pageY - n.y);
4104                if (i != 0) {
4105                    var s = n.sheight + i;
4106                    s > n.height && s <= t.scope.options.resize_maxheight && (t.scope.options.bbmode == 1 ? t.scope.$txtArea.css(t.scope.options.autoresize === !0 ? "min-height" : "height", s + "px") : t.scope.$body.css(t.scope.options.autoresize === !0 ? "min-height" : "height", s + "px"))
4107                }
4108            }, e(this).bind("mousedown", t.scope.drag_mousedown), e(document).bind("mouseup", e.proxy(t.scope.drag_mouseup, this))
4109        }, e.fn.getDoc = function() {
4110            return this.data("wbb").doc
4111        }, e.fn.getSelectText = function(e) {
4112            return this.data("wbb").getSelectText(e)
4113        }, e.fn.bbcode = function(e) {
4114            return typeof e != "undefined" ? (this.data("wbb").options.bbmode ? this.data("wbb").$txtArea.val(e) : this.data("wbb").$body.html(this.data("wbb").getHTML(e)), this) : this.data("wbb").getBBCode()
4115        }, e.fn.htmlcode = function(e) {
4116            if (!this.data("wbb").options.onlyBBMode && this.data("wbb").inited === !0) return typeof e != "undefined" ? (this.data("wbb").$body.html(e), this) : this.data("wbb").getHTML(this.data("wbb").$txtArea.val())
4117        }, e.fn.getBBCode = function() {
4118            return this.data("wbb").getBBCode()
4119        }, e.fn.getHTML = function() {
4120            var e = this.data("wbb");
4121            return e.getHTML(e.$txtArea.val())
4122        }, e.fn.getHTMLByCommand = function(e, t) {
4123            return this.data("wbb").getHTMLByCommand(e, t)
4124        }, e.fn.getBBCodeByCommand = function(e, t) {
4125            return this.data("wbb").getBBCodeByCommand(e, t)
4126        }, e.fn.insertAtCursor = function(e, t) {
4127            return this.data("wbb").insertAtCursor(e, t), this.data("wbb")
4128        }, e.fn.execCommand = function(e, t) {
4129            return this.data("wbb").execCommand(e, t), this.data("wbb")
4130        }, e.fn.insertImage = function(e, t) {
4131            var n = this.data("wbb"),
4132                r = t ? n.getCodeByCommand("link", {
4133                    url: e,
4134                    seltext: n.getCodeByCommand("img", {
4135                        src: t
4136                    })
4137                }) : n.getCodeByCommand("img", {
4138                    src: e
4139                });
4140            return this.insertAtCursor(r), n
4141        }, e.fn.sync = function() {
4142            return this.data("wbb").sync(), this.data("wbb")
4143        }, e.fn.destroy = function() {
4144            this.data("wbb").destroy()
4145        }, e.fn.queryState = function(e) {
4146            return this.data("wbb").queryState(e)
4147        }
4148    }(jQuery),
4149    function(e) {
4150        "use strict";
4151
4152        function t(t, n) {
4153            this.$block = e(t), this.opt = e.extend({
4154                url: !1,
4155                success: !1,
4156                extraParams: !1,
4157                fileParam: "img",
4158                validation: ".(jpg|png|gif|jpeg)$",
4159                t1: CURLANG.fileupload_text1,
4160                t2: CURLANG.fileupload_text2
4161            }, n)
4162        }
4163        e.fn.dragfileupload = function(e) {
4164            return this.each(function() {
4165                var n = new t(this, e);
4166                n.init()
4167            })
4168        }, t.prototype = {
4169            init: function() {
4170                if (window.FormData != null) {
4171                    this.$block.addClass("drag"), this.$block.prepend('<div class="p2">' + this.opt.t2 + "</div>"), this.$block.prepend('<div class="p">' + this.opt.t1 + "</div>"), this.$block.bind("dragover", function() {
4172                        return e(this).addClass("dragover"), !1
4173                    }), this.$block.bind("dragleave", function() {
4174                        return e(this).removeClass("dragover"), !1
4175                    });
4176                    var t = e.proxy(function(e) {
4177                            var t = parseInt(e.loaded / e.total * 100, 10);
4178                            this.$loader.children("span").text(CURLANG.loading + ": " + t + "%")
4179                        }, this),
4180                        n = jQuery.ajaxSettings.xhr();
4181                    n.upload && n.upload.addEventListener("progress", t, !1), this.$block[0].ondrop = e.proxy(function(t) {
4182                        t.preventDefault(), this.$block.removeClass("dragover");
4183                        var r = t.dataTransfer.files[0];
4184                        if (this.opt.validation && !r.name.match(new RegExp(this.opt.validation))) return this.error(CURLANG.validation_err), !1;
4185                        var i = new FormData;
4186                        i.append(this.opt.fileParam, r), this.opt.extraParams && e.each(this.opt.extraParams, function(e, t) {
4187                            i.append(e, t)
4188                        }), this.$loader = e('<div class="loader"><img src="' + this.opt.themePrefix + "/" + this.opt.themeName + '/img/loader.gif" /><br/><span>' + CURLANG.loading + "</span></div>"), this.$block.html(this.$loader), e.ajax({
4189                            type: "POST",
4190                            url: this.opt.url,
4191                            data: i,
4192                            processData: !1,
4193                            contentType: !1,
4194                            xhr: function() {
4195                                return n
4196                            },
4197                            dataType: "json",
4198                            success: e.proxy(function(e) {
4199                                e && e.status == 1 ? this.opt.success(e) : this.error(e.msg || CURLANG.error_onupload)
4200                            }, this),
4201                            error: e.proxy(function(e, t, n) {
4202                                this.error(CURLANG.error_onupload)
4203                            }, this)
4204                        })
4205                    }, this)
4206                }
4207            },
4208            error: function(e) {
4209                this.$block.find(".upl-error").remove().end().append('<span class="upl-error">' + e + "</span>").addClass("wbbm-brdred")
4210            }
4211        }
4212    }(jQuery);
4213;(function($){
4214	var timeouts = [];
4215	$.fn.my_info = function(options){
4216		return $(this).each(function(){
4217			var self = this;
4218			var settings = $.extend({
4219				'start': function(){},
4220				'stop': function(){},
4221				'time': 3000,
4222				'name': 'my_info_default'
4223			},options);
4224			
4225			var index = false;
4226			for(var i in timeouts){
4227				if(timeouts[i].row == settings.name){
4228					index = i;
4229				}
4230			}
4231			if(index !== false){
4232				clearTimeout(timeouts[index].timeout);
4233			}else{
4234				index = timeouts.length;
4235				timeouts.push({row: settings.name, timeout: false});
4236			}
4237			settings.start.apply(self, []);
4238			timeouts[index].timeout = setTimeout(function(){
4239				delete timeouts[index];
4240				settings.stop.apply(self, []);
4241			}, settings.time);
4242		});
4243	};
4244}(jQuery));
4245/*!
4246 * Author: Soroka Anton 
4247 *
4248 * Name: jQuery.message
4249 * Version: 1.0
4250 * Requires: jQuery 1.8+
4251 * Requires: jQuery.mousewheel (https://github.com/brandonaaron/jquery-mousewheel)
4252 */
4253(function(c){var g=0;c.message=function(h){var e=g++,b=c.extend({form:"",onclose:function(a){a(!0)},onkeydown:function(a){}},h);b.form instanceof jQuery||(b.form=c(b.form));var d=c('<div class="jq-message"><div class="jq-message-body"><div class="jq-message-content"></div></div><div class="jq-message-helper"></div></div>'),f={close:function(){b.onclose.apply(b.form,[function(a){a&&(d.remove(),c(document).off("keydown.jq_message_"+e),c("dody").css("opacity","0.99"),setTimeout(function(){c("body").css("opacity",
4254"1")},0))}])},form:b.form,id:e};d.click(function(a){a.preventDefault();a.stopPropagation();f.close()});d.find(".jq-message-body").click(function(a){a.preventDefault();a.stopPropagation()});c(document).on("keydown.jq_message_"+e,function(a){b.onkeydown.apply(this,[a,b.form])});d.mousewheel(function(a){a.preventDefault()});d.find(".jq-message-body").mousewheel(function(a){var b=c(this),d=b.scrollTop(),e=parseInt(b.prop("scrollHeight"),10),b=b.outerHeight();0<a.deltaY&&0>=d||0>a.deltaY&&d>=e-b-1||a.stopPropagation()});
4255d.find(".jq-message-content").append(b.form);c("body").append(d);return f}}(jQuery));
4256/**
4257 * @depends jQuery
4258*/
4259(function($){
4260	$.fn.new_window = function(options) {
4261		var self = this;
4262		options = $.extend({
4263			width: 1000,
4264			height: 600
4265		}, options);
4266		
4267		var pupup;
4268		var open_window = function(url, $el){
4269			$el.trigger('oauth_open');
4270			var left = (Math.abs($(window).width() - options.width) / 2)|0;
4271			var top = (Math.abs($(window).height() - options.height) / 2)|0;
4272			var params = [
4273				"width=" + options.width,
4274				"height=" + options.height,
4275				"left=" + left,
4276				"top=" + top,
4277				"resizable=yes",
4278				"scrollbars=no",
4279				"toolbar=no",
4280				"menubar=no",
4281				"location=no",
4282				"directories=no",
4283				"status=yes"
4284			];
4285			pupup = window.open(url, "www_vb_kg", params.join(','));
4286			$el.addClass('open');
4287			
4288			var interval = setInterval(function(){
4289				if(!pupup || pupup.closed){
4290					$el.trigger('oauth_close');
4291					$el.removeClass('open');
4292					clearInterval(interval);
4293				}
4294			}, 300);
4295			pupup.focus();
4296		};
4297		
4298		return self.each(function() {
4299			var $el = $(this);
4300			$el.click(function(e) {
4301				e.preventDefault();
4302				if(self.is('.open')){
4303					try{
4304						pupup.focus();
4305					}catch(e){}
4306					return;
4307				}
4308				var url = $el.data('url');
4309				open_window(url, $el);
4310			});
4311		});
4312	};
4313}(jQuery));
4314/*! Magnific Popup - v0.8.5 - 2013-05-15
4315* http://dimsemenov.com/plugins/magnific-popup/
4316* Copyright (c) 2013 Dmitry Semenov; */
4317(function(e){var t,i,n,a,o,r,s,l="Close",c="BeforeAppend",d="MarkupParse",u="Open",p="Change",f="mfp",m="."+f,g="mfp-ready",v="mfp-removing",h="mfp-prevent-close",C=function(){},y=!!window.jQuery,w=e(window),b=function(e,i){t.ev.on(f+e+m,i)},I=function(t,i,n,a){var o=document.createElement("div");return o.className="mfp-"+t,n&&(o.innerHTML=n),a?i&&i.appendChild(o):(o=e(o),i&&o.appendTo(i)),o},x=function(i,n){t.ev.triggerHandler(f+i,n),t.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),t.st.callbacks[i]&&t.st.callbacks[i].apply(t,e.isArray(n)?n:[n]))},k=function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},S=function(i){return i===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=i),t.currTemplate.closeBtn},P=function(){e.magnificPopup.instance||(t=new C,t.init(),e.magnificPopup.instance=t)},T=function(i){if(!e(i).hasClass(h)){var n=t.st.closeOnContentClick,a=t.st.closeOnBgClick;if(n&&a)return!0;
4317if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(n)return!0}else if(a)return!0;return!1}};C.prototype={constructor:C,init:function(){var i=navigator.appVersion;t.isIE7=-1!==i.indexOf("MSIE 7."),t.isIE8=-1!==i.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document.body),a=e(document),t.popupsCache={}},open:function(i){if(t.items=i.items.length?i.items:[i.items],t.isOpen)return t.updateItemHTML(),void 0;var o;if(t.types=[],r="",t.ev=i.el||a,i.isObj)t.index=i.index||0;else{t.index=0;var s,l=i.items;for(o=0;l.length>o;o++)if(s=l[o],s.parsed&&(s=s.el[0]),s===i.el[0]){t.index=o;break}}i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.bgOverlay||(t.bgOverlay=I("bg").on("click"+m,function(){t.close()}),t.wrap=I("wrap").attr("tabindex",-1).on("click"+m,function(e){T(e.target)&&t.close()}),t.container=I("container",t.wrap)),t.contentContainer=I("content"),t.st.preloader&&(t.preloader=I("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(o=0;c.length>o;o++){var p=c[o];p=p.charAt(0).toUpperCase()+p.slice(1),t["init"+p].call(t)}x("BeforeOpen"),t.st.closeBtnInside?(b(d,function(e,t,i,n){i.close_replaceWith=S(n.type)}),r+=" mfp-close-btn-in"):t.wrap.append(S()),t.st.alignTop&&(r+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:w.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:a.height(),position:"absolute"}),a.on("keyup"+m,function(e){27===e.keyCode&&t.close()}),w.on("resize"+m,function(){t.updateSize()}),t.st.closeOnContentClick||(r+=" mfp-auto-cursor"),r&&t.wrap.addClass(r);var f=t.wH=w.height(),v={};if(t.fixedContentPos){var h=t._getScrollbarSize();h&&(v.paddingRight=h)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):v.overflow="hidden");var C=t.st.mainClass;t.isIE7&&(C+=" mfp-ie7"),C&&t._addClassToMFP(C),t.updateItemHTML(),x("BuildControls"),n.css(v),t.bgOverlay.add(t.wrap).prependTo(document.body),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(g),k()):t.bgOverlay.addClass(g),a.on("focusin"+m,function(i){return i.target===t.wrap[0]||e.contains(t.wrap[0],i.target)?void 0:(k(),!1)})},16),t.isOpen=!0,t.updateSize(f),x(u)},close:function(){t.isOpen&&(t.isOpen=!1,t.st.removalDelay&&!t.isLowIE?(t._addClassToMFP(v),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){x(l);var i=v+" "+g+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var o={paddingRight:0};t.isIE7?e("body, html").css("overflow","auto"):o.overflow="auto",n.css(o)}a.off("keyup"+m+" focusin"+m),t.ev.off(m),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*i;t.wrap.css("height",n),t.wH=n}else t.wH=e||w.height();x("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var n=i.type;if(x("BeforeChange",[t.currItem?t.currItem.type:"",n]),t.currItem=i,!t.currTemplate[n]){var a=t.st[n]?t.st[n].markup:!1;x("FirstMarkupParse",a),t.currTemplate[n]=a?e(a):!0}o&&o!==i.type&&t.container.removeClass("mfp-"+o+"-holder");var r=t["get"+n.charAt(0).toUpperCase()+n.slice(1)](i,t.currTemplate[n]);
4317t.appendContent(r,n),i.preloaded=!0,x(p,i),o=i.type,t.container.prepend(t.contentContainer),x("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.closeBtnInside&&t.currTemplate[i]===!0?t.content.find(".mfp-close").length||t.content.append(S()):t.content=e:t.content="",x(c),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var n=t.items[i],a=n.type;if(n=n.tagName?{el:e(n)}:{data:n,src:n.src},n.el){for(var o=t.types,r=0;o.length>r;r++)if(n.el.hasClass("mfp-"+o[r])){a=o[r];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=a||t.st.type||"inline",n.index=i,n.parsed=!0,t.items[i]=n,x("ElementParse",n),t.items[i]},addGroup:function(e,i){var n=function(n){n.mfpEl=this,t._openClick(n,e,i)};i||(i={});var a="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(a).on(a,n)):(i.isObj=!1,i.delegate?e.off(a).on(a,i.delegate,n):(i.items=e,e.off(a).on(a,n)))},_openClick:function(i,n,a){var o=void 0!==a.midClick?a.midClick:e.magnificPopup.defaults.midClick;if(o||2!==i.which){var r=void 0!==a.disableOn?a.disableOn:e.magnificPopup.defaults.disableOn;if(r)if(e.isFunction(r)){if(!r.call(t))return!0}else if(r>w.width())return!0;i.type&&i.preventDefault(),a.el=e(i.mfpEl),a.delegate&&(a.items=n.find(a.delegate)),t.open(a)}},updateStatus:function(e,n){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),n||"loading"!==e||(n=t.st.tLoading);var a={status:e,text:n};x("UpdateStatus",a),e=a.status,n=a.text,t.preloader.html(n),t.preloader.find("a").click(function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),i=e}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return document.body.clientHeight>(e||w.height())?!0:!1},_parseMarkup:function(t,i,n){var a;n.data&&(i=e.extend(n.data,i)),x(d,[t,i,n]),e.each(i,function(e,i){if(void 0===i||i===!1)return!0;if(a=e.split("_"),a.length>1){var n=t.find(m+"-"+a[0]);if(n.length>0){var o=a[1];"replaceWith"===o?n[0]!==i[0]&&n.replaceWith(i):"img"===o?n.is("img")?n.attr("src",i):n.replaceWith('<img src="'+i+'" class="'+n.attr("class")+'" />'):n.attr(a[1],i)}}else t.find(m+"-"+e).html(i)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:C.prototype,modules:[],open:function(e,t){return P(),e||(e={}),e.isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,alignTop:!1,removalDelay:0,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&times;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(i){P();var n=e(this);if("string"==typeof i)if("open"===i){var a,o=y?n.data("magnificPopup"):n[0].magnificPopup,r=parseInt(arguments[1],10)||0;o.items?a=o.items[r]:(a=n,o.delegate&&(a=a.find(o.delegate)),a=a.eq(r)),t._openClick({mfpEl:a},n,o)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else y?n.data("magnificPopup",i):n[0].magnificPopup=i,t.addGroup(n,i);return n};var E,M,O,_="inline",z=function(){O&&(M.after(O.addClass(E)).detach(),O=null)};e.magnificPopup.registerModule(_,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(_),b(l+"."+_,function(){z()})},getInline:function(i,n){if(z(),i.src){var a=t.st.inline,o=e(i.src);return o.length?(null!==o[0].parentNode&&(M||(E=a.hiddenClass,M=I(E),E="mfp-"+E),O
4317=o.after(M).detach().removeClass(E)),t.updateStatus("ready")):(t.updateStatus("error",a.tNotFound),o=e("<div>")),i.inlineElement=o,o}return t.updateStatus("ready"),t._parseMarkup(n,{},i),n}}});var B,F="ajax",H=function(){B&&n.removeClass(B)};e.magnificPopup.registerModule(F,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(F),B=t.st.ajax.cursor,b(l+"."+F,function(){H(),t.req&&t.req.abort()})},getAjax:function(i){B&&n.addClass(B),t.updateStatus("loading");var a=e.extend({url:i.src,success:function(n,a,o){x("ParseAjax",o),t.appendContent(e(o.responseText),F),i.finished=!0,H(),k(),setTimeout(function(){t.wrap.addClass(g)},16),t.updateStatus("ready")},error:function(){H(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(a),""}}});var L,A=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var n=t.st.image.titleSrc;if(n){if(e.isFunction(n))return n.call(t,i);if(i.el)return i.el.attr(n)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><div class="mfp-img"></div><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=t.st.image,i=".image";t.types.push("image"),b(u+i,function(){"image"===t.currItem.type&&e.cursor&&n.addClass(e.cursor)}),b(l+i,function(){e.cursor&&n.removeClass(e.cursor),w.off("resize"+m)}),b("Resize"+i,t.resizeImage),t.isLowIE&&b("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height","none"/*t.wH-i*/)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,L&&clearInterval(L),e.isCheckingImgSize=!1,x("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,n=e.img[0],a=function(o){L&&clearInterval(L),L=setInterval(function(){return n.naturalWidth>0?(t._onImageHasSize(e),void 0):(i>200&&clearInterval(L),i++,3===i?a(10):40===i?a(50):100===i&&a(500),void 0)},o)};a(1)},getImage:function(i,n){var a=0,o=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0):(a++,200>a?setTimeout(o,100):r()))},r=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=n.find(".mfp-img");if(l.length){var c=new Image;c.className="mfp-img",i.img=e(c).on("load.mfploader",o).on("error.mfploader",r),c.src=i.src,l.is("img")&&(i.img=i.img.clone())}return t._parseMarkup(n,{title:A(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(L&&clearInterval(L),i.loadError?(n.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(n.removeClass("mfp-loading"),t.updateStatus("ready")),n):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,n.addClass("mfp-loading"),t.findImageSize(i)),n)}}});var j="iframe",N="//about:blank",W=function(e){if(t.currTemplate[j]){var i=t.currTemplate[j].find("iframe");i.length&&(e||(i[0].src=N),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(j,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(j),b("BeforeChange",function(e,t,i){t!==i&&(t===j?W():i===j&&W(!0))}),b(l+"."+j,W)},getIframe:function(i,n){var a=i.src,o=t.st.iframe;e.each(o.patterns,function(){return a.indexOf(this.index)>-1?(this.id&&(a="string"==typeof this.id?a.substr(a.lastIndexOf(this.id
4317)+this.id.length,a.length):this.id.call(this,a)),a=this.src.replace("%id%",a),!1):void 0});var r={};return o.srcAction&&(r[o.srcAction]=a),t._parseMarkup(n,r,i),t.updateStatus("ready"),n}}});var R=function(e){var i=t.items.length;return e>i-1?e-i:0>e?i+e:e},Y=function(e,t,i){return e.replace("%curr%",t+1).replace("%total%",i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,n=".mfp-gallery",o=Boolean(e.fn.mfpFastClick);return t.direction=!0,i&&i.enabled?(r+=" mfp-gallery",b(u+n,function(){i.navigateByImgClick&&t.wrap.on("click"+n,".mfp-img",function(){return t.next(),!1}),a.on("keydown"+n,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),b("UpdateStatus"+n,function(e,i){i.text&&(i.text=Y(i.text,t.currItem.index,t.items.length))}),b(d+n,function(e,n,a,o){var r=t.items.length;a.counter=r?Y(i.tCounter,o.index,r):""}),b("BuildControls"+n,function(){if(i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,a=t.arrowLeft=e(n.replace("%title%",i.tPrev).replace("%dir%","left")).addClass(h),r=t.arrowRight=e(n.replace("%title%",i.tNext).replace("%dir%","right")).addClass(h),s=o?"mfpFastClick":"click";a[s](function(){t.prev()}),r[s](function(){t.next()}),t.isIE7&&(I("b",a[0],!1,!0),I("a",a[0],!1,!0),I("b",r[0],!1,!0),I("a",r[0],!1,!0)),t.container.append(a.add(r))}}),b(p+n,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),b(l+n,function(){a.off(n),t.wrap.off("click"+n),o&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=R(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=R(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),a=Math.min(i[1],t.items.length);for(e=1;(t.direction?a:n)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?n:a)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=R(i),!t.items[i].preloaded){var n=t.items[i];n.parsed||(n=t.parseEl(i)),x("LazyLoad",n),"image"===n.type&&(n.img=e('<img class="mfp-img" />').on("load.mfploader",function(){n.hasSize=!0}).on("error.mfploader",function(){n.hasSize=!0,n.loadError=!0}).attr("src",n.src)),n.preloaded=!0}}}});var q="retina";e.magnificPopup.registerModule(q,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;i=isNaN(i)?i():i,i>1&&(b("ImageHasSize."+q,function(e,t){t.img.css({"max-width":"none"/*t.img[0].naturalWidth/i*/,width:"100%"})}),b("ElementParse."+q,function(t,n){n.src=e.replaceSrc(n,i)}))}}}}),function(){var t=1e3,i="ontouchstart"in window,n=function(){w.off("touchmove"+o+" touchend"+o)},a="mfpFastClick",o="."+a;e.fn.mfpFastClick=function(a){return e(this).each(function(){var r,s=e(this);if(i){var l,c,d,u,p,f;s.on("touchstart"+o,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,w.on("touchmove"+o,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,n())}).on("touchend"+o,function(e){n(),u||f>1||(r=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){r=!1},t),a())})})}s.on("click"+o,function(){r||a()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+o+" click"+o),i&&w.off("touchmove"+o+" touchend"+o)}}()})(window.jQuery||window.Zepto);
4318/*!
4319
4320   Flowplayer v7.2.7 (2018-08-13) | flowplayer.com/license
4321
4322*/
4323!function(e){function t(e,t,n,i){for(var r,o=n.slice(),a=(c=e,(u=t).currentTarget=c,u.eventPhase=u.target===u.currentTarget?2:3,u),s=0,l=o.length;s<l&&(handler=o[s],"object"==typeof handler&&"function"==typeof handler.handleEvent?handler.handleEvent(a):handler.call(e,a),!a.stoppedImmediatePropagation);s++);var u,c;return r=!a.stoppedPropagation,i&&r&&e.parentNode?e.parentNode.dispatchEvent(a):!a.defaultPrevented}function n(e,t){return{configurable:!0,get:e,set:t}}function i(e,t,i){var r=y(t||e,i);m(e,"textContent",n(function(){return r.get.call(this)},function(e){r.set.call(this,e)}))}function r(e,t){for(var n=e.length;n--&&e[n]!==t;);return n}function o(){if("BR"===this.tagName)return"\n";for(var e=this.firstChild,t=[];e;
4323)8!==e.nodeType&&7!==e.nodeType&&t.push(e.textContent),e=e.nextSibling;return t.join("")}function a(e){!f&&C.test(document.readyState)&&(f=!f,document.detachEvent(d,a),(e=document.createEvent("Event")).initEvent(p,!0,!0),document.dispatchEvent(e))}function s(e){for(var t;t=this.lastChild;)this.removeChild(t);null!=e&&this.appendChild(document.createTextNode(e))}function l(t,n){return n||(n=e.event),n.target||(n.target=n.srcElement||n.fromElement||document),n.timeStamp||(n.timeStamp=(new Date).getTime()),n}if(!document.createEvent){var u,c=!0,f=!1,d="onreadystatechange",p="DOMContentLoaded",h="__IE8__"+Math.random(),g=e.Object,m=g.defineProperty||function(e,t,n){e[t]=n.value},v=g.defineProperties||function(t,n){for(var i in n)if(w.call(n,i))try{m(t,i,n[i])}catch(n){e.console&&console.log(i+" failed on object:",t,n.message)}},y=g.getOwnPropertyDescriptor,w=g.prototype.hasOwnProperty,b=e.Element.prototype,I=e.Text.prototype,M=/^[a-z]+$/,C=/loaded|complete/,A={},S=document.createElement("div");i(e.HTMLCommentElement.prototype,b,"nodeValue"),i(e.HTMLScriptElement.prototype,null,"text"),i(I,null,"nodeValue"),i(e.HTMLTitleElement.prototype,null,"text"),m(e.HTMLStyleElement.prototype,"textContent",(u=y(e.CSSStyleSheet.prototype,"cssText"),n(function(){return u.get.call(this.styleSheet)},function(e){u.set.call(this.styleSheet,e)}))),v(b,{textContent:{get:o,set:s},firstElementChild:{get:function(){for(var e=this.childNodes||[],t=0,n=e.length;t<n;t++)if(1==e[t].nodeType)return e[t]}},lastElementChild:{get:function(){for(var e=this.childNodes||[],t=e.length;t--;)if(1==e[t].nodeType)return e[t]}},previousElementSibling:{get:function(){for(var e=this.previousSibling;e&&1!=e.nodeType;)e=e.previousSibling;return e}},nextElementSibling:{get:function(){for(var e=this.nextSibling;e&&1!=e.nodeType;)e=e.nextSibling;return e}},childElementCount:{get:function(){for(var e=0,t=this.childNodes||[],n=t.length;n--;e+=1==t[n].nodeType);return e}},addEventListener:{value:function(e,n,i){var o,a=this,s="on"+e,u=a[h]||m(a,h,{value:{}})[h],c=u[s]||(u[s]={}),f=c.h||(c.h=[]);if(!w.call(c,"w")){if(c.w=function(e){return e[h]||t(a,l(0,e),f,!1)},!w.call(A,s))if(M.test(e))try{(o=document.createEventObject())[h]=!0,9!=a.nodeType&&null==a.parentNode&&S.appendChild(a),a.fireEvent(s,o),A[s]=!0}catch(o){for(A[s]=!1;S.hasChildNodes();)S.removeChild(S.firstChild)}else A[s]=!1;(c.n=A[s])&&a.attachEvent(s,c.w)}r(f,n)<0&&f[i?"unshift":"push"](n)}},dispatchEvent:{value:function(e){var n,i=this,r="on"+e.type,o=i[h],a=o&&o[r],s=!!a;return e.target||(e.target=i),s?a.n?i.fireEvent(r,e):t(i,e,a.h,!0):!(n=i.parentNode)||n.dispatchEvent(e),!e.defaultPrevented}},removeEventListener:{value:function(e,t,n){var i="on"+e,o=this[h],a=o&&o[i],s=a&&a.h,l=s?r(s,t):-1;-1<l&&s.splice(l,1)}}}),v(I,{addEventListener:{value:b.addEventListener},dispatchEvent:{value:b.dispatchEvent},removeEventListener:{value:b.removeEventListener}}),v(e.XMLHttpRequest.prototype,{addEventListener:{value:function(e,t,n){var i=this,o="on"+e,a=i[h]||m(i,h,{value:{}})[h],s=a[o]||(a[o]={}),l=s.h||(s.h=[]);r(l,t)<0&&(i[o]||(i[o]=function(){var t=document.createEvent("Event");t.initEvent(e,!0,!0),i.dispatchEvent(t)}),l[n?"unshift":"push"](t))}},dispatchEvent:{value:function(e){var n="on"+e.type,i=this[h],r=i&&i[n];return!!r&&(r.n?this.fireEvent(n,e):t(this,e,r.h,!0))}},removeEventListener:{value:b.removeEventListener}}),v(e.Event.prototype,{bubbles:{value:!0,writable:!0},cancelable:{value:!0,writable:!0},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0,this.returnValue=!1)}},stopPropagation:{value:function(){this.stoppedPropagation=!0,this.cancelBubble=!0}},stopImmediatePropagation:{value:function(){this.stoppedImmediatePropagation=!0,this.stopPropagation()}},initEvent:{value:function(e,t,n){this.type=e,this.bubbles=!!t,this.cancelable=!!n,this.bubbles||this.stopPropagation()}}}),v(e.HTMLDocument.prototype,{textContent:{get:function(){return 11===this.nodeType?o.call(this):null},set:function(e){11===this.nodeType&&s.call(this,e)}},addEventListener:{value:function(t,n,i){var r=this;b.addEventListener.call(r,t,n,i),c&&t===p&&!C.test(r.readyState)&&(c=!1,r.attachEvent(d,a),e==top&&function e(t){try{r.documentElement.doScroll("left"),a()}catch(t){setTimeout(e,50)}}())}},dispatchEvent:{value:b.dispatchEvent},removeEventListener:{value:b.removeEventListener},createEvent:{value:function(e){var t;if("Event"!==e)throw new Error("unsupported "+e);return(t=document.createEventObject()).timeStamp=(new Date).getTime(),t}}}),v(e.Window.prototype,{getComputedStyle:{value:function(){function e(e){this._=e}function t(){}var n=/^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,i=/^(top|right|bottom|left)$/,r=/\-([a-z])/g,o=function(e,t){return t.toUpperCase()};return e.prototype.getPropertyValue=function(e){var t,a,s,l=this._,u=l.style,c=l.currentStyle,f=l.runtimeStyle;return e=("float"===e?"style-float":e).replace(r,o),t=c?c[e]:u[e],n.test(t)&&!i.test(e)&&(a=u.left,(s=f&&f.left)&&(f.left=c.left),u.left="fontSize"===e?"1em":t,t=u.pixelLeft+"px",u.left=a,s&&(f.left=s)),null==t?t:t+""||"auto"},t.prototype.getPropertyValue=function(){return null},function(n,i){return i?new t(n):new e(n)}}()},addEventListener:{value:function(n,i,o){var a,s=e,u="on"+n;s[u]||(s[u]=function(e){return t(s,l(0,e),a,!1)}),r(a=s[u][h]||(s[u][h]=[]),i)<0&&a[o?"unshift":"push"](i)}},dispatchEvent:{value:function(t){var n=e["on"+t.type];return!n||!1!==n.call(e,t)&&!t.defaultPrevented}},removeEventListener:{value:function(t,n,i){var o=(e["on"+t]||g)[h],a=o?r(o,n):-1;-1<a&&o.splice(a,1)}}})}}(this),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).flowplayer=e()}}(function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return r(n||e)},c,c.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(e,t,n){"use strict";var i=t.exports={},r=e("class-list"),o=window.jQuery,a=e("punycode"),s=e("computed-style");i.noop=function(){},i.identity=function(e){return e},i.removeNode=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},i.find=function(e,t){return o?o(e,t).toArray():(t=t||document,Array.prototype.map.call(t.querySelectorAll(e),function(e){return e}))},i.text=function(e,t){e["innerText"in e?"innerText":"textContent"]=t},i.findDirect=function(e,t){return i.find(e,t).filter(function(e){return e.parentNode===t})},i.hasClass=function(e,t){return"string"==typeof e.className&&r(e).contains(t)},i.isSameDomain=function(e){var t=window.location,n=i.createElement("a",{href:e});return t.hostname===n.hostname&&t.protocol===n.protocol&&t.port===n.port},i.css=function(e,t,n){return"object"==typeof t?Object.keys(t).forEach(function(n){i.css(e,n,t[n])}
4323):void 0!==n?""===n?e?e.style.removeProperty(t):void 0:e?e.style.setProperty(t,n):void 0:e?s(e,t):void 0},i.createElement=function(e,t,n){try{var r=document.createElement(e);for(var a in t)t.hasOwnProperty(a)&&("css"===a?i.css(r,t[a]):i.attr(r,a,t[a]));return n&&(r.innerHTML=n),r}catch(i){if(!o)throw i;return o("<"+e+">"+n+"</"+e+">").attr(t)[0]}},i.toggleClass=function(e,t,n){if(e){var i=r(e);void 0===n?i.toggle(t):n?i.add(t):n||i.remove(t)}},i.addClass=function(e,t){return i.toggleClass(e,t,!0)},i.removeClass=function(e,t){return i.toggleClass(e,t,!1)},i.append=function(e,t){return e.appendChild(t),e},i.appendTo=function(e,t){return i.append(t,e),e},i.prepend=function(e,t){e.insertBefore(t,e.firstChild)},i.insertAfter=function(e,t,n){t==i.lastChild(e)&&e.appendChild(n);var r=Array.prototype.indexOf.call(e.children,t);e.insertBefore(n,e.children[r+1])},i.html=function(e,t){(e=e.length?e:[e]).forEach(function(e){e.innerHTML=t})},i.attr=function(e,t,n){if("class"===t&&(t="className"),i.hasOwnOrPrototypeProperty(e,t))try{e[t]=n}catch(i){if(!o)throw i;o(e).attr(t,n)}else!1===n?e.removeAttribute(t):e.setAttribute(t,n);return e},i.prop=function(e,t,n){if(void 0===n)return e&&e[t];e[t]=n},i.offset=function(e){var t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight&&(t={left:100*t.left,right:100*t.right,top:100*t.top,bottom:100*t.bottom,width:100*t.width,height:100*t.height}),t},i.width=function(e,t){if(t)return e.style.width=(""+t).replace(/px$/,"")+"px";var n=i.offset(e).width;return void 0===n?e.offsetWidth:n},i.height=function(e,t){if(t)return e.style.height=(""+t).replace(/px$/,"")+"px";var n=i.offset(e).height;return void 0===n?e.offsetHeight:n},i.lastChild=function(e){return e.children[e.children.length-1]},i.hasParent=function(e,t){for(var n=e.parentElement;n;){if("string"!=typeof t){if(n===t)return!0}else if(i.matches(n,t))return!0;n=n.parentElement}return!1},i.createAbsoluteUrl=function(e){return i.createElement("a",{href:e}).href},i.xhrGet=function(e,t,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===this.readyState)return this.status>=400?n():void t(this.responseText)},i.open("get",e,!0),i.send()},i.pick=function(e,t){var n={};return t.forEach(function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n},i.hostname=function(e){return a.toUnicode(e||window.location.hostname)},i.browser={webkit:"WebkitAppearance"in document.documentElement.style},i.getPrototype=function(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__},i.hasOwnOrPrototypeProperty=function(e,t){for(var n=e;n;){if(Object.prototype.hasOwnProperty.call(n,t))return!0;n=i.getPrototype(n)}return!1},i.matches=function(e,t){var n=Element.prototype;return(n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=0;t[n]&&t[n]!==this;)n++;return!!t[n]}).call(e,t)},function(e){function t(e){return e.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()})}void 0!==e.setAttribute&&(e.setProperty=function(e,n){return this.setAttribute(t(e),String(n))},e.getPropertyValue=function(e){return this.getAttribute(t(e))||null},e.removeProperty=function(e){var n=this.getPropertyValue(e);return this.removeAttribute(t(e)),n})}(window.CSSStyleDeclaration.prototype)},{"class-list":36,"computed-style":37,punycode:44}],2:[function(e,t,n){"use strict";var i=e("../common");t.exports=function(e,t,n,r){n=n||"opaque";var o="obj"+(""+Math.random()).slice(2,15),a='<object class="fp-engine" id="'+o+'" name="'+o+'" ',s=navigator.userAgent.indexOf("MSIE")>-1;a+=s?'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">':' data="'+e+'" type="application/x-shockwave-flash">';var l={width:"100%",height:"100%",allowscriptaccess:"always",wmode:n,quality:"high",flashvars:"",movie:e+(s?"?"+o:""),name:o};"transparent"!==n&&(l.bgcolor=r||"#333333"),Object.keys(t).forEach(function(e){l.flashvars+=e+"="+t[e]+"&"}),Object.keys(l).forEach(function(e){a+='<param name="'+e+'" value="'+l[e]+'"/>'}),a+="</object>";var u=i.createElement("div",{},a);return i.find("object",u)},window.attachEvent&&window.attachEvent("onbeforeunload",function(){window.__flash_savedUnloadHandler=window.__flash_unloadHandler=function(){}})},{"../common":1}],3:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=e("../common"),a=e("./embed"),s=e("extend-object"),l=e("bean");function u(e){return/^https?:/.test(e)}(i=function(e,t){var n,c,f,d,p=e.conf,h=[],g={engineName:i.engineName,pick:function(t){var n=s({},function(){if(r.support.flashVideo){for(var n,i,o=0;o<t.length;o++)if(i=t[o],/mp4|flv|flash/i.test(i.type)&&(n=i),e.conf.swfHls&&/mpegurl/i.test(i.type)&&(n=i),n&&!/mp4/i.test(n.type))return n;return n}}());if(n)return!n.src||u(n.src)||e.conf.rtmp||n.rtmp||(n.src=o.createAbsoluteUrl(n.src)),n},suspendEngine:function(){d=!0},resumeEngine:function(){d=!1},load:function(i){function v(e){return e.replace(/&amp;/g,"%26").replace(/&/g,"%26").replace(/=/g,"%3D")}n=i,h.forEach(function(e){clearTimeout(e)});var y=o.findDirect("video",t)[0]||o.find(".fp-player > video",t)[0],w=i.src,b=u(w),I=function(){o.removeNode(y)};r.support.video&&o.prop(y,"autoplay")&&i.sources.some(function(e){return!!y.canPlayType(e.type)})?l.one(y,"timeupdate",I):I();var M,C=i.rtmp||p.rtmp;if(b||C||(w=o.createAbsoluteUrl(w)),f&&m(i)&&f.data!==o.createAbsoluteUrl(p.swfHls)&&g.unload(),f){["live","preload","loop"].forEach(function(e){i.hasOwnProperty(e)&&f.__set(e,i[e])}),Object.keys(i.flashls||{}
4323).forEach(function(e){f.__set("hls_"+e,i.flashls[e])});var A=!1;if(!b&&C)f.__set("rtmp",C.url||C);else A=!!f.__get("rtmp"),f.__set("rtmp",null);f.__play(w,A||i.rtmp&&i.rtmp!==p.rtmp)}else{c="fpCallback"+(""+Math.random()).slice(3,15),w=v(w);var S={hostname:p.embedded?o.hostname(p.hostname):o.hostname(location.hostname),url:w,callback:c};t.getAttribute("data-origin")&&(S.origin=t.getAttribute("data-origin")),["proxy","key","autoplay","preload","subscribe","live","loop","debug","splash","poster","rtmpt"].forEach(function(e){p.hasOwnProperty(e)&&(S[e]=p[e]),i.hasOwnProperty(e)&&(S[e]=i[e]),(p.rtmp||{}).hasOwnProperty(e)&&(S[e]=(p.rtmp||{})[e]),(i.rtmp||{}).hasOwnProperty(e)&&(S[e]=(i.rtmp||{})[e])}),p.splash&&(S.autoplay=!0),p.rtmp&&(S.rtmp=p.rtmp.url||p.rtmp),i.rtmp&&(S.rtmp=i.rtmp.url||i.rtmp),Object.keys(i.flashls||{}).forEach(function(e){var t=i.flashls[e];S["hls_"+e]=t});var E=void 0!==i.hlsQualities?i.hlsQualities:p.hlsQualities;void 0!==E&&(S.hlsQualities=E?encodeURIComponent(JSON.stringify(E)):E),void 0!==p.bufferTime&&(S.bufferTime=p.bufferTime),void 0!==p.bufferTimeMax&&(S.bufferTimeMax=p.bufferTimeMax),b&&delete S.rtmp,S.rtmp&&(S.rtmp=v(S.rtmp));var D,N=p.bgcolor||o.css(t,"background-color")||"";0===N.indexOf("rgb")?D=function(e){function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}if(!(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/)))return;return"#"+t(e[1])+t(e[2])+t(e[3])}(N):0===N.indexOf("#")&&(D=7===(M=N).length?M:"#"+M.split("").slice(1).map(function(e){return e+e}).join("")),S.initialVolume=e.volumeLevel;var j=m(i)?p.swfHls:p.swf;f=a(j,S,p.wmode,D)[0];var L=o.find(".fp-player",t)[0];o.prepend(L,f),e.off("quality.flashengine").on("quality.flashengine",function(t,n,i){if(void 0!==e.video.hlsQualities?e.video.hlsQualities:e.conf.hlsQualities)try{f.__quality(i)}catch(t){e.debug("Error changing quality in flash engine",t)}}),setTimeout(function(){try{if(!f.PercentLoaded())return e.trigger("error",[e,{code:7,url:p.swf}])}catch(e){}},5e3),h.push(setTimeout(function(){void 0===f.PercentLoaded&&e.trigger("flashdisabled",[e])},15e3)),h.push(setTimeout(function(){void 0===f.PercentLoaded&&e.trigger("flashdisabled",[e,!1])},500)),e.off("resume.flashhack").on("resume.flashhack",function(){var t=setTimeout(function(){var t=f.__status().time,n=setTimeout(function(){e.playing&&!e.loading&&f.__status().time===t&&e.trigger("flashdisabled",[e])},400);h.push(n),e.one("seek.flashhack pause.flashhack load.flashack",function(){clearTimeout(n)})},800);h.push(t),e.one("progress",function(){clearTimeout(t)})}),f.pollInterval=setInterval(function(){if(f&&!d){var t=f.__status?f.__status():null;t&&((e.conf.live||e.live||i.live)&&(i.seekOffset=t.seekOffset,i.duration=t.duration+t.seekOffset),e.playing&&t.time&&t.time!==e.video.time&&e.trigger("progress",[e,t.time]),i.buffer=t.buffer/i.bytes*i.duration,e.trigger("buffer",[e,i.buffer]),!i.buffered&&t.time>0&&(i.buffered=!0,e.trigger("buffered",[e])))}},250),window[c]=function(i,r){var o=n;p.debug&&(0===i.indexOf("debug")&&r&&r.length?console.log.apply(console,["-- "+i].concat(r)):console.log("--",i,r));var a={type:i};switch(i){case"ready":r=s(o,r);break;case"click":a.flash=!0;break;case"keydown":a.which=r;break;case"seek":o.time=r;break;case"status":e.trigger("progress",[e,r.time]),r.buffer<o.bytes&&!o.buffered?(o.buffer=r.buffer/o.bytes*o.duration,e.trigger("buffer",o.buffer)):o.buffered||(o.buffered=!0,e.trigger("buffered"));break;case"metadata":var u=atob(r);r={key:u.substr(10,4),data:u.substr(21)}}"click"===i||"keydown"===i?(a.target=t,l.fire(t,i,[a])):"buffered"!=i&&"unload"!==i?setTimeout(function(){e.trigger(a,[e,r])},1):"unload"===i&&e.trigger(a,[e,r])}}},speed:o.noop,unload:function(){f&&f.__unload&&f.__unload();try{c&&window[c]&&delete window[c]}catch(e){}o.find("object",t).forEach(o.removeNode),f=0,e.off(".flashengine"),e.off(".flashhack"),clearInterval(f.pollInterval),h.forEach(function(e){clearTimeout(e)})}};function m(e){return/application\/x-mpegurl/i.test(e.type)}return["pause","resume","seek","volume"].forEach(function(t){g[t]=function(n){try{e.ready&&(void 0===n?f["__"+t]():f["__"+t](n))}catch(n){if(void 0===f["__"+t])return e.trigger("flashdisabled",[e]);throw n}}}),g}).engineName="flash",i.canPlay=function(e,t){return r.support.flashVideo&&/video\/(mp4|flash|flv)/i.test(e)||r.support.flashVideo&&t.swfHls&&/mpegurl/i.test(e)},r.engines.push(i)},{"../common":1,"../flowplayer":31,"./embed":2,bean:34,"extend-object":39}],4:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=r.support,a=r.common,s=r.bean,l=e("./html5-factory");function u(e){return void 0!==window.Hls&&(/mpegurl/.test(e)&&window.Hls.isSupported())}(i=function(e,t){var n,o,c=window.Hls;return l("hlsjs-lite",e,t,u,function(l,u,f){var d=r.extend({recoverMediaError:!0},e.conf.hlsjs,l.hlsjs);e.engine.hls&&e.engine.hls.destroy();var p,h,g=e.engine.hls=new c(d);i.extensions.forEach(function(n){n({hls:g,player:e,root:t,videoTag:u})}),g.loadSource(l.src),f.resume=function(){e.live&&!e.dvr&&(u.currentTime=g.liveSyncPosition||0),u.play()},f.seek=function(t){try{e.live||e.dvr?u.currentTime=Math.min(t,g.liveSyncPosition||u.duration-d.livePositionOffset):u.currentTime=t}catch(n){e.debug("Failed to seek to ",t,n)}},!1===d.bufferWhilePaused&&e.on("pause",function(){g.stopLoad(),e.one("resume",function(){g.startLoad()})}),e.on("quality",function(e,t,i){g.nextLevel=n=i});var m=function(n){if(e.debug("hlsjs - recovery"),a.removeClass(t,"is-paused"),a.addClass(t,"is-seeking"),s.one(u,"seeked",function(){u.paused&&(a.removeClass(t,"is-poster"),e.poster=!1,u.play()),a.removeClass(t,"is-seeking")}),n)return g.startLoad();var i=performance.now();!p||i-p>3e3?(p=performance.now(),g.recoverMediaError()):(!h||i-h>3e3)&&(h=performance.now(),g.swapAudioCodec(),g.recoverMediaError())};return g.on(c.Events.MANIFEST_PARSED,function(t,i){var r,s=l.hlsQualities||e.conf.hlsQualities,c={},f=i.levels;if(!1===s)return g.attachMedia(u);if("drive"===s)switch(f.length){case 4:r=[1,2,3];break;case 5:r=[1,2,3,4];break;case 6:r=[1,3,4,5];break;case 7:r=[1,3,5,6];break;case 8:r=[1,3,6,7];break;default:r=f.length<3||f[0].height&&f[2].height&&f[0].height===f[2].height?[]:[1,2]}if(l.qualities=[{value:-1,label:"Auto"}],Array.isArray(s)){var d=s.find(function(e){return-1===e||e.level&&-1===e.level});d?l.qualities[0].label="number"!=typeof d?d.label:l.qualities[0].label:l.qualities=[],r=s.map(function(e){return void 0!==e.level&&(c[e.level]=e.label),void 0!==e.level?e.level:e})}var p=-2;l.qualities=l.qualities.concat(f.map(function(e,t){if(r&&-1===r.indexOf(t))return!1;var i=c[t]||Math.min(e.width,e.height)+"p";return c[t]||"drive"===s||(i+=" ("+Math.round(e.bitrate/1e3)+"k)"),t===n&&(p=t),{value:t,label:i}})).filter(a.identity);var h=l.quality=-2===p?l.qualities[0].value||-1:p;h!==g.currentLevel&&(g.currentLevel=h),g.attachMedia(u),o&&l.src!==o&&u.play(),o=l.src}),g.on(c.Events.ERROR,function(t,n){if(n.fatal)if(d.recoverNetworkError&&n.type===c.ErrorTypes.NETWORK_E
4323RROR)m(!0);else if(d.recoverMediaError&&n.type===c.ErrorTypes.MEDIA_ERROR)m(!1);else{var i=5;n.type===c.ErrorTypes.NETWORK_ERROR&&(i=2),n.type===c.ErrorTypes.MEDIA_ERROR&&(i=3),g.destroy(),e.trigger("error",[e,{code:i}])}}),e.one("unload",function(){g.destroy()}),{handlers:{error:function(e,t){var n=t.error&&t.error.code;return d.recoverMediaError&&3===n||!n?(e.preventDefault(),m(!1),!0):d.recoverNetworkError&&2===n?(e.preventDefault(),m(!0),!0):void 0}}}})}).canPlay=function(e,t){return!(!1===t.hlsjs||t.clip&&!1===t.clip.hlsjs)&&(!(o.browser.safari&&!(t.clip&&t.clip.hlsjs||t.hlsjs||{}).safari)&&(r.support.video&&u(e)))},i.engineName="hlsjs-lite",i.plugin=function(e){i.extensions.push(e)},i.extensions=[],r.engines.push(i)},{"../flowplayer":31,"./html5-factory":5}],5:[function(e,t,n){var i=e("../flowplayer"),r=i.common,o=i.support,a=i.bean,s=i.extend,l=o.browser.safari&&!o.iOS,u={ended:"finish",pause:"pause",play:"resume",timeupdate:"progress",volumechange:"volume",ratechange:"speed",seeked:"seek",loadedmetadata:l?0:"ready",canplaythrough:l?"ready":0,durationchange:"ready",error:"error",dataunavailable:"error",webkitendfullscreen:!i.support.inlineVideo&&"unload",progress:"buffer"};function c(e,t){return t=t||100,Math.round(e*t)/t}t.exports=function(e,t,n,i,l){var f,d,p,h=r.findDirect("video",n)[0]||r.find(".fp-player > video",n)[0],g=t.conf;return p={engineName:e,pick:function(e){var t=o.video&&e.filter(function(e){return i(e.type)})[0];if(t)return"string"==typeof t.src&&(t.src=r.createAbsoluteUrl(t.src)),t},load:function(e){var f=r.find(".fp-player",n)[0],m=!1;if(h||(h=document.createElement("video"),r.prepend(f,h),h.autoplay=!!g.splash,m=!0),r.addClass(h,"fp-engine"),r.find("track",h).forEach(r.removeNode),h.preload="none",g.nativesubtitles||r.attr(h,"crossorigin",!1),g.disableInline||(h.setAttribute("webkit-playsinline","true"),h.setAttribute("playsinline","true")),o.inlineVideo||r.css(h,{position:"absolute",top:"-9999em"}),o.subtitles&&g.nativesubtitles&&e.subtitles&&e.subtitles.length){r.addClass(h,"native-subtitles");var v=e.subtitles,y=function(e){var t=h.textTracks;t.length&&(t[0].mode=e)};v.some(function(e){return!r.isSameDomain(e.src)})&&r.attr(h,"crossorigin","anonymous"),"function"==typeof h.textTracks.addEventListener&&h.textTracks.addEventListener("addtrack",function(){y("disabled"),y("showing")}),v.forEach(function(e){h.appendChild(r.createElement("track",{kind:"subtitles",srclang:e.srclang||"en",label:e.label||"en",src:e.src,default:e.default}))})}a.off(h,"timeupdate",r.noop),a.on(h,"timeupdate",r.noop),r.prop(h,"loop",!1),t.off(".loophack"),(e.loop||g.loop)&&t.on("finish.loophack",function(){t.resume()}),void 0!==d&&(h.volume=d);var w=l(e,h,p);if(g.autoplay||g.splash||e.autoplay){t.debug("Autoplay / Splash setup, try to start video"),h.load();var b=function(){try{var e=h.play();if(e&&e.catch){var n=function(e){if("AbortError"===e.name&&20===e.code)return m?void 0:h.play().catch(n);if(!g.mutedAutoplay)throw new Error("Unable to autoplay");return t.debug("Play errored, trying muted",e),t.mute(!0,!0),h.play()};e.catch(n).catch(function(){g.autoplay=!1,t.mute(!1,!0),t.trigger("stop",[t])})}}catch(e){t.debug("play() error thrown",e)}};h.readyState>0?b():a.one(h,"canplay",b)}if(p._listeners=function(e,l,f,d){var p=n.getAttribute("data-flowplayer-instance-id");if(!e.listeners||!e.listeners.hasOwnProperty(p)){(e.listeners||(e.listeners={}))[p]=f,a.on(l,"error",function(n){try{i(n.target.getAttribute("type"))&&t.trigger("error",[t,{code:4,video:s(f,{src:e.src,url:e.src})}])}catch(e){}}),t.on("shutdown",function(){a.off(l),a.off(e,".dvrhack"),t.off(".loophack")});var h={},g=function(e){"metadata"===e.kind&&(e.mode="hidden",e.addEventListener("cuechange",function(){e.activeCues.length&&t.trigger("metadata",[t,e.activeCues[0].value])},!1))};return e&&e.textTracks&&e.textTracks.length&&Array.prototype.forEach.call(e.textTracks,g),e&&e.textTracks&&"function"==typeof e.textTracks.addEventListener&&e.textTracks.addEventListener("addtrack",function(e){g(e.track)},!1),(t.conf.dvr||t.dvr||f.dvr)&&a.on(e,"progress.dvrhack",function(){e.seekable.length&&(t.video.duration=e.seekable.end(null),t.video.seekOffset=e.seekable.start(null),t.trigger("dvrwindow",[t,{start:e.seekable.start(null),end:e.seekable.end(null)}]),e.currentTime>=e.seekable.start(null)||(e.currentTime=e.seekable.start(null)))}),Object.keys(u).forEach(function(i){var a=u[i];if("webkitendfullscreen"===i&&t.conf.disableInline&&(a="unload"),a){var l=function(l){if(f=e.listeners[p],l.target&&r.hasClass(l.target,"fp-engine")){/progress/.test(a)||t.debug(i,"->",a,l);var u,h=function(e){t.trigger(e||a,[t,u])};if((t.ready||/ready|error/.test(a))&&a&&r.find("video",n).length)if("unload"!==a){switch(a){case"ready":if(t.ready)return t.debug("Player already ready, not sending duplicate ready event");
4323if(!(e.duration&&e.duration!==1/0||t.live))return t.debug("No duration and VOD setup, not sending ready event");if((u=s(f,{duration:e.duration<Number.MAX_VALUE?e.duration:0,width:e.videoWidth,height:e.videoHeight,url:e.currentSrc})).seekable=u.duration,t.debug("Ready: ",u),!t.live&&!u.duration&&!o.hlsDuration&&"loadeddata"===i){var g=function(){u.duration=e.duration;try{u.seekable=e.seekable&&e.seekable.end(null)}catch(e){}h(),e.removeEventListener("durationchange",g),r.toggleClass(n,"is-live",!1)};e.addEventListener("durationchange",g);var m=function(){t.ready||e.duration||(u.duration=0,r.addClass(n,"is-live"),h()),e.removeEventListener("timeupdate",m)};return void e.addEventListener("timeupdate",m)}break;case"progress":case"seek":if(e.currentTime>0||t.live)u=Math.max(e.currentTime,0);else if("seek"===a&&0===e.currentTime)u=0;else if("progress"==a)return;break;case"buffer":u=[];for(var v=0;v<e.buffered.length;v++)u.push({start:e.buffered.start(v),end:e.buffered.end(v)});e.buffered.length&&e.buffered.end(null)===e.duration&&h("buffered");break;case"speed":u=c(e.playbackRate);break;case"volume":u=c(e.muted?0:e.volume);break;case"error":try{if(d&&d.handlers&&d.handlers.error&&d.handlers.error(l,e))return;(u=(l.srcElement||l.originalTarget).error).video=s(f,{src:e.src,url:e.src})}catch(e){return}}h()}else t.unload();else"resume"===a&&t.one("ready",function(){setTimeout(function(){h()})})}};n.addEventListener(i,l,!0),h[i]||(h[i]=[]),h[i].push(l)}}),h}e.listeners[p]=f}(h,r.find("source",h).concat(h),e,w)||p._listeners,!(g.autoplay||g.splash||e.autoplay)){var I=function(){var e;(e=n.getBoundingClientRect()).top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)+e.height&&e.right<=(window.innerWidth||document.documentElement.clientWidth)+e.width&&(t.debug("player is in viewport, preload"),o.preloadMetadata?h.preload="metadata":h.load(),a.off(document,"scroll.preloadviewport"))};a.off(document,"scroll.preloadviewport"),a.on(document,"scroll.preloadviewport",function(){window.requestAnimationFrame(I)}),I()}},mute:function(e){h.muted=!!e,t.trigger("mute",[t,e]),t.trigger("volume",[t,e?0:h.volume])},pause:function(){h.pause()},resume:function(){h.play()},speed:function(e){h.playbackRate=e},seek:function(e){var n=h.paused||t.finished;try{h.currentTime=e,n&&a.one(h,"seeked",function(){h.pause()})}catch(e){}},volume:function(e){d=e,h&&(h.volume=e,e&&p.mute(!1))},unload:function(){a.off(document,"scroll.preloadviewport"),r.find("video.fp-engine",n).forEach(function(e){"MediaSource"in window?e.src=URL.createObjectURL(new MediaSource):e.src="",r.removeNode(e)}),f=clearInterval(f);var e=n.getAttribute("data-flowplayer-instance-id");delete h.listeners[e],h=0,p._listeners&&Object.keys(p._listeners).forEach(function(e){p._listeners[e].forEach(function(t){n.removeEventListener(e,t,!0)})})}}}},{"../flowplayer":31}],6:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=r.common,a=e("./html5-factory"),s=document.createElement("video");function l(e){var t;return/^(video|application)/i.test(e)||(e=/mpegurl/i.test(t=e)?"application/x-mpegurl":t),!!s.canPlayType(e).replace("no","")}(i=function(e,t){return a("html5",e,t,l,function(e,t){t.currentSrc!==e.src?(o.find("source",t).forEach(o.removeNode),t.src=e.src,t.type=e.type):e.autoplay&&t.load()})}).canPlay=function(e){return r.support.video&&l(e)},i.engineName="html5",r.engines.push(i)},{"../flowplayer":31,"./html5-factory":5}],7:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){e.on("ready",function(){var e=r.find("video.fp-engine",t)[0];e&&(e.setAttribute("x-webkit-airplay","allow"),window.WebKitPlaybackTargetAvailabilityEvent&&(e.addEventListener("webkitplaybacktargetavailabilitychanged",function(e){if("available"===e.availability){var n=r.find(".fp-header",t)[0];r.find(".fp-airplay",n).forEach(r.removeNode);var i=r.createElement("a",{class:"fp-airplay fp-icon",title:"Play on AirPlay device"});n.insertBefore(i,r.find(".fp-fullscreen",n)[0])}}),e.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",function(){var n=r.find(".fp-airplay",t)[0];n&&r.toggleClass(n,"fp-active",e.webkitCurrentPlaybackTargetIsWireless)})))}),o.on(t,"click",".fp-airplay",function(e){e.preventDefault(),r.find("video.fp-engine",t)[0].webkitShowPlaybackTargetPicker()})})},{"../common":1,"../flowplayer":31,bean:34}],8:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("./resolve").TYPE_RE,o=e("scriptjs"),a=e("bean");i(function(e,t){var n,i=e.conf.analytics,s=0,l=0;if(i){"undefined"==typeof _gat&&o("//google-analytics.com/ga.js");var u=function(){var e=_gat._getTracker(i);return e._setAllowLinker(!0),e},c=function(i,o,a){(a=a||e.video,s&&"undefined"!=typeof _gat)&&(u()._trackEvent("Video / Seconds played",e.engine.engineName+"/"+a.type,a.title||t.getAttribute("title")||a.src.split("/").slice(-1)[0].replace(r,""),Math.round(s/1e3)),s=0,n&&(clearTimeout(n),n=null))};e.bind("load unload",c).bind("progress",function(){e.seeking||(s+=l?+new Date-l:0,l=+new Date),n||(n=setTimeout(function(){n=null,u()._trackEvent("Flowplayer heartbeat","Heartbeat","",0,!0)},6e5))}).bind("pause",function(){l=0}),e.bind("shutdown",function(){a.off(window,"unload",c)}),a.on(window,"unload",c)}})},{"../flowplayer":31,"./resolve":21,bean:34,scriptjs:45}],9:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean"),a=e("scriptjs");i(function(e,t){if(!1!==e.conf.chromecast){a("https://www.gstatic.
4323com/cv/js/sender/v1/cast_sender.js"),window.__onGCastApiAvailable=function(e){var t,n,i;e&&(t=l.applicationId||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,n=new chrome.cast.SessionRequest(t),i=new chrome.cast.ApiConfig(n,u,c),chrome.cast.initialize(i,f,d))};var n,i,s,l=e.conf.chromecast||{};o.on(t,"click",".fp-chromecast",function(o){if(o.preventDefault(),n)return e.trigger("pause",[e]),n.stop(),n=null,void p();e.playing&&e.pause(),chrome.cast.requestSession(function(o){var a=(n=o).receiver.friendlyName;r.html(r.find(".fp-chromecast-engine-status")[0],"Playing on device "+a);var l=new chrome.cast.media.MediaInfo(e.video.src),u=new chrome.cast.media.LoadRequest(l);n.loadMedia(u,function(o){o.addUpdateListener(function(a){if(n){i=i||setInterval(function(){e.trigger("progress",[e,o.getEstimatedTime()])},500),a?(r.toggleClass(t,"is-chromecast",!0),r.toggleClass(s,"fp-active",!0),e.hijack({pause:function(){o.pause()},resume:function(){o.play()},seek:function(e){var t=new chrome.cast.media.SeekRequest;t.currentTime=e,o.seek(t)}})):(p(),e.trigger("finish",[e]));var l=o.playerState;e.paused&&l===chrome.cast.media.PlayerState.PLAYING&&e.trigger("resume",[e]),e.playing&&l===chrome.cast.media.PlayerState.PAUSED&&e.trigger("pause",[e]),r.toggleClass(t,"is-loading",l===chrome.cast.media.PlayerState.BUFFERING)}})},function(){})},function(e){console.error("requestSession error",e)})})}function u(){console.log("sessionListener")}function c(e){e===chrome.cast.ReceiverAvailability.AVAILABLE&&function(){var e=r.find(".fp-header",t)[0];if(!e)return;r.find(".fp-chromecast",e).forEach(r.removeNode),r.find(".fp-chromecast-engine",t).forEach(r.removeNode),s=r.createElement("a",{class:"fp-chromecast fp-icon",title:"Play on Cast device"}),e.insertBefore(s,r.find(".fp-fullscreen",e)[0]);var n=r.createElement("div",{class:"fp-chromecast-engine"}),i=r.createElement("p",{class:"fp-chromecast-engine-status"}),o=r.createElement("p",{class:"fp-chromecast-engine-icon"});n.appendChild(o),n.appendChild(i);var a=r.find(".fp-engine",t)[0];
4323a?a.parentNode.insertBefore(n,a):r.prepend(r.find(".fp-player",t)[0]||t,n)}()}function f(){}function d(){console.log("onError")}function p(){clearInterval(i),i=null,e.release(),r.toggleClass(t,"is-chromecast",!1),r.toggleClass(s,"fp-active",!1)}})},{"../common":1,"../flowplayer":31,bean:34,scriptjs:45}],10:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){var n=/ ?cue\d+ ?/,i=!1;function a(e){t.className=t.className.replace(n," "),e>=0&&r.addClass(t,"cue"+e)}var s={},l=-.125,u=function(t){a(t.index),e.trigger("cuepoint",[e,t])};function c(t){var n=t&&!isNaN(t.time)?t.time:t;return n<0&&(n=e.video.duration+n),.125*Math.round(n/.125)}e.on("progress",function(e,t,n){if(!i)for(var r=c(n);l<r;)s[l+=.125]&&s[l].forEach(u)}).on("unload",a).on("beforeseek",function(e){setTimeout(function(){e.defaultPrevented||(i=!0)})}).on("seek",function(e,t,n){a(),l=c(n||0)-.125,i=!1,!n&&s[0]&&s[0].forEach(u)}).on("ready",function(t,n,i){l=-.125;var r=i.cuepoints||e.conf.cuepoints||[];e.setCuepoints(r)}).on("finish",function(){for(var t=c(e.video.duration);l<t;)s[l+=.125]&&s[l].forEach(u);l=-.125}),e.conf.generate_cuepoints&&e.bind("load",function(){r.find(".fp-cuepoint",t).forEach(r.removeNode)}),e.setCuepoints=function(t){return e.cuepoints=[],s={},t.forEach(e.addCuepoint),e},e.addCuepoint=function(n){e.cuepoints||(e.cuepoints=[]),"number"==typeof n&&(n={time:n}),n.index=0;var i=c(n);if(s[i]||(s[i]=[]),s[i].push(n),e.cuepoints.length&&(n.index=Math.max.apply(null,e.cuepoints.map(function(e){return e.index}))+1),e.cuepoints.push(n),e.conf.generate_cuepoints&&!1!==n.visible){var a=e.video.duration,l=r.find(".fp-timeline",t)[0];r.css(l,"overflow","visible");var u=n.time||n;u<0&&(u=a+u);var f=r.createElement("a",{className:"fp-cuepoint fp-cuepoint"+n.index});r.css(f,"left",u/a*100+"%"),l.appendChild(f),o.on(f,"mousedown",function(t){t.preventDefault(),t.stopPropagation(),e.seek(u)})}return e},e.removeCuepoint=function(n){"number"==typeof n&&(n=e.cuepoints.filter(function(e){return e.index===n})[0]);var i=e.cuepoints.indexOf(n),o=c(n);if(-1!==i){e.cuepoints=e.cuepoints.slice(0,i).concat(e.cuepoints.slice(i+1));var a=r.find(".fp-timeline",t)[0];r.find(".fp-cuepoint"+n.index,a).forEach(r.removeNode);var l=s[o].indexOf(n);if(-1!==l)return s[o]=s[o].slice(0,l).concat(s[o].slice(l+1)),e}}})},{"../common":1,"../flowplayer":31,bean:34}],11:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("bean"),o=e("../common"),a=e("./util/clipboard");i(function(e,t){if(!1!==e.conf.embed&&!1!==e.conf.share){var n=o.find(".fp-share-menu",t)[0],i=o.createElement("a",{class:"fp-icon fp-embed",title:"Copy to your site"},"Embed");o.append(n,i),e.embedCode=function(){var n=e.conf.embed||{},i=e.video,r=n.width||i.width||o.width(t),a=n.height||i.height||o.height(t),s=e.conf.ratio,l='<iframe src="'+e.shareUrl(!0)+'" allowfullscreen style="border:none;';return n.width||n.height?(isNaN(r)||(r+="px"),isNaN(a)||(a+="px"),l+"width:"+r+";height:"+a+';"></iframe>'):(s&&!e.conf.adaptiveRatio||(s=a/r),'<div style="position:relative;width:100%;display:inline-block;">'+l+'position:absolute;top:0;left:0;width:100%;height:100%;"></iframe><div style="padding-top:'+100*s+'%;"></div></div>')},r.on(t,"click",".fp-embed",function(){a(e.embedCode(),function(){e.message("The embed code is now on your clipboard",2e3)},function(){e.textarea(e.embedCode(),"Copy the code below to embed your video")})})}})},{"../common":1,"../flowplayer":31,"./util/clipboard":30,bean:34}],12:[function(e,t,n){"use strict";t.exports=function(e,t){t||(t=document.createElement("div"));var n={},i={},r=function(e,r,o){var a=e.split(".")[0],s=function(l){o&&(t.removeEventListener(a,s),n[e].splice(n[e].indexOf(s),1));var u=[l].concat(i[l.timeStamp+l.type]||[]);r&&r.apply(void 0,u)};t.addEventListener(a,s),n[e]||(n[e]=[]),n[e].push(s)};e.on=e.bind=function(t,n){return t.split(" ").forEach(function(e){r(e,n)}),e},e.one=function(t,n){return t.split(" ").forEach(function(e){r(e,n,!0)}),e};e.off=e.unbind=function(i){return i.split(" ").forEach(function(e){var i=e.split(".").slice(1),r=e.split(".")[0];Object.keys(n).filter(function(e){var t,n=e.split(".").slice(1);return(!r||0===e.indexOf(r))&&(t=n,0===i.filter(function(e){return-1===t.indexOf(e)}).length)}
4323).forEach(function(e){var i=n[e],r=e.split(".")[0];n[e]=i.filter(function(e){return t.removeEventListener(r,e),!1})})}),e},e.trigger=function(n,r,o){if(n){r=(r||[]).length?r||[]:[r];var a,s=document.createEvent("Event");return a=n.type||n,s.initEvent(a,!1,!0),Object.defineProperty&&(s.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}),i[s.timeStamp+s.type]=r,t.dispatchEvent(s),o?s:e}}},t.exports.EVENTS=["beforeseek","disable","error","finish","fullscreen","fullscreen-exit","load","mute","pause","progress","ready","resume","seek","speed","stop","unload","volume","boot","shutdown"]},{}],13:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){var n=e.conf;if(!1!==n.share&&n.facebook){e.facebook=function(){var e,t,i=screen.height,r=screen.width,o="string"==typeof n.facebook?n.facebook:window.location.toString();e=Math.round(r/2-275),t=0,i>420&&(t=Math.round(i/2-210)),window.open("https://www.facebook.com/sharer.php?s=100&p[url]="+encodeURIComponent(o),"sharer","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+e+",top="+t)};var i=r.find(".fp-share-menu",t)[0],a=r.createElement("a",{class:"fp-icon fp-facebook"},"Facebook");r.append(i,a),o.on(t,"click",".fp-facebook",function(){e.facebook()})}})},{"../common":1,"../flowplayer":31,bean:34}],14:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=e("bean"),a=e("../common"),s="fullscreen",l="fullscreen-exit",u=r.support.fullscreen;o.on(document,"fullscreenchange.ffscr webkitfullscreenchange.ffscr mozfullscreenchange.ffscr MSFullscreenChange.ffscr",function(e){var t=document.webkitCurrentFullScreenElement||document.mozFullScreenElement||document.fullscreenElement||document.msFullscreenElement||e.target;if(i||t.parentNode&&t.parentNode.getAttribute("data-flowplayer-instance-id")){var n=i||r(t.parentNode);t&&!i?i=n.trigger(s,[n]):(i.trigger(l,[i]),i=null)}}),r(function(e,t){var n=a.createElement("div",{className:"fp-player"});if(Array.prototype.map.call(t.children,a.identity).forEach(function(e){a.matches(e,".fp-ratio,script")||n.appendChild(e)}),t.appendChild(n),e.conf.fullscreen){var r,o,c,f=window;e.isFullscreen=!1,e.fullscreen=function(t){if(!e.disabled)return void 0===t&&(t=!e.isFullscreen),t&&(r=f.scrollY,o=f.scrollX),u?t?["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].forEach(function(e){"function"==typeof n[e]&&(n[e](Element.ALLOW_KEYBOARD_INPUT),"webkitRequestFullScreen"!==e||document.webkitFullscreenElement||n[e]())}):["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].forEach(function(e){"function"==typeof document[e]&&document[e]()}):e.trigger(t?s:l,[e]),e},e.on("mousedown.fs",function(){+new Date-c<150&&e.ready&&e.fullscreen(),c=+new Date}),e.on(s,function(){a.addClass(t,"is-fullscreen"),a.toggleClass(t,"fp-minimal-fullscreen",a.hasClass(t,"fp-minimal")),a.removeClass(t,"fp-minimal"),u||a.css(t,"position","fixed"),e.isFullscreen=!0}).on(l,function(){var n;a.toggleClass(t,"fp-minimal",a.hasClass(t,"fp-minimal-fullscreen")),a.removeClass(t,"fp-minimal-fullscreen"),u||"html5"!==e.engine||(n=t.css("opacity")||"",a.css(t,"opacity",0)),u||a.css(t,"position",""),a.removeClass(t,"is-fullscreen"),u||"html5"!==e.engine||setTimeout(function(){t.css("opacity",n)}),e.isFullscreen=!1,f.scrollTo(o,r)}).on("unload",function(){e.isFullscreen&&e.fullscreen()}),e.on("shutdown",function(){i=null,a.removeNode(n)})}})},{"../common":1,"../flowplayer":31,bean:34}],15:[function(e,t,n){"use strict";var i,r,o=e("../flowplayer"),a=e("bean"),s=e("../common");a.on(document,"keydown.fp",function(e){var t=i,n=e.ctrlKey||e.metaKey||e.altKey,r=e.which,o=t&&t.conf;if(t&&o.keyboard&&!t.disabled&&!n&&t.ready){if(e.shiftKey)return 39==r?t.speed(!0):37==r&&t.speed(!1),e.preventDefault();if(r<58&&r>47)return e.preventDefault(),t.seekTo(r-48);(function(){switch(r){case 38:case 75:return t.volume(t.volumeLevel+.15),!0;case 40:case 74:return t.volume(t.volumeLevel-.15),!0;case 39:case 76:return t.seeking=!0,t.seek(!0),!0;case 37:case 72:return t.seeking=!0,t.seek(!1),!0;case 190:return t.seekTo(),!0;
4323case 32:return t.toggle(),!0;case 70:return o.fullscreen&&t.fullscreen(),!0;case 77:return t.mute(),!0;case 81:return t.unload(),!0}})()&&e.preventDefault()}}),o(function(e,t){e.conf.keyboard&&(a.on(document,"click",function(n){if(s.hasParent(n.target,t))i=e.disabled?0:e;else{if(i!==e)return;i=0}i&&(r=t)}),e.bind("shutdown",function(){r==t&&(r=null)}))})},{"../common":1,"../flowplayer":31,bean:34}],16:[function(e,t,n){var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){e.showMenu=function(n,i){var a=r.find(".fp-ui",t)[0];r.toggleClass(n,"fp-active",!0),setTimeout(function(){o.one(document,"click",function(){e.hideMenu(n)})});var s=i;if(i&&i.tagName&&(s={left:r.offset(i).left,rightFallbackOffset:r.width(i),top:r.offset(i).top+r.height(i)}),!s)return r.css(n,"top","auto");s.rightFallbackOffset=s.rightFallbackOffset||0;var l=s.top-r.offset(a).top,u=s.left-r.offset(a).left;r.width(n)+u>r.width(a)&&(u=u-r.width(n)+s.rightFallbackOffset),r.height(n)+l>r.height(a)&&(l-=r.height(n)),r.css(n,{top:l+"px",left:u+"px",right:"auto"})},e.hideMenu=function(e){r.toggleClass(e,"fp-active",!1),r.css(e,{top:"-9999em"})}})},{"../common":1,"../flowplayer":31,bean:34}],17:[function(e,t,n){var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){var n=r.find(".fp-header",t)[0],i=r.find(".fp-ui",t)[0];e.message=function(e,t){var o,a,s=(o=e,a=r.createElement("div",{className:"fp-message"},o),i.insertBefore(a,n),setTimeout(function(){r.toggleClass(a,"fp-shown")}),a),l=function(){r.toggleClass(s,"fp-shown"),setTimeout(function(){var e;e=s,r.removeNode(e)},500)};return t&&setTimeout(l,t),l},e.textarea=function(e){var t=document.createElement("textarea");t.value=e,t.className="fp-textarea",i.appendChild(t),o.on(document,"click.fptextarea",function(e){if(e.target===t)return t.select();e.stopPropagation(),e.preventDefault(),r.removeNode(t),o.off(document,"click.fptextarea")})}})},{"../common":1,"../flowplayer":31,bean:34}],18:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=/IEMobile/.test(window.navigator.userAgent),o=e("../common"),a=e("bean"),s=e("./ui").format,l=i.support,u=window.navigator.userAgent;(l.touch||r)&&i(function(e,t){var n=l.android,i=n&&!n.firefox,c=/Silk/.test(u),f=n.version||0;if(i&&!r){if(!/Chrome/.test(u)&&f<4||n.samsung&&f<5){var d=e.load;e.load=function(){var n=d.apply(e,arguments);return o.find("video.fp-engine",t)[0].load(),e.trigger("ready",[e,e.video]),n}}var p,h=0,g=function(e){p=setInterval(function(){e.video.time=++h,e.trigger("progress",[e,h])},1e3)};e.on("ready pause unload",function(){p&&(clearInterval(p),p=null)}),e.on("ready",function(){h=0}),e.on("resume",function(t,n){if(n.live)return h?g(n):void e.one("progress",function(e,t,n){0===n&&g(t)})})}l.volume||(o.removeClass(t,"fp-mute"),o.addClass(t,"no-volume")),l.iOS&&o.addClass(t,"fp-mute"),o.addClass(t,"is-touch"),e.sliders&&e.sliders.timeline&&e.sliders.timeline.disableAnimation();var m=!1;a.on(t,"touchmove",function(){m=!0});var v=!0;if(a.on(t,"touchend click",function(n){if(m)m=!1;else{var i=o.find("video.fp-engine",t)[0];if(v&&e.conf.clickToUnMute&&i&&i.muted&&e.conf.autoplay&&(i.muted=!1),v=!1,e.playing&&!o.hasClass(t,"is-mouseover"))return o.addClass(t,"is-mouseover"),o.removeClass(t,"is-mouseout"),n.preventDefault(),void n.stopPropagation();e.playing||e.splash||!o.hasClass(t,"is-mouseout")||o.hasClass(t,"is-mouseover")||setTimeout(function(){e.disabled||e.playing||e.splash||o.find("video.fp-engine",t)[0].play()},400)}}),!l.fullscreen&&e.conf.native_fullscreen&&"function"==typeof o.createElement("video").webkitEnterFullScreen){var y=e.fullscreen;e.fullscreen=function(){var n=o.find("video.fp-engine",t)[0];if(!n)return y.apply(e);e.trigger("fullscreen",[e]),a.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement===n&&(a.off(document,".nativefullscreen"),a.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement||(a.off(document,".nativefullscreen"),e.trigger("fullscreen-exit",[e]))}))}),n.webkitEnterFullScreen(),a.one(n,"webkitendfullscreen",function(){a.off(document,"fullscreenchange.nativefullscreen"),e.trigger("fullscreen-exit",[e]),o.prop(n,"controls",!0),o.prop(n,"controls",!1)})}}(i||c)&&e.bind("ready",function(){var n=o.find("video.fp-engine",t)[0];e.conf.splash&&n.paused&&"hlsjs-lite"!==e.engine.engineName&&(a.one(n,"canplay",function(){n.play()}),n.load()),e.bind("progress.dur",function(){if(!e.live&&!e.conf.live){var i=n.duration;1!==i&&(e.video.duration=i,o.find(".fp-duration",t)[0].innerHTML=s(i),e.unbind("progress.dur"))}})})})},{"../common":1,"../flowplayer":31,"./ui":27,bean:34}],19:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("extend-object"),o=e("bean"),a=e("../common"),s=e("./resolve"),l=new s,u=window.jQuery,c=/^#/;i(function(e,t){var n=r({active:"is-active",advance:!0,query:".fp-playlist a"},e.conf),i=n.active,f=a.find(".fp-ui",t)[0],d=a.hasClass(t,"fp-custom-playlist")||!!n.customPlaylist;function p(){return a.find(n.query,h())}function h(){if(!c.test(n.query))return t}function g(){return a.find(n.query+"."+i,h())}function m(){var n=a.find(".fp-playlist",t)[0];if(!n){n=a.createElement("div",{className:"fp-playlist"});var r=a.find(".fp-next,.fp-prev",t);r.length?r[0].parentElement.insertBefore(n,r[0]):a.insertAfter(t,a.find("video",t)[0],n)}n.innerHTML="",e.conf.playlist[0].length&&(e.conf.playlist=e.conf.playlist.map(function(e){if("string"==typeof e){var t=e.split(s.TYPE_RE)[1];
4323return{sources:[{type:"m3u8"===t.toLowerCase()?"application/x-mpegurl":"video/"+t,src:e}]}}return{sources:e.map(function(e){var t={};return Object.keys(e).forEach(function(n){t.type=/mpegurl/i.test(n)?"application/x-mpegurl":"video/"+n,t.src=e[n]}),t})}})),e.conf.playlist.forEach(function(t,r){var o=t.sources[0].src;n.appendChild(a.createElement("a",{href:o,className:e.video.index===r?i:void 0,"data-index":r}))})}a.toggleClass(t,"fp-custom-playlist",d),a.toggleClass(t,"fp-default-playlist",!d),e.play=function(t){if(void 0===t)return e.resume();if("number"==typeof t&&!e.conf.playlist[t])return e;if("number"!=typeof t)return e.load.apply(null,arguments);var n=r({index:t},e.conf.playlist[t]);return e.off("beforeresume.fromfirst"),"number"==typeof t&&t===e.video.index?e.seek(0,function(){e.resume()}):(e.load(n,function(){e.video.index=t}),e)},e.next=function(t){t&&t.preventDefault();var n=e.video.index;return-1!=n&&(n=n===e.conf.playlist.length-1?0:n+1,e.play(n)),e},e.prev=function(t){t&&t.preventDefault();var n=e.video.index;return-1!=n&&(n=0===n?e.conf.playlist.length-1:n-1,e.play(n)),e},e.setPlaylist=function(t,n){return e.conf.playlist=t,n||delete e.video.index,m(),e},e.addPlaylistItem=function(t){return delete e.video.is_last,e.setPlaylist(e.conf.playlist.concat([t]),!0)},e.removePlaylistItem=function(t){var n=e.conf.playlist;return e.setPlaylist(n.slice(0,t).concat(n.slice(t+1)))},o.on(t,"click",".fp-next",e.next),o.on(t,"click",".fp-prev",e.prev),e.off("finish.pl").on("finish.pl",function(e,i){if(void 0===i.conf.advance||i.conf.advance){if(i.video.loop)return i.seek(0,function(){i.resume()});var r=i.video.index>=0?i.video.index+1:void 0;r<i.conf.playlist.length||n.loop?(r=r===i.conf.playlist.length?0:r,a.removeClass(t,"is-finished"),setTimeout(function(){i.play(r)})):i.conf.playlist.length>1&&(i.one("beforeresume.fromfirst",function(e){e.preventDefault(),i.play(0)}),i.one("seek",function(){i.off("beforeresume.fromfirst")}))}});var v=!1;e.conf.playlist.length&&(v=!0,m(),e.conf.clip&&e.conf.clip.sources.length||(e.conf.clip=e.conf.playlist[e.conf.startIndex||
43230])),p().length&&!v&&(e.conf.playlist=[],delete e.conf.startIndex,p().forEach(function(t){var n=t.href;t.setAttribute("data-index",e.conf.playlist.length);var i=l.resolve(n,e.conf.clip.sources);u&&r(i,u(t).data()),e.conf.playlist.push(i)})),a.find(".fp-prev,.fp-next,.fp-playlist",t).forEach(function(e){f.appendChild(e)}),o.on(c.test(n.query)?document:t,"click",n.query,function(t){t.preventDefault();var n=t.currentTarget,i=Number(n.getAttribute("data-index"));-1!=i&&e.play(i)}),e.on("load",function(r,o,s){if(e.conf.playlist.length){var l,u=g()[0],c=u&&u.getAttribute("data-index"),f=s.index=void 0!==(l=s).index?l.index:void 0!==e.video.index?e.video.index:e.conf.startIndex||0,d=a.find(n.query+'[data-index="'+f+'"]',h())[0],p=f==e.conf.playlist.length-1;u&&a.removeClass(u,i),d&&a.addClass(d,i),a.removeClass(t,"video"+c),a.addClass(t,"video"+f),a.toggleClass(t,"last-video",p),s.index=o.video.index=f,s.is_last=o.video.is_last=p}}).on("unload.pl",function(){e.conf.playlist.length&&(g().forEach(function(e){a.toggleClass(e,i)}),e.conf.playlist.forEach(function(e,n){a.removeClass(t,"video"+n)}),delete e.video.index)}),e.conf.playlist.length&&(e.conf.loop=!1)})},{"../common":1,"../flowplayer":31,"./resolve":21,bean:34,"extend-object":39}],20:[function(e,t,n){var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){var n=r.find(".fp-ui",t)[0],i=r.find(".fp-controls",n)[0];function a(e){r.find(".fp-qsel-menu a",t).forEach(function(t){r.toggleClass(t,"fp-selected",t.getAttribute("data-quality")==e),r.toggleClass(t,"fp-color",t.getAttribute("data-quality")==e)})}o.on(t,"click",".fp-qsel",function(){var n=r.find(".fp-qsel-menu",t)[0];r.hasClass(n,"fp-active")?e.hideMenu():e.showMenu(n)}),o.on(t,"click",".fp-qsel-menu a",function(t){var n=t.target.getAttribute("data-quality");e.quality(n)}),e.quality=function(t){t=isNaN(Number(t))?t:Number(t),e.trigger("quality",[e,t])},e.on("quality",function(e,t,n){a(n,t.video.qualities)}),e.on("ready",function(e,o,s){r.find(".fp-qsel-menu",t).forEach(r.removeNode),r.find(".fp-qsel",t).forEach(r.removeNode),!s.qualities||s.qualities.filter(function(e){return void 0===e.value||e.value>-1}).length<2||(!function(e){i.appendChild(r.createElement("strong",{className:"fp-qsel"},"HD"));var t=r.createElement("div",{className:"fp-menu fp-qsel-menu"},"<strong>Quality</strong>");e.forEach(function(e){var n=document.createElement("a"),i=void 0!==e.value?e.value:e;n.setAttribute("data-quality",i),n.innerHTML=e.label||e,t.appendChild(n)}),n.appendChild(t)}(s.qualities,s.quality),a(s.quality,s.qualities))})})},{"../common":1,"../flowplayer":31,bean:34}],21:[function(e,t,n){"use strict";var i=/\.(\w{3,4})(\?.*)?$/i,r=e("extend-object");function o(e){var t=e.attr("src"),n=e.attr("type")||"",o=t.split(i)[1];return n=n.toLowerCase(),r(e.data(),{src:t,suffix:o||n,type:n||o})}t.exports=function(){this.sourcesFromVideoTag=function(e,t){var n=[];return t("source",e).each(function(){n.push(o(t(this)))}),!n.length&&e.length&&n.push(o(e)),n},this.resolve=function(e,t){return e?("string"==typeof e&&((e={src:e,sources:[]}).sources=(t||[]).map(function(t){var n=t.src.split(i)[1];return{type:t.type,src:e.src.replace(i,"."+n+"$2")}})),e instanceof Array&&(e={sources:e.map(function(e){return e.type&&e.src?e:Object.keys(e).reduce(function(t,n){return r(t,{type:(i=n,/mpegurl/i.test(i)?"application/x-mpegurl":"video/"+i),src:e[n]});var i},{})})}),e):{sources:t}}},t.exports.TYPE_RE=i},{"extend-object":39}],22:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("extend-object"),a=e("bean");i(function(e,t){var n=e.conf;if(!1!==n.share){e.shareUrl=function(t){if(t&&n.embed&&n.embed.iframe)return n.embed.iframe;if("string"==typeof e.conf.share)return e.conf.share;var i=encodeURIComponent(e.video.title||(r.find("title")[0]||{}).innerHTML||"Flowplayer video"),a=encodeURIComponent(btoa(JSON.stringify(o({},e.conf,e.extensions)).replace(/[\u007F-\uFFFF]/g,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).substr(-4)}))),s=encodeURIComponent(window.location.toString());return(t?"https://flowplayer.com/e/":"https://flowplayer.com/s/")+"?t="+i+"&c="+a+"&r="+s};var i=r.createElement("div",{className:"fp-menu fp-share-menu"},"<strong>Share</strong>");r.find(".fp-ui",t)[0].appendChild(i);var s=r.find(".fp-share",t)[0];a.on(t,"click",".fp-share",function(t){t.preventDefault(),r.hasClass(i,"fp-active")?e.hideMenu():e.showMenu(i,s)})}
4323else r.find(".fp-share",t).forEach(r.removeNode)})},{"../common":1,"../flowplayer":31,bean:34,"extend-object":39}],23:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean"),a=e("./subtitles/parser");i.defaults.subtitleParser=a,i(function(e,t){var n,a,s,l,u;(!i.support.inlineVideo||!i.support.fullscreen&&e.conf.native_fullscreen)&&(e.conf.nativesubtitles=!0),e.ui||(e.ui={}),e.ui.createSubtitleControl=function(e,n){return u=n,s=s||r.createElement("strong",{className:"fp-cc"},"CC"),l=l||r.createElement("div",{className:"fp-menu fp-subtitle-menu"},"<strong>Closed Captions</strong>"),r.find("a",l).forEach(r.removeNode),l.appendChild(r.createElement("a",{"data-subtitle-index":-1},"No subtitles")),(e||[]).forEach(function(e,t){var n=e.srclang||"en",i=e.label||"Default ("+n+")",o=r.createElement("a",{"data-subtitle-index":t},i);l.appendChild(o)}),r.find(".fp-ui",t)[0].appendChild(l),r.find(".fp-controls",t)[0].appendChild(s),r.toggleClass(s,"fp-hidden",!e||!e.length),s},e.ui.setActiveSubtitleItem=function(e){c(e)},o.on(t,"click",".fp-cc",function(){r.hasClass(l,"fp-active")?e.hideMenu():e.showMenu(l)}),o.on(t,"click",".fp-subtitle-menu [data-subtitle-index]",function(t){t.preventDefault();var n=t.target.getAttribute("data-subtitle-index");return u?u(n):"-1"===n?e.disableSubtitles():void e.loadSubtitles(n)});e.on("ready",function(n,i,o){if(i.subtitles=[],a=(a=r.find(".fp-captions",t)[0])||r.appendTo(r.createElement("div",{class:"fp-captions"}),r.find(".fp-player",t)[0]),Array.prototype.forEach.call(a.children,r.removeNode),e.ui.createSubtitleControl(e.video.subtitles),r.removeClass(t,"has-menu"),e.disableSubtitles(),o.subtitles&&o.subtitles.length){var s=o.subtitles.filter(function(e){return e.default})[0];s&&i.loadSubtitles(o.subtitles.indexOf(s))}}),e.showSubtitle=function(e){r.html(a,e),r.addClass(a,"fp-shown")},e.hideSubtitle=function(){r.removeClass(a,"fp-shown")},e.bind("cuepoint",function(t,i,r){r.subtitle?(n=r.index,e.showSubtitle(r.subtitle.text)):r.subtitleEnd&&(e.hideSubtitle(),n=r.index)}),e.bind("seek",function(t,i,o){n&&e.cuepoints[n]&&e.cuepoints[n].time>o&&(r.removeClass(a,"fp-shown"),n=null),(e.cuepoints||[]).forEach(function(t,i){var r=t.subtitle;r&&n!=i?o>=t.time&&(!r.endTime||o<=r.endTime)&&e.trigger("cuepoint",[e,t]):t.subtitleEnd&&o>=t.time&&i==n+1&&e.trigger("cuepoint",[e,t])})}),e.on("unload",function(){r.find(".fp-captions",t).forEach(r.removeNode)});var c=function(e){r.toggleClass(r.find("a.fp-selected",l)[0],"fp-selected"),r.toggleClass(r.find('a[data-subtitle-index="'+e+'"]',l)[0],"fp-selected")},f=function(e,n){var i=r.find("video.fp-engine",t)[0].textTracks;i.length&&(null===e?[].forEach.call(i,function(e){e.mode=n}):i[e].mode=n)};e.disableSubtitles=function(){return e.subtitles=[],(e.cuepoints||[]).forEach(function(t){(t.subtitle||t.subtitleEnd)&&e.removeCuepoint(t)}),a&&Array.prototype.forEach.call(a.children,r.removeNode),c(-1),i.support.subtitles&&e.conf.nativesubtitles&&"html5"==e.engine.engineName&&f(null,"disabled"),e},e.loadSubtitles=function(t){e.disableSubtitles();var n=e.video.subtitles[t].src;
4323if(n){if(c(t),!i.support.subtitles||!e.conf.nativesubtitles||"html5"!=e.engine.engineName)return r.xhrGet(n,function(t){e.conf.subtitleParser(t).forEach(function(t,n){t.title||(t.title="subtitle"+n);var r={time:t.startTime,subtitle:t,visible:!1};e.subtitles.push(t),e.addCuepoint(r),e.addCuepoint({time:t.endTime,subtitleEnd:t.title,visible:!1}),0!==t.startTime||e.video.time||e.splash||e.trigger("cuepoint",[e,i.extend({},r,{index:0})]),e.splash&&e.one("ready",function(){e.trigger("cuepoint",[e,r])})})},function(){return e.trigger("error",{code:8,url:n}),!1}),e;f(t,"showing")}}})},{"../common":1,"../flowplayer":31,"./subtitles/parser":24,bean:34}],24:[function(e,t,n){t.exports=function(e){var t=/^(([0-9]+:){1,2}[0-9]{2}[,.][0-9]{3}) --\> (([0-9]+:){1,2}[0-9]{2}[,.][0-9]{3})(.*)/;function n(e){var t=e.split(":");return 2==t.length&&t.unshift(0),60*t[0]*60+60*t[1]+parseFloat(t[2].replace(",","."))}for(var i,r,o,a=[],s=0,l=e.split("\n"),u=l.length,c={};s<u;s++)if(r=t.exec(l[s])){for(i=l[s-1],o="<p>"+l[++s]+"</p><br/>";"string"==typeof l[++s]&&l[s].trim()&&s<l.length;)o+="<p>"+l[s]+"</p><br/>";c={title:i,startTime:n(r[1]),endTime:n(r[3]),text:o},a.push(c)}return a}},{}],25:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("extend-object");!function(){var e={},t=document.documentElement.style,n=navigator.userAgent.toLowerCase(),o=/(chrome)[ \/]([\w.]+)/.exec(n)||/(safari)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];o[1]&&(e[o[1]]=!0,e.version=o[2]||"0"),e.safari&&(e.version=(/version\/([\w.]+)/.exec(n)||[])[1]);var a,s,l=((s=document.createElement("video")).loop=!0,s.autoplay=!0,s.preload=!0,s),u=navigator.userAgent,c=e.msie||/Trident\/7/.test(u),f=/iPad|MeeGo/.test(u)&&!/CriOS/.test(u),d=/iPad/.test(u)&&/CriOS/.test(u),p=/iP(hone|od)/i.test(u)&&!/iPad/.test(u)&&!/IEMobile/i.test(u),h=/Android/.test(u),g=h&&/Firefox/.test(u),m=h&&/SAMSUNG/.test(u),v=/Silk/.test(u),y=/IEMobile/.test(u),w=y?parseFloat(/Windows\ Phone\ (\d+\.\d+)/.exec(u)[1],10):0,b=y?parseFloat(/IEMobile\/(\d+\.\d+)/.exec(u)[1],10):0,I=f||p?(a=/iP(ad|hone)(; CPU)? OS (\d+_\d)/.exec(u))&&a.length>1?parseFloat(a[a.length-1].replace("_","."),10):0:0,M=h?parseFloat(/Android\ (\d+(\.\d+)?)/.exec(u)[1],10):0,C=(p||f||d)&&{iPhone:p,iPad:f||d,version:I,chrome:d},A=r(i.support,{browser:e,iOS:C,android:!!h&&{firefox:g,opera:/Opera/.test(u),samsung:m,version:M},subtitles:!!l.addTextTrack,fullscreen:"boolean"==typeof document.webkitFullscreenEnabled?document.webkitFullscreenEnabled:"function"==typeof document.webkitCancelFullScreen&&!/Mac OS X 10_5.+Version\/5\.0\.\d Safari/.test(u)||document.mozFullScreenEnabled||"function"==typeof document.exitFullscreen||"function"==typeof document.msExitFullscreen,inlineBlock:!(c&&e.version<8),touch:"ontouchstart"in window,dataload:!f&&!p&&!y,flex:"flexWrap"in t||"WebkitFlexWrap"in t||"msFlexWrap"in t,svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,zeropreload:!c&&!h,volume:!(f||p||v||d),cachedVideoTag:!(f||p||d||y),firstframe:!(v||y||g||m||I&&I<10||h&&M<4.4),inlineVideo:(!p||I>=10)&&(!y||w>=8.1&&b>=11)&&(!h||M>=3),hlsDuration:!h&&(!e.safari||f||p||d),seekable:!f&&!d,preloadMetadata:!C&&!e.safari});A.autoplay=A.firstframe,y&&(A.browser.safari=!1);try{var S=navigator.plugins["Shockwave Flash"],E=c?new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version"):S.description;c||S[0].enabledPlugin?((E=E.split(/\D+/)).length&&!E[0]&&(E=E.slice(1)),A.flashVideo=E[0]>9||9==E[0]&&E[3]>=115):A.flashVideo=!1}catch(e){}try{A.video=!!l.canPlayType,A.video&&l.canPlayType("video/mp4")}catch(e){A.video=!1}A.animation=function(){for(var e=["","Webkit","Moz","O","ms","Khtml"],t=document.createElement("p"),n=0;n<e.length;n++)if(void 0!==t.style[e[n]+"AnimationName"])return!0}()}()},{"../flowplayer":31,"extend-object":39}],26:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){var n=e.conf;if(!1!==n.share&&!1!==n.twitter){e.tweet=function(){var t,i,r=screen.height,o=screen.width,a="string"==typeof n.twitter?n.twitter:e.shareUrl();t=Math.round(o/2-275),i=0,r>420&&(i=Math.round(r/2-210)),window.open("https://twitter.com/intent/tweet?url="+encodeURIComponent(a),"intent","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+t+",top="+i)};var i=r.find(".fp-share-menu",t)[0],a=r.createElement("a",{class:"fp-icon fp-twitter"},"Twitter");r.append(i,a),o.on(t,"click",".fp-twitter",function(){e.tweet()})}})},{"../common":1,"../flowplayer":31,bean:34}],27:[function(e,t,n){(function(n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean"),a=e("./ui/slider"),s=e("./ui/bar-slider");function l(e){return(e=parseInt(e,10))>=10?e:"0"+e}function u(e,t){e=Math.max(e||0,0),e=t?Math.ceil(e):Math.floor(e);var n=Math.floor(e/3600),i=Math.floor(e/60);return e-=60*i,n>=1?n+":"+l(i-=60*n)+":"+l(e):l(i)+":"+l(e)}var c=n("PHN2ZyBjbGFzcz0iZnAtcGxheS1yb3VuZGVkLW91dGxpbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDk5Ljg0NCA5OS44NDM0Ij48ZGVmcz48c3R5bGU+LmZwLWNvbG9yLXBsYXl7b3BhY2l0eTowLjY1O30uY29udHJvbGJ1dHRvbntmaWxsOiNmZmY7fTwvc3R5bGU+CjwvZGVmcz4KPHRpdGxlPnBsYXktcm91bmRlZC1vdXRsaW5lPC90aXRsZT48cGF0aCBjbGFzcz0iZnAtY29sb3ItcGxheSIgZD0iTTQ5LjkyMTctLjA3OGE1MCw1MCwwLDEsMCw1MCw1MEE1MC4wNTY0LDUwLjA1NjQsMCwwLDAsNDkuOTIxNy0uMDc4WiIvPjxwYXRoIGNsYXNzPSJjb250cm9sYnV0dG9uIiBkPSJNNDEuMDM1OSw3MS4xOWE1LjA0OTIsNS4wNDkyLDAsMCwxLTIuNTU3NS0uNjY3M2MtMS44MDMxLTEuMDQxLTIuNzk1OC0zLjEyNDgtMi43OTU4LTUuODY2NFYzNS4xODg3YzAtMi43NDI5Ljk5MzMtNC44MjcyLDIuNzk3LTUuODY3NiwxLjgwMjUtMS4wNDIyLDQuMTAzNC0uODYsNi40OC41MTQzTDcwLjQ3ODIsNDQuNTY3MmMyLjM3NTEsMS4zNzExLDMuNjgyNiwzLjI3MjUsMy42ODMyLDUuMzU0NXMtMS4zMDc2LDMuOTg0NS0zLjY4MzIsNS4zNTYyTDQ0Ljk1OTIsNzAuMDExNEE3LjkzODQsNy45Mzg0LDAsMCwxLDQxLjAzNTksNzEuMTlabS4wMDY1LTQwLjEyM2EyLjY3OTQsMi42Nzk0LDAsMCwwLTEuMzU4Mi4z
4323NDEzYy0xLjAyNjMuNTkyNi0xLjU5MTIsMS45MzQ5LTEuNTkxMiwzLjc4VjY0LjY1NjNjMCwxLjg0NDkuNTY0OSwzLjE4NjYsMS41OTA2LDMuNzc5MSwxLjAyODEuNTkzMiwyLjQ3MzMuNDEwOCw0LjA3LS41MTJMNjkuMjczLDUzLjE5MDZjMS41OTgzLS45MjI3LDIuNDc4LTIuMDgzOCwyLjQ3OC0zLjI2ODlzLS44OC0yLjM0NDUtMi40NzgtMy4yNjY2TDQzLjc1NCwzMS45MjI3QTUuNTY4NSw1LjU2ODUsMCwwLDAsNDEuMDQyMywzMS4wNjcxWiIgZmlsdGVyPSJ1cmwoI2YxKSIvPjwvc3ZnPgo=","base64"),f=n("PHN2ZyBjbGFzcz0iZnAtcGxheS1yb3VuZGVkLWZpbGwiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiPgogIDxkZWZzPjxzdHlsZT4uYXtmaWxsOiMwMDA7b3BhY2l0eTowLjY1O30uYntmaWxsOiNmZmY7b3BhY2l0eToxLjA7fTwvc3R5bGU+CiAgPC9kZWZzPjx0aXRsZT5wbGF5LXJvdW5kZWQtZmlsbDwvdGl0bGU+CiAgPHBhdGggY2xhc3M9ImZwLWNvbG9yLXBsYXkiIGQ9Ik00OS45MjE3LS4wNzhhNTAsNTAsMCwxLDAsNTAsNTBBNTAuMDU2NCw1MC4wNTY0LDAsMCwwLDQ5LjkyMTctLjA3OFoiLz4KICA8cGF0aCBjbGFzcz0iYiIgZD0iTTM1Ljk0MiwzNS4yMzIzYzAtNC43Mjg5LDMuMzUwNi02LjY2MzcsNy40NDYtNC4yOTcxTDY4LjgzLDQ1LjYyMzVjNC4wOTU2LDIuMzY0LDQuMDk1Niw2LjIzMTksMCw4LjU5NzdMNDMuMzg4LDY4LjkxYy00LjA5NTQsMi4zNjQtNy40NDYuNDMtNy40NDYtNC4yOTc5WiIgZmlsdGVyPSJ1cmwoI2YxKSIvPgogIDwvc3ZnPgogIAo=","base64"),d=n("PHN2ZyBjbGFzcz0iZnAtcGxheS1zaGFycC1maWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxzdHlsZT4uZnAtY29sb3ItcGxheXtvcGFjaXR5OjAuNjU7fS5jb250cm9sYnV0dG9ue2ZpbGw6I2ZmZjt9PC9zdHlsZT4KICA8L2RlZnM+CiAgPHRpdGxlPnBsYXktc2hhcnAtZmlsbDwvdGl0bGU+CiAgPHBhdGggY2xhc3M9ImZwLWNvbG9yLXBsYXkiIGQ9Ik00OS45MjE3LS4wNzhhNTAsNTAsMCwxLDAsNTAsNTBBNTAuMDU2NCw1MC4wNTY0LDAsMCwwLDQ5LjkyMTctLjA3OFoiLz4KICA8cG9seWdvbiBjbGFzcz0iY29udHJvbGJ1dHRvbiIgcG9pbnRzPSI3My42MDEgNTAgMzcuOTY4IDcwLjU3MyAzNy45NjggMjkuNDI3IDczLjYwMSA1MCIgZmlsdGVyPSJ1cmwoI2YxKSIvPgo8L3N2Zz4K","base64"),p=n("PHN2ZyBjbGFzcz0iZnAtcGxheS1zaGFycC1vdXRsaW5lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5OS44NDQgOTkuODQzNCI+PGRlZnM+PHN0eWxlPi5jb250cm9sYnV0dG9uYmd7b3BhY2l0eTowLjY1O30uY29udHJvbGJ1dHRvbntmaWxsOiNmZmY7fTwvc3R5bGU+CjwvZGVmcz48dGl0bGU+cGxheS1zaGFycC1vdXRsaW5lPC90aXRsZT48cGF0aCBjbGFzcz0iZnAtY29sb3ItcGxheSIgZD0iTTQ5LjkyMTctLjA3OGE1MCw1MCwwLDEsMCw1MCw1MEE1MC4wNTY0LDUwLjA1NjQsMCwwLDAsNDkuOTIxNy0uMDc4WiIvPjxwYXRoIGNsYXNzPSJjb250cm9sYnV0dG9uIiBkPSJNMzYuOTQ0Myw3Mi4yNDczVjI3LjI5MTZMNzUuODc3Niw0OS43N1ptMi4yLTQxLjE0NTVWNjguNDM3MUw3MS40Nzc2LDQ5Ljc3WiIgZmlsdGVyPSJ1cmwoI2YxKSIvPjwvc3ZnPgo=","base64"),h=n("PHN2ZyBjbGFzcz0iZnAtcGF1c2Utcm91bmRlZC1vdXRsaW5lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5OS44NDM0IDk5Ljg0MzQiPjxkZWZzPjxzdHlsZT4uZnAtY29sb3ItcGxheXtvcGFjaXR5OjAuNjU7fS5yZWN0e2ZpbGw6I2ZmZjt9PC9zdHlsZT4KPC9kZWZzPjx0aXRsZT5wYXVzZS1yb3VuZGVkLW91dGxpbmU8L3RpdGxlPjxwYXRoIGNsYXNzPSJmcC1jb2xvci1wbGF5IiBkPSJNNDkuOTIxMi0uMDc4M2E1MCw1MCwwLDEsMCw1MC4wMDA2LDUwQTUwLjA1NjIsNTAuMDU2MiwwLDAsMCw0OS45MjEyLS4wNzgzWiIvPjxnIGNsYXNzPSJjb250cm9sYnV0dG9uIj48cGF0aCBjbGFzcz0icmVjdCIgZD0iTTM5LjAwMzYsNzEuOTcyNmE3LjU2NSw3LjU2NSwwLDAsMS03LjU1Ny03LjU1NnYtMjguOTlhNy41NTY1LDcuNTU2NSwwLDAsMSwxNS4xMTMsMHYyOC45OUE3LjU2NDgsNy41NjQ4LDAsMCwxLDM5LjAwMzYsNzEuOTcyNlptMC00MS45MDRhNS4zNjQ3LDUuMzY0NywwLDAsMC01LjM1OTMsNS4zNTgydjI4Ljk5YTUuMzU4Nyw1LjM1ODcsMCwwLDAsMTAuNzE3NCwwdi0yOC45OUE1LjM2NDUsNS4zNjQ1LDAsMCwwLDM5LjAwMzYsMzAuMDY4NloiIGZpbHRlcj0idXJsKCNmMSkiLz48cGF0aCBjbGFzcz0icmVjdCIgZD0iTTYwLjg0LDcxLjk3MjZhNy41NjQ4LDcuNTY0OCwwLDAsMS03LjU1Ni03LjU1NnYtMjguOTlhNy41NTY1LDcuNTU2NSwwLDAsMSwxNS4xMTMsMHYyOC45OUE3LjU2NSw3LjU2NSwwLDAsMSw2MC44NCw3MS45NzI2Wm0wLTQxLjkwNGE1LjM2NDUsNS4zNjQ1LDAsMCwwLTUuMzU4Miw1LjM1ODJ2MjguOTlhNS4zNTg3LDUuMzU4NywwLDAsMCwxMC43MTc0LDB2LTI4Ljk5QTUuMzY0Nyw1LjM2NDcsMCwwLDAsNjAuODQsMzAuMDY4NloiIGZpbHRlcj0idXJsKCNmMSkiLz48L2c+PC9zdmc+Cg==","base64"),g=n("PHN2ZyBjbGFzcz0iZnAtcGF1c2Utcm91bmRlZC1maWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48ZGVmcz48c3R5bGU+LmZwLWNvbG9yLXBsYXl7b3BhY2l0eTowLjY1O30ucmVjdHtmaWxsOiNmZmY7fTwvc3R5bGU+CjwvZGVmcz48dGl0bGU+cGF1c2Utcm91bmRlZC1maWxsPC90aXRsZT48cGF0aCBjbGFzcz0iZnAtY29sb3ItcGxheSIgZD0iTTQ5LjkyMTctLjA3OGE1MCw1MCwwLDEsMCw1MCw1MEE1MC4wNTY0LDUwLjA1NjQsMCwwLDAsNDkuOTIxNy0uMDc4WiIvPjxnIGNsYXNzPSJjb250cm9sYnV0dG9uIiBmaWx0ZXI9InVybCgjZjEpIj48cmVjdCBjbGFzcz0icmVjdCIgeD0iMzEuODQ0IiB5PSIyOC4xMjMxIiB3aWR0aD0iMTMuNDM2MiIgaGVpZ2h0PSI0My41OTczIiByeD0iNi43MTgxIiByeT0iNi43MTgxIi8+PHJlY3QgY2xhc3M9InJlY3QiIHg9IjU0LjU2MzgiIHk9IjI4LjEyMzEiIHdpZHRoPSIxMy40MzYyIiBoZWlnaHQ9IjQzLjU5NzMiIHJ4PSI2LjcxODEiIHJ5PSI2LjcxODEiLz48L2c+PC9zdmc+Cg==","base64"),m=n("PHN2ZyBjbGFzcz0iZnAtcGF1c2Utc2hhcnAtZmlsbCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PGRlZnM+PHN0eWxlPi5mcC1jb2xvci1wbGF5e29wYWNpdHk6MC42NTt9LnJlY3R7ZmlsbDojZmZmO308L3N0eWxlPgo8L2RlZnM+PHRpdGxlPnBhdXNlLXNoYXJwLWZpbGw8L3RpdGxlPjxwYXRoIGNsYXNzPSJmcC1jb2xvci1wbGF5IiBkPSJNNDkuOTIxNy0uMDc4YTUwLDUwLDAsMSwwLDUwLDUwQTUwLjA1NjQsNTAuMDU2NCwwLDAsMCw0OS45MjE3LS4wNzhaIi8+PGcgY2x
4323hc3M9ImNvbnRyb2xidXR0b24iIGZpbHRlcj0idXJsKCNmMSkiPjxyZWN0IGNsYXNzPSJyZWN0IiB4PSIzMy41IiB5PSIzMC4xMDQyIiB3aWR0aD0iMTIuMjYzNCIgaGVpZ2h0PSIzOS43OTE3Ii8+PHJlY3QgY2xhc3M9InJlY3QiIHg9IjU0LjIzNjYiIHk9IjMwLjEwNDIiIHdpZHRoPSIxMi4yNjM0IiBoZWlnaHQ9IjM5Ljc5MTciLz48L2c+PC9zdmc+Cg==","base64"),v=n("PHN2ZyBjbGFzcz0iZnAtcGF1c2Utc2hhcnAtb3V0bGluZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgOTkuODQzNCA5OS44NDM0Ij48ZGVmcz48c3R5bGU+LmZwLWNvbG9yLXBsYXl7b3BhY2l0eTowLjY1O30ucmVjdHtmaWxsOiNmZmY7fTwvc3R5bGU+CjwvZGVmcz48dGl0bGU+cGF1c2Utc2hhcnAtb3V0bGluZTwvdGl0bGU+PHBhdGggY2xhc3M9ImZwLWNvbG9yLXBsYXkiIGQ9Ik00OS45MjEyLS4wNzgzYTUwLDUwLDAsMSwwLDUwLjAwMDYsNTBBNTAuMDU2Miw1MC4wNTYyLDAsMCwwLDQ5LjkyMTItLjA3ODNaIi8+PGcgY2xhc3M9ImNvbnRyb2xidXR0b24iIGZpbHRlcj0idXJsKCNmMSkiPjxwYXRoIGNsYXNzPSJyZWN0IiBkPSJNNDYuODcwOSw2OS45NTMxSDMzLjEzODVWMjkuODlINDYuODcwOVpNMzUuMTQxNiw2Ny45NWg5LjcyNjJWMzEuODkzNUgzNS4xNDE2WiIvPjxwYXRoIGNsYXNzPSJyZWN0IiBkPSJNNjYuNzA0Nyw2OS45NTMxSDUyLjk3MjJWMjkuODlINjYuNzA0N1pNNTQuOTc1NCw2Ny45NWg5LjcyNjJWMzEuODkzNUg1NC45NzU0WiIvPjwvZz48L3N2Zz4K","base64"),y=n("PHN2ZyBjbGFzcz0iZnAtbG9hZGluZy1yb3VuZGVkLW91dGxpbmUiIHdpZHRoPScxMTJweCcgaGVpZ2h0PScxMTJweCcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPgogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijc2IiBoZWlnaHQ9Ijc2IiBmaWxsPSJyZ2JhKDAsMCwwLDApIiBjbGFzcz0iYmsiPjwvcmVjdD4KICAgIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgMjUpIiBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMCwwLDAsLjUpIiBzdHJva2Utd2lkdGg9IjMlIiBjbGFzcz0ic3EiPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2UiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjAuMHMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC4wcyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICAgIDwvY2lyY2xlPgogICAgPGNpcmNsZSBjeD0iMCIgY3k9IjAiIHI9IjEwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1MCAyNSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgwLDAsMCwuNSkiIHN0cm9rZS13aWR0aD0iMyUiIGNsYXNzPSJzcSI+CiAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZSIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMC40cyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjRzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogICAgPC9jaXJjbGU+CiAgICA8Y2lyY2xlIGN4PSIwIiBjeT0iMCIgcj0iMTAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUwIDUwKSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2JhKDAsMCwwLC41KSIgc3Ryb2tlLXdpZHRoPSIzJSIgY2xhc3M9InNxIj4KICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ic3Ryb2tlIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIwLjhzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBhZGRpdGl2ZT0ic3VtIiBmcm9tPSIwLjgiIHRvPSIxIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuOHMiIGR1cj0iMS42cyIgdmFsdWVzPSIxOzAuODswLjg7MTsxIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+CiAgICA8L2NpcmNsZT4KICAgIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgNTApIiBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMCwwLDAsLjUpIiBzdHJva2Utd2lkdGg9IjMlIiBjbGFzcz0ic3EiPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2UiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjEuMnMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMS4ycyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICAgIDwvY2lyY2xlPgo8L3N2Zz4K","base64"),w=n("PHN2ZyBjbGFzcz0iZnAtbG9hZGluZy1yb3VuZGVkLWZpbGwiIHdpZHRoPScxMTJweCcgaGVpZ2h0PScxMTJweCcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPgogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijc2IiBoZWlnaHQ9Ijc2IiBmaWxsPSJyZ2JhKDAsMCwwLDApIiBjbGFzcz0iYmsiPjwvcmVjdD4KICAgIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgMjUpIiBmaWxsPSJyZ2JhKDAsMCwwLC41KSIgY2x
4323hc3M9InNxIj4KICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iZmlsbCIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMC4wcyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjBzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogICAgPC9jaXJjbGU+CiAgICA8Y2lyY2xlIGN4PSIwIiBjeT0iMCIgcj0iMTAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUwIDI1KSIgZmlsbD0icmdiYSgwLDAsMCwuNSkiIGNsYXNzPSJzcSI+CiAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImZpbGwiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjAuNHMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC40cyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICAgIDwvY2lyY2xlPgogICAgPGNpcmNsZSBjeD0iMCIgY3k9IjAiIHI9IjEwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1MCA1MCkiIGZpbGw9InJnYmEoMCwwLDAsLjUpIiBjbGFzcz0ic3EiPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIwLjhzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBhZGRpdGl2ZT0ic3VtIiBmcm9tPSIwLjgiIHRvPSIxIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuOHMiIGR1cj0iMS42cyIgdmFsdWVzPSIxOzAuODswLjg7MTsxIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+CiAgICA8L2NpcmNsZT4KICAgIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgNTApIiBmaWxsPSJyZ2JhKDAsMCwwLC41KSIgY2xhc3M9InNxIj4KICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iZmlsbCIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMS4ycyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjJzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogICAgPC9jaXJjbGU+Cjwvc3ZnPgo=","base64"),b=n("PHN2ZyBjbGFzcz0iZnAtbG9hZGluZy1zaGFycC1maWxsIiB3aWR0aD0nMTEycHgnIGhlaWdodD0nMTEycHgnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNzYiIGhlaWdodD0iNzYiIGZpbGw9InJnYmEoMCwwLDAsMCkiIGNsYXNzPSJiayI+PC9yZWN0PgogIDxyZWN0IHg9Ii0xMCIgeT0iLTEwIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI1IDI1KSIgZmlsbD0icmdiYSgwLDAsMCwuNSkiIGNsYXNzPSJzcSI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIwLjBzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjBzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogIDwvcmVjdD4KICA8cmVjdCB4PSItMTAiIHk9Ii0xMCIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1MCAyNSkiIGZpbGw9InJnYmEoMCwwLDAsLjUpIiBjbGFzcz0ic3EiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iZmlsbCIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMC40cyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC40cyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICA8L3JlY3Q+CiAgPHJlY3QgeD0iLTEwIiB5PSItMTAiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNTAg
4323NTApIiBmaWxsPSJyZ2JhKDAsMCwwLC41KSIgY2xhc3M9InNxIj4KICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImZpbGwiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjAuOHMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBhZGRpdGl2ZT0ic3VtIiBmcm9tPSIwLjgiIHRvPSIxIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuOHMiIGR1cj0iMS42cyIgdmFsdWVzPSIxOzAuODswLjg7MTsxIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+CiAgPC9yZWN0PgogIDxyZWN0IHg9Ii0xMCIgeT0iLTEwIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI1IDUwKSIgZmlsbD0icmdiYSgwLDAsMCwuNSkiIGNsYXNzPSJzcSI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIxLjJzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjJzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogIDwvcmVjdD4KPC9zdmc+Cg==","base64"),I=n("PHN2ZyBjbGFzcz0iZnAtbG9hZGluZy1zaGFycC1vdXRsaW5lIiB3aWR0aD0nMTEycHgnIGhlaWdodD0nMTEycHgnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNzYiIGhlaWdodD0iNzYiIGZpbGw9InJnYmEoMCwwLDAsMCkiIGNsYXNzPSJiayI+PC9yZWN0PgogIDxyZWN0IHg9Ii05IiB5PSItOSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNSAyNSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgwLDAsMCwuNSkiIHN0cm9rZS13aWR0aD0iMyUiIGNsYXNzPSJzcSI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2UiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjAuMHMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC4wcyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICA8L3JlY3Q+CiAgPHJlY3QgeD0iLTkiIHk9Ii05IiB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUwIDI1KSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2JhKDAsMCwwLC41KSIgc3Ryb2tlLXdpZHRoPSIzJSIgY2xhc3M9InNxIj4KICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZSIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMC40cyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjRzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogIDwvcmVjdD4KICA8cmVjdCB4PSItOSIgeT0iLTkiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNTAgNTApIiBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMCwwLDAsLjUpIiBzdHJva2Utd2lkdGg9IjMlIiBjbGFzcz0ic3EiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ic3Ryb2tlIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIwLjhzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBhZGRpdGl2ZT0ic3VtIiBmcm9tPSIwLjgiIHRvPSIxIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuOHMiIGR1cj0iMS42cyIgdmFsdWVzPSIxOzAuODswLjg7MTsxIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+CiAgPC9yZWN0PgogIDxyZWN0IHg9Ii05IiB5PSItOSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNSA1MCkiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgwLDAsMCwuNSkiIHN0cm9rZS13aWR0aD0iMyUiIGNsYXNzPSJzcSI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2UiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjEuMnMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMS4ycyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICA8L3JlY3Q+Cjwvc3ZnPgo=","base64");i(function(e,t){r.find(".fp-filters").forEach(r.removeNode);try{var l;document.body.appendChild(l=r.createElement("div",{},n("PHN2ZyBjbGFzcz0iZnAtZmlsdGVycyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMCAwIj4KICA8ZGVmcz4KICAgIDxmaWx0ZXIgaWQ9ImYxIiB4PSItMjAlIiB5PSItMjAlIiB3aWR0aD0iMjAwJSIgaGVpZ2h0PSIyMDAlIj4KICAgICAgPGZlT2Zmc2V0IHJlc3VsdD0ib2ZmT3V0IiBpbj0iU291cmNlQWxwaGEiIGR4PSIwIiBkeT0iMCIgLz4KICAgICAgPGZlQ29sb3JNYXRyaXggcmVzdWx0PSJtYXRyaXhPdXQiIGluPSJvZmZPdXQiIHR5cGU9Im1hdHJpeCIKICAgICAgdmFsdWVzPSIwLjMgMCAwIDAgMCAwIDAuMyAwIDAgMCAwIDAgMC4zIDAgMCAwIDAgMCAwLjQgMCIgLz4KICAgICAgPGZlR2F1c3NpYW5CbHVyIHJlc3VsdD0iYmx1ck91dCIgaW49Im1hdHJpeE91dCIgc3RkRGV2aWF0aW9uPSI0IiAvPgogICAgICA8ZmVCbGVuZCBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJibHVyT3V0IiBtb2RlPSJub3JtYWwiIC8+CiAgICA8L2ZpbHRlcj4KICA8L2RlZnM+Cjwvc3ZnPgo=","base64"))),r.css(l,{width:0,height:0,overflow:"hidden",position:"absolute",margin:0,padding:0})}catch(e){}var M,C=e.conf,A=i.support;r.find(".fp-ratio,.fp-ui",t).forEach(r.removeNode),r.addClass(t,"flowplayer"),t.appendChild(r.createElement("div",{className:"fp-ratio"}));var S=r.createElement("div",{className:"fp-ui"},'         <div class="fp-waiting">           {{ LOADING_SHARP_OUTLINE }}           {{ LOADING_SHARP_FILL }}           {{ LOADING_ROUNDED_FILL }}           {{ LOADING_ROUNDED_OUTLINE }}         </div>         <div class="fp-header">           <a class="fp-share fp-icon"></a>           <a class="fp-fullscreen fp-icon"></a>           <a class="fp-unload fp-icon"></a>         </div>         <p class="fp-speed-flash"></p>         <div class="fp-play fp-visible">           <a class="fp-icon fp-playbtn"></a>           {{ PLAY_ROUNDED_FILL }}           {{ PLAY_ROUNDED_OUTLINE }}           {{ PLAY_SHARP_FILL }}           {{ PLAY_SHARP_OUTLINE }}         </div>         <div class="fp-pause">           <a class="fp-icon fp-playbtn"></a>           {{ PAUSE_SHARP_OUTLINE }}           {{ PAUSE_SHARP_FILL }}           {{ PAUSE_ROUNDED_OUTLINE }}           {{ PAUSE_ROUNDED_FILL }}         </div>         <div class="fp-controls">            <a class="fp-icon fp-playbtn"></a>
4323            <span class="fp-elapsed">00:00</span>            <div class="fp-timeline fp-bar">               <span class="fp-timestamp"></span>               <div class="fp-progress fp-color"></div>            </div>            <span class="fp-duration"></span>            <span class="fp-remaining"></span>            <div class="fp-volume">               <a class="fp-icon fp-volumebtn"></a>               <div class="fp-volumebar fp-bar-slider">                 <em></em><em></em><em></em><em></em><em></em><em></em><em></em>               </div>            </div>            <strong class="fp-speed fp-hidden"></strong>         </div>'.replace("{{ PAUSE_ROUNDED_FILL }}",g).replace("{{ PAUSE_ROUNDED_OUTLINE }}",h).replace("{{ PAUSE_SHARP_FILL }}",m).replace("{{ PAUSE_SHARP_OUTLINE }}",v).replace("{{ PLAY_SHARP_OUTLINE }}",p).replace("{{ PLAY_SHARP_FILL }}",d).replace("{{ PLAY_ROUNDED_OUTLINE }}",c).replace("{{ PLAY_ROUNDED_FILL }}",f).replace("{{ LOADING_ROUNDED_OUTLINE }}",y).replace("{{ LOADING_ROUNDED_FILL }}",w).replace("{{ LOADING_SHARP_FILL }}",b).replace("{{ LOADING_SHARP_OUTLINE }}",I).replace(/url\(#/g,"url("+window.location.href.replace(window.location.hash,"").replace(/\#$/g,"")+"#"));function E(e){return r.find(".fp-"+e,t)[0]}t.appendChild(S);var D=E("waiting"),N=E("elapsed"),j=E("ratio"),L=E("speed-flash"),x=E("duration"),T=E("remaining"),Z=E("timestamp"),P=r.css(j,"padding-top"),k=E("play"),Y=E("pause"),z=E("timeline"),G=a(z,e.rtl),R=E("fullscreen"),O=E("volumebar"),W=s(O,{rtl:e.rtl}),U=r.hasClass(t,"no-toggle");G.disableAnimation(r.hasClass(t,"is-touch")),e.sliders=e.sliders||{},e.sliders.timeline=G,e.sliders.volume=W;var J=[];function B(e){r.css(j,"padding-top",100*e+"%"),A.inlineBlock||r.height(r.find("object",t)[0],r.height(t))}function F(e){e?(r.addClass(t,"is-mouseover"),r.removeClass(t,"is-mouseout")):(r.addClass(t,"is-mouseout"),r.removeClass(t,"is-mouseover"))}A.svg||r.html(D,"<p>loading &hellip;</p>"),C.ratio&&B(C.ratio);try{C.fullscreen||r.removeNode(R)}catch(e){r.removeNode(R)}e.on("dvrwindow",function(){G.disable(!1)}),e.on("ready",function(e,n,i){var o=n.video.duration;G.disable(n.disabled||!o),C.adaptiveRatio&&!isNaN(i.height/i.width)&&B(i.height/i.width),r.html([x,T],n.live?"Live":u(o)),r.toggleClass(t,"is-long",o>=3600),W.slide(n.volumeLevel),"flash"===n.engine.engineName?G.disableAnimation(!0,!0):G.disableAnimation(!1),r.find(".fp-title",S).forEach(r.removeNode),i.title&&r.prepend(S,r.createElement("div",{className:"fp-message fp-title"},i.title)),r.toggleClass(t,"has-title",!!i.title)}).on("unload",function(){P||C.splash||r.css(j,"paddingTop",""),G.slide(0),r.addClass(k,"fp-visible")}).on("buffer",function(e,t,n){var i=t.video,o=i.buffer/i.duration;!i.seekable&&A.seekable&&G.max(t.conf.live?1/0:o),n&&"number"!=typeof n||(n=[{start:0,end:i.buffer}]);var a=r.find(".fp-buffer",z);
4323a.length!==n.length&&(a.forEach(r.removeNode),a=[]),n.forEach(function(e,t){var n=a[t]||r.createElement("div",{className:"fp-buffer"});r.css(n,{left:100*e.start/i.duration+"%",width:100*(e.end-e.start)/i.duration+"%"}),r.prepend(z,n)})}).on("speed",function(e,t,n){t.video.time&&(r.text(L,n+"x"),r.addClass(L,"fp-shown"),(J=J.filter(function(e){return clearTimeout(e),!1})).push(setTimeout(function(){r.addClass(L,"fp-hilite"),J.push(setTimeout(function(){r.removeClass(L,"fp-hilite"),J.push(setTimeout(function(){r.removeClass(L,"fp-shown")},300))},1e3))})))}).on("buffered",function(){G.max(1)}).on("progress seek",function(n,i,o){var a=e.video.duration,s=e.video.seekOffset||0,l=((o=o||e.video.time)-s)/(a-s);G.dragging||G.slide(l,e.seeking?0:250),r.toggleClass(t,"is-live-position",a-o<C.livePositionOffset),r.html(N,u(o)),r.html(T,u(a-o,!0))}).on("finish resume seek",function(e){r.toggleClass(t,"is-finished","finish"==e.type)}).on("resume",function(){r.addClass(k,"fp-visible"),setTimeout(function(){r.removeClass(k,"fp-visible")},300)}).on("pause",function(){r.addClass(Y,"fp-visible"),setTimeout(function(){r.removeClass(Y,"fp-visible")},300)}).on("stop",function(){r.html(N,u(0)),G.slide(0,100)}).on("finish",function(){r.html(N,u(e.video.duration)),G.slide(1,100),r.removeClass(t,"is-seeking")}).on("beforeseek",function(){}).on("volume",function(){W.slide(e.volumeLevel)}).on("disable",function(){var n=e.disabled;G.disable(n),W.disable(n),r.toggleClass(t,"is-disabled",e.disabled)}).on("mute",function(e,n,i){r.toggleClass(t,"is-muted",i)}).on("error",function(e,n,i){if(r.removeClass(t,"is-loading"),r.removeClass(t,"is-seeking"),r.addClass(t,"is-error"),i){n.error=!0;var o=i.code;(i.message||"").match(/DECODER_ERROR_NOT_SUPPORTED/)&&(o=3);var a=n.message((n.engine&&n.engine.engineName||"html5")+": "+C.errors[o]);r.removeClass(t,"is-mouseover"),n.one("load progress",function(){a()})}}).one("resume ready",function(){var e=r.find("video.fp-engine",t)[0];if(e&&(!r.width(e)||!r.height(e))){var n=t.style.overflow;t.style.overflow="visible",setTimeout(function(){n?t.style.overflow=n:t.style.removeProperty("overflow")})}}),o.on(t,"mouseenter mouseleave",function(n){if(!U){var i,r="mouseover"==n.type;if(F(r),r){var a=function(){F(!0),i=new Date};e.on("pause.x volume.x",a),o.on(t,"mousemove.x",a),M=setInterval(function(){new Date-i>C.mouseoutTimeout&&(F(!1),i=new Date)},100)}else o.off(t,"mousemove.x"),e.off("pause.x volume.x"),clearInterval(M)}}),o.on(t,"mouseleave",function(){(G.dragging||W.dragging)&&(r.addClass(t,"is-mouseover"),r.removeClass(t,"is-mouseout"))}),o.on(t,"click.player",function(t){if(!e.disabled)return r.hasClass(t.target,"fp-ui")||r.hasClass(t.target,"fp-engine")||t.flash||r.hasParent(t.target,".fp-play,.fp-pause")?(t.preventDefault&&t.preventDefault(),e.toggle()):void 0}),o.on(t,"mousemove",".fp-timeline",function(t){var n=(t.pageX||t.clientX)-r.offset(z).left,i=n/r.width(z),o=e.video,a=o.duration-(void 0===o.seekOffset?0:o.seekOffset),s=(e.rtl?1-i:i)*a;if(!(i<0)){r.html(Z,u(s));var l=n-r.width(Z)/2;l<0&&(l=0),l>r.width(z)-r.width(Z)&&(l=!1),!1!==l?r.css(Z,{left:l+"px",right:"auto"}):r.css(Z,{left:"auto",right:"0px"})}}),o.on(t,"contextmenu",function(n){var i=window;if(!r.hasClass(t,"is-flash-disabled")){var a=r.find(".fp-context-menu",t)[0];a&&(n.preventDefault(),e.showMenu(a,{left:n.clientX-i.scrollX,top:n.clientY-i.scrollY}),o.on(t,"click",".fp-context-menu",function(e){e.stopPropagation()}))}}),e.on("flashdisabled",function(n,i,o){var a;r.addClass(t,"is-flash-disabled"),!1!==o&&(a=e.message("Seems something is blocking Adobe Flash from running")),e.one("ready progress",function(){r.removeClass(t,"is-flash-disabled"),a&&a()})}),C.poster&&r.css(t,"background-image","url("+C.poster+")");var H,V=r.css(t,"background-color"),X="none"!=r.css(t,"background-image")||V&&"rgba(0, 0, 0, 0)"!=V&&"transparent"!=V;if(X&&!C.splash){C.poster||(C.poster=!0);var _=function(){r.addClass(t,"is-poster"),r.addClass(k,"fp-visible"),e.poster=!0,e.on("resume.poster progress.poster beforeseek.poster",function(n){("beforeseek"===n.type||e.playing)&&(r.removeClass(t,"is-poster"),r.removeClass(k,"fp-visible"),e.poster=!1,e.off(".poster"))})};e.on("stop",function(){_()}
4323),e.on("ready",function(e,t,n){n.index||n.autoplay||_()})}if("string"==typeof C.splash&&r.css(t,"background-image","url('"+C.splash+"')"),!X&&e.forcedSplash&&r.css(t,"background-color","#555"),o.on(t,"click",".fp-toggle, .fp-play, .fp-playbtn",function(){e.disabled||e.toggle()}),o.on(t,"click",".fp-volumebtn",function(){e.mute()}),o.on(t,"click",".fp-fullscreen",function(){e.fullscreen()}),o.on(t,"click",".fp-unload",function(){e.unload()}),o.on(z,"slide",function(t){e.seeking=!0,e.seekTo(10*t)}),o.on(O,"slide",function(t){e.volume(t)}),o.on(t,"click",".fp-duration,.fp-remaining",function(){if(e.dvr)return e.seekTo(10);r.toggleClass(t,"is-inverted")}),F(U),e.on("shutdown",function(){o.off(z),o.off(O),H&&window.cancelAnimationFrame(H),r.removeNode(S),r.find(".fp-ratio",t).forEach(r.removeNode)}),"function"==typeof window.requestAnimationFrame){var K=r.find(".fp-player",t)[0]||t,Q=function(){r.toggleClass(t,"is-tiny",K.clientWidth<400),r.toggleClass(t,"is-small",K.clientWidth<600&&K.clientWidth>=400),H=window.requestAnimationFrame(Q)};H=window.requestAnimationFrame(Q)}}),t.exports.format=u}).call(this,e("buffer").Buffer)},{"../common":1,"../flowplayer":31,"./ui/bar-slider":28,"./ui/slider":29,bean:34,buffer:35}],28:[function(e,t,n){var i=e("bean"),r=e("../../common");t.exports=function(e,t){var n=(t=t||{}).activeClass||"fp-color",o=t.inactiveClass||"fp-grey",a=t.childSelector||"em",s=!!t.rtl,l=!1,u=r.find(a,e).length,c={unload:function(){i.off(e,".barslider")},slide:function(t,s){r.find(a,e).forEach(function(e,i){var a=t>i/u;r.toggleClass(e,n,a),r.toggleClass(e,o,!a)}),s&&i.fire(e,"slide",[t])},disable:function(e){l=e}};return i.on(e,"mousedown.sld touchstart.sld",function(t){t.preventDefault(),l||(c.slide(f(t),!0),i.on(e,"mousemove.sld touchmove.sld",function(e){e.preventDefault(),c.slide(f(e),!0)}),i.one(document,"mouseup.sld touchup.sld",function(){i.off(e,"mousemove.sld touchmove.sld")}))}),c;function f(t){var n=t.pageX||t.clientX,i=r.offset(e),o=r.width(e);!n&&t.originalEvent&&t.originalEvent.touches&&t.originalEvent.touches.length&&(n=t.originalEvent.touches[0].pageX);var a=n-i.left,l=(a=Math.max(0,Math.min(o,a)))/o;return s&&(l=1-l),l}}},{"../../common":1,bean:34}],29:[function(e,t,n){"use strict";var i=e("bean"),r=e("../../common");t.exports=function(e,t){var n,o,a,s,l,u,c=r.lastChild(e),f=!1,d=function(){o=r.offset(e),a=r.width(e),r.height(e),s=a,u=m(l)},p=function(t){n||t==v.value||l&&!(t<l)||(i.fire(e,"slide",[t]),v.value=t)},h=function(e){var n=e.pageX||e.clientX;!n&&e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length&&(n=e.originalEvent.touches[0].pageX);var i=n-o.left,r=(i=Math.max(0,Math.min(u||s,i)))/s;return t&&(r=1-r),g(r,0,!0)},g=function(e,t){void 0===t&&(t=0),e>1&&(e=1);var n=Math.round(1e3*e)/10+"%";return(!l||e<=l)&&(f?r.removeClass(c,"animated"):(r.addClass(c,"animated"),r.css(c,"transition-duration",(t||0)+"ms")),r.css(c,"width",n)),e},m=function(e){return Math.max(0,Math.min(s,e*a))},v={max:function(e){l=e},disable:function(e){n=e},slide:function(e,t,n){d(),n&&p(e),g(e,t)},disableAnimation:function(t,n){f=!1!==t,r.toggleClass(e,"no-animation",!!n)}};return d(),i.on(e,"mousedown.sld touchstart",function(t){if(t.preventDefault(),!n){var o=(a=p,s=100,function(){l||(a.apply(this,arguments),l=1,setTimeout(function(){l=0},s))});d(),v.dragging=!0,r.addClass(e,"is-dragging"),p(h(t)),i.on(document,"mousemove.sld touchmove.sld",function(e){e.preventDefault(),o(h(e))}),i.one(document,"mouseup touchend",function(){v.dragging=!1,r.removeClass(e,"is-dragging"),i.off(document,"mousemove.sld touchmove.sld")})}var a,s,l}),v}},{"../../common":1,bean:34}],30:[function(e,t,n){t.exports=function(e,t,n){try{!function(e){var t=document.createElement("textarea");t.value=e,t.style.opacity=0,t.style.position="absolute",document.body.appendChild(t),t.select();var n=document.execCommand("copy");if(document.body.removeChild(t),!n)throw new Error("Unsuccessfull")}(e),t()}catch(e){n(e)}}},{}],31:[function(e,t,n){"use strict";var i=e("extend-object"),r=e("is-function"),o=e("bean"),a=e("./ext/ui/slider"),s=e("./ext/ui/bar-slider"),l=e("./common"),u=e("./ext/events"),c=[],f=[],d=window.onbeforeunload;window.onbeforeunload=function(e){if(c.forEach(function(e){e.conf.splash?e.unload():e.bind("error",function(){l.find(".flowplayer.is-error .fp-message").forEach(l.removeNode)})}),d)return d(e)};var p=/Safari/.exec(navigator.userAgent)&&!/Chrome/.exec(navigator.userAgent),h=/(\d+\.\d+) Safari/.exec(navigator.userAgent),g=h?Number(h[1]):100,m=t.exports=function(e,t,n){if(r(e))return f.push(e);if("number"==typeof e||void 0===e)return c[e||0];if(e.nodeType){if(null!==e.getAttribute("data-flowplayer-instance-id"))return c[e.getAttribute("data-flowplayer-instance-id")];if(!t)return;return b(e,t,n)}if(e.jquery)return m(e[0],t,n);if("string"==typeof e){var i=l.find(e)[0];return i&&m(i,t,n)}};i(m,{version:"7.2.7",engines:[],engine:function(e){return m.engines.filter(function(t){return t.engineName===e})[0]},extensions:[],conf:{},set:function(e,t){"string"==typeof e?m.conf[e]=t:i(m.conf,e)},registerExtension:function(e,t){m.extensions.push([e,t])},support:{},defaults:{debug:!1,disabled:!1,fullscreen:window==window.top,keyboard:!0,ratio:9/16,adaptiveRatio:!1,rtmp:0,proxy:"best",hlsQualities:!0,seekStep:!1,splash:!1,live:!1,livePositionOffset:120,swf:"//releases.flowplayer.org/7.2.7/flowplayer.swf",swfHls:"//releases.flowplayer.org/7.2.7/flowplayerhls.swf",speeds:[.25,.5,1,1.5,2],tooltip:!0,mouseoutTimeout:5e3,mutedAutoplay:!0,clickToUnMute:!0,volume:1,errors:["","Video loading aborted","Network error","Video not properly encoded","Video file not found","Unsupported video","Skin not found","SWF file not found","Subtitles not found","Invalid RTMP URL","Unsupported video format. Try installing Adobe Flash."],errorUrls:["","","","","","","","","","","http://get.adobe.com/flashplayer/"],playlist:[],hlsFix:p&&g<8,disableInline:!1},bean:o,common:l,slider:a,barSlider:s,extend:i});var v=0,y=e("./ext/resolve");if(void 0!==window.jQuery){var w=window.jQuery;w(function(){"function"==typeof w.fn.flowplayer&&w('.flowplayer:has(video:not(.fp-engine),script[type="application/json"])').flowplayer()});w.fn.flowplayer=function(e,t){return this.each(function(){"string"==typeof e&&(e={swf:e}),r(e)&&(t=e,e={});var n=w(this),o=n.find('script[type="application/json"]'),a=o.length?JSON.parse(o.text()):function(e){if(!e.length)return{};var t=e.data()||{},n={};return w.each(["autoplay","loop","preload","poster"],function(i,r){var o=e.attr(r);void 0!==o&&-1!==["autoplay","poster"].indexOf(r)?n[r]=o||!0:void 0!==o&&(t[r]=o||!0)}),e[0].autoplay=e[0].preload=!1,t.subtitles=e.find("track").map(function(){var e=w(this);return{src:e.attr("src"),kind:e.attr("kind"),label:e.attr("label"),srclang:e.attr("srclang"),default:e.prop("default")}}).get(),t.sources=(new y).sourcesFromVideoTag(e,w),i(n,{clip:t})}(n.find("video")),s=b(this,w.extend({},e||{},a,n.data()),t);
4323u.EVENTS.forEach(function(e){s.on(e+".jquery",function(e){n.trigger.call(n,e.type,e.detail&&e.detail.args)})}),n.data("flowplayer",s)})}}function b(e,t,n){t&&t.embed&&(t.embed=i({},m.defaults.embed,t.embed));var a=!1;try{void 0===m.conf.storage&&"object"==typeof window.localStorage&&(window.localStorage.flowplayerTestStorage="test",a=!0)}catch(e){}var s,d,p=e,h=i({},m.defaults,m.conf,t),g={},w=p.className,b=new y;l.addClass(p,"is-loading"),l.toggleClass(p,"no-flex",!m.support.flex),l.toggleClass(p,"no-svg",!m.support.svg);try{g=m.conf.storage||(a?window.localStorage:g)}catch(e){}if(h.volume="true"===g.muted?0:h.volume!==m.defaults.volume?h.volume:isNaN(g.volume)?h.volume:g.volume,h.debug=!!g.flowplayerDebug||h.debug,h.aspectRatio&&"string"==typeof h.aspectRatio){var I=h.aspectRatio.split(/[:\/]/);h.ratio=I[1]/I[0]}var M=p.currentStyle&&"rtl"===p.currentStyle.direction||window.getComputedStyle&&null!==window.getComputedStyle(p,null)&&"rtl"===window.getComputedStyle(p,null).getPropertyValue("direction");M&&l.addClass(p,"is-rtl");var C={conf:h,currentSpeed:1,volumeLevel:h.muted?0:void 0===h.volume?1*g.volume:h.volume,video:{},disabled:!1,finished:!1,loading:!1,muted:"true"==g.muted||h.muted,paused:!1,playing:!1,ready:!1,splash:!1,rtl:M,hijack:function(e){try{C.engine.suspendEngine()}catch(e){}C.hijacked=e},release:function(){try{C.engine.resumeEngine()}catch(e){}C.hijacked=!1},debug:function(){h.debug&&console.log.apply(console,["DEBUG"].concat([].slice.call(arguments)))},load:function(e,t){if(!C.error&&!C.loading){C.video={},C.finished=!1,e=e||h.clip,e=i({},b.resolve(e,h.clip.sources)),(C.playing||C.engine)&&(e.autoplay=!0);var n=A(e);if(!n)return setTimeout(function(){C.trigger("error",[C,{code:m.support.flashVideo?5:10}])})&&C;if(!n.engineName)throw new Error("engineName property of factory should be exposed");if(C.engine&&n.engineName===C.engine.engineName||(C.ready=!1,C.engine&&(C.engine.unload(),C.conf.autoplay=!0),d=C.engine=n(C,p),C.one("ready",function(){setTimeout(function(){C.muted?C.mute(!0,!0):d.volume(C.volumeLevel)})})),i(e,d.pick(e.sources.filter(function(e){return!e.engine||e.engine===d.engineName}))),e.src)C.trigger("load",[C,e,d],!0).defaultPrevented?C.loading=!1:(C.ready=!1,d.load(e),r(e)&&(t=e),t&&C.one("ready",t));return C}},pause:function(e){return C.hijacked?C.hijacked.pause(e)|C:(!C.ready||C.seeking||C.loading||(d.pause(),C.one("pause",e)),C)},resume:function(){if(!C.trigger("beforeresume",[C],!0).defaultPrevented)return C.hijacked?C.hijacked.resume()|C:(C.ready&&C.paused&&(d.resume(),C.finished&&(C.trigger("resume",[C]),C.finished=!1)),C)},toggle:function(){return C.ready?C.paused?C.resume():C.pause():C.load()},seek:function(e,t){if("boolean"==typeof e){var n=C.conf.seekStep||.1*C.video.duration;e=C.video.time+(e?n:-n),e=Math.min(Math.max(e,0),C.video.duration-.1)}if(void 0===e)return C;if(C.hijacked)return C.hijacked.seek(e,t)|C;C.ready&&(s=e,C.trigger("beforeseek",[C,e],!0).defaultPrevented?(C.seeking=!1,l.toggleClass(p,"is-seeking",C.seeking)):(d.seek(e),r(t)&&C.one("seek",t)));return C},seekTo:function(e,t){return void 0===e?C.seek(s,t):void 0!==C.video.seekOffset?C.seek(C.video.seekOffset+.1*(C.video.duration-C.video.seekOffset)*e,t):C.seek(.1*C.video.duration*e,t)},mute:function(e,t){return void 0===e&&(e=!C.muted),C.muted=e,t||(g.muted=e,g.volume=isNaN(g.volume)?h.volume:g.volume),void 0!==d.mute?d.mute(e):(C.volume(e?0:g.volume,!0),C.trigger("mute",[C,e])),C},volume:function(e,t){return C.ready&&(e=Math.min(Math.max(e,0),1),t||(g.volume=e),d.volume(e)),C},speed:function(e,t){return C.ready&&("boolean"==typeof e&&(e=h.speeds[h.speeds.indexOf(C.currentSpeed)+(e?1:-1)]||C.currentSpeed),d.speed(e),t&&p.one("speed",t)),C},stop:function(){return C.ready&&(C.pause(),!C.live||C.dvr?C.seek(0,function(){C.trigger("stop",[C])}):C.trigger("stop",[C])),C},unload:function(){return h.splash?(C.trigger("unload",[C]),d&&(d.unload(),C.engine=d=0)):C.stop(),C},shutdown:function(){C.unload(),C.trigger("shutdown",[C]),o.off(p),delete c[p.getAttribute("data-flowplayer-instance-id")],p.removeAttribute("data-flowplayer-instance-id")},disable:function(e){return void 0===e&&(e=!C.disabled),e!=C.disabled&&(C.disabled=e,C.trigger("disable",e)),C},registerExtension:function(e,t){e=e||[],t=t||[],"string"==typeof e&&(e=[e]),"string"==typeof t&&(t=[t]),e.forEach(function(e){C.extensions.js.push(e)}),t.forEach(function(e){C.extensions.css.push(e)})}};C.conf=i(C.conf,h),C.extensions={js:[],css:[]},m.extensions.forEach(function(e){C.registerExtension(e[0],e[1])}),u(C);var A=function(e){var t,n=m.engines;if(h.engine){var i=n.filter(function(e){return e.engineName===h.engine})[0];if(i&&e.sources.some(function(e){return(!e.engine||e.engine===i.engineName)&&i.canPlay(e.type,C.conf)}))return i}return h.enginePreference&&(n=m.engines.filter(function(e){return h.enginePreference.indexOf(e.engineName)>-1}).sort(function(e,t){return h.enginePreference.indexOf(e.engineName)-h.enginePreference.indexOf(t.engineName)}
4323)),e.sources.some(function(e){var i=n.filter(function(t){return(!e.engine||e.engine===t.engineName)&&t.canPlay(e.type,C.conf)}).shift();return i&&(t=i),!!i}),t};return p.getAttribute("data-flowplayer-instance-id")||(p.setAttribute("data-flowplayer-instance-id",v++),C.on("boot",function(){var e=m.support;(h.splash||l.hasClass(p,"is-splash")||!e.firstframe)&&(C.forcedSplash=!h.splash&&!l.hasClass(p,"is-splash"),C.splash=!0,h.splash||(h.splash=!0),l.addClass(p,"is-splash")),h.splash&&l.find("video",p).forEach(l.removeNode),(h.dvr||h.live||l.hasClass(p,"is-live"))&&(C.live=h.live=!0,C.dvr=h.dvr=!!h.dvr||l.hasClass(p,"is-dvr"),l.addClass(p,"is-live"),l.toggleClass(p,"is-dvr",C.dvr)),f.forEach(function(e){e(C,p)}),c.push(C),h.splash?C.unload():C.load(),h.disabled&&C.disable(),C.one("ready",n),C.one("shutdown",function(){p.className=w})}).on("load",function(e,t,n){h.splash&&l.find(".flowplayer.is-ready,.flowplayer.is-loading").forEach(function(e){var t=e.getAttribute("data-flowplayer-instance-id");if(t!==p.getAttribute("data-flowplayer-instance-id")){var n=c[Number(t)];n&&n.conf.splash&&n.unload()}}),l.addClass(p,"is-loading"),t.loading=!0,void 0===n.live&&void 0===n.dvr||(l.toggleClass(p,"is-live",n.dvr||n.live),l.toggleClass(p,"is-dvr",!!n.dvr),t.live=n.dvr||n.live,t.dvr=!!n.dvr)}).on("ready",function(e,t,n){n.time=0,t.video=n,l.removeClass(p,"is-loading"),t.loading=!1,t.muted?t.mute(!0,!0):t.volume(t.volumeLevel);var i=t.conf.hlsFix&&/mpegurl/i.exec(n.type);l.toggleClass(p,"hls-fix",!!i)}).on("unload",function(){l.removeClass(p,"is-loading"),C.loading=!1}).on("ready unload",function(e){var t="ready"==e.type;l.toggleClass(p,"is-splash",!t),l.toggleClass(p,"is-ready",t),C.ready=t,C.splash=!t}).on("progress",function(e,t,n){t.video.time=n}).on("buffer",function(e,t,n){t.video.buffer="number"==typeof n?n:n.length?n[n.length-1].end:0}).on("speed",function(e,t,n){t.currentSpeed=n}).on("volume",function(e,t,n){t.volumeLevel=Math.round(100*n)/100,t.muted&&n&&t.mute(!1)}).on("beforeseek seek",function(e){C.seeking="beforeseek"==e.type,l.toggleClass(p,"is-seeking",C.seeking)}).on("ready pause resume unload finish stop",function(e){C.paused=/pause|finish|unload|stop/.test(e.type),C.paused=C.paused||"ready"===e.type&&!h.autoplay&&!C.playing,C.playing=!C.paused,l.toggleClass(p,"is-paused",C.paused),l.toggleClass(p,"is-playing",C.playing),C.load.ed||C.pause()}).on("finish",function(){C.finished=!0}).on("error",function(){})),C.trigger("boot",[C,p]),C}},{"./common":1,"./ext/events":12,"./ext/resolve":21,"./ext/ui/bar-slider":28,"./ext/ui/slider":29,bean:34,"extend-object":39,"is-function":42}],32:[function(e,t,n){e("es5-shim");var i=t.exports=e("./flowplayer");e("./ext/support"),e("./engine/embed"),e("./engine/hlsjs"),e("./engine/html5"),e("./engine/flash"),e("./ext/ui"),e("./ext/message"),e("./ext/keyboard"),e("./ext/playlist"),e("./ext/cuepoint"),e("./ext/subtitle"),e("./ext/analytics"),e("./ext/share"),e("./ext/facebook"),e("./ext/twitter"),e("./ext/embed"),e("./ext/airplay"),e("./ext/chromecast"),e("./ext/qsel"),e("./ext/menu"),e("./ext/fullscreen"),e("./ext/mobile"),i(function(e,t){var n,r,o,a,s=e.conf,l=i.common,u=l.createElement,c=s.swf.indexOf("flowplayer.org")&&s.e&&t.getAttribute("data-origin"),f=c?(n=c,(r=document.createElement("a")).href=n,l.hostname(r.hostname)):l.hostname(),d=(document,s.key);if("file:"==location.protocol&&(f="localhost"),e.load.ed=1,s.hostname=f,s.origin=c||location.href,c&&(a="is-embedded",-1===(o=t).className.split(" ").indexOf(a)&&(o.className+=" "+a)),"string"==typeof d&&(d=d.split(/,\s*/)),d&&"function"==typeof key_check&&key_check(d,f)){if(s.logo){var p=l.find(".fp-player",t)[0],h=s.logo.href||"",g=s.logo.src||s.logo,m=u("a",{className:"fp-logo",href:h});c&&(m.href=m.href||c),s.embed&&s.embed.popup&&(m.target="_blank");var v=u("img",{src:g});m.appendChild(v),(p||t).appendChild(m)}}else{m=u("a",{href:"https://flowplayer.com/hello/?from=player"});((p=l.find(".fp-player",t)[0])||t).appendChild(m);var y=u("div",{className:"fp-context-menu fp-menu"},'<strong>&copy; 2018 Flowplayer AB</strong><a href="https://flowplayer.com/hello/?from=player">About Flowplayer</a><a href="https://flowplayer.com/license">GPL based license</a>'),w=window.location.href.indexOf("localhost");7!==w&&(p||t).appendChild(y),e.on("pause resume finish unload ready",function(e,n){var i,r=-1;if(n.video.src)for(var o=[["org","flowplayer","drive"],["org","flowplayer","my"],["org","flowplayer","cdn"],["com","flowplayer","cdn"]],a=0;a<o.length&&(r=n.video.src.indexOf("://"+o[a].reverse().join(".")),-1===r);a++);if(/pause|resume/.test(e.type)&&"flash"!=n.engine.engineName&&4!=r&&5!=r){var s={display:"block",position:"absolute",left:"16px",bottom:"70px",zIndex:99999,width:"100px",height:"20px",backgroundImage:"url("+[".png","logo","/",".net",".cloudfront","d32
4323wqyuo10o653","//","https:"].reverse().join("")+")"};for(var l in s)s.hasOwnProperty(l)&&(m.style[l]=s[l]);n.load.ed=(i=m,"none"!==window.getComputedStyle(i).display&&(7===w||y.parentNode==t||y.parentNode==p)),n.load.ed||n.pause()}else m.style.display="none"})}})},{"./engine/embed":2,"./engine/flash":3,"./engine/hlsjs":4,"./engine/html5":6,"./ext/airplay":7,"./ext/analytics":8,"./ext/chromecast":9,"./ext/cuepoint":10,"./ext/embed":11,"./ext/facebook":13,"./ext/fullscreen":14,"./ext/keyboard":15,"./ext/menu":16,"./ext/message":17,"./ext/mobile":18,"./ext/playlist":19,"./ext/qsel":20,"./ext/share":22,"./ext/subtitle":23,"./ext/support":25,"./ext/twitter":26,"./ext/ui":27,"./flowplayer":31,"es5-shim":38}],33:[function(e,t,n){"use strict";n.byteLength=function(e){return 3*e.length/4-u(e)},n.toByteArray=function(e){var t,n,i,a,s,l,c=e.length;s=u(e),l=new o(3*c/4-s),i=s>0?c-4:c;var f=0;for(t=0,n=0;t<i;t+=4,n+=3)a=r[e.charCodeAt(t)]<<18|r[e.charCodeAt(t+1)]<<12|r[e.charCodeAt(t+2)]<<6|r[e.charCodeAt(t+3)],l[f++]=a>>16&255,l[f++]=a>>8&255,l[f++]=255&a;2===s?(a=r[e.charCodeAt(t)]<<2|r[e.charCodeAt(t+1)]>>4,l[f++]=255&a):1===s&&(a=r[e.charCodeAt(t)]<<10|r[e.charCodeAt(t+1)]<<4|r[e.charCodeAt(t+2)]>>2,l[f++]=a>>8&255,l[f++]=255&a);return l},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,o="",a=[],s=0,l=n-r;s<l;s+=16383)a.push(c(e,s,s+16383>l?l:s+16383));1===r?(t=e[n-1],o+=i[t>>2],o+=i[t<<4&63],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=i[t>>10],o+=i[t>>4&63],o+=i[t<<2&63],o+="=");return a.push(o),a.join("")};for(var i=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)i[s]=a[s],r[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function c(e,t,n){for(var r,o,a=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],a.push(i[(o=r)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],34:[function(e,t,n){var i,r;i=this,r=function(e,t){e=e||"bean",t=t||this;var n,i,r,o,a,s,l,u,c,f,d,p,h,g,m,v,y,w,b,I=window,M=t[e],C=/[^\.]*(?=\..*)\.|.*/,A=/\..*/,S="addEventListener",E=document||{},D=E.documentElement||{},N=D[S],j=N?S:"attachEvent",L={},x=Array.prototype.slice,T=function(e,t){return e.split(t||" ")},Z=function(e){return"string"==typeof e},P=function(e){return"function"==typeof e},k=function(e,t,n){for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},T("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll "+(N?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinput readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":""))),Y=(w="compareDocumentPosition"in D?function(e,t){return t.compareDocumentPosition&&16==(16&t.compareDocumentPosition(e))}:"contains"in D?function(e,t){return(t=9===t.nodeType||t===window?D:t)!==e&&t.contains(e)}:function(e,t){for(;e=e.parentNode;)if(e===t)return 1;return 0},{mouseenter:{base:"mouseover",condition:b=function(e){var t=e.relatedTarget;return t?t!==this&&"xul"!==t.prefix&&!/document/.test(this.toString())&&!w(t,this):null==t}}
4323,mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}),z=(s=T("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which propertyName"),l=s.concat(T("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement")),u=l.concat(T("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),c=s.concat(T("char charCode key keyCode keyIdentifier keyLocation location")),f=s.concat(T("data")),d=s.concat(T("touches targetTouches changedTouches scale rotation")),p=s.concat(T("data origin source")),h=s.concat(T("state")),g=/over|out/,m=[{reg:/key/i,fix:function(e,t){return t.keyCode=e.keyCode||e.which,c}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(e,t,n){return t.rightClick=3===e.which||2===e.button,t.pos={x:0,y:0},e.pageX||e.pageY?(t.clientX=e.pageX,t.clientY=e.pageY):(e.clientX||e.clientY)&&(t.clientX=e.clientX+E.body.scrollLeft+D.scrollLeft,t.clientY=e.clientY+E.body.scrollTop+D.scrollTop),g.test(n)&&(t.relatedTarget=e.relatedTarget||e[("mouseover"==n?"from":"to")+"Element"]),l}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return u}},{reg:/^text/i,fix:function(){return f}},{reg:/^touch|^gesture/i,fix:function(){return d}},{reg:/^message$/i,fix:function(){return p}},{reg:/^popstate$/i,fix:function(){return h}},{reg:/.*/,fix:function(){return s}}],v={},(y=function(e,t,n){if(arguments.length&&(e=e||((t.ownerDocument||t.document||t).parentWindow||I).event,this.originalEvent=e,this.isNative=n,this.isBean=!0,e)){var i,r,o,a,s,l=e.type,u=e.target||e.srcElement;if(this.target=u&&3===u.nodeType?u.parentNode:u,n){if(!(s=v[l]))for(i=0,r=m.length;i<r;i++)if(m[i].reg.test(l)){v[l]=s=m[i].fix;break}for(i=(a=s(e,this,l)).length;i--;)!((o=a[i])in this)&&o in e&&(this[o]=e[o])}}}).prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},y.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},y.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},y.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},y.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},y.prototype.clone=function(e){var t=new y(this,this.element,this.isNative);return t.currentTarget=e,t},y),G=function(e,t){return N||t||e!==E&&e!==I?e:D},R=(o=function(e,t,n,i){var r=function(n,r){return t.apply(e,i?x.call(r,n?0:1).concat(i):r)},o=function(n,i){return t.__beanDel?t.__beanDel.ft(n.target,e):i},a=n?function(e){var t=o(e,this);if(n.apply(t,arguments))return e&&(e.currentTarget=t),r(e,arguments)}:function(e){return t.__beanDel&&(e=e.clone(o(e))),r(e,arguments)};return a.__beanDel=t.__beanDel,a},(a=function(e,t,n,i,r,a,s){var l,u=Y[t];"unload"==t&&(n=B(F,e,t,n,i)),u&&(u.condition&&(n=o(e,n,u.condition,a)),t=u.base||t),this.isNative=l=k[t]&&!!e[j],this.customType=!N&&!l&&t,this.element=e,this.type=t,this.original=i,this.namespaces=r,this.eventType=N||l?t:"propertychange",this.target=G(e,l),this[j]=!!this.target[j],this.root=s,this.handler=o(e,n,null,a)}).prototype.inNamespaces=function(e){var t,n,i=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&i++;return e.length===i},a.prototype.matches=function(e,t,n){return!(this.element!==e||t&&this.original!==t||n&&this.handler!==n)},a),O=(i={},r=function(e,t,n,o,a,s){var l=a?"r":"$";if(t&&"*"!=t){var u,c=0,f=i[l+t],d="*"==e;if(!f)return;for(u=f.length;c<u;c++)if((d||f[c].matches(e,n,o))&&!s(f[c],f,c,t))return}else for(var p in i)p.charAt(0)==l&&r(e,p.substr(1),n,o,a,s)},{has:function(e,t,n,r){var o,a=i[(r?"r":"$")+t];if(a)for(o=a.length;o--;)if(!a[o].root&&a[o].matches(e,n,null))return!0;return!1},get:function(e,t,n,i){var o=[];return r(e,t,n,null,i,function(e){return o.push(e)}),o},put:function(e){var t=!e.root&&!this.has(e.element,e.type,null,!1),n=(e.root?"r":"$")+e.type;return(i[n]||(i[n]=[])).push(e),t},del:function(e){r(e.element,e.type,null,e.handler,e.root,function(e,t,n){return t.splice(n,1),e.removed=!0,0===t.length&&delete i[(e.root?"r":"$")+e.type],!1})},entries:function(){var e,t=[];for(e in i)"$"==e.charAt(0)&&(t=t.concat(i[e]));return t}}),W=function(e){n=arguments.length?e:E.querySelectorAll?function(e,t){return t.querySelectorAll(e)}:function(){throw new Error("Bean: No selector engine installed")}},U=function(e,t){if(N||!t||!e||e.propertyName=="_on"+t){var n=O.get(this,t||e.type,null,!1),i=n.length,r=0;for(e=new z(e,this,!0),t&&(e.type=t);r<i&&!e.isImmediatePropagationStopped();r++)n[r].removed||n[r].handler.call(this,e)}},J=N?function(e,t,n){e[n?S:"removeEventListener"](t,U,!1)}:function(e,t,n,i){var r;n?(O.put(r=new R(e,i||t,function(t){U.call(e,t,i)},U,null,null,!0)),i&&null==e["_on"+i]&&(e["_on"+i]=0),r.target.attachEvent("on"+r.eventType,r.handler)):(r=O.get(e,i||t,U,!0)[0])&&(r.target.detachEvent("on"+r.eventType,r.handler),O.del(r))},B=function(e,t,n,i,r){return function(){i.apply(this,arguments),e(t,n,r)}},F=function(e,t,n,i){var r,o,a=t&&t.replace(A,""),s=O.get(e,a,null,!1),l={};for(r=0,o=s.length;r<o;r++)n&&s[r].original!==n||!s[r].inNamespaces(i)||(O.del(s[r]),!l[s[r].eventType]&&s[r][j]&&(l[s[r].eventType]={t:s[r].eventType,c:s[r].type}));for(r in l)O.has(e,l[r].t,null,!1)||J(e,l[r].t,!1,l[r].c)},H=N?function(e,t,n){var i=E.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,I,1),n.dispatchEvent(i)}:function(e,t,n){n=G(n,e),e?n.fireEvent("on"+t,E.createEventObject()):n["_on"+t]++},V=function(e,t,n){var i,r,o,a,s=Z(t);if(s&&t.indexOf(" ")>0){for(a=(t=T(t)).length;a--;)V(e,t[a],n);return e}if((r=s&&t.replace(A,""))&&Y[r]&&(r=Y[r].base),!t||s)(o=s&&t.replace(C,""))&&(o=T(o,".")),F(e,r,n,o);else if(P(t))F(e,null,t);else for(i in t)t.hasOwnProperty(i)&&V(e,i,t[i]);return e},X=function(e,t,i,r){var o,a,s,l,u,c,f;if(void 0!==i||"object"!=typeof t){var d,p,h,g;for(P(i)?(u=x.call(arguments,3),r=o=i):(o=r,u=x.call(arguments,4),p=o,(g=function(e){var t=h(e.target,this);t&&p.apply(t,arguments)}).__beanDel={ft:h=function(e,t){for(var i,r=Z(d)?n(d,t):d;e&&e!==t;e=e.parentNode)for(i=r.length;i--;)if(r[i]===e)return e},selector:d=i},r=g),s=T(t),this===L&&(r=B(V,e,t,r,o)),l=s.length;l--;)f=O.put(c=new R(e,s[l].replace(A,""),r,o,T(s[l].replace(C,""),"."),u,!1)),c[j]&&f&&J(e,c.eventType,!0,c.customType);return e}
4323for(a in t)t.hasOwnProperty(a)&&X.call(this,e,a,t[a])},_={on:X,add:function(e,t,n,i){return X.apply(null,Z(n)?[e,n,t,i].concat(arguments.length>3?x.call(arguments,5):[]):x.call(arguments))},one:function(){return X.apply(L,arguments)},off:V,remove:V,clone:function(e,t,n){for(var i,r,o=O.get(t,n,null,!1),a=o.length,s=0;s<a;s++)o[s].original&&(i=[e,o[s].type],(r=o[s].handler.__beanDel)&&i.push(r.selector),i.push(o[s].original),X.apply(null,i));return e},fire:function(e,t,n){var i,r,o,a,s,l=T(t);for(i=l.length;i--;)if(t=l[i].replace(A,""),(a=l[i].replace(C,""))&&(a=T(a,".")),a||n||!e[j])for(s=O.get(e,t,null,!1),n=[!1].concat(n),r=0,o=s.length;r<o;r++)s[r].inNamespaces(a)&&s[r].handler.apply(e,n);else H(k[t],t,e);return e},Event:z,setSelectorEngine:W,noConflict:function(){return t[e]=M,this}};if(I.attachEvent){var K=function(){var e,t=O.entries();for(e in t)t[e].type&&"unload"!==t[e].type&&V(t[e].element,t[e].type);I.detachEvent("onunload",K),I.CollectGarbage&&I.CollectGarbage()};I.attachEvent("onunload",K)}return W(),_},void 0!==t&&t.exports?t.exports=r():i.bean=r()},{}],35:[function(e,t,n){(function(t){"use strict";var i=e("base64-js"),r=e("ieee754"),o=e("isarray");function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return u(this,e,t,n)}function u(e,t,n,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=d(e,t);return e}(e,t,n,i):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|h(t,n),r=(e=s(e,i)).write(t,n);r!==i&&(e=e.slice(0,r));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|p(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?s(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=s(e,t<0?0:0|p(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|p(t.length);e=s(e,n);for(var i=0;i<n;i+=1)e[i]=255&t[i];return e}function p(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(i)return Y(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function m(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}
vendor: 7,480 bytes, line 4323
4323if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,i,r);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,i,r){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var c=-1;for(o=n;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var f=!0,d=0;d<l;d++)if(u(e,o+d)!==u(t,d)){f=!1;break}if(f)return o}return-1}function y(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var a=0;a<i;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,i){return G(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function b(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var o,a,s,l,u=e[r],c=null,f=u>239?4:u>223?3:u>191?2:1;if(r+f<=n)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[r+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[r+1],a=e[r+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[r+1],a=e[r+2],s=e[r+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),r+=f}return function(e){var t=e.length;if(t<=M)return String.fromCharCode.apply(String,e);var n="",i=0;for(;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=M));return n}(i)}n.Buffer=l,n.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},n.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),n.kMaxLength=a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return u(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return i=null,o=t,a=n,c(r=e),r<=0?s(i,r):void 0!==o?"string"==typeof a?s(i,r).fill(o,a):s(i,r).fill(o):s(i,r);var i,r,o,a},l.allocUnsafe=function(e){return f(null,e)},l.allocUnsafeSlow=function(e){return f(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,r=0,o=Math.min(n,i);r<o;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=l.allocUnsafe(t),r=0;for(n=0;n<e.length;++n){var a=e[n];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,r),r+=a.length}return i},l.byteLength=h,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):function(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return b(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,i,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,r>>>=0,this===e)return 0;for(var o=r-i,a=n-t,s=Math.min(o,a),u=this.slice(i,r),c=e.slice(t,n),f=0;f<s;++f)if(u[f]!==c[f]){o=u[f],a=c[f];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},l.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,l,u,c,f,d,p,h=!1;;)switch(i){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return d=t,p=n,G(Y(e,(f=this).length-d),f,d,p);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return l=this,u=t,c=n,G(z(e),l,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=n,G(function(e,t){for(var n,i,r,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),i=n>>8,r=n%256,o.push(r),o.push(i);return o}(e,(o=this).length-a),o,a,s);default:if(h)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),h=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;
vendor: 8,133 bytes, line 4323
4323function C(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function A(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function S(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var r="",o=t;o<n;++o)r+=k(e[o]);return r}function E(e,t,n){for(var i=e.slice(t,n),r="",o=0;o<i.length;o+=2)r+=String.fromCharCode(i[o]+256*i[o+1]);return r}function D(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,i,r,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function j(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-n,2);r<o;++r)e[n+r]=(t&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function L(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-n,4);r<o;++r)e[n+r]=t>>>8*(i?r:3-r)&255}function x(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function T(e,t,n,i,o){return o||x(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function Z(e,t,n,i,o){return o||x(e,0,n,8),r.write(e,t,n,i,52,8),n+8}l.prototype.slice=function(e,t){var n,i=this.length;if(e=~~e,t=void 0===t?i:~~t,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),t<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var r=t-e;n=new l(r,void 0);for(var o=0;o<r;++o)n[o]=this[o+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var i=this[e],r=1,o=0;++o<t&&(r*=256);)i+=this[e+o]*r;return i},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},l.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var i=this[e],r=1,o=0;++o<t&&(r*=256);)i+=this[e+o]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,i){(e=+e,t|=0,n|=0,i)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[t]=255&e;++o<n&&(r*=256);)this[t+o]=e/r&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,i){(e=+e,t|=0,n|=0,i)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var r=n-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return T(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return T(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return Z(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return Z(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var r,o=i-n;if(this===e&&n<t&&t<i)for(r=o-1;r>=0;--r)e[r+t]=this[r+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)e[r+t]=this[r+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},l.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=l.isBuffer(e)?e:Y(new l(e,i).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function k(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){var n;t=t||1/0;for(var i=e.length,r=null,o=[],a=0;a<i;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!r){if(n>56319){(t-=3)>
4323-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":33,ieee754:40,isarray:43}],36:[function(e,t,n){var i=e("indexof");function r(e){return!!e}t.exports=function(e){var t=e.classList;if(t)return t;var n={add:o,remove:a,contains:s,toggle:function(e){return s(e)?(a(e),!1):(o(e),!0)},toString:function(){return e.className},length:0,item:function(e){return l()[e]||null}};return n;function o(e){var t=l();i(t,e)>-1||(t.push(e),u(t))}function a(e){var t=l(),n=i(t,e);-1!==n&&(t.splice(n,1),u(t))}function s(e){return i(l(),e)>-1}function l(){var t=e.className;return function(e,t){for(var n=[],i=0;i<e.length;i++)t(e[i])&&n.push(e[i]);return n}(t.split(" "),r)}function u(t){var i=t.length;e.className=t.join(" "),n.length=i;for(var r=0;r<t.length;r++)n[r]=t[r];delete t[i]}}},{indexof:41}],37:[function(e,t,n){t.exports=function(e,t,n,i){if(i=(n=window.getComputedStyle)?n(e):e.currentStyle)return i[t.replace(/-(\w)/gi,function(e,t){return t.toUpperCase()})]}},{}],38:[function(e,t,n){!function(e,i){"use strict";"object"==typeof n?t.exports=i():e.returnExports=i()}(this,function(){var e,t,n=Array,i=n.prototype,r=Object,o=r.prototype,a=Function,s=a.prototype,l=String,u=l.prototype,c=Number,f=c.prototype,d=i.slice,p=i.splice,h=i.push,g=i.unshift,m=i.concat,v=i.join,y=s.call,w=s.apply,b=Math.max,I=Math.min,M=o.toString,C="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,A=Function.prototype.toString,S=/^\s*class /,E=function(e){try{var t=A.call(e).replace(/\/\/.*\n/g,"").replace(/\/\*[.\s\S]*\*\//g,"").replace(/\n/gm," ").replace(/ {2}/g," ");return S.test(t)}catch(e){return!1}},D=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(C)return function(e){try{return!E(e)&&(A.call(e),!0)}catch(e){return!1}}(e);if(E(e))return!1;var t=M.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t},N=RegExp.prototype.exec;e=function(e){return"object"==typeof e&&(C?function(e){try{return N.call(e),!0}catch(e){return!1}}(e):"[object RegExp]"===M.call(e))};var j=String.prototype.valueOf;t=function(e){return"string"==typeof e||"object"==typeof e&&(C?function(e){try{return j.call(e),!0}catch(e){return!1}}(e):"[object String]"===M.call(e))};var L,x,T=r.defineProperty&&function(){try{var e={};r.defineProperty(e,"x",{enumerable:!1,value:e});for(var t in e)return!1;return e.x===e}catch(e){return!1}}(),Z=(L=o.hasOwnProperty,x=T?function(e,t,n,i){!i&&t in e||r.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(e,t,n,i){!i&&t in e||(e[t]=n)},function(e,t,n){for(var i in t)L.call(t,i)&&x(e,i,t[i],n)}),P=function(e){var t=typeof e;return null===e||"object"!==t&&"function"!==t},k=c.isNaN||function(e){return e!=e},Y=function(e){var t=+e;return k(t)?t=0:0!==t&&t!==1/0&&t!==-1/0&&(t=(t>0||-1)*Math.floor(Math.abs(t))),t},z=function(e){var t,n,i;if(P(e))return e;if(n=e.valueOf,D(n)&&(t=n.call(e),P(t)))return t;if(i=e.toString,D(i)&&(t=i.call(e),P(t)))return t;throw new TypeError},G=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return r(e)},R=function(e){return e>>>0},O=function(){};Z(s,{bind:function(e){var t=this;if(!D(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);
4323for(var n,i=d.call(arguments,1),o=b(0,t.length-i.length),s=[],l=0;l<o;l++)h.call(s,"$"+l);return n=a("binder","return function ("+v.call(s,",")+"){ return binder.apply(this, arguments); }")(function(){if(this instanceof n){var o=w.call(t,this,m.call(i,d.call(arguments)));return r(o)===o?o:this}return w.call(t,e,m.call(i,d.call(arguments)))}),t.prototype&&(O.prototype=t.prototype,n.prototype=new O,O.prototype=null),n}});var W=y.bind(o.hasOwnProperty),U=y.bind(o.toString),J=y.bind(d),B=w.bind(d),F=y.bind(u.slice),H=y.bind(u.split),V=y.bind(u.indexOf),X=y.bind(h),_=y.bind(o.propertyIsEnumerable),K=y.bind(i.sort),Q=n.isArray||function(e){return"[object Array]"===U(e)},q=1!==[].unshift(0);Z(i,{unshift:function(){return g.apply(this,arguments),this.length}},q),Z(n,{isArray:Q});var $=r("a"),ee="a"!==$[0]||!(0 in $),te=function(e){var t=!0,n=!0,i=!1;if(e)try{e.call("foo",function(e,n,i){"object"!=typeof i&&(t=!1)}),e.call([1],function(){"use strict";n="string"==typeof this},"x")}catch(e){i=!0}return!!e&&!i&&t&&n};Z(i,{forEach:function(e){var n,i=G(this),r=ee&&t(this)?H(this,""):i,o=-1,a=R(r.length);if(arguments.length>1&&(n=arguments[1]),!D(e))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++o<a;)o in r&&(void 0===n?e(r[o],o,i):e.call(n,r[o],o,i))}},!te(i.forEach)),Z(i,{map:function(e){var i,r=G(this),o=ee&&t(this)?H(this,""):r,a=R(o.length),s=n(a);if(arguments.length>1&&(i=arguments[1]),!D(e))throw new TypeError("Array.prototype.map callback must be a function");for(var l=0;l<a;l++)l in o&&(s[l]=void 0===i?e(o[l],l,r):e.call(i,o[l],l,r));return s}},!te(i.map)),Z(i,{filter:function(e){var n,i,r=G(this),o=ee&&t(this)?H(this,""):r,a=R(o.length),s=[];if(arguments.length>1&&(i=arguments[1]),!D(e))throw new TypeError("Array.prototype.filter callback must be a function");for(var l=0;l<a;l++)l in o&&(n=o[l],(void 0===i?e(n,l,r):e.call(i,n,l,r))&&X(s,n));return s}},!te(i.filter)),Z(i,{every:function(e){var n,i=G(this),r=ee&&t(this)?H(this,""):i,o=R(r.length);if(arguments.length>1&&(n=arguments[1]),!D(e))throw new TypeError("Array.prototype.every callback must be a function");for(var a=0;a<o;a++)if(a in r&&!(void 0===n?e(r[a],a,i):e.call(n,r[a],a,i)))return!1;return!0}},!te(i.every)),Z(i,{some:function(e){var n,i=G(this),r=ee&&t(this)?H(this,""):i,o=R(r.length);if(arguments.length>1&&(n=arguments[1]),!D(e))throw new TypeError("Array.prototype.some callback must be a function");for(var a=0;a<o;a++)if(a in r&&(void 0===n?e(r[a],a,i):e.call(n,r[a],a,i)))return!0;return!1}},!te(i.some));var ne=!1;i.reduce&&(ne="object"==typeof i.reduce.call("es5",function(e,t,n,i){return i})),Z(i,{reduce:function(e){var n=G(this),i=ee&&t(this)?H(this,""):n,r=R(i.length);if(!D(e))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===r&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var o,a=0;if(arguments.length>=2)o=arguments[1];else for(;;){if(a in i){o=i[a++];break}if(++a>=r)throw new TypeError("reduce of empty array with no initial value")}for(;a<r;a++)a in i&&(o=e(o,i[a],a,n));return o}},!ne);var ie=!1;i.reduceRight&&(ie="object"==typeof i.reduceRight.call("es5",function(e,t,n,i){return i})),Z(i,{reduceRight:function(e){var n,i=G(this),r=ee&&t(this)?H(this,""):i,o=R(r.length);if(!D(e))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var a=o-1;if(arguments.length>=2)n=arguments[1];else for(;;){if(a in r){n=r[a--];break}if(--a<0)throw new TypeError("reduceRight of empty array with no initial value")}if(a<0)return n;do{a in r&&(n=e(n,r[a],a,i))}while(a--);return n}},!ie);var re=i.indexOf&&-1!==[0,1].indexOf(1,2);Z(i,{indexOf:function(e){var n=ee&&t(this)?H(this,""):G(this),i=R(n.length);if(0===i)return-1;var r=0;for(arguments.length>1&&(r=Y(arguments[1])),r=r>=0?r:b(0,i+r);r<i;r++)if(r in n&&n[r]===e)return r;return-1}},re);var oe=i.lastIndexOf&&-1!==[0,1].lastIndexOf(0,-3);Z(i,{lastIndexOf:function(e){var n=ee&&t(this)?H(this,""):G(this),i=R(n.length);if(0===i)return-1;var r=i-1;for(arguments.length>1&&(r=I(r,Y(arguments[1]))),r=r>=0?r:i-Math.abs(r);r>=0;r--)if(r in n&&e===n[r])return r;return-1}},oe);var ae,se,le=(se=(ae=[1,2]).splice(),2===ae.length&&Q(se)&&0===se.length);Z(i,{splice:function(e,t){return 0===arguments.length?[]:p.apply(this,arguments)}},!le);var ue,ce=(ue={},i.splice.call(ue,0,0,1),1===ue.length);Z(i,{splice:function(e,t){if(0===arguments.length)return[];var n=arguments;return this.length=b(Y(this.length),0),arguments.length>0&&"number"!=typeof t&&((n=J(arguments)).length<2?X(n,this.length-e):n[1]=Y(t)),p.apply(this,n)}},!ce);var fe,de,pe=((fe=new n(1e5))[8]="x",fe.splice(1,1),7===fe.indexOf("x")),he=((de=[])[256]="a",de.splice(257,0,"b"),"a"===de[256]);Z(i,{splice:function(e,t){for(var n,i=G(this),r=[],o=R(i.length),a=Y(e),s=a<0?b(o+a,0):I(a,o),u=I(b(Y(t),0),o-s),c=0;c<u;)n=l(s+c),W(i,n)&&(r[c]=i[n]),c+=1;var f,d=J(arguments,2),p=d.length;if(p<u){c=s;for(var h=o-u;c<h;)n=l(c+u),f=l(c+p),W(i,n)?i[f]=i[n]:delete i[f],c+=1;c=o;for(var g=o-u+p;c>g;)delete i[c-1],c-=1}else if(p>u)for(c=o-u;c>s;)n=l(c+u-1),f=l(c+p-1),W(i,n)?i[f]=i[n]:delete i[f],c-=1;c=s;for(var m=0;m<d.length;++m)i[c]=d[m],c+=1;return i.length=o-u+p,r}},!pe||!he);var ge,me=i.join;try{ge="1,2,3"!==Array.prototype.join.call("123",",")}catch(e){ge=!0}ge&&Z(i,{join:function(e){var n=void 0===e?",":e;return me.call(t(this)?H(this,""):this,n)}},ge);var ve="1,2"!==[1,2].join(void 0);ve&&Z(i,{join:function(e){var t=void 0===e?",":e;return me.call(this,t)}},ve);var ye,we=function(e){for(var t=G(this),n=R(t.length),i=0;i<arguments.length;)t[n+i]=arguments[i],i+=1;return t.length=n+i,n+i},be=(ye={},1!==Array.prototype.push.call(ye,void 0)||1!==ye.length||void 0!==ye[0]||!W(ye,0));Z(i,{push:function(e){return Q(this)?h.apply(this,arguments):we.apply(this,arguments)}},be);var Ie,Me=1!==(Ie=[]).push(void 0)||1!==Ie.length||void 0!==Ie[0]||!W(Ie,0);Z(i,{push:we},Me),Z(i,{slice:function(e,n){var i=t(this)?H(this,""):this;return B(i,arguments)}},ee);var Ce=function(){try{return[1,2].sort(null),[1,2].sort({}),!0}catch(e){}return!1}(),Ae=function(){try{return[1,2].sort(/a/),!1}catch(e){}return!0}(),Se=function(){try{return[1,2].sort(void 0),!0}catch(e){}return!1}();Z(i,{sort:function(e){if(void 0===e)return K(this);if(!D(e))throw new TypeError("Array.prototype.sort callback must be a function");return K(this,e)}},Ce||!Se||!Ae);var Ee=!_({toString:null},"toString"),De=_(function(){},"prototype"),Ne=!W("x","0"),je=function(e){var t=e.constructor;return t&&t.prototype===e},Le={$window:!0,$console:!0,$parent:!0,$self:!0,$frame:!0,$frames:!0,$frameElement:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$external:!0},xe=function(){if("undefined"==typeof window)return!1;for(var e in window)try{!Le["$"+e]&&W(window,e)&&null!==window[e]&&"object"==typeof window[e]&&je(window[e])}catch(e){return!0}return!1}
4323(),Te=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ze=Te.length,Pe=function(e){return"[object Arguments]"===U(e)},ke=Pe(arguments)?Pe:function(e){return null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&!Q(e)&&D(e.callee)};Z(r,{keys:function(e){var n=D(e),i=ke(e),r=null!==e&&"object"==typeof e,o=r&&t(e);if(!r&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var a=[],s=De&&n;if(o&&Ne||i)for(var u=0;u<e.length;++u)X(a,l(u));if(!i)for(var c in e)s&&"prototype"===c||!W(e,c)||X(a,l(c));if(Ee)for(var f=function(e){if("undefined"==typeof window||!xe)return je(e);try{return je(e)}catch(e){return!1}}(e),d=0;d<Ze;d++){var p=Te[d];f&&"constructor"===p||!W(e,p)||X(a,p)}return a}});var Ye=r.keys&&function(){return 2===r.keys(arguments).length}(1,2),ze=r.keys&&function(){var e=r.keys(arguments);return 1!==arguments.length||1!==e.length||1!==e[0]}(1),Ge=r.keys;Z(r,{keys:function(e){return ke(e)?Ge(J(e)):Ge(e)}},!Ye||ze);var Re,Oe,We=0!==new Date(-0xc782b5b342b24).getUTCMonth(),Ue=new Date(-0x55d318d56a724),Je=new Date(14496624e5),Be="Mon, 01 Jan -45875 11:59:59 GMT"!==Ue.toUTCString();Ue.getTimezoneOffset()<-720?(Re="Tue Jan 02 -45875"!==Ue.toDateString(),Oe=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Je.toString())):(Re="Mon Jan 01 -45875"!==Ue.toDateString(),Oe=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Je.toString()));var Fe=y.bind(Date.prototype.getFullYear),He=y.bind(Date.prototype.getMonth),Ve=y.bind(Date.prototype.getDate),Xe=y.bind(Date.prototype.getUTCFullYear),_e=y.bind(Date.prototype.getUTCMonth),Ke=y.bind(Date.prototype.getUTCDate),Qe=y.bind(Date.prototype.getUTCDay),qe=y.bind(Date.prototype.getUTCHours),$e=y.bind(Date.prototype.getUTCMinutes),et=y.bind(Date.prototype.getUTCSeconds),tt=y.bind(Date.prototype.getUTCMilliseconds),nt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],it=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rt=function(e,t){return Ve(new Date(t,e,0))};Z(Date.prototype,{getFullYear:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Fe(this);return e<0&&He(this)>11?e+1:e},getMonth:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Fe(this),t=He(this);return e<0&&t>11?0:t},getDate:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Fe(this),t=He(this),n=Ve(this);return e<0&&t>11?12===t?n:rt(0,e+1)-n+1:n},getUTCFullYear:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Xe(this);return e<0&&_e(this)>11?e+1:e},getUTCMonth:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Xe(this),t=_e(this);return e<0&&t>11?0:t},getUTCDate:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Xe(this),t=_e(this),n=Ke(this);return e<0&&t>11?12===t?n:rt(0,e+1)-n+1:n}},We),Z(Date.prototype,{toUTCString:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Qe(this),t=Ke(this),n=_e(this),i=Xe(this),r=qe(this),o=$e(this),a=et(this);return nt[e]+", "+(t<10?"0"+t:t)+" "+it[n]+" "+i+" "+(r<10?"0"+r:r)+":"+(o<10?"0"+o:o)+":"+(a<10?"0"+a:a)+" GMT"}},We||Be),Z(Date.prototype,{toDateString:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=this.getDay(),t=this.getDate(),n=this.getMonth(),i=this.getFullYear();return nt[e]+" "+it[n]+" "+(t<10?"0"+t:t)+" "+i}},We||Re),(We||Oe)&&(Date.prototype.toString=function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=this.getDay(),t=this.getDate(),n=this.getMonth(),i=this.getFullYear(),r=this.getHours(),o=this.getMinutes(),a=this.getSeconds(),s=this.getTimezoneOffset(),l=Math.floor(Math.abs(s)/60),u=Math.floor(Math.abs(s)%60);return nt[e]+" "+it[n]+" "+(t<10?"0"+t:t)+" "+i+" "+(r<10?"0"+r:r)+":"+(o<10?"0"+o:o)+":"+(a<10?"0"+a:a)+" GMT"+(s>0?"-":"+")+(l<10?"0"+l:l)+(u<10?"0"+u:u)},T&&r.defineProperty(Date.prototype,"toString",{configurable:!0,enumerable:!1,writable:!0}));var ot=-621987552e5,at="-000001",st=Date.prototype.toISOString&&-1===new Date(ot).toISOString().indexOf(at),lt=Date.prototype.toISOString&&"1969-12-31T23:59:59.999Z"!==new Date(-1).toISOString(),ut=y.bind(Date.prototype.getTime);Z(Date.prototype,{toISOString:function(){if(!isFinite(this)||!isFinite(ut(this)))throw new RangeError("Date.prototype.toISOString called on non-finite value.");var e=Xe(this),t=_e(this);e+=Math.floor(t/12);var n=[(t=(t%12+12)%12)+1,Ke(this),qe(this),$e(this),et(this)];e=(e<0?"-":e>9999?"+":"")+F("00000"+Math.abs(e),0<=e&&e<=9999?-4:-6);for(var i=0;i<n.length;++i)n[i]=F("00"+n[i],-2);return e+"-"+J(n,0,2).join("-")+"T"+J(n,2).join(":")+"."+F("000"+tt(this),-3)+"Z"}},st||lt),function(){try{return Date.prototype.toJSON&&null===new Date(NaN).toJSON()&&-1!==new Date(ot).toJSON().indexOf(at)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(e){return!1}}()||(Date.prototype.toJSON=function(e){var t=r(this),n=z(t);if("number"==typeof n&&!isFinite(n))return null;var i=t.toISOString;if(!D(i))throw new TypeError("toISOString property is not callable");return i.call(t)});var ct=1e15===Date.parse("+033658-09-27T01:46:40.000Z"),ft=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z"));if(isNaN(Date.parse("2000-01-01T00:00:00.000Z"))||ft||!ct){var dt=Math.pow(2,31)-1,pt=k(new Date(1970,0,1,0,0,0,dt+1).getTime());Date=function(e){var t=function(n,i,r,o,a,s,u){var c,f=arguments.length;if(this instanceof e){var d=s,p=u;if(pt&&f>=7&&u>dt){var h=Math.floor(u/dt)*dt,g=Math.floor(h/1e3);d+=g,p-=1e3*g}c=1===f&&l(n)===n?new e(t.parse(n)):f>=7?new e(n,i,r,o,a,d,p):f>=6?new e(n,i,r,o,a,d):f>=5?new e(n,i,r,o,a):f>=4?new e(n,i,r,o):f>=3?new e(n,i,r):f>=2?new e(n,i):f>=1?new e(n instanceof e?+n:n):new e}else c=e.apply(this,arguments);return P(c)||Z(c,{constructor:t},!0),c},n=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"),i=[0,31,59,90,120,151,181,212,243,273,304,334,365],r=function(e,t){var n=t>1?1:0;return i[t]+Math.floor((e-1969+n)/4)-Math.floor((e-1901+n)/100)+Math.floor((e-1601+n)/400)+365*(e-1970)};for(var o in e)W(e,o)&&(t[o]=e[o]);Z(t,{now:e.now,UTC:e.UTC},!0),t.prototype=e.prototype,Z(t.prototype,{constructor:t},!0);return Z(t,{parse:function(t){var i=n.exec(t);if(i){var o,a=c(i[1]),s=c(i[2]||1)-1,l=c(i[3]||1)-1,u=c(i[4]||0),f=c(i[5]||0),d=c(i[6]||0),p=Math.floor(1e3*c(i[7]||0)),h=Boolean(i[4]&&!i[8]),g="-"===i[9]?1:-1,m=c(i[10]||0),v=c(i[11]||0);return u<(f>0||d>0||p>0?24:25)&&f<60&&d<60&&p<1e3&&s>-1&&s<12&&m<24&&v<60&&l>-1&&l<r(a,s+1)-r(a,s)&&(o=1e3*(60*((o=60*(24*(r(a,s)+l)+u+m*g))+f+v*g)+d)+p,h&&(o=function(t){var n=0,i=t;if(pt&&i>dt){var r=Math.floor(i/dt)*dt,o=Math.floor(r/1e3);n+=o,i-=1e3*o}return c(new e(1970,0,1,0,0,n,i))}(o)),-864e13<=o&&o<=864e13)?o:NaN}return e.parse.apply(this,arguments)}}),t}(Date)}Date.now||(Date.now=function(){return(new Date).getTime()});var ht=f.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0)),gt={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function(e,t){for(var n=-1,i=t;++n<gt.size;)i+=e*gt.data[n],gt.data[n]=i%gt.base,i=Math.floor(i/gt.base)},divide:function(e){for(var t=gt.size,n=0;--t>=0;)n+=gt.data[t],gt.data[t]=Math.floor(n/e),n=n%e*gt.base},numToString:function(){for(var e=gt.size,t="";--e>=0;)if(""!==t||0===e||0!==gt.data[e]){var n=l(gt.data[e]);""===t?t=n:t+=F("0000000",0,7-n.length)+n}return t},pow:function e(t,n,i){return 0===n?i:n%2==1?e(t,n-1,i*t):e(t*t,n/2,i)},log:function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}};Z(f,{toFixed:function(e){var t,n,i,r,o,a,s,u;if(t=c(e),(t=k(t)?0:Math.floor(t))<0||t>
432320)throw new RangeError("Number.toFixed called with invalid number of decimals");if(n=c(this),k(n))return"NaN";if(n<=-1e21||n>=1e21)return l(n);if(i="",n<0&&(i="-",n=-n),r="0",n>1e-21)if(a=(o=gt.log(n*gt.pow(2,69,1))-69)<0?n*gt.pow(2,-o,1):n/gt.pow(2,o,1),a*=4503599627370496,(o=52-o)>0){for(gt.multiply(0,a),s=t;s>=7;)gt.multiply(1e7,0),s-=7;for(gt.multiply(gt.pow(10,s,1),0),s=o-1;s>=23;)gt.divide(1<<23),s-=23;gt.divide(1<<s),gt.multiply(1,1),gt.divide(2),r=gt.numToString()}else gt.multiply(0,a),gt.multiply(1<<-o,0),r=gt.numToString()+F("0.00000000000000000000",2,2+t);return r=t>0?(u=r.length)<=t?i+F("0.0000000000000000000",0,t-u+2)+r:i+F(r,0,u-t)+"."+F(r,u-t):i+r}},ht);var mt,vt,yt=function(){try{return"1"===1..toPrecision(void 0)}catch(e){return!0}}(),wt=f.toPrecision;Z(f,{toPrecision:function(e){return void 0===e?wt.call(this):wt.call(this,e)}},yt),2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?(mt=void 0===/()??/.exec("")[1],vt=Math.pow(2,32)-1,u.split=function(t,n){var i=String(this);if(void 0===t&&0===n)return[];if(!e(t))return H(this,t,n);var r,o,a,s,l=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),c=0,f=new RegExp(t.source,u+"g");mt||(r=new RegExp("^"+f.source+"$(?!\\s)",u));var d=void 0===n?vt:R(n);for(o=f.exec(i);o&&!((a=o.index+o[0].length)>c&&(X(l,F(i,c,o.index)),!mt&&o.length>1&&o[0].replace(r,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(o[e]=void 0)}),o.length>1&&o.index<i.length&&h.apply(l,J(o,1)),s=o[0].length,c=a,l.length>=d));)f.lastIndex===o.index&&f.lastIndex++,o=f.exec(i);return c===i.length?!s&&f.test("")||X(l,""):X(l,F(i,c)),l.length>d?J(l,0,d):l}):"0".split(void 0,0).length&&(u.split=function(e,t){return void 0===e&&0===t?[]:H(this,e,t)});var bt,It=u.replace;(bt=[],"x".replace(/x(.)?/g,function(e,t){X(bt,t)}),1===bt.length&&void 0===bt[0])||(u.replace=function(t,n){var i=D(n),r=e(t)&&/\)[*?]/.test(t.source);if(i&&r){return It.call(this,t,function(e){var i=arguments.length,r=t.lastIndex;t.lastIndex=0;var o=t.exec(e)||[];return t.lastIndex=r,X(o,arguments[i-2],arguments[i-1]),n.apply(this,o)})}return It.call(this,t,n)});var Mt=u.substr,Ct="".substr&&"b"!=="0b".substr(-1);Z(u,{substr:function(e,t){var n=e;return e<0&&(n=b(this.length+e,0)),Mt.call(this,n,t)}},Ct);var At="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff",St="["+At+"]",Et=new RegExp("^"+St+St+"*"),Dt=new RegExp(St+St+"*$"),Nt=u.trim&&(At.trim()||!"​".trim());Z(u,{trim:function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");return l(this).replace(Et,"").replace(Dt,"")}},Nt);var jt=y.bind(String.prototype.trim),Lt=u.lastIndexOf&&-1!=="abcあい".lastIndexOf("あい",2);Z(u,{lastIndexOf:function(e){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");for(var t=l(this),n=l(e),i=arguments.length>1?c(arguments[1]):NaN,r=k(i)?1/0:Y(i),o=I(b(r,0),t.length),a=n.length,s=o+a;s>0;){s=b(0,s-a);var u=V(F(t,s,o+a),n);if(-1!==u)return s+u}return-1}},Lt);var xt,Tt,Zt,Pt=u.lastIndexOf;if(Z(u,{lastIndexOf:function(e){return Pt.apply(this,arguments)}},1!==u.lastIndexOf.length),8===parseInt(At+"08")&&22===parseInt(At+"0x16")||(parseInt=(xt=parseInt,Tt=/^[\-+]?0[xX]/,function(e,t){var n=jt(String(e)),i=c(t)||(Tt.test(n)?16:10);return xt(n,i)})),1/parseFloat("-0")!=-1/0&&(parseFloat=(Zt=parseFloat,function(e){var t=jt(String(e)),n=Zt(t);return 0===n&&"-"===F(t,0,1)?-0:n})),"RangeError: test"!==String(new RangeError("test"))){Error.prototype.toString=function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");var e=this.name;void 0===e?e="Error":"string"!=typeof e&&(e=l(e));var t=this.message;return void 0===t?t="":"string"!=typeof t&&(t=l(t)),e?t?e+": "+t:e:t}}if(T){var kt=function(e,t){if(_(e,t)){var n=Object.getOwnPropertyDescriptor(e,t);n.configurable&&(n.enumerable=!1,Object.defineProperty(e,t,n))}};kt(Error.prototype,"message"),""!==Error.prototype.message&&(Error.prototype.message=""),kt(Error.prototype,"name")}if("/a/gim"!==String(/a/gim)){RegExp.prototype.toString=function(){var e="/"+this.source+"/";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),e}}})},{}],39:[function(e,t,n){var i=[],r=i.forEach,o=i.slice;
4323t.exports=function(e){return r.call(o.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e}},{}],40:[function(e,t,n){n.read=function(e,t,n,i,r){var o,a,s=8*r-i-1,l=(1<<s)-1,u=l>>1,c=-7,f=n?r-1:0,d=n?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,i),o-=u}return(p?-1:1)*a*Math.pow(2,o-i)},n.write=function(e,t,n,i,r,o){var a,s,l,u=8*o-r-1,c=(1<<u)-1,f=c>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,h=i?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,r),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,r),a=0));r>=8;e[n+p]=255&s,p+=h,s/=256,r-=8);for(a=a<<r|s,u+=r;u>0;e[n+p]=255&a,p+=h,a/=256,u-=8);e[n+p-h]|=128*g}},{}],41:[function(e,t,n){var i=[].indexOf;t.exports=function(e,t){if(i)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},{}],42:[function(e,t,n){t.exports=function(e){var t=i.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var i=Object.prototype.toString},{}],43:[function(e,t,n){var i={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},{}],44:[function(e,t,n){(function(e){!function(i){var r="object"==typeof n&&n&&!n.nodeType&&n,o="object"==typeof t&&t&&!t.nodeType&&t,a="object"==typeof e&&e;a.global!==a&&a.window!==a&&a.self!==a||(i=a);var s,l,u=2147483647,c=36,f=1,d=26,p=38,h=700,g=72,m=128,v="-",y=/^xn--/,w=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=c-f,C=Math.floor,A=String.fromCharCode;function S(e){throw new RangeError(I[e])}function E(e,t){for(var n=e.length,i=[];n--;)i[n]=t(e[n]);return i}function D(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+E((e=e.replace(b,".")).split("."),t).join(".")}function N(e){for(var t,n,i=[],r=0,o=e.length;r<o;)(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<o?56320==(64512&(n=e.charCodeAt(r++)))?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),r--):i.push(t);return i}function j(e){return E(e,function(e){var t="";return e>65535&&(t+=A((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=A(e)}).join("")}function L(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,n){var i=0;for(e=n?C(e/h):e>>1,e+=C(e/t);e>M*d>>1;i+=c)e=C(e/M);return C(i+(M+1)*e/(e+p))}function T(e){var t,n,i,r,o,a,s,l,p,h,y,w=[],b=e.length,I=0,M=m,A=g;for((n=e.lastIndexOf(v))<0&&(n=0),i=0;i<n;++i)e.charCodeAt(i)>=128&&S("not-basic"),w.push(e.charCodeAt(i));for(r=n>0?n+1:0;r<b;){for(o=I,a=1,s=c;r>=b&&S("invalid-input"),((l=(y=e.charCodeAt(r++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:c)>=c||l>C((u-I)/a))&&S("overflow"),I+=l*a,!(l<(p=s<=A?f:s>=A+d?d:s-A));s+=c)a>C(u/(h=c-p))&&S("overflow"),a*=h;A=x(I-o,t=w.length+1,0==o),C(I/t)>u-M&&S("overflow"),M+=C(I/t),I%=t,w.splice(I++,0,M)}return j(w)}function Z(e){var t,n,i,r,o,a,s,l,p,h,y,w,b,I,M,E=[];for(w=(e=N(e)).length,t=m,n=0,o=g,a=0;a<w;++a)(y=e[a])<128&&E.push(A(y));for(i=r=E.length,r&&E.push(v);i<w;){for(s=u,a=0;a<w;++a)(y=e[a])>=t&&y<s&&(s=y);for(s-t>C((u-n)/(b=i+1))&&S("overflow"),n+=(s-t)*b,t=s,a=0;a<w;++a)if((y=e[a])<t&&++n>u&&S("overflow"),y==t){for(l=n,p=c;!(l<(h=p<=o?f:p>=o+d?d:p-o));p+=c)M=l-h,I=c-h,E.push(A(L(h+M%I,0))),l=C(M/I);E.push(A(L(l,0))),o=x(n,b,i==r),n=0,++i}++n,++t}return E.join("")}if(s={version:"1.4.1",ucs2:{decode:N,encode:j},decode:T,encode:Z,toASCII:function(e){return D(e,function(e){return w.test(e)?"xn--"+Z(e):e})},toUnicode:function(e){return D(e,function(e){return y.test(e)?T(e.slice(4).toLowerCase()):e})}},r&&o)if(t.exports==r)o.exports=s;else for(l in s)s.hasOwnProperty(l)&&(r[l]=s[l]);else i.punycode=s}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(e,t,n){!function(e,n){void 0!==t&&t.exports?t.exports=n():this.$script=n()}(0,function(){var e,t,n=document,i=n.getElementsByTagName("head")[0],r=!1,o="push",a="readyState",s="onreadystatechange",l={},u={},c={},f={};function d(e,t){for(var n=0,i=e.length;n<i;
4323++n)if(!t(e[n]))return r;return 1}function p(e,t){d(e,function(e){return!t(e)})}function h(t,n,i){t=t[o]?t:[t];var r=n&&n.call,a=r?n:i,s=r?t.join(""):n,m=t.length;function v(e){return e.call?e():l[e]}function y(){if(!--m){l[s]=1,a&&a();for(var e in c)d(e.split("|"),v)&&!p(c[e],v)&&(c[e]=[])}}return setTimeout(function(){p(t,function t(n,i){return null===n?y():(i||/^https?:\/\//.test(n)||!e||(n=-1===n.indexOf(".js")?e+n+".js":e+n),f[n]?(s&&(u[s]=1),2==f[n]?y():setTimeout(function(){t(n,!0)},0)):(f[n]=1,s&&(u[s]=1),void g(n,y)))})},0),h}function g(e,r){var o,l=n.createElement("script");l.onload=l.onerror=l[s]=function(){l[a]&&!/^c|loade/.test(l[a])||o||(l.onload=l[s]=null,o=1,f[e]=2,r())},l.async=1,l.src=t?e+(-1===e.indexOf("?")?"?":"&")+t:e,i.insertBefore(l,i.lastChild)}return h.get=g,h.order=function(e,t,n){!function i(r){r=e.shift(),e.length?h(r,i):h(r,t,n)}()},h.path=function(t){e=t},h.urlArgs=function(e){t=e},h.ready=function(e,t,n){var i,r=[];return!p(e=e[o]?e:[e],function(e){l[e]||r[o](e)})&&d(e,function(e){return l[e]})?t():(i=e.join("|"),c[i]=c[i]||[],c[i][o](t),n&&n(r)),h},h.done=function(e){h([null],e)},h})},{}]},{},[32])(32)});
4324
4325//var url = 'http://social.vb.kg/foo.php?topic';
4326(function($){
4327	var id = 0;
4328	var get_id = function(){
4329		id++;
4330		return id;
4331	}
4332	$.fn.news_block_social = function(options){
4333		return $(this).each(function(){
4334			var $this = $(this);
4335			var me_id = get_id();
4336			var settings = $.extend({
4337				limit: 10,
4338				lable: null,
4339				cat: null,
4340				columns: null,//'id','name','message','actual','day_news','count_views','count_message','date_create','path','icons'
4341				image:false,
4342				actual:false,
4343				width:'100%',
4344				height:'',
4345				url: $_PARAM.url_api + 'query_news.php'
4346			}, options);
4347			data = {
4348				limit: settings.limit
4349			};
4350			if(settings.lable instanceof Array){
4351				data['lable'] = settings.lable.join(',');
4352			}
4353			if(settings.cat instanceof Array){
4354				data['cat'] = settings.cat.join(',');
4355			}
4356			if(settings.columns instanceof Array){
4357				data['columns'] = settings.columns.join(',');
4358			}
4359			if(settings.actual){
4360				data['actual'] = '';
4361			}
4362			if(settings.image === 0){
4363				data['img'] = 0;
4364			}else if(settings.image === 1){
4365				data['img'] = 1;
4366			}else if(settings.image === 2){
4367				data['img'] = 2;
4368			}else if(settings.image === true){
4369				data['img'] = 0;
4370			}
4371			//console.log(data)
4372			
4373			
4374			var self = this;
4375			
4376			var rev = function(arr, col){
4377				var r = [];
4378				for(i in arr){
4379					var cur = arr[i],
4380						add = {};
4381					for(j in cur){
4382						add[col[j]] = cur[j];
4383					}
4384					r.push(add);
4385				};
4386				return r;
4387			};
4388			
4389			$.ajax({
4390				type: 'POST',
4391				url: settings.url,
4392				data: data,
4393				async: true,
4394				dataType: "JSON",
4395				error: function(e){
4396					if(typeof console != 'undefined'){
4397						console.error("Error query on " + settings.url);
4398						//console.log(e);
4399					}
4400				},
4401				success: function(h){$this.each(function(){
4402					var u = h[0];
4403					var icon_map = h[1];
4404					var arr = rev(h[2], h[3]);
4405					var $me = $('<div>').css({
4406						width: settings.width, 
4407						height: settings.height
4408					}).addClass('vb-main');
4409					var num = 1;
4410					for(i in arr){
4411						var current = arr[i];
4412						var $news_form = $('<div class="vb-news">');
4413						$news_form.attr('data-num', num);
4414						num++;
4415						
4416						if(i == 0){
4417							$news_form.addClass('first');
4418						}
4419						if(i == arr.length - 1){
4420							$news_form.addClass('last');
4421						}
4422						if(i == arr.length - 2){
4423							$news_form.addClass('prev_last');
4424						}
4425						if(i % 2 == 0){
4426							$news_form.addClass('two');
4427						}
4428						if(i % 2 == 1){
4429							$news_form.addClass('prev_two');
4430						}
4431						
4432						if(settings.image !== false && !!current.img){
4433							$news_form.append($('<div class="i"></div>')
4434								.append($('<img class="p">')
4435									.attr('src', $_PARAM.url_static + 'img/16x9.jpg')
4436								)
4437								.append($('<a></a>')
4438									.attr('href', u + current.id)
4439									.append($('<img data-min="755" class="img-resize" >')
4440										.attr('data-src', current.img)
4441									)
4442								)
4443							);
4444						}
4445						
4446						$name = $('<div class="t"><a></a></div>');
4447						$name.find('a')
4448							.attr('href', u + current.id)
4449							.attr('target', '_blank');
4450						for(j in current['icons']){
4451							if(current['icons'][j] == 1){
4452								var liter = ['i', 'v', 'f', 'u', 'a', 'l', 'p'][j];
4453								
4454								$name.find('a')
4455									.append($('<span class="ico"></span>')
4456									.addClass('i_' + liter))
4457									.append('<span> </span>');
4458							}
4459						}
4460						$name.find('a').append($('<span class="n"></span>').text(current.name))
4461						
4462						if(current.actual == 1){
4463							$name.addClass('topic_actual');
4464						}
4465						
4466						
4467						if(current.count_message > 0){
4468							$name.find('a').append($('<span class="cm">&nbsp;</span>')
4469								.append($('<span class="ico i_m"> '))
4470								.append('&nbsp;')
4471								.append($('<span class="cm">').text(current.count_message))
4472							);
4473						}
4474						
4475						$news_form.append($name)
4476						$news_form.append('<div class="both"></div>');
4477						$me.append($news_form);
4478						$(window).resize();
4479					};
4480					
4481					$this.append($me);
4482				});}
4483			});
4484			
4485			return self;
4486		});
4487	};
4488})(jQuery);
4489
4490$("#afisha_main").news_block_social({
4491	limit:4,
4492	image:0,
4493	url: 'http://afisha.vb.kg/foo.php?topic'
4494});
4495$("#social_main").news_block_social({
4496	limit:4,
4497	image:1,
4498	url: 'http://social.vb.kg/foo.php?topic'
4499});
4500$("#agim_main").news_block_social({
4501	limit:5,
4502	image:false,
4503	lable: [7044],
4504	url: 'http://www.kabarordo.kg/foo.php?topic'
4505});
4506
4507
4508var make_no_mistake = [
4509	'flowplayer',
4510	'$_PARAM',
4511	'$',
4512	'_tools'
4513];
4514
4515if(typeof String.prototype.ltrim == 'undefined'){
4516	String.prototype.ltrim = function(str){
4517		if(typeof str == 'string'){
4518			this.replace(new RegExp('^(' + RegExp.escape(str) + ')+', 'g'), '');
4519		}else{
4520			this.replace(/^\s+/g, '')
4521		}
4522	}
4523}
4524if(typeof String.prototype.rtrim == 'undefined'){
4525	String.prototype.ltrim = function(str){
4526		if(typeof str == 'string'){
4527			this.replace(new RegExp('(' + RegExp.escape(str) + ')+$', 'g'), '');
4528		}else{
4529			this.replace(/\s+$/g, '')
4530		}
4531	}
4532}
4533if(typeof String.prototype.trim == 'undefined'){
4534	String.prototype.trim = function(str){
4535		if(typeof str == 'string'){
4536			this.replace(new RegExp('(' + RegExp.escape(str) + ')+$', 'g'), '')
4537				.replace(new RegExp('^(' + RegExp.escape(str) + ')+', 'g'), '');
4538		}else{
4539			this.replace(/\s+$/g, '').replace(/^\s+/g, '');
4540		}
4541	}
4542}
4543
4544for(var i in make_no_mistake){
4545	if(typeof(window[make_no_mistake[i]]) == 'undefined'){
4546		throw new Error(make_no_mistake[i] + ' is undefined');
4547	}
4548}
4549
4550
4551flowplayer.conf.analytics = $_PARAM.ga;
4552flowplayer.conf.engine = "html5";
4553flowplayer.conf.ratio = 9/16;
4554flowplayer.conf.swf = $_PARAM.url_static + "/flowplayer/flowplayer.swf";
4555flowplayer.conf.debug = true;
4556flowplayer.conf.splash = true;
4557flowplayer.conf.volume = 1;
4558
4559if(_tools.localstore.isset('uidl4vb')){
4560	window.user_uid = _tools.localstore.get('uidl4vb');
4561}else if(_tools.cookie.get('uidl4vb')){
4562	window.user_uid = _tools.cookie.get('uidl4vb')
4563}else{
4564	$.ajax({
4565		url: $_PARAM.url_folder + 'other/vb_api.php?new_uid',
4566		success:function(r){
4567			r = ''+r;
4568			_tools.localstore.set('uidl4vb', r);
4569			_tools.cookie.set('uidl4vb', r);
4570			window.user_uid = r;
4571		},
4572		dataType: 'JSON',
4573		error:function(){},
4574		type : 'GET'
4575	});
4576}
4577
4578function session_valid(callback){
4579	$.ajax({
4580		type:'GET',
4581		url: $_PARAM.url_folder + 'add_message.php?session_valid',
4582		dataType:"JSON",
4583		async:true,
4584		success:function(r){
4585			if(r[0] == true){
4586				callback(false, r[1]);
4587			}else{
4588				callback("Не удалось получить ключь");
4589			}
4590		},
4591		error:function(e){
4592			callback("Не удалось получить ключь, ошибка сети.");
4593		}
4594	});
4595};
4596
4597// Кнопка вверх
4598(function(){
4599	var down = false;
4600	var min_scroll = 300;
4601	var max_opacity = 600;
4602	var $me = $("#j_up_btn");
4603	var $up = $me.find('.my-btn-up_up');
4604	var $down = $me.find('.my-btn-up_down');
4605	$me.css('opacity', 0);
4606	var fn_scroll = function(){
4607		var scroll_top = $(this).scrollTop();
4608		//console.log(scroll_top);
4609		if(scroll_top == 0){
4610			$up.removeClass('on');
4611			if(down){
4612				$down.addClass('on');
4613			}
4614		}else if(scroll_top < min_scroll && down){
4615			$me.css('opacity', 0.7);
4616		}else{
4617			down = false;
4618			$down.removeClass('on');
4619			if(scroll_top > min_scroll){
4620				$up.addClass('on');
4621			}else{
4622				$up.removeClass('on');
4623			}
4624			var opacity = scroll_top > max_opacity ? 0.7 : (scroll_top < min_scroll ? 0 : ((scroll_top - min_scroll) / (max_opacity - min_scroll)));
4625			if(opacity > 0.7) opacity = 0.7;
4626			$me.css('opacity', opacity);
4627		}
4628	};
4629	$(document).on('scroll', fn_scroll);
4630	$(document).on('touchmove', fn_scroll);
4631	fn_scroll();
4632	$up.click(function(){
4633		var scroll_top = $('body').scrollTop();
4634		$('body,html').scrollTop(10);
4635		$me.css('opacity', 0.7);
4636		down = scroll_top;
4637		$('body,html').animate({
4638			scrollTop: 0
4639		}, {
4640			duration: 100,
4641			complete: function(){
4642				$up.removeClass('on');
4643				$down.addClass('on');
4644				$me.css('opacity', 0.7);
4645				down = scroll_top;
4646			}
4647		});
4648	});
4649	$down.click(function(){
4650		$('body,html').scrollTop(down - 10)
4651		$('body,html').animate({
4652			scrollTop: down
4653		}, {
4654			duration: 100,
4655			complete: function(){
4656				down = false;
4657			}
4658		});
4659	});
4660	
4661	$("#j_up_btn").click()
4662}());
4663
4664
4665
4666
4667jQuery.screentime({
4668  fields: [
4669    { selector: '.topic-text',
4670      name: 'Text'
4671    },
4672    { selector: '.topic-url',
4673      name: 'TopicURL'
4674    },
4675    { selector: '.topic-messages',
4676      name: 'Messages'
4677    }
4678  ],
4679  callback: function(data) {
4680    //console.log(data);
4681    // Logs: { Top: 5, Middle: 3 }
4682  }
4683});
4684jQuery.scrollDepth();
4685
4686
4687
4688
4689/**
4690 * @depends jQuery
4691*/
4692
4693
4694
4695(function (d, w, s) {
4696
4697	var add_js = function(jss){
4698		if(jss.length == 0){
4699			return;
4700		}
4701		var cur = jss.shift();
4702		var t = d.createElement("script");
4703		if(cur instanceof Array){
4704			if(typeof cur[0] == 'function'){
4705				cur[0](d, w);
4706				t.src = cur[1];
4707				var onload = typeof cur[2] == 'function' ? cur[2] : false;
4708			}else{
4709				t.src = cur[0];
4710				var onload = typeof cur[1] == 'function' ? cur[1] : false;
4711			}
4712			if(onload !== false){
4713				t.onload = t.onreadystatechange = function(){
4714					if((!this.readyState || this.readyState == "loaded" || this.readyState == "complete") && !this.executed){
4715						this.executed = true;
4716						setTimeout(function () {onload(d,w)}, 0);
4717					}
4718				};
4719			}
4720		}else{
4721			t.src = cur;
4722		}
4723		t.type = 'text/javascript';
4724		t.async = true;
4725		d.body.insertBefore(t, d.body.childNodes[0]);
4726		add_js(jss)
4727	}
4728	add_js(s);
4729})(document, window, [
4730	//голосования с quiz.vb.kg
4731	['https://quiz.vb.kg/static/js/widget2.js', function(){$('.topic-text .quiz').quiz();}]
4732]);
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743$("#j_main_lenta_scroll_btn").click(function(e){
4744	e.preventDefault();
4745	e.stopPropagation();
4746	//var $block = $("#j_main_lenta_block");
4747	var $block = $("#j_main_lenta_block_lenta");
4748	var top = $block.offset().top;
4749	//$('body, html').scrollTop(top - 100)
4750	$('body, html').animate({
4751		scrollTop: top
4752	}, 500);
4753});
4754(function(){
4755	var $btn = $("#j_popular_of_week_btn");
4756	var $block = $("#j_popular_of_week");
4757	var $title = $("#j_popular_title").clone().attr('id', '');
4758	var btn_name = [
4759		"",
4760		"Популярные за месяц"
4761	];
4762	var btn_stat = [
4763		"week",
4764		"mount"
4765	];
4766	var btn_urls = [
4767		$_PARAM.url + '?popular_off_week',
4768		$_PARAM.url + '?popular_off_mount'
4769	]
4770	btn_name[0] = $btn.text();
4771	
4772	var set = function(){
4773		if(btn_name.length == 0){
4774			$btn.remove();
4775		}
4776		var str = btn_name.shift();
4777		var stat = btn_stat.shift();
4778		var url = btn_urls.shift();
4779		$btn.unbind('click');
4780		$btn.find('.btn_text').text(str);
4781		$btn.attr('data-stat', stat + ' load');
4782		$btn.click(function(e){
4783			$.ajax({
4784				type: 'GET',
4785				url: url,
4786				async:true,
4787				success: function(html){
4788					var $my_title = $title.clone().text(str);
4789					$block.append($my_title);
4790					var $html = $('<div></div>').attr('data-stat', stat).append(html);
4791					$block.append($html);
4792					set();
4793					$(window).resize();
4794				}
4795			});
4796		});
4797	}
4798	set();
4799}());
4800//Кнопки меню
4801$("#j_menu480").click(function(){
4802	var $parent = $(this).closest("#j_menu480_parent");
4803	if($parent.is('.off')){
4804		$parent.removeClass('off');
4805		$parent.addClass('on');
4806	}else{
4807		$parent.removeClass('on');
4808		$parent.addClass('off');
4809	}
4810});
4811$("#j_menu720").click(function(){
4812	var $parent = $(this).closest("#j_menu720_parent");
4813	if($parent.is('.off')){
4814		$parent.removeClass('off');
4815		$parent.addClass('on');
4816	}else{
4817		$parent.removeClass('on');
4818		$parent.addClass('off');
4819	}
4820});
4821(function(){
4822	var calendar_id = 0; 
4823	$('.cat_date_paginator').each(function(){
4824		var $this = $(this);
4825		var me_id = calendar_id;
4826		calendar_id++;
4827		if(_tools.localstore.isset('cat_date_paginator_' + me_id)){
4828			if(_tools.localstore.get('cat_date_paginator_' + me_id) == true){
4829				$this.removeClass("off");
4830				$this.addClass("on");
4831			}else{
4832				$this.removeClass("on");
4833				$this.addClass("off");
4834			}
4835		}
4836	});
4837}());
4838//Календарь
4839(function(){
4840	var calendar_id = 0;
4841	$('.cat_date_paginator').each(function(){
4842		var $this = $(this);
4843		var me_id = calendar_id;
4844		calendar_id++;
4845		
4846		// Считываем запомненные состояние календарей из локального хранилища
4847		if(_tools.localstore.isset('cat_date_paginator_' + me_id)){
4848			if(_tools.localstore.get('cat_date_paginator_' + me_id) == true){
4849				$this.removeClass("off");
4850				$this.addClass("on");
4851			}else{
4852				$this.removeClass("on");
4853				$this.addClass("off");
4854			}
4855		}
4856		
4857		//Делаем кнопку "След." не активной если следующий по счёту день это завтра
4858		$('.cat_date_paginator_children .next').each(function(){
4859			var link_date = ($(this).attr('href')+'').replace(/^.*date/, 'date').replace(/^date\=(\d\d\d\d\-\d\d\-\d\d).*$/, '$1');
4860			var link_year = parseInt(link_date.replace(/^(\d\d\d\d).*$/, '$1'), 10);
4861			var link_mount = parseInt(link_date.replace(/^\d\d\d\d-(\d\d).*$/, '$1'), 10);
4862			var link_date = parseInt(link_date.replace(/^\d\d\d\d-\d\d-(\d\d).*$/, '$1'), 10);
4863			var date_next = new Date(link_year, link_mount - 1, link_date);
4864			var date_now = new Date($_PARAM.date.year, $_PARAM.date.mount - 1, $_PARAM.date.day);
4865			if(date_next.getTime() > date_now.getTime()){
4866				$(this).addClass('off');
4867				$(this).click(function(e){
4868					e.preventDefault();
4869				});
4870			}
4871		});
4872		
4873		var $link = $this.find('.curent');
4874		var $calendar = $this.find('.calendar');
4875		
4876		var html = 
4877		'<div class="calendar-top">' +
4878			'<div class="calendar-prev_mount" data-send data-stat="mount prev" onselectstart="return false;" onmousedown="return false;">' + 
4879				'<span class="ico i_date_prev"></span>' +
4880			'</div>' +
4881			'<div class="calendar-curent_mount"></div>' +
4882			'<div class="calendar-next_mount" data-send data-stat="mount next" onselectstart="return false;" onmousedown="return false;">' +
4883				'<span class="ico i_date_next"></span>' +
4884			'</div>' +
4885		'</div>' +
4886		'<div class="calendar-bottom">' +
4887			'<div class="calendar-days"></div>'
4888		'</div>'+
4889		'<div class="both"></div>';
4890		$calendar.append(html);
4891		
4892		var $days = $calendar.find('.calendar-days');
4893		
4894		
4895		$link.click(function(e){
4896			e.preventDefault();
4897			if($this.is('.on')){
4898				$this.removeClass('on');
4899				$this.addClass('off');
4900				_tools.localstore.set('cat_date_paginator_' + me_id, false);
4901			}else{
4902				$this.removeClass('off');
4903				$this.addClass('on');
4904				_tools.localstore.set('cat_date_paginator_' + me_id, true);
4905			}
4906		});
4907		$calendar.find('.calendar-prev_mount').click(function(){
4908			set_prev_mount();
4909		});
4910		$calendar.find('.calendar-next_mount').click(function(){
4911			set_next_mount();
4912		});
4913		
4914		var curent_date = (location.search+'').replace(/^.*date/, 'date').replace(/^date\=(\d\d\d\d\-\d\d\-\d\d).*$/, '$1');
4915		
4916		var temp = curent_date;
4917		
4918		var curent_year = parseInt(curent_date.replace(/^(\d\d\d\d).*$/, '$1'), 10);
4919		var curent_mount = parseInt(curent_date.replace(/^\d\d\d\d-(\d\d).*$/, '$1'), 10);
4920		var curent_date = parseInt(curent_date.replace(/^\d\d\d\d-\d\d-(\d\d).*$/, '$1'), 10);
4921		
4922		var start_year = curent_year;
4923		var start_mount = curent_mount;
4924		var start_date = curent_date;
4925		var start_dt = new Date(curent_year, curent_mount - 1, curent_date).getTime();
4926		
4927		
4928		var week_str = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'];
4929		var mount_str = ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'];
4930		
4931		
4932		var get_week = function(date){
4933			var num = date.getDay();
4934			if(num == 0){
4935				num = 6;
4936			}else{
4937				num--;
4938			}
4939			return num;
4940		}
4941		
4942		var set_date = function(){
4943			$calendar.find('.calendar-curent_mount').text(mount_str[curent_mount-1] + ' ' + curent_year);
4944			
4945			
4946			var temp_date = new Date(curent_year, curent_mount - 1, 1);
4947			if(get_week(temp_date) == 0){
4948				var date_len_prev = 8;
4949			}else{
4950				var date_len_prev = get_week(temp_date) + 1;
4951			}
4952			var date_start = new Date(temp_date.setDate(temp_date.getDate() - date_len_prev));
4953			
4954			var temp_date = new Date(date_start);
4955			var date_stop = new Date(temp_date.setDate(temp_date.getDate() + 7*6));
4956			var date_now = new Date($_PARAM.date.year, $_PARAM.date.mount - 1, $_PARAM.date.day);
4957			
4958			var dates = [];
4959			var curent_line = -1;
4960			
4961			var curent_day = new Date(date_start);
4962			var index = 0;
4963			do {
4964				var day = get_week(curent_day);
4965				if(day == 6){
4966					curent_line++;
4967					dates.push([]);
4968				}
4969				dates[curent_line].push(curent_day);
4970				curent_day = new Date(curent_day.setDate(curent_day.getDate() + 1));
4971			}while(
4972				curent_day.getDate() != date_stop.getDate() ||
4973				curent_day.getMonth() != date_stop.getMonth() ||
4974				curent_day.getFullYear() != date_stop.getFullYear()
4975			)
4976			
4977			var html = '';
4978			
4979			var html_week = '';
4980			for(var i in week_str){
4981				html_week += '<div class="' +
4982					'calendar-week-name' +
4983					(i == 6 ? ' last' : '') +
4984					(i == 0 ? ' first' : '') +
4985				'">' + 
4986					week_str[i] + 
4987				'</div>';
4988			}
4989			html += '<div class="calendar-week first">' +
4990				html_week +
4991			'<div class="both"></div></div>';
4992			var index = 0;
4993			
4994			for(var i in dates){
4995				var html_week = '';
4996				for(var j in dates[i]){
4997					var date = dates[i][j].getDate() + '';
4998					// if(date.length == 1){
4999						// date = '0' + date;
5000					// }
5001					var dt = (new Date(dates[i][j].getFullYear(), dates[i][j].getMonth(),dates[i][j].getDate())).getTime();
5002					var future = dt > date_now.getTime();
5003					var now = dt == date_now.getTime();
5004					var curent_day = dates[i][j].getDate() == start_date &&  
5005						dates[i][j].getMonth() == start_mount - 1 &&  
5006						dates[i][j].getFullYear() == start_year;
5007					var stat = (date_now.getTime() - dt) /1000/60/60/24;
5008						
5009					html_week += '<div ' +
5010						'data-stat="number" ' +
5011						'onselectstart="return false;" ' +
5012						'onmousedown="return false;" ' +
5013						(!future && !now ? 'data-num="' + stat + '" data-send ' : '') +
5014						'class="' +
5015							'calendar-day' +
5016							(j == 6 ? ' last' : '') +
5017							(j == 0 ? ' first' : '') +
5018							(dates[i][j].getMonth() != curent_mount -1 ? ' additive' : '') +
5019							(future ? ' future' : '') +
5020							(now ? ' now' : '') +
5021							(curent_day ? ' curent_day' : '') +
5022						'" ' +
5023						'data-year="' + dates[i][j].getFullYear() + '" ' +
5024						'data-mount="' + dates[i][j].getMonth() + '" ' +
5025						'data-date="' + dates[i][j].getDate() + '"' +
5026					'>' + date + '</div>';
5027					index++;
5028				}
5029				html += '<div class="' +
5030					'calendar-week' +
5031					(i == 5 ? ' last' : '') +
5032				'">' +
5033					html_week +
5034				'<div class="both"></div></div>';
5035			}
5036			$days.empty();
5037			$days.append(html);
5038			$days.find('.calendar-day:not(.future):not(.curent_day)').click(function(){
5039				var year = $(this).data('year') + '';
5040				var mount = (parseInt($(this).data('mount')) + 1) + '';
5041				if(mount.length == 1){
5042					mount = '0' + mount;
5043				}
5044				var date = $(this).data('date') + '';
5045				if(date.length == 1){
5046					date = '0' + date;
5047				}
5048				
5049				var url = 
5050					location.protocol + '//' +
5051					location.hostname +
5052					location.pathname + 
5053					location.search.replace(/date=\d\d\d\d-\d\d-\d\d/, 'date=' + year + '-' + mount + '-' + date) 
5054					+ '#paginator';
5055				//alert(url);
5056				location.href = url;
5057			});
5058		}
5059		
5060		var set_next_mount = function(){
5061			if(curent_mount == 12){
5062				curent_year++;
5063				curent_mount = 1;
5064			}else{
5065				curent_mount++;
5066			}
5067			set_date();
5068		}
5069		var set_prev_mount = function(){
5070			if(curent_mount == 1){
5071				curent_year--;
5072				curent_mount = 12;
5073			}else{
5074				curent_mount--;
5075			}
5076			set_date();
5077		}
5078		
5079		set_date();
5080		
5081	});
5082}());
5083
5084
5085
5086//Баннеры
5087function set_all_banners(banners){
5088	
5089	$('body').append('<script language="Javascript">var flashinstalled = 0;	MSDetect = "false";</script>');
5090	if (navigator.mimeTypes && navigator.mimeTypes.length){
5091		x = navigator.mimeTypes["application/x-shockwave-flash"];
5092		if (x && x.enabledPlugin) flashinstalled = 2;
5093		else flashinstalled = 1;
5094	}else{
5095		MSDetect = "true";
5096	}
5097	(function(){
5098		try{
5099			$('body').append('<script language="VBScript">If MSDetect = "true" Then If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash"))) Then flashinstalled = 1 Else flashinstalled = 2 End If End If </script>');
5100		}catch(e){}
5101	})();
5102	
5103	
5104	var views_send = []; //[['A','480','32'],[pos, key, id]]
5105	var prepend_size = false;
5106	
5107	var $banners = $('.banner');
5108	
5109	var set_to_html = function(){
5110		$banners.each(function(){
5111			var $me = $(this),
5112				pos = $me.data('pos'),
5113				key = $me.data('key'),
5114				id  = $me.data('id'),
5115				set = $me.data('set') == "y" ? true : false;
5116			if(prepend_size != key){
5117				return;
5118			}
5119			if(set || typeof banners[pos] == "undefined" || typeof banners[pos][key] == "undefined"){
5120				return;
5121			}
5122			var banner = banners[pos][key];
5123			if(banner.title){
5124				$me.attr('title', banner.title);
5125			}
5126			if((flashinstalled != 2 || !banner.flash) && banner.img){
5127				var $img = $('<img>').attr({src: banner.img});
5128				if(banner.title){
5129					$img.attr({alt: banner.title});
5130				}
5131				if(banner.href){
5132					$img = $('<a></a>')
5133						.attr({href: banner.href, rel: 'nofollow', target: '_blank'})
5134						.click(function(){click_to_banner(pos, key, id);})
5135						.append($img);
5136				}else{
5137					$img = $('<span></span>')
5138						.append($img);
5139				}
5140				$me.append($img);
5141			}else if(banner.flash && flashinstalled == 2){
5142				var $flash = $('<object></object>')
5143					.width(banner.width)
5144					.height(banner.height)
5145					.attr('data', banner.flash)
5146					.append('<param name="quality" value="high"/>')
5147					.append('<param name="wmode" value="opaque"/>')
5148					.append($('<embed/>').attr({src: banner.flash, width: banner.width, height: banner.height}))
5149				$me.append($flash);
5150				$me.on('mousedown', 'object', function(){click_to_banner(pos, key, id);});
5151			}
5152			
5153			$me.data('set', 'y');
5154			views_send.push([pos, key, id]);
5155		});
5156		send_view();
5157	};
5158	var timeout_send = false;
5159	setTimeout(function(){
5160		timeout_send = true;
5161		send_view();
5162	}, 5000);
5163	var send_view = function(){
5164		if(!timeout_send){
5165			return;
5166		}
5167		if(views_send.length == 0){
5168			return;
5169		}
5170		var uid = typeof user_uid !== 'undefined' ? user_uid : 0;
5171		var data = {
5172			uid: uid,
5173			banners: JSON.stringify(views_send),
5174			event: 'view'
5175		}
5176		views_send = [];
5177		$.ajax({
5178			url: $_PARAM.url_folder + 'other/vb_api.php?stat_banner',
5179			data: data,
5180			type : 'POST',
5181			async : true,
5182			success: function(){
5183				timeout_send = false;
5184			}
5185		});
5186	}
5187	
5188	var click_to_banner = function(pos, key, id){
5189		var uid = typeof user_uid !== 'undefined' ? user_uid : 0;
5190		var data = {
5191			uid: uid,
5192			banners: JSON.stringify([[pos, key, id]]),
5193			event: 'click'
5194		}
5195		$.ajax({
5196			url: $_PARAM.url + 'other/vb_api.php?stat_banner',
5197			data: data,
5198			type : 'POST',
5199			async : true
5200		});
5201	}
5202	
5203	var resize_timeout = false;
5204	var resize = function(){
5205		var width = _tools.window.width();
5206		var key = width < 480 ? 240 : (width < 980 ? 480 : 980);
5207		if(prepend_size === false || prepend_size != key){
5208			prepend_size = ''+key;
5209			set_to_html();
5210		}
5211	};
5212	
5213	$(window).bind('resize orientationchange', function(){
5214		clearTimeout(resize_timeout);
5215		resize_timeout = setTimeout(function(){
5216			resize();
5217		}, 20);
5218	});
5219	$(document).on('image_init', function(){
5220		resize();
5221	})
5222}
5223set_all_banners($_PARAM.banners);
5224
5225var topic_set_bb_news = function(result){
5226	//???????????????
5227	
5228	$topic = $("#topic");
5229	
5230	var set_new = function($new, cur){
5231		//console.log($new);
5232		$new.empty();
5233		$new.each(function(){
5234			var $me = $(this);
5235			var $name = $('<div class="t"><a></a></div>');
5236			if(cur.media_main){
5237				//console.log(cur.media_main)
5238				$me.append($('<div class="i"><img class="p"/><a><img></a></div>'));
5239				$me.find('a').attr('href', cur.url);
5240				$me.find('.p').attr('src', $_PARAM.url_static + 'img/16x9.jpg');
5241				
5242				if(cur.media_main.type == 'img'){
5243					var img_url = cur.media_main.data.media_name.big;
5244					if($me.closest('.vrez-left, .vrez-right').size() != 0){
5245						img_url = cur.media_main.data.media_name.medium;
5246					}
5247					$me.find('.i a img').attr('src', img_url);
5248				}else if(cur.media_main.type == 'video'){
5249					var img_url = cur.media_main.data.media_name.screen_normal;
5250					if($me.closest('.vrez-left, .vrez-right').size() != 0){
5251						img_url = cur.media_main.data.media_name.screen_medium;
5252					}
5253					$me.find('.i a').append($('<div class="video_logo"></div>'))
5254					$me.find('.i a img').attr('src', img_url);
5255				}
5256			}
5257			if (typeof cur.lable[17] != 'undefined') $name.find('a').append('<span class="ico i_i" title="??"></span> ');
5258			if (typeof cur.lable[18] != 'undefined') $name.find('a').append('<span class="ico i_v" title="???></span> ');
5259			if (typeof cur.lable[36] != 'undefined') $name.find('a').append('<span class="ico i_f" title="????? ?????"></span> ');
5260			if (typeof cur.lable[38] != 'undefined') $name.find('a').append('<span class="ico i_u" title="???? ?????></span> ');
5261			if (typeof cur.lable[37] != 'undefined') $name.find('a').append('<span class="ico i_a" title="???"></span> ');
5262			if (typeof cur.lable[20] != 'undefined') $name.find('a').append('<span class="ico i_l" title="???"></span> ');
5263			if (typeof cur.lable[19] != 'undefined') $name.find('a').append('<span class="ico i_p" title="?? ??????></span> ');
5264			if (typeof cur.lable[6731] != 'undefined') $name.find('a').append('<span class="ico i_q" title="???></span> ');
5265			
5266			$name.find('a').append($('<span class="n"></span>').text(cur.topic_name)).attr('href', cur.url);
5267			cur.topic_count_message = cur.topic_count_message|0;
5268			if(cur.topic_count_message > 0){
5269				$name.find('a').append('&nbsp;');
5270				$name.find('a').append($('<span class="cm"><span class="ico i_m"></span>&nbsp;</span>').append(cur.topic_count_message));
5271			}
5272			$me.append($name);
5273		});
5274	}
5275	for(var i in result.bb){
5276		//console.log(result.bb[i])
5277		set_new($topic.find(".bb_news.topic_id_" + result.bb[i].topic_id), result.bb[i]);
5278	}
5279}
5280var topic_set_media = function(result){
5281	var media = result.media;
5282	$topic = $("#topic");
5283	
5284	//Мультимедиа
5285	var aOutMedia = {};
5286	var for_viewer = [];
5287	var $popup_elem = $('<div></div>');
5288	
5289	for(var i in media){
5290		for(var j in media[i]){
5291			aOutMedia[media[i][j].media_id] = media[i][j];
5292		}
5293	}
5294	
5295	$popup_elem.on('open', function(e, id, $elem){
5296		var $self = $(this);
5297		var $me = $self.find('[val=' + id + ']');
5298		var $wrap = $('<a target="_blank"></a>')
5299			.attr({href: $me.attr('href')})
5300			.css({'display':'block'});
5301		
5302		var check_me = function(){
5303			var $temp = $self.find('[val=' + id + ']');
5304			if($temp.length == 0){
5305				setTimeout(function(){check_me();}, 100);
5306			}else{
5307				$me = $temp;
5308				//$elem.parent().attr({'href': $me.attr('href')});
5309			}
5310		}
5311		if($me.length == 0){
5312			check_me();
5313		}
5314		
5315		$elem.addClass('img-viewer-onclick').wrap($wrap);
5316		$elem.bind('click', function(e){
5317			if(_tools.window.width() > 800){
5318				e.preventDefault();
5319				e.stopPropagation();
5320				$me.click();
5321			}else{
5322				
5323			}
5324		});
5325		
5326	});
5327	
5328	var add_media_for_popup_elem = function(media){
5329		var url_to_big = false;
5330		if(media.media_type_id == 1){
5331			url_to_big = media.media_name['big'];
5332		}else if(media.media_type_id == 2){
5333			url_to_big = media.media_name['original'];
5334		}else{
5335			return;
5336		}
5337		var author = [];
5338		for(j in media.authors){
5339			var temp_a = media.authors[j][1];
5340			//temp_a = temp_a.replace(']','*#93*').replace(';','*#59*');
5341			author.push(temp_a);
5342		}
5343		if(author.length == 0){
5344			author = '';
5345		}else{
5346			author = '<b>Фото:</b> ' + author.join(', ');
5347		}
5348		
5349		var title = media.media_title == "" ? "" : media.media_title + '</br>';
5350		
5351		$popup_elem.append($('<a></a>').attr({
5352			val: media.media_id,
5353			href: url_to_big,
5354			title: title+author
5355		}).append('<img>'));
5356	}
5357	
5358	
5359	var set_media_for_div = function($me, media, align){
5360		align = align || 'center';
5361		
5362		var upload_url = '' + '?load';
5363		var url_to_big = false;
5364		
5365		//Фото
5366		if(media.media_type_id == 1){
5367			var size = align == 'center' ? 'big' : 'medium';
5368			
5369			if(size == 'big' && $me.closest('.vrez-left, .vrez-right').size() != 0){
5370				size = 'medium';
5371			}
5372			
5373			var $img = $('<img>');
5374			$img[0].onload = function(e){
5375				if(this.width / this.height < 1.777777777777777){
5376					$(this).addClass('topic-image-vertical');
5377				}else{
5378					$(this).addClass('topic-image-horisontal');
5379				}
5380			}
5381			$img.attr({
5382				src: media.media_name[size],
5383				alt: media.media_desc == "" ? result.name : media.media_desc
5384			});
5385			$me.append($img);
5386			if(media.media_desc){
5387				$me.append($('<div class="media-desc"></div>').text(media.media_desc));
5388			}
5389			upload_url = media.media_name['big'] + '?load';
5390		}
5391		
5392		//Инфографики
5393		else if(media.media_type_id == 2){
5394			var size = 'original';
5395			
5396			if($me.closest('.vrez-left, .vrez-right').size() != 0){
5397				size = 'medium';
5398			}
5399			
5400			$me.append($('<img>').attr({
5401				src: media.media_name[size],
5402				alt: media.media_desc == "" ? result.name : media.media_desc
5403			}));
5404			upload_url = media.media_name['original'] + '?load';
5405		}
5406		
5407		//Гифки
5408		else if(media.media_type_id == 7){
5409			
5410			
5411			$me.append($('<img>').attr({
5412				src: media.media_name.file,
5413				alt: media.media_desc == "" ? result.name : media.media_desc
5414			}));
5415			upload_url = media.media_name.file + '?load';
5416		}
5417		
5418		//Видео
5419		else if(media.media_type_id == 4){
5420			var types = {
5421				'3gp': ['video/3gp',0],
5422				ipod: ['video/mp4', 1],
5423				webm: ['video/webm',2],
5424				all: ['video/mp4',  3]
5425			}
5426			var source = [];
5427			var screen = media.media_name.screen_normal;
5428			//console.log(media)
5429			if(media.media_ready == 0){
5430				source.push([media.media_name.file, media.media_name.file_type]);
5431				var url = media.media_name.file;
5432				upload_url = url + '?load';
5433			}else{
5434				var priority = ['webm','all','ipod'];
5435				upload_url = media.media_name.conv.all;
5436				if(_tools.info.is.tablet){
5437					upload_url = media.media_name.conv.all;
5438					priority = ['all','ipod','webm'];
5439				}else if(_tools.info.is.mobile){
5440					upload_url = media.media_name.conv.ipod;
5441					priority = ['ipod','all','webm','3gp'];
5442				}else if (_tools.info.is.android){
5443					upload_url = media.media_name.conv.ipod;
5444					priority = ['ipod','all','3gp','webm'];
5445				}else if (_tools.info.is.chrome){
5446					upload_url = media.media_name.conv.all;
5447					priority = ['all','ipod','webm','3gp'];
5448				}
5449				upload_url = media.media_name.conv[types[priority[0]][1]] + '?load';
5450				for(var j = 0, l = priority.length; j < l; j++){
5451					source.push([media.media_name.conv[types[priority[j]][1]] , types[priority[j]][0]]);
5452				}
5453				//console.log(source);
5454			}
5455			$me.append("<div class='topic-media-video'></div>");
5456			var $elem = $me.find('.topic-media-video');
5457			$elem.attr({
5458				preload: "none",
5459				"data-engine" : "html5",
5460				ratio: 1.77778
5461			})
5462			$elem.append('<video>');
5463			for(var j = 0, l = source.length; j < l; j++){
5464				$elem.find('video').append($('<source>').attr({src:source[j][0], type: source[j][1]}));
5465			}
5466			var data = {};
5467			if(_tools.info.is.firefox){
5468				data.engine = "flash";
5469			}
5470			$elem.flowplayer(data);
5471			$elem.css({
5472				'background': '#000 url("' + screen + '") 0 0 no-repeat',
5473				'background-size': '100%'
5474			});
5475			var $desc = $('<div class="media-desc"></div>')
5476			if(media.media_desc){
5477				$desc.append($('<div class="media-desc-text"></div>').text(media.media_desc))
5478			}
5479			$desc.append($('<a class="media-desc-upload">Скачать</a>').attr('href', upload_url));
5480			
5481			var $authors = $('<span class="media-desc-authors"><b>Видео:</b> <span class="media-desc-authors-list"></span></span>');
5482			var first = true;
5483			for(var i in media.authors){
5484				var author = media.authors[i];
5485				if(!first){
5486					$authors.find('.media-desc-authors-list').append(", ");
5487				}
5488				$authors.find('.media-desc-authors-list').append($('<span class="media-desc-authors-name"></span>').text(author[1]));
5489				first = false;
5490			}
5491			$desc.append($authors);
5492			
5493			$me.append($desc);
5494			// $me.append($('<div class="media-video-desc"></div>'));
5495			// $me.append($('<a class="media-video-upload">Скачать</a>').attr('href', upload_url))
5496			// if(media.media_desc){
5497				// $me.find('.media-video-desc').text(media.media_desc);
5498			// }
5499		}
5500		
5501		return upload_url;
5502	};
5503	
5504	
5505
5506	
5507	//Видео в крутилку
5508	for(var media_id in aOutMedia){
5509		if(aOutMedia[media_id].media_type_id == 4 && aOutMedia[media_id].media_enable == "1"){
5510			for_viewer.push(media_id)
5511		}
5512	}
5513	//Фото в крутилку
5514	for(var media_id in aOutMedia){
5515		if(aOutMedia[media_id].media_type_id == 1 && aOutMedia[media_id].media_enable == "1"){
5516			for_viewer.push(media_id)
5517		}
5518	}
5519	
5520	$topic.find(".topic-media").each(function(){
5521		
5522		var $me = $(this);
5523		var $content = $me.find('.topic-media-content');
5524		var $scroll = $me.find('.topic-media-scroll');
5525		
5526		$scroll.find('.topic-media-scroll-next').click(function(){
5527			next();
5528		}).on("go_to_next", function(){
5529			next();
5530		});
5531		$scroll.find('.topic-media-scroll-prev').click(function(){
5532			prev();
5533		}).on("go_to_prev", function(){
5534			prev();
5535		});
5536		
5537		var count = for_viewer.length;
5538		
5539		if(count == 0){
5540			$me.remove();
5541			return;
5542		}else if(count == 1){
5543			var media = aOutMedia[for_viewer[0]];
5544			if(media.media_type_id == 1){
5545				var $elem = $('<a class="media"></a>')
5546					.attr('data-id', media.media_id)
5547					.attr('data-align', parseInt(media.media_width) > 700 ? 'center' : 'right')
5548					.attr('data-url', parseInt(media.media_width) > 700  ? media.media_name['big'] : media.media_name['medium'])
5549				;
5550				var $banner_480 = $topic.find('.topic-text .banner.ad-480.J');
5551				var $banner_240 = $topic.find('.topic-text .banner.ad-240.J');
5552				var $banner_980 = $topic.find('.topic-text .ad-J-parrent .banner.ad-980.J');
5553				var $text = $topic.find('.topic-text');
5554				
5555				
5556				if($banner_480.size() != 0){
5557					$banner_480.after($elem);
5558				}
5559				else if($banner_240.size() != 0){
5560					$banner_240.after($elem);
5561				}
5562				else if($banner_980.size() != 0){
5563					$banner_980.before($elem);
5564				}
5565				else{
5566					console.log('text', $banner_240);
5567					$text.prepend($elem);
5568				}
5569				$me.remove();
5570				return;
5571			}
5572			$scroll.remove();
5573		}
5574		$me.css('display', 'block');
5575		
5576		var current = 0;
5577		
5578		var set = function(index){
5579			$content.empty();
5580			var media = aOutMedia[for_viewer[index]];
5581			var upload_url = set_media_for_div($content, media);
5582			$scroll.find('.topic-media-scroll-text').text((current + 1) + ' из ' + count);
5583			$me.find('.media-author').empty();
5584			var authors = [];
5585			for(var i in media.authors){
5586				if(authors.indexOf(media.authors[i][1]) == -1)
5587					authors.push(media.authors[i][1]);
5588			}
5589			if(media.media_type_id == 4){
5590				$me.find('.media-author').html($("<span>")
5591					.append($('<b>').text('Видео: '))
5592					.append($('<span>').text(authors.join(', ')))
5593					.append($('<a class="upload_video" target="_blank">').attr('href', upload_url).text('Скачать'))
5594				);
5595			}else{
5596				$me.find('.media-author').html($("<span>")
5597					.append($('<div class="topic-media-title">').text(media.media_title))
5598					.append($('<b>').text('Фото: '))
5599					.append($('<span>').text(authors.join(', ')))
5600					//.append($('<a class="upload_video" target="_blank">').attr('href', upload_url).text('Скачать'))
5601				);
5602				$popup_elem.trigger('open', [media.media_id, $me.find('img')]);
5603			}
5604		}
5605		
5606		var next = function(){
5607			current = current + 1 == count ? 0 : current + 1;
5608			set(current);
5609		}
5610		var prev = function(){
5611			current = current - 1 < 0 ? count - 1 : current - 1
5612			set(current);
5613		}
5614		set(current);
5615		//console.log('123');
5616		for(var i in for_viewer){
5617			var media = aOutMedia[for_viewer[i]];
5618			add_media_for_popup_elem(media);
5619			//console.log(media.media_id);
5620		}
5621	});
5622	
5623	// Галерея в тексте
5624	$topic.find(".topic-gallery").each(function(){
5625		
5626		var $gallery_parrent = $(this);
5627		var media_ids = $gallery_parrent.attr("data-media-ids").split(',');
5628		var aOutMedia = {};
5629		var for_viewer = media_ids;
5630		for(var i in media){
5631			for(var j in media[i]){
5632				if(media_ids.indexOf(media[i][j].media_id) != -1){
5633					aOutMedia[media[i][j].media_id] = media[i][j];
5634				}
5635			}
5636		}
5637		
5638		var $gallery = $(
5639			'<div class="topic-media">' +
5640				'<div class="topic-media-size">' +
5641					'<img class="topic-media-size-img" alt="" src="' + $_PARAM.url_static + 'img/16x9.jpg">' +
5642					'<div class="topic-media-content"></div>' +
5643				'</div>' +
5644				'<div class="media-author"></div>' +
5645				'<div class="topic-media-scroll">' +
5646					'<div class="topic-media-scroll-prev" onselectstart="return false;" onmousedown="return false;">' +
5647						'<span class="ico i_media_prev">' +
5648					'</div>' +
5649					'<div class="topic-media-scroll-text"></div>' +
5650					'<div class="topic-media-scroll-next" onselectstart="return false;" onmousedown="return false;">' +
5651						'<span class="ico i_media_next">' +
5652					'</div>' +
5653				'</div>' +
5654			'</div>' 
5655		);
5656		
5657		
5658		$gallery.each(function(){
5659			var $me = $(this);
5660			var $content = $me.find('.topic-media-content');
5661			var $scroll = $me.find('.topic-media-scroll');
5662			
5663			$scroll.find('.topic-media-scroll-next').click(function(){
5664				next();
5665			}).on("go_to_next", function(){
5666				next();
5667			});
5668			$scroll.find('.topic-media-scroll-prev').click(function(){
5669				prev();
5670			}).on("go_to_prev", function(){
5671				prev();
5672			});
5673			
5674			
5675			var count = for_viewer.length;
5676			
5677			if(count == 0){
5678				$me.remove();
5679				return;
5680			}
5681			$me.css('display', 'block');
5682			
5683			var current = 0;
5684			
5685			var set = function(index){
5686				$content.empty();
5687				var media = aOutMedia[for_viewer[index]];
5688				var upload_url = set_media_for_div($content, media);
5689				$scroll.find('.topic-media-scroll-text').text((current + 1) + ' из ' + count);
5690				$me.find('.media-author').empty();
5691				var authors = [];
5692				for(var i in media.authors){
5693					if(authors.indexOf(media.authors[i][1]) == -1)
5694						authors.push(media.authors[i][1]);
5695				}
5696				if(media.media_type_id == 4){
5697					$me.find('.media-author').html($("<span>")
5698						.append($('<b>').text('Видео: '))
5699						.append($('<span>').text(authors.join(', ')))
5700						.append($('<a class="upload_video" target="_blank">').attr('href', upload_url).text('Скачать'))
5701					);
5702				}else{
5703					$me.find('.media-author').html($("<span>")
5704						.append($('<div class="topic-media-title">').text(media.media_title))
5705						.append($('<b>').text('Фото: '))
5706						.append($('<span>').text(authors.join(', ')))
5707						//.append($('<a class="upload_video" target="_blank">').attr('href', upload_url).text('Скачать'))
5708					);
5709					$popup_elem.trigger('open', [media.media_id, $me.find('img')]);
5710				}
5711			}
5712			
5713			var next = function(){
5714				current = current + 1 == count ? 0 : current + 1;
5715				set(current);
5716			}
5717			var prev = function(){
5718				current = current - 1 < 0 ? count - 1 : current - 1
5719				set(current);
5720			}
5721			set(current);
5722			//console.log('123');
5723			for(var i in for_viewer){
5724				var media = aOutMedia[for_viewer[i]];
5725				add_media_for_popup_elem(media);
5726				//console.log(media.media_id);
5727			}
5728		});
5729		$gallery_parrent.append($gallery);
5730	});
5731	
5732
5733
5734	var topic_photo_uid = 0;
5735	$topic.find(".topic-photo-new").each(function(){
5736		var id = topic_photo_uid++;
5737		var $me = $(
5738			'<div class="topic-photo">' +
5739				'<div class="topic-photo-main">' +
5740					'<img class="topic-photo-proportions" src="' + $_PARAM.url_static +'img/16x9.jpg">' +
5741					'<ul class="topic-photo-list">' +
5742						'<li class="topic-photo-item" onselectstart="return false;" onmousedown="return false;">' +
5743							'<img class="topic-photo-img">' +
5744							'<div class="topic-photo-description"></div>' +
5745							'<div class="topic-photo-z"></div>' +
5746						'</li>' +
5747					'</ul>' +
5748				'</div>' +
5749				'<div class="topic-photo-scroll" onselectstart="return false;" onmousedown="return false;">' +
5750					'<div class="topic-photo-scroll-next"><span class="ico i_media_next"></div>' +
5751					'<div class="topic-photo-scroll-prev"><span class="ico i_media_prev"></div>' +
5752					'<ul class="topic-photo-scroll-list">' +
5753						'<li class="topic-photo-scroll-item"></li>' +
5754					'</ul>' +
5755				'</div>' +
5756				'<ul class="topic-photo-preview-list">' +
5757					'<li class="topic-photo-preview-item">' +
5758						'<img class="topic-photo-preview-proportions" src="' + $_PARAM.url_static +'img/16x9.jpg">' +
5759						'<img class="topic-photo-preview-img">' +
5760						'<div class="topic-photo-preview-border"></div>' +
5761					'</li>' +
5762				'</ul>' +
5763			'</div>'
5764		);
5765		
5766		var $content_list = $me.find('.topic-photo-list');
5767		var $content_item = $me.find('.topic-photo-item').detach();
5768		var $scroll_list = $me.find('.topic-photo-scroll-list');
5769		var $scroll_item = $me.find('.topic-photo-scroll-item').detach();
5770		var $scroll_next = $me.find('.topic-photo-scroll-next');
5771		var $scroll_prev = $me.find('.topic-photo-scroll-prev');
5772		var $preview_list = $me.find('.topic-photo-preview-list');
5773		var $preview_item = $me.find('.topic-photo-preview-item').detach();
5774		var photos = [];
5775		var current_element = 0;
5776		for(var index in for_viewer){
5777			var media = aOutMedia[for_viewer[index]];
5778			if(media.media_type_id == 1){
5779				photos.push(media);
5780			}else{
5781				//TODO
5782			}
5783		}
5784		if(photos.length == 0){
5785			$me.remove();
5786			return;
5787		}else if(photos.length == 1){
5788			//TODO
5789			$me.remove();
5790			return;
5791		}
5792		for(var index = 0, len = photos.length; index < len; index++){
5793			var photo = photos[index];
5794			//console.log(photo)
5795			if(_tools.info.is.mobile && parseInt($(window).width()) <= 480){
5796				var url = photo.media_name.medium;
5797			}else{
5798				var url = photo.media_name.big;
5799			}
5800			var url_preview = photo.media_name.small;
5801			
5802			var $_content_item = $content_item.clone(true);
5803			var $_preview_item = $preview_item.clone(true);
5804			var $_scroll_item = $scroll_item.clone(true);
5805			
5806			$_content_item.addClass('next');
5807			
5808			$_content_item.attr('data-index', index);
5809			$_preview_item.attr('data-index', index);
5810			$_scroll_item.attr('data-index', index);
5811			
5812			$_content_item.find('.topic-photo-img').attr('src', url);
5813			$_preview_item.find('.topic-photo-preview-img').attr('src', url_preview);
5814			
5815			if(photo.media_desc == ''){
5816				$_content_item.find('.topic-photo-description').remove();
5817			}else{
5818				$_content_item.find('.topic-photo-description').text(photo.media_desc);
5819			}
5820			
5821			
5822			$content_list.append($_content_item);
5823			$scroll_list.append($_scroll_item);
5824			$preview_list.append($_preview_item);
5825		}
5826		$content_list.children().eq(current_element).removeClass('next').addClass('current');
5827		
5828		$content_list.on('mousedown touchstart', function(e){
5829			e.stopPropagation();
5830			var cursor_start_x = e.offsetX || e.originalEvent.layerX;
5831			try{
5832				if(typeof e.originalEvent.changedTouches[0] != 'undefined'){
5833					cursor_start_x = e.originalEvent.changedTouches[0].clientX;
5834				}
5835			}catch(exp){}
5836			
5837			$content_list.trigger("mousedown.topic-photo-"+id, [cursor_start_x]);
5838		});
5839		$content_list.bind('mousedown.topic-photo-'+id, function(e, cursor_start_x){
5840			if(e.namespace != 'topic-photo-'+id){
5841				return;
5842			}
5843			
5844			var current_width = parseInt($content_list.width(),10);
5845			var $childs = $content_list.children();
5846			
5847			var $elem_prev = current_element == 0 ? false : $childs.eq(current_element - 1);
5848			var $elem_current = $childs.eq(current_element);
5849			var $elem_next = current_element == photos.length - 1 ? false : $childs.eq(current_element + 1);
5850
5851			
5852			var start_transform = $elem_current.css('transform') + '';
5853			var start_left = parseInt(start_transform.replace(/matrix\(.*,.*,.*,.*,(.*),.*\)/g, '$1'), 10);
5854			var start_move_left = current_element * current_width + start_left;
5855			
5856			
5857			var current_left_prev = start_move_left;
5858			$(document).bind('mousemove.topic-photo-'+id+' touchmove.topic-photo-'+id, function(e){
5859				var cursor_x = _tools.element.cursor.x($content_list[0]);
5860				try{
5861					if(typeof e.originalEvent.changedTouches[0] != 'undefined'){
5862						x = e.originalEvent.changedTouches[0].clientX;
5863					}
5864				}catch(exp){}
5865				var cursor_end_x =  cursor_x - cursor_start_x;
5866				
5867				var current_left = current_element * current_width + start_move_left;
5868				var current_left_elem = cursor_end_x;
5869				
5870				//console.log(cursor_start_x, cursor_end_x, cursor_x);
5871				var stop_scroll = false;
5872				
5873
5874				
5875				//console.log($elem_prev, $elem_current, $elem_next)
5876				
5877				if(Math.ceil((current_left + current_left_elem)/current_width) !== current_element){
5878					var next_elem = Math.abs(Math.ceil((current_left + current_left_elem)/current_width));
5879					console.log(
5880						'(', current_left, '+' , current_left_elem, ')', '/' , current_width, '=' , 
5881							(current_left + current_left_elem)/current_width, '=' , 
5882							Math.abs(Math.ceil((current_left + current_left_elem)/current_width)), ',',
5883						current_element
5884					);
5885					if(next_elem > photos.length - 1 || next_elem < 0){
5886						stop_scroll = true;
5887					}
5888					
5889					$elem_prev = current_element == 0 ? false : $childs.eq(current_element - 1);
5890					$elem_current = $childs.eq(current_element);
5891					$elem_next = current_element == photos.length - 1 ? false : $childs.eq(current_element + 1);
5892					
5893					var index = 0;
5894					$childs.each(function(){
5895						if(current_element == index){
5896							$elem_current = $(this);
5897							$elem_current
5898								.removeClass('next')
5899								.removeClass('prev')
5900								.addClass('current');
5901								
5902						}else if(index < current_element){
5903							$(this)
5904								.removeClass('next')
5905								.removeClass('current')
5906								.addClass('prev');
5907							if(index < current_element - 1){
5908								$(this).css('transform', '');
5909							}
5910						}else if(index > current_element){
5911							$(this)
5912								.removeClass('prev')
5913								.removeClass('current')
5914								.addClass('next');
5915							if(index > current_element + 1){
5916								$(this).css('transform', '');
5917							}
5918						}
5919					});
5920					current_element = next_elem;
5921				}
5922				if($elem_prev) $elem_prev.css('transform', 'translateX(' + current_left_elem + 'px)');
5923				if($elem_next) $elem_next.css('transform', 'translateX(' + (current_width + current_left_elem) + 'px)');
5924				$elem_current.css('transform', 'translateX(' + current_left_elem + 'px)');
5925				
5926				
5927				current_left_prev = current_left;
5928			});
5929			$(document).bind('mouseup.topic-photo-'+id+' touchend.topic-photo-'+id+' touchcancel.topic-photo-'+id+'',function(){
5930				$(document).unbind(
5931					'touchstart.topic-photo-'+id+' ' +
5932					'mousedown.topic-photo-'+id+' ' +
5933					'mousemove.topic-photo-'+id+' ' +
5934					'touchmove.topic-photo-'+id+' ' +
5935					'mouseup.topic-photo-'+id+' ' +
5936					'touchend.topic-photo-'+id+' ' +
5937					'touchcancel.topic-photo-'+id
5938				);
5939			});
5940		});
5941
5942		
5943		$(this).append($me);
5944	});
5945	$topic.find('.topic-text .media').each(function(){
5946		var $me = $(this);
5947		var id = $me.attr('data-id');
5948		if(typeof aOutMedia[id] == "undefined"){
5949			return;
5950		}
5951		var media = aOutMedia[id];
5952		var align = $me.attr('data-align');
5953		$me.addClass(align);
5954		set_media_for_div($me, media, align);
5955		add_media_for_popup_elem(media);
5956		$popup_elem.trigger('open', [media.media_id, $me.find('img')]);
5957	});
5958	
5959	var callbacks = {
5960		open: function(){
5961			$('object').css('visibility', 'hidden');
5962		},
5963		close: function(){
5964			$('object').css('visibility', '');
5965		}
5966	};
5967	
5968	$popup_elem.magnificPopup({
5969		delegate: 'a',
5970		type: 'image',
5971		tLoading: 'Изображение загружается #%curr%...',
5972		mainClass: 'mfp-img-mobile',
5973		gallery: {
5974			enabled: true,
5975			preload: [0,1]
5976		},
5977		image: {
5978			tError: 'Не получилось загрузить <a href="%url%">изображение #%curr%</a>.',
5979			titleSrc: function(item) {
5980				return item.el.attr('title');
5981			}
5982		},
5983		overflowY: 'scroll',
5984		callbacks: callbacks
5985	});
5986	
5987};
5988
5989
5990
5991
5992
5993
5994function topic_set_messages(){
5995
5996	$('.auth').new_window();
5997	
5998	$(".topic-messages").on("click", ".j_message_role_button", function(){
5999		var $parent = $(this).closest(".j_message_role_block").find('.j_message_role_text');
6000		if($parent.is('.off')){
6001			$parent.removeClass('off');
6002			$parent.addClass('on');
6003		}else{
6004			$parent.removeClass('on');
6005			$parent.addClass('off');
6006		}
6007	});
6008	
6009	
6010	
6011	
6012	$('.j_message .send.off').click(function(){
6013		if(!$_PARAM.user){
6014			var $form = $('<div class="auth_form">' +
6015				'<b>Вы не авторизованы</b><br>' +
6016				'<span>Вам необходимо авторизоваться, чтобы<br> оценить комментарий</span>' +
6017				'<div class="auth_form_buttons">' +
6018					'<div class="auth_form_button auth_form_auth my-btn my-btn-blue">Авторизоваться</div>' +
6019					'<div class="auth_form_button auth_form_cancel my-btn">Отмена</div>' +
6020				'</div>' +
6021			'</div>');
6022			$form.css({'text-align':'center'});
6023			var $btn = $('<a></a>').attr('data-url', $_PARAM.url_auth);
6024			$btn.new_window();
6025			
6026			var message = $.message({
6027				form: $form,
6028				onkeydown: function(e){
6029					if(e.which == 13){
6030						$(this).find('.auth_form_auth').click();
6031					}else if(e.which == 27){
6032						$(this).find('.auth_form_cancel').click();
6033					}
6034				}
6035			});
6036			
6037			$form.find('.auth_form_auth').click(function(){
6038				$btn.trigger('click');
6039				$btn.one('oauth_close', function(){
6040					message.close();
6041				});
6042			});
6043			$form.find('.auth_form_cancel').click(function(){
6044				message.close();
6045			});
6046		}else{
6047			var $self = $(this);
6048			var $me = $self.closest('.j_message');
6049			var id = $me.data('id');
6050			var like = $self.is('.like') ? '1':'0';
6051			var i = parseInt($self.closest('.vote_parrent').find('.vote').text())+ (like=='1'?1:-1);
6052			
6053			var rate_plus = parseInt($me.find('.user_rate').attr('data-plus'), 10);
6054			var rate_minus = parseInt($me.find('.user_rate').attr('data-minus'), 10);
6055			var rate_sum = parseInt($me.find('.user_rate').attr('data-sum'), 10);
6056
6057			$.ajax({
6058				type:'POST',
6059				data:{id:id,vote:like},
6060				url: $_PARAM.url_folder + 'other/vb_api.php?message_vote',
6061				dataType:"JSON",
6062				success:function(r){
6063					if(r.event == 'success'){
6064						$self.closest('.vote_parrent').find('.send').removeClass('off').addClass('on');
6065						$self.closest('.vote_parrent').find('.vote')
6066							.text(i > 0 ? '+' + i : i)
6067							.removeClass('up')
6068							.removeClass('down')
6069							.removeClass('zero')
6070						if(i>0){
6071							$self.closest('.vote_parrent').find('.vote').addClass('up');
6072						}else if(i<0){
6073							$self.closest('.vote_parrent').find('.vote').addClass('down');
6074						}else{
6075							$self.closest('.vote_parrent').find('.vote').addClass('zero');
6076						}
6077						$self.closest('.vote_parrent').find('.vote').unbind('click');
6078						$self.closest('.j_message').addClass('message_me_vote');
6079						
6080						if(like == '1'){
6081							rate_plus = rate_plus + 1;
6082							$me.find('.user_rate .user_rate-info-plus').text(rate_plus);
6083							$me.find('.user_rate').attr('data-plus', rate_plus);
6084						}else{
6085							rate_minus = rate_minus + 1;
6086							$me.find('.user_rate .user_rate-info-minus').text(rate_minus);
6087							$me.find('.user_rate').attr('data-minus', rate_minus);
6088						}
6089						rate_sum = rate_plus - rate_minus;
6090						$me.find('.user_rate .user_rate-sum')
6091							.removeClass('user_rate-sum-plus')
6092							.removeClass('user_rate-sum-minus')
6093							.removeClass('user_rate-sum-zero')
6094							.addClass(rate_sum == 0 ? 'user_rate-sum-zero' : (rate_sum > 0 ? 'user_rate-sum-plus' : 'user_rate-sum-minus'))
6095							.text((rate_sum == 0 ? '' : (rate_sum > 0 ? '+' : '-')) + Math.abs(rate_sum));
6096						$me.find('.user_rate').attr('data-sum', rate_sum);
6097						
6098						
6099					}
6100				},
6101				error: function(){
6102				}
6103			});
6104		}
6105	});
6106	
6107	var $message_form = $("#j_message_send_form").clone();
6108	$message_form.attr('id', '');
6109	
6110	
6111	if($message_form.length == 0){
6112		$(".j_message .reply").css("display", "none");
6113		return;
6114	}
6115	
6116	//Получить сообщение с сервера по его id
6117	var get_message = function(id, callback, bb){
6118		$.ajax({
6119			type:'POST',
6120			data:{id:id},
6121			url: $_PARAM.url_folder + 'other/vb_api.php?get_message' + (bb ? '&bb' : ''),
6122			dataType:"JSON",
6123			success:function(r){
6124				if(r[0] == false){
6125					callback(true);
6126					return;
6127				}
6128				callback(false, r[1], r[2]);
6129			},
6130			error: function(){
6131				callback(true);
6132			}
6133		});
6134	};
6135	
6136	var set_error = function($elem){
6137		$elem.css({'outline':'2px rgba(255,0,0,1) solid'});
6138		setTimeout(function(){
6139			$elem.css({'outline':'none'});
6140		},2000);
6141	}
6142	
6143	
6144	var set_message_form = function($form, parrent_id){
6145		parrent_id = parrent_id || 0;
6146		
6147		$form.find('.auth').new_window();
6148		
6149		var wysibb_form = $form.find('.j_message_send_message').wysibb({
6150			buttons: "bold,italic,underline,|,img,link,myimg,quote",
6151			allButtons:{
6152				quote:{
6153					transform:{
6154						"<blockquote><b>{NAME}</b><br>{SELTEXT}</blockquote>": '[quote={NAME}]{SELTEXT}[/quote]'
6155					}
6156				}
6157			},
6158			traceTextarea:true,
6159			smileList:[],
6160			themePrefix: $_PARAM.url_static + 'jquery/wysibb/',
6161			img_uploadurl: $_PARAM.url_folder + 'iupload.php',
6162			'min-heigth': 100,
6163			wbbdebug: true
6164		});
6165		
6166		
6167		if(_tools.info.is.mobile){
6168			$form.find('.wysibb .btn-inner.modesw').trigger('click', [true]);
6169		}
6170		$form.find(".j_message_send_submit").click(function(e){
6171			e.preventDefault();
6172			e.stopPropagation();
6173			session_valid(function(err, key){
6174				if(err){
6175					console.log(err);
6176					return;
6177				}
6178				// Сбор данных
6179				var error = false;
6180				var data = {
6181					rand: key,
6182					message: ($form.find(".j_message_send_message").bbcode() + '').replace(/(^\s*|\s*$)/,''),
6183					uid: user_uid,
6184					parrent_id: parrent_id
6185				}
6186				if(data.message == ''){
6187					set_error($form.find('.j_message_send_message'));
6188					error = true;
6189				}
6190				
6191				if(!$_PARAM.user){
6192					data.user_name = ($form.find('.j_message_send_user_name').val() + '').replace(/(^\s*|\s*$)/,'');
6193					if(data.user_name == ''){
6194						set_error($form.find('.j_message_send_user_name'));
6195						error = true;
6196					}
6197				}
6198				if(error){
6199					return false;
6200				}
6201				// Отправка сообщения
6202				$.ajax({
6203					type: 'POST',
6204					data: data,
6205					url: $_PARAM.url_folder + 'add_message.php?add_message=' + $_PARAM.topic.id,
6206					dataType:"JSON",
6207					async:true,
6208					success: function(r){
6209						if(r[0] == false){
6210							console.log(r[1]);
6211						}else{
6212							if($_PARAM.user == 13 ){
6213								window.location.href = 
6214									window.location.origin + 
6215									window.location.pathname + 
6216									window.location.search + 
6217									"#message" +r[2]
6218								;
6219								window.location.reload();
6220							}else{
6221								$form.empty();
6222								$form.css({
6223									'font-size': '16px',
6224									'font-weight': 'bold',
6225									'padding': '24px',
6226									'background-color': '#f0f0f0',
6227									'text-align': 'center',
6228								});
6229								$form.text("Ваше сообщение появится на сайте после проверки модератором");
6230							}
6231						}
6232					}
6233				});
6234			});
6235		});
6236	}
6237	set_message_form($("#j_message_send_form"));
6238	
6239	$('.j_message .complaint').click(function(){
6240		var $me = $(this);
6241		$me.removeClass('complaint')
6242			.addClass('complaint2')
6243			.unbind('click')
6244			.text('Отправка...');
6245		var message_id = $me.closest('.j_message').data('id');
6246		session_valid(function(err, key){
6247			if(err){
6248				console.log(err);
6249				return;
6250			}
6251			var data = {
6252				message_id: message_id,
6253				rand: key
6254			}
6255			$.ajax({
6256				type: 'POST',
6257				data: data,
6258				url: $_PARAM.url_folder + 'add_message.php?message_complaint',
6259				dataType:"JSON",
6260				async:true,
6261				success: function(r){
6262					if(r[0] == false){
6263						console.log(r[1]);
6264						$me.text('Произошла ошибка')
6265					}else{
6266						$me.text('Жалоба отправлена')
6267					}
6268				}
6269			});
6270		})
6271	});
6272	$('.topic-messages .not_moderated').click(function(){
6273		$(this).text('Запрашиваю...')
6274			.addClass('off')
6275			.unbind('click');
6276		var $me = $(this).closest('.j_message');
6277		var message_id = $me.data('id');
6278		get_message(message_id, function(err, user_name, text){
6279			$me.find('.text').html(text);
6280		}, true);
6281	});
6282	
6283	$('.j_message .delete').click(function(){
6284		var $me = $(this);
6285		var message_id = $me.closest('.j_message').data('id');
6286		
6287		var $form = $('<div class="auth_form">' +
6288			'<b>Вы уверены что хотите удалить ваше<br> сообщение?</b>' +
6289			'<div class="auth_form_buttons">' +
6290				'<div class="auth_form_button auth_form_auth my-btn my-btn-red">Удалить</div>' +
6291				'<div class="auth_form_button auth_form_cancel my-btn">Отмена</div>' +
6292			'</div>' +
6293		'</div>');
6294		$form.css({'text-align':'center'});
6295		var $btn = $('<a></a>').attr('data-url', $_PARAM.url_auth);
6296		$btn.new_window();
6297		
6298		var message = $.message({
6299			form: $form,
6300			onkeydown: function(e){
6301				if(e.which == 13){
6302					$(this).find('.auth_form_auth').click();
6303				}else if(e.which == 27){
6304					$(this).find('.auth_form_cancel').click();
6305				}
6306			}
6307		});
6308		
6309		$form.find('.auth_form_auth').click(function(){
6310			delete_message(message.close);
6311		});
6312		$form.find('.auth_form_cancel').click(function(){
6313			message.close();
6314		});
6315		
6316		
6317		var delete_message = function(c){
6318			session_valid(function(err, key){
6319				if(err){
6320					console.log(err);
6321					return;
6322				}
6323				var data = {
6324					message_id: message_id,
6325					rand: key
6326				};
6327				// Отправка запроса на удаление
6328				$.ajax({
6329					type: 'POST',
6330					data: data,
6331					url: $_PARAM.url_folder + 'add_message.php?delete_message=' + $_PARAM.topic.id,
6332					dataType:"JSON",
6333					async:true,
6334					success: function(r){
6335						if(r[0] == false){
6336							console.log(r[1]);
6337							c();
6338						}else{
6339							window.location.href = 
6340								window.location.origin + 
6341								window.location.pathname + 
6342								window.location.search
6343							;
6344							window.location.reload();
6345							c();
6346						}
6347					}
6348				});
6349			});
6350		}
6351	});
6352	
6353	$('.j_message .edit').click(function(){
6354		var $me = $(this).closest('.j_message');
6355		var $form = $me.find('.j_message_edit');
6356		var form_html = $me.find('.text_edit').html();
6357		var message_id = $me.data('id');
6358		get_message(message_id, function(err, user_name, text){
6359			$me.addClass("on_edit");
6360			var $save = $('<div class="save" onselectstart="return false;" onmousedown="return false;">Сохранить</div>');
6361			var $cancel = $('<div class="save" onselectstart="return false;" onmousedown="return false;">Отмена</div>');
6362			$me.find('.event').prepend($save);
6363			$me.find('.event').prepend($cancel);
6364			$form.val(text);
6365			$form.wysibb({
6366				buttons: "bold,italic,underline,|,img,link,quote",
6367				allButtons:{
6368					quote:{
6369						transform:{
6370							"<blockquote><b>{NAME}</b><br>{SELTEXT}</blockquote>": '[quote={NAME}]{SELTEXT}[/quote]'
6371						}
6372					}
6373				},
6374				traceTextarea:true,
6375				smileList:[],
6376				themePrefix: $_PARAM.url_static + 'jquery/wysibb/',
6377				img_uploadurl: $_PARAM.url_folder + 'iupload.php',
6378				'min-heigth': 100
6379			});
6380			if(_tools.info.is.mobile){
6381				$('.wysibb .btn-inner.modesw').click()
6382			}
6383
6384			$cancel.click(function(){
6385				$me.removeClass("on_edit");
6386				$save.remove();
6387				$cancel.remove();
6388				console.log(form_html)
6389				$me.find('.text_edit').empty().append(form_html);
6390			});
6391			$save.click(function(){
6392				$save.css('display', 'none');
6393				$cancel.css('display', 'none');
6394				session_valid(function(err, key){
6395					if(err){
6396						console.log(err);
6397						return;
6398					}
6399					var data = {
6400						rand: key,
6401						message_id: message_id,
6402						message: ($form.bbcode() + '').replace(/(^\s*|\s*$)/,'')
6403					}
6404					if(data.message == ''){
6405						set_error($me.find('.text_edit'));
6406						return;
6407					}
6408					// Отправка обновлённого сообщения
6409					$.ajax({
6410						type: 'POST',
6411						data: data,
6412						url: $_PARAM.url_folder + 'add_message.php?edit_message=' + $_PARAM.topic.id,
6413						dataType:"JSON",
6414						async:true,
6415						success: function(r){
6416							if(r[0] == false){
6417								console.log(r[1]);
6418								$cancel.click();
6419							}else{
6420								get_message(message_id, function(err, user_name, text){
6421									$me.find('.text').empty().append(text);
6422									$cancel.click();
6423								}, true);
6424							}
6425						}
6426					});
6427				})
6428			});
6429			
6430		}, false);
6431	});
6432	/*
6433	$('.j_message .reply').click(function(){
6434		var $me = $(this).closest('.j_message');
6435		var message_id = $me.data('id');
6436		$me.addClass('message_reply');
6437		var $cancel = $('<div class="cancel" onselectstart="return false;" onmousedown="return false;">Отмена</div>');
6438		var $form = $message_form.clone();
6439		$me.find('.bottom .event').prepend($cancel);
6440		$me.find('.reply_form').append($form);
6441		set_message_form($form, message_id);
6442		$cancel.click(function(){
6443			$cancel.remove();
6444			$me.removeClass('message_reply');
6445			$me.find('.reply_form').empty();
6446		});
6447	});
6448	*/
6449	$('.j_message .quote_btn').click(function(){
6450		var $me = $(this).closest('.j_message');
6451		var message_id = $me.data('id');
6452		get_message(message_id, function(err, user_name, text){
6453			var $form_bb = $("#j_message_send_form").find('textarea');
6454			var str = $form_bb.bbcode();
6455			if(str.length != 0){
6456				str = str + "\n";
6457			}
6458			str = str + '[quote=' + user_name + ']' + text + '[/quote]';
6459			
6460			var $btn = $('#j_message_send_form .wysibb .wysibb-toolbar-btn.mswitch');
6461			//console.log($btn)
6462			//console.log(text);
6463			if(!_tools.info.is.mobile && !$btn.is('.on')){
6464				$btn.find('.btn-inner').click();
6465				$form_bb.bbcode(str);
6466				//console.log($btn.find('.btn-inner'), 'click klack');
6467				$btn.find('.btn-inner').click();
6468			}else{
6469				$form_bb.bbcode(str);
6470			}
6471			
6472		});
6473	});
6474};
6475/**
6476 * @depends jQuery
6477 * @depends _tools
6478 * @depends $_PARAM
6479*/
6480//Всплывающие окошки из раздела "Справка ВБ"
6481(function($){
6482	'use stract';
6483	var uid = 0;
6484	$.fn.info_link = function(option){
6485		var settings = $.extend({
6486			time_hover:1000,
6487			time_close:200
6488		},option);
6489		
6490		var timer = false;
6491		
6492		var col = [],
6493			data = [],
6494			beck = undefined;
6495		var query = function(callback, limit){
6496			if(typeof limit == 'undefined'){
6497				limit = 3;
6498			}
6499			if(col.length == 0){
6500				return;
6501			}
6502			
6503			//console.log(me_url)
6504			$.ajax({
6505				url: $_PARAM.url_folder + 'other/vb_api.php?topic_info',
6506				data: {
6507					ids: JSON.stringify(col)
6508				},
6509				success:function(r){
6510					callback(false, r);
6511				},
6512				dataType: 'JSON',
6513				error:function(){
6514					//console.log(limit);
6515					if(limit <= 0){
6516						callback(true);
6517						return;
6518					}
6519					limit--;
6520					query(callback,limit);
6521				},
6522				type : 'POST'
6523			});
6524		};
6525		var step2_callback = function(err,result){
6526			if(err){
6527				beck = false;
6528				return;
6529			}
6530			for(var i in result){
6531				var cur = result[i];
6532				data.push({
6533					id: cur.i,
6534					name: cur.n,
6535					lead: cur.l,
6536					src: cur.s
6537				});
6538			};
6539			//console.log(data);
6540			beck = true;
6541		}
6542		
6543		var ret = this.each(function(){
6544			var self = $(this),
6545				id = (self.attr('href')||"").replace(/.*\/([0-9]{5,})\_.*/gi,'$1');
6546			if(!id.match(/^[\d]+$/)){
6547				console.log('not_match: '+self.attr('href'))
6548				return;
6549			}
6550			col.push(parseInt(id));
6551			var timer = false;
6552			
6553			var load = function(me_data, el){
6554				var my_id = uid++;
6555				var $info_bar = $('<div class="info_bar"><div class="info_bar_children clearfix"></div></div>');
6556				var $info_bar_children = $info_bar.find('.info_bar_children');
6557				if(me_data.src != null){
6558					$info_bar_children.append($('<div class="info_bar_parrent_img"></div>').append($('<img class="info_bar_img">').attr('src', me_data.src)));
6559				}
6560				$info_bar_children.append($('<div class="info_bar_top"></div>')
6561					.append($('<div class="info_bar_close"></div>').text('×').click(function(e){close();e.stopPropagation();e.preventDefault();}))
6562					.append($('<a class="info_bar_link" target="_blank"></a>').text(me_data.name).attr("href", $_PARAM.url_folder + me_data.id))
6563				);
6564				$info_bar_children.append($('<span class="info_bar_lead"></span>').text(me_data.lead + ' '));
6565				$info_bar_children.append(
6566					$('<a class="info_bar_link_end" target="_blank"></a>')
6567						.text('Подробнее')
6568						.attr("href", $_PARAM.url_folder + me_data.id)
6569				);
6570				
6571				var close = function(){
6572					el.attr('val','');
6573					$info_bar.remove();
6574					$(document).off('click.info_bar_' + my_id);
6575				};
6576				
6577				var timer = false;
6578				el.attr('val','open');
6579				
6580				var hover = function(){
6581						timer = setTimeout(function(){close();}, settings.time_close);
6582					},
6583					unhover = function(){
6584						clearTimeout(timer);
6585					};
6586				
6587				el.click(function(){close();});
6588				$info_bar_children.click(function(e){
6589					e.stopPropagation();
6590				});
6591				$info_bar.click(function(e){
6592					e.preventDefault();
6593					e.stopPropagation();
6594				});
6595				$(document).on('click.info_bar_' + my_id, function(){
6596					close();
6597				})
6598				
6599				$('body').append($info_bar);
6600				
6601				
6602				var width = parseInt($info_bar.outerWidth(true));
6603				
6604				var w = _tools.window.width();
6605				var mouse_x = _tools.document.cursor.x();
6606				var mouse_y = _tools.document.cursor.y();
6607				
6608				if(width > w){
6609					mouse_x = 0;
6610					$info_bar.css('width', w - (width-$info_bar.width()));
6611				}else if(w <= 480){
6612					mouse_x = 0;
6613					$info_bar.css('width', w - (width-$info_bar.width()));
6614				}else if(w < mouse_x + width){
6615					if(w < mouse_x){
6616						mouse_x -= width;
6617					}else{
6618						mouse_x -= mouse_x + width - w;
6619					}
6620				}
6621				$info_bar.css({
6622					top: mouse_y + 'px',
6623					left: mouse_x + 'px'
6624				});
6625			};
6626			self.on('click', function(e){
6627				var me = $(this);
6628				if(me.attr('val') == 'open'){
6629					return;
6630				}
6631				for(i in data){
6632					if(data[i].id == id){
6633						load(data[i], me);
6634					}
6635				}
6636				e.preventDefault();
6637				e.stopPropagation();
6638			});
6639		});
6640		query(step2_callback);
6641		return ret;
6642	}
6643}(jQuery));
6644$('.info_link').info_link();
6645
6646(function(){
6647	"use strict";
6648	
6649	var $me = $('.lable_info_form');
6650	var current_submit = false;
6651	$me.append('<input class="lable_info_rand" type="hidden" name="rand">');
6652	$me.attr('enctype', 'multipart/form-data')
6653	
6654	// Прикркпляемые файлы
6655	var file_panel = function($files){
6656		var add = function(){
6657			var $elem = $('<div class="lable_info_file"></div>');
6658			$elem.append($('<input type="file" name="files[]" class="lable_info_file_input">'));
6659			$elem.append($('<span class="lable_info_file_delete">').attr('name', 'name[]').text('Удалить'));
6660			$elem.find('.lable_info_file_delete').click(function(){
6661				$elem.remove();
6662				clear();
6663			});
6664			$elem.find('.lable_info_file_input').bind('change', function(){
6665				clear();
6666			});
6667			$files.append($elem);
6668		}
6669		var clear = function(){
6670			$files.find(".lable_info_file_input").each(function(){
6671				if($(this).val() == ''){
6672					$(this).closest('.lable_info_file').remove();
6673				}
6674			});
6675			add();
6676		}
6677		clear();
6678	};
6679	file_panel($me.find('.lable_info_files'));
6680	
6681	$me.attr('action', $_PARAM.url_folder + 'add_message.php?add_news');
6682	
6683	var error_timeout = false;
6684
6685	$me.on('submit', function(e){
6686		e.preventDefault();
6687		if(current_submit){
6688			return;
6689		}
6690		var message = ($me.find('.lable_info_textarea').val()+'').replace(/(^\s*([^\s])|([^\s])\s*$)/g, '$2$3');
6691		
6692
6693		if(message == ''){
6694			var $textarea = $('.lable_info_textarea').closest('.lable_info_row');
6695			$textarea.find('.lable_info_textarea_parrent').css({
6696				'border-color': '#f55'
6697			})
6698			$textarea.find('.lable_info_lable').css({
6699				'color': '#800'
6700			});
6701			clearTimeout(error_timeout);
6702			error_timeout = setTimeout(function(){
6703				$textarea.find('.lable_info_textarea_parrent').css({
6704					'border-color': ''
6705				})
6706				$textarea.find('.lable_info_lable').css({
6707					'color': ''
6708				});
6709			}, 1000);
6710			return;
6711		}
6712		current_submit = true;
6713		var on_error = function(){
6714			var $form = $(
6715				'<div>' +
6716					'<b>Не удалось отправить статью</b><br><br>' +
6717					'<span>Попробуйте отправить статью<br> немного поже</span><br><br>' +
6718					'<div><div class="my-btn">Закрыть</div></div>' +
6719				'</div>'
6720			);
6721			var message_form = $.message({
6722				form: $form,
6723				onkeydown: function(e){
6724					if(e.which == 27){
6725						message_form.close();
6726					}
6727				}
6728			});
6729			$form.find('.my-btn').click(function(){
6730				message_form.close();
6731			});
6732		}
6733		session_valid(function(err, key){
6734			if(err){
6735				on_error();
6736				current_submit = false;
6737			}else{
6738				$me.find('.lable_info_rand').val(key);
6739				
6740				var $form = $("<div style='max-width:250px;'></div>");
6741				var is_success = false;
6742				var is_end = false;
6743				var message_form = $.message({
6744					form: $form,
6745					onkeydown: function(e){
6746						if(is_success && e.which == 27){
6747							message_form.close();
6748						}
6749					},
6750					onclose: function(cb){
6751						if(is_end){
6752							if(is_success){
6753								window.location = $_PARAM.url;
6754								//current_submit = false;
6755								cb(true);
6756							}else{
6757								current_submit = false;
6758								cb(true);
6759							}
6760						}else{
6761							cb(false);
6762						}
6763					}
6764				});
6765				
6766				$form.html('<b>Подождите</b><br><br>ваша статья отправляется...<br><br><div class="percent_text"></div><div class="progress"><div class="percent"></div></div>');
6767				
6768				$form.find(".progress").css({
6769					'width': '100%',
6770					'height': '10px',
6771					'background-color': "#ccc"
6772				});
6773				$form.find(".percent").css({
6774					'width': '20%',
6775					'height': '100%',
6776					'background-color': "#000"
6777				});
6778				$form.find('.percent_text').css({
6779					height: '20px',
6780					textAlign: 'center',
6781					fontWeight: 'bold'
6782				});
6783				var animate = function(){
6784					$form.find(".percent").animate({
6785						'marginLeft': '80%'
6786					},{
6787						complete : function(){
6788							$form.find(".percent").animate({
6789								'marginLeft': '0%'
6790							}, {
6791								complete : function(){
6792									animate();
6793								},
6794								easing: 'linear',
6795								duration: 1000
6796							})
6797						},
6798						easing: 'linear',
6799						duration: 1000
6800					})
6801				};
6802				var first_progress = true;
6803				var stop_animate = function(){
6804					animate = function(){};
6805					$form.find(".percent").stop().css({
6806						'width': '0%',
6807						'marginLeft': '0'
6808					});
6809				}
6810				animate();
6811				var options = {
6812					success:function(h){
6813						var ret = $.parseJSON(h);
6814						$form.find(".progress").remove();
6815						
6816						if(ret[0] === true){
6817							is_success = true;
6818							$form.html(
6819								'<b>Ваша статья успешно отправлена</b>' +
6820								'<br><br>' +
6821								'<span>Статья появится на сайте после того, как её опубликует редактор</span>' +
6822								'<br><br>' +
6823								'<div><div class="my-btn close">Закрыть</div></div>'
6824							);
6825							$form.find('.close').click(function(){
6826								message_form.close();
6827							});
6828						}else{
6829							$form.html(
6830								'<b>К сожалению, не удалось отправить вашу новость из-за ошибки на сервер</b>' +
6831								'<br><br>' +
6832								'<div><div class="my-btn close">Закрыть</div></div>'
6833							);
6834							$form.find('.close').click(function(){
6835								message_form.close();
6836							});
6837						}
6838						is_end = true;
6839					},
6840					error:function(){
6841						$form.html(
6842							'<b>К сожалению, не удалось отправить вашу новость из-за ошибки на сервер</b>' +
6843							'<br><br>' +
6844							'<div><div class="my-btn close">Закрыть</div></div>'
6845						);
6846						$form.find('.close').click(function(){
6847							message_form.close();
6848						});
6849						is_end = true;
6850					},
6851					uploadProgress:function(e,position, total, percent){
6852						if(first_progress){
6853							stop_animate();
6854							first_progress = false;
6855						}
6856						$form.find(".percent").stop().animate({
6857							width: ((position / total) * 100) + '%'
6858						},100);
6859						$form.find('.percent_text').text(Math.floor((position / total) * 100) + '%');
6860					}
6861				};
6862				$me.ajaxSubmit(options);
6863			}
6864		});
6865	});
6866	
6867}());
6868var print_topic = function(result){
6869
6870	
6871	topic_set_media(result);
6872	topic_set_bb_news(result);
6873	topic_set_messages();
6874	
6875	
6876	
6877	$(document).bind('keyup.topic', function(e){
6878		if($('body').is('.mfp-zoom-out-cur')){
6879			return;
6880		}
6881		if(e.which == 37){
6882			$topic.find('.topic-media-scroll-prev').trigger('go_to_prev');
6883		}else if(e.which == 39){
6884			$topic.find('.topic-media-scroll-next').trigger('go_to_next');
6885		}
6886	});
6887	
6888	(function(){
6889		var index = 1;
6890		var $cards = $(".topic-card");
6891		var len = ($cards.size() + '').length;
6892		var pad = function(string, width, padding, left) {
6893			if(width <= string.length){
6894				return string
6895			}else{
6896				var p = (new Array(width - string.length + 1)).join(padding);
6897				if(left !== false){
6898					return p + string;
6899				}else{
6900					return string + p;
6901				}
6902			}
6903		}
6904
6905		$cards.each(function(){
6906			var $card = $(this);
6907		//	var num = pad(index + '', len, '0');
6908		//	index++;
6909		//	$card.prepend('<div class="topic-card-index">' + num + '</div>');
6910		});
6911
6912	}());
6913}
6914
6915if($_PARAM.topic){
6916	print_topic($_PARAM.topic);
6917}
6918
6919//Баннеры
6920function set_all_banners(banners){
6921	
6922	$('body').append('<script language="Javascript">var flashinstalled = 0;	MSDetect = "false";</script>');
6923	if (navigator.mimeTypes && navigator.mimeTypes.length){
6924		x = navigator.mimeTypes["application/x-shockwave-flash"];
6925		if (x && x.enabledPlugin) flashinstalled = 2;
6926		else flashinstalled = 1;
6927	}else{
6928		MSDetect = "true";
6929	}
6930	(function(){
6931		try{
6932			$('body').append('<script language="VBScript">If MSDetect = "true" Then If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash"))) Then flashinstalled = 1 Else flashinstalled = 2 End If End If </script>');
6933		}catch(e){}
6934	})();
6935	
6936	
6937	var views_send = []; //[['A','480','32'],[pos, key, id]]
6938	var prepend_size = false;
6939	
6940	var $banners = $('.banner');
6941	
6942	var set_to_html = function(){
6943		$banners.each(function(){
6944			var $me = $(this),
6945				pos = $me.data('pos'),
6946				key = $me.data('key'),
6947				id  = $me.data('id'),
6948				set = $me.data('set') == "y" ? true : false;
6949			if(prepend_size != key){
6950				return;
6951			}
6952			if(set || typeof banners[pos] == "undefined" || typeof banners[pos][key] == "undefined"){
6953				return;
6954			}
6955			var banner = banners[pos][key];
6956			if(banner.title){
6957				$me.attr('title', banner.title);
6958			}
6959			if((flashinstalled != 2 || !banner.flash) && banner.img){
6960				var $img = $('<img>').attr({src: banner.img});
6961				if(banner.title){
6962					$img.attr({alt: banner.title});
6963				}
6964				if(banner.href){
6965					$img = $('<a></a>')
6966						.attr({href: banner.href, rel: 'nofollow', target: '_blank'})
6967						.click(function(){click_to_banner(pos, key, id);})
6968						.append($img);
6969				}else{
6970					$img = $('<span></span>')
6971						.append($img);
6972				}
6973				$me.append($img);
6974			}else if(banner.flash && flashinstalled == 2){
6975				var $flash = $('<object></object>')
6976					.width(banner.width)
6977					.height(banner.height)
6978					.attr('data', banner.flash)
6979					.append('<param name="quality" value="high"/>')
6980					.append('<param name="wmode" value="opaque"/>')
6981					.append($('<embed/>').attr({src: banner.flash, width: banner.width, height: banner.height}))
6982				$me.append($flash);
6983				$me.on('mousedown', 'object', function(){click_to_banner(pos, key, id);});
6984			}
6985			
6986			$me.data('set', 'y');
6987			views_send.push([pos, key, id]);
6988		});
6989		send_view();
6990	};
6991	var timeout_send = false;
6992	setTimeout(function(){
6993		timeout_send = true;
6994		send_view();
6995	}, 5000);
6996	var send_view = function(){
6997		if(!timeout_send){
6998			return;
6999		}
7000		if(views_send.length == 0){
7001			return;
7002		}
7003		var uid = typeof user_uid !== 'undefined' ? user_uid : 0;
7004		var data = {
7005			uid: uid,
7006			banners: JSON.stringify(views_send),
7007			event: 'view'
7008		}
7009		views_send = [];
7010		$.ajax({
7011			url: $_PARAM.url_folder + 'other/vb_api.php?stat_banner',
7012			data: data,
7013			type : 'POST',
7014			async : true,
7015			success: function(){
7016				timeout_send = false;
7017			}
7018		});
7019	}
7020	
7021	var click_to_banner = function(pos, key, id){
7022		var uid = typeof user_uid !== 'undefined' ? user_uid : 0;
7023		var data = {
7024			uid: uid,
7025			banners: JSON.stringify([[pos, key, id]]),
7026			event: 'click'
7027		}
7028		$.ajax({
7029			url: $_PARAM.url + 'other/vb_api.php?stat_banner',
7030			data: data,
7031			type : 'POST',
7032			async : true
7033		});
7034	}
7035	
7036	var resize_timeout = false;
7037	var resize = function(){
7038		var width = _tools.window.width();
7039		var key = width < 480 ? 240 : (width < 980 ? 480 : 980);
7040		if(prepend_size === false || prepend_size != key){
7041			prepend_size = ''+key;
7042			set_to_html();
7043		}
7044	};
7045	
7046	$(window).bind('resize orientationchange', function(){
7047		clearTimeout(resize_timeout);
7048		resize_timeout = setTimeout(function(){
7049			resize();
7050		}, 20);
7051	});
7052	$(document).on('image_init', function(){
7053		resize();
7054	})
7055}
7056set_all_banners($_PARAM.banners);
7057
7058/**
7059 * @depends jQuery
7060 * @depends _tools
7061*/
7062// Подгрузка изображений
7063(function(){
7064	var start_trigger = false;
7065	var count_img = 0;
7066	var onload = function(){
7067		count_img--;
7068		if(count_img == 0 && start_trigger == false){
7069			start_trigger = true;
7070			$(document).trigger('image_init');
7071		}
7072	};
7073	var timeout_resize_image = false;
7074	var foo = function(){
7075		var width = parseInt(_tools.window.width()),
7076			height = parseInt(_tools.window.height());
7077		$(".img-resize").each(function(){
7078			var me = $(this),
7079				min = parseInt(me.attr('data-min')) || 0,
7080				max = parseInt(me.attr('data-max')) || 10000000;
7081			if(min <= width && width < max){
7082				count_img++;
7083				me[0].onload = me[0].onerror = onload;
7084				me.attr('src', me.attr("data-src")).css('display','block');
7085			}else{
7086				//me.attr('src', '').css('display','none');
7087			}
7088			
7089		});
7090		if(count_img == 0){
7091			count_img++;
7092			onload();
7093		}
7094	};
7095	$(window).resize(function(){
7096		clearTimeout(timeout_resize_image);
7097		timeout_resize_image = setTimeout(foo, 30);
7098	});
7099	foo();
7100}());
7101;(function(){
7102	if($('.rekOlama').length == 0){
7103		return;
7104	}
7105	
7106	var money_format = function(cost){
7107		return (cost + '').replace(/(\d{3})(?=(\d{3})*$)/g, ' $1');
7108	}
7109	
7110	var animate = function($elem, num){
7111		$elem.stop().animate({
7112			'marginBottom': num,
7113		}, {
7114			step : function(){$(this).text(money_format(parseInt($(this).css('marginBottom'), 10)))},
7115			complete: function(){$(this).text(money_format(num))},
7116			duration: 200
7117		});
7118	}
7119		
7120	var sum = 0;
7121	var discount = 0;
7122	var total = 0;
7123	var discount_list = [
7124		[0,0],
7125		[30000, 5],
7126		[45000, 10],
7127		[90000, 15],
7128		[175000, 20],
7129		[250000, 25],
7130		[350000, 30],
7131		[500000, 35]
7132	];
7133	
7134	var scan = function(){
7135		var $checkers = $('.checker');
7136		var temp_sum = [];
7137		var margin_list = [];
7138		$checkers.each(function(){
7139			var $me = $(this);
7140			var count = parseInt($me.attr('data-cost'), 10) * parseInt($me.attr('data-val'), 10);
7141			animate($me.next(), count);
7142			temp_sum.push([count, $me.attr('id')]);
7143		});
7144		var $checkers = $('.checker2');
7145		$checkers.each(function(){
7146			var $me = $(this);
7147			var margin = 0;
7148			if($me.attr('data-checked') == '1'){
7149				var my_sum = 0;
7150				var percent = parseInt($me.attr('data-percent'), 10);
7151				var ids = ($me.attr('data-ids')+'').split(',');
7152				for(var i in temp_sum){
7153					if(temp_sum[i][1]+'' == ''){
7154						continue;
7155					}
7156					for(var j in ids){
7157						if(ids[j]+'' == ''){
7158							continue;
7159						}
7160						if(temp_sum[i][1] == ids[j]){
7161							my_sum += temp_sum[i][0];
7162						}
7163					}
7164				}
7165				margin = parseInt(my_sum * (percent / 100), 10);
7166			}
7167			temp_sum.push([margin, $me.attr('id')]);
7168			animate($me.next(), margin);
7169		});
7170		var temp = 0;
7171		for(var i in temp_sum){
7172			temp += temp_sum[i][0];
7173		}
7174		sum = temp;
7175		
7176		var temp_discount = 0;
7177		
7178		for(var i in discount_list){
7179			if(Math.ceil(discount_list[i][0] / (1 - (discount_list[i][1] / 100))) <= sum){
7180				temp_discount = discount_list[i][1];
7181			}
7182		}
7183		
7184		discount = temp_discount;
7185		
7186		var total = sum - parseInt(sum * (discount / 100), 10);
7187		
7188		$('.result_discount font').text(discount);
7189		animate($('.result_all_count font'), sum);
7190		animate($('.result_total font'), total);
7191	}
7192	$('.checker').each(function(){
7193		var $this = $(this);
7194		var $form = $(
7195			'<div class="checker_content">' +
7196				'<span class="ico i_plus" onselectstart="return false;" onmousedown="return false;"></span>' + 
7197				'<div class="checker_input">' +
7198					'<input type="text" value="0">' +
7199				'</div>' +
7200				'<span class="ico i_minus" onselectstart="return false;" onmousedown="return false;"></span>' +
7201			'</div>'
7202		);
7203		var $plus = $form.find('.i_plus');
7204		var $minus = $form.find('.i_minus');
7205		var $input = $form.find('input');
7206		
7207		$this.attr('data-val', 0);
7208		
7209		
7210		$input.on('keypress', function(e){
7211			// Всё кроме цифр
7212			if(!(e.which >= 48 && e.which <= 57)){
7213				e.preventDefault();
7214			}
7215			if($input.val().substr(0,1) == 0){
7216				$input.val(('' +  $input.val()).replace(/^0+/, ''));
7217			}
7218			scan();
7219		});
7220		$input.on('change', function(){
7221			$this.attr('data-val', $input.val());
7222			scan();
7223		});
7224		$plus.on('click', function(){
7225			var current = $input.val();
7226			current++;
7227			$input.val(current);
7228			$input.change();
7229		});
7230		$minus.on('click', function(){
7231			var current = $input.val();
7232			if(current == 0){
7233				return;
7234			}
7235			current--;
7236			$input.val(current);
7237			$input.change();
7238		});
7239		$this.append($form);
7240	});
7241	$('.checker2').each(function(){
7242		var $this = $(this);
7243		var $form = $(
7244			'<div class="checker2_content">' +
7245				'<input type="checkbox">' +
7246				'<div class="checker2_checkbox off"></div>' +
7247			'</div>'
7248		);
7249		var $div = $form.find(".checker2_checkbox");
7250		var $input = $('input');
7251		$div.on('click', function(){
7252			$input.prop('checked', !$input.prop('checked'));
7253			if($input.prop('checked')){
7254				$div.removeClass('off');
7255				$div.addClass('on');
7256			}else{
7257				$div.addClass('off');
7258				$div.removeClass('on');
7259			}
7260			$input.change();
7261		});
7262		$this.attr('data-checked', 0);
7263		$input.on('change', function(){
7264			$this.attr('data-checked',  $input.prop('checked') ? '1' : '0');
7265			scan();
7266		})
7267		
7268		$this.append($form);
7269	});
7270	scan();
7271	
7272	$('.j_leave_application').click(function(){
7273		$(this).css('display', 'none');
7274		var $block = $('.j_leave_application_block');
7275		$block.css('display', 'block');
7276		var $form = $block.find('.j_leave_application_form');
7277		
7278		var now_submit = false;
7279		$form.submit(function(e){
7280			e.preventDefault();
7281			
7282			if(now_submit){
7283				return;
7284			}
7285			
7286			var name = $form.find('.j_application_name').val().trim();
7287			var company = $form.find('.j_application_company').val().trim();
7288			var email = $form.find('.j_application_email').val().trim();
7289			var info = $form.find('.j_application_info').val().trim();
7290			
7291			var error = false;
7292			var obj_config = {
7293				start: function(){$(this).parent().addClass('error');},
7294				stop: function(){$(this).parent().removeClass('error');},
7295			}
7296			
7297			if(name == ''){
7298				error = true;
7299				$form.find('.j_application_name').my_info($.extend({name: 'name'}, obj_config));
7300			}
7301			if(company == ''){
7302				error = true;
7303				$form.find('.j_application_company').my_info($.extend({name: 'company'}, obj_config));
7304			}
7305			if(email == ''){
7306				error = true;
7307				$form.find('.j_application_email').my_info($.extend({name: 'email'}, obj_config));
7308			}
7309			
7310			if(!error){
7311				now_submit = true;
7312				$form.ajaxSubmit({
7313					url: $_PARAM.url + '?reklama_leave',
7314					success: function(){
7315						$block.empty().html('<h2 class="success">Ваша заявка отправлена отделу рекламы, после того как её прочтут с вами обязательно свяжутся</h2>');
7316					},
7317					error: function(){
7318						now_submit = false;
7319						$form.find('.j_send_application_submit').my_info({
7320							start: function(){$(this).addClass('error');},
7321							stop: function(){$(this).removeClass('error');},
7322							name: 'submit'
7323						});
7324					}
7325				});
7326			}
7327			
7328		});
7329	});
7330}());
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342/**
7343 * @depends jQuery
7344 * @depends $_PARAM
7345*/
7346//var title = document.title.replace('"',"&quot;");
7347//var url = typeof seti_url === 'undefined' ? document.location.origin.toString() + document.location.pathname : seti_url;
7348
7349
7350
7351//$('.share_fb').html('<div class="fb-like" data-href="'+url+'" data-send="false" data-layout="button_count" data-width="450" data-show-faces="true" data-font="arial" data-action="recommend"></div>');
7352//$('.share_tw').html('<a href="https://twitter.com/share" class="twitter-share-button" data-url="'+url+'" data-text="RT @vb_kg: ' + title +'" data-lang="ru">Твитнуть</a>');
7353//$('.share_od').html('<div id="ok_shareWidget"></div>');
7354/*
7355$('#www_net_kg').append(
7356	'<!-- WWW.NET.KG , code for http://vb.kg -->'+
7357	'<script language="javascript" type="text/javascript">java="1.0";java1=""+"refer="+escape(document.referrer)+"&amp;page="+escape(window.location.href);document.cookie="astratop=1; path=/";java1+="&amp;c="+(document.cookie?"yes":"now");</script>'+
7358	'<script language="javascript1.1" type="text/javascript">java="1.1";java1+="&amp;java="+(navigator.javaEnabled()?"yes":"now");</script>'+
7359	'<script language="javascript1.2" type="text/javascript">java="1.2";java1+="&amp;razresh="+screen.width+\'x\'+screen.height+"&amp;cvet="+(((navigator.appName.substring(0,3)=="Mic"))?screen.colorDepth:screen.pixelDepth);</script>'+
7360	'<script language="javascript1.3" type="text/javascript">java="1.3"</script>'+
7361	'<span id="link_for_net_kg"></span>'+
7362	'<script language="javascript" type="text/javascript">java1+="&amp;jscript="+java+"&amp;rand="+Math.random();document.getElementById("link_for_net_kg").innerHTML = "<a href=\'http://www.net.kg/stat.php?id=1142&amp;fromsite=1142\' target=\'_blank\'><img src=\'http://www.net.kg/img.php?id=1142&amp;"+java1+"\' border=\'0\' alt=\'WWW.NET.KG\' width=\'88\' height=\'31\'></a>";</script>'+
7363	'<noscript><a href=\'http://www.net.kg/stat.php?id=1142&amp;fromsite=1142\' target=\'_blank\'><imgsrc="http://www.net.kg/img.php?id=1142" border=\'0\' alt=\'WWW.NET.KG\' width=\'88\'height=\'31\'></a></noscript>'+
7364	'<!-- /WWW.NET.KG -->'
7365);
7366*/
7367
7368;(function(){
7369	var timeout = false;
7370	var stop = false;
7371	var resize = function(){
7372		var width = $(document).width();
7373		if(width >= 800){
7374			$(document).off('resize', on_resize);
7375			$('body').append('<div id="fb-root"></div>');
7376			(function(d, s, id) {
7377			  var js, fjs = d.getElementsByTagName(s)[0];
7378			  if (d.getElementById(id)) return;
7379			  js = d.createElement(s); 
7380			  js.id = id;
7381			  js.src = "//connect.facebook.net/ru_RU/sdk.js#xfbml=1&appId=349639328491546&version=v2.0";
7382			  fjs.parentNode.insertBefore(js, fjs);
7383			}(document, 'script', 'facebook-jssdk'));
7384			stop = true;
7385		}
7386	}
7387	resize();
7388	var on_resize = function(){
7389		if(stop){
7390			return;
7391		}
7392		clearTimeout(timeout);
7393		timeout = setTimeout(function(){
7394			resize();
7395		}, 20);
7396	};
7397	$(document).on('resize', on_resize);
7398}());
7399
7400
7401
7402
7403
7404/**
7405 * @depends jQuery
7406 * @depends $_PARAM
7407*/
7408// Статистика
7409(function(){
7410	if(typeof $_PARAM.topic == "undefined" || $_PARAM.topic === false){
7411		return;
7412	}
7413	var count = 0;
7414	var max = 10;
7415	
7416	var data = {
7417		topic_id: $_PARAM.topic.id,
7418		uid: 0
7419	};
7420	var send = function(){
7421		$.ajax({
7422			url: $_PARAM.url_folder + 'other/vb_api.php?stat',
7423			data: data,
7424			type : 'POST',
7425			async : true
7426		});
7427	};
7428	var set_data = function(){
7429		count++;
7430		if(typeof user_uid === 'undefined' && count < max){
7431			setTimeout(set_data, 500);
7432		}else{
7433			data.uid = typeof user_uid !== 'undefined' ? user_uid : 0;
7434			send();
7435		}
7436	}
7437	set_data();
7438})();

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.