1// Password show/hide toggle for .dn-password-wrapper elements. 2// Usage: wrap any password input in <span class="dn-password-wrapper">...</span> 3// The toggle button is auto-injected by this script â no extra markup needed. 4// Icons served from /images/icons/eye-open.svg and eye-closed.svg via CSS mask-image. 5(function() { 6 if (window._dnPasswordToggleInit) return; 7 window._dnPasswordToggleInit = true; 8 9 function initToggles(root) { 10 var wrappers = (root || document).querySelectorAll('.dn-password-wrapper'); 11 for (var i = 0; i < wrappers.length; i++) { 12 if (wrappers[i]._dnToggleInjected) continue; 13 wrappers[i]._dnToggleInjected = true; 14 var btn = document.createElement('button'); 15 btn.type = 'button'; 16 btn.className = 'dn-password-toggle'; 17 btn.setAttribute('aria-label', 'Show password'); 18 var icon = document.createElement('span'); 19 icon.className = 'dn-password-toggle-icon'; 20 btn.appendChild(icon); 21 btn.addEventListener('click', function(e) { 22 e.preventDefault(); 23 var wrapper = this.closest('.dn-password-wrapper'); 24 if (!wrapper) return; 25 var input = wrapper.querySelector('input'); 26 if (!input) return; 27 if (input.type === 'password') { 28 input.type = 'text'; 29 this.classList.add('dn-showing'); 30 this.setAttribute('aria-label', 'Hide password'); 31 } else { 32 input.type = 'password'; 33 this.classList.remove('dn-showing'); 34 this.setAttribute('aria-label', 'Show password'); 35 } 36 }); 37 wrappers[i].appendChild(btn); 38 } 39 } 40 41 // Init on DOM ready 42 if (document.readyState === 'loading') { 43 document.addEventListener('DOMContentLoaded', function() { initToggles(); }); 44 } else { 45 initToggles(); 46 } 47 48 // Expose for dynamic content (popups, AJAX) 49 window.dnInitPasswordToggles = initToggles; 50})(); 51 52 53 54var pwCurData = { 1: ["United States Dollar", "USD", "$", 1.0, true, [], 2], 2: ["Australian Dollar", "AUD", "$", 1.4233639433, true, [], 2], 12: ["United Kingdom Pound", "GBP", "£", 0.754931287, true, [], 2], 22: ["Japan Yen", "JPY", "Â¥", 157.2947503008, true, [], 0], 32: ["Canada Dollar ", "CAD", "$", 1.4141823997, true, [], 2], 42: ["United Arab Emirates Dirhams", "AED", "$", 3.6725, false, [], 2], 52: ["Afghanistan Afghanis", "AFN", "$", 64.8684221133, false, [], 2], 62: ["Albania Leke", "ALL", "$", 80.7238811549, false, [], 2], 72: ["Armenia Drams", "AMD", "$", 363.5428654356, false, [], 2], 82: ["Netherlands Antilles Guilders", "ANG", "$", 1.7975511229, false, [], 2], 92: ["Angola Kwanza", "AOA", "$", 918.1903643042, false, [], 2], 102: ["Argentina Pesos", "ARS", "$", 1524.7675936551, false, [], 2], 112: ["Aruba Guilders", "AWG", "$", 1.79, false, [], 2], 122: ["Azerbaijan New Manats", "AZN", "$", 1.7020202278, false, [], 2], 132: ["Bosnia and Herzegovina Convertible Marka", "BAM", "$", 1.716956067, false, [], 2], 142: ["Barbados Dollars", "BBD", "$", 2.0, false, [], 2], 152: ["Bangladesh Taka", "BDT", "$", 123.2294392915, false, [], 2], 162: ["Bulgaria Leva", "BGN", "$", 1.716956067, false, [], 2], 172: ["Bahrain Dinars", "BHD", "$", 0.376, false, [], 2], 182: ["Burundi Francs", "BIF", "$", 2997.2868193631, false, [], 2], 192: ["Bermuda Dollars", "BMD", "$", 1.0, false, [], 2], 202: ["Brunei Dollars", "BND", "$", 1.2776280057, false, [], 2], 212: ["Bolivia Bolivianos", "BOB", "R$", 12.2279799035, false, [], 2], 222: ["Brazil Reais", "BRL", "R$", 5.1845295757, false, [], 2], 232: ["Bahamas Dollars", "BSD", "$", 1.0, false, [], 2], 242: ["Bhutan Ngultrum", "BTN", "$", 95.7375940113, false, [], 2], 252: ["Botswana Pulas", "BWP", "$", 13.5977527239, false, [], 2], 262: ["Belarus Rubles", "BYR", "$", 30193.9887831177, false, [], 2], 272: ["Belize Dollars", "BZD", "$", 2.0157395361, false, [], 2], 282: ["Congo/Kinshasa Francs", "CDF", "$", 2281.2302152192, false, [], 2], 292: ["Switzerland Francs", "CHF", "CHF", 0.8286035623, false, [], 2], 302: ["Chile Pesos", "CLP", "$", 961.6543521287, false, [], 2], 312: ["China Yuan Renminbi", "CNY", "Â¥", 6.7137201625, false, [], 2], 322
54: ["Colombia Pesos", "COP", "$", 3306.275743096, false, [], 2], 332: ["Costa Rica Colones", "CRC", "$", 453.5511361479, false, [], 2], 342: ["Cuba Convertible Pesos", "CUC", "$", 1.0, false, [], 2], 352: ["Cuba Pesos", "CUP", "$", 23.8953577514, false, [], 2], 362: ["Cape Verde Escudos", "CVE", "$", 96.802250457, false, [], 2], 372: ["Czech Republic Koruny", "CZK", "KÄ", 21.3834465127, false, [], 2], 382: ["Djibouti Francs", "DJF", "$", 178.4243298082, false, [], 2], 392: ["Denmark Kroner", "DKK", "", 6.5625999998, false, [], 2], 402: ["Dominican Republic Pesos", "DOP", "$", 59.4574818981, false, [], 2], 412: ["Algeria Dinars", "DZD", "$", 133.8043915239, false, [], 2], 422: ["Estonia Krooni", "EEK", "$", 14.1507464649, false, [], 2], 432: ["Egypt Pounds", "EGP", "E£", 51.7866732479, false, [], 2], 442: ["Eritrea Nakfa", "ERN", "$", 15.0, false, [], 2], 452: ["Ethiopia Birr", "ETB", "$", 162.0390797584, false, [], 2], 462: ["Euro", "EUR", "â¬", 0.8778656974, true, [], 2], 472: ["Fiji Dollars", "FJD", "$", 2.2472738657, false, [], 2], 482: ["Falkland Islands Pounds", "FKP", "$", 0.754931287, false, [], 2], 492: ["Georgia Lari", "GEL", "$", 2.6007373957, false, [], 2], 502: ["Guernsey Pounds", "GGP", "$", 0.754931287, false, [], 2], 512: ["Ghana Cedis", "GHS", "$", 11.6154705738, false, [], 2], 522: ["Gibraltar Pounds", "GIP", "$", 0.754931287, false, [], 2], 532: ["Gambia Dalasi", "GMD", "$", 73.8833550856, false, [], 2], 542: ["Guinea Francs", "GNF", "$", 8806.8600236545, false, [], 2], 552: ["Guatemala Quetzales", "GTQ", "$", 7.6369846211, false, [], 2], 562: ["Guyana Dollars", "GYD", "$", 209.1954989075, false, [], 2], 572: ["Hong Kong Dollars", "HKD", "$", 7.8441941966, false, [], 2], 582: ["Honduras Lempiras", "HNL", "$", 26.9087130446, false, [], 2], 592: ["Croatia Kuna", "HRK", "$", 6.6142790974, false, [], 2], 602: ["Haiti Gourdes", "HTG", "$", 131.8225909399, false, [], 2], 612: ["Hungary Forint", "HUF", "$", 320.5709507738, false, [], 0], 622: ["Indonesia Rupiahs", "IDR", "RP", 17897.4995690699, false, [], 2], 632: ["Israel New Shekels", "ILS", "âª", 3.0405632606, false, [], 2], 642: ["Isle of Man Pounds", "IMP", "$", 0.754931287, false, [], 2], 652: ["India Rupees", "INR", "Rs", 95.7375940113, false, [], 2], 662: ["Iraq Dinars", "IQD", "$", 1310.2597807972, false, [], 2], 672: ["Iran Rials", "IRR", "$", 1371426.9944310463, false, [], 2], 682: ["Iceland Kronur", "ISK", "$", 120.2353578026, false, [], 2], 692: ["Jersey Pounds", "JEP", "$", 0.754931287, false, [], 2], 702: ["Jamaica Dollars", "JMD", "$", 158.0227029267, false, [], 2], 712: ["Jordan Dinars", "JOD", "JOR", 0.709, false, [], 2], 722: ["Kenya Shillings", "KES", "", 129.5973762758, false, [], 2], 732: ["Kyrgyzstan Soms", "KGS", "$", 87.4615752998, false, [], 2], 742: ["Cambodia Riels", "KHR", "$", 4060.663018809, false, [], 2], 752: ["Comoros Francs", "KMF", "$", 431.8816119731, false, [], 2], 762: ["North Korea Won", "KPW", "$", 900.0049613483, false, [], 2], 772: ["South Korea Won", "KRW", "$", 1354.9828722292, false, [], 2], 782: ["Kuwait Dinars", "KWD", "$", 0.3086096786, false, [], 2], 792: ["Cayman Islands Dollars", "KYD", "$", 0.8205291505, false, [], 2], 802: ["Kazakhstan Tenge", "KZT", "$", 442.5423043791, false, [], 2], 812: ["Laos Kips", "LAK", "$", 22362.2754815259, false, [], 2], 822: ["Lebanon Pounds", "LBP", "$", 89695.9957998597, false, [], 2], 832: ["Sri Lanka Rupees", "LKR", "$", 330.0312645903, false, [], 2], 842: ["
54Liberia Dollars", "LRD", "$", 172.3058031207, false, [], 2], 852: ["Lesotho Maloti", "LSL", "$", 16.3100635135, false, [], 2], 862: ["Lithuania Litai", "LTL", "$", 3.1226958244, false, [], 2], 872: ["Latvia Lati", "LVL", "$", 0.6356089624, false, [], 2], 882: ["Libya Dinars", "LYD", "$", 6.3894300212, false, [], 2], 892: ["Morocco Dirhams", "MAD", "", 9.6050367565, false, [], 2], 902: ["Moldova Lei", "MDL", "$", 17.702890654, false, [], 2], 912: ["Madagascar Ariary", "MGA", "$", 4414.0880405306, false, [], 2], 922: ["Macedonia Denars", "MKD", "$", 54.0078752086, false, [], 2], 932: ["Myanmar Kyats", "MMK", "$", 2099.6791583787, false, [], 2], 942: ["Mongolia Tugriks", "MNT", "$", 3596.6708669491, false, [], 2], 952: ["Macau Patacas", "MOP", "$", 8.0795200225, false, [], 2], 962: ["Mauritania Ouguiyas", "MRO", "$", 401.3806665507, false, [], 2], 972: ["Mauritius Rupees", "MUR", "$", 47.5233912338, false, [], 2], 982: ["Maldives Rufiyaa", "MVR", "$", 15.4593042695, false, [], 2], 992: ["Malawi Kwachas", "MWK", "$", 1732.7683057575, false, [], 2], 1002: ["Mexico Pesos", "MXN", "$", 17.6806552867, false, [], 2], 1012: ["Malaysia Ringgits", "MYR", "RM", 4.0746419586, false, [], 2], 1022: ["Mozambique Meticais", "MZN", "$", 63.7743404973, false, [], 2], 1032: ["Namibia Dollars", "NAD", "$", 16.3100635135, false, [], 2], 1042: ["Nigeria Nairas", "NGN", "N", 1329.1147642993, false, [], 2], 1052: ["Nicaragua Cordobas", "NIO", "$", 36.6710989125, false, [], 2], 1062: ["Norway Kroner", "NOK", "kr", 9.5078597509, false, [], 2], 1072: ["Nepal Rupees", "NPR", "$", 153.2519536136, false, [], 2], 1082: ["New Zealand Dollars", "NZD", "$", 1.7653015226, false, [], 2], 1092: ["Oman Rials", "OMR", "$", 0.3850530131, false, [], 2], 1102: ["Panama Balboas", "PAB", "$", 1.0, false, [], 2], 1112: ["Peru Nuevos Soles", "PEN", "$", 3.3913123238, false, [], 2], 1122: ["Papua New Guinea Kina", "PGK", "$", 4.3385023246, false, [], 2], 1132: ["Philippines Pesos", "PHP", "", 62.4442527258, false, [], 2], 1142: ["Pakistan Rupees", "PKR", "", 277.2592137463, false, [], 2], 1152: ["Poland Zlotych", "PLN", "", 3.8377588836, false, [], 2], 1162: ["Paraguay Guarani", "PYG", "$", 5906.7618821655, false, [], 2], 1172: ["Qatar Riyals", "QAR", "$", 3.64, false, [], 2], 1182: ["Romania New Lei", "RON", "L", 4.6290528359, false, [], 2], 1192: ["Serbia Dinars", "RSD", "$", 103.1001828484, false, [], 2], 1202: ["Russia Rubles", "RUB", "$", 84.2084771456, false, [], 2], 1212: ["Rwanda Francs", "RWF", "$", 1474.3757957027, false, [], 2], 1222: ["Saudi Arabia Riyals", "SAR", "SAR", 3.75, false, [], 2], 1232: ["Solomon Islands Dollars", "SBD", "$", 8.0368994294, false, [], 2], 1242: ["Seychelles Rupees", "SCR", "$", 14.4252626178, false, [], 2], 1252: ["Sudan Pounds", "SDG", "$", 600.1943797475, false, [], 2], 1262: ["Sweden Kronor", "SEK", "kr", 9.9184008966, false, [], 2], 1272: ["Singapore Dollars", "SGD", "$", 1.2776280057, false, [], 2], 1282: ["Saint Helena Poun
54ds", "SHP", "$", 0.754931287, false, [], 2], 1292: ["Slovakia Koruny", "SKK", "$", 22.9058089417, false, [], 2], 1302: ["Sierra Leone Leones", "SLL", "$", 22929.9972858445, false, [], 2], 1312: ["Somalia Shillings", "SOS", "$", 571.4658964935, false, [], 2], 1322: ["Seborga Luigini", "SPL", "$", 0.166666666, false, [], 2], 1332: ["Suriname Dollars", "SRD", "$", 37.6903009782, false, [], 2], 1342: ["São Tome and Principe Dobras", "STD", "$", 21510.4289521972, false, [], 2], 1352: ["El Salvador Colones", "SVC", "$", 8.75, false, [], 2], 1362: ["Syria Pounds", "SYP", "$", 121.4879456012, false, [], 2], 1372: ["Swaziland Emalangeni", "SZL", "$", 16.3100635135, false, [], 2], 1382: ["Thailand Baht", "THB", "", 33.4082192349, false, [], 2], 1392: ["Tajikistan Somoni", "TJS", "$", 9.2265597772, false, [], 2], 1402: ["Turkmenistan Manats", "TMM", "$", 17145.3975201751, false, [], 2], 1412: ["Tunisia Dinars", "TND", "$", 2.9504639903, false, [], 2], 1422: ["Tonga Pa'anga", "TOP", "$", 2.410202943, false, [], 2], 1432: ["Turkey New Lira", "TRY", "$", 48.8814000033, false, [], 2], 1442: ["Trinidad and Tobago Dollars", "TTD", "$", 6.7808730263, false, [], 2], 1452: ["Tuvalu Dollars", "TVD", "$", 1.4233639433, false, [], 2], 1462: ["Taiwan New Dollars", "TWD", "$", 31.7303840727, false, [], 0], 1472: ["Tanzania Shillings", "TZS", "$", 2642.9150025665, false, [], 2], 1482: ["Ukraine Hryvnia", "UAH", "$", 44.7703439367, false, [], 2], 1492: ["Uganda Shillings", "UGX", "$", 3915.0251201664, false, [], 2], 1502: ["Uruguay Pesos", "UYU", "$", 40.2384620007, false, [], 2], 1512: ["Uzbekistan Sums", "UZS", "$", 11825.6528744795, false, [], 2], 1522: ["Venezuela Bolivares", "VEB", "BSF", 85360173342.6058, false, [], 2], 1532: ["Venezuela Bolivares Fuertes", "VEF", "BSF", 85360173.3426058, false, [], 2], 1542: ["Vietnam Dong", "VND", "$", 25972.40550871, false, [], 2], 1552: ["Vanuatu Vatu", "VUV", "Vt", 118.7171652067, false, [], 0], 1562: ["Samoa Tala", "WST", "$", 2.7457224569, false, [], 2], 1572: ["Communauté Financière Africaine Francs BEAC", "XAF", "$", 575.8421492975, false, [], 2], 1582: ["Silver Ounces", "XAG", "$", 0.015552422, false, [], 2], 1592: ["Gold Ounces", "XAU", "$", 0.00023331, false, [], 2], 1602: ["East Caribbean Dollars", "XCD", "$", 2.7003464314, false, [], 2], 1612: ["International Monetary Fund Special Drawing Rights", "XDR", "$", 0.7292697015, false, [], 2], 1622: ["Communauté Financière Africaine Francs BCEAO", "XOF", "$", 575.8421492975, false, [], 2], 1632: ["Palladium Ounces", "XPD", "$", 0.0007874032, false, [], 2], 1642: ["Comptoirs Français du Pacifique Francs", "XPF", "â£", 104.7572431312, false, [], 2], 1652: ["Platinum Ounces", "XPT", "$", 0.0005611738, false, [], 2], 1662: ["Yemen Rials", "YER", "$", 236.5554298401, false, [], 2], 1672: ["South Africa Rand", "ZAR", "R", 16.3100635135, false, [], 2], 1682: ["Zambia Kwacha", "ZMK", "$", 19497.8615063655, false, [], 2], 1692: ["Zimbabwe Dollars", "ZWD", "$", 361.9, false, [], 2], 1693: ["Turkmenistan New Manats", "TMT", "$", 3.429079504, false, [], 2], 1703: ["ERR", "ZMW", "$", 19.4978615064, false, [], 2], 1708: ["ERR", "XBT", "$", 0.0083098295, false, [], 2], 1712: ["ERR", "BYN", "$", 3.0193988783, false, [], 2], 1713: ["ERR", "CNH", "$", 6.734300319, false, [], 2], 1718: ["Mauritania Ouguiyas", "MRU", "$", 40.1380666551, false, [], 2], 1723: ["S", "STN", "$", 21.5104289522, false, [], 2], 1727: ["Venezuela Bol?vares", "VES", "$", 853.6017334261, false, [], 2], 1732: ["ERR", "MXV", "$", 2.0026129901, false, [], 2], 1733: ["ERR", "VED", "$", 853.6017334261, false, [], 2], 1736: ["Sierra Leone Leones", "SLE", "$", 22.9299972858, false, [], 2], 1741: ["ERR", "XCG", "$", 1.7975511229, false, [], 2], 1746: ["ERR", "SSP", "$", 4574.4430868966, false, [], 2] }; 55 56var pwCurOrder = [1,2,12,22,32,42,52,62,72,82,92,102,112,122,132,142,152,162,172,182,192,202,212,222,232,242,252,262,272,282,292,302,312,322,332,342,352,362,372,382,392,402,412,422,432,442,452,462,472,482,492,502,512,522,532,542,552,562,572,582,592,602,612,622,632,642,652,662,672,682,692,702,712,722,732,742,752,762,772,782,792,802,812,822,832,842,852,862,872,882,892,902,912,922,932,942,952,962,972,982,992,1002,1012,1022,1032,1042,1052,1062,1072,1082,1092,1102,1112,1122,1132,1142,1152,1162,1172,1182,1192,1202,1212,1222,1232,1242,1252,1262,1272,1282,1292,1302,1312,1322,1332,1342,1352,1362,1372,1382,1392,1402,1412,1422,1432,1442,1452,1462,1472,1482,1492,1502,1512,1522,1532,1542,1552,1562,1572,1582,1592,1602,1612,1622,1632,1642,1652,1662,1672,1682,1692,1693,1703,1708,1712,1713,1718,1723,1727,1732,1733,1736,1741,1746]; 57 58function pwCurSelectCurrency() { 59 var v2CurPopup = $("pw_c_popup"); 60 if (v2CurPopup == null) { 61 return 62 } 63 var pwCurContainer = $("pw_c_container"); 64 if (pwCurContainer && pwCurContainer.firstChild == null) { 65 pwCurContainer.innerHTML = pwLoadCurrencySelector(); 66 } 67} 68 69function pwLoadCurrencySelector(el) { 70 var html = '<select id="pw_c_selector" onchange="pwCurSelectorChanged(this);" style="width: 54px;">'; //</select>"; 71 for(var i=0; i < pwCurOrder.length; i++) { 72 var cId = pwCurOrder[i]; 73 var cData = pwCurData[cId]; 74 if(cId==pwCurId) { 75 html += '<option value="' + cId + '" selected="true">' + cData[1] + " " + cData[0] + '</option>'; 76 } else { 77 html += '<option value="' + cId + '">' + cData[1] + " " + cData[0] + '</option>'; 78 } 79 } 80 html += '</select>'; 81 return html; 82} 83 84function pwCurSelectorChanged(el) { 85 var cId = el.value; 86 pwSetCurrentCurrency(cId); 87 88 var i2=new Image(1,1); 89 i2.src="/home/set_user_currency/" + cId; 90 i2.onload=function() { pwCurVoid(); }; 91 92 pwUpdateCurrencyAreas(); 93 94 var link = $("pw_c_popup_link"); 95 link.innerHTML = "currency: "+pwCurCur[1]; 96 close_extras($('currency')); 97} 98 99function pwCurVoid() { 100 return; 101} 102 103 104var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version",this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(i){for(var r=0;r<i.length;r++){var n=i[r].string,t=i[r].prop;if(this.versionSearchString=i[r].versionSearch||i[r].identity,n){if(-1!=n.indexOf(i[r].subString))return i[r].identity}else if(t)return i[r].identity}return null},searchVersion:function(i){var r=i.indexOf(this.versionSearchString);return-1==r?null:parseFloat(i.substring(r+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init(); 105var Prototype={Version:"9.5.1.1",Browser:{IE:!(!window.attachEvent||window.opera),Opera:!!window.opera,WebKit:-1<navigator.userAgent.indexOf("AppleWebKit/"),Gecko:-1<navigator.userAgent.indexOf("Gecko")&&-1==navigator.userAgent.indexOf("KHTML"),Safari:-1<navigator.userAgent.indexOf("AppleWebKit/")&&-1==navigator.userAgent.indexOf("Chrome")&&-1<navigator.userAgent.indexOf("Safari")},BrowserSpecific:{Safari:{MajorVersion:null,WebKitMajorVersion:null},Chrome:{}},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(t){return t}},Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};function _log_or_console_log(e){try{log(e)}catch(t){try{console.log(e)}catch(t){}}}Prototype.Browser.Safari&&navigator.userAgent.match("Version/([0-9]+)")&&(Prototype.BrowserSpecific.Safari={MajorVersion:null!==navigator.userAgent.match("Version/([0-9]+)")&&0<navigator.userAgent.match("Version/([0-9]+)").length?parseInt(navigator.userAgent.match("Version/([0-9]+)")[1],10):null,WebKitMajorVersion:null!==navigator.userAgent.match("Safari/([0-9]+)")&&0<navigator.userAgent.match("Safari/([0-9]+)").length?parseInt(navigator.userAgent.match("Safari/([0-9]+)")[1],10):null});var Abstract={},Try=(Object.extend=function(t,e){for(var n in e)t[n]=e[n];return t},Object.extend(Object,{inspect:function(t){try{return void 0===t?"undefined":null===t?"null":t.inspect?t.inspect():t.toString()}catch(t){if(t instanceof RangeError)return"...";throw t}},toPJSON:function(t){switch(typeof t){case"undefined":case"function":case"unknown":return;case"boolean":return t.toString()}if(null===t)return"null";if(t.toPJSON)return t.toPJSON();if(t.ownerDocument!==document){var e,n=[];for(e in t){var r=Object.toPJSON(t[e]);void 0!==r&&n.push(e.toPJSON()+": "+r)}return"{"+n.join(", ")+"}"}},dnKeys:function(t){var e,n=[];for(e in t)n.push(e);return n},values:function(t){var e,n=[];for(e in t)n.push(t[e]);return n},clone:function(t){return Object.extend({},t)}}),Function.prototype.bind=function(){var t=this,e=$A(arguments),n=e.shift();return function(){return t.apply(n,e.concat($A(arguments)))}},Function.prototype.bindAsEventListener=function(e){var n=this,r=$A(arguments);return e=r.shift(),function(t){return n.apply(e,[t||window.event].concat(r))}},Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},timesDo:function(t){return $R(0,this,!0).each(t),this},toPaddedString:function(t,e){e=this.toString(e||10);return"0".times(t-e.length)+e},toPJSON:function(){return isFinite(this)?this.toString():"null"}}),Date.prototype.toPJSON=function(){return'"'+this.getFullYear()+"-"+(this.getMonth()+1).toPaddedString(2)+"-"+this.getDate().toPaddedString(2)+"T"+this.getHours().toPaddedString(2)+":"+this.getMinutes().toPaddedString(2)+":"+this.getSeconds().toPaddedString(2)+'"'},{these:function(){for(var t,e=0,n=arguments.length;e<n;e++){var r=arguments[e];try{t=r();break}catch(t){}}return t}}),PeriodicalExecuter=Class.create(),Template=(PeriodicalExecuter.prototype={initialize:function(t,e){this.callback=t,this.frequency=e,this.currentlyExecuting=!1,this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),1e3*this.frequency)},stop:function(){this.timer&&(clearInterval(this.timer),this.timer=null)},onTimerEvent:function(){if(!this.currentlyExecuting)try{this.currentlyExecuting=!0,this.callback(this)}finally{this.currentlyExecuting=!1}}},Object.extend(String,{interpret:function(t){return null===t?"":String(t)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}}),Object.extend(String.prototype,{gsub:function(t,e){var n,r="",i=this;for(e=arguments.callee.prepareReplacement(e);0<i.length;)i=(n=i.match(t))?(r=(r+=i.slice(0,n.index))+String.interpret(e(n)),i.slice(n.index+n[0].length)):(r+=i,"");return r},ptSub:function(t,e,n){return e=this.gsub.prepareReplacement(e),n=void 0===n?1:n,this.gsub(t,function(t){return--n<0?t[0]:e(t)})},scan:function(t,e){return this.gsub(t,e),this},truncate:function(t,e){return e=void 0===e?"...":e,this.length>(t=t||30)?this.slice(0,t-e.length)+e:this},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var t=new RegExp(Prototype.ScriptFragment,"img"),e=new RegExp(Prototype.ScriptFragment,"im");return(this.match(t)||[]).pmap(function(t){return(t.match(e)||["",""])[1]})},evalScripts:function(){return this.extractScripts().pmap(function(script){try{return eval(script)}catch(e){try{log(script),log("Exception while evaluating above script: "+e.message,!0)}catch(e2){}throw e}})},escapeHTML:function(){var t=arguments.callee;return t.text.data=this,t.div.innerHTML},unescapeHTML:function(){var t=document.createElement("div");return t.innerHTML=this.stripTags(),t.childNodes[0]?1<t.childNodes.length?$A(t.childNodes).inject("",function(t,e){return t+e.nodeValue}):t.childNodes[0].nodeValue:""},toQueryParams:function(t){var e=this.strip().match(/([^?#]*)(#.*)?$/);return e?e[1].split(t||"&").inject({},function(t,e){var n;return(e=e.split("="))[0]&&(n=decodeURIComponent(e.shift()),void 0!==(e=1<e.length?e.join("="):e[0])&&(e=decodeURIComponent(e)),n in t?(t[n].constructor!=Array&&(t[n]=[t[n]]),t[
105n].push(e)):t[n]=e),t}):{}},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(t){for(var e="",n=0;n<t;n++)e+=this;return e},camelize:function(){var t=this.split("-"),e=t.length;if(1==e)return t[0];for(var n="-"==this.charAt(0)?t[0].charAt(0).toUpperCase()+t[0].substring(1):t[0],r=1;r<e;r++)n+=t[r].charAt(0).toUpperCase()+t[r].substring(1);return n},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(t){var e=this.gsub(/[\x00-\x1f\\]/,function(t){var e=String.specialChar[t[0]];return e||"\\u00"+t[0].charCodeAt().toPaddedString(2,16)});return t?'"'+e.replace(/"/g,'\\"')+'"':"'"+e.replace(/'/g,"\\'")+"'"},toPJSON:function(){return this.inspect(!0)},unfilterJSON:function(t){return this.ptSub(t||Prototype.JSONFilter,"#{1}")},isJSON:function(){var t=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(t)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON())return eval("("+json+")")}catch(e){log(json),log("Exception while evaluating above json: "+e.message,!0)}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(t){return-1<this.indexOf(t)},startsWith:function(t){return 0===this.indexOf(t)},endsWith:function(t){var e=this.length-t.length;return 0<=e&&this.lastIndexOf(t)===e},empty:function(){return""===this},blank:function(){return/^\s*$/.test(this)}}),(Prototype.Browser.WebKit||Prototype.Browser.IE)&&Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},unescapeHTML:function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}}),String.prototype.gsub.prepareReplacement=function(t){var e;return"function"==typeof t?t:(e=new Template(t),function(t){return e.evaluate(t)})},String.prototype.parseQuery=String.prototype.toQueryParams,Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")}),String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text),Class.create()),$break=(Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/,Template.prototype={initialize:function(t,e){this.template=t.toString(),this.pattern=e||Template.Pattern},evaluate:function(n){return this.template.gsub(this.pattern,function(t){var e=t[1];return"\\"==e?t[2]:e+String.interpret(n[t[3]])})}},{}),$continue=new Error('"throw $continue" is deprecated, use "return" instead'),Enumerable={each:function(e){var n=0;try{this._each(function(t){e(t,n),n++})}catch(t){if(t!=$break)throw t}return this},eachSlice:function(t,e){for(var n=-t,r=[],i=this.toArray();(n+=t)<i.length;)r.push(i.slice(n,n+t));return r.pmap(e)},all:function(n){var r=!0;return this.each(function(t,e){if(!(r=r&&!!(n||Prototype.K)(t,e)))throw $break}),r},any:function(n){var r=!1;return this.each(function(t,e){if(r=!!(n||Prototype.K)(t,e))throw $break}),r},collect:function(n){var r=[];return this.each(function(t,e){r.push((n||Prototype.K)(t,e))}),r},detect:function(n){var r;return this.each(function(t,e){if(n(t,e))throw r=t,$break}),r},findAll:function(n){var r=[];return this.each(function(t,e){n(t,e)&&r.push(t)}),r},grep:function(n,r){var i=[];return this.each(function(t,e){t.toString().match(n)&&i.push((r||Prototype.K)(t,e))}),i},include:function(e){var n=!1;return this.each(function(t){if(t==e)throw n=!0,$break}),n},inGroupsOf:function(e,n){return n=void 0===n?null:n,this.eachSlice(e,function(t){for(;t.length<e;)t.push(n);return t})},inject:function(n,r){return this.each(function(t,e){n=r(n,t,e)}),n},invoke:function(e){var n=$A(arguments).slice(1);return this.pmap(function(t){return t[e].apply(t,n)})},max:function(n){var r;return this.each(function(t,e){t=(n||Prototype.K)(t,e),(void 0===r||r<=t)&&(r=t)}),r},min:function(n){var r;return this.each(function(t,e){t=(n||Prototype.K)(t,e),(void 0===r||t<r)&&(r=t)}),r},partition:function(n){var r=[],i=[];return this.each(function(t,e){((n||Prototype.K)(t,e)?r:i).push(t)}),[r,i]},pluck:function(n){var r=[];return this.each(function(t,e){r.push(t[n])}),r},reject:function(n){var r=[];return this.each(function(t,e){n(t,e)||r.push(t)}),r}
105,sortBy:function(n){return this.pmap(function(t,e){return{value:t,criteria:n(t,e)}}).sort(function(t,e){t=t.criteria,e=e.criteria;return t<e?-1:e<t?1:0}).pluck("value")},toArray:function(){return this.pmap()},zip:function(){var n=Prototype.K,t=$A(arguments),r=("function"==typeof t.last()&&(n=t.pop()),[this].concat(t).pmap($A));return this.pmap(function(t,e){return n(r.pluck(e))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}},$A=(Object.extend(Enumerable,{pmap:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray}),Array.from=function(t,e,n){if(null==t)return[];if("undefined"!=typeof Symbol&&t[Symbol.iterator]){for(var r,i=[],o=t[Symbol.iterator]();!(r=o.next()).done;)i.push(e?e.call(n,r.value):r.value);return i}if(t.toArray)return t.toArray();for(var s=[],a=0,c=t.length;a<c;a++)s.push(e?e.call(n,t[a],a):t[a]);return s},Array.from);function $w(t){return(t=t.strip())?t.split(/\s+/):[]}Object.extend(Array.prototype,Enumerable),Array.prototype._reverse||(Array.prototype._reverse=Array.prototype.reverse),Object.extend(Array.prototype,{_each:function(t){for(var e=0,n=this.length;e<n;e++)t(this[e])},clear:function(){return this.length=0,this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(t){return null!=t})},flatten:function(){return this.inject([],function(t,e){return t.concat(e&&e.constructor==Array?e.flatten():[e])})},without:function(){var e=$A(arguments);return this.select(function(t){return!e.include(t)})},reverse:function(t){return(!1!==t?this:this.toArray())._reverse()},preduce:function(){return 1<this.length?this:this[0]},uniq:function(r){return this.inject([],function(t,e,n){return 0!==n&&(r?t.last()==e:t.include(e))||t.push(e),t})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.pmap(Object.inspect).join(", ")+"]"}}),"undefined"==typeof dnNoArrayToJSON&&Object.extend(Array.prototype,{toPJSON:function(){var e=[];return this.each(function(t){t=Object.toPJSON(t);void 0!==t&&e.push(t)}),"["+e.join(", ")+"]"}}),Array.prototype.toArray=Array.prototype.clone,Prototype.Browser.Opera&&(Array.prototype.concat=function(){var t=[],e=0;for(length=this.length;e<length;e++)t.push(this[e]);for(e=0,length=arguments.length;e<length;e++)if(arguments[e].constructor==Array)for(var n=0,r=arguments[e].length;n<r;n++)t.push(arguments[e][n]);else t.push(arguments[e]);return t});var Hash=function(t){t instanceof Hash?this.merge(t):Object.extend(this,t||{})};function $H(t){return t instanceof Hash?t:new Hash(t)}Object.extend(Hash,{toQueryString:function(t){var n=[];return n.add=arguments.callee.addPair,this.prototype._each.call(t,function(e){var t;e.key&&((t=e.value)&&"object"==typeof t?t.constructor==Array&&t.each(function(t){n.add(e.key,t)}):n.add(e.key,t))}),n.join("&")},toPJSON:function(t){var n=[];return this.prototype._each.call(t,function(t){var e=Object.toPJSON(t.value);void 0!==e&&n.push(t.key.toPJSON()+": "+e)}),"{"+n.join(", ")+"}"}}),Hash.toQueryString.addPair=function(t,e,n){t=encodeURIComponent(t),void 0===e?this.push(t):this.push(t+"="+(null==e?"":encodeURIComponent(e)))},Object.extend(Hash.prototype,Enumerable),Object.extend(Hash.prototype,{_each:function(t){for(var e in this){var n,r=this[e];r&&r==Hash.prototype[e]||((n=[e,r]).key=e,n.value=r,t(n))}},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},merge:function(t){return $H(t).inject(this,function(t,e){return t[e.key]=e.value,t})},remove:function(){for(var t,e=0,n=arguments.length;e<n;e++){var r=this[arguments[e]];void 0!==r&&(void 0===t?t=r:(t=t.constructor!=Array?[t]:t).push(r)),delete this[arguments[e]]}return t},toQueryString:function(){return Hash.toQueryString(this)},inspect:function(){return"#<Hash:{"+this.pmap(function(t){return t.pmap(Object.inspect).join(": ")}).join(", ")+"}>"},toPJSON:function(){return Hash.toPJSON(this)}}),(()=>{function t(t){this.key=t}var e,n=0;for(e in t.prototype.key="foo",new t("bar"))n++;return 1<n})()&&(Hash.prototype._each=function(t){var e,n=[];for(e in this){var r,i=this[e];i&&i==Hash.prototype[e]||n.include(e)||(n.push(e),(r=[e,i]).key=e,r.value=i,t(r))}}),ObjectRange=Class.create(),Object.extend(ObjectRange.prototype,Enumerable),Object.extend(ObjectRange.prototype,{initialize:function(t,e,n){this.start=t,this.end=e,this.exclusive=n},_each:function(t){for(var e=this.start;this.include(e);)t(e),e=e.succ()},include:function(t){return!(t<this.start)&&(this.exclusive?t<this.end:t<=this.end)}});var $R=function(t,e,n){return new ObjectRange(t,e,n)},Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest})||!1},activeRequestCount:0,unProcessableRequestHandler:null};function $(t){if(1<arguments.length){for(var e=0,n=[],r=arguments.length;e<r;e++)n.push($(arguments[e]));return n}return"string"==typeof t&&(t=document.getElementById(t)),Element.extend(t)}Ajax.Responders={responders:[],_each:function(t){this.responders._each(t)},register:function(t){this.include(t)||this.responders.push(t)},unregister:function(t){this.responders=this.responders.without(t)},dispatch:function(e,n,r,i){this.each(function(t){if("function"==typeof t[e])try{t[e].apply(t,[n,r,i])}catch(t){}})}},Object.extend(Ajax.Responders,Enumerable),Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}}),Ajax.Base=function(){},Ajax.Base.prototype={setOptions:function(t){this.options={method:"post",asynchronous:!0,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",crossDomain:!1,networkErrorRetryCount:5},Object.extend(this.options,t||{}),this.options.method=this.options.method.toLowerCase(),"string"==typeof this.options.parameters&&(this.options.parameters=this.options.parameters.toQueryParams())}},Ajax.Request=Class.create(),Ajax.Request.Events=["Uninitialized","Loa
105ding","Loaded","Interactive","Complete"],Ajax.Request.prototype=Object.extend(new Ajax.Base,{_complete:!1,initialize:function(t,e){this.transport=Ajax.getTransport(),this.retryCount=0,this.requestStart=(new Date).getTime(),this.setOptions(e),this.request(t)},request:function(t){this.url=t,this.method=this.options.method;t=Object.clone(this.options.parameters);["get","post"].include(this.method)||(t._method=this.method,this.method="post"),this.parameters=t,(t=Hash.toQueryString(t))&&("get"==this.method?this.url+=(this.url.include("?")?"&":"?")+t:/Konqueror|Safari|KHTML/.test(navigator.userAgent)&&(t+="&_="));try{this.options.onCreate&&this.options.onCreate(this.transport),Ajax.Responders.dispatch("onCreate",this,this.transport),this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous),this.options.asynchronous&&setTimeout(function(){this.respondToReadyState(1)}.bind(this),10),this.transport.onreadystatechange=this.onStateChange.bind(this),this.setRequestHeaders(),this.body="post"==this.method?this.options.postBody||t:null,this.transport.send(this.body),!this.options.asynchronous&&this.transport.overrideMimeType&&this.onStateChange()}catch(t){this.dispatchException(t)}},onStateChange:function(){var t=this.transport.readyState;1<t&&(4!=t||!this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var t,e={};if(1==this.options.crossDomain?e={Accept:"text/javascript, text/html, application/xml, text/xml, */*"}:(e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"},"undefined"!=typeof dnCSRFToken&&(e["X-CSRF-Token"]=dnCSRFToken)),0<this.retryCount&&(e["X-Retry-Count"]=this.retryCount),"post"==this.method&&(e["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:""),this.transport.overrideMimeType)&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005&&(e.Connection="close"),"object"==typeof this.options.requestHeaders){var n=this.options.requestHeaders;if("function"==typeof n.push)for(var r=0,i=n.length;r<i;r+=2)e[n[r]]=n[r+1];else $H(n).each(function(t){e[t.key]=t.value})}for(t in e)this.transport.setRequestHeader(t,e[t])},isNetworkError:function(){return 4==this.transport.readyState&&0==this.transport.status},success:function(){return 4!=this.transport.readyState&&!this.transport.status||200<=this.transport.status&&this.transport.status<300},respondToReadyState:function(t){var e=Ajax.Request.Events[t],n=this.transport,r=this.evalJSON();if("Complete"==e){if(this.isNetworkError()){var i=(new Date).getTime()-this.requestStart;if(i<3e3&&this.retryCount<this.options.networkErrorRetryCount)return this.transport.onreadystatechange=null,this.transport=Ajax.getTransport(),this.retryCount++,void this.request(this.url);_log_or_console_log("Network error occured getting "+this.url+": retryCount="+this.retryCount+", timeFromStart="+i+"ms")}if(422==n.status&&(_log_or_console_log("422 (Unprocessable Entity) Error getting "+this.url+": retryCount="+this.retryCount),null!=Ajax.unProcessableRequestHandler))if(this.retryCount<1)return void Ajax.unProcessableRequestHandler(this,t);if(503==n.status&&"true"==this.getHeader("x-maintenance")&&(_log_or_console_log("503: x-maintenance"),null!=Ajax.serverDownMaintenanceHandler)&&Ajax.serverDownMaintenanceHandler(this,t))return;try{var o=this.getHeader("Unique-Request-Id");_log_or_console_log(null==o?null==(o=this.getHeader("X-Request-Id"))?"Unable to get X-Request-Id of "+this.url+" with http status "+n.status:"X-Request-Id of "+this.url+" is "+o+" with http status "+n.status:"Unique-Request-Id of "+this.url+" is "+o+" with http status "+n.status)}catch(t){_log_or_console_log("Error getting Unique-Request-Id of request: "+t.message)}try{this._complete=!0,(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(n,r)}catch(t){this.dispatchException(t)}i=this.getHeader("Content-type");i&&i.strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)&&this.evalResponse()}try{(this.options["on"+e]||Prototype.emptyFunction)(n,r),Ajax.Responders.dispatch("on"+e,this,n,r)}catch(t){this.dispatchException(t)}"Complete"==e&&(this.transport.onreadystatechange=Prototype.emptyFunction)},getHeader:function(t){try{return this.transport.getResponseHeader(t)}catch(t){return null}},evalJSON:function(){if(1==this.options.crossDomain)return null;if(!this.isSameOrigin())return log("evalJSON: !isSameOrigin"),null;try{var t=this.getHeader("X-JSON");return t?t.evalJSON():null}catch(t){return null}},evalResponse:function(){if(this.isSameOrigin()){this.evaluatingResponse=this.transport.responseText||"";try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){log("Exception when evaluating response"),this.dispatchException(e)}finally{this.evaluatingResponse=null}}else log("evalResponse: !isSameOrigin");return null},dispatchException:function(t){(this.options.onException||Prototype.emptyFunction)(this,t),Ajax.Responders.dispatch("onException",this,t)},isSameOrigin:function(){var t=this.url.match(/^\s*https?:\/\/[^\/]*/),e=location.protocol+"//"+document.domain;return location.port&&(e+=":"+location.port),!t||t[0]==e}}),Ajax.Updater=Class.create(),Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(t,e,n){this.container={success:t.success||t,failure:t.failure||(t.success?null:t)},this.retryCount=0,this.requestStart=(new Date).getTime(),this.transport=Ajax.getTransport(),this.setOptions(n);var r=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=function(t,e){this.updateContent(),setTimeout(function(){r(t,e)},15)}.bind(this),this.request(e)},updateContent:function(){var t=this.container[this.success()?"success":"failure"],e=this.transport.responseText;this.options.evalScripts||(e=e.stripScripts()),(t=$(t))&&(this.options.insertion?new this.options.insertion(t,e):t.update(e)),this.success()&&this.onComplete&&setTimeout(this.onComplete.bind(this),10)}}
105),Ajax.PeriodicalUpdater=Class.create(),Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base,{initialize:function(t,e,n){this.setOptions(n),this.onComplete=this.options.onComplete,this.frequency=this.options.frequency||2,this.decay=this.options.decay||1,this.updater={},this.container=t,this.url=e,this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this),this.onTimerEvent()},stop:function(){this.updater.options.onComplete=void 0,clearTimeout(this.timer),(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(t){this.options.decay&&(this.decay=t.responseText==this.lastText?this.decay*this.options.decay:1,this.lastText=t.responseText),this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1e3)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});var proto$=$,Element,Toggle=(Prototype.BrowserFeatures.XPath?(document._getElementsByXPath=function(t,e){for(var n=[],r=document.evaluate(t,$(e)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),i=0,o=r.snapshotLength;i<o;i++)n.push(r.snapshotItem(i));return n},document.ptGetElementsByClassName=function(t,e){return document._getElementsByXPath(".//*[contains(concat(' ', @class, ' '), ' "+t+" ')]",e)}):document.ptGetElementsByClassName=function(t,e){for(var n=($(e)||document.body).getElementsByTagName("*"),r=[],i=new RegExp("(^|\\s)"+t+"(\\s|$)"),o=0,s=n.length;o<s;o++){var a,c=(a=n[o]).className;0===c.length||c!=t&&!c.match(i)||r.push(Element.extend(a))}return r},document.getElementsByClassName||(document.getElementsByClassName=document.ptGetElementsByClassName),window.Element||(Element={}),Element.extend=function(t){var e=Prototype.BrowserFeatures;if(t&&t.tagName&&3!=t.nodeType&&!t._extended&&!e.SpecificElementExtensions&&t!=window){var n,r={},i=t.tagName,o=Element.extend.cache,s=Element.Methods.ByTag;for(n in e.ElementExtensions||(Object.extend(r,Element.Methods),Object.extend(r,Element.Methods.Simulated)),s[i]&&Object.extend(r,s[i]),r){var a=r[n];"function"!=typeof a||n in t||(t[n]=o.findOrStore(a))}t._extended=Prototype.emptyFunction}return t},Element.extend.cache={findOrStore:function(t){return this[t]=this[t]||function(){return t.apply(null,[this].concat($A(arguments)))},this[t]}},Element.Methods={visible:function(t){return"none"!=$(t).style.display},toggle:function(t){return t=$(t),Element[Element.visible(t)?"hide":"show"](t),t},hide:function(t){return $(t).style.display="none",t},show:function(t){return $(t).style.display="",t},setVisible:function(t,e){$(t).style.display=e?"":"none"},remove:function(t){return(t=$(t)).parentNode&&t.parentNode.removeChild(t),t},update:function(t,e){return e=void 0===e?"":e.toString(),$(t).innerHTML=e.stripScripts(),setTimeout(function(){e.evalScripts()},10),t},replace:function(t,e){var n;return t=$(t),e=void 0===e?"":e.toString(),t.outerHTML?t.outerHTML=e.stripScripts():((n=t.ownerDocument.createRange()).selectNodeContents(t),t.parentNode.replaceChild(n.createContextualFragment(e.stripScripts()),t)),setTimeout(function(){e.evalScripts()},10),t},inspect:function(n){var r="<"+(n=$(n)).tagName.toLowerCase();return $H({id:"id",className:"class"}).each(function(t){var e=t.first(),t=t.last(),e=(n[e]||"").toString();e&&(r+=" "+t+"="+e.inspect(!0))}),r+">"},recursivelyCollect:function(t,e){var n=[];for(t=(t=$(t))[e];t;)1==t.nodeType&&n.push(Element.extend(t)),t=t[e];return n},ancestors:function(t){return $(t).recursivelyCollect("parentNode")},descendants:function(t){return $A($(t).getElementsByTagName("*")).each(Element.extend)},firstDescendant:function(t){for(t=$(t).firstChild;t&&1!=t.nodeType;)t=t.nextSibling;return $(t)},immediateDescendants:function(t){if(!(t=$(t).firstChild))return[];for(;t&&1!=t.nodeType;)t=t.nextSibling;return t?[t].concat($(t).nextSiblings()):[]},previousSiblings:function(t){return $(t).recursivelyCollect("previousSibling")},nextSiblings:function(t){return $(t).recursivelyCollect("nextSibling")},siblings:function(t){return(t=$(t)).previousSiblings().reverse().concat(t.nextSiblings())},match:function(t,e){return(e="string"==typeof e?new Selector(e):e).match($(t))},up:function(t,e,n){return t=$(t),1==arguments.length?$(t.parentNode):(t=t.ancestors(),e?Selector.findElement(t,e,n):t[n||0])},down:function(t,e,n){return t=$(t),1==arguments.length?t.firstDescendant():(t=t.descendants(),e?Selector.findElement(t,e,n):t[n||0])},previous:function(t,e,n){return t=$(t),1==arguments.length?$(Selector.handlers.previousElementSibling(t)):(t=t.previousSiblings(),e?Selector.findElement(t,e,n):t[n||0])},next:function(t,e,n){return t=$(t),1==arguments.length?$(Selector.handlers.nextElementSibling(t)):(t=t.nextSiblings(),e?Selector.findElement(t,e,n):t[n||0])},getElementsBySelector:function(){var t=$A(arguments),e=$(t.shift());return Selector.findChildElements(e,t)},readAttribute:function(t,e){if(t=$(t),Prototype.Browser.IE){if(!t.attributes)return null;var n=Element._attributeTranslations;if(n.values[e])return n.values[e](t,e);n.names[e]&&(e=n.names[e]);n=t.attributes[e];return n?n.nodeValue:null}return t.getAttribute(e)},getHeight:function(t){return $(t).getDimensions().height},getWidth:function(t){return $(t).getDimensions().width},classNames:function(t){return new Element.ClassNames(t)},hasClassName:function(t,e){if(t=$(t))return 0!=(t=t.className).length&&!(t!=e&&!t.match(new RegExp("(^|\\s)"+e+"(\\s|$)")))},addClassName:function(t,e){if(t=$(t))return Element.classNames(t).add(e),t},removeClassName:function(t,e){if(t=$(t))return Element.classNames(t).remove(e),t},toggleClassName:function(t,e){if(t=$(t))return Element.classNames(t)[t.hasClassName(e)?"remove":"add"](e),t}
105,observe:function(){return Event.observe.apply(Event,arguments),$A(arguments).first()},stopObserving:function(){return Event.stopObserving.apply(Event,arguments),$A(arguments).first()},cleanWhitespace:function(t){for(var e=(t=$(t)).firstChild;e;){var n=e.nextSibling;3!=e.nodeType||/\S/.test(e.nodeValue)||t.removeChild(e),e=n}return t},empty:function(t){return $(t).innerHTML.blank()},descendantOf:function(t,e){for(t=$(t),e=$(e),t=t.parentNode;t;){if(t==e)return!0;t=t.parentNode}return!1},scrollTo:function(t){t=$(t);var e=Position.cumulativeOffset(t);return window.scrollTo(e[0],e[1]),t},getStyle:function(t,e){t=$(t),e="float"==e?"cssFloat":e.camelize();var n=t.style[e];return n||(n=(t=document.defaultView.getComputedStyle(t,null))?t[e]:null),"opacity"==e?n?parseFloat(n):1:"auto"==n?null:n},getOpacity:function(t){return $(t).getStyle("opacity")},setStyle:function(t,e,n){var r,i=(t=$(t)).style;for(r in e)"opacity"==r?t.setOpacity(e[r]):i["float"==r||"cssFloat"==r?void 0===i.styleFloat?"cssFloat":"styleFloat":n?r:r.camelize()]=e[r];return t},setOpacity:function(t,e){return(t=$(t)).style.opacity=1==e||""===e?"":e<1e-5?0:e,t},getDimensions:function(t){t=$(t);var e,n,r,i,o=$(t).getStyle("display");return"none"!=o&&null!=o?{width:t.offsetWidth,height:t.offsetHeight}:(e=(o=t.style).visibility,n=o.position,r=o.display,o.visibility="hidden",o.position="absolute",o.display="block",i=t.clientWidth,t=t.clientHeight,o.display=r,o.position=n,o.visibility=e,{width:i,height:t})},makePositioned:function(t){t=$(t);var e=Element.getStyle(t,"position");return"static"!=e&&e||(t._madePositioned=!0,t.style.position="relative",window.opera&&(t.style.top=0,t.style.left=0)),t},undoPositioned:function(t){return(t=$(t))._madePositioned&&(t._madePositioned=void 0,t.style.position=t.style.top=t.style.left=t.style.bottom=t.style.right=""),t},makeClipping:function(t){return(t=$(t))._overflow||(t._overflow=t.style.overflow||"auto","hidden"!=(Element.getStyle(t,"overflow")||"visible")&&(t.style.overflow="hidden")),t},undoClipping:function(t){return(t=$(t))._overflow&&(t.style.overflow="auto"==t._overflow?"":t._overflow,t._overflow=null),t}},Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf,childElements:Element.Methods.immediateDescendants}),Prototype.Browser.Opera?(Element.Methods._getStyle=Element.Methods.getStyle,Element.Methods.getStyle=function(t,e){switch(e){case"left":case"top":case"right":case"bottom":if("static"==Element._getStyle(t,"position"))return null;default:return Element._getStyle(t,e)}}):Prototype.Browser.IE?(Element.Methods.getStyle=function(t,e){t=$(t),e="float"==e||"cssFloat"==e?"styleFloat":e.camelize();var n=t.style[e];return!n&&t.currentStyle&&(n=t.currentStyle[e]),"opacity"==e?(n=(t.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/))&&n[1]?parseFloat(n[1])/100:1:"auto"==n?"width"!=e&&"height"!=e||"none"==t.getStyle("display")?null:t["offset"+e.capitalize()]+"px":n},Element.Methods.setOpacity=function(t,e){var n=(t=$(t)).getStyle("filter"),r=t.style;return 1==e||""===e?r.filter=n.replace(/alpha\([^\)]*\)/gi,""):(e<1e-5&&(e=0),r.filter=n.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+100*e+")"),t},BrowserDetect.version<10&&(Element.Methods.update=function(e,t){e=$(e),t=void 0===t?"":t.toString();var n=e.tagName.toUpperCase();if(["THEAD","TBODY","TR","TD"].include(n)){var r=document.createElement("div"),i=0;switch(n){case"THEAD":case"TBODY":r.innerHTML="<table><tbody>"+t.stripScripts()+"</tbody></table>",i=2;break;case"TR":r.innerHTML="<table><tbody><tr>"+t.stripScripts()+"</tr></tbody></table>",i=3;break;case"TD":r.innerHTML="<table><tbody><tr><td>"+t.stripScripts()+"</td></tr></tbody></table>",i=4}$A(e.childNodes).each(function(t){e.removeChild(t)}),i.timesDo(function(){r=r.firstChild}),$A(r.childNodes).each(function(t){e.appendChild(t)})}else e.innerHTML=t.stripScripts();return setTimeout(function(){t.evalScripts()},10),e}),BrowserDetect.version<=8&&(Element.Methods.getElementsByClassName=function(t,e){return document.ptGetElementsByClassName(e,t)})):Prototype.Browser.Gecko&&(Element.Methods.setOpacity=function(t,e){return(t=$(t)).style.opacity=1==e?.999999:""===e?"":e<1e-5?0:e,t}),Element._attributeTranslations={names:{colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"},values:{_getAttr:function(t,e){return t.getAttribute(e,2)},_flag:function(t,e){return $(t).hasAttribute(e)?e:null},style:function(t){return t.style.cssText.toLowerCase()},title:function(t){t=t.getAttributeNode("title");return t.specified?t.nodeValue:null}}},!function(){Object.extend(this,{href:this._getAttr,src:this._getAttr,type:this._getAttr,disabled:this._flag,checked:this._flag,readonly:this._flag,multiple:this._flag})}.call(Element._attributeTranslations.values),Element.Methods.Simulated={hasAttribute:function(t,e){return e=Element._attributeTranslations.names[e]||e,(t=$(t).getAttributeNode(e))&&t.specified}},Element.Methods.ByTag={},Object.extend(Element,Element.Methods),!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__&&(window.HTMLElement={},window.HTMLElement.prototype=document.createElement("div").__proto__,Prototype.BrowserFeatures.ElementExtensions=!0),Element.hasAttribute=function(t,e){return t.hasAttribute?t.hasAttribute(e):Element.Methods.Simulated.hasAttribute(t,e)},Element.addMethods=function(e){var t,n,r,i=Prototype.BrowserFeatures,o=Element.Methods.ByTag;function s(t){t=t.toUpperCase(),Element.Methods.ByTag[t]||(Element.Methods.ByTag[t]={}),Object.extend(Element.Methods.ByTag[t],e)}function a(t,e,n){n=n||!1;var r,i=Element.extend.cache;for(r in t){var o=t[r];n&&r in e||(e[r]=i.findOrStore(o))}}if(e||(Object.extend(Form,Form.Methods),Object.extend(Form.Element,Form.Element.Methods),Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})),2==arguments.length&&(t=e,e=arguments[1]),t?t.constructor==Array?t.each(s):s(t):Object.extend(Element.Methods,e||{}),i.ElementExtensions&&(a(Element.Methods,HTMLElement.prototype),a(Element.Methods.Simulated,HTMLElement.prototype,!0)),i.SpecificElementExtensions)for(var c in
105Element.Methods.ByTag){r=void 0,(l={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"})[n=c]&&(r="HTML"+l[n]+"Element"),window[r]||window[r="HTML"+n+"Element"]||(r="HTML"+n.capitalize()+"Element",window[r])||(window[r]={},window[r].prototype=document.createElement(n).__proto__);var l=window[r];void 0!==l&&a(o[c],l.prototype)}Object.extend(Element,Element.Methods),delete Element.ByTag},{display:Element.toggle}),Insertion=(Abstract.Insertion=function(t){this.adjacency=t},Abstract.Insertion.prototype={initialize:function(e,t){if(this.element=$(e),this.content=t.stripScripts(),this.adjacency&&this.element.insertAdjacentHTML)try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(t){e=this.element.tagName.toUpperCase();if(["TBODY","TR"].include(e))this.insertContent(this.contentFromAnonymousTable());else{if(!["TABLE"].include(e))throw t;this.insertContent(this.contentFromAnonymousTBody())}}else this.range=this.element.ownerDocument.createRange(),this.initializeRange&&this.initializeRange(),this.insertContent([this.range.createContextualFragment(this.content)]);setTimeout(function(){t.evalScripts()},10)},contentFromAnonymousTable:function(){var t=document.createElement("div");return t.innerHTML="<table><tbody>"+this.content+"</tbody></table>",$A(t.childNodes[0].childNodes[0].childNodes)},contentFromAnonymousTBody:function(){var t=document.createElement("div");return t.innerHTML="<table>"+this.content+"</table>",$A(t.childNodes[0].childNodes)}},{}),Form=(Insertion.Before=Class.create(),Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element)},insertContent:function(t){t.each(function(t){this.element.parentNode.insertBefore(t,this.element)}.bind(this))}}),Insertion.Top=Class.create(),Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element),this.range.collapse(!0)},insertContent:function(t){t.reverse(!1).each(function(t){this.element.insertBefore(t,this.element.firstChild)}.bind(this))}}),Insertion.Bottom=Class.create(),Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element),this.range.collapse(this.element)},insertContent:function(t){t.each(function(t){this.element.appendChild(t)}.bind(this))}}),Insertion.After=Class.create(),Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(t){t.each(function(t){this.element.parentNode.insertBefore(t,this.element.nextSibling)}.bind(this))}}),Element.ClassNames=Class.create(),Element.ClassNames.prototype={initialize:function(t){this.element=$(t)},_each:function(t){this.element.className.split(/\s+/).select(function(t){return 0<t.length})._each(t)},set:function(t){this.element.className=t},add:function(t){this.include(t)||this.set($A(this).concat(t).join(" "))},remove:function(t){this.include(t)&&this.set($A(this).without(t).join(" "))},toString:function(){return $A(this).join(" ")}},Object.extend(Element.ClassNames.prototype,Enumerable),{reset:function(t){return $(t).reset(),t},serializeElements:function(t,e){t=t.inject({},function(t,e){var n;return!e.disabled&&e.name&&(n=e.name,null!=(e=$(e).getValue()))&&(n in t?(t[n].constructor!=Array&&(t[n]=[t[n]]),t[n].push(e)):t[n]=e),t});return e?t:Hash.toQueryString(t)}}),Field=(Form.Methods={serialize:function(t,e){return Form.serializeElements(Form.getElements(t),e)},getElements:function(t){return $A($(t).getElementsByTagName("*")).inject([],function(t,e){return Form.Element.Serializers[e.tagName.toLowerCase()]&&t.push(Element.extend(e)),t})},getInputs:function(t,e,n){var r=(t=$(t)).getElementsByTagName("input");if(!e&&!n)return $A(r).pmap(Element.extend);for(var i=0,o=[],s=r.length;i<s;i++){var a=r[i];e&&a.type!=e||n&&a.name!=n||o.push(Element.extend(a))}return o},disable:function(t){return t=$(t),Form.getElements(t).invoke("disable"),t},enable:function(t){return t=$(t),Form.getElements(t).invoke("enable"),t},findFirstElement:function(t){return $(t).getElements().find(function(t){return"hidden"!=t.type&&!t.disabled&&["input","select","textarea"].include(t.tagName.toLowerCase())})},focusFirstElement:function(t){return(t=$(t)).findFirstElement().activate(),t},request:function(t,e){t=$(t);var n=(e=Object.clone(e||{})).parameters;return e.parameters=t.serialize(!0),n&&("string"==typeof n&&(n=n.toQueryParams()),Object.extend(e.parameters,n)),t.hasAttribute("method")&&!e.method&&(e.method=t.method),new Ajax.Request(t.readAttribute("action"),e)}},Form.Element={focus:function(t){return $(t).focus(),t},select:function(t){return $(t).select(),t}},Form.Element.Methods={serialize:function(t){if(!(t=$(t)).disabled&&t.name){var e,n=t.getValue();if(void 0!==n)return(e={})[t.name]=n,Hash.toQueryString(e)}return""},getValue:function(t){var e=(t=$(t)).tagName.toLowerCase();return Form.Element.Serializers[e](t)},clear:function(t){return $(t).value="",t},present:function(t){return""!=$(t).value},activate:function(t){t=$(t);try{t.focus(),!t.select||"input"==t.tagName.toLowerCase()&&["button","reset","submit"].include(t.type)||t.select()}catch(t){}return t},disable:function(t){return(t=$(t)).blur(),t.disabled=!0,t},enable:function(t){return(t=$(t)).disabled=!1,t}},Form.Element),$F=Form.Element.Methods.getValue,Event,Position=(Form.Element.Serializers={input:function(t){switch(t.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(t);default:return Form.Element.Serializers.textarea(t)}},inputSelector:function(t){return t.checked?t.value:null},textarea:function(t){return t.value},select:function(t){return this["select-one"==t.type?"selectOne":"selectMany"](t)},selectOne:function(t){var e=t.selectedIndex;return 0<=e?this.optionValue(t.options[e]):null},selectMany:function(t){var e,n,r=t.length;if(!r)return null;for(n=0,e=[];n<r;
105n++){var i=t.options[n];i.selected&&e.push(this.optionValue(i))}return e},optionValue:function(t){return Element.extend(t).hasAttribute("value")?t.value:t.text}},Abstract.TimedObserver=function(){},Abstract.TimedObserver.prototype={initialize:function(t,e,n){this.frequency=e,this.element=$(t),this.callback=n,this.lastValue=this.getValue(),this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),1e3*this.frequency)},onTimerEvent:function(){var t=this.getValue();("string"==typeof this.lastValue&&"string"==typeof t?this.lastValue!=t:String(this.lastValue)!=String(t))&&(this.callback(this.element,t),this.lastValue=t)}},Form.Element.Observer=Class.create(),Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}}),Form.Observer=Class.create(),Form.Observer.prototype=Object.extend(new Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}}),Abstract.EventObserver=function(){},Abstract.EventObserver.prototype={initialize:function(t,e){this.element=$(t),this.callback=e,this.lastValue=this.getValue(),"form"==this.element.tagName.toLowerCase()?this.registerFormCallbacks():this.registerCallback(this.element)},onElementEvent:function(){var t=this.getValue();this.lastValue!=t&&(this.callback(this.element,t),this.lastValue=t)},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback.bind(this))},registerCallback:function(t){if(t.type)switch(t.type.toLowerCase()){case"checkbox":case"radio":Event.observe(t,"click",this.onElementEvent.bind(this));break;default:Event.observe(t,"change",this.onElementEvent.bind(this))}}},Form.Element.EventObserver=Class.create(),Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}}),Form.EventObserver=Class.create(),Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}}),window.Event||(Event={}),Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(t){return $(t.target||t.srcElement)},isLeftClick:function(t){return t.which&&1==t.which||t.button&&1==t.button},pointerX:function(t){var e=document.documentElement,n=document.body||{scrollLeft:0};return t.changedTouches?t.changedTouches[0].clientX+(e.scrollLeft||n.scrollLeft)-(e.clientLeft||0):t.pageX||t.clientX+(e.scrollLeft||n.scrollLeft)-(e.clientLeft||0)},pointerY:function(t){var e=document.documentElement,n=document.body||{scrollTop:0};return t.changedTouches?t.changedTouches[0].clientY+(e.scrollTop||n.scrollTop)-(e.clientTop||0):t.pageY||t.clientY+(e.scrollTop||n.scrollTop)-(e.clientTop||0)},stop:function(t){t.preventDefault?(t.preventDefault(),t.stopPropagation()):(t.returnValue=!1,t.cancelBubble=!0)},findElement:function(t,e){for(var n=Event.element(t);n.parentNode&&(!n.tagName||n.tagName.toUpperCase()!=e.toUpperCase());)n=n.parentNode;return n},observers:!1,_observeAndCache:function(t,e,n,r){this.observers||(this.observers=[]),t.addEventListener?(this.observers.push([t,e,n,r]),t.addEventListener(e,n,r)):t.attachEvent&&(this.observers.push([t,e,n,r]),t.attachEvent("on"+e,n))},unloadCache:function(){if(Event.observers){for(var t=0,e=Event.observers.length;t<e;t++)Event.stopObserving.apply(this,Event.observers[t]),Event.observers[t][0]=null;Event.observers=!1}},observe:function(t,e,n,r){"keypress"==e&&(Prototype.Browser.WebKit||t.attachEvent)&&(e="keydown"),Event._observeAndCache(t,e,n,r=r||!1)},stopObserving:function(t,e,n,r){if(r=r||!1,"keypress"==e&&(Prototype.Browser.WebKit||t.attachEvent)&&(e="keydown"),t.removeEventListener)t.removeEventListener(e,n,r);else if(t.detachEvent)try{t.detachEvent("on"+e,n)}catch(t){}}}),Prototype.Browser.IE&&Event.observe(window,"unload",Event.unloadCache,!1),{includeScrollOffsets:!1,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0,this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},realOffset:function(t){var e=0,n=0;do{if(t==document.body){e+=void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop||0,n+=void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft||0;break}}while(e+=t.scrollTop||0,n+=t.scrollLeft||0,t=t.parentNode);return[n,e]},cumulativeOffset:function(t){var e=t,n=0,r=0;do{var i=Element.getStyle(t,"transform");if(null!=i&&"none"!=i)if("function"==typeof t.getBoundingClientRect)return[(i=e.getBoundingClientRect()).left,i.top]}while(n+=t.offsetTop||0,r+=t.offsetLeft||0,t=t.offsetParent);return[r,n]},positionedOffset:function(t){var e=0,n=0;do{if(e+=t.offsetTop||0,n+=t.offsetLeft||0,t=t.offsetParent){if("BODY"==t.tagName)break;var r=Element.getStyle(t,"position");if("relative"===r||"absolute"===r)break}}while(t);return[n,e]},offsetParent:function(t){if(t.offsetParent)return t.offsetParent;if(t==document.body)return t;for(;(t=t.parentNode)&&t!=document.body;)if("static"!=Element.getStyle(t,"position"))return t;return document.body},within:function(t,e,n){return this.includeScrollOffsets?this.withinIncludingScrolloffsets(t,e,n):(this.xcomp=e,this.ycomp=n,this.offset=this.cumulativeOffset(t),n>=this.offset[1]&&n<this.offset[1]+t.offsetHeight&&e>=this.offset[0]&&e<this.offset[0]+t.offsetWidth)},withinIncludingScrolloffsets:function(t,e,n){var r=this.realOffset(t);return this.xcomp=e+r[0]-this.deltaX,this.ycomp=n+r[1]-this.deltaY,this.offset=this.cumulativeOffset(t),this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+t.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+t.offsetWidth},overlap:function(t,e){return t?"vertical"==t?(this.offset[1]+e.offsetHeight-this.ycomp)/e.offsetHeight:"horizontal"==t?(this.offset[0]+e.offsetWidth-this.xcomp)/e.offsetWidth:void 0:0},page:function(t){for(var e=0,n=0,r=t;e+=r.offsetTop||0,n+=r.offsetLeft||0,(r.offsetParent!=document.body||"absolute"!=Element.getStyle(r,"position"))&&(r=r.offsetParent););for(r=t;
105window.opera&&"BODY"!=r.tagName||(e-=r.scrollTop||0,n-=r.scrollLeft||0),r=r.parentNode;);return[n,e]},clone:function(t,e){var n=Object.extend({setLeft:!0,setTop:!0,setWidth:!0,setHeight:!0,offsetTop:0,offsetLeft:0},arguments[2]||{}),r=(t=$(t),Position.page(t)),i=(e=$(e),[0,0]),o=null;"absolute"==Element.getStyle(e,"position")&&(o=Position.offsetParent(e),i=Position.page(o)),o==document.body&&(i[0]-=document.body.offsetLeft,i[1]-=document.body.offsetTop),n.setLeft&&(e.style.left=r[0]-i[0]+n.offsetLeft+"px"),n.setTop&&(e.style.top=r[1]-i[1]+n.offsetTop+"px"),n.setWidth&&(e.style.width=t.offsetWidth+"px"),n.setHeight&&(e.style.height=t.offsetHeight+"px")},absolutize:function(t){var e,n,r,i;"absolute"!=(t=$(t)).style.position&&(Position.prepare(),e=(n=Position.positionedOffset(t))[1],r=t.clientWidth,i=t.clientHeight,t._originalLeft=(n=n[0])-parseFloat(t.style.left||0),t._originalTop=e-parseFloat(t.style.top||0),t._originalWidth=t.style.width,t._originalHeight=t.style.height,t.style.position="absolute",t.style.top=e+"px",t.style.left=n+"px",t.style.width=r+"px",t.style.height=i+"px")},relativize:function(t){var e,n;"relative"!=(t=$(t)).style.position&&(Position.prepare(),t.style.position="relative",e=parseFloat(t.style.top||0)-(t._originalTop||0),n=parseFloat(t.style.left||0)-(t._originalLeft||0),t.style.top=e+"px",t.style.left=n+"px",t.style.height=t._originalHeight,t.style.width=t._originalWidth)}});(Prototype.Browser.Gecko||Prototype.Browser.WebKit&&!Prototype.Browser.Safari||Prototype.Browser.Safari&&(Prototype.BrowserSpecific.Safari.WebKitMajorVersion<601||603<=Prototype.BrowserSpecific.Safari.WebKitMajorVersion))&&(Position.cumulativeOffset=function(t){var e=t,n=0,r=0;do{var i=Element.getStyle(t,"transform");if(null!=i&&"none"!=i)if("function"==typeof t.getBoundingClientRect)return[(i=e.getBoundingClientRect()).left,i.top];if(n+=t.offsetTop||0,r+=t.offsetLeft||0,t.offsetParent==document.body&&"absolute"==Element.getStyle(t,"position"))break;if((null==t.offsetParent||t.offsetParent==document.body)&&"fixed"==Element.getStyle(t,"position")){n+=document.body.scrollTop||0,r+=document.body.scrollLeft||0;try{var o=document.documentElement;n+=o.scrollTop||0,r+=o.scrollLeft||0}catch(t){}}}while(t=t.offsetParent);return[r,n]}),Object.extend(XMLHttpRequest.prototype,{safeEvalJSON:function(t){try{return this.responseText.evalJSON(t)}catch(t){return 401==this.status?{errors:"Not Logged IN",errorAlreadyHandled:!0}:501==this.status?this.responseText?{errors:this.responseText}:{errors:dnMl("System error occurred")}:0==this.status&&4==this.readyState?{errors:dnMl("Network error occurred")}:{errors:dnMl("System error occurred")}}}}),Element.addMethods(); 106/* Portions of the Selector class are derived from Jack Slocumââ¬â¢s DomQuery, 107 * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style 108 * license. Please see http://www.yui-ext.com/ for more information. */ 109 110var Selector = Class.create(); 111 112Selector.prototype = { 113 initialize: function(expression) { 114 this.expression = expression.strip(); 115 this.compileMatcher(); 116 }, 117 118 compileMatcher: function() { 119 // Selectors with namespaced attributes can't use the XPath version 120 if (Prototype.BrowserFeatures.XPath && !(/\[[\w\-]*?:/).test(this.expression)) { 121 return this.compileXPathMatcher(); 122 } 123 var e = this.expression, ps = Selector.patterns, h = Selector.handlers, 124 c = Selector.criteria, le, p, m; 125 126 if (Selector._cache[e]) { 127 this.matcher = Selector._cache[e]; return; 128 } 129 this.matcher = ["this.matcher = function(root) {", 130 "var r = root, h = Selector.handlers, c = false, n;"]; 131 132 while (e && le != e && (/\S/).test(e)) { 133 le = e; 134 for (var i in ps) { 135 p = ps[i]; 136 m = e.match(p); 137 if (m) { 138 this.matcher.push(typeof c[i] == 'function' ? c[i](m) : 139 new Template(c[i]).evaluate(m)); 140 e = e.replace(m[0], ''); 141 break; 142 } 143 } 144 } 145 146 this.matcher.push("return h.unique(n);\n}"); 147 eval(this.matcher.join('\n')); 148 Selector._cache[this.expression] = this.matcher; 149 }, 150 151 compileXPathMatcher: function() { 152 var e = this.expression, ps = Selector.patterns, 153 x = Selector.xpath, le, m; 154 155 if (Selector._cache[e]) { 156 this.xpath = Selector._cache[e]; return; 157 } 158 159 this.matcher = ['.//*']; 160 while (e && le != e && (/\S/).test(e)) { 161 le = e; 162 for (var i in ps) { 163 m = e.match(ps[i]); 164 if (m) {
165 this.matcher.push(typeof x[i] == 'function' ? x[i](m) : 166 new Template(x[i]).evaluate(m)); 167 e = e.replace(m[0], ''); 168 break; 169 } 170 } 171 } 172 173 this.xpath = this.matcher.join(''); 174 Selector._cache[this.expression] = this.xpath; 175 }, 176 177 findElements: function(root) { 178 root = root || document; 179 if (this.xpath) { 180 return document._getElementsByXPath(this.xpath, root); 181 } 182 return this.matcher(root); 183 }, 184 185 match: function(element) { 186 return this.findElements(document).include(element); 187 }, 188 189 toString: function() { 190 return this.expression; 191 }, 192 193 inspect: function() { 194 return "#<Selector:" + this.expression.inspect() + ">"; 195 } 196}; 197 198Object.extend(Selector, { 199 _cache: {}, 200 201 xpath: { 202 descendant: "//*", 203 child: "/*", 204 adjacent: "/following-sibling::*[1]", 205 laterSibling: '/following-sibling::*', 206 tagName: function(m) { 207 if (m[1] == '*') { 208 return ''; 209 } 210 return "[local-name()='" + m[1].toLowerCase() + 211 "' or local-name()='" + m[1].toUpperCase() + "']"; 212 }, 213 className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", 214 id: "[@id='#{1}']", 215 attrPresence: "[@#{1}]", 216 attr: function(m) { 217 m[3] = m[5] || m[6]; 218 return new Template(Selector.xpath.operators[m[2]]).evaluate(m); 219 }, 220 pseudo: function(m) { 221 var h = Selector.xpath.pseudos[m[1]]; 222 if (!h) { 223 return ''; 224 } 225 if (typeof h === 'function') { 226 return h(m); 227 } 228 return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); 229 }, 230 operators: { 231 '=': "[@#{1}='#{3}']", 232 '!=': "[@#{1}!='#{3}']", 233 '^=': "[starts-with(@#{1}, '#{3}')]", 234 '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", 235 '*=': "[contains(@#{1}, '#{3}')]", 236 '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", 237 '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" 238 }, 239 pseudos: { 240 'first-child': '[not(preceding-sibling::*)]', 241 'last-child': '[not(following-sibling::*)]', 242 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', 243 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]", 244 'checked': "[@checked]", 245 'disabled': "[@disabled]", 246 'enabled': "[not(@disabled)]", 247 'not': function(m) { 248 var e = m[6], p = Selector.patterns, 249 x = Selector.xpath, le, v; 250 251 var exclusion = []; 252 while (e && le != e && (/\S/).test(e)) { 253 le = e; 254 for (var i in p) { 255 m = e.match(p[i]); 256 if (m) { 257 v = typeof x[i] == 'function' ? x[i](m) : new Template(x[i]).evaluate(m); 258 exclusion.push("(" + v.substring(1, v.length - 1) + ")"); 259 e = e.replace(m[0], ''); 260 break; 261 } 262 } 263 } 264 return "[not(" + exclusion.join(" and ") + ")]"; 265 }, 266 'nth-child': function(m) { 267 return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); 268 }, 269 'nth-last-child': function(m) { 270 return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); 271 }, 272 'nth-of-type': function(m) { 273 return Selector.xpath.pseudos.nth("position() ", m); 274 }, 275 'nth-last-of-type': function(m) { 276 return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); 277 }, 278 'first-of-type': function(m) { 279 m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); 280 }, 281 'last-of-type': function(m) { 282 m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); 283 }, 284 'only-of-type': function(m) { 285 var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); 286 }, 287 nth: function(fragment, m) { 288 var mm, formula = m[6], predicate; 289 if (formula == 'even') { 290 formula = '2n+0'; 291 } 292 if (formula == 'odd') { 293 formula = '2n+1'; 294 } 295 mm = formula.match(/^(\d+)$/); 296 if (mm) { // digit only 297 return '[' + fragment + "= " + mm[1] + ']'; 298 } 299 mm = formula.match(/^(\-?\d*)?n(([+\-])(\d+))?/); 300 if (mm) { // an+b 301 if (mm[1] == "-") { 302 mm[1] = -1; 303 } 304 var a = mm[1] ? Number(mm[1]) : 1; 305 var b = mm[2] ? Number(mm[2]) : 0; 306 predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + 307 "((#{fragment} - #{b}) div #{a} >= 0)]"; 308 return new Template(predicate).evaluate({ 309 fragment: fragment, a: a, b: b }); 310 } 311 } 312 } 313 }, 314 315 criteria: { 316 tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', 317 className: 'n = h.className(n, r, "#{1}", c); c = false;', 318 id: 'n = h.id(n, r, "#{1}", c); c = false;', 319 attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;', 320 attr: function(m) { 321 m[3] = (m[5] || m[6]); 322 return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m); 323 }, 324 pseudo: function(m) { 325 if (m[6]) { 326 m[6] = m[6].replace(/"/g, '\\"'); 327 } 328 return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); 329 }, 330 descendant: 'c = "descendant";', 331 child: 'c = "child";', 332 adjacent: 'c = "adjacent";', 333 laterSibling: 'c = "laterSibling";' 334 }, 335 336 patterns: {
337 // combinators must be listed first 338 // (and descendant needs to be last combinator) 339 laterSibling: /^\s*~\s*/, 340 child: /^\s*>\s*/, 341 adjacent: /^\s*\+\s*/, 342 descendant: /^\s/, 343 344 // selectors follow 345 tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, 346 id: /^#([\w\-\*]+)(\b|$)/, 347 className: /^\.([\w\-\*]+)(\b|$)/, 348 pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s|(?=:))/, 349 attrPresence: /^\[([\w]+)\]/, 350 attr: /\[((?:[\w\-]*:)?[\w\-]+)\s*(?:([!\^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/ 351 }, 352 353 handlers: { 354 // UTILITY FUNCTIONS 355 // joins two collections 356 concat: function(a, b) { 357 for (var i = 0, node; i < b.length; i++) { 358 node = b[i]; 359 a.push(node); 360 } 361 return a; 362 }, 363 364 // marks an array of nodes for counting 365 mark: function(nodes) { 366 for (var i = 0, node; i < nodes.length; i++) { 367 node = nodes[i]; 368 node._counted = true; 369 } 370 return nodes; 371 }, 372 373 unmark: function(nodes) { 374 for (var i = 0, node; i < nodes.length; i++) { 375 node = nodes[i]; 376 node._counted = undefined; 377 } 378 return nodes; 379 }, 380 381 // mark each child node with its position (for nth calls) 382 // "ofType" flag indicates whether we're indexing for nth-of-type 383 // rather than nth-child 384 index: function(parentNode, reverse, ofType) { 385 parentNode._counted = true; 386 var i,j, nodes; 387 if (reverse) { 388 for (nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { 389 node = nodes[i]; 390 if (node.nodeType == 1 && (!ofType || node._counted)) { 391 node.nodeIndex = j++; 392 } 393 } 394 } else { 395 for (i = 0, j = 1, nodes = parentNode.childNodes; i < nodes.length; i++) { 396 node = nodes[i]; 397 if (node.nodeType == 1 && (!ofType || node._counted)) { 398 node.nodeIndex = j++; 399 } 400 } 401 } 402 }, 403 404 // filters out duplicates and extends all nodes 405 unique: function(nodes) { 406 if (nodes.length == 0) { 407 return nodes; 408 } 409 var results = [], n; 410 for (var i = 0, l = nodes.length; i < l; i++) 411 if (!(n = nodes[i])._counted) { 412 n._counted = true; 413 results.push(Element.extend(n)); 414 } 415 return Selector.handlers.unmark(results); 416 }, 417 418 // COMBINATOR FUNCTIONS 419 descendant: function(nodes) { 420 var h = Selector.handlers; 421 for (var i = 0, results = [], node; node = nodes[i]; i++) 422 h.concat(results, node.getElementsByTagName('*')); 423 return results; 424 }, 425 426 child: function(nodes) { 427 var h = Selector.handlers; 428 for (var i = 0, results = [], node; node = nodes[i]; i++) { 429 for (var j = 0, children = [], child; child = node.childNodes[j]; j++) 430 if (child.nodeType == 1 && child.tagName != '!') results.push(child); 431 } 432 return results; 433 }, 434 435 adjacent: function(nodes) { 436 for (var i = 0, results = [], node; node = nodes[i]; i++) { 437 var next = this.nextElementSibling(node); 438 if (next) results.push(next); 439 } 440 return results; 441 }, 442 443 laterSibling: function(nodes) { 444 var h = Selector.handlers; 445 for (var i = 0, results = [], node; node = nodes[i]; i++) 446 h.concat(results, Element.nextSiblings(node)); 447 return results; 448 }, 449 450 nextElementSibling: function(node) { 451 while (node = node.nextSibling) 452 if (node.nodeType == 1) return node; 453 return null; 454 }, 455 456 previousElementSibling: function(node) { 457 while (node = node.previousSibling) 458 if (node.nodeType == 1) return node; 459 return null; 460 }, 461 462 // TOKEN FUNCTIONS 463 tagName: function(nodes, root, tagName, combinator) { 464 tagName = tagName.toUpperCase(); 465 var results = [], h = Selector.handlers; 466 if (nodes) { 467 if (combinator) { 468 // fastlane for ordinary descendant combinators 469 if (combinator == "descendant") { 470 for (var i = 0, node; node = nodes[i]; i++) 471 h.concat(results, node.getElementsByTagName(tagName)); 472 return results; 473 } else nodes = this[combinator](nodes); 474 if (tagName == "*") return nodes; 475 } 476 for (var i = 0, node; node = nodes[i]; i++) 477 if (node.tagName.toUpperCase() == tagName) results.push(node); 478 return results; 479 } else return root.getElementsByTagName(tagName); 480 }, 481 482 id: function(nodes, root, id, combinator) { 483 var targetNode = $(id), h = Selector.handlers; 484 if (!nodes && root == document) return targetNode ? [targetNode] : []; 485 if (nodes) { 486 if (combinator) { 487 if (combinator == 'child') { 488 for (var i = 0, node; node = nodes[i]; i++) 489 if (targetNode.parentNode == node) return [targetNode]; 490 } else if (combinator == 'descendant') { 491 for (var i = 0, node; node = nodes[i]; i++) 492 if (Element.descendantOf(targetNode, node)) return [targetNode]; 493 } else if (combinator == 'adjacent') { 494 for (var i = 0, node; node = nodes[i]; i++) 495 if (Selector.handlers.previousElementSibling(targetNode) == node) 496 return [targetNode]; 497 } else nodes = h[combinator](nodes); 498 } 499 for (var i = 0, node; node = nodes[i]; i++) 500 if (node == targetNode) return [targetNode]; 501 return []; 502 } 503 return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; 504 }, 505 506 className: function(nodes, root, className, combinator) { 507 if (nodes && combinator) nodes = this[combinator](nodes); 508 return Selector.handlers.byClassName(nodes, root, className); 509 }, 510 511 byClassName: function(nodes, root, className) {
512 if (!nodes) nodes = Selector.handlers.descendant([root]); 513 var needle = ' ' + className + ' '; 514 for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { 515 nodeClassName = node.className; 516 if (nodeClassName.length == 0) continue; 517 if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) 518 results.push(node); 519 } 520 return results; 521 }, 522 523 attrPresence: function(nodes, root, attr) { 524 var results = []; 525 for (var i = 0, node; node = nodes[i]; i++) 526 if (Element.hasAttribute(node, attr)) results.push(node); 527 return results; 528 }, 529 530 attr: function(nodes, root, attr, value, operator) { 531 if (!nodes) nodes = root.getElementsByTagName("*"); 532 var handler = Selector.operators[operator], results = []; 533 for (var i = 0, node; node = nodes[i]; i++) { 534 var nodeValue = Element.readAttribute(node, attr); 535 if (nodeValue === null) continue; 536 if (handler(nodeValue, value)) results.push(node); 537 } 538 return results; 539 }, 540 541 pseudo: function(nodes, name, value, root, combinator) { 542 if (nodes && combinator) nodes = this[combinator](nodes); 543 if (!nodes) nodes = root.getElementsByTagName("*"); 544 return Selector.pseudos[name](nodes, value, root); 545 } 546 }, 547 548 pseudos: { 549 'first-child': function(nodes, value, root) { 550 for (var i = 0, results = [], node; node = nodes[i]; i++) { 551 if (Selector.handlers.previousElementSibling(node)) continue; 552 results.push(node); 553 } 554 return results; 555 }, 556 'last-child': function(nodes, value, root) { 557 for (var i = 0, results = [], node; node = nodes[i]; i++) { 558 if (Selector.handlers.nextElementSibling(node)) continue; 559 results.push(node); 560 } 561 return results; 562 }, 563 'only-child': function(nodes, value, root) { 564 var h = Selector.handlers; 565 for (var i = 0, results = [], node; node = nodes[i]; i++) 566 if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) 567 results.push(node); 568 return results; 569 }, 570 'nth-child': function(nodes, formula, root) { 571 return Selector.pseudos.nth(nodes, formula, root); 572 }, 573 'nth-last-child': function(nodes, formula, root) { 574 return Selector.pseudos.nth(nodes, formula, root, true); 575 }, 576 'nth-of-type': function(nodes, formula, root) { 577 return Selector.pseudos.nth(nodes, formula, root, false, true); 578 }, 579 'nth-last-of-type': function(nodes, formula, root) { 580 return Selector.pseudos.nth(nodes, formula, root, true, true); 581 }, 582 'first-of-type': function(nodes, formula, root) { 583 return Selector.pseudos.nth(nodes, "1", root, false, true); 584 }, 585 'last-of-type': function(nodes, formula, root) { 586 return Selector.pseudos.nth(nodes, "1", root, true, true); 587 }, 588 'only-of-type': function(nodes, formula, root) { 589 var p = Selector.pseudos; 590 return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); 591 }, 592 593 // handles the an+b logic 594 getIndices: function(a, b, total) { 595 if (a == 0) return b > 0 ? [b] : []; 596 return $R(1, total).inject([], function(memo, i) { 597 if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); 598 return memo; 599 }); 600 }, 601 602 // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type 603 nth: function(nodes, formula, root, reverse, ofType) { 604 if (nodes.length == 0) return []; 605 if (formula == 'even') formula = '2n+0'; 606 if (formula == 'odd') formula = '2n+1'; 607 var h = Selector.handlers, results = [], indexed = [], m; 608 h.mark(nodes); 609 for (var i = 0, node; node = nodes[i]; i++) { 610 if (!node.parentNode._counted) { 611 h.index(node.parentNode, reverse, ofType); 612 indexed.push(node.parentNode); 613 } 614 } 615 if (formula.match(/^\d+$/)) { // just a number 616 formula = Number(formula); 617 for (var i = 0, node; node = nodes[i]; i++) 618 if (node.nodeIndex == formula) results.push(node); 619 } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
620 if (m[1] == "-") m[1] = -1; 621 var a = m[1] ? Number(m[1]) : 1; 622 var b = m[2] ? Number(m[2]) : 0; 623 var indices = Selector.pseudos.getIndices(a, b, nodes.length); 624 for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { 625 for (var j = 0; j < l; j++) 626 if (node.nodeIndex == indices[j]) results.push(node); 627 } 628 } 629 h.unmark(nodes); 630 h.unmark(indexed); 631 return results; 632 }, 633 634 'empty': function(nodes, value, root) { 635 for (var i = 0, results = [], node; node = nodes[i]; i++) { 636 // IE treats comments as element nodes 637 if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue; 638 results.push(node); 639 } 640 return results; 641 }, 642 643 'not': function(nodes, selector, root) { 644 var h = Selector.handlers, selectorType, m; 645 var exclusions = new Selector(selector).findElements(root); 646 h.mark(exclusions); 647 for (var i = 0, results = [], node; node = nodes[i]; i++) 648 if (!node._counted) results.push(node); 649 h.unmark(exclusions); 650 return results; 651 }, 652 653 'enabled': function(nodes, value, root) { 654 for (var i = 0, results = [], node; node = nodes[i]; i++) 655 if (!node.disabled) results.push(node); 656 return results; 657 }, 658 659 'disabled': function(nodes, value, root) { 660 for (var i = 0, results = [], node; node = nodes[i]; i++) 661 if (node.disabled) results.push(node); 662 return results; 663 }, 664 665 'checked': function(nodes, value, root) { 666 for (var i = 0, results = [], node; node = nodes[i]; i++) 667 if (node.checked) results.push(node); 668 return results; 669 } 670 }, 671 672 operators: { 673 '=': function(nv, v) { return nv == v; }, 674 '!=': function(nv, v) { return nv != v; }, 675 '^=': function(nv, v) { return nv.startsWith(v); }, 676 '$=': function(nv, v) { return nv.endsWith(v); }, 677 '*=': function(nv, v) { return nv.include(v); }, 678 '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, 679 '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } 680 }, 681 682 matchElements: function(elements, expression) { 683 var matches = new Selector(expression).findElements(), h = Selector.handlers; 684 h.mark(matches); 685 for (var i = 0, results = [], element; element = elements[i]; i++) 686 if (element._counted) results.push(element); 687 h.unmark(matches); 688 return results; 689 }, 690 691 findElement: function(elements, expression, index) { 692 if (typeof expression == 'number') { 693 index = expression; expression = false; 694 } 695 return Selector.matchElements(elements, expression || '*')[index || 0]; 696 }, 697 698 findChildElements: function(element, expressions) { 699 var exprs = expressions.join(','), expressions = []; 700 exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { 701 expressions.push(m[1].strip()); 702 }); 703 var results = [], h = Selector.handlers; 704 for (var i = 0, l = expressions.length, selector; i < l; i++) { 705 selector = new Selector(expressions[i].strip()); 706 h.concat(results, selector.findElements(element)); 707 } 708 return (l > 1) ? h.unique(results) : results; 709 } 710}); 711 712/*function $$() { 713 return Selector.findChildElements(document, $A(arguments)); 714}*/ 715 716function $$(cssSelector, context) { 717 if(context == null) { 718 context = document; 719 } 720 try { 721 if(context.querySelectorAll) { 722 var result = []; 723 var elements = context.querySelectorAll(cssSelector ); 724 for(var i=0; i < elements.length; i++) { 725 var element = elements[i]; 726 result.push($(element)); 727 } 728 return result; 729 } 730 } catch(e) { 731 log("Unable to select elements using document.querySelectorAll(" + cssSelector + '): ' + e.message) 732 } 733 return Selector.findChildElements(context, $A(arguments)); 734} 735 736Extend={VERSION:1.1,CLASSDEF:"CLASSDEF",DELETE:"DELETE",INSTANCE_RESERVED:{CLASSDEF:!0,getClass:!0,parentClass:!0},setupClass:function(t,e){for(var s in e=e||{},t.prototype=e,t.methods={},e)t.methods[s]=e[s];t.inherited={},t.parentClass=void 0,e[Extend.CLASSDEF]?t.className=e[Extend.CLASSDEF].name:t.className=void 0,t.subclasses=t.subclasses||[],t.constructor=Extend.Operations.constructor,t.reparent=Extend.Operations.reparent,t.method=Extend.Operations.method,t.update=Extend.Operations.update,e[Extend.CLASSDEF]&&t.reparent(e[Extend.CLASSDEF].parent),e.getClass=function(){return t},e.parentClass=function(){return this.getClass().parentClass},e.parentCall=function(){for(var t=[],e=1;e<arguments.length;e++)t.push(arguments[e]);return this.parentClass().method(arguments[0]).apply(this,t)},e.setClass=function(t){return this.getClass().parentClass};for(var n=0;n<t.subclasses;n++)t.subclasses[n].reparent(t);return t},Operations:{constructor:function(){return this.prototype.initialize||function(){}},reparent:function(t){if(this.parentClass){var e,s=this.subclasses.indexOf(this);for(e in this.parentClass.subclasses.splice(s,1),this.inherited)this.method(e,null,this.parentClass)}if(!(this.parentClass=t))return t;var n=t.prototype;for(parent_method_name in n)!0!==Extend.INSTANCE_RESERVED[parent_method_name]&&void 0===this.methods[parent_method_name]&&this.method(parent_method_name,n[parent_method_name],t.inherited[parent_method_name]||t);return t.subclasses.push(this)},update:function(t){Extend.setupClass(this,t||this.prototype)},method:function(t,e,s){var n;if(void 0===e){var r=this.prototype[t];if(void 0===t)throw new Error("Method not found: "+t);return r}(s=s||this)==this?e==Extend.DELETE?(delete this.methods[t],delete this.inherited[t],delete this.prototype[t],this.parentClass&&(n=this.parentClass.method(t))&&this.method(t,n,this.parentClass.inherited[t]||this.parentClass)):(this.methods[t]=e,this.prototype[t]=e,delete this.inherited[t]):e==Extend.DELETE?(delete this.inherited[t],delete this.methods[t],delete this.prototype[t],this.parentClass&&(n=this.parentClass.method(t))&&this.method(t,n,this.parentClass.inherited[t]||this.parentClass)):void 0===this.methods[t]&&(this.inherited[t]=s,this.prototype[t]=e);for(var a=0;a<this.subclasses.length;a++)this.subclasses[a].method(t,e,s);return null}}};try{Class}catch(Error){Class={create:function(){return function(){this.initialize.apply(this,arguments)}}}}Class._create=Class.create,Class.create=function(t){return Extend.setupClass(Class._create(t),t)}; 737String.prototype.parseColor=function(){var t="#";if("rgb("==this.slice(0,4))for(var e=this.slice(4,this.length-1).split(","),n=0;t+=parseInt(e[n],10).toColorPart(),++n<3;);else if("#"==this.slice(0,1)){if(4==this.length)for(n=1;n<4;n++)t+=(this.charAt(n)+this.charAt(n)).toLowerCase();7==this.length&&(t=this.toLowerCase())}return 7==t.length?t:arguments[0]||this},Element.collectTextNodes=function(t){return $A($(t).childNodes).collect(function(t){return 3==t.nodeType?t.nodeValue:t.hasChildNodes()?Element.collectTextNodes(t):""}).flatten().join("")},Element.collectTextNodesIgnoreClass=function(t,e){return $A($(t).childNodes).collect(function(t){return 3==t.nodeType?t.nodeValue:t.hasChildNodes()&&!Element.hasClassName(t,e)?Element.collectTextNodesIgnoreClass(t,e):""}).flatten().join("")},Element.setContentZoom=function(t,e){return(t=$(t)).setStyle({fontSize:e/100+"em"}),Prototype.Browser.WebKit&&window.scrollBy(0,0),t},Element.getInlineOpacity=function(t){return $(t).style.opacity||""},Element.forceRerendering=function(t){try{t=$(t);var e=document.createTextNode(" ");t.appendChild(e),t.removeChild(e)}catch(t){}},Array.prototype.dnCall=function(){var e=arguments;this.each(function(t){t.apply(this,e)})};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(n){if("undefined"==typeof Builder)throw"Effect.tagifyText requires including script.aculo.us' builder.js library";var i="position:relative";Prototype.Browser.IE&&(i+=";zoom:1"),n=$(n),$A(n.childNodes).each(function(e){3==e.nodeType&&(e.nodeValue.toArray().each(function(t){n.insertBefore(Builder.node("span",{style:i}," "==t?String.fromCharCode(160):t),e)}),Element.remove(e))})},multiple:function(t,n){var e="object"!=typeof t&&"function"!=typeof t||!t.length?$(t).childNodes:t,i=Object.extend({speed:.1,delay:0},arguments[2]||{}),o=i.delay;$A(e).each(function(t,e){new n(t,Object.extend(i,{delay:e*i.speed+o}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(t,e){t=$(t),e=(e||"appear").toLowerCase();var n=Object.extend({queue:{position:"end",scope:t.id||"global",limit:1}},arguments[2]||{});Effect[t.visible()?Effect.PAIRS[e][1]:Effect.PAIRS[e][0]](t,n)}}
737,Effect2=Effect;Effect.Transitions={linear:Prototype.K,sinoidal:function(t){return-Math.cos(t*Math.PI)/2+.5},reverse:function(t){return 1-t},flicker:function(t){return 1<(t=-Math.cos(t*Math.PI)/4+.75+Math.random()/4)?1:t},wobble:function(t){return-Math.cos(t*Math.PI*(9*t))/2+.5},pulse:function(t,e){return e=e||5,0===Math.round(t%(1/e)*e)?t*e*2-Math.floor(t*e*2):1-(t*e*2-Math.floor(t*e*2))},none:function(t){return 0},full:function(t){return 1}},Effect.ScopedQueue=Class.create(),Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){this.effects=[],this.interval=null},_each:function(t){this.effects._each(t)},add:function(e){var t=(new Date).getTime();switch("string"==typeof e.options.queue?e.options.queue:e.options.queue.position){case"front":this.effects.findAll(function(t){return"idle"==t.state}).each(function(t){t.startOn+=e.finishOn,t.finishOn+=e.finishOn});break;case"with-last":t=this.effects.pluck("startOn").max()||t;break;case"end":t=this.effects.pluck("finishOn").max()||t}e.startOn+=t,e.finishOn+=t,(!e.options.queue.limit||this.effects.length<e.options.queue.limit)&&this.effects.push(e),this.interval||(this.interval=setInterval(this.loop.bind(this),15))},remove:function(e){this.effects=this.effects.reject(function(t){return t==e}),0===this.effects.length&&(clearInterval(this.interval),this.interval=null)},loop:function(){for(var t=(new Date).getTime(),e=0,n=this.effects.length;e<n;e++)this.effects[e]&&this.effects[e].loop(t)}}),Effect.Queues={instances:$H(),get:function(t){return"string"!=typeof t?t:(this.instances[t]||(this.instances[t]=new Effect.ScopedQueue),this.instances[t])}},Effect.Queue=Effect.Queues.get("global"),Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:100,sync:!1,from:0,to:1,delay:0,queue:"parallel"},Effect.Base=function(){},Effect.Base.prototype={position:null,start:function(options){function codeForEvent(t,e){return(t[e+"Internal"]?"this.options."+e+"Internal(this);":"")+(t[e]?"this.options."+e+"(this);":"")}!1===options.transition&&(options.transition=Effect.Transitions.linear),this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{}),this.currentFrame=0,this.state="idle",this.startOn=1e3*this.options.delay,this.finishOn=this.startOn+1e3*this.options.duration,this.fromToDelta=this.options.to-this.options.from,this.totalTime=this.finishOn-this.startOn,this.totalFrames=this.options.fps*this.options.duration,null!=this.element&&this.element.setAttribute("data-effect-started",(new Date).getTime());var funcCode='this.render = function(pos){ if(this.state=="idle"){this.state="running";'+codeForEvent(options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(options,"afterSetup")+'};if(this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(options,"afterUpdate")+"}}";eval(funcCode),this.event("beforeStart"),this.options.sync||Effect.Queues.get("string"==typeof this.options.queue?"global":this.options.queue.scope).add(this)},loop:function(t){var e;t>=this.startOn&&(t>=this.finishOn?(this.render(1),this.cancel(),this.event("beforeFinish"),this.finish&&this.finish(),this.event("afterFinish")):(t=(t-this.startOn)/this.totalTime,(e=Math.round(t*this.totalFrames))>this.currentFrame&&(this.render(t),this.currentFrame=e)))},cancel:function(){this.options.sync||Effect.Queues.get("string"==typeof this.options.queue?"global":this.options.queue.scope).remove(this),this.state="finished",null!=this.element&&this.element.removeAttribute("data-effect-started")},event:function(t){this.options[t+"Internal"]&&this.options[t+"Internal"](this),this.options[t]&&this.options[t](this)},inspect:function(){var t=$H();for(property in this)"function"!=typeof this[property]&&(t[property]=this[property]);return"#<Effect:"+t.inspect()+",options:"+$H(this.options).inspect()+">"}},Effect.Parallel=Class.create(),Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(t){this.effects=t||[],this.start(arguments[1])},update:function(t){this.effects.invoke("render",t)},finish:function(e){this.effects.each(function(t){t.render(1),t.cancel(),t.event("beforeFinish"),t.finish&&t.finish(e),t.event("afterFinish")})}}),Effect.Event=Class.create(),Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){var t=Object.extend({duration:0},arguments[0]||{});this.start(t)},update:Prototype.emptyFunction}),Effect.Opacity=Class.create(),Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(t){if(this.element=$(t),!this.element)throw Effect._elementDoesNotExistError;Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});var e=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(e)},update:function(t){this.element.setOpacity(t)}}),Effect.Move=Class.create(),Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(t){if(this.element=$(t),!this.element)throw Effect._elementDoesNotExistError;var e=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(e)},setup:function(){this.element.makePositioned(),this.originalLeft=parseFloat(this.element.getStyle("left")||"0"),this.originalTop=parseFloat(this.element.getStyle("top")||"0"),"absolute"==this.options.mode&&(this.options.x=this.options.x-this.originalLeft,this.options.y=this.options.y-this.originalTop)},update:function(t){this.element.setStyle({left:Math.round(this.options.x*t+this.originalLeft)+"px",top:Math.round(this.options.y*t+this.originalTop)+"px"})}}),Effect.MoveBy=function(t,e,n){return new Effect.Move(t,Object.extend({x:n,y:e},arguments[3]||{}))},Effect.Scale=Class.create(),Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(t,e){if(this.element=$(t),!this.element)throw Effect._elementDoesNotExistError;var n=Object.extend({scaleX:!0,scaleY:!0,scaleContent:!0,scaleFromCenter:!1,scaleMode:"box",scaleFrom:100,scaleTo:e},arguments[2]||{});this.start(n)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||!1,this.elementPositioning=this.element.getStyle("position"),this.originalStyle={},["top","left","width","height","fontSize"].each(function(t){this.originalStyle[t]=this.element.style[t]}.bind(this)),this.originalTop=this.element.offsetTop,this.originalLeft=this.element.offsetLeft;var e=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(t){0<e.indexOf(t)&&(this.fontSize=parseFloat(e),this.fontSizeType=t)}.bind(this)),this.factor=(this.options.scaleTo-this.options.scaleFrom)/100,this.dims=null,"box"==this.options.scaleMode&&(this.dims=[this.element.offsetHeight,this.element.offsetWidth]),/^content/.test(this.options.scaleMode)&&(this.dims=[this.element.scrollHeight,this.element.scrollWidth]),this.dims||(this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth])},update:function(t){t=this.options.scaleFrom/100+this.factor*t;this.options.scaleContent&&this.fontSize&&this.element.setStyle({fontSize:this.fontSize*t+this.fontSizeType}),this.setDimensions(this.dims[0]*t,this.dims[1]*t)},finish:function(t){this.restoreAfterFinish&&this.element.setStyle(this.originalStyle)},setDimensions:function(t,e){var n={};this.options.scaleX&&(n.width=Math.round(e)+"px"),this.options.scaleY&&(n.height=Math.round(t)+"px"),this.options.scaleFromCenter&&(t=(t-this.dims[0])/2,e=(e-this.dims[1])/2,"absolute"==this.elementPositioning?(this.options.scaleY&&(n.top=this.originalTop-t+"px"),this.options.scaleX&&(n.left
737=this.originalLeft-e+"px")):(this.options.scaleY&&(n.top=-t+"px"),this.options.scaleX&&(n.left=-e+"px"))),this.element.setStyle(n)}}),Effect.Highlight=Class.create(),Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(t){if(this.element=$(t),!this.element)throw Effect._elementDoesNotExistError;var e=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(e)},setup:function(){"none"==this.element.getStyle("display")?this.cancel():(this.oldStyle={},this.options.keepBackgroundImage||(this.oldStyle.backgroundImage=this.element.getStyle("background-image"),this.element.setStyle({backgroundImage:"none"})),this.options.endcolor||(this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")),this.options.restorecolor||(this.options.restorecolor=this.element.getStyle("background-color")),this._base=$R(0,2).pmap(function(t){return parseInt(this.options.startcolor.slice(2*t+1,2*t+3),16)}.bind(this)),this._delta=$R(0,2).pmap(function(t){return parseInt(this.options.endcolor.slice(2*t+1,2*t+3),16)-this._base[t]}.bind(this)))},update:function(i){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(t,e,n){return t+Math.round(this._base[n]+this._delta[n]*i).toColorPart()}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}}),Effect.ScrollTo=Class.create(),Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(t){this.element=$(t),this.start(arguments[1]||{})},setup:function(){Position.prepare();var t=Position.cumulativeOffset(this.element),e=(this.options.offset&&(t[1]+=this.options.offset),window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight||document.body.clientHeight));this.scrollStart=Position.deltaY,this.delta=(t[1]>e?e:t[1])-this.scrollStart},update:function(t){Position.prepare(),window.scrollTo(Position.deltaX,this.scrollStart+t*this.delta)}}),Effect.Fade=function(t){var e=(t=$(t)).getInlineOpacity(),n=Object.extend({from:t.getOpacity()||1,to:0,afterFinishInternal:function(t){0==t.options.to&&t.element.hide().setStyle({opacity:e})}},arguments[1]||{});return new Effect.Opacity(t,n)},Effect.Appear=function(t){t=$(t);var e=Object.extend({from:"none"!=t.getStyle("display")&&t.getOpacity()||0,to:1,afterFinishInternal:function(t){t.element.forceRerendering()},beforeSetup:function(t){t.element.setOpacity(t.options.from).show()}},arguments[1]||{});return new Effect.Opacity(t,e)},Effect.Puff=function(t){var e={opacity:(t=$(t)).getInlineOpacity(),position:t.getStyle("position"),top:t.style.top,left:t.style.left,width:t.style.width,height:t.style.height};return new Effect.Parallel([new Effect.Scale(t,200,{sync:!0,scaleFromCenter:!0,scaleContent:!0,restoreAfterFinish:!0}),new Effect.Opacity(t,{sync:!0,to:0})],Object.extend({duration:1,beforeSetupInternal:function(t){Position.absolutize(t.effects[0].element)},afterFinishInternal:function(t){t.effects[0].element.hide().setStyle(e)}},arguments[1]||{}))},Effect.BlindUp=function(t){return(t=$(t)).makeClipping(),new Effect.Scale(t,0,Object.extend({scaleContent:!1,scaleX:!1,restoreAfterFinish:!0,afterFinishInternal:function(t){t.element.hide().undoClipping()}},arguments[1]||{}))},Effect.BlindDown=function(t){var e=(t=$(t)).getDimensions();return new Effect.Scale(t,100,Object.extend({scaleContent:!1,scaleX:!1,scaleFrom:0,scaleMode:{originalHeight:e.height,originalWidth:e.width},restoreAfterFinish:!0,afterSetup:function(t){t.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(t){t.element.undoClipping()}},arguments[1]||{}))},Effect.SwitchOff=function(t){var e=(t=$(t)).getInlineOpacity();return new Effect.Appear(t,Object.extend({duration:.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(t){new Effect.Scale(t.element,1,{duration:.3,scaleFromCenter:!0,scaleX:!1,scaleContent:!1,restoreAfterFinish:!0,beforeSetup:function(t){t.element.makePositioned().makeClipping()},afterFinishInternal:function(t){t.element.hide().undoClipping().undoPositioned().setStyle({opacity:e})}})}},arguments[1]||{}))},Effect.DropOut=function(t){var e={top:(t=$(t)).getStyle("top"),left:t.getStyle("left"),opacity:t.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(t,{x:0,y:100,sync:!0}),new Effect.Opacity(t,{sync:!0,to:0})],Object.extend({duration:.5,beforeSetup:function(t){t.effects[0].element.makePositioned()},afterFinishInternal:function(t){t.effects[0].element.hide().undoPositioned().setStyle(e)}},arguments[1]||{}))},Effect.Shake=function(t){var e={top:(t=$(t)).getStyle("top"),left:t.getStyle("left")};return new Effect.Move(t,{x:20,y:0,duration:.05,afterFinishInternal:function(t){new Effect.Move(t.element,{x:-40,y:0,duration:.1,afterFinishInternal:function(t){new Effect.Move(t.element,{x:40,y:0,duration:.1,afterFinishInternal:function(t){new Effect.Move(t.element,{x:-40,y:0,duration:.1,afterFinishInternal:function(t){new Effect.Move(t.element,{x:40,y:0,duration:.1,afterFinishInternal:function(t){new Effect.Move(t.element,{x:-20,y:0,duration:.05,afterFinishInternal:function(t){t.element.undoPositioned().setStyle(e)}})}})}})}})}})}})},Effect.SlideDown=function(t){var e=(t=$(t).cleanWhitespace()).down().getStyle("bottom"),n=t.getDimensions();return new Effect.Scale(t,100,Object.extend({scaleContent:!1,scaleX:!1,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:n.height,originalWidth:n.width},restoreAfterFinish:!0,afterSetup:function(t){t.element.makePositioned(),t.element.down().makePositioned(),window.opera&&t.element.setStyle({top:""}),t.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(t){t.element.down().setStyle({bottom:t.dims[0]-t.element.clientHeight+"px"})},afterFinishInternal:function(t){t.element.undoClipping().undoPositioned(),t.element.down().undoPositioned().setStyle({bottom:e})}},arguments[1]||{}))},Effect.SlideUp=function(t){var e=(t=$(t).cleanWhitespace()).down().getStyle("bottom"),n=t.getDimensions();return new Effect.Scale(t,window.opera?0:1,Object.extend({scaleContent:!1,scaleX:!1,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:n.height,originalWidth:n.width},restoreAfterFinish:!0,afterSetup:function(t){t.element.makePositioned(),t.element.down().makePositioned(),window.opera&&t.element.setStyle({top:""}),t.element.makeClipping().show()},afterUpdateInternal:function(t){t.element.down().setStyle({bottom:t.dims[0]-t.element.clientHeight+"px"})},afterFinishInternal:function(t){t.element.hide().undoClipping().undoPositioned(),t.element.down().undoPositioned().setStyle({bottom:e})}},arguments[1]||{}))},Effect.Squish=function(t){return new Effect.Scale(t,window.opera?1:0,{restoreAfterFinish:!0,beforeSetup:function(t){t.element.makeClipping()},afterFinishInternal:function(t){t.element.hide().undoClipping()}})},Effect.Grow=function(t){t=$(t);var e,n,i,o,s=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{}
737),r={top:t.style.top,left:t.style.left,height:t.style.height,width:t.style.width,opacity:t.getInlineOpacity()},a=t.getDimensions();switch(s.direction){case"top-left":e=n=i=o=0;break;case"top-right":e=a.width,n=o=0,i=-a.width;break;case"bottom-left":e=i=0,n=a.height,o=-a.height;break;case"bottom-right":e=a.width,n=a.height,i=-a.width,o=-a.height;break;case"center":e=a.width/2,n=a.height/2,i=-a.width/2,o=-a.height/2}return new Effect.Move(t,{x:e,y:n,duration:.01,beforeSetup:function(t){t.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(t){new Effect.Parallel([new Effect.Opacity(t.element,{sync:!0,to:1,from:0,transition:s.opacityTransition}),new Effect.Move(t.element,{x:i,y:o,sync:!0,transition:s.moveTransition}),new Effect.Scale(t.element,100,{scaleMode:{originalHeight:a.height,originalWidth:a.width},sync:!0,scaleFrom:window.opera?1:0,transition:s.scaleTransition,restoreAfterFinish:!0})],Object.extend({beforeSetup:function(t){t.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(t){t.effects[0].element.undoClipping().undoPositioned().setStyle(r)}},s))}})},Effect.Shrink=function(t){t=$(t);var e,n,i=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{}),o={top:t.style.top,left:t.style.left,height:t.style.height,width:t.style.width,opacity:t.getInlineOpacity()},s=t.getDimensions();switch(i.direction){case"top-left":e=n=0;break;case"top-right":e=s.width,n=0;break;case"bottom-left":e=0,n=s.height;break;case"bottom-right":e=s.width,n=s.height;break;case"center":e=s.width/2,n=s.height/2}return new Effect.Parallel([new Effect.Opacity(t,{sync:!0,to:0,from:1,transition:i.opacityTransition}),new Effect.Scale(t,window.opera?1:0,{sync:!0,transition:i.scaleTransition,restoreAfterFinish:!0}),new Effect.Move(t,{x:e,y:n,sync:!0,transition:i.moveTransition})],Object.extend({beforeStartInternal:function(t){t.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(t){t.effects[0].element.hide().undoClipping().undoPositioned().setStyle(o)}},i))},Effect.Pulsate=function(t){t=$(t);function e(t){return o(1-Effect.Transitions.pulse(t,n.pulses))}var n=arguments[1]||{},i=t.getInlineOpacity(),o=n.transition||Effect.Transitions.sinoidal;return e.bind(o),new Effect.Opacity(t,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(t){t.element.setStyle({opacity:i})}},n),{transition:e}))},Effect.Fold=function(e){var n={top:(e=$(e)).style.top,left:e.style.left,width:e.style.width,height:e.style.height};return e.makeClipping(),new Effect.Scale(e,5,Object.extend({scaleContent:!1,scaleX:!1,afterFinishInternal:function(t){new Effect.Scale(e,1,{scaleContent:!1,scaleY:!1,afterFinishInternal:function(t){t.element.hide().undoClipping().setStyle(n)}})}},arguments[1]||{}))},Effect.Morph=Class.create(),Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(t){if(this.element=$(t),!this.element)throw Effect._elementDoesNotExistError;var e,n,i=Object.extend({style:{}},arguments[1]||{});"string"==typeof i.style?-1==i.style.indexOf(":")?(e="",n="."+i.style,$A(document.styleSheets).reverse().each(function(t){if(t.cssRules?cssRules=t.cssRules:t.rules&&(cssRules=t.rules),$A(cssRules).reverse().each(function(t){if(n==t.selectorText)throw e=t.style.cssText,$break}),e)throw $break}),this.style=e.parseStyle(),i.afterFinishInternal=function(e){e.element.addClassName(e.options.style),e.transforms.each(function(t){"opacity"!=t.style&&(e.element.style[t.style]="")})}):this.style=i.style.parseStyle():this.style=$H(i.style),this.start(i)},setup:function(){function o(e){return e=(e=e&&!["rgba(0, 0, 0, 0)","transparent"].include(e)?e:"#ffffff").parseColor(),$R(0,2).pmap(function(t){return parseInt(e.slice(2*t+1,2*t+3),16)})}this.transforms=this.style.pmap(function(t){var e=t[0],t=t[1],n=null,i=("#zzzzzz"!=t.parseColor("#zzzzzz")?(t=t.parseColor(),n="color"):"opacity"==e?(t=parseFloat(t),Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1})):Element.CSS_LENGTH.test(t)&&(i=t.match(/^([\+\-]?[0-9\.]+)(.*)$/),t=parseFloat(i[1]),n=3==i.length?i[2]:null),this.element.getStyle(e));return{style:e.camelize(),originalValue:"color"==n?o(i):parseFloat(i||0),targetValue:"color"==n?o(t):t,unit:n}}.bind(this)).reject(function(t){return t.originalValue==t.targetValue||"color"!=t.unit&&(isNaN(t.originalValue)||isNaN(t.targetValue))})},update:function(t){for(var e,n={},i=this.transforms.length;i;)n[(e=this.transforms[--i]).style]="color"==e.unit?"#"+Math.round(e.originalValue[0]+(e.targetValue[0]-e.originalValue[0])*t).toColorPart()+Math.round(e.originalValue[1]+(e.targetValue[1]-e.originalValue[1])*t).toColorPart()+Math.round(e.originalValue[2]+(e.targetValue[2]-e.originalValue[2])*t).toColorPart():e.originalValue+Math.round((e.targetValue-e.originalValue)*t*1e3)/1e3+e.unit;this.element.setStyle(n,!0)}}),Effect.Transform=Class.create(),Object.extend(Effect.Transform.prototype,{initialize:function(t){this.tracks=[],this.options=arguments[1]||{},this.addTracks(t)},addTracks:function(t){return t.each(function(t){var e=$H(t).values().first();this.tracks.push($H({ids:$H(t).keys().first(),effect:Effect.Morph,options:{style:e}}))}.bind(this)),this},play:function(){return new Effect.Parallel(this.tracks.pmap(function(e){return[$(e.ids)||$$(e.ids)].flatten().pmap(function(t){return new e.effect(t,Object.extend({sync:!0},e.options))})}).flatten(),this.options)}}),Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex"),Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/,Str
737ing.prototype.parseStyle=function(){var t=document.createElement("div"),e=(t.innerHTML='<div style="'+this+'"></div>',t.childNodes[0].style),n=$H();return Element.CSS_PROPERTIES.each(function(t){e[t]&&(n[t]=e[t])}),Prototype.Browser.IE&&-1<this.indexOf("opacity")&&(n.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]),n},Element.morph=function(t,e){new Effect.Morph(t,Object.extend({style:e},arguments[2]||{}));return t},["getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(t){Element.Methods[t]=Element[t]}),Element.Methods.visualEffect=function(t,e,n){s=e.dasherize().camelize(),effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](t,n);return $(t)},Element.addMethods(),Effect.Transitions.easeInQuad=function(t){return Math.pow(t,2)},Effect.Transitions.easeOutQuad=function(t){return-(Math.pow(t-1,2)-1)},Effect.Transitions.easeInOutQuad=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},Effect.Transitions.easeInCubic=function(t){return Math.pow(t,3)},Effect.Transitions.easeOutCubic=function(t){return Math.pow(t-1,3)+1},Effect.Transitions.easeInOutCubic=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},Effect.Transitions.easeInQuart=function(t){return Math.pow(t,4)},Effect.Transitions.easeOutQuart=function(t){return-(Math.pow(t-1,4)-1)},Effect.Transitions.easeInOutQuart=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},Effect.Transitions.easeInQuint=function(t){return Math.pow(t,5)},Effect.Transitions.easeOutQuint=function(t){return Math.pow(t-1,5)+1},Effect.Transitions.easeInOutQuint=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},Effect.Transitions.easeInSine=function(t){return 1-Math.cos(t*(Math.PI/2))},Effect.Transitions.easeOutSine=function(t){return Math.sin(t*(Math.PI/2))},Effect.Transitions.easeInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)},Effect.Transitions.easeInExpo=function(t){return 0===t?0:Math.pow(2,10*(t-1))},Effect.Transitions.easeOutExpo=function(t){return 1==t?1:1-Math.pow(2,-10*t)},Effect.Transitions.easeInOutExpo=function(t){return 0===t?0:1==t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},Effect.Transitions.easeInCirc=function(t){return-(Math.sqrt(1-t*t)-1)},Effect.Transitions.easeOutCirc=function(t){return Math.sqrt(1-Math.pow(t-1,2))},Effect.Transitions.easeInOutCirc=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},Effect.Transitions.easeInBounce=function(t){return 1},Effect.Transitions.easeOutBounce=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},Effect.Transitions.easeInOutBounce=function(t){return 1},Effect.Transitions.easeInBack=function(t){return t*t*(2.70158*t-1.70158)},Effect.Transitions.easeOutBack=function(t){return(t-=1)*t*(2.70158*t+1.70158)+1},Effect.Transitions.easeInOutBack=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},Effect.Transitions.easeInElastic=function(t){return 1},Effect.Transitions.easeOutElastic=function(t){return 1},Effect.Transitions.easeInOutElastic=function(t){return 1}; 738var _dn_svu=["translate.googleusercontent.com","honyaku.yahoofs.jp","webcache.googleusercontent.com"];function dnGetRenderMode(){return"undefined"!=typeof dnRenderMode?dnRenderMode:"unknown"}function dnInTest(){return"undefined"!=typeof dnIsInTest&&dnIsInTest}function dnInDnm(){return"dnm"==dnGetRenderMode()}function dnInOM(){return"om"==dnGetRenderMode()}var _dnInV3=null;function dnInV3(){return _dnInV3=null===_dnInV3?"v3"==dnGetRenderMode()||"v3-edit"==dnGetRenderMode():_dnInV3}var _dnInV3Edit=null;function dnInV3Edit(){return _dnInV3Edit=null===_dnInV3Edit?"v3-edit"==dnGetRenderMode():_dnInV3Edit}function dnInV1(){return"v1"==dnGetRenderMode()}function _dnCVD(n,s){try{var e=window.location.host;if(null!==e&&""!==e){for(var t=e.indexOf(":"),o=e="."==(e=(e=0<t?e.substr(0,t):e).toLowerCase()).substr(e.length-1)?e.substr(0,e.length-1):e,o="www."==e.substr(0,4).toLowerCase()?e.substr(4):"www."+e,r=0;r<_dn_svu.length;r++)if((l=_dn_svu[r])==e||l==o)return;var i=!1;for(r=0;r<_dn_vu.length;r++)if((l=decodeURIComponent(_dn_vu[r]).toLowerCase())==e||l==o){i=!0;break}if(!i)if(s){for(var a,c=_dn_vu.join(","),l=decodeURIComponent(n),u="",p=$("body-bottom"),d=(null!==p&&0<(a=p.src.indexOf("/images/trans.gif"))&&(u=p.src.substr(0,a+1)),[]),r=0;r<e.length;r++)d.push(e.charCodeAt(r)-1);var g=d.join("A"),y='<img src="'+u+"header_for_products_page.gif?u="+encodeURIComponent(window.location)+"&h="+encodeURIComponent(e)+"&encs="+encodeURIComponent(g)+"&vu="+c+'"/>',_=(y+='<a class="dn_all_products_link" href="'+u+"details_for_all_products_dn_page.html?u="+encodeURIComponent(window.location)+"&h="+encodeURIComponent(e)+"&encs="+encodeURIComponent(g)+"&vu="+c+'">Click here to see all products</a>',document.createElement("div"));_.innerHTML=y,document.body.appendChild(_)}else window.location="http://"+l}}catch(n){}}function _pcGetSecureLink(n){return-1==n.indexOf("?")?n+"?_pc_session_id="+pcSID+"&_pc_skey="+pcSKey:n+"&_pc_session_id="+pcSID+"&_pc_skey="+pcSKey}function _pcSecureLink(n){log("session change link clicked");for(var s,e=Event.element(n);null!==e&&"A"!=e.tagName;)e=e.parentNode;return null===e?(alert("Unable to change domains correctly: cannot rewrite url"),null):(s=_pcGetSecureLink(e.href),window.location=s,log("changed location to "+s),e.href=s,Event.stop(n),!1)}function _pcRebindSessionLinks(n){for(var s=0;s<document.links.length;s++){var e=document.links[s];"false"!=e.getAttribute("data-allow-rebind")&&0===e.href.indexOf(n)&&(log("rebinding secure link "+e.href),Event.observe(e,"click",_pcSecureLink))}}function _pcGaLink(n){var n=_pcGetSecureLink(n),s=null;ga(function(n){s=n.get("linkerParam")}),null!==s&&(n=addUrlParam(n,s)),window.location=n}var mlStringTable={},debugMissingML=!1;function registerMLString(n,s){mlStringTable[n]={ml:s,sub:-1!=s.indexOf("%s"),msub:-1!=s.indexOf("%1s")}}function subMl(n,s){return n.replace("%s",s)}function subMlm(n,s){for(var e=0;e<s.length;e++)n=n.replace("%"+(e+1)+"s",s[e]);return n}function ml(n,s){return dnMl(n,s)}function dnMl(n,s){var e=mlStringTable[n];return void 0===e?(-1!=n.indexOf("%s")?n=subMl(n,s):-1!=n.indexOf("%1s")&&(n=subMlm(n,s)),debugMissingML?"["+n+"]":n):e.sub?subMl(e.ml,s):e.msub?subMlm(e.ml,s):e.ml}function getTlsCookie(){for(var n=document.cookie.split(";"),s=!1,e=0;e<n.length;e++)if(-1<n[e].indexOf("_tls_version")){s=n[e];break}return s}function checkValidTlsVersion(n){}function hashCopy(n){var s={};for(k in n)s[k]=n[k];return s}function hashSize(n){var s=0;for(k in n)s++;return s}function hashEmpty(n){for(k in n)return!1;return!0}function hashFirst(n){for(k in n)return n[k];return null}function hashClearEmpty(n){var s={};for(k in n)null!==n[k]&&""!==n[k]&&void 0!==n[k]&&(s[k]=n[k]);return s}function hashToArray(n){var s=[];for(item in n)s[s.length]=item;return s}var MapList=Class.create({CLASSDEF:{name:"MapList"},initialize:function(n){this.byId={},this.list=[],this.parentObject=n},first:function(){return this.isEmpty()?null:this.list[0]},last:function(){return this.isEmpty()?null:this.list[this.list.size()-1]},isEmpty:function(){return 0===this.list.size()},add:function(n){return this.byId[n.id]=n,this.list.push(n),n.parentObject=this.parentObject,n},insert:function(n,s){return this.byId[n.id]=n,this.list.splice(s,0,n),n.parentObject=this.parentObject,n},copy:function(n){for(var s=new MapList(n),e=0;e<this.list.size();e++)s.add(this.list[e].copy());return s},clone:function(){for(var n=new MapList(this.parentObject),s=0;s<this.list.size();s++)n.add(this.list[s]);return n},resort:function(){this.list=this.qsort(this.list)},qsort:function(n){if(0===n.length)return[];for(var s=[],e=[],t=n[0],o=1;o<n.length;o++)(n[o].compare(t)<0?s:e).push(n[o]);return this.qsort(s).concat(t,this.qsort(e))},moveUp:function(n){n=this.objectIndex(n);return 0!==n&&this.swapPos(n,n-1)},moveDown:function(n){n=this.objectIndex(n);return!(n>=this.list.size()-1)&&this.swapPos(n,n+1)},swapPos:function(n,s){var e=this.list[n],t=this.list[s],o=e.pos;return e.pos=t.pos,t.pos=o,this.list[n]=t,this.list[s]=e,!0},objectIndex:function(n){for(var s=0;s<this.list.size();s++)if(this.list[s].id==n)return s;return-1},remove:function(n){var s,e=this.objectIndex(n);return-1!=e?(s=this.byId[n],this.callEventListener("remove",s),this.list.splice(e,1),delete this.byId[n],s):null},replace:function(n){var s=this.objectIndex(n.id);-1!=s?(this.callEventListener("remove",this.list[s]),this.list[s]=n):this.list.push(n),this.byId[n.id]=n},addEventListener:function(n,s){void 0===this.eventListeners&&(this.eventListeners={}),void 0===this.eventListeners[n]&&(this.eventListeners[n]=[]),this.eventListeners[n].push(s)},callEventListener:function(n,s){var e=null;if(void 0!==this.eventListeners&&void 0!==this.eventListeners[n])for(var t=0;t<this.eventListeners[n].length;t++){var o=this.eventListeners[n][t](s);null!=o&&(e=o)}return e}}),asyncProgressKey=null,asyncProgressStartingText=null,asyncProgressOptions=null,asyncProgressStatus=null,asyncProgressStartedAt=null,asyncProgressIsQueuedTask=!1;function startAsyncProgress(n,s,e,t){asyncProgressStartedAt=(new Date).getTime(),asyncProgressStatus={},asyncProgressIsQueuedTask=!0===(asyncProgressOptions=void 0===(asyncProgressOptions=t)?{}:asyncProgressOptions).queuedTask;var o,t=asyncProgressOptions.prefix||"",r=!!asyncProgressOptions.inline,i=asyncProgressOptions.classPrefix||"",a=asyncProgressOptions.buttonClass||"btn",c=!1;if(void 0!==asyncProgressOptions.useDnmPopup?c=!0===asyncProgressOptions.useDnmPopup:dnInDnm()&&(c=!0),o=(asyncProgressOptions.useDnmPopup=c)?"dnm-":"",asyncProgressKey=n,null===$(t+"async_progress_dialog"))alert("Unable to display progress: "+t+"async_progress_dialog missing");else{(c?$("_dnm_popup_heading_"+t+"async_progress_dialog"):$(t+"async_progress_t
738itle")).update(s),asyncProgressStartingText=e=null==e?"starting..":e,c&&$("_dnm_popup_footer_"+t+"async_progress_dialog").update('<div id="'+t+'async_progress_actions" style="display:none;" class="'+i+'submit"></div>'),$(t+"async_progress_actions").hide(),updateAsyncProgress(e,0,!0,null,null);var l=[];if(l.push('<a id="'+t+'async_progress_cancel" class="cancel '+i+o+a+'" onclick="cancelAsyncProgress();"/>Cancel</a>'),null!=asyncProgressOptions.actions)for(k in asyncProgressOptions.actions){var u=asyncProgressOptions.actions[k],p=null==u.className?' class="okay '+i+o+a+'"':' class="'+u.className+'"';l.push("<a "+p+' " onclick="callAsyncProgressAction(\''+k+"');\">"+u.caption+"</a>")}else asyncProgressOptions.requireOk&&l.push('<a type="button" onclick="updateAsyncProgressOk();" class="okay '+i+o+a+" "+i+o+a+'-primary"/>OK</a>');$(t+"async_progress_actions").update(l.join("")),null!=asyncProgressOptions.cancel?($(t+"async_progress_cancel").show(),c||null!=$(t+"async_progress_footer")&&$(t+"async_progress_footer").show()):($(t+"async_progress_cancel").hide(),c||null!=$(t+"async_progress_footer")&&$(t+"async_progress_footer").hide()),r?$(t+"async_progress_dialog").show():"function"==typeof go_popup?go_popup(t+"async_progress_dialog",!0,!0,null,!0):(c?dnmPopup:dnPopup)(t+"async_progress_dialog"),asyncProgressOptions.showSpinner&&$(t+"async_progress_spinner")&&$(t+"async_progress_spinner").show()}}function continueAsyncProgress(n,s,e){var t;null==s&&(s=asyncProgressStartingText),null!=e&&(t=asyncProgressOptions.prefix||"",(asyncProgressOptions.useDnmPopup?$("_dnm_popup_heading_"+t+"async_progress_dialog"):$(t+"async_progress_title")).update(e)),asyncProgressStartedAt=(new Date).getTime(),asyncProgressKey=n,updateAsyncProgress(s,0,!0,null,null)}function updateAsyncProgress(n,s,e,t,o,r,i){asyncProgressStatus={statusText:n,percent:s,warnings:t,errors:o,notes:r,metaData:i},progressMeta={};var a,c,l,u,p=asyncProgressOptions.prefix||"",d=!!asyncProgressOptions.inline,g=!1,y=(void 0!==asyncProgressOptions.useDnmPopup?g=!0===asyncProgressOptions.useDnmPopup:dnInDnm()&&(g=!0),asyncProgressOptions.useDnmPopup=g,parseFloat(s));if($(p+"async_progress_indicator").style.width=parseInt(y,10)+"%",$(p+"async_progress_message").update(n),null==r||0===r.length)$(p+"async_progress_notes").hide();else{for($(p+"async_progress_notes").show(),a="",c=0;c<r.length;c++)a+="<li>"+r[c]+"</li>";$(p+"async_progress_note_list").update(a)}if(null==t||0===t.length)$(p+"async_progress_warnings").hide();else{for($(p+"async_progress_warnings").show(),a="",c=0;c<t.length;c++)a+="<li>"+t[c]+"</li>";$(p+"async_progress_warning_list").update(a)}if(null==o||0===o.length)$(p+"async_progress_errors").hide();else{for($(p+"async_progress_errors").show(),a="",c=0;c<o.length;c++)a+="<li>"+o[c]+"</li>";$(p+"async_progress_error_list").update(a),null!=asyncProgressOptions.actions?(g||$(p+"async_progress_footer").show(),$(p+"async_progress_actions").show()):(g||$(p+"async_progress_footer").hide(),$(p+"async_progress_actions").hide()),$(p+"async_progress_cancel").hide()}asyncProgressOptions.timeout&&0==s&&(new Date).getTime()-asyncProgressStartedAt>asyncProgressOptions.timeout&&(log("Async timeout occured"),e=!1,progressMeta.timeoutOccured=!0),null!=i&&null!=i.changeProgessKey&&(log("Changing from progress key "+asyncProgressKey+" to "+i.changeProgessKey),asyncProgressKey=i.changeProgessKey),null!=asyncProgressOptions.onUpdate&&asyncProgressOptions.onUpdate(t,o,r,i,progressMeta),e?null!=asyncProgressKey&&window.setTimeout(function(){new Ajax.Request("/shared/lookups/async_progress?key="+encodeURIComponent(asyncProgressKey)+"&ts="+(new Date).getTime()+"&qt="+asyncProgressIsQueuedTask,{asynchronous:!0,evalScripts:!0,method:"get",onFailure:function(){log("Ajax failure. Retrying manually"),updateAsyncProgress(n,s,e,t,o,r,i)}})},500):(y=asyncProgressOptions.classPrefix||"",l=asyncProgressOptions.buttonClass||"btn",$(p+"async_progress_spinner")&&$(p+"async_progress_spinner").hide(),u=asyncProgressOptions.requireOk,asyncProgressOptions.requireOkOnErrors&&null!=o&&0<o.length&&(asyncProgressOptions.requireOk=!0),asyncProgressOptions.requireOkOnWarnings&&null!=t&&0<t.length&&(asyncProgressOptions.requireOk=!0),u!=asyncProgressOptions.requireOk&&($(p+"async_progress_actions").update('<input type="button" value="OK" onclick="updateAsyncProgressOk();" class="'+y+l+'" />'),$(p+"async_progress_actions").show()),1==asyncProgressOptions.requireOk||null!=asyncProgressOptions.actions&&0!=asyncProgressOptions.actions.length?null!=asyncProgressOptions.onFinish&&1==asyncProgressOptions.onFinish(t,o,r,i,progressMeta,{beforeOk:!0})||($(p+"async_progress_actions").show(),g||$(p+"async_progress_footer").show(),$(p+"async_progress_cancel").hide(),1!=asyncProgressOptions.useDnmPopup&&repositionPopup(p+"async_progress_dialog"),"undefined"!=typeof iframeMode&&iframeMode&&!d&&(u=$(p+"async_progress_dialog"),parent.orderManager.notifyPopupSizeChange(u.clientWidth,u.clientHeight))):null!=asyncProgressOptions.onFinish?"show_errors"==asyncProgressOptions.onFinish(t,o,r,i,progressMeta,{onFinish:!0})?($(p+"async_progress_actions").update('<input type="button" value="OK" onclick="updateAsyncProgressOk();" class="'+y+l+'" />'),$(p+"async_progress_actions").show(),g||$(p+"async_progress_footer").show(),null!=$(p+"async_progress_cancel")&&$(p+"async_progress_cancel").hide(),d?$(p+"async_progress_dialog").show():"function"==typeof go_popup?go_popup(p+"async_progress_dialog",!0,!0,null,!0):(asyncProgressOptions.useDnmPopup?dnmPopup:dnPopup)(p+"async_progress_dialog")):d?$(p+"async_progress_dialog").show():"function"==typeof go_popup?go_popup(p+"async_progress_dialog",!0,!1):(asyncProgressOptions.useDnmPopup?dnmClosePopup:closePopup)(p+"async_progress_dialog"):window.setTimeout(function(){d?$(p+"async_progress_dialog").hide():"function"==typeof go_popup?go_popup(p+"async_progress_dialog",!0,!1):(asyncProgressOptions.useDnmPopup?dnmClosePopup:closePopup)(p+"async_progress_dialog")},1e3))}function updateAsyncProgressOk(){var n=asyncProgressOptions.prefix||"";!!asyncProgressOptions.inline?$(n+"async_progress_dialog").hide():"function"==typeof go_popup?go_popup(n+"async_progress_dialog",!0,!1):(asyncProgressOptions.useDnmPopup?dnmClosePopup:closePopup)(n+"async_progress_dialog"),null!=asyncProgressOptions.onOK&&asyncProgressOptions.onOK(asyncProgressStatus.warnings,asyncProgressStatus.errors,asyncProgressStatus.notes,asyncProgressStatus.metaData),null!=asyncProgressOptions.onFinish&&asyncProgressOptions.onFinish(asyncProgressStatus.warnings,asyncProgressStatus.errors,asyncProgressStatus.notes,asyncProgressStatus.metaData,{},{onOk:!0})}function callAsyncProgressAction(n){var s=asyncProgressOptions.prefix||"",e=!!asyncProgressOptions.inline,t=asyncProgressOptions.useDnmPopup,e=(e?$(s+"async_progress_dialog").hide():"function"==typeof go_popup?go_popup(s+"async_progress_dialog",!0,!1):(t?dnmClosePopup:closePopup)(s+"async_progress_dialog"),asyncProgressOptions.actions[n]);null!=e&&e.callback(asyncProgressStatus.warnings,asyncProgressStatus.errors,asyncProgressStatus.notes,asyncProgressStatus.metaData)}function cancelAsyncProgress(){var n=asyncProgressOptions.prefix||"",s=!!asyncProgressOptions.inline,e=asyncProgressOptions.useDnmPopup;s?$(n+"async_progress_dialog").hide():"function"==typeof go_popup?go_popup(n+"async_progress_dialog",!0,!1):(e?dnmClosePopup:closePopup)(n+"async_progress_dialog"),null!=asyncProgressOptions.onCancel&&asyncProgressOptions.onCancel()}var dnUtilsNextId=-1e7;function dnGetNextId(){return--dnUtilsNextId+1}function dnGetElId(n){return null!=n.id&&""!=n.id||(n.id="tmp_id_"+dnGetNextId()),n.id}var dnWaitingActions={};function dnWaitingStart(n,s){var e,t,o,r,i,a;return null==s&&(s={}
738),null==(n="string"==typeof n?document.getElementById(n):n)||(e=$dnj(n),1!=s.allowHidden&&e.is(":hidden"))?null:(n=dnGetElId(n),t=dnInDnm()?"dnm-":"dn-",null!=dnWaitingActions[n]&&(log("Stopping existing async action "+n),dnWaitingFinish({id:n,version:dnWaitingActions[n].version})),"absolute"!=(o=e.css("position"))&&"fixed"!=o&&"relative"!=o&&(o=e.get(0).style.position,e.css("position","relative")),s=s.zIndex||3e3,(r=document.createElement("DIV")).style.zIndex=s,r.className=t+"async-action-container",(i=document.createElement("DIV")).style.zIndex=s,i.className=t+"async-action-background",(a=document.createElement("DIV")).style.zIndex=s,a.className=t+"async-action",a.innerHTML="<img src='/images/loading-oval.svg' alt='[]' />",r.id="dnWaiting_"+n+"_c",i.id="dnWaiting_"+n+"_bg",a.id="dnWaiting_"+n,e.append(r),r.appendChild(i),r.appendChild(a),s=dnGetNextId(),dnWaitingActions[n]={indicator:a,background:r,container:e,version:s,at:(new Date).getTime(),originalPosition:o},{id:n,version:s})}function dnWaitingFinish(n){if(null!=n){var s=n.id,e=dnWaitingActions[s];if(null==e)log("asyncFinish ignored ("+s+" not in asyncActions)");else{var t=document.getElementById(s),o=!1;if(null!=t&&t==e.container.get(0)||(null==t?log("container has been removed, stoping async action"):log("container element has changed, stoping async action"),o=!0),o||e.version==n.version){delete dnWaitingActions[s];try{e.indicator&&(e.indicator.remove(),e.indicator=null),e.background&&(e.background.remove(),e.background=null),null!=e.originalPosition&&e.container.css("position",e.originalPosition)}catch(n){}}else log("asyncFinish ignored ("+e.version+" != "+n.version+")")}}}function dnWaitingFinishAll(){for(var n in dnWaitingFinish)dnWaitingFinish({id:n,version:dnWaitingFinish[n].version})}function dnCheckWaitingActions(){var n,s=[];for(n in dnWaitingFinish){var e=(new Date).getTime(),t=dnWaitingFinish[n];3e3<e-t.at&&(null!=(e=document.getElementById(t.id))&&e==t.container.get(0)||(log("dnCheckWatingActions found invalid action container:"+t.id),s.push({id:t.id,version:t.version})))}for(var o=0;o<s.length;o++)dnWaitingFinish(s[o]);window.setTimeout(function(){dnCheckWaitingActions()},1e3)}function isNumeric(n){for(var s,e=!0,t=0;t<n.length&&1==e;t++)s=n.charAt(t),-1=="0123456789.".indexOf(s)&&(e=!1);return e}function getIntegerValue(n,s,e,t){e=e||0;var o=parseInt(n.value,10);return isNaN(o)&&(o=e),isNumeric(n.value)&&o==parseInt(o,10)||(o=parseInt(o,10)),null!=s&&s<o&&(o=s),n.value=o=null!=t&&o<t?t:o}function addUrlParam(n,s,e){return""==s||null==s||null!=e&&null!=n&&-1!=n.indexOf(e+"=")?n:null==n?null:-1!=n.indexOf("?")?n+"&"+s:n+"?"+s}function dnGetCallStackDescription(n,s){null==s&&(s=6),null==n&&(n=0);var e=[];try{for(var t=dnGetCallStackDescription.caller;0<n&&null!=t;)t=t.caller,n--;for(var o=0;o<s&&null!=t;){var r,i=t.toString();null!=i?(r=i.indexOf("("),"function "==(i=i.substr(0,r)).substr(0,9)&&(i=i.substr(9,i.length))):i="unknown",e.push(i),t=t.caller,o+=1}}catch(n){log("Unable to get call stack for dnGetCallStackDescription"),e.push("error")}return encodeURIComponent(e.join("-"))}function dnGetAjaxUrl(n,s){return"undefined"!=typeof dnDebugAjax&&0!=dnDebugAjax&&(n=addUrlParam("email_request_log=",dnDebugAjax)),n=null!=s&&1==s.skipCallStack?n:addUrlParam(n,"_cstack="+dnGetCallStackDescription(1),"_cstack")}function dnFindBestPosition(n,s,e,t){for(var o,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,a=$dnj(window).scrollTop(),c=$dnj(window).scrollLeft(),l=(t=(t=void 0===t?"l,t,r,b":t).split(","),e.bottom=e.top+e.height,e.right=e.left+e.width,[]),u=0;u<t.length;u++){var p=t[u];"l"===p?l.push({left:e.left-n,top:e.top}):"t"===p?l.push({left:e.left,top:e.top-s}):"r"==p?l.push({left:e.left+e.width,top:e.top}):"b"===p&&l.push({left:e.left,top:e.top+e.height})}for(u=0;u<l.length;u++){(o=l[u]).left+n-c>r&&(o.left=r-n+c),o.left-c<0&&(o.left=c),i<o.top+s-a&&(o.top=i-s+a),o.top-a<0&&(o.top=a),o.bottom=o.top+s,o.right=o.left+n;var d=Math.max(0,Math.min(e.bottom,o.bottom)-Math.max(e.top,o.top)),g=Math.max(0,Math.min(e.right,o.right)-Math.max(e.left,o.left));o.overlap=d*g}var y=null;for(u=0;
738u<l.length;u++)(null==y||y.overlap>l[u].overlap)&&(y=l[u]);return y}dnCheckWaitingActions();var _dnEventListeners={};function dnRegisterEventListener(n,s,e){null==_dnEventListeners[n]&&(_dnEventListeners[n]={}),void 0===e&&(e="evl_"+dnGetNextId()),_dnEventListeners[n][e]=s}function dnNotifyEventListeners(n,s){if(null!=_dnEventListeners[n])for(var e in _dnEventListeners[n])_dnEventListeners[n][e](s)}String.prototype.escapeQuotes=function(){return this.replace(/"/g,""").replace(/'/g,"'")}; 739 740(function (global, factory) { 741 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 742 typeof define === 'function' && define.amd ? define(factory) : 743 (global = global || self, global.LazyLoad = factory()); 744}(this, (function () { 'use strict'; 745 746 function _extends() { 747 _extends = Object.assign || function (target) { 748 for (var i = 1; i < arguments.length; i++) { 749 var source = arguments[i]; 750 751 for (var key in source) { 752 if (Object.prototype.hasOwnProperty.call(source, key)) { 753 target[key] = source[key]; 754 } 755 } 756 } 757 758 return target; 759 }; 760 761 return _extends.apply(this, arguments); 762 } 763 764 var runningOnBrowser = typeof window !== "undefined"; 765 var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent); 766 var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window; 767 var supportsClassList = runningOnBrowser && "classList" in document.createElement("p"); 768 var isHiDpi = runningOnBrowser && window.devicePixelRatio > 1; 769 770 var defaultSettings = { 771 elements_selector: "IMG", 772 container: isBot || runningOnBrowser ? document : null, 773 threshold: 300, 774 thresholds: null, 775 data_src: "src", 776 data_srcset: "srcset", 777 data_sizes: "sizes", 778 data_bg: "bg", 779 data_bg_hidpi: "bg-hidpi", 780 data_bg_multi: "bg-multi", 781 data_bg_multi_hidpi: "bg-multi-hidpi", 782 data_poster: "poster", 783 class_applied: "applied", 784 class_loading: "loading", 785 class_loaded: "loaded", 786 class_error: "error", 787 unobserve_completed: true, 788 unobserve_entered: false, 789 cancel_on_exit: false, 790 callback_enter: null, 791 callback_exit: null, 792 callback_applied: null, 793 callback_loading: null, 794 callback_loaded: null, 795 callback_error: null, 796 callback_finish: null, 797 callback_cancel: null, 798 use_native: false 799 }; 800 var getExtendedSettings = function getExtendedSettings(customSettings) { 801 return _extends({}, defaultSettings, customSettings); 802 }; 803 804 /* Creates instance and notifies it through the window element */ 805 var createInstance = function createInstance(classObj, options) { 806 var event; 807 var eventString = "LazyLoad::Initialized"; 808 var instance = new classObj(options); 809 810 try { 811 // Works in modern browsers 812 event = new CustomEvent(eventString, { 813 detail: { 814 instance: instance 815 } 816 }); 817 } catch (err) { 818 // Works in Internet Explorer (all versions) 819 event = document.createEvent("CustomEvent"); 820 event.initCustomEvent(eventString, false, false, { 821 instance: instance 822 }); 823 } 824 825 window.dispatchEvent(event); 826 }; 827 /* Auto initialization of one or more instances of lazyload, depending on the 828 options passed in (plain object or an array) */ 829 830 831 var autoInitialize = function autoInitialize(classObj, options) { 832 if (!options) { 833 return; 834 } 835 836 if (!options.length) { 837 // Plain object 838 createInstance(classObj, options); 839 } else { 840 // Array of objects 841 for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) { 842 createInstance(classObj, optionsItem); 843 } 844 } 845 }; 846 847 var statusLoading = "loading"; 848 var statusLoaded = "loaded"; 849 var statusApplied = "applied"; 850 var statusError = "error"; 851 var statusNative = "native"; 852 853 var dataPrefix = "data-"; 854 var statusDataName = "ll-status"; 855 var getData = function getData(element, attribute) { 856 return element.getAttribute(dataPrefix + attribute); 857 }; 858 var setData = function setData(element, attribute, value) { 859 var attrName = dataPrefix + attribute; 860 861 if (value === null) { 862 element.removeAttribute(attrName); 863 return; 864 } 865 866 element.setAttribute(attrName, value); 867 }; 868 var getStatus = function getStatus(element) { 869 return getData(element, statusDataName); 870 }; 871 var setStatus = function setStatus(element, status) { 872 return setData(element, statusDataName, status); 873 }; 874 var resetStatus = function resetStatus(element) { 875 return setStatus(element, null); 876 }; 877 var hasEmptyStatus = function hasEmptyStatus(element) { 878 return getStatus(element) === null; 879 }; 880 var hasStatusLoading = function hasStatusLoading(element) { 881 return getStatus(element) === statusLoading; 882 }; 883 var hasStatusError = function hasStatusError(element) { 884 return getStatus(element) === statusError; 885 }; 886 var hasStatusNative = function hasStatusNative(element) { 887 return getStatus(element) === statusNative; 888 }; 889 var hadStartedLoading = function hadStartedLoading(element) { 890 return !hasEmptyStatus(element); 891 }; 892 893 var safeCallback = function safeCallback(callback, arg1, arg2, arg3) { 894 if (!callback) { 895 return; 896 } 897 898 if (arg3 !== undefined) { 899 callback(arg1, arg2, arg3); 900 return; 901 } 902 903 if (arg2 !== undefined) { 904 callback(arg1, arg2); 905 return; 906 } 907 908 callback(arg1); 909 }; 910 911 var addClass = function addClass(element, className) { 912 if (supportsClassList) { 913 element.classList.add(className); 914 return; 915 } 916 917 element.className += (element.className ? " " : "") + className; 918 }; 919 var removeClass = function removeClass(element, className) { 920 if (supportsClassList) { 921 element.classList.remove(className); 922 return; 923 } 924 925 element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, ""); 926 }; 927 928 var addTempImage = function addTempImage(element) { 929 element.llTempImage = document.createElement("IMG"); 930 }; 931 var deleteTempImage = function deleteTempImage(element) { 932 delete element.llTempImage; 933 }; 934 var getTempImage = function getTempImage(element) { 935 return element.llTempImage; 936 }; 937 938 var unobserve = function unobserve(element, instance) { 939 if (!instance) return; 940 var observer = instance._observer; 941 if (!observer) return; 942 observer.unobserve(element); 943 }; 944 var resetObserver = function resetObserver(observer) { 945 observer.disconnect(); 946 }; 947 var unobserveIfRequired = function unobserveIfRequired(element, settings, instance) { 948 if (settings.unobserve_entered) unobserve(element, instance); 949 }; 950 951 var updateLoadingCount = function updateLoadingCount(instance, delta) { 952 if (!instance) return; 953 instance.loadingCount += delta; 954 }; 955 var decreaseToLoadCount = function decreaseToLoadCount(instance) { 956 if (!instance) return; 957 instance.toLoadCount -= 1; 958 }; 959 var setToLoadCount = function setToLoadCount(instance, value) { 960 if (!instance) return; 961 instance.toLoadCount = value; 962 }; 963 var isSomethingLoading = function isSomethingLoading(instance) { 964 return instance.loadingCount > 0; 965 }; 966 var haveElementsToLoad = function haveElementsToLoad(instance) { 967 return instance.toLoadCount > 0; 968 }; 969 970 var getSourceTags = function getSourceTags(parentTag) { 971 var sourceTags = []; 972 973 for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) { 974 if (childTag.tagName === "SOURCE") { 975 sourceTags.push(childTag); 976 } 977 } 978 979 return sourceTags; 980 }; 981 var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) { 982 if (!value) { 983 return; 984 } 985 986 element.setAttribute(attrName, value); 987 }; 988 var resetAttribute = function resetAttribute(element, attrName) { 989 element.removeAttribute(attrName); 990 }; 991 var hasOriginalAttributes = function hasOriginalAttributes(element) { 992 return !!element.llOriginalAttrs; 993 }; 994 var saveOriginalImageAttributes = function saveOriginalImageAttributes(element) { 995 if (hasOriginalAttributes(element)) { 996 return; 997 } 998 999 var originalAttributes = {}; 1000 originalAttributes["src"] = element.getAttribute("src"); 1001 originalAttributes["srcset"] = element.getAttribute("srcset"); 1002 originalAttributes["sizes"] = element.getAttribute("sizes"); 1003 element.llOriginalAttrs = originalAttributes; 1004 }; 1005 var restoreOriginalImageAttributes = function restoreOriginalImageAttributes(element) { 1006 if (!hasOriginalAttributes(element)) { 1007 return; 1008 } 1009 1010 var originalAttributes = element.llOriginalAttrs; 1011 setAttributeIfValue(element, "src", originalAttributes["src"]); 1012 setAttributeIfValue(element, "srcset", originalAttributes["srcset"]); 1013 setAttributeIfValue(element, "sizes", originalAttributes["sizes"]); 1014 }; 1015 var setImageAttributes = function setImageAttributes(element, settings) { 1016 setAttributeIfValue(element, "sizes", getData(element, settings.data_sizes)); 1017 setAttributeIfValue(element, "srcset", getData(element, settings.data_srcset)); 1018 setAttributeIfValue(element, "src", getData(element, settings.data_src)); 1019 }; 1020 var resetImageAttributes = function resetImageAttributes(element) { 1021 resetAttribute(element, "src"); 1022 resetAttribute(element, "srcset"); 1023 resetAttribute(element, "sizes"); 1024 };
1025 var forEachPictureSource = function forEachPictureSource(element, fn) { 1026 var parent = element.parentNode; 1027 1028 if (!parent || parent.tagName !== "PICTURE") { 1029 return; 1030 } 1031 1032 var sourceTags = getSourceTags(parent); 1033 sourceTags.forEach(fn); 1034 }; 1035 var forEachVideoSource = function forEachVideoSource(element, fn) { 1036 var sourceTags = getSourceTags(element); 1037 sourceTags.forEach(fn); 1038 }; 1039 var restoreOriginalAttributesImg = function restoreOriginalAttributesImg(element) { 1040 forEachPictureSource(element, function (sourceTag) { 1041 restoreOriginalImageAttributes(sourceTag); 1042 }); 1043 restoreOriginalImageAttributes(element); 1044 }; 1045 var setSourcesImg = function setSourcesImg(element, settings) { 1046 forEachPictureSource(element, function (sourceTag) { 1047 saveOriginalImageAttributes(sourceTag); 1048 setImageAttributes(sourceTag, settings); 1049 }); 1050 saveOriginalImageAttributes(element); 1051 setImageAttributes(element, settings); 1052 }; 1053 var resetSourcesImg = function resetSourcesImg(element) { 1054 forEachPictureSource(element, function (sourceTag) { 1055 resetImageAttributes(sourceTag); 1056 }); 1057 resetImageAttributes(element); 1058 }; 1059 var setSourcesIframe = function setSourcesIframe(element, settings) { 1060 setAttributeIfValue(element, "src", getData(element, settings.data_src)); 1061 }; 1062 var setSourcesVideo = function setSourcesVideo(element, settings) { 1063 forEachVideoSource(element, function (sourceTag) { 1064 setAttributeIfValue(sourceTag, "src", getData(sourceTag, settings.data_src)); 1065 }); 1066 setAttributeIfValue(element, "poster", getData(element, settings.data_poster)); 1067 setAttributeIfValue(element, "src", getData(element, settings.data_src)); 1068 element.load(); 1069 }; 1070 var setSourcesFunctions = { 1071 IMG: setSourcesImg, 1072 IFRAME: setSourcesIframe, 1073 VIDEO: setSourcesVideo 1074 }; 1075 var setBackground = function setBackground(element, settings, instance) { 1076 var bg1xValue = getData(element, settings.data_bg); 1077 var bgHiDpiValue = getData(element, settings.data_bg_hidpi); 1078 var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue; 1079 if (!bgDataValue) return; 1080 element.style.backgroundImage = "url(\"".concat(bgDataValue, "\")"); 1081 getTempImage(element).setAttribute("src", bgDataValue); 1082 manageLoading(element, settings, instance); 1083 }; // NOTE: THE TEMP IMAGE TRICK CANNOT BE DONE WITH data-multi-bg 1084 // BECAUSE INSIDE ITS VALUES MUST BE WRAPPED WITH URL() AND ONE OF THEM 1085 // COULD BE A GRADIENT BACKGROUND IMAGE 1086 1087 var setMultiBackground = function setMultiBackground(element, settings, instance) { 1088 var bg1xValue = getData(element, settings.data_bg_multi); 1089 var bgHiDpiValue = getData(element, settings.data_bg_multi_hidpi); 1090 var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue; 1091 1092 if (!bgDataValue) { 1093 return; 1094 } 1095 1096 element.style.backgroundImage = bgDataValue; 1097 manageApplied(element, settings, instance); 1098 }; 1099 var setSources = function setSources(element, settings) { 1100 var setSourcesFunction = setSourcesFunctions[element.tagName]; 1101 1102 if (!setSourcesFunction) { 1103 return; 1104 } 1105 1106 setSourcesFunction(element, settings); 1107 }; 1108 var manageApplied = function manageApplied(element, settings, instance) { 1109 addClass(element, settings.class_applied); 1110 setStatus(element, statusApplied); 1111 removeDataMultiBackground(element, settings); 1112 1113 if (settings.unobserve_completed) { 1114 // Unobserve now because we can't do it on load 1115 unobserve(element, settings); 1116 } 1117 1118 safeCallback(settings.callback_applied, element, instance); 1119 }; 1120 var manageLoading = function manageLoading(element, settings, instance) { 1121 updateLoadingCount(instance, +1); 1122 addClass(element, settings.class_loading); 1123 setStatus(element, statusLoading); 1124 safeCallback(settings.callback_loading, element, instance); 1125 }; // REMOVE DATA ATTRIBUTES -------------- 1126 1127 var removeDataImg = function removeDataImg(element, settings) { 1128 setData(element, settings.data_src, null); 1129 setData(element, settings.data_srcset, null); 1130 setData(element, settings.data_sizes, null);
1131 forEachPictureSource(element, function (sourceTag) { 1132 setData(sourceTag, settings.data_srcset, null); 1133 setData(sourceTag, settings.data_sizes, null); 1134 }); 1135 }; 1136 var removeDataIframe = function removeDataIframe(element, settings) { 1137 setData(element, settings.data_src, null); 1138 }; 1139 var removeDataVideo = function removeDataVideo(element, settings) { 1140 setData(element, settings.data_src, null); 1141 setData(element, settings.data_poster, null); 1142 forEachVideoSource(element, function (sourceTag) { 1143 setData(sourceTag, settings.data_src, null); 1144 }); 1145 }; 1146 var removeDataFunctions = { 1147 IMG: removeDataImg, 1148 IFRAME: removeDataIframe, 1149 VIDEO: removeDataVideo 1150 }; 1151 var removeDataBackground = function removeDataBackground(element, settings) { 1152 setData(element, settings.data_bg, null); 1153 setData(element, settings.data_bg_hidpi, null); 1154 }; 1155 var removeDataMultiBackground = function removeDataMultiBackground(element, settings) { 1156 setData(element, settings.data_bg_multi, null); 1157 setData(element, settings.data_bg_multi_hidpi, null); 1158 }; 1159 var removeDataAttributes = function removeDataAttributes(element, settings) { 1160 var removeDataFunction = removeDataFunctions[element.tagName]; 1161 1162 if (removeDataFunction) { 1163 removeDataFunction(element, settings); 1164 return; 1165 } 1166 1167 removeDataBackground(element, settings); 1168 }; 1169 1170 var elementsWithLoadEvent = ["IMG", "IFRAME", "VIDEO"]; 1171 var hasLoadEvent = function hasLoadEvent(element) { 1172 return elementsWithLoadEvent.indexOf(element.tagName) > -1; 1173 }; 1174 var checkFinish = function checkFinish(settings, instance) { 1175 if (instance && !isSomethingLoading(instance) && !haveElementsToLoad(instance)) { 1176 safeCallback(settings.callback_finish, instance); 1177 } 1178 }; 1179 var addEventListener = function addEventListener(element, eventName, handler) { 1180 element.addEventListener(eventName, handler); 1181 element.llEvLisnrs[eventName] = handler; 1182 }; 1183 var removeEventListener = function removeEventListener(element, eventName, handler) { 1184 element.removeEventListener(eventName, handler); 1185 }; 1186 var hasEventListeners = function hasEventListeners(element) { 1187 return !!element.llEvLisnrs; 1188 }; 1189 var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) { 1190 if (!hasEventListeners(element)) element.llEvLisnrs = {}; 1191 var loadEventName = element.tagName === "VIDEO" ? "loadeddata" : "load"; 1192 addEventListener(element, loadEventName, loadHandler); 1193 addEventListener(element, "error", errorHandler); 1194 }; 1195 var removeEventListeners = function removeEventListeners(element) { 1196 if (!hasEventListeners(element)) { 1197 return; 1198 } 1199 1200 var eventListeners = element.llEvLisnrs; 1201 1202 for (var eventName in eventListeners) { 1203 var handler = eventListeners[eventName]; 1204 removeEventListener(element, eventName, handler); 1205 } 1206 1207 delete element.llEvLisnrs; 1208 }; 1209 var doneHandler = function doneHandler(element, settings, instance) { 1210 deleteTempImage(element); 1211 updateLoadingCount(instance, -1); 1212 decreaseToLoadCount(instance); 1213 removeClass(element, settings.class_loading); 1214 1215 if (settings.unobserve_completed) { 1216 unobserve(element, instance); 1217 } 1218 }; 1219 var loadHandler = function loadHandler(event, element, settings, instance) { 1220 var goingNative = hasStatusNative(element); 1221 doneHandler(element, settings, instance); 1222 addClass(element, settings.class_loaded); 1223 setStatus(element, statusLoaded); 1224 removeDataAttributes(element, settings); 1225 safeCallback(settings.callback_loaded, element, instance); 1226 if (!goingNative) checkFinish(settings, instance); 1227 }; 1228 var errorHandler = function errorHandler(event, element, settings, instance) { 1229 var goingNative = hasStatusNative(element); 1230 doneHandler(element, settings, instance); 1231 addClass(element, settings.class_error); 1232 setStatus(element, statusError); 1233 safeCallback(settings.callback_error, element, instance); 1234 if (!goingNative) checkFinish(settings, instance); 1235 }; 1236 var addOneShotEventListeners = function addOneShotEventListeners(element, settings, instance) { 1237 var elementToListenTo = getTempImage(element) || element; 1238 1239 if (hasEventListeners(elementToListenTo)) { 1240 // This happens when loading is retried twice 1241 return; 1242 } 1243 1244 var _loadHandler = function _loadHandler(event) { 1245 loadHandler(event, element, settings, instance); 1246 removeEventListeners(elementToListenTo); 1247 }; 1248 1249 var _errorHandler = function _errorHandler(event) { 1250 errorHandler(event, element, settings, instance); 1251 removeEventListeners(elementToListenTo); 1252 }; 1253 1254 addEventListeners(elementToListenTo, _loadHandler, _errorHandler); 1255 }; 1256
1257 var loadBackground = function loadBackground(element, settings, instance) { 1258 addTempImage(element); 1259 addOneShotEventListeners(element, settings, instance); 1260 setBackground(element, settings, instance); 1261 setMultiBackground(element, settings, instance); 1262 }; 1263 1264 var loadRegular = function loadRegular(element, settings, instance) { 1265 addOneShotEventListeners(element, settings, instance); 1266 setSources(element, settings); 1267 manageLoading(element, settings, instance); 1268 }; 1269 1270 var load = function load(element, settings, instance) { 1271 if (hasLoadEvent(element)) { 1272 loadRegular(element, settings, instance); 1273 } else { 1274 loadBackground(element, settings, instance); 1275 } 1276 }; 1277 var loadNative = function loadNative(element, settings, instance) { 1278 addOneShotEventListeners(element, settings, instance); 1279 setSources(element, settings); 1280 removeDataAttributes(element, settings); 1281 setStatus(element, statusNative); 1282 }; 1283 1284 var cancelLoadingIfRequired = function cancelLoadingIfRequired(element, entry, settings, instance) { 1285 if (!settings.cancel_on_exit) return; 1286 if (!hasStatusLoading(element)) return; 1287 if (element.tagName !== "IMG") return; //Works only on images 1288 1289 removeEventListeners(element); 1290 resetSourcesImg(element); 1291 restoreOriginalAttributesImg(element); 1292 removeClass(element, settings.class_loading); 1293 updateLoadingCount(instance, -1); 1294 resetStatus(element); 1295 safeCallback(settings.callback_cancel, element, entry, instance); 1296 }; 1297 1298 var onEnter = function onEnter(element, entry, settings, instance) { 1299 safeCallback(settings.callback_enter, element, entry, instance); 1300 unobserveIfRequired(element, settings, instance); 1301 if (hadStartedLoading(element)) return; //Prevent loading it again 1302 1303 load(element, settings, instance); 1304 }; 1305 var onExit = function onExit(element, entry, settings, instance) { 1306 if (hasEmptyStatus(element)) return; //Ignore the first pass, at landing 1307 1308 cancelLoadingIfRequired(element, entry, settings, instance); 1309 safeCallback(settings.callback_exit, element, entry, instance); 1310 }; 1311 1312 var tagsWithNativeLazy = ["IMG", "IFRAME"]; 1313 var shouldUseNative = function shouldUseNative(settings) { 1314 return settings.use_native && "loading" in HTMLImageElement.prototype; 1315 }; 1316 var loadAllNative = function loadAllNative(elements, settings, instance) { 1317 elements.forEach(function (element) { 1318 if (tagsWithNativeLazy.indexOf(element.tagName) === -1) { 1319 return; 1320 } 1321 1322 element.setAttribute("loading", "lazy"); //TODO: Move inside the loadNative method 1323 1324 loadNative(element, settings, instance); 1325 }); 1326 setToLoadCount(instance, 0); 1327 }; 1328 1329 var isIntersecting = function isIntersecting(entry) { 1330 return entry.isIntersecting || entry.intersectionRatio > 0; 1331 }; 1332 1333 var getObserverSettings = function getObserverSettings(settings) { 1334 return { 1335 root: settings.container === document ? null : settings.container, 1336 rootMargin: settings.thresholds || settings.threshold + "px" 1337 }; 1338 }; 1339 1340 var intersectionHandler = function intersectionHandler(entries, settings, instance) { 1341 entries.forEach(function (entry) { 1342 return isIntersecting(entry) ? onEnter(entry.target, entry, settings, instance) : onExit(entry.target, entry, settings, instance); 1343 }); 1344 }; 1345 1346 var observeElements = function observeElements(observer, elements) { 1347 elements.forEach(function (element) { 1348 observer.observe(element); 1349 }); 1350 }; 1351 var updateObserver = function updateObserver(observer, elementsToObserve) { 1352 resetObserver(observer); 1353 observeElements(observer, elementsToObserve); 1354 }; 1355 var setObserver = function setObserver(settings, instance) { 1356 if (!supportsIntersectionObserver || shouldUseNative(settings)) { 1357 return; 1358 } 1359 1360 instance._observer = new IntersectionObserver(function (entries) { 1361 intersectionHandler(entries, settings, instance); 1362 }, getObserverSettings(settings)); 1363 }; 1364 1365 var toArray = function toArray(nodeSet) { 1366 return Array.prototype.slice.call(nodeSet); 1367 }; 1368 var queryElements = function queryElements(settings) {
1369 return settings.container.querySelectorAll(settings.elements_selector); 1370 }; 1371 var excludeManagedElements = function excludeManagedElements(elements) { 1372 return toArray(elements).filter(hasEmptyStatus); 1373 }; 1374 var hasError = function hasError(element) { 1375 return hasStatusError(element); 1376 }; 1377 var filterErrorElements = function filterErrorElements(elements) { 1378 return toArray(elements).filter(hasError); 1379 }; 1380 var getElementsToLoad = function getElementsToLoad(elements, settings) { 1381 return excludeManagedElements(elements || queryElements(settings)); 1382 }; 1383 1384 var retryLazyLoad = function retryLazyLoad(settings, instance) { 1385 var errorElements = filterErrorElements(queryElements(settings)); 1386 errorElements.forEach(function (element) { 1387 removeClass(element, settings.class_error); 1388 resetStatus(element); 1389 }); 1390 instance.update(); 1391 }; 1392 var setOnlineCheck = function setOnlineCheck(settings, instance) { 1393 if (!runningOnBrowser) { 1394 return; 1395 } 1396 1397 window.addEventListener("online", function () { 1398 retryLazyLoad(settings, instance); 1399 }); 1400 }; 1401 1402 var LazyLoad = function LazyLoad(customSettings, elements) { 1403 var settings = getExtendedSettings(customSettings); 1404 this._settings = settings; 1405 this.loadingCount = 0; 1406 setObserver(settings, this); 1407 setOnlineCheck(settings, this); 1408 this.update(elements); 1409 }; 1410 1411 LazyLoad.prototype = { 1412 update: function update(givenNodeset) { 1413 var settings = this._settings; 1414 var elementsToLoad = getElementsToLoad(givenNodeset, settings); 1415 setToLoadCount(this, elementsToLoad.length); 1416 1417 if (isBot || !supportsIntersectionObserver) { 1418 this.loadAll(elementsToLoad); 1419 return; 1420 } 1421 1422 if (shouldUseNative(settings)) { 1423 loadAllNative(elementsToLoad, settings, this); 1424 return; 1425 } 1426 1427 updateObserver(this._observer, elementsToLoad); 1428 }, 1429 destroy: function destroy() { 1430 // Observer 1431 if (this._observer) { 1432 this._observer.disconnect(); 1433 } // Clean custom attributes on elements 1434 1435 1436 queryElements(this._settings).forEach(function (element) { 1437 delete element.llOriginalAttrs; 1438 }); // Delete all internal props 1439 1440 delete this._observer; 1441 delete this._settings; 1442 delete this.loadingCount; 1443 delete this.toLoadCount; 1444 }, 1445 loadAll: function loadAll(elements) { 1446 var _this = this; 1447 1448 var settings = this._settings; 1449 var elementsToLoad = getElementsToLoad(elements, settings); 1450 elementsToLoad.forEach(function (element) { 1451 load(element, settings, _this); 1452 }); 1453 } 1454 }; 1455 1456 LazyLoad.load = function (element, customSettings) { 1457 var settings = getExtendedSettings(customSettings); 1458 load(element, settings); 1459 }; 1460 1461 LazyLoad.resetStatus = function (element) { 1462 resetStatus(element); 1463 }; // Automatic instances creation if required (useful for async script loading) 1464 1465 1466 if (runningOnBrowser) { 1467 autoInitialize(LazyLoad, window.lazyLoadOptions); 1468 } 1469 1470 return LazyLoad; 1471 1472}))); 1473 1474 1475"use strict";var DnForm=function(e){var i=this,t={},n={};this.fields=[],this.prefix=e.prefix;for(var l=0;l<e.fields.length;l++){var r=new DnFormField(this,e.fields[l]);t[r.name]=r,n[r.fieldId()]=r,i.fields.push(r)}this.field=function(e){return t[e]},this.fieldById=function(e){return n[e]},this.submitTo=function(e,t,n){null==t&&(t={});for(var l=[],r=0;r<i.fields.length;r++){var a=i.fields[r],s=document.getElementById(a.fieldId());null!=s&&l.push(s)}var u=$dnj(l).serialize();dnCallJsonApiEndpoint(e,u,t,n)},this.updateHtmlValues=function(){for(var e=0;e<i.fields.length;e++)i.fields[e].updateHtmlValue()}},DnFormField=function(e,i){var t=this;if(this.code=i.code,this.value=i.value,this.name=i.name,this.error=i.error,this.required=1==i.required,this.options=[],null!=i.options)for(var n=0;n<i.options.length;n++){var l=i.options[n];1==l.length?this.options.push({caption:l[0],value:l[0]}):this.options.push({caption:l[0],value:l[1]})}this.fieldType=i.field_type,this.htmlOptions=i.html_options,this.caption=i.caption,this.settings=i.settings,i.no_prefix?this.prefix="":null!=i.prefix?this.prefix=i.prefix:this.prefix=e.prefix,Object.defineProperty(this,"hasError",{get:function(){return null!=t.error&&""!=t.error}}),this.fieldId=function(){return null!=i.id?i.id:null!=t.prefix&&""!=t.prefix?t.prefix+"_"+t.name:t.name},this.fieldName=function(){return null!=t.prefix&&""!=t.prefix?t.prefix+"["+t.name+"]":t.name},this.textValue=function(){return null==t.value?"":system.utils.htmlEscape(t.value)},this.hasValue=function(e){if(t.value==e)return!0;
1475if("array"==typeof t.value)for(var i=0;i<t.value.length;i++){var n=t.value[i];if(n==e)return!0}return!1},this.isList=function(){switch(t.fieldType){case FieldDataType.PRODUCT_SIZE:case FieldDataType.LIST_DROPDOWN:case FieldDataType.LIST_CHECKBOX:case FieldDataType.LIST_RADIO:case FieldDataType.LIST_MULTISELECT:return!0}return!1},this.updateHtmlValue=function(){if(t.fieldType==FieldDataType.LIST_CHECKBOX||t.fieldType==FieldDataType.LIST_RADIO)for(var e=0;e<t.options.length;e++);else{var i=t.getFormFieldElement();1==i.length&&i.val(t.value)}},this.updateValueFromHtml=function(){if(t.fieldType==FieldDataType.LIST_CHECKBOX||t.fieldType==FieldDataType.LIST_RADIO)for(var e=0;e<t.options.length;e++);else{var i=t.getFormFieldElement();1==i.length&&(t.value=i.val())}},this.isValid=function(){if(t.required)if(t.isList()){if("array"==typeof t.value){if(0==t.value.lengtth)return!1}else if(null==t.value||""==t.value)return!1}else if(null==t.value||""==t.value)return!1;return!0},this.getFormFieldElement=function(){return $dnj("#"+t.fieldId())},this.getContainerElement=function(){return $dnj("#"+t.fieldId()+"_container")}},FieldDataType={PRODUCT_SIZE:0,LIST_DROPDOWN:2,LIST_CHECKBOX:3,LIST_RADIO:4,LIST_MULTISELECT:5,TEXT_BOX:7,TEXT_AREA:8,FILE:9,IMAGE:10,DATE:11,DATE_TIME:12,TIME:13,CHECKBOX:20,PASSWORD:21}; 1476var TYPE_RESOURCE=0,TYPE_DESIGN_CATEGORY=1,DnHierarchy=function(e){var l=this,i=(this.nodes={},this.rootNode=null,this.showRoot=1==e.showRoot,this.rootLabel=e.rootLabel,this.allowEdit=1==e.allowEdit,this.containerId=e.containerId,this.hierarchyType=e.hierarchyType,e.callbacks||{}),s=null;this.registerNode=function(e){this.nodes[e.id]=e},this.deRegisterNode=function(e){delete this.nodes[e]},this.getSelectedNode=function(){return s},this.loadNodes=function(e){for(var n=0,t=[];0<e.length&&n!=e.length;){for(var n=e.length,i=0;i<e.length;i++){var l,s=e[i];null==s.parent_id||0==s.parent_id?(s.isRoot=!0,this.rootNode=new DnHierarchyNode(this,s),this.registerNode(this.rootNode)):null==(l=this.nodes[s.parent_id])?t.push(s):(s.parent=l,s=new DnHierarchyNode(this,s),this.registerNode(s),l.addChild(s))}e=t,t=[]}},this.fetchNodes=function(e,i){$dnj.ajax({type:"GET",url:"/manage_site/hierarchy/fetch",data:e,dataType:"json"}).done(function(e){l.loadNodes(e.nodes),null!=i&&i(!0)}).fail(function(e,n,t){e=dnmExtractJsonError(e,n,t);1!=e.handled&&(e.json?dnmMsgBox("Error Occured",e.message+" ("+e.code+")",null,"OK",null,null,null):dnmMsgBox("Communication Error Occured",e.message+" ("+e.code+")",null,"OK",null,null,null)),null!=i&&i(!1)})},this.setSelectedNode=function(n,t,i){s==n&&1!=t?null!=i&&i():null!=s?this.fireCallback("deselect",{node:s},function(e){0!=e?(s.clearNavigation(),s.setSelected(!1),s.updateClasses(),s=null,l.setSelectedNode(n,t,i)):null!=i&&i()}):null!=n?this.fireCallback("select",{node:n},function(e){0!=e&&((s=n).setSelected(!0),s.setNavigated(!0),s.updateClasses(),s.showNavigated()),null!=i&&i()}):null!=i&&i()},this.bind=function(){this.rootNode.bind()},this.fireCallback=function(e,n,t){null!=i[e]?i[e](n,t):null!=t&&t(null)},this.getNodeList=function(){var e=[];return this.rootNode.getNodeList("",e),e}},DnHierarchyNode=function(t,n){var l=this,s=(this.hierarchy=t,this.id=n.id,this.type=n.type,this.parent=n.parent,n.name),e=!1,i=1==n.navigated,d=1==n.selected;this.children=new MapList(l),this.addChild=function(e){this.children.add(e)},this.hasChildren=function(){return 0<this.children.list.length||1==n.has_children},this.isRoot=function(){return null==this.parent},this.name=function(){return this.isRoot()&&this.hierarchy.showRoot?this.hierarchy.rootLabel:null==s?"":s},this.nameWithPath=function(){if(null!=this.parent){var e=this.parent.nameWithPath();if(""!=e)return e+"/"+this.name()}return this.name()},this.getNodeList=function(e,n){if(this.isRoot()&&!this.hierarchy.showRoot||(n.push([e+this.name(),this.id]),e+=" "),this.hasChildren())for(var t=0;t<this.children.list.length;t++)this.children.list[t].getNodeList(e,n)},this.refresh=function(){this.containerEl.replaceWith(this.renderHtml()),this.bind()},this.renderHtml=function(){var e=null;return null==(e=n.isRoot?Jst.templates["sundry.hierarchy.node.root"]:e)&&null==(e=Jst.templates["sundry.hierarchy.node."+this.type])&&null==(e=Jst.templates["sundry.hierarchy.node"])?"No JST Template Found":Jst.run(e,{node:this})}
1476,this.bind=function(){this.containerEl=$dnj("#dhn_"+this.id),this.labelEl=$dnj("#dhnl_"+this.id),this.labelEl.click(function(e){l.hierarchy.setSelectedNode(l)}),this.allowEdit()&&($dnj("#dhnaa_"+this.id).click(function(e){l.hierarchy.setSelectedNode(l,!1,function(){l.hierarchy.fireCallback("addNode",{node:l},null)})}),$dnj("#dhnae_"+this.id).click(function(e){l.hierarchy.setSelectedNode(l,!1,function(){l.hierarchy.fireCallback("editNode",{node:l},null)})}),$dnj("#dhnad_"+this.id).click(function(e){l.hierarchy.setSelectedNode(l,!1,function(){l.hierarchy.fireCallback("deleteNode",{node:l},null)})})),this.hasChildren()&&(this.expanderEl=$dnj("#dhne_"+this.id),this.expanderEl.click(function(e){l.toggleExpand()}),this.childrenEl=$dnj("#dhnc_"+this.id));for(var e=0;e<this.children.list.length;e++)this.children.list[e].bind()},this.toggleExpand=function(){e?(this.containerEl.removeClass("dnm-expanded"),e=!1):(e=!0,this.containerEl.addClass("dnm-expanded"))},this.showNavigated=function(){i?(1!=e&&this.toggleExpand(),null!=this.parent&&this.parent.showNavigated()):d&&null!=this.parent&&this.parent.showNavigated()},this.allowEdit=function(){return this.hierarchy.allowEdit},this.navigated=function(){return i},this.selected=function(){return d},this.setSelected=function(e){d=e},this.setNavigated=function(e){e||(i=!0),null!=this.parent&&this.parent.setNavigated(!1)},this.clearNavigation=function(){i=!1,null!=this.parent&&this.parent.clearNavigation()},this.updateClasses=function(){null!=this.containerEl&&(d?this.containerEl.addClass("dnm-selected"):this.containerEl.removeClass("dnm-selected"),e||n.isRoot?this.containerEl.addClass("dnm-expanded"):this.containerEl.removeClass("dnm-expanded"))}
1476,this.isExpanded=function(){return e||n.isRoot},this.addChildToServer=function(e,i){e.parent_id=this.id;var n;$dnj.ajax({type:"POST",url:"/manage_site/hierarchy/add_node",data:e,dataType:"json"}).done(function(e){e.parent=l,n=new DnHierarchyNode(l.hierarchy,e),l.hierarchy.registerNode(n),l.addChild(n),i(n)}).fail(function(e,n,t){e=dnmExtractJsonError(e,n,t);1!=e.handled&&(e.json?dnmMsgBox("Error Occured",e.message+" ("+e.code+")",null,"OK",null,null,null):dnmMsgBox("Communication Error Occured",e.message+" ("+e.code+")",null,"OK",null,null,null)),i(null)})},this.deleteNode=function(i){var e={id:this.id};$dnj.ajax({type:"POST",url:"/manage_site/hierarchy/delete",data:e,dataType:"json"}).done(function(e){e.success&&l.remove(),null!=i&&i()}).fail(function(e,n,t){e=dnmExtractJsonError(e,n,t);1!=e.handled&&(e.json?dnmMsgBox("Error Occured",e.message+" ("+e.code+")",null,"OK",null,null,null):dnmMsgBox("Communication Error Occured",e.message+" ("+e.code+")",null,"OK",null,null,null)),null!=i&&i()})},this.remove=function(){if(this.hasChildren()){for(var e=[],n=0;n<this.children.list.length;n++)e.push(this.children.list[n]);for(n=0;n<e.length;n++)e[n].remove()}t.deRegisterNode(this.id),null!=this.parent&&this.parent.children.remove(this.id)},this.renameNode=function(n,i){var e={id:this.id,name:n};$dnj.ajax({type:"POST",url:"/manage_site/hierarchy/rename",data:e,dataType:"json"}).done(function(e){e.success&&(s=n),null!=i&&i()}).fail(function(e,n,t){e=dnmExtractJsonError(e,n,t);1!=e.handled&&(e.json?dnmMsgBox("Error Occured",e.message+" ("+e.code+")",null,"OK",null,null,null):dnmMsgBox("Communication Error Occured",e.message+" ("+e.code+")",null,"OK",null,null,null)),null!=i&&i()})},this.setName=function(e){s=e}}; 1477function dnPostATag(n,e){var o=document.createElement("form");o.style.display="none",n.parentNode.appendChild(o),dnInsertCSRFField(o),o.method="POST",o.action=n.href,o.submit()}function dnPostLink(n,e){null==e&&(e={});var o=document.createElement("form");o.style.display="none",document.body.appendChild(o),dnInsertCSRFField(o),e.iframeMode&&dnInsertSessionField(o),o.method="POST",o.action=n,o.submit()}function dnInsertCSRFField(n){var e=document.createElement("input");e.type="hidden",e.name="authenticity_token",e.value=dnCSRFToken,n.appendChild(e)}function dnInsertSessionField(n){var e=document.createElement("input"),e=(e.type="hidden",e.name="_pc_session_id",e.value=pcSID,n.appendChild(e),document.createElement("input"));e.type="hidden",e.name="_pc_skey",e.value=pcSKey,n.appendChild(e)}var dnFormSubmitListeners={};function dnAddSubmitFormListener(n,e){dnFormSubmitListeners[n]=e}function dnSubmitForm(n){for(var e in dnFormSubmitListeners)if(0==dnFormSubmitListeners[e]())return;for(;null!=n&&"FORM"!=n.tagName;)n=n.parentElement;null!=n&&$dnj(n).trigger("submit")}function cclz(n,e){return dnSiteSystemVersion<3?n:e}var dnCurrentPopupId=null,dnPopupStack=[],dnPopupListeners=[],dnPopupScrollPosition=null,dnPopupFocusHistory=[];function dnPopup(n,e){null==e&&(e={});var o=document.activeElement,t=$dnj("#"+n);null==t?alert("unable to get element:"+n):(null==dnPopupScrollPosition&&(dnPopupScrollPosition=$dnj(document.body).scrollTop()),null!=dnCurrentPopupId&&(log("added "+dnCurrentPopupId+" to popupStack"),dnPopupStack.push(dnCurrentPopupId),$dnj("#"+dnCurrentPopupId).removeClass("dn-alt"),notifyPopupListeners("hide",dnCurrentPopupId)),dnPopupFocusHistory.push(o),dnCurrentPopupId=n,t.addClass("dn-alt"),$dnj(document.body).addClass("dn-popup-visible"),e.ignoreMonitorPopupContent||e.alreadySized?e.alreadySized||dnInitPopupSizeMeta(dnCurrentPopupId,!0):dnMonitorPopupContent(dnCurrentPopupId),"function"==typeof windowResizeEventHandler&&windowResizeEventHandler(null),notifyPopupListeners("popup",dnCurrentPopupId),((o=t.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').first()).length?o:t.attr("tabindex","-1")).focus())}function closePopup(n,e){if(null==e&&(e=!1),dnCurrentPopupId!=(n=null==n?dnCurrentPopupId:n)){log("Closing popup that is not current: "+n);for(var o=[],t=[],d=0;d<dnPopupStack.length;d++)dnPopupStack[d]!=n?(o.push(dnPopupStack[d]),t.push(dnPopupFocusHistory[d])):log("Removed popup from stack:"+n),dnPopupStack=o,dnPopupFocusHistory=t}else{var u,p=$dnj("#"+n);null==p?alert("unable to get popup element"):(log("closePopup("+n+")"),p.removeClass("dn-alt"),notifyPopupListeners("closePopup",
1477n),u=dnPopupFocusHistory.pop(),0<dnPopupStack.length?(dnCurrentPopupId=dnPopupStack.pop(),log("pulled "+dnCurrentPopupId+" from popupStack"),$dnj("#"+dnCurrentPopupId).addClass("dn-alt"),dnMonitorPopupContent(dnCurrentPopupId),notifyPopupListeners("restore",dnCurrentPopupId)):(dnCurrentPopupId=null,$dnj(document.body).removeClass("dn-popup-visible"),dnMonitorPopupContent(null),notifyPopupListeners("allClosed",null),null!=dnPopupScrollPosition&&($dnj(document.body).scrollTop(dnPopupScrollPosition),dnPopupScrollPosition=null)),u&&"function"==typeof u.focus&&!e&&setTimeout(function(){u.focus()},0))}}function repositionPopup(){dnMonitorPopupContent(dnCurrentPopupId)}function addPopupListener(n){dnPopupListeners.push(n)}function notifyPopupListeners(n,e){for(var o=0;o<dnPopupListeners.length;o++)dnPopupListeners[o](n,e)}var _dnCurrentPopupEl=null,_dnCurrentPopupContentEl=null,_dnCurrentPopupContentScrollEl=null,_dnCurrentPopupContentContainerEl=null,_dnPopupContentMonitorTimeout=null,_dnCurrentPopupContentSize=null,_dnCurrentPopupFixedPadding=0;function dnInitPopupSizeMeta(n,e){var o,t,d;return null==n?(_dnCurrentPopupContentEl=_dnCurrentPopupEl=null,!1):(n=$dnj("#"+n),n=$dnj(".dn-popup",n),o=$dnj(".dn-popup-content-container",n),t=$dnj(".dn-popup-content-scroll",n),1!=(d=$dnj(".dn-popup-content",n)).length||1!=n.length||1!=t.length||1!=o.length?(log("dnMonitorPopupContent: unable to get content or popup or content scroll element"),_dnCurrentPopupContentContainerEl=_dnCurrentPopupContentScrollEl=_dnCurrentPopupContentEl=_dnCurrentPopupEl=null,!1):(_dnCurrentPopupContentEl=d,_dnCurrentPopupContentScrollEl=t,_dnCurrentPopupContentContainerEl=o,_dnCurrentPopupEl=n,!0))}function dnMonitorPopupContent(n){null!=_dnPopupContentMonitorTimeout&&(window.clearTimeout(_dnPopupContentMonitorTimeout),_dnPopupContentMonitorTimeout=null),dnInitPopupSizeMeta(n,!0)&&(_dnPopupContentMonitorTimeout=window.setTimeout(_dnMonitorPopupContent,200))}function _dnMonitorPopupContent(){null!=_dnPopupContentMonitorTimeout&&(window.clearTimeout(_dnPopupContentMonitorTimeout),_dnPopupContentMonitorTimeout=null),null==_dnCurrentPopupContentEl[0].parentElement&&dnInitPopupSizeMeta(dnCurrentPopupId,!1),_dnCurrentPopupContentContainerEl[0].offsetHeight>_dnCurrentPopupEl[0].offsetHeight+2?_dnCurrentPopupEl.addClass("dn-at-fullheight"):_dnCurrentPopupContentEl[0].clientHeight>_dnCurrentPopupContentScrollEl[0].clientHeight+2&&_dnCurrentPopupEl.removeClass("dn-at-fullheight"),_dnPopupContentMonitorTimeout=window.setTimeout(_dnMonitorPopupContent,200)}var dnDisplayMessageTimeout=null;function dnDisplayMessage(n,e,o){dnHideMessage();var t="",d=$dnj("#dn_page_message");null!=d&&(n=["dn-alert","dn-"+n],null==e&&n.push("dn-with-close"),t='<div class="'+n.join(" ")+'">',null==e?t+='<div class="dn-alert-message">'+o+'</div><div class="dn-alert-close" onclick="dnHideMessage();">x</div>':(t+="<div>"+o+"</div>",dnDisplayMessageTimeout=window.setTimeout(function(){dnDisplayMessageTimeout=null,dnHideMessage()},e)),d.html(t+="</div>"),d.addClass("dn-alt"))}function dnHideMessage(){null!=dnDisplayMessageTimeout&&(window.clearTimeout(dnDisplayMessageTimeout),dnDisplayMessageTimeout=null),$dnj("#dn_page_message").removeClass("dn-alt")}var _dnInlinePopups=[],_dnInlinePopupZIndex=1001;function dnInlinePopup(n,e,o){var t,d=document.activeElement,u=_dnInlinePopupZIndex,p=document.createElement("DIV"),l=(p.className="dn-inline-popup-background",p.id=e+"_background",p.style.zIndex=_dnInlinePopupZIndex,document.body.appendChild(p),null!=o.backgroundClass&&$dnj(p).addClass(o.backgroundClass),p.onclick=function(){dnCloseInlinePopup()},o.delayBackground&&setTimeout(function(){$dnj(p).addClass("dn-alt")},0),_dnInlinePopupZIndex++,$dnj("#"+e)),e=(l.css({zIndex:_dnInlinePopupZIndex}),l.addClass("dn-alt"),_dnInlinePopupZIndex++,_dnInlinePopups.push({id:e,el:n,options:o,z:u,previousFocus:d}),$dnj(n)),u=e.offset(),d=e.height(),n=e.width(),e=(window.innerHeight,window.innerWidth),r=(u.top,document.body.scrollTop,l.height()),i=l.width(),r=("above"==o.valign?(t=u.top-r)<0&&(t=0):"below"==o.valign?(t=u.top+d)<0&&(t=0):"center"==o.valign?(t=u.top+d/2-r/2)<0&&(t=0):t="zero"==o.valign?0:null,null!=(d="left"==o.halign?u.left-i:"lefts"==o.halign?u.left:"r
1477ight"==o.halign?u.left+n:"rights"==o.halign?u.left+n-i:"center"==o.halign?u.left+n/2-i/2:"zero"==o.halign?0:null)&&e<(d=d<0?0:d)+i&&(d=e-i),l.css({top:t,left:d}),null!=o.bodyClass&&$dnj(document.body).addClass(o.bodyClass),l.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').first());(r.length?r:l.attr("tabindex","-1")).focus()}function dnCloseInlinePopup(){var n=_dnInlinePopups.pop(),e=n.id;$dnj("#"+e).removeClass("dn-alt"),_dnInlinePopupZIndex=n.z,null!=n.options&&(n.options.onClose&&n.options.onClose(),null!=n.options.bodyClass&&$dnj(document.body).removeClass(n.options.bodyClass),n.options.delayBackground)?($dnj("#"+e+"_background").removeClass("dn-alt"),setTimeout(function(){$dnj("#"+e+"_background").remove()},n.options.delayBackground)):$dnj("#"+e+"_background").remove(),n.previousFocus&&"function"==typeof n.previousFocus.focus&&setTimeout(function(){n.previousFocus.focus()},0)}function dnCurrentInlinePopup(){return 0<_dnInlinePopups.length?_dnInlinePopups[_dnInlinePopups.length-1].id:null}function dnCallJsonApiEndpoint(d,n,e,u){u=u||function(n,e){};var p=null,e=(null!=e.waitingContainer&&(p=dnWaitingStart(e.waitingContainer,e.waitingOptions)),$dnj.ajax({url:d,data:n,dataType:"json",method:"POST"}));e.done(function(n){dnWaitingFinish(p),u(!0,n)}),e.fail(function(n,e,o){dnWaitingFinish(p),log("Error during api callback to "+d+":"+e);var t=null;try{t=n.responseJSON}catch(n){t=null}u(!1,t=null==t?{error:{message:e,code:"system.error"}}:t)})}function dnUpdateCurrencySelectorLabel(){$dnj("#dn_currency_code").html(pwCurCurCode()),$dnj("#dn_currency_glyph").html(pwCurCurGlyph()),$dnj("#dn_currency_code2").html(pwCurCurCode()),$dnj("#dn_currency_glyph2").html(pwCurCurGlyph()),dnUpdateSelectedCurrencyDropdownClass()}function dnPrepareCurrencySelectorDropdown(){var n=$dnj("#currency_select_list_nodes");if(1==n.length){for(var e=n.html(),o="",t=0;t<pwCurOrder.length;t++){var d=pwCurOrder[t],u=pwCurData[d];o+=e.replace(/\{CC\}/g,u[1]).replace(/\{CN\}/g,u[0]).replace(/\{CG\}/g,u[2]).replace(/\{CID\}/g,d)}n.html(o),dnUpdateSelectedCurrencyDropdownClass()}}function dnSelectCurrency(n){pwSetCurrentCurrency(parseInt(n,10)),pwUpdateCurrencyAreas(),dnUpdateCurrencySelectorLabel();try{dnDropDownMenuManager.closeAll()}catch(n){}"currency_select_list_dropdown"===dnCurrentInlinePopup()&&dnCloseInlinePopup(),jQuery.ajax({type:"GET",url:"/home/set_user_currency/"+n})}function dnUpdateSelectedCurrencyDropdownClass(){$dnj("#currency_select_list_nodes .dn-currency-node").removeClass("dn-selected"),$dnj("#currency_select_list_nodes .dn-currency-node-"+pwCurCurCode()).addClass("dn-selected")}var dnLazyLoad=null;function dnInitLazyLoad(){dnLazyLoad=new LazyLoad({elements_selector:".dn-lazyload",class_loaded:"dn-loaded"})}function dnRefreshLazyLoad(){dnLazyLoad?dnLazyLoad.update():dnInitLazyLoad()} 1478 1479var DnCarousels=function(){var e={},n=0,r=[];this.getCarousel=function(t){return e[t]},this.addCarousel=function(t){null==t.id&&(n++,t.id=n),e[t.id]=t},this.addCallback=function(t){r.push(t)},this.notify=function(t,e,n){for(var i=0;i<r.length;i++)r[i](t,e,n)}},DnCarousel=function(t){var e,n,i,r,o,s,u,d=this,a=$dnj(t);function l(){return u.find(".dn-grid-item")}a.hasClass("dn-carousel-initialized")||(a.addClass("dn-carousel-initialized"),e=parseFloat(t.getAttribute("data-animation-delay"))||5e3,n="true"===t.getAttribute("data-auto-rotate"),i="true"===t.getAttribute("data-pause-on-hover"),o=r=!1,s=null,this.id=t.getAttribute("data-carousel-list-id"),u=$dnj("#"+d.id),this.moveItem=function(t){if(!o){o=!0;var e=l();if(e.length){for(var n=e.filter(".dn-item-ref"),n=(n.removeClass("dn-item-ref"),0<t?d.nextItem(n):d.prevItem(n)),i=(0<t?u.removeClass("dn-is-reversing"):u.addClass("dn-is-reversing"),n.addClass("dn-item-ref").css("order",1),n),r=2;r<=e.length;r++)i=d.nextItem(i).css("order",r);u.removeClass("dn-is-set"),u[0].offsetHeight,u.addClass("dn-is-set");var s=!1;n.one("transitionend",a),setTimeout(a,100)}else o=!1}function a(){s||(o=!(s=!0))}},this.nextItem=function(t){t=t.next(".dn-grid-item");return t.length?t:l().first()},this.prevItem=function(t){t=t.prev(".dn-grid-item");return t.length?t:l().last()},this.startTimer=function(){s||!function t(){n&&!r&&(s=setTimeout(function(){o||d.moveItem(1),t()},e))}()},this.stopTimer=function(){clearTimeout(s),s=null},$dnj(".dn-carousel-left-container",t).click(function(t){d.moveItem(-1),t.stopPropagation()}),$dnj(".dn-carousel-right-container",t).click(function(t){d.moveItem(1),t.stopPropagation()}),n&&i&&a.mouseenter(function(){r=!0,d.stopTimer()}).mouseleave(function(){r=!1,d.startTimer()}),d.startTimer())};dnBehaviours.registerBehaviour("carousel",DnCarousel); 1480var _dnCollapseGroups={},DnCollapse=function(a){!function(){var e=$dnj(a),l=a.getAttribute("data-collapse-group"),d=a.getAttribute("data-collapse-panel"),n=$dnj("#"+d);null==_dnCollapseGroups[l]&&(_dnCollapseGroups[l]={id:l,panels:[]});var s={header:e,panel:n,group:_dnCollapseGroups[l]};_dnCollapseGroups[l].panels.push(s),e.hasClass("dn-alt")&&(s.expanded=!0,n.addClass("dn-alt")),e.click(function(a){s.expanded?(s.expanded=!1,s.header.removeClass("dn-alt"),s.panel.removeClass("dn-alt")):(s.expanded=!0,s.header.addClass("dn-alt"),s.panel.addClass("dn-alt"),dnWindowResizeEventHandler())})}()};dnBehaviours.registerBehaviour("collapse",DnCollapse); 1481var _dnCollapseGroups={},DnCollapsedContent=function(n){!function(){var e=$dnj(n),o=$dnj(".dn-widget-collapsed-content",e);$dnj(".dn-widget-content",e),o.off(".cc"),o.on("click.cc",function(n){e.toggleClass("dn-collapsed-expanded")})}()};dnBehaviours.registerBehaviour("collapsedContent",DnCollapsedContent); 1482var DnColorCell=function(c){!function(){var n=$dnj(c),a=n.attr("data-color-id"),d=n.parent(),l=d.attr("data-product-id"),t=d.attr("data-widget-id"),o=$dnj("#thumb_"+l+"_"+t),r=null;o.hasClass("dn-lazyload")&&(r=o.attr("data-src")),null==r&&(r=o.attr("src"));var e=(r=r.split("/")).indexOf(l)+6;r[e]=a,e=r.indexOf(l)+5,r[e]="0",r=r.join("/"),o.off(".cc"),o.on("load.cc",function(){o.parent().removeClass("dn-loading")}),n.off(".cc"),n.on("click.cc",function(a){o.parent().addClass("dn-loading"),o.attr("src",r),d.find("div.dn-color-panel-cell").removeClass("dn-selected"),n.addClass("dn-selected")})}()};dnBehaviours.registerBehaviour("colorCell",DnColorCell); 1483var DnCountryList=function(t){var a=null,i=null,o=null,u=null,r=null,d=null,s=null,c=!1;function h(t){if(null!=i){var n=i.val();null==n&&(n="");i.attr("options");$dnj("option",i).remove();for(var l="",e=0;e<t.length;e++)null==t[e][1]&&(t[e][1]=""),t[e][1]==n?l+='<option value="'+t[e][1]+'" selected="true">'+t[e][0]+"</option>":l+='<option value="'+t[e][1]+'">'+t[e][0]+"</option>";i.html(l),i.attr("data-reset-validation","true"),i.change()}f(!0)}function f(t){o&&(t?o.show():o.hide())}function v(t){s&&(t?s.show():s.hide())}!function(t){var n=(a=$dnj(t)).attr("data-state-field");null!=n&&(0==(i=$dnj("#"+n)).length?i=null:0==(o=i.parents(".dn-field-container")).length&&(o=null));var l=a.attr("data-postcode-field");null!=l&&(0==(u=$dnj("#"+l)).length?u=null:0==(r=u.parents(".dn-field-container")).length&&(r=null));var e=a.attr("data-city-field");null!=e&&(0==(d=$dnj("#"+e)).length?d=null:0==(s=d.parents(".dn-field-container")).length&&(s=null)),"true"==a.attr("data-state-filtered")&&(c=!0),"true"==a.attr("data-state-hidden")&&f(!1),"true"==a.attr("data-city-hidden")&&v(!1),a.change(function(){!function(){var t=a.val();if(null!=i||null!=u)if(null==t||""==t)h([["Select State",null]]);else{var n="country_id="+t;c&&(n+="&fs=1"),dnCallJsonApiEndpoint("/shared/lookups/country_data",n,{waitingContainer:i.parent().get(0)},function(t,n){n.filterState?f(!1):h(n.states),function(t){r&&(t?r.show():r.hide())}(n.showPostcode),v(n.showCity)})}}()})}(t)};dnBehaviours.registerBehaviour("countryList",DnCountryList); 1484var DROPDOWN_EVENT_MODE_CLICK=1,DROPDOWN_EVENT_MODE_HOVER=2,DnDropdownMenu=function(e){var n,a=this;this.triggerElement=$dnj(e),this.dropDownElementId=e.getAttribute("data-dropdown-menu-id"),this.dropDownClass=e.getAttribute("data-dropdown-menu-class"),this.dropDownElement=$dnj("#"+this.dropDownElementId),this.closeElement=$dnj("#"+this.dropDownElementId+"_close"),this.notifyElementId=e.getAttribute("data-notify-element-id"),null!=this.notifyElementId?this.notifyElement=$dnj("#"+this.notifyElementId):this.notifyElement=this.dropDownElement,this.anchorElement=null,this.mode="hover",this.active=!1,this.visible=!1,this.lastActive=null,this.isRoot=!0,null==e.id||""==e.id?this.co
1484de=e.className:this.code=e.id,null==(n=e.getAttribute("data-dropdown-anchor-id"))?0<(e=$dnj(".dn-dropdown-anchor",e)).length&&(a.anchorElement=$dnj(e[0])):a.anchorElement=$dnj("#"+n),this.eventMode=function(){return"underline"==this.getCachedAnchorCss("text-decoration")?DROPDOWN_EVENT_MODE_CLICK:DROPDOWN_EVENT_MODE_HOVER},this.hideBackgroundMenus=function(){return"fixed"==this.getCachedAnchorCss("background-attachment")},this.setMenuBackgroundClass=function(){return"rgba(0, 0, 0, 0)"!=this.getCachedAnchorCss("background-color")};var o={};function t(){a.triggerElement.off(".ddmenu"),a.closeElement.off(".ddmenu"),a.dropDownElement.off(".ddmenu");function n(e){if(dnDebug("DnDropdownMenu."+a.code+".triggerElement.on(click)"),e.stopPropagation(),a.eventMode()==DROPDOWN_EVENT_MODE_CLICK)e.preventDefault();else if(null!=o&&(new Date).getTime()-o<100)return dnDebug("DnDropdownMenu."+a.code+".triggerElement.on(click): ignoring over + click event");dnDropDownMenuManager.isCurrentMenu(a)?(dnDebug("DnDropdownMenu."+a.code+".triggerElement.on(click): hiding active menu"),dnDropDownMenuManager.hideMenu(a.getActiveParent())):dnDropDownMenuManager.showMenu(a,e)}var o=null;a.triggerElement.on("keydown.ddmenu",function(e){"Enter"!=e.key&&" "!=e.key||n(e)}),a.triggerElement.on("click.ddmenu",function(e){n(e)}),a.closeElement.on("click.ddmenu",function(e){dnDebug("DnDropdownMenu."+a.code+".closeElement.on(click)"),a.eventMode()==DROPDOWN_EVENT_MODE_CLICK&&(e.stopPropagation(),e.preventDefault(),dnDropDownMenuManager.closeMenu(a))}),a.triggerElement.on("mouseenter.ddmenu",function(e){o=(new Date).getTime(),e.stopImmediatePropagation(),dnDebug("DnDropdownMenu."+a.code+".triggerElement.on(mouseenter)"),a.eventMode()==DROPDOWN_EVENT_MODE_HOVER&&dnDropDownMenuManager.enterMenu(a,!0)}),a.triggerElement.on("mouseleave.ddmenu",function(e){e.stopImmediatePropagation(),dnDebug("DnDropdownMenu."+a.code+".triggerElement.on(mouseleave)"),a.eventMode()==DROPDOWN_EVENT_MODE_HOVER&&dnDropDownMenuManager.leaveMenu(a,!0)}),a.triggerElement.on("mousemove.ddmenu",function(e){o=(new Date).getTime(),e.stopImmediatePropagation(),dnDebug("DnDropdownMenu."+a.code+".triggerElement.on(mousemove)"),a.eventMode()==DROPDOWN_EVENT_MODE_HOVER&&a.setActive(!0)}),1==a.dropDownElement.length&&(a.dropDownElement.on("mouseenter.ddmenu",function(){var e=dnDropDownMenuManager.getMenuItemForDropDown(a.dropDownElementId);null!=e?(dnDebug("DnDropdownMenu."+e.code+".dropDownElement.on(mouseenter)"),e.eventMode()==DROPDOWN_EVENT_MODE_HOVER?e.isRecentlyActive()?(dnDebug("DnDropdownMenu."+e.code+".dropDownElement.on(mouseenter): is recently active"),dnDropDownMenuManager.enterMenu(e,!1)):dnDebug("DnDropdownMenu."+e.code+".dropDownElement.on(mouseenter): not recently active ("+(new Date).getTime()+","+e.lastActive+")"):dnDebug("DnDropdownMenu."+e.code+".dropDownElement.on(mouseenter): !DROPDOWN_EVENT_MODE_HOVER")):dnDebug("DnDropdownMenu."+a.code+".dropDownElement.on(mouseenter): no active associated menu")}),a.dropDownElement.on("mouseleave.ddmenu",function(){var e=dnDropDownMenuManager.getMenuItemForDropDown(a.dropDownElementId);null!=e?(dnDebug("DnDropdownMenu."+e.code+".dropDownElement.on(mouseleave)"),e.eventMode()==DROPDOWN_EVENT_MODE_HOVER&&e.active&&dnDropDownMenuManager.leaveMenu(e,!1)):dnDebug("DnDropdownMenu."+a.code+".dropDownElement.on(mouseleave): no active associated menu")}),a.dropDownElement.on("mousemove.ddmenu",function(){var e=dnDropDownMenuManager.getMenuItemForDropDown(a.dropDownElementId);null!=e?(dnDebug("DnDropdownMenu."+e.code+".dropDownElement.on(mousemove)"),e.eventMode()==DROPDOWN_EVENT_MODE_HOVER&&e.active&&e.setActive(!0)):dnDebug("DnDropdownMenu."+a.code+".dropDownElement.on(mousemove): no active associated menu")}))}this.getCachedAnchorCss=function(e){var n=(new Date).getTime();return(null==o[e]||1e3<n-o[e].timestamp)&&(value={value:null,timestamp:n},null!=this.anchorElement)&&(value.value=this.anchorElement.css(e),o[e]=value,"text-decoration"==e)&&null!=value.value&&-1!=value.value.indexOf("underline")&&(value.value="underline"),o[e].value},0==this.dropDownElement.length?this.triggerElement.removeClass("dn-nav-with-submenu"):(t(),dnDropDownMenuManager.registerMenu(this),dnDropDownMenuManager.registerDropDown(this,this.dropDownElementId));var i=[],r=[];this.registerParents=function(e){0<(i=e).length&&(this.isRoot=!1)},this.registerChild=function(e){r.push(e)},this.getActiveParent=function(){for(var e=0,n=null,o=0;o<i.length;o++){var t=i[o];if(t.active)return t;null!=t.lastActive&&e<t.lastActive&&(e=(n=t).lastActive)}return n},this.setActive=function(e){(this.active=e)&&(this.lastActive=(new Date).getTime(),null!=(e=this.getActiveParent()))&&e.setActive(!0)},this.isRecentlyActive=function(){return null!=this.lastActive&&(new Date).getTime()-this.lastActive<500},this.canActivate=function(){var e;return!!this.isRoot||!(null==(e=this.getActiveParent())||!e.isRecentlyActive())},this.isChildOf=function(e){for(var n=0;n<i.length;n++)if(i[n]==e)return!0;for(n=0;n<i.length;n++)if(i[n].isChildOf(e))return!0;return!1}
1484,this.showInHierarchy=function(e){e||!this.hideBackgroundMenus()?this.show():e||this.eventMode()!=DROPDOWN_EVENT_MODE_CLICK||this.hide()},this.show=function(){var e;this.visible||(this.triggerElement.addClass("dn-menu-active"),this.dropDownElement.css("z-index",""),null!=this.dropDownClass&&this.dropDownElement.attr("class",this.dropDownClass),this.dropDownElement.addClass("dn-menu-dropdown-active"),a.dropDownElement.css("visibility","hidden"),a.dropDownElement.css("transition","none"),a.dropDownElement.css("max-height","none"),a.dropDownElement.css("max-width","none"),a.dropDownElement.css("display",""),a.dropDownElement.css("left",""),a.dropDownElement.css("right",""),a.dropDownElement.css("top",""),a.dropDownElement.css("bottom",""),a.dropDownElement.addClass("dn-calculating-menu-size"),a.notifyElement.addClass("dn-calculating-menu-position"),window.setTimeout(function(){var e,n="right",o="bottom",t=null,i=0,r=0,d=window.innerWidth,s=a.dropDownElement.outerWidth(),l=a.dropDownElement.outerHeight(),u={};null!=a.anchorElement?(t=a.anchorElement.offset(),o="none"==a.anchorElement.css("display")?n="none":(n=a.anchorElement.css("text-align"),a.anchorElement.css("vertical-align")),i=a.anchorElement.outerWidth(),r=a.anchorElement.outerHeight(),"1px"==a.anchorElement.css("max-height")?u["max-height"]=l+"px":"100%"==a.anchorElement.css("max-height")&&(u["max-height"]="100%"),"1px"==a.anchorElement.css("max-width")?u["max-width"]=s+"px":"100%"==a.anchorElement.css("max-width")&&(u["max-width"]="100%")):(t=a.triggerElement.offset(),i=a.triggerElement.outerWidth(),r=a.triggerElement.outerHeight()),a.dropDownElement.css("left",""),a.dropDownElement.css("right",""),a.dropDownElement.css("top",""),a.dropDownElement.css("bottom",""),"right"==n?(e=t.left+i-s,a.dropDownElement.css("left",(e=e<0?0:e)+"px")):"left"==n&&(e=t.left,a.dropDownElement.css("left",(e=d<e+s?d-s:e)+"px")),"fixed"===a.dropDownElement.css("position")&&(t.top-=$dnj(document).scrollTop()),"top"==o?a.dropDownElement.css("top",t.top+"px"):"bottom"==o&&a.dropDownElement.css("bottom",t.top+r+"px"),a.dropDownElement.css("max-height",""),a.dropDownElement.css("max-width",""),a.dropDownElement.css("transition",""),a.notifyElement.removeClass("dn-calculating-menu-position"),window.setTimeout(function(){for(var e in a.dropDownElement.removeClass("dn-calculating-menu-size"),a.dropDownElement.css("visibility",""),u)a.dropDownElement.css(e,u[e]);window.setTimeout(function(){a.dropDownElement.hasClass("dn-menu-dropdown-active")&&a.dropDownElement.addClass("dn-menu-dropdown-transitioned")},205)},10)},30),this.visible=!0,0<(e=this.dropDownElement.find('a, button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').first()).length&&this.activatedFromKeyboard?setTimeout(function(){e.focus()},100):document.activeElement.blur(),this.dropDownElement.on("keydown.dropdown",function(e){var n=a.dropDownElement.find('a, button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=n.first(),t=n.last(),i=n.index(document.activeElement);"ArrowUp"!==e.key&&38!==e.keyCode||(document.activeElement===o[0]?(e.preventDefault(),t):(e.preventDefault(),n.eq(i-1))).focus(),"ArrowDown"!==e.key&&40!==e.keyCode||(document.activeElement===t[0]?(e.preventDefault(),o):(e.preventDefault(),n.eq(i+1))).focus(),"Escape"!==e.key&&27!==e.keyCode||dnDropDownMenuManager.closeMenu(a)}))},this.hide=function(n){var e,o;(this.visible||n)&&(n&&a.dropDownElement.css("transition","none"),e=a.triggerElement,o=a.triggerElement,"-1"==e.attr("tabindex")&&(o=e.find('a, button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').first()),window.setTimeout(function(){var e=parseInt(a.dropDownElement.css("z-index"),10);0!=e&&a.dropDownElement.css("z-index",e-=1),window.setTimeout(function(){a.dropDownElement.css("max-height",""),a.dropDownElement.css("max-width","")},10),a.triggerElement.removeClass("dn-menu-active"),a.dropDownElement.removeClass("dn-menu-dropdown-active"),a.dropDownElement.removeClass("dn-menu-dropdown-transitioned"),a.visible=!1,a.dropDownElement.off("keydown.dropdown"),0<o.length&&a.activatedFromKeyboard&&setTimeout(function(){o.focus()},100),n&&window.setTimeout(function(){a.dropDownElement.css("transition","")},10),window.setTimeout(function(){a.dropDownElement.css("z-index","")},500)},30))},this.closeSoon=function(){null!=this.closeSoonDelay&&(window.clearTimeout(this.closeSoonDelay),this.closeSoonDelay=null),dnDropDownMenuManager.registerToCloseSoon(this),this.closeSoonDelay=window.setTimeout(function(){dnDropDownMenuManager.closeBecauseInactive(a)},300)},this.dontCloseSoon=function(){null!=this.closeSoonDelay&&(window.clearTimeout(this.closeSoonDelay),this.closeSoonDelay=null),dnDropDownMenuManager.deRegisterToCloseSoon(this)}},DnDropdownMenuManager=function(){var n=this,d={},s=[],r={},i={},o=!1,t=null;function l(e,n){var o=e.getActiveParent();null!=o&&l(o),e.setActive(!0),e.dontCloseSoon(),e.activatedFromKeyboard=null!=n&&("Enter"==n.key||" "==n.key),e.showInHierarchy(e==t)}this.registerMenu=function(e){null==d[e.dropDownElementId]&&(d[e.dropDownElementId]=[]),d[e.dropDownElementId].push(e),s.push(e),o||(
1484dnBehaviours.afterBind("ddmenu",function(){n.resolveMenuHierarchy()}),o=!0)},this.registerDropDown=function(e,n){null==r[n]&&(r[n]={}),r[n][e.code]=e},this.getMenuItemForDropDown=function(e){var n=r[e];if(null==n)return null;var o,t=null;for(o in n){var i=n[o];if(i.active)return i;i.isRecentlyActive()&&(t=i)}return t},this.resolveMenuHierarchy=function(){for(var e=0;e<s.length;e++)for(var n=s[e],o=n.triggerElement.parent();1==o.length;){var t=o.attr("id");if(null!=t&&null!=d[t]){var i=d[t];n.registerParents(i);for(var r=0;r<i.length;r++)i[r].registerChild(n);o=[]}else o=o.parent()}$dnj(document.body).click(function(e){for(var n=e.target;null!=n;){if("true"==n.getAttribute("data-keep-dropdowns"))return;n=n.parentElement}dnDropDownMenuManager.closeAll()})},this.showMenu=function(e,n){dnDebug("DnDropdownMenuManager.showMenu("+e.code+")"),null!=t&&(dnDebug("DnDropdownMenuManager.showMenu("+e.code+"):closing current menu ("+t.code+")"),this.hideMenu(e)),l(t=e,n),t.setMenuBackgroundClass()&&$dnj(document.body).addClass("dn-showing-dropdown-nav")},this.closeMenu=function(e){dnDebug("DnDropdownMenuManager.closeMenu("+e.code+")"),e.setActive(!1),e.hide(),null!=(t=e.getActiveParent())?l(t):$dnj(document.body).removeClass("dn-showing-dropdown-nav")},this.hideMenu=function(e){null==e?dnDebug("DnDropdownMenuManager.hideMenu(null), currentMenu="+(null==t?"null":t.code)):dnDebug("DnDropdownMenuManager.hideMenu(transitionToMenu="+e.code+"), currentMenu="+(null==t?"null":t.code));var n=t;for(t=null;null!=n;)null!=e&&e.isChildOf(n)?(t=n,n=null,l(t)):(n.hide(null!=e),n.setActive(!1),n=n.getActiveParent());null!=e&&this.quickCloseDelayed(e),null==t&&$dnj(document.body).removeClass("dn-showing-dropdown-nav")},this.enterMenu=function(e,n){dnDebug("DnDropdownMenuManager.enterMenu("+e.code+","+n+")"),t!=e&&(null!=t&&t!=e?this.hideMenu(e):this.quickCloseDelayed(e),l(t=e)),e.setActive(!0),e.dontCloseSoon(),t.setMenuBackgroundClass()&&$dnj(document.body).addClass("dn-showing-dropdown-nav")},this.leaveMenu=function(e,n){if(dnDebug("DnDropdownMenuManager.leaveMenu("+e.code+","+n+")"),e.setActive(!1),t==e)if(n)t=e.getActiveParent(),dnDebug("DnDropdownMenuManager.leaveMenu: New currentMenu="+(null==t?"null":t.code)),null!=t?l(t):$dnj(document.body).removeClass("dn-showing-dropdown-nav"),e.closeSoon();else{for(dnDebug("DnDropdownMenuManager.leaveMenu: closing all menus soon");null!=t;)t.closeSoon(),t=t.getActiveParent();$dnj(document.body).removeClass("dn-showing-dropdown-nav")}else dnDebug("DnDropdownMenuManager.leaveMenu:"+e.code+" is not the active menu ("+(null==t?"null":t.code)+")"),e.closeSoon()},this.registerToCloseSoon=function(e){i[e.code]=e},this.deRegisterToCloseSoon=function(e){delete i[e.code]},this.quickCloseDelayed=function(e){var n,o=i;for(n in i={},o){var t=o[n];e==t||e.isChildOf(t)||t.hide(!0)}},this.closeBecauseInactive=function(e){dnDebug("DnDropdownMenuManager.closeBecauseInactive("+e.code+") currentMenu="+(e==t)),e.hide(),window.setTimeout(function(){n.deRegisterToCloseSoon(e)},300)},this.closeAll=function(){dnDebug("DnDropdownMenuManager.closeAll()"),this.hideMenu(null)},this.isCurrentMenu=function(e){return e==t}},dnDropDownMenuManager=new DnDropdownMenuManager;dnBehaviours.registerBehaviour("dropdownMenu",DnDropdownMenu,{skipEditMode:!0,skipCriticalPass:!0}); 1485var DnEntranceAnimationScrollListener=function(){var n={};this.listenToScroll=function(i){n[i.id]=i},this.stopListening=function(i){delete n[i.id]};var i={};this.listenToHiddenContainer=function(n,t){null==i[n]&&(i[n]=[]),i[n].push(t)},this.containerVisible=function(n){var t=i[n];if(null!=t){delete i[n];for(var e=0;e<t.length;e++)t[e].onContainerVisible()}};var t=$dnj(window);t.scroll(function(){var i=t.scrollTop(),e=i+t.height();for(var o in n)n[o].onScroll(i,e)})},dnEntranceAnimationScrollListener=new DnEntranceAnimationScrollListener,DnEntranceAnimation=function(n){function i(n,i){var t=a.offset().top,e=t+a.height();return t<=i&&e>=n}function t(n){for(;null!=n;){var i=n.getAttribute("data-hide-container");if(null!=i)return i;n=n.parentElement}return null}function e(){var e=$dnj(window),l=e.scrollTop(),s=l+e.height(),d=t(n);null!=d?"true"==n.getAttribute("data-anim-force")?(a.addClass("dn-go"),a.removeClass("dn-wait"),o()):dnEntranceAnimationScrollListener.listenToHiddenContainer(d,r):i(l,s)?(a.addClass("dn-go"),a.removeClass("dn-wait"),o()):dnEntranceAnimationScrollListener.listenToScroll(r)}function o(){window.setTimeout(function(){a.removeClass("dn-go")},2e3)}this.id=dnNextId();var r=this,a=$dnj(n);this.onScroll=function(n,t){i(n,t)&&window.setTimeout(function(){a.addClass("dn-go"),a.removeClass("dn-wait"),dnEntranceAnimationScrollListener.stopListening(r),o()},500)},this.onContainerVisible=function(){a.addClass("dn-go"),a.removeClass("dn-wait"),o()},window.setTimeout(function(){e()},100)};dnBehaviours.registerBehaviour("animEnter",DnEntranceAnimation); 1486var DnExpandingContent=function(n){function e(){var e=parseInt(n.getAttribute("data-content-height"),10),i=null;d.height()>=e&&(d.css("max-height",e+"px"),d.addClass("dn-content-expandable"),$dnj(".dn-content-expander-actions .dn-content-expander-expand span",d).on("click.ddexpand",function(){dnBehaviours.callback("expandingContent:expand:start",n,a),d.addClass("dn-alt"),d.css("max-height",t()+20+"px"),i=window.setTimeout(function(){d.css("max-height","none"),dnBehaviours.callback("expandingContent:expand:finish",n,a)},1e3)}),$dnj(".dn-content-expander-actions .dn-content-expander-retract span",d).on("click.ddexpand",function(){null!=i&&window.clearTimeout(i),dnBehaviours.callback("expandingContent:retract:start",n,a),d.css("max-height",t()+20+"px"),window.setTimeout(function(){d.css("max-height",e+"px"),d.removeClass("dn-alt"),dnBehaviours.callback("expandingContent:retract:finish",n,a)},20)}))}function t(){for(var n=d.children(),e=0,t=0;t<n.length;t++)e+=$dnj(n[t]).outerHeight();return e}var a=this,d=$dnj(n);if(d.hasClass("dn-content-expandable")){d.css("max-height","none"),d.removeClass("dn-content-expandable"),d.removeClass("dn-alt");$dnj(".dn-content-expander-actions span").off(".ddexpand"),window.setTimeout(function(){e()},10)}else e()};dnBehaviours.registerBehaviour("expandingContent",DnExpandingContent); 1487var DnFitInline=function(n){!function(){for(var i=$dnj(n),t=i.children(),e=0,l=null,a=0;a<t.length;a++){var d=$dnj(t[a]);d.hasClass("dn-inline-fit")?l=d.attr("class").split(" "):e+=$dnj(t[a]).outerWidth()}if(null!=l){var r="."+l.join(".");$dnj("<style type='text/css'> "+r+"{ width: 100%; margin-left: -"+e+"px; padding-left: "+e+"px;} </style>").appendTo("head")}}()};dnBehaviours.registerBehaviour("fitInline",DnFitInline); 1488var DnFixedHeader=function(o){function e(){if(s.scrollTop()>i.offset().top){if(!t){var o=d.outerHeight();console.log("Adding floating header: win.scrollTop()="+s.scrollTop()+" container.offset().top="+i.offset().top+" height="+o),d.addClass("dn-fixed"),i.css("padding-top",o+"px"),t=!0}}else t&&(console.log("Removing floating header: win.scrollTop()="+s.scrollTop()+" container.offset().top="+i.offset().top),d.removeClass("dn-fixed"),i.css("padding-top",""),t=!1)}function n(o,n,s){if(t){var r=d.outerHeight();i.css("padding-top",r+"px")}e()}var i=$dnj(o).parent(),d=$dnj(o),t=!1,s=$dnj(window);s.scroll(function(){e()}),dnAddResizeListener(o,n)};dnBehaviours.registerBehaviour("fixedHeader",DnFixedHeader); 1489var DnHierarchyNav=function(n){!function(n){for(var a,r=$dnj("li.dn-hierarchy-node > span.dn-hierarchy-expander",n),e=0;e<r.length;e++)a=r[e],$dnj(a).click(function(n){$dnj(this).parent().toggleClass("dn-expanded"),
14891==$dnj(this).parents("nav.dn-nav-dropdown").length&&n.stopPropagation()})}(n)};dnBehaviours.registerBehaviour("hierarchyNav",DnHierarchyNav); 1490var _dnCurrentHtmlToolTipEl=null,DnHtmlToolTip=function(i){var r=$dnj(i),t=i.getAttribute("data-html-tooltip-id"),d=i.getAttribute("data-html-tooltip-class")||"";function s(){return document.getElementById(t)}function l(){var t=s();if(t){for(var l,o,n=document.querySelectorAll(".dn-html-tooltip-content.open"),e=0;e<n.length;e++)n[e].classList.remove("open");_dnCurrentHtmlToolTipEl=null,d&&t.classList.add(d),t.classList.add("open"),t.parentNode!==document.body&&document.body.appendChild(t),t=t,l=i.getBoundingClientRect(),o=t.getBoundingClientRect(),t.style.position="absolute",t.style.top=l.bottom+window.scrollY+4+"px",t.style.left=l.left+window.scrollX+"px",l.left+o.width>window.innerWidth&&(t.style.left=window.innerWidth-o.width-10+"px"),l.bottom+o.height>window.innerHeight+window.scrollY&&(t.style.top=l.top+window.scrollY-o.height-4+"px"),_dnCurrentHtmlToolTipEl=r}}r.on("click",function(t){$dnj.Event(t).stopPropagation();var t=s();t&&t.classList.contains("open")?((t=s())&&t.classList.remove("open"),_dnCurrentHtmlToolTipEl=null):l()})};function _dnCloseAllHtmlTooltips(){if(null!==_dnCurrentHtmlToolTipEl){for(var t=document.querySelectorAll(".dn-html-tooltip-content.open"),l=0;l<t.length;l++)t[l].classList.remove("open");_dnCurrentHtmlToolTipEl=null}}$dnj(document).on("click",function(t){if(null!==_dnCurrentHtmlToolTipEl&&!$dnj(t.target).closest(".dn-html-tooltip-content").length&&!$dnj(t.target).hasClass("dn-html-tooltip-trigger")){for(var l=document.querySelectorAll(".dn-html-tooltip-content.open"),o=0;o<l.length;o++)l[o].classList.remove("open");_dnCurrentHtmlToolTipEl=null}}),dnRegisterEventListener("popup.show",_dnCloseAllHtmlTooltips),dnRegisterEventListener("popup.hide",_dnCloseAllHtmlTooltips),dnBehaviours.registerBehaviour("html-tooltip",DnHtmlToolTip,{skipEditMode:!0,skipCriticalPass:!0}); 1491var DnOrientation=function(t){function i(t,i){for(var a=-1,e=1,n=0;n<r.length;n++){var o=r[n];o.limit<t&&o.limit>a&&(a=o.limit,e=o.ratio)}return i<e?"portrait":"landscape"}function a(a,r,n){var o=e.width(),l=parseFloat(o)/parseFloat(e.height()),s=i(o,l);return t.getAttribute("data-orientation")!=s&&(t.setAttribute("data-orientation",s),!0)}var r=[];!function(t){if(null!=t)for(var i=t.split(","),a=0;a<i.length;a++){var e=i[a];if(-1!=e.indexOf("=")){var n=e.split("=");2==n.length&&r.push({limit:parseInt(n[0],10),ratio:parseFloat(n[1])})}else r.push({limit:0,ratio:parseFloat(e)})}}(t.getAttribute("data-orientation-aspect-ratio"));var e=$dnj(t);dnAddResizeListener(t,a)};dnBehaviours.registerBehaviour("orientation",DnOrientation); 1492var DnParallax=function(a){function n(){var a=l.outerHeight(),n=t.innerHeight,r=e.scrollTop(),s=l.offset().top,d=s+a,p=s-n,c=d;if(r>p&&r<c){var u=n-a;u<0&&(u=0);var v,f,x,h,g=n>a?n:a;o<=50?(v=(50-o)/50,f=u*v,x=a+f,h=x*v):(v=(50-o)/60,f=u*v,x=a+f,h=x*v);var w=r-p,j=w/g,$=h*(j-1);i.css("top",$+"px"),i.css("height",x+"px")}}function r(a,r,e){return n(),!1}var e,t,i=$dnj(a),o=parseInt(a.getAttribute("data-parallax-speed"),10),l=$dnj(i.parents(".dn-parallax-container")[0]);e=$dnj(window),t=window,e.scroll(function(){n()}),dnAddResizeListener(a,r)};dnBehaviours.registerBehaviour("parallax",DnParallax); 1493var _dnRadioCollapseGroups={},DnRadioCollapse=function(a){!function(){var d=$dnj(a),l=a.getAttribute("data-radio-collapse-group"),e=a.getAttribute("data-radio-collapse-btn"),o=$dnj("#"+e),s=a.getAttribute("data-radio-collapse-panel"),n=$dnj("#"+s);null==_dnRadioCollapseGroups[l]&&(_dnRadioCollapseGroups[l]={id:l,panels:[]});var p={header:d,radio:o,panel:n,group:_dnRadioCollapseGroups[l]};_dnRadioCollapseGroups[l].panels.push(p),d.hasClass("dn-alt")&&(p.expanded=!0,n.addClass("dn-alt")),o.click(function(a){for(var d=0;d<_dnRadioCollapseGroups[l].panels.length;d++){var e=_dnRadioCollapseGroups[l].panels[d];e.expanded=!1,e.header.removeClass("dn-alt"),e.panel.removeClass("dn-alt")}p.expanded=!0,p.header.addClass("dn-alt"),p.panel.addClass("dn-alt")})}()};dnBehaviours.registerBehaviour("radioCollapse",DnRadioCollapse); 1494var DnRollOver=function(t){!function(){var n=$dnj(t),i=t.getAttribute("data-rollover-id"),o=null,e=!1,l=!1,r=function(){e||l||o.css({maxHeight:"0px",maxWidth:"0px"})},u=null,a=function(){null!==u&&window.clearTimeout(u),u=window.setTimeout(r,30)};n.hover(function(t){e=!0,null==o&&(o=$dnj("#"+i),o.hover(function(t){l=!0},function(t){l=!1,a()}));var r=n.offset();o.css({left:r.left+30+"px",top:r.top+30+"px",maxHeight:"400px",maxWidth:"400px"})},function(t){e=!1,a()})}()};dnBehaviours.registerBehaviour("rollover",DnRollOver,{skipEditMode:!0,skipCriticalPass:!0}); 1495var DnScaledContent=function(n){function t(n,t,i){var d=e.innerWidth(),s=d/a;s<1?r.css({width:a+"px",transform:"scale("+s+")","transform-origin":"0 0"}):r.css({width:"100%",transform:""})}var e=$dnj(n),r=e.children(".dn-scaled-content"),a=parseFloat(n.getAttribute("data-min-width"));dnAddResizeListener(n,t)};dnBehaviours.registerBehaviour("scaledContent",DnScaledContent);
1496function isElementHalfInVerticalView(e,t){t=t||0;var e=e.getBoundingClientRect(),n=window.innerHeight,t=Math.max(e.top,t),n=Math.min(e.bottom,n)-t,t=e.height;return!(t<=0)&&.8<=n/t}function getHeaderPaddingTop(){var e=document.querySelector(".dn-large-header-container");return e&&(e=window.getComputedStyle(e),parseFloat(e.paddingTop))||0}var DnSliders=function(){var t={},n=0,r=[];this.getSlider=function(e){return t[e]},this.addSlider=function(e){null==e.id&&(n++,e.id=n),t[e.id]=e},this.addCallback=function(e){r.push(e)},this.notify=function(e,t,n){for(var i=0;i<r.length;i++)r[i](e,t,n)}},dnSliders=new DnSliders,DnSlider=function(a){for(var r=this,e=$dnj(a),d=[],t=e.children(".dn-slider-panel"),n=0;n<t.length;n++)d.push($dnj(t[n]));var o=parseInt(a.getAttribute("data-current-panel-index"),10),l="true"==a.getAttribute("data-auto-height"),s=l?0:parseFloat(a.getAttribute("data-animation-duration")),u=parseFloat(a.getAttribute("data-animation-delay")),c="true"==a.getAttribute("data-auto-rotate"),e="true"==a.getAttribute("data-pause-on-hover"),h=[],f=[],g=[],m=!1;function w(e,t){var n=(t=null==t?"ltr":t).split(",");for(i=0;i<n.length;i++)switch(t=n[i]){case"ltr":e.push({enter:function(e){e.show("slide",{queue:!1,duration:s,direction:"left"})},leave:function(e){e.hide("slide",{queue:!1,duration:s,direction:"right"})}});break;case"rtl":e.push({enter:function(e){e.show("slide",{queue:!1,duration:s,direction:"right"})},leave:function(e){e.hide("slide",{queue:!1,duration:s,direction:"left"})}});break;case"fade":e.push({enter:function(e){e.show("fade",{queue:!1,duration:s})},leave:function(e){e.hide("fade",{queue:!1,duration:s})}})}}this.id=a.getAttribute("data-slider-id"),this.getDuration=function(){return s},this.getCurrentPanel=function(){return d[o]},w(h,a.getAttribute("data-animation-effects")),w(f,a.getAttribute("data-animation-left-arrow-effects")),w(g,a.getAttribute("data-animation-right-arrow-effects"));var p=null,v=(this.setPanel=function(e,t){var n="right"==e?g:"left"==e?f:h;if(null==t&&(t=o+1),(t=(t=d.length<=t?0:t)<0?d.length-1:t)!=o){$dnj(".dn-slider-select-button-"+(o+1),a).removeClass("dn-selected"),this.getCurrentPanel().finish(),this.checkFinished();var i,r=d[t];for(r.finish(),i=0;i<n.length;i++)n[i].enter(r);for(r=d[o],i=0;i<n.length;i++)n[i].leave(r);r=d[o=t],$dnj(".dn-slider-select-button-"+(o+1),a).addClass("dn-selected");e=r.attr("data-hdr-clr-scheme");"std"==e?$dnj("body").removeClass("dn-alt-color-scheme"):"alt"==e&&$dnj("body").addClass("dn-alt-color-scheme"),dnSliders.notify(this.id,"change",o),"undefined"!=typeof dnWindowResizeEventHandler&&window.setTimeout(function(){dnWindowResizeEventHandler(!0)},10),this.startTimer(),"undefined"!=typeof dnEntranceAnimationScrollListener&&(null!=p&&window.clearTimeout(p),p=window.setTimeout(function(){dnEntranceAnimationScrollListener.containerVisible(r.attr("id"))},s))}},$dnj(".dn-slider-left-container",a).click(function(e){c&&!m&&r.stopTimer(),r.setPanel("left",o-1)}),$dnj(".dn-slider-right-container",a).click(function(e){c&&!m&&r.stopTimer(),r.setPanel("right",o+1)}),$dnj(".dn-slide-button",a).click(function(e){var t=parseInt(this.getAttribute("data-slide-index"),10),n=t<o?"left":"right";r.setPanel(n,t)}),this.checkFinished=function(){v=window.setTimeout(function(){var e=r.getCurrentPanel();"none"===e[0].style.display&&(e[0].style.display="")},s+1e3)},null);this.startTimer=function(){var e;c&&!m&&(e=getHeaderPaddingTop(),!isElementHalfInVerticalView(a,e)&&l||(null!=v&&window.clearTimeout(v),v=window.setTimeout(function(){r.setPanel("auto",null)},u)))},this.stopTimer=function(){null!=v&&(window.clearTimeout(v),v=null)},dnSliders.addSlider(this),this.startTimer(),e&&$dnj(a).mouseenter(function(e){m=!0,r.stopTimer()}).mouseleave(function(e){m=!1,r.startTimer()}),window.addEventListener("scroll",function(){var e;l&&(e=getHeaderPaddingTop(),(e=isElementHalfInVerticalView(a,e))&&c&&!m?r.startTimer():e||r.stopTimer())})};dnBehaviours.registerBehaviour("slider",DnSlider); 1497var _stopFormsDoubleClick={},DnStopFormDoubleClick=function(t){var o=$dnj(t);if(!_stopFormsDoubleClick[o.attr("id")]){_stopFormsDoubleClick[o.attr("id")]=!0;var e=parseInt(t.getAttribute("data-fdc-timeout"),10);isNaN(e)&&(e=30);var a=1e3*e;o.on("submit",function(t){return!0===o.data("submitted")?(console.log(o.attr("id")+" Previously submitted - don't submit again"),markFormBlocked(o),t.preventDefault(),t.stopImmediatePropagation(),!1):(markFormSubmitted(o),setTimeout(function(){markFormUnblocked(o)},a),!0)})}},markFormSubmitted=function(t){console.log(t.attr("id")+" Marked as submitted"),t.data("submitted",!0),t.addClass("dn-disabled")},markFormBlocked=function(t){console.log(t.attr("id")+" Marked as blocked"),t.data("blocked",!0)},markFormUnblocked=function(t){console.log(t.attr("id")+" Marked as unblocked"),t.data("submitted",!1),t.data("blocked",!1),t.removeClass("dn-disabled")},formIsBlocked=function(t){return t.data("blocked")};dnBehaviours.registerBehaviour("stopFormDoubleClick",DnStopFormDoubleClick); 1498var _dnTabGroups={},DnTabs=function(a){!function(){var t=$dnj(a),n=a.getAttribute("data-tab-group"),s=a.getAttribute("data-tab-panel"),d=$dnj("#"+s);null==_dnTabGroups[n]&&(_dnTabGroups[n]={id:n,tabs:[]});var e={tab:t,panel:d,group:_dnTabGroups[n]};_dnTabGroups[n].tabs.push(e),t.hasClass("dn-alt")&&(_dnTabGroups[n].active=e,d.addClass("dn-alt")),t.click(function(a){null!=e.group.active&&(e.group.active.tab.removeClass("dn-alt"),e.group.active.panel.removeClass("dn-alt")),e.tab.addClass("dn-alt"),e.panel.addClass("dn-alt"),e.group.active=e,dnWindowResizeEventHandler()})}()};dnBehaviours.registerBehaviour("tabs",DnTabs); 1499var _dnCurrentToolTipEl=null,DnToolTip=function(t){var n=$dnj(t);
1499try{n.miniTip({content:t.getAttribute("data-tooltip"),show:function(){_dnCurrentToolTipEl=n},hide:function(){_dnCurrentToolTipEl=null}})}catch(t){}};dnBehaviours.registerBehaviour("tooltip",DnToolTip),dnRegisterEventListener("popup.show",function(t){null!=_dnCurrentToolTipEl&&_dnCurrentToolTipEl.miniTip({doHide:!0})}),dnRegisterEventListener("popup.hide",function(t){null!=_dnCurrentToolTipEl&&_dnCurrentToolTipEl.miniTip({doHide:!0})}),function(t){t.fn.miniTip=function(n){var e={title:"",content:!1,delay:300,anchor:"n",event:"hover",fadeIn:200,fadeOut:200,aHide:!0,maxW:"250px",offset:5,stemOff:0,doHide:!1},o=t.extend(e,n);t("#miniTip")[0]||t("body").append('<div id="dn_tool_tip"><div id="dn_tool_tip_t"></div><div id="dn_tool_tip_c"></div><div id="dn_tool_tip_a"></div></div>');var i=t("#dn_tool_tip"),r=t("#dn_tool_tip_t"),a=t("#dn_tool_tip_c"),d=t("#dn_tool_tip_a");return o.doHide?(delay&&clearTimeout(delay),i.stop(!0,!0).fadeOut(o.fadeOut),!1):this.each(function(){var n=t(this),e=o.content?o.content:n.attr("title");if(""!=e&&void 0!==e){window.delay=!1;var s=!1,c=!0,l=!1;o.content||n.removeAttr("title"),"hover"==o.event?(n.on("touchend",function(){l=!0}),n.on("click",function(){l=!1}),n.hover(function(t){l||(i.removeAttr("click"),c=!0,h.call(this))},function(t){l||(c=!1,p())}),o.aHide||i.hover(function(){s=!0},function(){s=!1,setTimeout(function(){c||i.attr("click")||p()},20)})):"click"==o.event&&(o.aHide=!0,n.click(function(){return i.attr("click","t"),i.data("last_target")!==n?h.call(this):"none"==i.css("display")?h.call(this):p(),i.data("last_target",n),t("html").unbind("click").click(function(n){"block"!=i.css("display")||t(n.target).closest("#miniTip").length||(t("html").unbind("click"),p())}),!1}));var h=function(){function s(t,n){return t-n}o.show&&o.show.call(this,o),o.content&&""!=o.content&&(e=o.content),a.html(e),""!=o.title?r.html(o.title).show():r.hide(),o.render&&o.render(i),d.removeAttr("class"),i.hide().width("").width(i.width()).css("max-width",o.maxW);var c=n.is("area");if(c){var l,h=[],p=[],f=n.attr("coords").split(",");for(l=0;l<f.length;l++)h.push(f[l++]),p.push(f[l]);var u=n.parent().attr("name"),v=t("img[usemap=\\#"+u+"]").offset(),T=parseInt(v.left,10)+parseInt((parseInt(h.sort(s)[0],10)+parseInt(h.sort(s)[h.length-1],10))/2,10),m=parseInt(v.top,10)+parseInt((parseInt(p.sort(s)[0],10)+parseInt(p.sort(s)[p.length-1],10))/2,10)}else var m=parseInt(n.offset().top,10),T=parseInt(n.offset().left,10);var _=c?0:parseInt(n.outerWidth(),10),w=c?0:parseInt(n.outerHeight(),10),I=i.outerWidth(),g=i.outerHeight(),y=Math.round(T+Math.round((_-I)/2)),H=Math.round(m+w+o.offset+8),b=Math.round(I-16)/2-parseInt(i.css("borderLeftWidth"),10),W=0,k=T+_+I+o.offset+8>parseInt(t(window).width(),10),x=I+o.offset+8>T,E=g+o.offset+8>m-t(window).scrollTop(),M=m+w+g+o.offset+8>parseInt(t(window).height()+t(window).scrollTop(),10),C=o.anchor;x||"e"==o.anchor&&!k?"w"!=o.anchor&&"e"!=o.anchor||(C="e",W=Math.round(g/2-8-parseInt(i.css("borderRightWidth"),10)),b=-8-parseInt(i.css("borderRightWidth"),10),y=T+_+o.offset+8,H=Math.round(m+w/2-g/2)):(k||"w"==o.anchor&&!x)&&("w"!=o.anchor&&"e"!=o.anchor||(C="w",W=Math.round(g/2-8-parseInt(i.css("borderLeftWidth"),10)),b=I-parseInt(i.css("borderLeftWidth"),10),y=T-I-o.offset-8,H=Math.round(m+w/2-g/2))),M||"n"==o.anchor&&!E?"n"!=o.anchor&&"s"!=o.anchor||(C="n",W=g-parseInt(i.css("borderTopWidth"),10),H=m-(g+o.offset+8)):(E||"s"==o.anchor&&!M)&&("n"!=o.anchor&&"s"!=o.anchor||(C="s",W=-8-parseInt(i.css("borderBottomWidth"),10),H=m+w+o.offset+8)),"n"==o.anchor||"s"==o.anchor?I/2>T?(y=y<0?b+y:b,b=0):T+I/2>parseInt(t(window).width(),10)&&(y-=b,b*=2):E?(H+=W,W=0):M&&(H-=W,W*=2),d.css({"margin-left":(b>0?b:b+parseInt(o.stemOff,10)/2)+"px","margin-top":W+"px"}).attr("class",C),delay&&clearTimeout(delay),delay=setTimeout(function(){i.css({"margin-left":y+"px","margin-top":H+"px"}).stop(!0,!0).fadeIn(o.fadeIn)},o.delay)},p=function(){(!o.aHide&&!s||o.aHide)&&(delay&&clearTimeout(delay),delay=setTimeout(function(){f()},o.delay))},f=function(){!o.aHide&&!s||o.aHide?(i.stop(!0,!0).fadeOut(o.fadeOut),o.hide&&o.hide.call(this)):setTimeout(function(){p()},200)}}})}}($dnj); 1500var DnVerticalFill=function(t){function e(t){var e=[];
1500if(null==t)return[];for(var i=t.split(","),l=0;l<i.length;l++){var n=i[l];if(-1!=n.indexOf("=")){var r=n.split("=");2==r.length&&e.push({limit:parseInt(r[0],10),value:parseInt(r[1],10)})}else e.push({limit:0,value:parseInt(n,10)})}return e}function i(t,e){for(var i=-1,l=null,n=0;n<t.length;n++){var r=t[n];r.limit<e&&r.limit>i&&(i=r.limit,l=r.value)}return l}function l(e,l,f){var d=s.innerWidth||g.clientWidth||o.clientWidth,c=s.innerHeight||g.clientHeight||o.clientHeight,m=v.offset();l=v.width();var p=m.top,H=i(n,l),b=i(r,l),x=i(a,l),y=i(h,l),A=i(u,d);p>H&&(p=H);var I=Math.max(o.scrollHeight,o.offsetHeight,g.clientHeight,g.scrollHeight,g.offsetHeight),w=I-m.top-t.offsetHeight;if(w>b&&(w=b),f=c-p-w,null!=y&&y>f&&(f=y),1==A){if("100%"!=t.style.height)return t.style.height="100%",!0}else 0!==x&&null!=x&&x<f&&(f=x);return parseInt(t.style.height,10)!=f&&(t.style.height=f+"px",!0)}var n=e(t.getAttribute("data-vf-max-header")),r=e(t.getAttribute("data-vf-max-footer")),a=e(t.getAttribute("data-vf-max-height")),h=e(t.getAttribute("data-vf-min-height")),u=e(t.getAttribute("data-vf-fs-breakpoints")),s=window,f=document,g=f.documentElement,o=f.getElementsByTagName("body")[0],v=$dnj(t);dnAddResizeListener(null,l)};dnBehaviours.registerBehaviour("verticalFill",DnVerticalFill); 1501
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.