1// Avoid `console` errors in browsers that lack a console. 2(function() { 3 var method; 4 var noop = function () {}; 5 var methods = [ 6 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 7 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 8 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 9 'timeStamp', 'trace', 'warn' 10 ]; 11 var length = methods.length; 12 var console = (window.console = window.console || {}); 13 14 while (length--) { 15 method = methods[length]; 16 17 // Only stub undefined methods. 18 if (!console[method]) { 19 console[method] = noop; 20 } 21 } 22}()); 23 24/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) 25 * Licensed under the MIT License (LICENSE.txt). 26 * 27 * Version 2.1.2 28 */ 29(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery); 30 31/* Copyright (c) 2006 Brandon Aaron ([email protected] || http://brandonaaron.net) 32 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 33 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 34 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 35 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 36 * 37 * $LastChangedDate: 2007-12-14 23:57:10 -0600 (Fri, 14 Dec 2007) $ 38 * $Rev: 4163 $ 39 * 40 * Version: 3.0 41 * 42 * Requires: $ 1.2.2+ 43 */ 44(function($){$.event.special.mousewheel={setup:function(){var handler=$.event.special.mousewheel.handler;if($.browser.mozilla)$(this).bind('mousemove.mousewheel',function(event){$.data(this,'mwcursorposdata',{pageX:event.pageX,pageY:event.pageY,clientX:event.clientX,clientY:event.clientY});});if(this.addEventListener)this.addEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else 45this.onmousewheel=handler;},teardown:function(){var handler=$.event.special.mousewheel.handler;$(this).unbind('mousemove.mousewheel');if(this.removeEventListener)this.removeEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else 46this.onmousewheel=function(){};$.removeData(this,'mwcursorposdata');},handler:function(event){var args=Array.prototype.slice.call(arguments,1);event=$.event.fix(event||window.event);$.extend(event,$.data(this,'mwcursorposdata')||{});var delta=0,returnValue=true;if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detail)delta=-event.detail/3;if($.browser.opera)delta=-event.wheelDelta;event.data=event.data||{};event.type="mousewheel";args.unshift(delta);args.unshift(event);return $.event.handle.apply(this,args);}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});})(jQuery); 47 48 49/* 50 * Superfish v1.4.8 - jQuery menu widget 51 * Copyright (c) 2008 Joel Birch 52 * 53 * Dual licensed under the MIT and GPL licenses: 54 * http://www.opensource.org/licenses/mit-license.php 55 * http://www.gnu.org/licenses/gpl.html 56 * 57 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt 58 * MA: Modified 10/15/2013 59 */ 60 61;(function($){ 62 $.fn.superfish = function(op){ 63 64 var sf = $.fn.superfish, 65 c = sf.c, 66 $arrow = $(['<span class="',c.arrowClass,'"> <span class="visuallyHidden">»</span></span>'].join('')), 67 over = function(){ 68 var $$ = $(this), menu = getMenu($$); 69 clearTimeout(menu.sfTimer); 70 $$.showSuperfishUl().siblings().hideSuperfishUl(); 71 }, 72 out = function(){ 73 var $$ = $(this), menu = getMenu($$), o = sf.op; 74 clearTimeout(menu.sfTimer); 75 menu.sfTimer=setTimeout(function(){ 76 o.retainPath=($.inArray($$[0],o.$path)>-1);
77 $$.hideSuperfishUl(); 78 if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} 79 },o.delay); 80 }, 81 getMenu = function($menu){ 82 var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; 83 sf.op = sf.o[menu.serial]; 84 return menu; 85 }, 86 addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; 87 88 return this.each(function() { 89 var s = this.serial = sf.o.length; 90 var o = $.extend({},sf.defaults,op); 91 o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ 92 $(this).addClass([o.hoverClass,c.bcClass].join(' ')) 93 .filter('li:has(ul)').removeClass(o.pathClass); 94 }); 95 sf.o[s] = sf.op = o; 96 97 $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { 98 if (o.autoArrows) addArrow( $('>a:first-child',this) ); 99 }) 100 .not('.'+c.bcClass) 101 .hideSuperfishUl(); 102 103 var $a = $('a',this); 104 $a.each(function(i){ 105 var $li = $a.eq(i).parents('li'); 106 $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); 107 }); 108 o.onInit.call(this); 109 110 }).each(function() { 111 var menuClasses = [c.menuClass]; 112 if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); 113 $(this).addClass(menuClasses.join(' ')); 114 }); 115 }; 116 117 var sf = $.fn.superfish; 118 sf.o = []; 119 sf.op = {}; 120 sf.IE7fix = function(){ 121 var o = sf.op; 122 if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined) 123 this.toggleClass(sf.c.shadowClass+'-off'); 124 }; 125 sf.c = { 126 bcClass : 'sf-breadcrumb', 127 menuClass : 'sf-js-enabled', 128 anchorClass : 'sf-with-ul', 129 arrowClass : 'sf-sub-indicator', 130 shadowClass : 'sf-shadow' 131 }; 132 sf.defaults = { 133 hoverClass : 'sfHover', 134 pathClass : 'overideThisToUse', 135 pathLevels : 1, 136 delay : 800, 137 animation : {opacity:'show'}, 138 speed : 'normal', 139 autoArrows : true, 140 dropShadows : true, 141 disableHI : false, // true disables hoverIntent detection 142 onInit : function(){}, // callback functions 143 onBeforeShow: function(){}, 144 onShow : function(){}, 145 onHide : function(){} 146 }; 147 $.fn.extend({ 148 hideSuperfishUl : function(){ 149 var o = sf.op, 150 not = (o.retainPath===true) ? o.$path : ''; 151 o.retainPath = false; 152 var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) 153 .find('>ul').hide().css('visibility','hidden'); 154 o.onHide.call($ul); 155 return this; 156 }, 157 showSuperfishUl : function(){ 158 var o = sf.op, 159 sh = sf.c.shadowClass+'-off', 160 $ul = this.addClass(o.hoverClass) 161 .find('>ul:hidden').css('visibility','visible'); 162 sf.IE7fix.call($ul); 163 o.onBeforeShow.call($ul); 164 $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); 165 return this; 166 } 167 }); 168 169})(jQuery); 170 171 172/* 173 * hoverIntent by Brian Cherne 174 */ 175(function($){ 176 /* hoverIntent by Brian Cherne */ 177 $.fn.hoverIntent = function(f,g) { 178 // default configuration options 179 var cfg = { 180 sensitivity: 7, 181 interval: 100, 182 timeout: 0 183 }; 184 // override configuration options with user supplied object 185 cfg = $.extend(cfg, g ? { over: f, out: g } : f ); 186 187 // instantiate variables 188 // cX, cY = current X and Y position of mouse, updated by mousemove event 189 // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval 190 var cX, cY, pX, pY; 191 192 // A private function for getting mouse position 193 var track = function(ev) { 194 cX = ev.pageX; 195 cY = ev.pageY; 196 }; 197 198 // A private function for comparing current and previous mouse position 199 var compare = function(ev,ob) { 200 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 201 // compare mouse positions to see if they've crossed the threshold 202 if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { 203 $(ob).unbind("mousemove",track); 204 // set hoverIntent state to true (so mouseOut can be called) 205 ob.hoverIntent_s = 1; 206 return cfg.over.apply(ob,[ev]); 207 } else {
208 // set previous coordinates for next time 209 pX = cX; pY = cY; 210 // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) 211 ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); 212 } 213 }; 214 215 // A private function for delaying the mouseOut function 216 var delay = function(ev,ob) { 217 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 218 ob.hoverIntent_s = 0; 219 return cfg.out.apply(ob,[ev]); 220 }; 221 222 // A private function for handling mouse 'hovering' 223 var handleHover = function(e) { 224 // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut 225 var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; 226 while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } } 227 if ( p == this ) { return false; } 228 229 // copy objects to be passed into t (required for event object to be passed in IE) 230 var ev = jQuery.extend({},e); 231 var ob = this; 232 233 // cancel hoverIntent timer if it exists 234 if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } 235 236 // else e.type == "onmouseover" 237 if (e.type == "mouseover") { 238 // set "previous" X and Y position based on initial entry point 239 pX = ev.pageX; pY = ev.pageY; 240 // update "current" X and Y position based on mousemove 241 $(ob).bind("mousemove",track); 242 // start polling interval (self-calling timeout) to compare mouse coordinates over time 243 if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} 244 245 // else e.type == "onmouseout" 246 } else { 247 // unbind expensive mousemove event 248 $(ob).unbind("mousemove",track); 249 // if hoverIntent state is true, then call the mouseOut function after the specified delay 250 if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} 251 } 252 }; 253 254 // bind the function to the two event listeners 255 return this.mouseover(handleHover).mouseout(handleHover); 256 }; 257 258})(jQuery); 259 260 261/* 262 * HTML Truncator for jQuery 263 * by Henrik Nyh <http://henrik.nyh.se> 2008-02-28. 264 * http://github.com/henrik/jquery.truncator.js/tree/master 265 * Free to modify and redistribute with credit. 266 * 267 * modified by Mike Avello 268 */ 269(function($) { 270 271 var trailing_whitespace = true; 272 273 $.fn.truncate = function(options) { 274 275 var opts = $.extend({}, $.fn.truncate.defaults, options); 276 277 $(this).each(function() { 278 279 var content_length = $.trim(squeeze($(this).text())).length; 280 if (content_length <= opts.max_length) 281 return; // bail early if not overlong 282 283 var actual_max_length = opts.max_length - opts.more.length - 3; // 3 for " ()" 284 var truncated_node = recursivelyTruncate(this, actual_max_length); 285 var full_node = $(this).hide(); 286 287 truncated_node.insertAfter(full_node); 288 289 findNodeForMore(truncated_node).append(' <span class="truncateLink"><a class="truncateMore" href="#show more content">'+opts.more+'</a></span>'); 290 findNodeForLess(full_node).append(' <span class="truncateLink"><a class="truncateLess" href="#show less content">'+opts.less+'</a></span>'); 291 292 truncated_node.find('a:last').click(function() { 293 truncated_node.hide(); full_node.show(); return false; 294 }); 295 full_node.find('a:last').click(function() { 296 truncated_node.show(); full_node.hide(); return false; 297 }); 298 299 }); 300 } 301 302 // Note that the " ( more)" bit counts towards the max length so a max 303 // length of 10 would truncate "1234567890" to "12 ( more)". 304 $.fn.truncate.defaults = { 305 max_length: 100, 306 more: ' more', 307 less: 'less' 308 }; 309 310 function recursivelyTruncate(node, max_length) { 311 return (node.nodeType == 3) ? truncateText(node, max_length) : truncateNode(node, max_length); 312 } 313 314 function truncateNode(node, max_length) { 315 var node = $(node); 316 var new_node = node.clone().empty(); 317 var truncatedChild; 318 node.contents().each(function() { 319 var remaining_length = max_length - new_node.text().length; 320 if (remaining_length == 0) return; // breaks the loop 321 truncatedChild = recursivelyTruncate(this, remaining_length); 322 if (truncatedChild) new_node.append(truncatedChild); 323 });
324 return new_node; 325 } 326 327 function truncateText(node, max_length) { 328 var text = squeeze(node.data); 329 if (trailing_whitespace) // remove initial whitespace if last text 330 text = text.replace(/^ /, ''); // node had trailing whitespace. 331 trailing_whitespace = !!text.match(/ $/); 332 var text = text.slice(0, max_length); 333 // Ensure HTML entities are encoded 334 // http://debuggable.com/posts/encode-html-entities-with-jquery:480f4dd6-13cc-4ce9-8071-4710cbdd56cb 335 text = $('<div/>').text(text).html(); 336 return text; 337 } 338 339 // Collapses a sequence of whitespace into a single space. 340 function squeeze(string) { 341 return string.replace(/\s+/g, ' '); 342 } 343 344 // Finds the last, innermost block-level element 345 function findNodeForMore(node) { 346 var $node = $(node); 347 var last_child = $node.children(":last"); 348 if (!last_child) return node; 349 var display = last_child.css('display'); 350 if (!display || display=='inline') return $node; 351 return findNodeForMore(last_child); 352 }; 353 354 // Finds the last child if it's a p; otherwise the parent 355 function findNodeForLess(node) { 356 var $node = $(node); 357 var last_child = $node.children(":last"); 358 if (last_child && last_child.is('p')) return last_child; 359 return node; 360 }; 361 362})(jQuery); 363 364 365 366/*-------------------------------------------------------------------- 367 * JQuery Plugin: "EqualHeights" & "EqualWidths" 368 * by: Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com) 369 * 370 * Copyright (c) 2007 Filament Group 371 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) 372 * 373 * Description: Compares the heights or widths of the top-level children of a provided element 374 and sets their min-height to the tallest height (or width to widest width). Sets in em units 375 by default if pxToEm() method is available. 376 * Dependencies: jQuery library, pxToEm method (article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/) 377 * Usage Example: $(element).equalHeights(); 378 Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true); 379 * Version: 2.0, 07.24.2008 380 * Changelog: 381 * 08.02.2007 initial Version 1.0 382 * 07.24.2008 v 2.0 - added support for widths 383--------------------------------------------------------------------*/ 384 385$.fn.equalHeights = function(px) { 386 $(this).each(function(){ 387 var currentTallest = 0; 388 $(this).children().each(function(i){ 389 if ($(this).height() > currentTallest) { currentTallest = $(this).height(); } 390 }); 391 if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified 392 // for ie6, set height since min-height isn't supported 393 if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); } 394 $(this).children().css({'min-height': currentTallest}); 395 }); 396 return this; 397}; 398 399// just in case you need it... 400$.fn.equalWidths = function(px) { 401 $(this).each(function(){ 402 var currentWidest = 0; 403 $(this).children().each(function(i){ 404 if($(this).width() > currentWidest) { currentWidest = $(this).width(); } 405 }); 406 if(!px || !Number.prototype.pxToEm) currentWidest = currentWidest.pxToEm(); //use ems unless px is specified 407 // for ie6, set width since min-width isn't supported 408 if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'width': currentWidest}); } 409 $(this).children().css({'min-width': currentWidest}); 410 }); 411 return this; 412}; 413 414 415/*-------------------------------------------------------------------- 416 * javascript method: "pxToEm" 417 * by: 418 Scott Jehl ([email protected]) 419 Maggie Wachs ([email protected]) 420 http://www.filamentgroup.com 421 * 422 * Copyright (c) 2008 Filament Group 423 * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses. 424 * 425 * Description: Extends the native Number and String objects with pxToEm method. pxToEm converts a pixel value to ems depending on inherited font size. 426 * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/ 427 * Demo: http://www.filamentgroup.com/examples/pxToEm/ 428 * 429 * Options: 430 scope: string or jQuery selector for font-size scoping 431 reverse: Boolean, true reverses the conversion to em-px 432 * Dependencies: jQuery library 433 * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true}); 434 * 435 * Version: 2.0, 08.01.2008 436 * Changelog: 437 * 08.02.2007 initial Version 1.0 438 * 08.01.2008 - fixed font-size calculation for IE 439--------------------------------------------------------------------*/ 440 441Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){ 442 //set defaults 443 settings = jQuery.extend({ 444 scope: 'body', 445 reverse: false 446 }, settings); 447 448 var pxVal = (this == '') ? 0 : parseFloat(this); 449 var scopeVal; 450 var getWindowWidth = function(){ 451 var de = document.documentElement; 452 return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; 453 }; 454 455 /* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. 456 For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size. 457 When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) 458 to get an accurate em value. */ 459 460 if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getW
460indowWidth()).toFixed(1) > 0.0) { 461 var calcFontSize = function(){ 462 return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16; 463 }; 464 scopeVal = calcFontSize(); 465 } 466 else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); }; 467 468 var result = (settings.reverse == true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em'; 469 return result; 470}; 471 472 473/* CENTER ELEMENT */ 474(function($) { 475 $.fn.center = function() { 476 var topCheck = ($(window).height() - this.height()) / 2 + $(window).scrollTop(), 477 leftCheck = ($(window).width() - this.width()) / 2 + $(window).scrollLeft(), 478 top = topCheck < 0 ? 0 : topCheck, 479 left = leftCheck < 0 ? 0 : leftCheck; 480 this.css({"position":"absolute", "top":top + "px", "left":left + "px"}); 481 return this; 482 }; 483})(jQuery); 484 485 486 487 488/* 489 jquery.constrain plugin 490 491 492 $.constrain usage: 493 //limit field to having maximum of one 'p' and four '\' 494 $("#myfield").constrain({ 495 limit: { "p":1 , "\\":4 } 496 }); 497 498 //prohibit field from having alphabet chars 499 $("#myfield").constrain({ 500 prohibit: { regex: "[a-zA-Z]" } 501 }); 502 //prohibit field from having vowels 503 $("#myfield").constrain({ 504 prohibit: { chars: "aeiouAEIOU" } 505 }); 506 507 //allow field to only have alphabet chars 508 $("#myfield").constrain({ 509 allow: { regex: "[a-zA-Z]" } 510 }); 511 512 $.numeric usage: 513 $("#myfield").numeric({ precision : { num: 1} }); //fixes precision on blur 514 --or-- 515 $("#myfield").numeric({ precision : { num: 1,onblur:false} }); //fixes precision on keyup event 516 517 Rev:$090508$ 518*/ 519 520 521(function($) { 522 $.fn.constrain = function(opt) { 523 opt = $.extend(true, {}, { 524 limit: {}, //key/value pairs ie {"p":4,"\\":4} 525 prohibit: { chars: "", regex: false }, 526 allow: { chars: "", regex: false } 527 }, opt); 528 529 function isProhibitedByLimit(input, e) { 530 var prohibited = false; 531 $.each(opt.limit, function(token, idx) { 532 var max = this; 533 if (token.charCodeAt(0) == e.which) { 534 prohibited = max < 0 ? false : max < $(input).val().split(token).length; 535 return false; //break 'each' iterator 536 } 537 }); 538 return prohibited; 539 }; 540 541 //has prohibit or allow been configured by user? 542 function isConfigured(item) { 543 return item.chars.length > 0 || (item.regex && item.regex.length > 0); 544 }; 545 546 //does the prohibit or allow collection find a match given the key? 547 function match(item, input, e) { 548 var arr = item.chars.split(""); 549 for (var i in arr) { 550 var token = arr[i]; 551 if (token.charCodeAt(0) == e.which) { 552 return true; 553 } 554 } 555 if (item.regex) { 556 var re = new RegExp(item.regex); 557 if (re.test(String.fromCharCode(e.which))) { 558 return true; 559 } 560 } 561 562 return false; 563 }; 564 565 function isProhibited(input, e) { 566 if (e.which == 0 || e.which == 8 || e.which == 27) {//always permit space,tab, or escape 567 return false; 568 } 569 570 var prohibit = isConfigured(opt.prohibit) ? match(opt.prohibit, input, e) : false; 571 var allow = isConfigured(opt.allow) ? match(opt.allow, input, e) : true; 572 var limited = isProhibitedByLimit(input, e); 573 return prohibit || !allow || limited; 574 }; 575 576 return this.each(function() { 577 $(this).keypress(function(e) { 578 if (isProhibited(this, e)) { 579 e.preventDefault(); 580 } 581 }); 582 583 }); 584 }; 585 //todo use number formatring script from http://www.xaprb.com/blog/2007/07/15/javascript-number-formatting-library-v13-released/ 586 $.fn.numeric = function(opt) { 587 opt = $.extend(true, {}, { 588 onblur: true, 589 format: "" //"0,0.0" for thousand sep (52,456,34.49) or "0.0" for no thousands sep 590 }, opt); 591 592 var parts = opt.format.split("."); 593 var precision = parts.length > 1 ? parts[1].length : false; 594 return this.each(function() { 595 var allowRe = "\\d"; 596 597 if (opt.format.indexOf(".") > -1) { 598 allowRe += "\\."; 599 } 600 if (opt.format.indexOf(",") > -1) { 601 allowRe += ","; 602 } 603 var constraintOptions = { 604 allow: { regex: "[" + allowRe + "]" }, 605 limit: { ".": 1 } 606 }; 607 608 $(this).constrain(constraintOptions); 609 610 if (precision) { 611 //on the field's blur event, correct the value to the configured precision, rounding if necessary 612 //so if precision.num is set to '1', then 14.2563 would be changed to 14.3 on the blur event 613 $(this).blur(function(e) { 614 var n = parseFloat($(this).val()); 615 if (!isNaN(n)) { 616 var val = $(this).val(); 617 $(this).val($.formatNumber(val, opt.format)); 618 } 619 }); 620 if (!opt.onblur) {
621 //on the field's keyup event, correct the value to the configured precision right away 622 //this is a bit jarring as the number they just entered is removed if it exceeds the precision value 623 624 var prec = new RegExp("\\d+\\.*\\d{0," + precision + "}"); 625 $(this).keyup(function(e) { 626 //since keyup e.which is considering numberkeys differently 627 if ((e.which < 48 && e.which > 57) || //number keys 628 (e.which < 96 && e.which > 105)) { //number keypad 629 return; 630 } 631 var val = $(this).val(); 632 $(this).val(val.match(prec)); //we can't invoke format fn here 633 }); 634 } 635 } 636 637 }); 638 }; 639 640})(jQuery); 641 642/* formatNumber function for extension directly on jQuery namespace */ 643(function($) { 644 $.numericFormat = $.numericFormat || {}; $.numericFormat.formats = $.numericFormat.formats || new Array(); 645 646 $.extend({ 647 formatNumber: function(num, format) { 648 649 //hide our internals so the createNewFormat function can recurse on it without requiring the user to ignore the 'context' arg 650 function _numberFormat(num, format, context) { 651 652 function createNewFormat(format, formatName) { 653 654 var code = "var " + formatName + " = function(num){\n"; 655 656 //todo: internationalization concerns will need to be met here by sanitizing the correct thousands separator out 657 code += "num = num.replace(/,/,'');"; 658 659 // Decide whether the function is a terminal or a pos/neg/zero function 660 var formats = format.split(";"); 661 switch (formats.length) { 662 case 1: 663 code += createTerminalFormat(format); 664 break; 665 case 2: 666 code += "return (num < 0) ? _numberFormat(num,\"" 667 + escape(formats[1]) 668 + "\", 1) : _numberFormat(num,\"" 669 + escape(formats[0]) 670 + "\", 2);"; 671 break; 672 case 3: 673 code += "return (num < 0) ? _numberFormat(num,\"" 674 + escape(formats[1]) 675 + "\", 1) : ((num == 0) ? _numberFormat(num,\"" 676 + escape(formats[2]) 677 + "\", 2) : _numberFormat(num,\"" 678 + escape(formats[0]) 679 + "\", 3));"; 680 break; 681 default: 682 code += "throw 'Too many semicolons in format string';"; 683 break; 684 } 685 686 return code + "};"; 687 688 }; 689 690 function createTerminalFormat(format) { 691 // If there is no work to do, just return the literal value 692 if (format.length > 0 && format.search(/[0#?]/) == -1) { 693 return "return '" + escape(format) + "';\n"; 694 } 695 // Negative values are always displayed without a minus sign when section separators are used. 696 697 var code = "var val = (context == null) ? new Number(num) : Math.abs(num);\n"; 698 var thousands = false; 699 var lodp = format; 700 var rodp = ""; 701 var ldigits = 0; 702 var rdigits = 0; 703 var scidigits = 0; 704 var scishowsign = false; 705 var sciletter = ""; 706 // Look for (and remove) scientific notation instructions, which can be anywhere 707 m = format.match(/\..*(e)([+-]?)(0+)/i); 708 if (m) { 709 sciletter = m[1]; 710 scishowsign = (m[2] == "+"); 711 scidigits = m[3].length; 712 format = format.replace(/(e)([+-]?)(0+)/i, ""); 713 } 714 // Split around the decimal point 715 var m = format.match(/^([^.]*)\.(.*)$/); 716 if (m) { 717 lodp = m[1].replace(/\./g, ""); 718 rodp = m[2].replace(/\./g, ""); 719 } 720 // Look for % 721 if (format.indexOf('%') >= 0) { 722 code += "val *= 100;\n"; 723 }
724 // Look for comma-scaling to the left of the decimal point 725 m = lodp.match(/(,+)(?:$|[^0#?,])/); 726 if (m) { 727 code += "val /= " + Math.pow(1000, m[1].length) + "\n;"; 728 } 729 // Look for comma-separators 730 if (lodp.search(/[0#?],[0#?]/) >= 0) { 731 thousands = true; 732 } 733 // Nuke any extraneous commas 734 if ((m) || thousands) { 735 lodp = lodp.replace(/,/g, ""); 736 } 737 // Figure out how many digits to the l/r of the decimal place 738 m = lodp.match(/0[0#?]*/); 739 if (m) { 740 ldigits = m[0].length; 741 } 742 m = rodp.match(/[0#?]*/); 743 if (m) { 744 rdigits = m[0].length; 745 } 746 747 // Scientific notation takes precedence over rounding etc 748 if (scidigits > 0) { 749 code += "var sci = toScientific(num,val," 750 + ldigits + ", " + rdigits + ", " + scidigits + ", " + scishowsign + ");\n" 751 + "var arr = [sci.l, sci.r];\n"; 752 } 753 else { 754 // If there is no decimal point, round to nearest integer, AWAY from zero 755 if (format.indexOf('.') < 0) { 756 code += "val = (val > 0) ? Math.ceil(val) : Math.floor(val);\n"; 757 } 758 // Numbers are rounded to the correct number of digits to the right of the decimal 759 //code += "var arr = val.round(" + rdigits + ").toFixed(" + rdigits + ").split('.');\n"; 760 code += "var arr = round(val," + rdigits + ").toFixed(" + rdigits + ").split('.');\n"; 761 // There are at least "ldigits" digits to the left of the decimal, so add zeros if needed. 762 code += "arr[0] = (val < 0 ? '-' : '') + leftPad((val < 0 ? arr[0].substring(1) : arr[0]), " 763 + ldigits + ", '0');\n"; 764 } 765 // Add thousands separators 766 if (thousands) { 767 code += "arr[0] = addSeparators(arr[0]);\n"; 768 } 769 770 // Insert the digits into the formatting string. On the LHS, extra digits are copied 771 // into the result. On the RHS, rounding has chopped them off. 772 code += "arr[0] = reverse(injectIntoFormat(reverse(arr[0]), '" + escape(reverse(lodp)) + "', true));\n"; 773 if (rdigits > 0) { 774 code += "arr[1] = injectIntoFormat(arr[1], '" + escape(rodp) + "', false);\n"; 775 } 776 if (scidigits > 0) { 777 code += "arr[1] = arr[1].replace(/(\\d{" + rdigits + "})/, '$1" + sciletter + "' + sci.s);\n"; 778 } 779 780 return code + "return arr.join('.');\n"; 781 }; 782 783 function toScientific(num, val, ldigits, rdigits, scidigits, showsign) { 784 var result = { l: "", r: "", s: "" }; 785 var ex = ""; 786 // Make ldigits + rdigits significant figures 787 var before = Math.abs(val).toFixed(ldigits + rdigits + 1).trim('0'); 788 // Move the decimal point to the right of all digits we want to keep, 789 // and round the resulting value off 790 var after = Math.round(num, new Number(before.replace(".", "").replace( 791 new RegExp("(\\d{" + (ldigits + rdigits) + "})(.*)"), "$1.$2"))).toFixed(0); 792 // Place the decimal point in the new string 793 if (after.length >= ldigits) { 794 after = after.substring(0, ldigits) + "." + after.substring(ldigits); 795 } 796 else { 797 after += '.'; 798 } 799 // Find how much the decimal point moved. This is #places to LODP in the original 800 // number, minus the #places in the new number. There are no left-padded zeroe
800s in 801 // the new number, so the calculation for it is simpler than for the old number. 802 result.s = (before.indexOf(".") - before.search(/[1-9]/)) - after.indexOf("."); 803 // The exponent is off by 1 when it gets moved to the left. 804 if (result.s < 0) { 805 result.s++; 806 } 807 // Split the value around the decimal point and pad the parts appropriately. 808 result.l = (val < 0 ? '-' : '') + leftPad(after.substring(0, after.indexOf(".")), ldigits, "0"); 809 result.r = after.substring(after.indexOf(".") + 1); 810 if (result.s < 0) { 811 ex = "-"; 812 } 813 else if (showsign) { 814 ex = "+"; 815 } 816 result.s = ex + leftPad(Math.abs(result.s).toFixed(0), scidigits, "0"); 817 return result; 818 }; 819 820 821 function reverse(str) { 822 var res = ""; 823 for (var i = str.length; i > 0; --i) { 824 res += str.charAt(i - 1); 825 } 826 return res; 827 }; 828 function escape(string) { 829 return string.replace(/('|\\)/g, "\\$1"); 830 }; 831 function leftPad(val, size, ch) { 832 var result = new String(val); 833 if (ch == null) { 834 ch = " "; 835 } 836 while (result.length < size) { 837 result = ch + result; 838 } 839 return result; 840 }; 841 842 function round(num, decimals) { 843 if (decimals > 0) { 844 var m = num.toFixed(decimals + 1).match( 845 new RegExp("(-?\\d*)\.(\\d{" + decimals + "})(\\d)\\d*$")); 846 if (m && m.length) { 847 return new Number(m[1] + "." + leftPad(Math.round(m[2] + "." + m[3]), decimals, "0")); 848 } 849 } 850 return num; 851 }; 852 853 function addSeparators(val) { 854 //return val.reverse().replace(/(\d{3})/g, "$1,").reverse().replace(/^(-)?,/, "$1"); 855 var s = reverse(val).replace(/(\d{3})/g, "$1,"); 856 return reverse(s).replace(/^(-)?,/, "$1"); 857 }; 858 859 function injectIntoFormat(val, format, stuffExtras) { 860 var i = 0; 861 var j = 0; 862 var result = ""; 863 var revneg = val.charAt(val.length - 1) == '-'; 864 if (revneg) { 865 val = val.substring(0, val.length - 1); 866 } 867 while (i < format.length && j < val.length && format.substring(i).search(/[0#?]/) >= 0) { 868 if (format.charAt(i).match(/[0#?]/)) { 869 // It's a formatting character; copy the corresponding character 870 // in the value to the result 871 if (val.charAt(j) != '-') { 872 result += val.charAt(j); 873 } 874 else { 875 result += "0"; 876 } 877 j++; 878 } 879 else { 880 result += format.charAt(i); 881 } 882 ++i; 883 } 884 if (revneg && j == val.length) { 885 result += '-'; 886 } 887 if (j < val.length) { 888 if (stuffExtras) { 889 result += val.substring(j); 890 } 891 if (revneg) { 892 result += '-'; 893 } 894 } 895 if (i < format.length) { 896 result += format.substring(i); 897 } 898 return result.replace(/#/g, "").replace(/\?/g, " "); 899 }; 900 901 //add our dynamic function 902 var formatName = "numFormat" + $.numericFormat.formats.length++; 903 eval(createNewFormat(format, formatName)); 904 //return our new function named by our formatName 905 return eval(formatName); 906 }; 907 908 if (!$.numericFormat.formats[format]) { 909 $.numericFormat.formats[format] = _numberFormat(num, format); 910 }; 911 return $.numericFormat.formats[format](num); 912 } 913 });
914 915})(jQuery); 916 917 918 919 920 921 922 923/* 924* jqModal - Minimalist Modaling with jQuery 925* (http://dev.iceburg.net/jquery/jqModal/) 926* 927* Copyright (c) 2007,2008 Brice Burgess <[email protected]> 928* Dual licensed under the MIT and GPL licenses: 929* http://www.opensource.org/licenses/mit-license.php 930* http://www.gnu.org/licenses/gpl.html 931* 932* $Version: 03/01/2009 +r14 933*/ 934(function($) { 935 $.fn.jqm = function(o) { 936 var p = { 937 overlay: 50, 938 overlayClass: 'jqmOverlay', 939 closeClass: 'jqmClose', 940 trigger: '.jqModal', 941 ajax: F, 942 ajaxText: '', 943 target: F, 944 modal: F, 945 toTop: F, 946 onShow: F, 947 onHide: F, 948 onLoad: F 949 }; 950 return this.each(function() { 951 if (this._jqm) return H[this._jqm].c = $.extend({}, H[this._jqm].c, o); s++; this._jqm = s; 952 H[s] = { c: $.extend(p, $.jqm.params, o), a: F, w: $(this).addClass('jqmID' + s), s: s }; 953 if (p.trigger) $(this).jqmAddTrigger(p.trigger); 954 }); 955 }; 956 957 $.fn.jqmAddClose = function(e) { return hs(this, e, 'jqmHide'); }; 958 $.fn.jqmAddTrigger = function(e) { return hs(this, e, 'jqmShow'); }; 959 $.fn.jqmShow = function(t) { return this.each(function() { t = t || window.event; $.jqm.open(this._jqm, t); }); }; 960 $.fn.jqmHide = function(t) { return this.each(function() { t = t || window.event; $.jqm.close(this._jqm, t) }); }; 961 962 $.jqm = { 963 hash: {}, 964 open: function(s, t) { 965 var h = H[s], c = h.c, cc = '.' + c.closeClass, z = (parseInt(h.w.css('z-index'))), z = (z > 0) ? z : 3000, o = $('<div></div>').css({ height: '100%', width: '100%', position: 'fixed', left: 0, top: 0, 'z-index': z - 1, opacity: c.overlay / 100 }); if (h.a) return F; h.t = t; h.a = true; h.w.css('z-index', z); 966 if (c.modal) { if (!A[0]) L('bind'); A.push(s); } 967 else if (c.overlay > 0) h.w.jqmAddClose(o); 968 else o = F; 969 970 h.o = (o) ? o.addClass(c.overlayClass).appendTo('body') : F; 971 if (ie6) { $('html,body').css({ height: '100%', width: '100%' }); if (o) { o = o.css({ position: 'absolute' })[0]; for (var y in { Top: 1, Left: 1 }) o.style.setExpression(y.toLowerCase(), "(_=(document.documentElement.scroll" + y + " || document.body.scroll" + y + "))+'px'"); } } 972 973 if (c.ajax) { 974 var r = c.target || h.w, u = c.ajax, r = (typeof r == 'string') ? $(r, h.w) : $(r), u = (u.substr(0, 1) == '@') ? $(t).attr(u.substring(1)) : u; 975 r.html(c.ajaxText).load(u, function() { if (c.onLoad) c.onLoad.call(this, h); if (cc) h.w.jqmAddClose($(cc, h.w)); e(h); }); 976 } 977 else if (cc) h.w.jqmAddClose($(cc, h.w)); 978 979 if (c.toTop && h.o) h.w.before('<span id="jqmP' + h.w[0]._jqm + '"></span>').insertAfter(h.o); 980 (c.onShow) ? c.onShow(h) : h.w.show(); e(h); return F; 981 }, 982 close: function(s) { 983 var h = H[s]; if (!h.a) return F; h.a = F; 984 if (A[0]) { A.pop(); if (!A[0]) L('unbind'); } 985 if (h.c.toTop && h.o) $('#jqmP' + h.w[0]._jqm).after(h.w).remove(); 986 if (h.c.onHide) h.c.onHide(h); else { h.w.hide(); if (h.o) h.o.remove(); } return F; 987 }, 988 params: {} 989 }; 990 var s = 0, H = $.jqm.hash, A = [], ie6 = $.browser.msie && ($.browser.version == "6.0"), F = false, 991i = $('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({ opacity: 0 }), 992e = function(h) { if (ie6) if (h.o) h.o.html('<p style="width:100%;height:100%"/>').prepend(i); else if (!$('iframe.jqm', h.w)[0]) h.w.prepend(i); f(h); }, 993f = function(h) { try { $(':input:visible', h.w)[0].focus(); } catch (_) { } }, 994L = function(t) { $()[t]("keypress", m)[t]("keydown", m)[t]("mousedown", m); }, 995m = function(e) { var h = H[A[A.length - 1]], r = (!$(e.target).parents('.jqmID' + h.s)[0]); if (r) f(h); return !r; }, 996hs = function(w, t, c) { 997 return w.each(function() { 998 var s = this._jqm; $(t).each(function() { 999 if (!this[c]) { this[c] = []; $(this).click(function() { for (var i in { jqmShow: 1, jqmHide: 1 }) for (var s in this[i]) if (H[this[i][s]]) H[this[i][s]].w[i](this); return F; }); } this[c].push(s); 1000 }); 1001 });
1002}; 1003})(jQuery); 1004 1005 1006 1007 1008 1009 1010 1011/** 1012* TableDnD plug-in for JQuery, allows you to drag and drop table rows 1013* You can set up various options to control how the system will work 1014* Copyright (c) Denis Howlett <[email protected]> 1015* Licensed like jQuery, see http://docs.jquery.com/License. 1016* 1017* Configuration options: 1018* 1019* onDragStyle 1020* This is the style that is assigned to the row during drag. There are limitations to the styles that can be 1021* associated with a row (such as you can't assign a border--well you can, but it won't be 1022* displayed). (So instead consider using onDragClass.) The CSS style to apply is specified as 1023* a map (as used in the jQuery css(...) function). 1024* onDropStyle 1025* This is the style that is assigned to the row when it is dropped. As for onDragStyle, there are limitations 1026* to what you can do. Also this replaces the original style, so again consider using onDragClass which 1027* is simply added and then removed on drop. 1028* onDragClass 1029* This class is added for the duration of the drag and then removed when the row is dropped. It is more 1030* flexible than using onDragStyle since it can be inherited by the row cells and other content. The default 1031* is class is tDnD_whileDrag. So to use the default, simply customise this CSS class in your 1032* stylesheet. 1033* onDrop 1034* Pass a function that will be called when the row is dropped. The function takes 2 parameters: the table 1035* and the row that was dropped. You can work out the new order of the rows by using 1036* table.rows. 1037* onDragStart 1038* Pass a function that will be called when the user starts dragging. The function takes 2 parameters: the 1039* table and the row which the user has started to drag. 1040* onAllowDrop 1041* Pass a function that will be called as a row is over another row. If the function returns true, allow 1042* dropping on that row, otherwise not. The function takes 2 parameters: the dragged row and the row under 1043* the cursor. It returns a boolean: true allows the drop, false doesn't allow it. 1044* scrollAmount 1045* This is the number of pixels to scroll if the user moves the mouse
1045cursor to the top or bottom of the 1046* window. The page should automatically scroll up or down as appropriate (tested in IE6, IE7, Safari, FF2, 1047* FF3 beta 1048* dragHandle 1049* This is the name of a class that you assign to one or more cells in each row that is draggable. If you 1050* specify this class, then you are responsible for setting cursor: move in the CSS and only these cells 1051* will have the drag behaviour. If you do not specify a dragHandle, then you get the old behaviour where 1052* the whole row is draggable. 1053* 1054* Other ways to control behaviour: 1055* 1056* Add class="nodrop" to any rows for which you don't want to allow dropping, and class="nodrag" to any rows 1057* that you don't want to be draggable. 1058* 1059* Inside the onDrop method you can also call $.tableDnD.serialize() this returns a string of the form 1060* <tableID>[]=<rowID1>&<tableID>[]=<rowID2> so that you can send this back to the server. The table must have 1061* an ID as must all the rows. 1062* 1063* Other methods: 1064* 1065* $("...").tableDnDUpdate() 1066* Will update all the matching tables, that is it will reapply the mousedown method to the rows (or handle cells). 1067* This is useful if you have updated the table rows using Ajax and you want to make the table draggable again. 1068* The table maintains the original configuration (so you don't have to specify it again). 1069* 1070* $("...").tableDnDSerialize() 1071* Will serialize and return the serialized string as above, but for each of the matching tables--so it can be 1072* called from anywhere and isn't dependent on the currentTable being set up correctly before calling 1073* 1074* Known problems: 1075* - Auto-scoll has some problems with IE7 (it scrolls even when it shouldn't), work-around: set scrollAmount to 0 1076* 1077* Version 0.2: 2008-02-20 First public version 1078* Version 0.3: 2008-02-07 Added onDragStart option 1079* Made the scroll amount configurable (default is 5 as before) 1080* Version 0.4: 2008-03-15 Changed the noDrag/noDrop attributes to nodrag/nodrop classes 1081* Added onAllowDrop to control dropping 1082* Fixed a bug which meant that you couldn't set the scroll amount in both directions 1083* Added serialize method 1084* Version 0.5: 2008-05-16 Changed so that if you specify a dragHandle class it doesn't make the whole row 1085* draggable 1086* Improved the serialize method to use a default (and settable) regular expression. 1087* Added tableDnDupate() and tableDnDSerialize() to be called when you are outside the table 1088*/ 1089jQuery.tableDnD = { 1090 /** Keep hold of the current table being dragged */ 1091 currentTable: null, 1092 /** Keep hold of the current drag object if any */ 1093 dragObject: null, 1094 /** The current mouse offset */ 1095 mouseOffset: null, 1096 /** Remember the old value of Y so that we don't do too much processing */ 1097 oldY: 0, 1098 1099 /** Actually build the structure */ 1100 build: function(options) { 1101 // Set up the defaults if any 1102 1103 this.each(function() { 1104 // This is bound to each matching table, set up the defaults and override with user options 1105 this.tableDnDConfig = jQuery.extend({ 1106 onDragStyle: null, 1107 onDropStyle: null, 1108 // Add in the default class for whileDragging 1109 onDragClass: "tDnD_whileDrag", 1110 onDrop: null, 1111 onDragStart: null, 1112 scrollAmount: 5, 1113 serializeRegexp: /[^\-]*$/, // The regular expression to use to trim row IDs 1114 serializeParamName: null, // If you want to specify another parameter name instead of the table ID 1115 dragHandle: null // If you give the name of a class here, then only Cells with this class will be draggable 1116 }, options || {}); 1117 // Now make the rows draggable 1118 jQuery.tableDnD.makeDraggable(this); 1119 }); 1120 1121 // Now we need to capture the mouse up and mouse move event 1122 // We can use bind so that we don't interfere with other event handlers 1123 jQuery(document) 1124 .bind('mousemove', jQuery.tableDnD.mousemove) 1125 .bind('mouseup', jQuery.tableDnD.mouseup); 1126 1127 // Don't break the chain 1128 return this; 1129 }, 1130 1131 /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */ 1132 makeDraggable: function(table) { 1133 var config = table.tableDnDConfig; 1134 if (table.tableDnDConfig.dragHandle) { 1135 // We only need to add the event to the specified cells 1136 var cells = jQuery("td." + table.tableDnDConfig.dragHandle, table); 1137 cells.each(function() { 1138 // The cell is bound to "this" 1139 jQuery(this).mousedown(function(ev) { 1140 jQuery.tableDnD.dragObject = this.parentNode; 1141 jQuery.tableDnD.currentTable = table; 1142 jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev); 1143 if (config.onDragStart) { 1144 // Call the onDrop method if there is one 1145 config.onDragStart(table, this); 1146 } 1147 return false; 1148 }); 1149 }) 1150 } else { 1151 // For backwards compatibility, we add the event to the whole row 1152 var rows = jQuery("tr", table); // get all the rows as a wrapped set 1153 rows.each(function() { 1154 // Iterate through each row, the row is bound to "this" 1155 var row = jQuery(this); 1156 if (!row.hasClass("nodrag")) { 1157 row.mousedown(function(ev) { 1158 if (ev.target.tagName == "TD") { 1159 jQuery.tableDnD.dragObject = this; 1160 jQuery.tableDnD.currentTable = table; 1161 jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev); 1162 if (config.onDragStart) { 1163 // Call the onDrop method if there is one 1164 config.onDragStart(table, this); 1165 } 1166 return false; 1167 } 1168 }).css("cursor", "move"); // Store the tableDnD object 1169 } 1170 }); 1171 } 1172 }, 1173 1174 updateTables: function() { 1175 this.each(function() { 1176 // this is now bound to each matching table 1177 if (this.tableDnDConfig) { 1178 jQuery.tableDnD.makeDraggable(this); 1179 } 1180 }) 1181 }, 1182
1183 /** Get the mouse coordinates from the event (allowing for browser differences) */ 1184 mouseCoords: function(ev) { 1185 if (ev.pageX || ev.pageY) { 1186 return { x: ev.pageX, y: ev.pageY }; 1187 } 1188 return { 1189 x: ev.clientX + document.body.scrollLeft - document.body.clientLeft, 1190 y: ev.clientY + document.body.scrollTop - document.body.clientTop 1191 }; 1192 }, 1193 1194 /** Given a target element and a mouse event, get the mouse offset from that element. 1195 To do this we need the element's position and the mouse position */ 1196 getMouseOffset: function(target, ev) { 1197 ev = ev || window.event; 1198 1199 var docPos = this.getPosition(target); 1200 var mousePos = this.mouseCoords(ev); 1201 return { x: mousePos.x - docPos.x, y: mousePos.y - docPos.y }; 1202 }, 1203 1204 /** Get the position of an element by going up the DOM tree and adding up all the offsets */ 1205 getPosition: function(e) { 1206 var left = 0; 1207 var top = 0; 1208 /** Safari fix -- thanks to Luis Chato for this! */ 1209 if (e.offsetHeight == 0) { 1210 /** Safari 2 doesn't correctly grab the offsetTop of a table row 1211 this is detailed here: 1212 http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/ 1213 the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild. 1214 note that firefox will return a text node as a first child, so designing a more thorough 1215 solution may need to take that into account, for now this seems to work in firefox, safari, ie */ 1216 e = e.firstChild; // a table cell 1217 } 1218 1219 while (e.offsetParent) { 1220 left += e.offsetLeft; 1221 top += e.offsetTop; 1222 e = e.offsetParent; 1223 } 1224 1225 left += e.offsetLeft; 1226 top += e.offsetTop; 1227 1228 return { x: left, y: top }; 1229 }, 1230 1231 mousemove: function(ev) { 1232 if (jQuery.tableDnD.dragObject == null) { 1233 return; 1234 } 1235 1236 var dragObj = jQuery(jQuery.tableDnD.dragObject); 1237 var config = jQuery.tableDnD.currentTable.tableDnDConfig; 1238 var mousePos = jQuery.tableDnD.mouseCoords(ev); 1239 var y = mousePos.y - jQuery.tableDnD.mouseOffset.y; 1240 //auto scroll the window 1241 var yOffset = window.pageYOffset; 1242 if (document.all) {
1243 // Windows version 1244 //yOffset=document.body.scrollTop; 1245 if (typeof document.compatMode != 'undefined' && 1246 document.compatMode != 'BackCompat') { 1247 yOffset = document.documentElement.scrollTop; 1248 } 1249 else if (typeof document.body != 'undefined') { 1250 yOffset = document.body.scrollTop; 1251 } 1252 1253 } 1254 1255 if (mousePos.y - yOffset < config.scrollAmount) { 1256 window.scrollBy(0, -config.scrollAmount); 1257 } else { 1258 var windowHeight = window.innerHeight ? window.innerHeight 1259 : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight; 1260 if (windowHeight - (mousePos.y - yOffset) < config.scrollAmount) { 1261 window.scrollBy(0, config.scrollAmount); 1262 } 1263 } 1264 1265 1266 if (y != jQuery.tableDnD.oldY) { 1267 // work out if we're going up or down... 1268 var movingDown = y > jQuery.tableDnD.oldY; 1269 // update the old value 1270 jQuery.tableDnD.oldY = y; 1271 // update the style to show we're dragging 1272 if (config.onDragClass) { 1273 dragObj.addClass(config.onDragClass); 1274 } else { 1275 dragObj.css(config.onDragStyle); 1276 } 1277 // If we're over a row then move the dragged row to there so that the user sees the 1278 // effect dynamically 1279 var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y); 1280 if (currentRow) { 1281 // TODO worry about what happens when there are multiple TBODIES 1282 if (movingDown && jQuery.tableDnD.dragObject != currentRow) { 1283 jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling); 1284 } else if (!movingDown && jQuery.tableDnD.dragObject != currentRow) { 1285 jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow); 1286 } 1287 } 1288 } 1289 1290 return false; 1291 }, 1292 1293 /** We're only worried about the y position really, because we can only move rows up and down */ 1294 findDropTargetRow: function(draggedRow, y) { 1295 var rows = jQuery.tableDnD.currentTable.rows; 1296 for (var i = 0; i < rows.length; i++) { 1297 var row = rows[i]; 1298 var rowY = this.getPosition(row).y; 1299 var rowHeight = parseInt(row.offsetHeight) / 2; 1300 if (row.offsetHeight == 0) { 1301 rowY = this.getPosition(row.firstChild).y; 1302 rowHeight = parseInt(row.firstChild.offsetHeight) / 2; 1303 } 1304 // Because we always have to insert before, we need to offset the height a bit 1305 if ((y > rowY - rowHeight) && (y < (rowY + rowHeight))) { 1306 // that's the row we're over 1307 // If it's the same as the current row, ignore it 1308 if (row == draggedRow) { return null; } 1309 var config = jQuery.tableDnD.currentTable.tableDnDConfig; 1310 if (config.onAllowDrop) { 1311 if (config.onAllowDrop(draggedRow, row)) { 1312 return row; 1313 } else { 1314 return null; 1315 } 1316 } else { 1317 // If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic) 1318 var nodrop = jQuery(row).hasClass("nodrop"); 1319 if (!nodrop) { 1320 return row; 1321 } else { 1322 return null; 1323 } 1324 } 1325 return row; 1326 } 1327 } 1328 return null; 1329 }, 1330 1331 mouseup: function(e) { 1332 if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) { 1333 var droppedRow = jQuery.tableDnD.dragObject; 1334 var config = jQuery.tableDnD.currentTable.tableDnDConfig; 1335 // If we have a dragObject, then we need to release it, 1336 // The row will already have been moved to the right place so we just reset stuff
1337 if (config.onDragClass) { 1338 jQuery(droppedRow).removeClass(config.onDragClass); 1339 } else { 1340 jQuery(droppedRow).css(config.onDropStyle); 1341 } 1342 jQuery.tableDnD.dragObject = null; 1343 if (config.onDrop) { 1344 // Call the onDrop method if there is one 1345 config.onDrop(jQuery.tableDnD.currentTable, droppedRow); 1346 } 1347 jQuery.tableDnD.currentTable = null; // let go of the table too 1348 } 1349 }, 1350 1351 serialize: function() { 1352 if (jQuery.tableDnD.currentTable) { 1353 return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable); 1354 } else { 1355 return "Error: No Table id set, you need to set an id on your table and every row"; 1356 } 1357 }, 1358 1359 serializeTable: function(table) { 1360 var result = ""; 1361 var tableId = table.id; 1362 var rows = table.rows; 1363 for (var i = 0; i < rows.length; i++) { 1364 if (result.length > 0) result += "&"; 1365 var rowId = rows[i].id; 1366 if (rowId && rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) { 1367 rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0]; 1368 } 1369 1370 result += tableId + '[]=' + rowId; 1371 } 1372 return result; 1373 }, 1374 1375 serializeTables: function() { 1376 var result = ""; 1377 this.each(function() { 1378 // this is now bound to each matching table 1379 result += jQuery.tableDnD.serializeTable(this); 1380 }); 1381 return result; 1382 } 1383 1384} 1385 1386jQuery.fn.extend( 1387 { 1388 tableDnD: jQuery.tableDnD.build, 1389 tableDnDUpdate: jQuery.tableDnD.updateTables, 1390 tableDnDSerialize: jQuery.tableDnD.serializeTables 1391 } 1392); 1393 1394 1395 1396 1397/** 1398* Cookie plugin 1399* 1400* Copyright (c) 2006 Klaus Hartl (stilbuero.de) 1401* Dual licensed under the MIT and GPL licenses: 1402* http://www.opensource.org/licenses/mit-license.php 1403* http://www.gnu.org/licenses/gpl.html 1404* 1405*/ 1406 1407/** 1408* Create a cookie with the given name and value and other optional parameters. 1409* 1410* @example $.cookie('the_cookie', 'the_value'); 1411* @desc Set the value of a cookie. 1412* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); 1413* @desc Create a cookie with all available options. 1414* @example $.cookie('the_cookie', 'the_value'); 1415* @desc Create a session cookie. 1416* @example $.cookie('the_cookie', null); 1417* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain 1418* used when the cookie was set. 1419* 1420* @param String name The name of the cookie. 1421* @param String value The value of the cookie. 1422* @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 1423* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 1424* If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 1425* If set to null or omitted, the cookie will be a session cookie and will not be retained 1426* when the the browser exits. 1427* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 1428* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 1429* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 1430* require a secure protocol (like HTTPS). 1431* @type undefined 1432* 1433* @name $.cookie 1434* @cat Plugins/Cookie 1435* @author Klaus Hartl/[email protected] 1436*/ 1437 1438/** 1439* Get the value of a cookie with the given name. 1440* 1441* @example $.cookie('the_cookie'); 1442* @desc Get the value of a cookie. 1443* 1444* @param String name The name of the cookie. 1445* @return The value of the cookie. 1446* @type String 1447* 1448* @name $.cookie 1449* @cat Plugins/Cookie 1450* @author Klaus Hartl/[email protected] 1451*/ 1452jQuery.cookie = function(name, value, options) { 1453 if (typeof value != 'undefined') { // name and value given, set cookie 1454 options = options || {}; 1455 if (value === null) { 1456 value = ''; 1457 options.expires = -1; 1458 } 1459 var expires = ''; 1460 if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 1461 var date; 1462 if (typeof options.expires == 'number') { 1463 date = new Date(); 1464 date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 1465 } else { 1466 date = options.expires; 1467 } 1468 expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 1469 } 1470 // CAUTION: Needed to parenthesize options.path and options.domain 1471 // in the following expressions, otherwise they evaluate to undefined 1472 // in the packed version for some reason... 1473 var path = options.path ? '; path=' + (options.path) : ''; 1474 var domain = options.domain ? '; domain=' + (options.domain) : ''; 1475 var secure = options.secure ? '; secure' : ''; 1476 document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 1477 } else { // only name given, get cookie 1478 var cookieValue = null; 1479 if (document.cookie && document.cookie != '') { 1480 var cookies = document.cookie.split(';'); 1481 for (var i = 0; i < cookies.length; i++) { 1482 var cookie = jQuery.trim(cookies[i]); 1483 // Does this cookie string begin with the name we want? 1484 if (cookie.substring(0, name.length + 1) == (name + '=')) { 1485 cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 1486 break; 1487 } 1488 } 1489 } 1490 return cookieValue; 1491 } 1492}; 1493 1494/* 1495 * jquery.tools 1.1.2 - The missing UI library for the Web 1496 * 1497 * [tools.tooltip-1.1.2, tools.tooltip.slide-1.0.0, tools.tooltip.dynamic-1.0.1, tools.scrollable-1.1.2, tools.scrollable.circular-0.5.1, tools.scrollable.autoscroll-1.0.1, tools.scrollable.navigator-1.0.2, tools.scrollable.mousewheel-1.0.1] 1498 * 1499 * Copyright (c) 2009 Tero Piirainen 1500 * http://flowplayer.org/tools/ 1501 * 1502 * Dual licensed under MIT and GPL 2+ licenses 1503 * http://www.opensource.org/licenses 1504 * 1505 * ----- 1506 * 1507 * jquery.event.wheel.js - rev 1 1508 * Copyright (c) 2008, Three Dub Media (http://threedubmedia.com) 1509 * Liscensed under the MIT License (MIT-LICENSE.txt) 1510 * http://www.opensource.org/licenses/mit-license.php 1511 * Created: 2008-07-01 | Updated: 2008-07-14 1512 * 1513 * ----- 1514 * 1515 * File generated: Thu Oct 08 09:36:42 GMT+00:00 2009 1516 * 1517 * Updated by MA: Oct 01 2012 1518 */ 1519(function(c){var d=[];c.tools=c.tools||{};c.tools.tooltip={version:"1.1.3",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:false,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(e,g,f){b[e]=[g,f]}};var b={toggle:[function(e){var f=this.getConf(),g=this.getTip(),h=f.opacity;if(h<1){g.css({opacity:h})}g.show();e.call()},function(e){this.getTip().hide();e.call()}],fade:[function(e){this.getTip().fadeIn(this.getConf().fadeInSpeed,e)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};function a(f,g){var p=this,k=c(this);f.data("tooltip",p);var l=f.next();if(g.tip){l=c(g.tip);if(l.length>1){l=f.nextAll(g.tip).eq(0);if(!l.length){l=f.parent().nextAll(g.tip).eq(0)}}}function o(u){var t=g.relative?f.position().top:f.offset().top,s=g.relative?f.position().left:f.offset().left,v=g.position[0];t-=l.outerHeight()-g.offset[0];s+=f.outerWidth()+g.offset[1];var q=l.outerHeight()+f.outerHeight();if(v=="center"){t+=q/2}if(v=="bottom"){t+=q}v=g.position[1];var r=l.outerWidth()+f.outerWidth();if(v=="center"){s-=r/2}if(v=="left"){s-=r}return{top:t,left:s}}var i=f.is(":input"),e=i&&f.is(":checkbox, :radio, select, :button"),h=f.attr("type"),n=g.events[h]||g.events[i?(e?"widget":"input"):"def"];n=n.split(/,\s*/);if(n.length!=2){throw"Tooltip: bad events configuration for "+h}f.bind(n[0],function(r){if(g.oneInstance){c.each(d,function(){this.hide()})}var q=l.data("trigger");if(q&&q[0]!=this){l.hide().stop(true,true)}r.target=this;p.show(r);n=g.events.tooltip.split(/,\s*/);l.bind(n[0],function(){p.show(r)}
1519);if(n[1]){l.bind(n[1],function(){p.hide(r)})}});f.bind(n[1],function(q){p.hide(q)});if(!c.browser.msie&&!i&&!g.predelay){f.mousemove(function(){if(!p.isShown()){f.triggerHandler("mouseover")}})}if(g.opacity<1){l.css("opacity",g.opacity)}var m=0,j=f.attr("title");if(j&&g.cancelDefault){f.removeAttr("title");f.data("title",j)}c.extend(p,{show:function(r){if(r){f=c(r.target)}clearTimeout(l.data("timer"));if(l.is(":animated")||l.is(":visible")){return p}function q(){l.data("trigger",f);var t=o(r);if(g.tip&&j){l.html(f.data("title"))}r=c.Event();r.type="onBeforeShow";k.trigger(r,[t]);if(r.isDefaultPrevented()){return p}t=o(r);l.css({position:"absolute",top:t.top,left:t.left});var s=b[g.effect];if(!s){throw'Nonexistent effect "'+g.effect+'"'}s[0].call(p,function(){r.type="onShow";k.trigger(r)})}if(g.predelay){clearTimeout(m);m=setTimeout(q,g.predelay)}else{q()}return p},hide:function(r){clearTimeout(l.data("timer"));clearTimeout(m);if(!l.is(":visible")){return}function q(){r=c.Event();r.type="onBeforeHide";k.trigger(r);if(r.isDefaultPrevented()){return}b[g.effect][1].call(p,function(){r.type="onHide";k.trigger(r)})}if(g.delay&&r){l.data("timer",setTimeout(q,g.delay))}else{q()}return p},isShown:function(){return l.is(":visible, :animated")},getConf:function(){return g},getTip:function(){return l},getTrigger:function(){return f},bind:function(q,r){k.bind(q,r);return p},onHide:function(q){return this.bind("onHide",q)},onBeforeShow:function(q){return this.bind("onBeforeShow",q)},onShow:function(q){return this.bind("onShow",q)},onBeforeHide:function(q){return this.bind("onBeforeHide",q)},unbind:function(q){k.unbind(q);return p}});c.each(g,function(q,r){if(c.isFunction(r)){p.bind(q,r)}})}c.prototype.tooltip=function(e){var f=this.eq(typeof e=="number"?e:0).data("tooltip");if(f){return f}var g=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(e)){e={onBeforeShow:e}}else{if(typeof e=="string"){e={tip:e}}}e=c.extend(true,g,e);
1519if(typeof e.position=="string"){e.position=e.position.split(/,?\s/)}if(e.lazy!==false&&(e.lazy===true||this.length>20)){this.one("mouseover",function(h){f=new a(c(this),e);f.show(h);d.push(f)})}else{this.each(function(){f=new a(c(this),e);d.push(f)})}return e.api?f:this}})(jQuery); 1520(function(b){var a=b.tools.tooltip;a.effects=a.effects||{};a.effects.slide={version:"1.0.0"};b.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!b.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.tools.tooltip.addEffect("slide",function(d){var f=this.getConf(),g=this.getTip(),h=f.slideFade?{opacity:f.opacity}:{},e=c[f.direction]||c.up;h[e[1]]=e[0]+"="+f.slideOffset;if(f.slideFade){g.css({opacity:0})}g.show().animate(h,f.slideInSpeed,d)},function(e){var g=this.getConf(),i=g.slideOffset,h=g.slideFade?{opacity:0}:{},f=c[g.direction]||c.up;var d=""+f[0];if(g.bounce){d=d=="+"?"-":"+"}h[f[1]]=d+"="+i;this.getTip().animate(h,g.slideOutSpeed,function(){b(this).hide();e.call()})})})(jQuery); 1521(function(d){var c=d.tools.tooltip;c.plugins=c.plugins||{};c.plugins.dynamic={version:"1.0.1",conf:{api:false,classNames:"top right bottom left"}};function b(h){var e=d(window);var g=e.width()+e.scrollLeft();var f=e.height()+e.scrollTop();return[h.offset().top<=e.scrollTop(),g<=h.offset().left+h.width(),f<=h.offset().top+h.height(),e.scrollLeft()>=h.offset().left]}function a(f){var e=f.length;while(e--){if(f[e]){return false}}return true}d.fn.dynamic=function(g){var h=d.extend({},c.plugins.dynamic.conf),f;if(typeof g=="number"){g={speed:g}}g=d.extend(h,g);var e=g.classNames.split(/\s/),i;this.each(function(){if(d(this).tooltip().jquery){throw"Lazy feature not supported by dynamic plugin. set lazy: false for tooltip"}var j=d(this).tooltip().onBeforeShow(function(n,o){var m=this.getTip(),l=this.getConf();if(!i){i=[l.position[0],l.position[1],l.offset[0],l.offset[1],d.extend({},l)]}d.extend(l,i[4]);l.position=[i[0],i[1]];l.offset=[i[2],i[3]];m.css({visibility:"hidden",position:"absolute",top:o.top,left:o.left}).show();var k=b(m);if(!a(k)){if(k[2]){d.extend(l,g.top);l.position[0]="top";m.addClass(e[0])}if(k[3]){d.extend(l,g.right);l.position[1]="right";m.addClass(e[1])}if(k[0]){d.extend(l,g.bottom);l.position[0]="bottom";m.addClass(e[2])}if(k[1]){d.extend(l,g.left);l.position[1]="left";m.addClass(e[3])}if(k[0]||k[2]){l.offset[0]*=-1}if(k[1]||k[3]){l.offset[1]*=-1}}m.css({visibility:"visible"}).hide()});j.onShow(function(){var l=this.getConf(),k=this.getTip();l.position=[i[0],i[1]];l.offset=[i[2],i[3]]});j.onHide(function(){var k=this.getTip();k.removeClass(g.classNames)});f=j});return g.api?f:this}})(jQuery); 1522(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c;function a(o,m){var r=this,p=b(this),d=!m.vertical,e=o.children(),k=0,i;if(!c){c=r}b.each(m,function(s,t){if(b.isFunction(t)){p.bind(s,t)}});if(e.length>1){e=b(m.items,o)}function l(t){var s=b(t);return m.globalNav?s:o.parent().find(t)}o.data("finder",l);var f=l(m.prev),h=l(m.next),g=l(m.prevPage),n=l(m.nextPage);b.extend(r,{getIndex:function(){return k},getClickIndex:function(){var s=r.getItems();return s.index(s.filter("."+m.activeClass))},getConf:function(){return m},getSize:function(){return r.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(k/m.size)},getNaviButtons:function(){return f.add(h).add(g).add(n)},getRoot:function(){return o},getItemWrap:function(){return e},getItems:function(){return e.children(m.item)},getVisibleItems:function(){return r.getItems().slice(k,k+m.size)},seekTo:function(s,w,t){if(s<0){s=0}if(k===s){return r}if(b.isFunction(w)){t=w}if(s>r.getSize()-m.size){return m.loop?r.begin():this.end()}var u=r.getItems().eq(s);if(!u.length){return r}var v=b.Event("onBeforeSeek");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}if(w===undefined||b.isFunction(w)){w=m.speed}function x(){if(t){t.call(r,s)}p.trigger("onSeek",[s])}if(d){e.animate({left:-u.position().left},w,m.easing,x)}else{e.animate({top:-u.position().top},w,m.easing,x)}c=r;k=s;v=b.Event("onStart");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}f.add(g).toggleClass(m.disabledClass,s===0);h.add(n).toggleClass(m.disabledClass,s>=r.getSize()-m.size);return r},move:function(u,t,s){i=u>0;return this.seekTo(k+u,t,s)},next:function(t,s){return this.move(1,t,s)},prev:function(t,s){return this.move(-1,t,s)},movePage:function(w,v,u){i=w>0;var s=m.size*w;var t=k%m.size;if(t>0){s+=(w>0?-t:m.size-t)}return this.move(s,v,u)},prevPage:function(t,s){return this.movePage(-1,t,s)},nextPage:function(t,s){return this.movePage(1,t,s)},setPage:function(t,u,s){return this.seekTo(t*m.size,u,s)},begin:function(t,s){i=false;return this.seekTo(0,t,s)},end:function(t,s){i=true;var u=this.getSize()-m.size;return u>0?this.seekTo(u,t,s):r},reload:function(){p.trigger("onReload");return r},focus:function(){c=r;return r},click:function(u){var v=r.getItems().eq(u),s=m.activeClass,t=m.size;if(u<0||u>=r.getSize()){return r}if(t==1){if(m.loop){return r.next()}if(u===0||u==r.getSize()-1){i=(i===undefined)?true:!i}return i===false?r.prev():r.next()}if(t==2){if(u==k){u--}r.getItems().removeClass(s);v.addClass(s);return r.seekTo(u,time,fn)}if(!v.hasClass(s)){r.getItems().removeClass(s);v.addClass(s);var x=Math.floor(t/2);var w=u-x;if(w>r.getSize()-t){w=r.getSize()-t}if(w!==u){return r.seekTo(w)}}return r},bind:function(s,t){p.bind(s,t);return r},unbind:function(s){p.unbind(s);return r}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(s,t){r[t]=function(u){return r.bind(t,u)}});f.addClass(m.disabledClass).click(function(){r.prev()});h.click(function(){r.next()});n.click(function(){r.nextPage()});if(r.getSize()<m.size){h.add(n).addClass(m.disabledClass)}g.addClass(m.disabledClass).click(function(){r.prevPage()});var j=m.hoverClass,q="keydown."+Math.random().toString().substring(10);r.onReload(function(){if(j){r.getItems().hover(function(){b(this).addClass(j)},function(){b(this).removeClass(j)})}if(m.clickable){r.getItems().each(function(s){b(this).unbind("click.scrollable").bind("click.scrollable",function(t){if(b(t.target).is("a")){return}return r.click(s)})})}if(m.keyboard){b(document).unbind(q).bind(q,function(t){if(t.altKey||t.ctrlKey){return}if(m.keyboard!="static"&&c!=r){return}var u=m.keyboardSteps;if(d&&(t.keyCode==37||t.keyCode==39)){r.move(t.keyCode==37?-u:u);return t.preventDefault()}if(!d&&(t.keyCode==38||t.keyCode==40)){r.move(t.keyCode==38?-u:u);return t.preventDefault()}return true})}else{b(document).unbind(q)}});r.reload()}b.fn.scrollable=function(d){var e=this.eq(typeof d=="number"?d:0).data("scrollable");if(e){return e}var f=b.extend({},b.tools.scrollable.conf);d=b.extend(f,d);d.keyboardSteps=d.keyboardSteps||d.size;this.each(function(){e=new a(b(this),d);b(this).data("scrollable",e)});return d.api?e:this}})(jQuery); 1523(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.circular={version:"0.5.1",conf:{api:false,clonedClass:"cloned"}};b.fn.circular=function(e){var d=b.extend({},a.plugins.circular.conf),c;b.extend(d,e);this.each(function(){var i=b(this).scrollable(),n=i.getItems(),k=i.getConf(),f=i.getItemWrap(),j=0;if(i){c=i}if(n.length<k.size){return false}n.slice(0,k.size).each(function(o){b(this).clone().appendTo(f).click(function(){i.click(n.length+o)}).addClass(d.clonedClass)});var l=b.makeArray(n.slice(-k.size)).reverse();b(l).each(function(o){b(this).clone().prependTo(f).click(function(){i.click(-o-1)}).addClass(d.clonedClass)});var m=f.children(k.item);var h=k.hoverClass;if(h){m.hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)})}function g(o){var p=m.eq(o);if(k.vertical){f.css({top:-p.position().top})}else{f.css({left:-p.position().left})}}g(k.size);b.extend(i,{move:function(s,r,p,q){var u=j+s+k.size;var t=u>i.getSize()-k.size;if(u<=0||t){var o=j+k.size+(t?-n.length:n.length);g(o);u=o+s}if(q){m.removeClass(k.activeClass).eq(u+Math.floor(k.size/2)).addClass(k.activeClass)}if(u===j+k.size){return self}return i.seekTo(u,r,p)},begin:function(p,o){return this.seekTo(k.size,p,o)},end:function(p,o){return this.seekTo(n.length,p,o)},click:function(p,r,q){if(!k.clickable){return self}if(k.size==1){return this.next()}var s=p-j,o=k.activeClass;s-=Math.floor(k.size/2);return this.move(s,r,q,true)},getIndex:function(){return j},setPage:function(p,q,o){return this.seekTo(p*k.size+k.size,q,o)}
1523,getPageAmount:function(){return Math.ceil(n.length/k.size)},getPageIndex:function(){if(j<0){return this.getPageAmount()-1}if(j>=n.length){return 0}var o=(j+k.size)/k.size-1;return o},getVisibleItems:function(){var o=j+k.size;return m.slice(o,o+k.size)}});i.onStart(function(p,o){j=o-k.size;return false});i.getNaviButtons().removeClass(k.disabledClass)});return d.api?c:this}})(jQuery); 1524(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};b.fn.autoscroll=function(d){if(typeof d=="number"){d={interval:d}}var e=b.extend({},a.plugins.autoscroll.conf),c;b.extend(e,d);this.each(function(){var g=b(this).scrollable();if(g){c=g}var i,f,h=true;g.play=function(){if(i){return}h=false;i=setInterval(function(){g.move(e.steps)},e.interval);g.move(e.steps)};g.pause=function(){i=clearInterval(i)};g.stop=function(){g.pause();h=true};if(e.autopause){g.getRoot().add(g.getNaviButtons()).hover(function(){g.pause();clearInterval(f)},function(){if(!h){f=setTimeout(g.play,e.interval)}})}if(e.autoplay){setTimeout(g.play,e.interval)}});return e.api?c:this}})(jQuery); 1525(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};b.fn.navigator=function(d){var e=b.extend({},a.plugins.navigator.conf),c;if(typeof d=="string"){d={navi:d}}d=b.extend(e,d);this.each(function(){var i=b(this).scrollable(),f=i.getRoot(),l=f.data("finder").call(null,d.navi),g=null,k=i.getNaviButtons();if(i){c=i}i.getNaviButtons=function(){return k.add(l)};function j(){if(!l.children().length||l.data("navi")==i){l.empty();l.data("navi",i);for(var m=0;m<i.getPageAmount();m++){l.append(b("<"+(d.naviItem||"a")+"/>"))}g=l.children().each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()});if(d.indexed){o.text(n)}if(d.idPrefix){o.attr("id",d.idPrefix+n)}})}else{g=d.naviItem?l.find(d.naviItem):l.children();g.each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()})})}g.eq(0).addClass(d.activeClass)}i.onStart(function(o,n){var m=d.activeClass;g.removeClass(m).eq(i.getPageIndex()).addClass(m)});i.onReload(function(){j()});j();var h=g.filter("[href="+location.hash+"]");if(h.length){i.move(g.index(h))}});return d.api?c:this}})(jQuery); 1526(function(b){b.fn.wheel=function(e){return this[e?"bind":"trigger"]("wheel",e)};b.event.special.wheel={setup:function(){b.event.add(this,d,c,{})},teardown:function(){b.event.remove(this,d,c)}};var d=!b.browser.mozilla?"mousewheel":"DOMMouseScroll"+(b.browser.version<"1.9"?" mou
1526semove":"");function c(e){switch(e.type){case"mousemove":return b.extend(e.data,{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY});case"DOMMouseScroll":b.extend(e,e.data);e.delta=-e.detail/3;break;case"mousewheel":e.delta=e.wheelDelta/120;break}e.type="wheel";return b.event.handle.call(this,e,e.delta)}var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};b.fn.mousewheel=function(f){var g=b.extend({},a.plugins.mousewheel.conf),e;if(typeof f=="number"){f={speed:f}}f=b.extend(g,f);this.each(function(){var h=b(this).scrollable();if(h){e=h}h.getRoot().wheel(function(i,j){h.move(j<0?1:-1,f.speed||50);return false})});return f.api?e:this}})(jQuery); 1527(function(c){c.tools=c.tools||{};c.tools.overlay={version:"1.1.2",addEffect:function(e,f,g){b[e]=[f,g]},conf:{top:"10%",left:"center",absolute:false,speed:"normal",closeSpeed:"fast",effect:"default",close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var b={};c.tools.overlay.addEffect("default",function(e){this.getOverlay().fadeIn(this.getConf().speed,e)},function(e){this.getOverlay().fadeOut(this.getConf().closeSpeed,e)});var d=[];function a(g,k){var o=this,m=c(this),n=c(window),j,i,h,e=k.expose&&c.tools.expose.version;var f=k.target||g.attr("rel");i=f?c(f):null||g;if(!i.length){throw"Could not find Overlay: "+f}if(g&&g.index(i)==-1){g.click(function(p){o.load(p);return p.preventDefault()})}c.each(k,function(p,q){if(c.isFunction(q)){m.bind(p,q)}});c.extend(o,{load:function(u){if(o.isOpened()){return o}var r=b[k.effect];if(!r){throw'Overlay: cannot find effect : "'+k.effect+'"'}if(k.oneInstance){c.each(d,function(){this.close(u)})}u=u||c.Event();u.type="onBeforeLoad";m.trigger(u);
1527if(u.isDefaultPrevented()){return o}h=true;if(e){i.expose().load(u)}var t=k.top;var s=k.left;var p=i.outerWidth(true);var q=i.outerHeight(true);if(typeof t=="string"){t=t=="center"?Math.max((n.height()-q)/2,0):parseInt(t,10)/100*n.height()}if(s=="center"){s=Math.max((n.width()-p)/2,0)}if(!k.absolute){t+=n.scrollTop();s+=n.scrollLeft()}i.css({top:t,left:s,position:"absolute"});u.type="onStart";m.trigger(u);r[0].call(o,function(){if(h){u.type="onLoad";m.trigger(u)}});if(k.closeOnClick){c(document).bind("click.overlay",function(w){if(!o.isOpened()){return}var v=c(w.target);if(v.parents(i).length>1){return}c.each(d,function(){this.close(w)})})}if(k.closeOnEsc){c(document).unbind("keydown.overlay").bind("keydown.overlay",function(v){if(v.keyCode==27){c.each(d,function(){this.close(v)})}})}return o},close:function(q){if(!o.isOpened()){return o}q=q||c.Event();q.type="onBeforeClose";m.trigger(q);if(q.isDefaultPrevented()){return}h=false;b[k.effect][1].call(o,function(){q.type="onClose";m.trigger(q)});var p=true;c.each(d,function(){if(this.isOpened()){p=false}});if(p){c(document).unbind("click.overlay").unbind("keydown.overlay")}return o},getContent:function(){return i},getOverlay:function(){return i},getTrigger:function(){return g},getClosers:function(){return j},isOpened:function(){return h},getConf:function(){return k},bind:function(p,q){m.bind(p,q);return o},unbind:function(p){m.unbind(p);return o}});c.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(p,q){o[q]=function(r){return o.bind(q,r)}});if(e){if(typeof k.expose=="string"){k.expose={color:k.expose}}c.extend(k.expose,{api:true,closeOnClick:k.closeOnClick,closeOnEsc:false});var l=i.expose(k.expose);l.onBeforeClose(function(p){o.close(p)});o.onClose(function(p){l.close(p)})}j=i.find(k.close||".close");if(!j.length&&!k.close){j=c('<div class="close"></div>');i.prepend(j)}j.click(function(p){o.close(p)})}c.fn.overlay=function(e){var f=this.eq(typeof e=="number"?e:0).data("overlay");if(f){return f}if(c.isFunction(e)){e={onBeforeLoad:e}}var g=c.extend({},c.tools.overlay.conf);e=c.extend(true,g,e);this.each(function(){f=new a(c(this),e);d.push(f);c(this).data("overlay",f)});return e.api?f:this}})(jQuery); 1528(function(d){var b=d.tools.overlay;b.effects=b.effects||{};b.effects.apple={version:"1.0.1"};d.extend(b.conf,{start:{absolute:true,top:null,left:null},fadeInSpeed:"fast",zIndex:99999999});function c(f){var g=f.offset();return[g.top+f.height()/2,g.left+f.width()/2]}var e=function(n){var k=this.getOverlay(),f=this.getConf(),i=this.getTrigger(),q=this,r=k.outerWidth(true),m=k.data("img");if(!m){var l=k.css("backgroundImage");if(!l){throw"background-image CSS property not set for overlay"}l=l.substring(l.indexOf("(")+1,l.indexOf(")")).replace(/\"/g,"");k.css("backgroundImage","none");m=d('<img src="'+l+'"/>');m.css({border:0,position:"absolute",display:"none"}).width(r);d("body").append(m);k.data("img",m)}var o=d(window),j=f.start.top||Math.round(o.height()/2),h=f.start.left||Math.round(o.width()/2);if(i){var g=c(i);j=g[0];h=g[1]}if(!f.start.absolute){j+=o.scrollTop();h+=o.scrollLeft()}m.css({top:j,left:h,width:0,zIndex:f.zIndex}).show();m.animate({top:k.css("top"),left:k.css("left"),width:r},f.speed,function(){k.css("zIndex",f.zIndex+1).fadeIn(f.fadeInSpeed,function(){if(q.isOpened()&&!d(this).index(k)){n.call()}else{k.hide()}})})};var a=function(f){var h=this.getOverlay(),i=this.getConf(),g=this.getTrigger(),l=i.start.top,k=i.start.left;h.hide();if(g){var j=c(g);l=j[0];k=j[1]}h.data("img").animate({top:l,left:k,width:0},i.closeSpeed,f)};b.addEffect("apple",e,a)})(jQuery); 1529(function(b){b.tools=b.tools||{};b.tools.expose={version:"1.0.5",conf:{maskId:null,loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,color:"#456",api:false}};function a(){if(b.browser.msie){var f=b(document).height(),e=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f-e<20?e:f]}return[b(window).width(),b(document).height()]}function c(h,g){var e=this,j=b(this),d=null,f=false,i=0;b.each(g,function(k,l){if(b.isFunction(l)){j.bind(k,l)}});b(window).resize(function(){e.fit()});b.extend(this,{getMask:function(){return d},getExposed:function(){return h},getConf:function(){return g},isLoaded:function(){return f},load:function(n){if(f){return e}i=h.eq(0).css("zIndex");if(g.maskId){d=b("#"+g.maskId)}if(!d||!d.length){var l=a();d=b("<div/>").css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:0,zIndex:g.zIndex});if(g.maskId){d.attr("id",g.maskId)}b("body").append(d);var k=d.css("backgroundColor");
1529if(!k||k=="transparent"||k=="rgba(0, 0, 0, 0)"){d.css("backgroundColor",g.color)}if(g.closeOnEsc){b(document).bind("keydown.unexpose",function(o){if(o.keyCode==27){e.close()}})}if(g.closeOnClick){d.bind("click.unexpose",function(o){e.close(o)})}}n=n||b.Event();n.type="onBeforeLoad";j.trigger(n);if(n.isDefaultPrevented()){return e}b.each(h,function(){var o=b(this);if(!/relative|absolute|fixed/i.test(o.css("position"))){o.css("position","relative")}});h.css({zIndex:Math.max(g.zIndex+1,i=="auto"?0:i)});var m=d.height();if(!this.isLoaded()){d.css({opacity:0,display:"block"}).fadeTo(g.loadSpeed,g.opacity,function(){if(d.height()!=m){d.css("height",m)}n.type="onLoad";j.trigger(n)})}f=true;return e},close:function(k){if(!f){return e}k=k||b.Event();k.type="onBeforeClose";j.trigger(k);if(k.isDefaultPrevented()){return e}d.fadeOut(g.closeSpeed,function(){k.type="onClose";j.trigger(k);h.css({zIndex:b.browser.msie?i:null})});f=false;return e},fit:function(){if(d){var k=a();d.css({width:k[0],height:k[1]})}},bind:function(k,l){j.bind(k,l);return e},unbind:function(k){j.unbind(k);return e}});b.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","),function(k,l){e[l]=function(m){return e.bind(l,m)}})}b.fn.expose=function(d){var e=this.eq(typeof d=="number"?d:0).data("expose");if(e){return e}if(typeof d=="string"){d={color:d}}var f=b.extend({},b.tools.expose.conf);d=b.extend(f,d);this.each(function(){e=new c(b(this),d);b(this).data("expose",e)});return d.api?e:this}})(jQuery); 1530 1531 1532/** 1533* Sets the type of metadata to use. Metadata is encoded in JSON, and each property 1534* in the JSON will become a property of the element itself. 1535* 1536* There are four supported types of metadata storage: 1537* 1538* attr: Inside an attribute. The name parameter indicates *which* attribute. 1539* 1540* class: Inside the class attribute, wrapped in curly braces: { } 1541* 1542* elem: Inside a child element (e.g. a script tag). The 1543* name parameter indicates *which* element. 1544* html5: Values are stored in data-* attributes. 1545* 1546* The metadata for an element is loaded the first time the element is accessed via jQuery. 1547* 1548* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements 1549* matched by expr, then redefine the metadata type and run another $(expr) for other elements. 1550* 1551* @name $.metadata.setType 1552* 1553* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p> 1554* @before $.metadata.setType("class") 1555* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 1556* @desc Reads metadata from the class attribute 1557* 1558* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p> 1559* @before $.metadata.setType("attr", "data") 1560* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 1561* @desc Reads metadata from a "data" attribute 1562* 1563* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p> 1564* @before $.metadata.setType("elem", "script") 1565* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 1566* @desc Reads metadata from a nested script element 1567* 1568* @example <p id="one" class="some_class" data-item_id="1" data-item_label="Label">This is a p</p> 1569* @before $.metadata.setType("html5") 1570* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 1571* @desc Reads metadata from a series of data-* attributes 1572* 1573* @param String type The encoding type 1574* @param String name The name of the attribute to be used to get metadata (optional) 1575* @cat Plugins/Metadata 1576* @descr Sets the type of encoding to be used when loading metadata for the first time 1577* @type undefined 1578* @see metadata() 1579*/ 1580 1581(function($) { $.extend({ metadata: { defaults: { type: "class", name: "metadata", cre: /({.*})/, single: "metadata" }, setType: function(type, name) { this.defaults.type = type; this.defaults.name = name }, get: function(elem, opts) { var settings = $.extend({}, this.defaults, opts); if (!settings.single.length) { settings.single = "metadata" } var data = $.data(elem, settings.single); if (data) { return data } data = "{}"; var getData = function(data) { if (typeof data != "string") { return data } if (data.indexOf("{") < 0) { data = eval("(" + data + ")") } }; var getObject = function(data) { if (typeof data != "string") { return data } data = eval("(" + data + ")"); return data }; if (settings.type == "html5") { var object = {}; $(elem.attributes).each(function() { var name = this.nodeName; if (name.match(/^data-/)) { name = name.replace(/^data-/, "") } else { return true } object[name] = getObject(this.nodeValue) }) } else { if (settings.type == "class") { var m = settings.cre.exec(elem.className); if (m) { data = m[1] } } else { if (settings.type == "elem") { if (!elem.getElementsByTagName) { return } var e = elem.getElementsByTagName(settings.name); if (e.length) { data = $.trim(e[0].innerHTML) } } else { if (elem.getAttribute != undefined) { var attr = elem.getAttribute(settings.name); if (attr) { data = attr } } } } object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data) } $.data(elem, settings.single, object); return object } } }); $.fn.metadata = function(opts) { return $.metadata.get(this[0], opts) } })(jQuery); 1582 1583 1584 1585/* 1586 * Match Heights jQuery Plugin 1587 * 1588 * Version 1.7.2 (Updated 7/31/2013) 1589 * Copyright (c) 2010-2013 Mike Avello 1590 * Dual licensed under the MIT and GPL licenses: 1591 * http://www.opensource.org/licenses/mit-license.php 1592 * http://www.gnu.org/licenses/gpl.html 1593 * 1594 */ 1595(function (d) { d.fn.matchHeights = function (a) { a = jQuery.extend(this, { minHeight: null, maxHeight: null, extension: 0, overflow: null, includeMargin: !1 }, a); var e = a.extension, b = a.minHeight ? a.minHeight : 0; this.each(function () { b = Math.max(b, d(this).outerHeight()) }); a.maxHeight && b > a.maxHeight && (b = a.maxHeight); return this.each(function () { var c = d(this), f = c.innerHeight() - c.height() + (c.outerHeight(a.includeMargin) - c.innerHeight()); a.overflow ? c.css({ height: b - f + e, overflow: a.overflow }) : c.css({ "min-height": b - f + e }) }) } })(jQuery); 1596 1597 1598 1599/* Copyright (c) 2006 Mathias Bank (http://www.mathias-bank.de) 1600 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 1601 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 1602 * 1603 * Thanks to Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing. 1604 */ 1605jQuery.extend({ 1606/** 1607* Returns get parameters. 1608* 1609* If the desired param does not exist, null will be returned 1610*
1611* @example value = $.getURLParam("paramName"); 1612*/ 1613 getURLParam: function(strParamName){ 1614 var strReturn = ""; 1615 var strHref = window.location.href; 1616 var bFound=false; 1617 1618 var cmpstring = strParamName + "="; 1619 var cmplen = cmpstring.length; 1620 1621 if ( strHref.indexOf("?") > -1 ){ 1622 var strQueryString = strHref.substr(strHref.indexOf("?")+1); 1623 var aQueryString = strQueryString.split("&"); 1624 for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){ 1625 if (aQueryString[iParam].substr(0,cmplen)==cmpstring){ 1626 var aParam = aQueryString[iParam].split("="); 1627 strReturn = aParam[1]; 1628 bFound=true; 1629 break; 1630 } 1631 1632 } 1633 } 1634 if (bFound==false) return null; 1635 return strReturn; 1636 } 1637}); 1638 1639/* 1640 * jQuery blockUI plugin 1641 * Version 2.28 (02-DEC-2009) 1642 * @requires jQuery v1.2.3 or later 1643 * 1644 * Examples at: http://malsup.com/jquery/block/ 1645 * Copyright (c) 2007-2008 M. Alsup 1646 * Dual licensed under the MIT and GPL licenses: 1647 * http://www.opensource.org/licenses/mit-license.php 1648 * http://www.gnu.org/licenses/gpl.html 1649 * 1650 * Thanks to Amir-Hossein Sobhi for some excellent contributions! 1651 */ 1652(function(g){g.fn._fadeIn=g.fn.fadeIn;var i=document.documentMode||0;var d=g.browser.msie&&((g.browser.version<8&&!i)||i<8);var e=g.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!i;g.blockUI=function(o){c(window,o)};g.unblockUI=function(o){h(window,o)};g.growlUI=function(s,q,r,o){var p=g('<div class="growlUI"></div>');if(s){p.append("<h1>"+s+"</h1>")}if(q){p.append("<h2>"+q+"</h2>")}if(r==undefined){r=3000}g.blockUI({message:p,fadeIn:700,fadeOut:1000,centerY:false,timeout:r,showOverlay:false,onUnblock:o,css:g.blockUI.defaults.growlCSS})};g.fn.block=function(o){return this.unblock({fadeOut:0}).each(function(){if(g.css(this,"position")=="static"){this.style.position="relative"}if(g.browser.msie){this.style.zoom=1}c(this,o)})};g.fn.unblock=function(o){return this.each(function(){h(this,o)})};g.blockUI.version=2.28;g.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onUnblock:null,quirksmodeOffsetHack:4};var b=null;var f=[];function c(o,B){var v=(o==window);var r=B&&B.message!==undefined?B.message:undefined;B=g.extend({},g.blockUI.defaults,B||{});B.overlayCSS=g.extend({},g.blockUI.defaults.overlayCSS,B.overlayCSS||{});var x=g.extend({},g.blockUI.defaults.css,B.css||{});var I=g.extend({},g.blockUI.defaults.themedCSS,B.themedCSS||{});r=r===undefined?B.message:r;if(v&&b){h(window,{fadeOut:0})}if(r&&typeof r!="string"&&(r.parentNode||r.jquery)){var D=r.jquery?r[0]:r;var J={};g(o).data("blockUI.history",J);J.el=D;J.parent=D.parentNode;J.display=D.style.display;J.position=D.style.position;if(J.parent){J.parent.removeChild(D)}}var w=B.baseZ;var H=(g.browser.msie||B.forceIframe)?g('<iframe class="blockUI" style="z-index:'+(w++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+B.iframeSrc+'"></iframe>'):g('<div class="blockUI" style="display:none"></div>');var G=g('<div class="blockUI blockOverlay" style="z-index:'+(w++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var F;if(B.theme&&v){var C='<div class="blockUI blockMsg blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+w+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(B.title||" ")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>';F=g(C)}else{F=v?g('<div class="blockUI blockMsg blockPage" style="z-index:'+w+';display:none;position:fixed"></div>'):g('<div class="blockUI blockMsg blockElement" style="z-index:'+w+';display:none;position:absolute"></div>')}if(r){if(B.theme){F.css(I);F.addClass("ui-widget-content")}else{F.css(x)}}if(!B.applyPlatformOpacityRules||!(g.browser.mozilla&&/Linux/.test(navigator.platform))){G.css(B.overlayCSS)}G.css("position",v?"fixed":"absolute");if(g.browser.msie||B.forceIframe){H.css("opacity",0)}g([H[0],G[0],F[0]]).appendTo(v?"body":o);if(B.theme&&B.draggable&&g.fn.draggable){F.draggable({handle:".ui-dialog-titlebar",cancel:"li"})}var q=d&&(!g.boxModel||g("object,embed",v?null:o).length>0);if(e||q){if(v&&B.allowBodyStretch&&g.boxModel){g("html,body").css("height","100%")}if((e||!g.boxModel)&&!v){var A=l(o,"borderTopWidth"),E=l(o,"borderLeftWidth");var u=A?"(0 - "+A+")":0;var y=E?"(0 - "+E+")":0}g.each([H,G,F],function(t,M){var z=M[0].style;z.position="absolute";if(t<2){v?z.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+B.quirksmodeOffsetHack+') + "px"'):z.setExpression("height",'this.parentNode.offsetHeight + "px"');v?z.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):z.setExpression("width",'this.parentNode.offsetWidth + "px"');if(y){z.setExpression("left",y)}if(u){z.setExpression("top",u)}}else{if(B.centerY){if(v){z.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}z.marginTop=0}else{if(!B.centerY&&v){var K=(B.css&&B.css.top)?parseInt(B.css.top):0;var L="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+K+') + "px"';z.setExpression("top",L)}}}})}if(r){if(B.theme){F.find(".ui-widget-content").append(r)}else{F.append(r)}if(r.jquery||r.nodeType){g(r).show()}}if((g.browser.msie||B.forceIframe)&&B.showOverlay){H.show()}
1652if(B.fadeIn){if(B.showOverlay){G._fadeIn(B.fadeIn)}if(r){F.fadeIn(B.fadeIn)}}else{if(B.showOverlay){G.show()}if(r){F.show()}}k(1,o,B);if(v){b=F[0];f=g(":input:enabled:visible",b);if(B.focusInput){setTimeout(n,20)}}else{a(F[0],B.centerX,B.centerY)}if(B.timeout){var p=setTimeout(function(){v?g.unblockUI(B):g(o).unblock(B)},B.timeout);g(o).data("blockUI.timeout",p)}}function h(r,s){var q=(r==window);var p=g(r);var t=p.data("blockUI.history");var u=p.data("blockUI.timeout");if(u){clearTimeout(u);p.removeData("blockUI.timeout")}s=g.extend({},g.blockUI.defaults,s||{});k(0,r,s);var o;if(q){o=g("body").children().filter(".blockUI").add("body > .blockUI")}else{o=g(".blockUI",r)}if(q){b=f=null}if(s.fadeOut){o.fadeOut(s.fadeOut);setTimeout(function(){j(o,t,s,r)},s.fadeOut)}else{j(o,t,s,r)}}function j(o,r,q,p){o.each(function(s,t){if(this.parentNode){this.parentNode.removeChild(this)}});if(r&&r.el){r.el.style.display=r.display;r.el.style.position=r.position;if(r.parent){r.parent.appendChild(r.el)}g(p).removeData("blockUI.history")}if(typeof q.onUnblock=="function"){q.onUnblock(p,q)}}function k(o,s,t){var r=s==window,q=g(s);if(!o&&(r&&!b||!r&&!q.data("blockUI.isBlocked"))){return}if(!r){q.data("blockUI.isBlocked",o)}if(!t.bindEvents||(o&&!t.showOverlay)){return}var p="mousedown mouseup keydown keypress";o?g(document).bind(p,t,m):g(document).unbind(p,m)}function m(r){if(r.keyCode&&r.keyCode==9){if(b&&r.data.constrainTabKey){var q=f;var p=!r.shiftKey&&r.target==q[q.length-1];var o=r.shiftKey&&r.target==q[0];if(p||o){setTimeout(function(){n(o)},10);return false}}}if(g(r.target).parents("div.blockMsg").length>0){return true}return g(r.target).parents().children().filter("div.blockUI").length==0}function n(o){if(!f){return}var p=f[o===true?f.length-1:0];if(p){try{p.focus()}catch(ex){}}}function a(v,o,z){var w=v.parentNode,u=v.style;var q=((w.offsetWidth-v.offsetWidth)/2)-l(w,"borderLeftWidth");var r=((w.offsetHeight-v.offsetHeight)/2)-l(w,"borderTopWidth");if(o){u.left=q>0?(q+"px"):"0"}if(z){u.top=r>0?(r+"px"):"0"}}function l(o,q){return parseInt(g.css(o,q))||0}})(jQuery); 1653 1654/* 1655Simple function to use POST with JSON using same implementation as $.getJSON 1656*/ 1657$.extend({ postJSON: function(url, callback) { $.post(url, null, callback, "json"); } }); 1658 1659 1660/** 1661* Ajax Autocomplete for jQuery, version 1.1.3 1662* (c) 2010 Tomas Kirda 1663* 1664* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license. 1665* For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/ 1666* 1667* Last Review: 07/12/2012 1668* - EP: Modified default z-index 1669* 1670* 08/28/2011 1671* - EP: Fixed issue with DeferRequestBy and Auto Suggest not getting fired. 1672* - EP: Added Loading icon. 1673* - EP: Added SiteId and WebService mode. 1674*/ 1675 1676(function ($) { function Autocomplete(a, b) { this.el = $(a); this.el.attr("autocomplete", "off"); this.suggestions = []; this.data = []; this.badQueries = []; this.selectedIndex = -1; this.currentValue = this.el.val(); this.intervalId = 0; this.cachedResponse = []; this.onChangeInterval = null; this.ignoreValueChange = false; this.serviceUrl = b.serviceUrl; this.isLocal = false; this.options = { autoSubmit: false, minChars: 1, maxHeight: 300, deferRequestBy: 0, width: 0, highlight: true, params: {}, fnFormatResult: fnFormatResult, delimiter: null, zIndex: 99999999999, webServiceCall: false, webServiceParams: "", siteId: 0 }; this.initialize(); this.setOptions(b) } function fnFormatResult(a, b, c) { var d = "(" + c.replace(reEscape, "\\$1") + ")"; return a.replace(new RegExp(d, "gi"), "<strong>$1</strong>") } var reEscape = new RegExp("(\\" + ["/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\"].join("|\\") + ")", "g"); $.fn.autocomplete = function (a) { return new Autocomplete(this.get(0) || $("<input />"), a) }; Autocomplete.prototype = { killerFn: null, initialize: function () { var a, b, c; a = this; b = Math.floor(Math.random() * 1048576).toString(16); c = "Autocomplete_" + b; this.killerFn = function (b) { if ($(b.target).parents(".autocomplete").size() === 0) { a.killSuggestions(); a.disableKillerFn() } }; if (!this.options.width) { this.options.width = this.el.width() } this.mainContainerId = "AutocompleteContainer_" + b; $('<div id="' + this.mainContainerId + '" style="position:absolute;z-index:99999999999;"><div class="autocomplete-w1"><div class="autocomplete" id="' + c + '" style="display:none; width:300px;"></div></div></div>').appendTo("body"); this.container = $("#" + c); this.fixPosition(); if (window.opera) { this.el.keypress(function (b) { a.onKeyPress(b) }) } else { this.el.keydown(function (b) { a.onKeyPress(b) }) } this.el.keyup(function (b) { a.onKeyUp(b) }); this.el.blur(function () { a.enableKillerFn() }); this.el.focus(function () { a.fixPosition() }) }, setOptions: function (a) { var b = this.options; $.extend(b, a); if (b.lookup) { this.isLocal = true; if ($.isArray(b.lookup)) { b.lookup = { suggestions: b.lookup, data: [] } } } $("#" + this.mainContainerId).css({ zIndex: b.zIndex }); this.container.css({ maxHeight: b.maxHeight + "px", width: b.width }) }, clearCache: function () { this.cachedResponse = []; this.badQueries = [] }, disable: function () { this.disabled = true }, enable: function () { this.disabled = false }, fixPosition: function () { var a = this.el.offset(); $("#" + this.mainContainerId).css({ top: a.top + this.el.innerHe
1676ight() + "px", left: a.left + "px" }) }, enableKillerFn: function () { var a = this; $(document).bind("click", a.killerFn) }, disableKillerFn: function () { var a = this; $(document).unbind("click", a.killerFn) }, killSuggestions: function () { var a = this; this.stopKillSuggestions(); this.intervalId = window.setInterval(function () { a.hide(); a.stopKillSuggestions() }, 300) }, stopKillSuggestions: function () { window.clearInterval(this.intervalId) }, onKeyPress: function (a) { if (this.disabled || !this.enabled) { return } switch (a.keyCode) { case 27: this.el.val(this.currentValue); this.hide(); break; case 9: case 13: if (this.selectedIndex === -1) { this.hide(); return } this.select(this.selectedIndex); if (a.keyCode === 9) { return } break; case 38: this.moveUp(); break; case 40: this.moveDown(); break; default: return } a.stopImmediatePropagation(); a.preventDefault() }, onKeyUp: function (a) { if (this.disabled) { return } switch (a.keyCode) { case 38: case 40: return } clearInterval(this.onChangeInterval); if (this.options.deferRequestBy == 0 && this.currentValue !== this.el.val()) { this.onValueChange() } else { var b = this; this.onChangeInterval = setInterval(function () { b.onValueChange() }, this.options.deferRequestBy) } }, onValueChange: function () { clearInterval(this.onChangeInterval); this.currentValue = this.el.val(); var a = this.getQuery(this.currentValue); this.selectedIndex = -1; if (this.ignoreValueChange) { this.ignoreValueChange = false; return } if (a === "" || a.length < this.options.minChars) { this.hide() } else { this.getSuggestions(a) } }, getQuery: function (a) { var b, c; b = this.options.delimiter; if (!b) { return $.trim(a) } c = a.split(b); return $.trim(c[c.length - 1]) }, getSuggestionsLocal: function (a) { var b, c, d, e, f; c = this.options.lookup; d = c.suggestions.length; b = { suggestions: [], data: [] }; a = a.toLowerCase(); for (f = 0; f < d; f++) { e = c.suggestions[f]; if (e.toLowerCase().indexOf(a) === 0) { b.suggestions.push(e); b.data.push(c.data[f]) } } return b }, getSuggestions: function (a) { var b, c; b = this.isLocal ? this.getSuggestionsLocal(a) : this.cachedResponse[a]; if (b && $.isArray(b.suggestions)) { this.suggestions = b.suggestions; this.data = b.data; this.suggest() } else if (!this.isBadQuery(a)) { c = this; c.options.params.query = a; this.setLoadingStyle(); if (!c.options.webServiceCall) { $.get(this.serviceUrl, c.options.params, function (a) { c.clearLoadingStyle(); c.processResponse(a) }, "text") } else { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: this.serviceUrl, data: "{'q': '" + a + "', p: '" + c.options.webServiceParams + "', s: " + c.options.siteId + " }", dataType: "json", success: function (a) { c.clearLoadingStyle(); c.processResponse(a.d) } }) } } }, setLoadingStyle: function () { this.el.css("background", "url('/cms/images/ajaxloading5.gif') no-repeat right") }, clearLoadingStyle: function () { this.el.css("background", "") }, isBadQuery: function (a) { var b = this.badQueries.length; while (b--) { if (a.indexOf(this.badQueries[b]) === 0) { return true } } return false }, hide: function () { this.enabled = false; this.selectedIndex = -1; this.container.hide() }, suggest: function () { if (this.suggestions.length === 0) { this.hide(); return } var a, b, c, d, e, f, g, h, i; a = this; b = this.suggestions.length; d = this.options.fnFormatResult; e = this.getQuery(this.currentValue); h = function (b) { return function () { a.activate(b) } }; i = function (b) { return function () { a.select(b) } }; this.container.hide().empty(); for (f = 0; f < b; f++) { g = this.suggestions[f]; c = $((a.selectedIndex === f ? '<div class="selected"' : "<div") + ' title="' + g + '">' + d(g, this.data[f], e) + "</div>"); c.mouseover(h(f)); c.click(i(f)); this.container.append(c) } this.enabled = true; this.container.show() }, processResponse: function (text) { var response; if (!this.options.webServiceCall) { try { response = eval("(" + text + ")") } catch (err) { return } } else { response = text } if (!response) return; if (!$.isArray(response.data)) { response.data = [] } if (!this.options.noCache) { this.cachedResponse[response.query] = response; if (response.suggestions.length === 0) { this.badQueries.push(response.query) } } if (response.query === this.getQuery(this.currentValue)) { this.suggestions = response.suggestions; this.data = response.data; this.suggest() } }, activate: function (a) { var b, c; b = this.container.children(); if (this.selectedIndex !== -1 && b.length > this.selectedIndex) { $(b.get(this.selectedIndex)).removeClass() } this.selectedIndex = a; if (this.selectedIndex !== -1 && b.length > this.selectedIndex) { c = b.get(this.selectedIndex); $(c).addClass("selected") } return c }, deactivate: function (a, b) { a.className = ""; if (this.selectedIndex === b) { this.selectedIndex = -1 } }, select: function (a) { var b, c; b = this.suggestions[a]; if (b) { this.el.val(b); if (this.options.autoSubmit) { c = this.el.parents("form"); if (c.length > 0) { c.get(0).submit() } } this.ignoreValueChange = true; this.hide(); this.onSelect(a) } }, moveUp: function () { if (this.selectedIndex === -1) { return } if (this.selectedIndex === 0) { this.container.children().get(0).className = ""; this.selectedIndex = -1; this.el.val(this.currentValue); return } this.adjustScroll(this.selectedIndex - 1) }, moveDown: function () { if (this.selectedIndex === this.suggestions.length - 1) { return } this.adjustScroll(this.selectedIndex + 1) }, adjustScroll: function (a) { var b, c, d, e; b = this.activate(a);
1676 c = b.offsetTop; d = this.container.scrollTop(); e = d + this.options.maxHeight - 25; if (c < d) { this.container.scrollTop(c) } else if (c > e) { this.container.scrollTop(c - this.options.maxHeight + 25) } this.el.val(this.getValue(this.suggestions[a])) }, onSelect: function (a) { var b, c, d, e; b = this; c = b.options.onSelect; d = b.suggestions[a]; e = b.data[a]; b.el.val(b.getValue(d)); if ($.isFunction(c)) { c(d, e, b.el) } }, getValue: function (a) { var b, c, d, e; e = this; b = e.options.delimiter; if (!b) { return a } c = e.currentValue; d = c.split(b); if (d.length === 1) { return a } return c.substr(0, c.length - d[d.length - 1].length) + a } } })(jQuery); 1677 1678/** 1679* @author Remy Sharp 1680* @url http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/ 1681*/ 1682 1683(function ($) { 1684 1685$.fn.hint = function (blurClass) { 1686 if (!blurClass) { 1687 blurClass = 'blur'; 1688 } 1689 1690 return this.each(function () { 1691 // get jQuery version of 'this' 1692 var $input = $(this), 1693 1694 // capture the rest of the variable to allow for reuse 1695 title = $input.attr('title'), 1696 $form = $(this.form), 1697 $win = $(window); 1698 1699 function remove() { 1700 if ($input.val() === title && $input.hasClass(blurClass)) { 1701 $input.val('').removeClass(blurClass); 1702 } 1703 } 1704 1705 // only apply logic if the element has the attribute 1706 if (title) { 1707 // on blur, set value to title attr if text is blank 1708 $input.blur(function () { 1709 if (this.value === '') { 1710 $input.val(title).addClass(blurClass); 1711 } 1712 }).focus(remove).blur(); // now change all inputs to title 1713 1714 // clear the pre-defined text when form is submitted 1715 $form.submit(remove); 1716 $win.unload(remove); // handles Firefox's autocomplete 1717 } 1718 }); 1719}; 1720 1721})(jQuery); 1722 1723 1724/* Enables the use of the following console commands using failsafe 1725* methods to prevent conflicts in non-supported browers: 1726* 1727* logger.log = console.log 1728* logger.debug = console.debug 1729* logger.warn = console.warn 1730* logger.error = console.error 1731*/ 1732var logger={log:function(a){void 0!=window.console&&console.log(a)},debug:function(a){void 0!=window.console&&console.log(a)},warn:function(a){void 0!=window.console&&console.warn(a)},error:function(a){void 0!=window.console&&console.error(a)}}; 1733 1734/* 1735* jQuery hashchange event - v1.3 - 7/21/2010 1736* http://benalman.com/projects/jquery-hashchange-plugin/ 1737* 1738 * Copyright (c) 2010 "Cowboy" Ben Alman 1739* Dual licensed under the MIT and GPL licenses. 1740* http://benalman.com/about/license/ 1741*/ 1742(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this); 1743 1744 1745/************************/ 1746/* Custom Plugins Below */ 1747/************************/ 1748 1749/* Courtesy of JR */ 1750(function ($, undefined) { 1751 $.fn.bindEnterToButton = function () { 1752 var buttonSelector = arguments[0]; 1753 var selectedObjs = this; 1754 selectedObjs.each(function (txtInput) { 1755 $(selectedObjs[txtInput]).keyup(function (keyupEvent) { 1756 if (keyupEvent.which == 13) { 1757 keyupEvent.preventDefault(); 1758 $(buttonSelector).click(); 1759 } 1760 }); 1761 }); 1762 } 1763})(jQuery); 1764 1765 1766/*! Magnific Popup - v1.1.0 - 2016-02-20
vendor: 4,980 bytes, lines 1767-1769
1767* http://dimsemenov.com/plugins/magnific-popup/ 1768* Copyright (c) 2016 Dmitry Semenov; */ 1769!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)}
1769,updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close"><span aria-hidden="true">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1
1769));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;
1769var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></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 c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});
1769var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{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(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.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 c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()}); 1770 1771/*! ________________ 1772* ___ ____/_ __ \ 1773* __ /_ _ / / / 1774* _ __/ / /_/ / 1775* /_/ \____/ 1776* Focus Overlay 1777* 1778* Version: 0.9.2 1779* Author: Maurice Mahan 1780* License: MIT 1781* Repo: https://github.com/MauriceMahan/FocusOverlay 1782*/ 1783!function(e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t,window)}):"object"==typeof module&&module.exports?module.exports=function(t,o){return void 0===o&&(o="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(o,window),o}:e(jQuery,window)}(function(e,t){function o(t,o){var n=this;
1783n.active=!1,n.$el=e(t),n.$focusBox=e("<div aria-hidden='true' />"),n.$previousTarget,n.$nextTarget,n.timeout=0,n.inScope=!1,n.transitionEvent=n._whichTransitionEvent(),n.options=e.extend({},e.fn.focusOverlay.defaults,o),n.onFocusHandler=e.proxy(n.onFocusHandler,n),n.createFocusBox=e.proxy(n.createFocusBox,n),n.onKeyDownHandler=e.proxy(n.onKeyDownHandler,n),n._repositionBox=e.proxy(n._repositionBox,n),n.moveFocusBox=e.proxy(n.moveFocusBox,n),n.cleanup=e.proxy(n.cleanup,n),n.stop=e.proxy(n.stop,n),n.destroy=e.proxy(n.destroy,n),n.init()}o.prototype={init:function(){var e=this;e.options.alwaysActive?(e.active=!0,t.addEventListener("focus",e.onFocusHandler,!0)):(t.addEventListener("keydown",e.onKeyDownHandler,!1),e.options.inactiveOnClick&&t.addEventListener("mousedown",e.stop,!1)),e.createFocusBox(),e.$el.trigger("foInit",[e])},onKeyDownHandler:function(o){var n=this,i=o.which;e.inArray(i,n.options.triggerKeys)>=0?!1===n.active&&(n.active=!0,t.addEventListener("focus",n.onFocusHandler,!0)):n.options.inactiveOnNonTriggerKey&&n.stop()},createFocusBox:function(){var e=this;e.$focusBox.appendTo(e.$el).attr("id",e.options.id).css({position:"absolute",zIndex:e.options.zIndex,pointerEvents:"none"})},cleanup:function(){var e=this;null!=e.$nextTarget&&(e.$previousTarget=e.$nextTarget,e.$previousTarget.removeClass(e.options.targetClass),e.transitionEvent&&e.options.watchTransitionEnd&&e.$previousTarget[0].removeEventListener(e.transitionEvent,e._repositionBox))},onFocusHandler:function(t){var o=this,n=e(t.target);if(o.cleanup(),n.closest(o.$el).length>0){var i=o.$nextTarget,r=o.$previousTarget;if(o.inScope=!0,n.data("focus"))o.$nextTarget=e(n.data("focus")).first();else if(n.is("[data-focus-label]"))o.$nextTarget=e("[for='"+n.attr("id")+"']");else{if(n.is("[data-focus-ignore]"))return;o.$nextTarget=n}clearTimeout(o.timeout),o.transitionEvent&&o.options.watchTransitionEnd&&o.$nextTarget[0].addEventListener(o.transitionEvent,o._repositionBox),o.$el.trigger("foBeforeMove",[o,r,i,o.$nextTarget]),o.moveFocusBox(o.$nextTarget)}else o.options.alwaysActive?o.inScope=!1:(o.inScope=!1,o.stop())},stop:function(){var e=this;e.active=!1,t.removeEventListener("focus",e.onFocusHandler,!0),e.cleanup(),e.$focusBox.removeClass(e.options.activeClass)},moveFocusBox:function(e){var t=this;if(e.addClass(t.options.targetClass),e.length>0&&e[0]instanceof Element){var o=t._getAbsoluteBoundingRect(e[0]),n=o.width,i=o.height,r=o.left,s=o.top;t.$focusBox.addClass(t.options.animatingClass).addClass(t.options.activeClass).css({width:n,height:i,left:r,top:s}),t.timeout=setTimeout(function(){t.$focusBox.removeClass(t.options.animatingClass),t.options.inactiveAfterDuration&&t.$focusBox.removeClass(t.options.activeClass),t.$el.trigger("foAfterMove",[t,t.$previousTarget,e])},t.options.duration)}else t.cleanup()},_repositionBox:function(t){var o=this,n=e(t.target);o.moveFocusBox(n)},destroy:function(){var e=this;e.$el.removeData(),e.$focusBox.remove(),null!=e.$previousTarget&&e.$previousTarget.removeClass(e.options.targetClass),null!=e.$nextTarget&&e.$nextTarget.removeClass(e.options.targetClass),t.removeEventListener("focus",e.onFocusHandler,!0),t.removeEventListener("keydown",e.onKeyDown
1783Handler,!1),t.removeEventListener("mousedown",e.stop,!1),e.$el.trigger("foDestroyed",[e])},_getAbsoluteBoundingRect:function(e){var o=document,n=t,i=o.body,r=void 0!==n.pageXOffset?n.pageXOffset:(o.documentElement||i.parentNode||i).scrollLeft,s=void 0!==n.pageYOffset?n.pageYOffset:(o.documentElement||i.parentNode||i).scrollTop,a=e.getBoundingClientRect();if(e!==i)for(var c=e.parentNode;c!==i&&c;)r+=c.scrollLeft,s+=c.scrollTop,c=c.parentNode;return{bottom:a.bottom+s,height:a.height,left:a.left+r,right:a.right+r,top:a.top+s,width:a.width}},_whichTransitionEvent:function(){var e,t=document.createElement("fakeelement"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(void 0!==t.style[e])return o[e]}},e.fn.focusOverlay=function(t){var n=arguments;if(void 0===t||"object"==typeof t)return this.each(function(){e.data(this,"plugin_"+o)||e.data(this,"plugin_"+o,new o(this,t))});if("string"==typeof t&&"_"!==t[0]&&"init"!==t){if(0==Array.prototype.slice.call(n,1).length&&-1!=e.inArray(t,e.fn.focusOverlay.getters)){var i=e.data(this[0],"plugin_"+o);return i[t].apply(i,Array.prototype.slice.call(n,1))}return this.each(function(){var i=e.data(this,"plugin_"+o);i instanceof o&&"function"==typeof i[t]&&i[t].apply(i,Array.prototype.slice.call(n,1))})}},e.fn.focusOverlay.getters=["destroy"],e.fn.focusOverlay.defaults={id:"focus-overlay",activeClass:"focus-overlay-active",animatingClass:"focus-overlay-animating",targetClass:"focus-overlay-target",zIndex:9001,duration:500,inactiveAfterDuration:!1,triggerKeys:[9,36,37,38,39,40,13,32,16,17,18,27],inactiveOnNonTriggerKey:!0,inactiveOnClick:!0,alwaysActive:!1,watchTransitionEnd:!0}}); 1784 1785
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.