﻿/*
* jQuery Cookie plugin
*
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function(a){a.cookie=function(d,h,e){if(arguments.length>1&&(h===null||typeof h!=="object")){e=a.extend({},e);if(h===null){e.expires=-1}if(typeof e.expires==="number"){var b=e.expires,g=e.expires=new Date();g.setDate(g.getDate()+b)}return(document.cookie=[encodeURIComponent(d),"=",e.raw?String(h):encodeURIComponent(String(h)),e.expires?"; expires="+e.expires.toUTCString():"",e.path?"; path="+e.path:"",e.domain?"; domain="+e.domain:"",e.secure?"; secure":""].join(""))}e=h||{};var f,c=e.raw?function(i){return i}:decodeURIComponent;return(f=new RegExp("(?:^|; )"+encodeURIComponent(d)+"=([^;]*)").exec(document.cookie))?c(f[1]):null}})(jQuery);
/*
* jQuery Timer plugin v0.1
*     Matt Schmidt [http://www.mattptr.net]
*
* Licensed under the BSD License:
*     http://mattptr.net/license/license.txt
*/
(function(a){a.timer=function(c,b){var c=c||100;if(!b){return false}_timer=function(e,d){this.stop=function(){clearInterval(f.id)};this.internalCallback=function(){d(f)};this.reset=function(g){if(f.id){clearInterval(f.id)}var g=g||100;this.id=setInterval(this.internalCallback,g)};this.interval=e;this.id=setInterval(this.internalCallback,this.interval);var f=this};return new _timer(c,b)}})(jQuery);
/*
* Array helper library
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){var b=Array.prototype.toString;Array.prototype.indexOf=function(f,d){if(typeof d!=="function"){d=jQuery.compare||c}for(var e=0;e<this.length;e++){if(d(this[e],f)===0){return e}}return -1};function c(d,e){if(d===e||d==e){return 0}if(d===null||d===undefined||d>e){return -1}return 1}Array.prototype.contains=function(e,d){return this.indexOf(e,d)>=0};Array.prototype.removeAt=function(d){if(d<this.length&&d>=0){this.splice(d,1);return true}return false};Array.prototype.remove=function(e,d){return this.removeAt(this.indexOf(e,d))};Array.prototype.clear=function(){this.length=0};Array.prototype.toString=function(d){if(a.isFunction(a.toJSON)){return a.toJSON(this,d)}return b.call(this)};Array.prototype.clean=function(){return a.grep(this,function(d,e){return d!==null&&d!==undefined})}})(jQuery);
/*
* Browser detection library
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){var e=navigator.userAgent.toLowerCase(),c=navigator.appVersion.toLowerCase(),d=a.browser;a.extend(a.browser,{userAgent:e,appVersion:c,isOpera:e.indexOf("opera")!==-1,isKonqueror:e.indexOf("konqueror")!==-1,isSafari:e.indexOf("safari")!==-1,isKhtml:d.isKonqueror||d.isSafari,isGecko:!d.isKhtml&&navigator.product&&navigator.product.toLowerCase()==="gecko"?true:false,isFirebird:e.indexOf("mozilla/5")!==-1&&e.indexOf("spoofer")===-1&&e.indexOf("compatible")===-1&&e.indexOf("opera")===-1&&e.indexOf("webtv")===-1&&e.indexOf("hotjava")===-1&&d.isGecko&&navigator.vendor==="Firebird",isFirefox:e.indexOf("mozilla/5")!==-1&&e.indexOf("spoofer")===-1&&e.indexOf("compatible")===-1&&e.indexOf("opera")===-1&&e.indexOf("webtv")===-1&&e.indexOf("hotjava")===-1&&d.isGecko&&(navigator.vendor==="Firefox"||e.indexOf("firefox")!==-1),isMozilla:e.indexOf("mozilla/5")!==-1&&e.indexOf("spoofer")===-1&&e.indexOf("compatible")===-1&&e.indexOf("opera")===-1&&e.indexOf("webtv")===-1&&e.indexOf("hotjava")===-1&&d.isGecko&&!d.isFirebird&&!d.isFirefox&&(navigator.vendor===""||navigator.vendor==="Mozilla"||navigator.vendor==="Debian"),isNetscape:e.indexOf("mozilla")!==-1&&e.indexOf("spoofer")===-1&&e.indexOf("compatible")===-1&&e.indexOf("opera")===-1&&e.indexOf("webtv")===-1&&e.indexOf("hotjava")===-1&&!d.isKhtml&&!d.isMozilla&&!d.isFirebird&&!d.isFirefox,isIE:c.indexOf("msie")!==-1&&!d.isOpera&&!d.isKhtml,isIE6:d.isIE&&parseFloat(c.substring(c.indexOf("msie")+5))===6,isIE7:d.isIE&&parseFloat(c.substring(c.indexOf("msie")+5))===7,isIE8:d.isIE&&parseFloat(c.substring(c.indexOf("msie")+5))===8,isIE9:d.isIE&&parseFloat(c.substring(c.indexOf("msie")+5))===9,isAOL:e.indexOf("aol")!==-1,isWebTV:e.indexOf("webtv")!==-1,isTVNavigator:e.indexOf("navio")!==-1||e.indexOf("navio_aoltv")!==-1,isHotJava:e.indexOf("hotjava")!==-1})})(jQuery);
/*
* Password Validator v1.1
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Score index algorithm based on:
* www.passwordmeter.com
* Copyright 2007 Jeff Todnem
* Licensed under the GPL Version 2 license.
*/
(function(a){a.checkPassword=function(t){if(!t){return{score:0,complexity:a.checkPassword.globalization.textNoPassword,color:{r:255,g:0,b:0}}}var g=8,f=a.checkPassword.globalization.alphabet,e=a.checkPassword.globalization.keyboard,o={score:0,complexity:"",color:{r:255,g:0,b:0},numberOfCharacters:{count:t.length,bonus:t.length*4},upperCaseLetters:{count:0,bonus:0},lowerCaseLetters:{count:0,bonus:0},numbers:{count:0,bonus:0},symbols:{count:0,bonus:0},middleNumbersOrSymbols:{count:0,bonus:0},requirements:{count:0,bonus:0},lettersOnly:{count:0,bonus:0},numbersOnly:{count:0,bonus:0},repeatCharacters:{count:0,bonus:0},consecutiveUpperCaseLetters:{count:0,bonus:0},consecutiveLowerCaseLetters:{count:0,bonus:0},consecutiveNumbers:{count:0,bonus:0},sequentialLetters:{count:0,bonus:0},sequentialKeyboard:{count:0,bonus:0}};var k=t.replace(/\s+/g,"").split(/\s*/),n=0,q=-1,p=-1,r=-1;var b,d;for(b=0;b<k.length;b++){if(k[b].match(/[A-Z]/g)){if(q!==-1&&q+1===b){o.consecutiveUpperCaseLetters.count++}q=b;o.upperCaseLetters.count++}else{if(k[b].match(/[a-z]/g)){if(p!==-1&&p+1===b){o.consecutiveLowerCaseLetters.count++}p=b;o.lowerCaseLetters.count++}else{if(k[b].match(/[0-9]/g)){if(b>0&&b<k.length-1){o.middleNumbersOrSymbols.count++}if(r!==-1&&r+1===b){o.consecutiveNumbers.count++}r=b;o.numbers.count++}else{if(k[b].match(/[^a-zA-Z0-9_]/g)){if(b>0&&b<k.length-1){o.middleNumbersOrSymbols.count++}o.symbols.count++}}}}var m=false;for(d=0;d<k.length;d++){if(k[b]==k[d]&&b!=d){m=true;n+=Math.abs(k.length/(d-b))}}if(m){o.repeatCharacters.count++;var s=k.length-o.repeatCharacters.count;n=Math.ceil(s>0?n/s:n)}}var l=t.toUpperCase(),h;for(b=0;b<f.length-2;b++){h=f.substring(b,b+3);if(l.indexOf(h)!==-1||l.indexOf(h.split("").reverse().join(""))!==-1){o.sequentialLetters.count++}}for(b=0;b<e.length;b++){for(d=0;d<e[b].length-2;d++){h=e[b].substring(d,d+3);if(l.indexOf(h)!==-1||l.indexOf(h.split("").reverse().join(""))!==-1){o.sequentialKeyboard.count++}}}if(o.upperCaseLetters.count>0&&o.upperCaseLetters.count<t.length){o.upperCaseLetters.bonus=(t.length-o.upperCaseLetters.count)*2}if(o.lowerCaseLetters.count>0&&o.lowerCaseLetters.count<t.length){o.lowerCaseLetters.bonus=(t.length-o.lowerCaseLetters.count)*2}if(o.numbers.count>0&&o.numbers.count<t.length){o.numbers.bonus=o.numbers.count*4}if(o.symbols.count>0){o.symbols.bonus=o.symbols.count*6}if(o.middleNumbersOrSymbols.count>0){o.middleNumbersOrSymbols.bonus=o.middleNumbersOrSymbols.count*2}if((o.lowerCaseLetters.count>0||o.upperCaseLetters.count>0)&&o.numbers.count===0&&o.symbols.count===0){o.lettersOnly={count:t.length,bonus:-t.length}}if(o.lowerCaseLetters.count===0&&o.upperCaseLetters.count===0&&o.symbols.count===0&&o.numbers.count>0){o.numbersOnly={count:t.length,bonus:-t.length}}if(o.repeatCharacters.count>0){o.repeatCharacters.bonus=-o.repeatCharacters.count}if(o.consecutiveUpperCaseLetters.count>0){o.consecutiveUpperCaseLetters.bonus=-o.consecutiveUpperCaseLetters.count*2}if(o.consecutiveLowerCaseLetters.count>0){o.consecutiveLowerCaseLetters.bonus=-o.consecutiveLowerCaseLetters.count*2}if(o.consecutiveNumbers.count>0){o.consecutiveNumbers.bonus=-o.consecutiveNumbers.count*2}if(o.sequentialLetters.count>0){o.sequentialLetters.bonus=-o.sequentialLetters.count*3}if(o.sequentialKeyboard.count>0){o.sequentialKeyboard.bonus=-o.sequentialKeyboard.count*3}if(o.numberOfCharacters.count>=g){o.requirements.count++}if(o.upperCaseLetters.count>0){o.requirements.count++}if(o.lowerCaseLetters.count>0){o.requirements.count++}if(o.numbers.count>0){o.requirements.count++}if(o.symbols.count>0){o.requirements.count++}o.requirements.bonus=o.requirements.count*2;for(var c in o){if(typeof o[c]!=="function"&&c!=="score"&&c!=="complexity"&&o[c].bonus){o.score+=o[c].bonus}}if(o.score>100){o.score=100}else{if(o.score<0){o.score=0}}if(o.score<20){o.complexity=a.checkPassword.globalization.textVeryWeak}else{if(o.score>=20&&o.score<40){o.complexity=a.checkPassword.globalization.textWeak}else{if(o.score>=40&&o.score<60){o.complexity=a.checkPassword.globalization.textGood}else{if(o.score>=60&&o.score<80){o.complexity=a.checkPassword.globalization.textStrong}else{if(o.score>=80){o.complexity=a.checkPassword.globalization.textVeryStrong}}}}}if(o.score===0){o.color={r:255,g:0,b:0}}else{if(o.score===50){o.color={r:255,g:255,b:0}}else{if(o.score===100){o.color={r:0,g:255,b:0}}else{if(o.score<50){o.color={r:255,g:Math.ceil((o.score*2*255)/100),b:0}}else{o.color={r:255-Math.ceil((o.score*255)/100),g:255,b:0}}}}}return o};a.checkPassword.version="1.1";a.checkPassword.globalization={alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",keyboard:["01234567890","!@#$%^&*()","QWERTYUIOP","ASDFGHJKL","ZXCVBNM"],textNoPassword:"No Password",textVeryWeak:"Very Weak",textWeak:"Weak",textGood:"Good",textStrong:"Strong",textVeryStrong:"Very Strong"}})(jQuery);
/*
* General helper library
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){a.extend({isEmail:function(b){if(!arguments.callee.REGEX){arguments.callee.REGEX=/^(?=.{0,256}$)(?=[^@]{1,64}@)[\w!#$%&'*+\/=?\^`{|}~\-]+(?:\.[\w!#$%&'*+\/=?\^`{|}~\-]+)*@(?=[^@]{1,255}$)(?:[a-zA-Z\d](?:[a-zA-Z\d\-]*[a-zA-Z\d])?\.)+[a-zA-Z\d](?:[a-zA-Z\d\-]*[a-zA-Z\d])?$/}return b&&b!==null&&arguments.callee.REGEX.test(b)},isValidDomain:function(b){if(!arguments.callee.REGEX){arguments.callee.REGEX=/^(?=[^@]{1,255}$)(?:[a-zA-Z\d](?:[a-zA-Z\d\-]*[a-zA-Z\d])?\.)+[a-zA-Z\d](?:[a-zA-Z\d\-]*[a-zA-Z\d])?$/}return b&&b!==null&&arguments.callee.REGEX.test(b)},randomNumber:function(b,c){b=b?b:0;c=c?c+1:b+2;return(Math.floor(Math.random()*(c-b))+b)},randomPassword:function(c){c=c?c:8;var d="";for(var b=0;b<c;b++){switch(a.randomNumber(1,3)){case 1:d+=String.fromCharCode(a.randomNumber(48,57));break;case 2:d+=String.fromCharCode(a.randomNumber(65,90));break;case 3:d+=String.fromCharCode(a.randomNumber(97,122));break}}return d},calcHourPart:function(b){b=b?Number(b):0;return parseInt(b/60,10)},calcMinutePart:function(b){b=b?Number(b):0;return b%60},compare:function(b,c){if(b===c||b==c){return 0}if(b===null||b===undefined||b>c){return -1}return 1},isDate:function(b){return b instanceof Date||!isNaN(Date.parse(b))}});Number.compare=function(b,c){return b==c?0:b<c?-1:1};Error.prototype.toErrorString=function(){var b=this;return"Message: "+b.message+"\nDesc: "+b.description+"\nName: "+b.name+"\nNumber: "+b.number+"\nLine: "+b.lineNumber+"\nFile: "+b.fileName+"\nStack Trace:\n"+b.stack.replace(/@/g,"\n\tat ")};Error.prototype.showAlert=function(){alert(this.toErrorString())}})(jQuery);
/*
* Date helper library
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){Date.prototype.toString=function(f,g){if(f!==undefined){return this.format(f,g)}return this.toDateString()+" "+this.toTimeString()};Date.prototype.equals=function(f){return this.getTime()==f.getTime()};Date.prototype.addYears=function(f){this.setFullYear(this.getFullYear()+f);return this};Date.prototype.addMonths=function(f){this.setMonth(this.getMonth()+f);return this};Date.prototype.addDays=function(f){this.setDate(this.getDate()+f);return this};Date.prototype.addHours=function(f){this.setHours(this.getHours()+f);return this};Date.prototype.addMinutes=function(f){this.setMinutes(this.getMinutes()+f);return this};Date.prototype.addSeconds=function(f){this.setSeconds(this.getSeconds()+f);return this};Date.prototype.addMilliseconds=function(f){this.setMilliseconds(this.getMilliseconds()+f);return this};Date.prototype.getFirstWeekDay=function(){var f=this.clone();f.addDays(f.getDay()*-1);return f};Date.prototype.getLastWeekDay=function(){var f=this.clone();f.addDays((f.getDay()*-1)+6);return f};Date.prototype.getFirstMonthDay=function(){return new Date(this.getFullYear(),this.getMonth(),1,0,0,0,0)};Date.prototype.getLastMonthDay=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth(),0,0,0,0)};Date.prototype.getDaysInMonth=function(){return Date.daysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.getIsoWeekNumber=function(){return Date.isoWeekNumber(this)};Date.prototype.getDayOfYear=function(f){if(f!==true){f=false}return Date.dayOfYear(f?this.getUTCFullYear():this.getFullYear(),f?this.getUTCMonth():this.getMonth(),f?this.getUTCDate():this.getDate())};Date.prototype.getLongMonthName=function(){return Date.longMonthName(this.getMonth())};Date.prototype.getShortMonthName=function(){return Date.shortMonthName(this.getMonth())};Date.prototype.getLongWeekDayName=function(){return Date.longWeekDayName(this.getDay())};Date.prototype.getShortWeekDayName=function(){return Date.shortWeekDayName(this.getDay())};Date.prototype.getWeekDayLetter=function(){return Date.weekDayLetter(this.getDay())};Date.prototype.date=function(){var f=this.clone();f.setHours(0,0,0,0);return f};Date.prototype.timeOfDay=function(){var f=this.clone();f.setFullYear(1970,0,1);return f};Date.prototype.clone=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())};Date.prototype.isLessThan=function(f){return this.getTime()<f.getTime()};Date.prototype.isGreaterThan=function(f){return this.getTime()>f.getTime()};Date.prototype.isLessThanOrEqualTo=function(f){return this.getTime()<=f.getTime()};Date.prototype.isGreaterThanOrEqualTo=function(f){return this.getTime()>=f.getTime()};Date.prototype.format=function(f,h){if(typeof f!=="string"||f.length<=0){return""}if(h!==true){h=false}switch(f){case"ATOM":case"ISO_8601":case"JSON":case"W3C":case"XML":f="yyyy-MM-ddTHH:mm:ss.fffzzzz";break;case"COOKIE":f="ddd, d MMM yyyy HH:mm:ss UTC";h=true;break;case"RFC_822":case"RFC_2822":case"RSS":f="ddd, d MMM yyyy HH:mm:ss zzz";break;case"RFC_850":case"RFC_1036":f="ddd, d MMM yy HH:mm:ss zzz";break}var v="",g=0,l="",x="",p=false,B=h?this.getUTCFullYear():this.getFullYear(),t=h?this.getUTCMonth():this.getMonth(),m=h?this.getUTCDate():this.getDate(),o=h?this.getUTCHours():this.getHours(),s=h?this.getUTCMinutes():this.getMinutes(),w=h?this.getUTCSeconds():this.getSeconds(),r=h?this.getUTCMilliseconds():this.getMilliseconds(),u=r/1000,j=o>11?o-12:o,z=this.getTimezoneOffset()<0?"+":"-",k=Math.abs(this.getTimezoneOffset()),y=k/60,q=this.getIsoWeekNumber(),n=this.getDayOfYear(),A={};if(j===0){j=12}A.ffff=e(u,4).toString().replace("0.","");A.fff=e(u,3).toString().replace("0.","");A.ff=e(u,2).toString().replace("0.","");A.f=e(u,1).toString().replace("0.","");A.FFFF=d(e(u,4),4).replace("0.","");A.FFF=d(e(u,3),3).replace("0.","");A.FF=d(e(u,2),2).replace("0.","");A.F=d(e(u,1),1).replace("0.","");A.ss=c(w,2);A.s=w.toString();A.mm=c(s,2);A.m=s.toString();A.hhhh=o===0?"midnight":(o===12?"noon":c(j,2));A.hhh=o===0?"midnight":(o===12?"noon":j.toString());A.hh=c(j,2);A.h=j.toString();A.HHHH=o===0?"midnight":(o===12?"noon":c(o,2));A.HHH=o===0?"midnight":(o===12?"noon":o.toString());A.HH=c(o,2);A.H=o.toString();A.dddd=this.getLongWeekDayName();A.ddd=this.getShortWeekDayName();A.dd=c(m,2);A.d=m.toString();A.MMMM=this.getLongMonthName();A.MMM=this.getShortMonthName();A.MM=c(t+1,2);A.M=(t+1).toString();A.yyyy=c(B,4);A.yy=c(B,4).substr(2);A.y=B.toString();A.jjj=c(n,3);A.jj=c(n,2);A.j=c(n,1);A.wwww=c(q,2)+b(q);A.www=c(q,1)+b(q);A.ww=c(q,2);A.w=c(q,1);A.O=b(n);A.o=b(m);A.zzzz=h?"Z":z+c(y,2)+":"+c(k-(y*60),2);A.zzz=h?"Z":z+c(y,2)+c(k-(y*60),2);A.zz=h?"Z":z+c(y,2);A.z=h?"Z":z+y.toString();A.tt=o>11?"PM":"AM";A.t=o>11?"pm":"am";A.G=B<0?"BC":"AD";A.g=B<0?"bc":"ad";if((o===0||o===12)&&s===0&&w===0&&r===0&&(f.indexOf("hhh")>=0||f.indexOf("HHH")>=0)){f=f.replace("f","").replace("F","").replace("s","").replace("m","").replace("t","").replace(":","")}while(g<f.length){l=f.charAt(g);x="";if(!p&&l==="<"){p=true}if(!p){while((f.charAt(g)===l)&&(g<f.length)){x+=f.charAt(g++)}if(A[x]!==undefined&&A[x]!==null){v+=A[x]}else{v+=x}}else{g++;v+=l;if(p&&l===">"){p=false}}}return v.trim()};function e(h,f){var g=Math.pow(10,f);return Math.round(h*g)/g}function c(k,f){var j=String(k.valueOf()),h=j.length;if(h<f){for(var g=h;g<f;g++){j="0"+j}}return j}function d(k,f){var j=String(k.valueOf()).split(".");if(j.length<=0){return f>0?"0."+"0".replicate(f):"0"}if(j.length===1){return j[0]+(f>0?"."+"0".replicate(f):"")}var h=j[1];if(h.length<f){for(var g=h.length;g<f;g++){h=h+"0"}}return j[0]+(f>0?"."+h:"")}function b(f){if(f>100){return b(f%100)}if(f>=11&&f<=19){return"th"}switch(f%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"}Date.prototype.UTCAddYears=function(f){this.setUTCFullYear(this.getUTCFullYear()+f);return this};Date.prototype.UTCAddMonths=function(f){this.setUTCMonth(this.getUTCMonth()+f);return this};Date.prototype.UTCAddDays=function(f){this.setUTCDate(this.getUTCDate()+f);return this};Date.prototype.UTCAddHours=function(f){this.setUTCHours(this.getUTCHours()+f);return this};Date.prototype.UTCAddMinutes=function(f){this.setUTCMinutes(this.getUTCMinutes()+f);return this};Date.prototype.UTCAddSeconds=function(f){this.setUTCSeconds(this.getUTCSeconds()+f);return this};Date.prototype.UTCAddMilliseconds=function(f){this.setUTCMilliseconds(this.getUTCMilliseconds()+f);return this};Date.daysInMonths=[31,28,31,30,31,30,31,31,30,31,30,31];Date.longMonthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.shortMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.longWeekDayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.shortWeekDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.weekDayLetters=["S","M","T","W","T","F","S"];Date.compare=function(f,g){return f.isLessThan(g)?-1:(f.equals(g)?0:1)};Date.today=function(){var f=new Date();f.setHours(0,0,0,0);return f};Date.now=function(){return new Date()};Date.isLeapYear=function(f){if(f%400===0){return true}else{if(f%100===0){return false}else{if(f%4===0){return true}}}return false};Date.daysInMonth=function(g,f){if(f>11||f<0){throw"month is an invalid value."}if(f===1){return Date.isLeapYear(g)?29:28}return Date.daysInMonths[f]};Date.longMonthName=function(f){if(f>11||f<0){throw"month is an invalid value."}return Date.longMonthNames[f]};Date.shortMonthName=function(f){if(f>11||f<0){throw"month is an invalid value."}return Date.shortMonthNames[f]};Date.longWeekDayName=function(f){if(f>6||f<0){throw"weekday is an invalid value."}return Date.longWeekDayNames[f]};Date.shortWeekDayName=function(f){if(f>6||f<0){throw"weekday is an invalid value."}return Date.shortWeekDayNames[f]};Date.weekDayLetter=function(f){if(f>6||f<0){throw"weekday is an invalid value."}return Date.weekDayLetters[f]};Date.dateDiff=function(h,f,g){var i=f.getTime(),j=g.getTime(),k=i-j;switch(h){case"ms":return k;case"s":return k/1000;case"m":return k/(1000*60);case"h":return k/(1000*60*60);case"d":return k/(1000*60*60*24);case"ww":throw"Week of year is not supported yet.";case"w":throw"Weekdays are not supported yet.";case"y":throw"Day of year is not supported yet.";case"m":throw"Months are not supported yet.";case"q":throw"Quarters are not supported yet.";case"yyyy":throw"Years are not supported yet.";default:throw"part is not a regonized token."}};Date.isoWeekNumber=function(f){var g=f.clone(),i=new Date(g.getFullYear(),0,1,0,0,0,0),h=((Date.UTC(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0)-Date.UTC(g.getFullYear(),0,1,0,0,0,0))/1000/60/60/24)+1;v_offset=7+1-i.getDay();if(v_offset===8){v_offset=1}var l=Math.floor((h-v_offset+7)/7);if(l===0){g.addYears(-1);var j=new Date(g.getFullYear(),0,1,0,0,0,0),k=7+1-j.getDay();if(k===2||k===8){l=53}else{l=52}}return l};Date.dayOfYear=function(j,h,f){if(h===0){return f}for(var g=0;g<h;g++){if(g===1&&Date.isLeapYear(j)){f+=29}else{f+=Date.daysInMonths[g]}}return f}})(jQuery);
/*
* jQuery Dirty Check plugin v1.0
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($){$.extend({dirtyCheck:function(options,name,value){var dc=DirtyCheck._inst;if(options==="isInit"){return dc!==null}if(dc!==null){switch(options){case"isDirty":return dc.pageIsDirty;case"dirty":dc.dirty();break;case"clean":dc.clean();break;case"check":return dc.check();case"save":dc.save();break;case"option":if(typeof name==="string"){if(value===undefined){return dc.options[name]}dc.options[name]=value}else{if(name===undefined){return dc.options}else{dc.options=$.extend(dc.options,name)}}break;case"enable":dc.options.disabled=false;break;case"disable":dc.options.disabled=true;break;case"refresh":dc.refresh(name);break;case"remove":dc.destroy(name);if(name===undefined||name===null){dc=DirtyCheck._inst=null}break;case"destroy":dc.destroy(name);dc=DirtyCheck._inst=null;break}}else{if(typeof options==="string"){throw new Error("Can not call a method before the dirty check object is created.")}else{dc=DirtyCheck._inst=new DirtyCheck(options);$(window).bind("unload",_destroy)}}return $}});function _destroy(){if(DirtyCheck._inst!==null){DirtyCheck._inst.destroy();DirtyCheck._inst=null}$(window).unbind("unload",_destroy)}$.dirtyCheck.defaults={autoCreate:true,disabled:false,onlySaveIfDirty:true,autoCleanOnCheck:true,scope:"body",text:function(isBeforeUnload){if(isBeforeUnload){return"You have unsaved changes, if you navigate away, all unsaved changes will be lost."}return"Are you sure you want to navigate away from this page?\n\nYou have unsaved changes, if you navigate away, all unsaved changes will be lost.\n\nPress OK to continue, or Cancel to stay."},doCheck:function(text){return confirm(text)},doSave:function(){return true},becomeDirty:null,becomeClean:null,dirty:[{selector:"input:password,input:text,textarea",eventType:"keypress"},{selector:"input:checkbox,input:file,input:hidden,input:radio,select",eventType:"change"}],clean:[{selector:":reset",eventType:"click"}],check:["beforeunload",{selector:":button,a",eventType:"click"}],save:[{selector:":submit,:image",eventType:"click"}]};function DirtyCheck(options){var t=this;t.pageIsDirty=false;t.options=$.extend({},$.dirtyCheck.defaults,options);if(typeof t.options.scope!=="string"&&!t.options.scope.jquery){throw new Error("scope option must be a valid jQuery selector or jQuery object.")}if(!$.isFunction(t.options.doCheck)){throw new Error("doCheck option must be a function.")}if(!$.isArray(t.options.dirty)){throw new Error("dirty option must be an array.")}if(!$.isArray(t.options.clean)){throw new Error("clean option must be an array.")}if(!$.isArray(t.options.check)){throw new Error("check option must be an array.")}function _parseHtml(scopeOverride,remove){var scope=scopeOverride||t.options.scope;if(!scope.jquery){scope=$(scope)}if(scope===null||scope===undefined||scope.length<=0){throw new Error("An invalid scope was provided. Please provide a valid jQuery selector that returns at least one element, or a jQuery object with at least one element for the scope.")}_parseSimpleHandler(t.options.dirty,t.dirty,"change",scope,remove,false);_parseSimpleHandler(t.options.clean,t.clean,"click",scope,remove,false);for(var i=0;i<t.options.check.length;i++){var item=_parseItem(t.options.check[i],"click");if(item===null){continue}if(item.e==="unload"){throw new Error("unload event is only valid for the save option.")}if(item.e==="beforeunload"){_addCheckHandler(window,"beforeunload",_beforeUnloadHandler,remove);continue}scope.find(item.s).each(function(){_addCheckHandler(this,item.e,t.check,remove)})}_parseSimpleHandler(t.options.save,t.save,"click",scope,remove,true)}function _parseSimpleHandler(optArray,handler,defaultAttr,scope,remove,isSave){for(var i=0;i<optArray.length;i++){var item=_parseItem(optArray[i],defaultAttr);if(item===null){continue}if(item.e==="beforeunload"){throw new Error("beforeunload event is only valid for the check option.")}if(!isSave&&item.e==="unload"){throw new Error("unload event is only valid for the save option.")}(item.e==="unload"?$(window):scope.find(item.s)).each(function(){var _self=$(this);if(_self.attr("dc_set")==="1"){if(remove){_self.unbind(item.e,handler).removeAttr("dc_set")}return}_self.bind(item.e,handler).attr("dc_set","1")})}}function _parseItem(item,defaultEvent){if(item==="unload"||item==="beforeunload"){return{s:"",e:item}}if(typeof item==="string"){return{s:item,e:defaultEvent}}return{s:item.selector,e:typeof item.eventType!=="string"||item.eventType.length<=0?defaultEvent:item.eventType}}function _addCheckHandler(element,attr,handler,remove){var _self=$(element);if(_self.attr("dc_set")==="1"){if(remove){var data=_self.data("dirtycheck");if(data&&data.attr&&data.value){_self.attr(data.attr,data.value)}_self.removeData("dirtycheck").unbind(attr,handler).unbind(attr,_execOriginalValue).removeAttr("dc_set")}return}_self.bind(attr,handler).attr("dc_set","1");var content=_self.attr("on"+attr);if(typeof content==="string"&&content.length>0){_self.data("dirtycheck",{attr:"on"+attr,value:content}).bind(attr,_execOriginalValue).removeAttr("on"+attr)}}function _execOriginalValue(){var data=$.data(this,"dirtycheck");if(data&&typeof data.value==="string"){eval(data.value)}}function _beforeUnloadHandler(){if(!t.options.disabled&&t.pageIsDirty){return _getText(true)}}function _getText(isBeforeUnload){if($.isFunction(t.options.text)){return t.options.text(isBeforeUnload)}return t.options.text}t.dirty=function(){if(t.options.disabled||t.pageIsDirty){return}t.pageIsDirty=true;if($.isFunction(t.options.becomeDirty)){t.options.becomeDirty()}};t.clean=function(){if(t.options.disabled||!t.pageIsDirty){return}t.pageIsDirty=false;if($.isFunction(t.options.becomeClean)){t.options.becomeClean()}};t.check=function(){if(t.options.disabled||!t.pageIsDirty){return true}var v_check=t.options.doCheck(_getText(false));if(v_check&&t.options.autoCleanOnCheck){t.clean()}return v_check};t.save=function(){if(t.options.disabled||(t.options.onlySaveIfDirty&&!t.pageIsDirty)){return}if($.isFunction(t.options.doSave)&&t.options.doSave()!==false){t.clean()}};t.refresh=function(scope){_parseHtml(scope,false)};t.destroy=function(scope){_parseHtml(scope,true)};if(t.options.autoCreate){_parseHtml(null,false)}}DirtyCheck._inst=null})(jQuery);
/*
* Google Tools library
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
GMAPINIT=null;(function(a){a.fn.gMap=function(i,h){var b=this;if(b.length>1){throw"This plugin does not work on multiple elements."}if(typeof i==="string"){var j=b.data("googleMap");if(j){j[i].apply(j,h);return}throw"You must create the map before you can call methods on it."}if(!i||!i.apiKey){throw"Unable to create the Google Map. Reason: No API key provided."}if(b.data("gMap.loaded")){g()}else{GMAPINIT=g;a("head").append(a('<script type="text/javascript" src="'+("https:"===document.location.protocol?"https":"http")+"://maps.google.com/maps/api/js?v=3.5&sensor=false&callback=GMAPINIT&key="+i.apiKey+'"></script>'))}function g(){GMAPINIT=null;b.data("gMap.loaded",true);var k=d(b.get(0));if(i.marker&&i.marker.latitude&&i.marker.longitude){if(!i.center||(!i.center.latitude&&!i.center.longitude)){f(k,i.marker.latitude,i.marker.longitude)}c(k,i.marker)}}function e(l){if(a.isFunction(i.error)){i.error(l)}else{try{b.html(l)}catch(k){alert(l)}}}function d(l){try{var m={zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP};if(i.center&&i.center.latitude&&i.center.longitude){m.center=new google.maps.LatLng(i.marker.latitude,i.marker.longitude)}return new google.maps.Map(l,m)}catch(k){e("Unable to create the Google Map. Reason: "+k.toString())}return null}function f(n,l,m){if(!n||(!l&&!m)){return false}try{n.setCenter(new google.maps.LatLng(l,m));return true}catch(k){e("Unable to set the Google Map center point. Reason: "+k.toString())}return false}function c(l,m){if(!l||!m){return}try{v_gm_marker=new google.maps.Marker({map:l,position:new google.maps.LatLng(m.latitude,m.longitude),title:m.title,clickable:m.infoWindow&&m.infoWindow.showOnClick,visible:true});if(m.infoWindow){var n=new google.maps.InfoWindow({content:m.infoWindow.title});if(m.infoWindow.showOnClick){google.maps.event.addListener(v_gm_marker,"click",function(){n.open(l,v_gm_marker)})}if(m.infoWindow.visible){n.open(l,v_gm_marker)}}}catch(k){e("Unable to add marker to Google Map. Reason: "+k.toString())}}};a.extend({gaTrackPage:function(b){if(!b){throw"Unable to track the current page using Google Analytics. Reason: No account identifier provided."}a.ajax({type:"GET",url:("https:"===document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js",dataType:"script",cache:true,success:function(){if(!_gat){throw"Unable to track the current page using Google Analytics. Reason: _gat is undefined."}_gat._getTracker(b)._trackPageview()}})},gawTrackConversion:function(n){var o=undefined;n=a.extend({id:o,lang:"en_US",format:"1",color:"FFFFFF",label:o,value:0,type:o,orderId:o,domain:o,items:o,params:o,callback:o},n);if(!n.id){throw"Unable to track the conversion. Reason: no ID specified."}var e=n.id,h=n.lang,d=n.format,b=n.color,g=n.label,k=n.value,j=n.type,i=n.orderId,c=n.domain,f=n.items,l=n.params,m=n.callback;a.getScript(("https:"===document.location.protocol?"https://":"http://")+"www.googleadservices.com/pagead/conversion.js")}})})(jQuery);
/*
* JavaScript HTML Utility library
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){a.extend({addBookmark:function(b){b=b?String(b):document.title;var d=false;try{if(window.sidebar){window.sidebar.addPanel(b,window.location.href,"")}else{if(window.external){window.external.AddFavorite(window.location.href,b)}else{d=true}}}catch(c){d=true}if(d){alert("Please press Ctrl+D to bookmark this page.")}},generateSelect:function(d){a.extend({attributes:null,count:0,items:null,addOne:false,getValue:null},d);var b,e=a("<select/>").attr(d.attributes);if(typeof d.count==="number"&&d.count>0){for(b=0;b<d.count;b++){var f=b+(d.addOne?1:0);e.append(a("<option/>").val(f).html(a.isFunction(d.getValue)?d.getValue(f):f))}}else{if(a.isArray(d.items)&&d.items.length>0){for(b=0;b<d.items.length;b++){e.append(a("<option/>").val(b+(d.addOne?1:0)).html(a.isFunction(d.getValue)?d.getValue(d.items[b]):d.items[b]))}}else{for(var c in d.items){if(typeof d.items[c]!="function"){e.append(a("<option/>").val(c).html(a.isFunction(d.getValue)?d.getValue(d.items[c]):d.items[c]))}}}}return e},getScrollBarWidth:function(){var b=a('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div>');a("body").append(b);var c=a("div",b).innerWidth();b.css("overflow-y","scroll");var d=a("div",b).innerWidth();a(b).remove();return c-d}})})(jQuery);
/*
* String helper library
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($){String.prototype.trim=function(){if($.trim){return $.trim(this)}if(!arguments.callee.REGEX){arguments.callee.REGEX=/^\s+|\s+$/g}return this.replace(arguments.callee.REGEX,"")};String.prototype.toProperCase=function(){var v_callee=arguments.callee;if(!v_callee.REGEX){v_callee.REGEX=/\w+/g}if(!v_callee.SUB_REGEX){v_callee.SUB_REGEX=/[A-Z]+/}function __wordToProperCase(word){if(word.length<=3&&word.match(v_callee.SUB_REGEX)){return word}return word.charAt(0).toUpperCase()+word.substr(1).toLowerCase()}return this.replace(arguments.callee.REGEX,__wordToProperCase)};String.prototype.isNumeric=function(){if(!arguments.callee.REGEX){arguments.callee.REGEX=/^\-?[0-9,]+\.?[0-9]*?$/}return arguments.callee.REGEX.test(this)};String.prototype.isAlphaNumeric=function(){if(!arguments.callee.REGEX){arguments.callee.REGEX=/^[0-9A-Z,\. \-]*$/i}return arguments.callee.REGEX.test(this)};String.prototype.isEmpty=function(){if(!arguments.callee.REGEX){arguments.callee.REGEX=/^\s*$/}return arguments.callee.REGEX.test(this)};String.prototype.reverse=function(){return this.split("").reverse().join("")};String.prototype.regExEscape=function(){if(!arguments.callee.REGEX){arguments.callee.REGEX=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g")}return this.replace(arguments.callee.REGEX,"\\$1")};String.prototype.htmlEncode=function(){return String.htmlEncode(this)};String.prototype.htmlDecode=function(){return String.htmlDecode(this)};String.prototype.count=function(subString){var v_count=0;for(var i=0;i<this.length;i++){if(subString===this.substr(i,subString.length)){v_count++}}return v_count};String.prototype.replicate=function(count){count=typeof count!=="number"||count<1?1:count;var v_retval="";for(var i=0;i<count;i++){v_retval+=this}return v_retval};String.prototype.startsWith=function(value){if(typeof value!=="string"||value.length<=0){return false}return this.substr(0,value.length)===value};String.prototype.endsWith=function(value){if(typeof value!=="string"||value.length<=0){return false}return this.substr(this.length-value.length)===value};String.isNullOrEmpty=function(value){if(value===null||value===undefined){return true}if(typeof value!=="string"){value=value.toString()}return value.length<=0};String.isAllNullOrEmpty=function(){if(arguments&&arguments.length>0){for(var i=0;i<arguments.length;i++){if(!String.isNullOrEmpty(arguments[i])){return false}}}return true};String.htmlEncode=function(obj){if(obj===undefined||obj===null){return""}var v_string=obj.toString();if(v_string.length<=0){return""}var v_div=document.createElement("div");var v_text=document.createTextNode(v_string);v_div.appendChild(v_text);return v_div.innerHTML};String.htmlDecode=function(obj){if(obj===undefined||obj===null){return""}var v_retval="",v_string=obj.toString();if(v_string.length<=0){return""}for(var i=0;i<v_string.length;i++){var v_char=v_string.charAt(i);if(v_char==="&"){var v_sc_index=v_string.indexOf(";",i+1);if(v_sc_index>0){var v_entity=v_string.substring(i+1,v_sc_index);if(v_entity.length>1&&v_entity.charAt(0)==="#"){if(v_entity.charAt(1)==="x"||v_entity.charAt(1)==="X"){v_retval+=String.fromCharCode(eval("0"+v_entity.substring(1)))}else{v_retval+=String.fromCharCode(eval(v_entity.substring(1)))}}else{switch(v_entity){case"quot":v_retval+=String.fromCharCode(34);break;case"amp":v_retval+=String.fromCharCode(38);break;case"lt":v_retval+=String.fromCharCode(60);break;case"gt":v_retval+=String.fromCharCode(62);break;case"nbsp":v_retval+=String.fromCharCode(160);break;case"iexcl":v_retval+=String.fromCharCode(161);break;case"cent":v_retval+=String.fromCharCode(162);break;case"pound":v_retval+=String.fromCharCode(163);break;case"curren":v_retval+=String.fromCharCode(164);break;case"yen":v_retval+=String.fromCharCode(165);break;case"brvbar":v_retval+=String.fromCharCode(166);break;case"sect":v_retval+=String.fromCharCode(167);break;case"uml":v_retval+=String.fromCharCode(168);break;case"copy":v_retval+=String.fromCharCode(169);break;case"ordf":v_retval+=String.fromCharCode(170);break;case"laquo":v_retval+=String.fromCharCode(171);break;case"not":v_retval+=String.fromCharCode(172);break;case"shy":v_retval+=String.fromCharCode(173);break;case"reg":v_retval+=String.fromCharCode(174);break;case"macr":v_retval+=String.fromCharCode(175);break;case"deg":v_retval+=String.fromCharCode(176);break;case"plusmn":v_retval+=String.fromCharCode(177);break;case"sup2":v_retval+=String.fromCharCode(178);break;case"sup3":v_retval+=String.fromCharCode(179);break;case"acute":v_retval+=String.fromCharCode(180);break;case"micro":v_retval+=String.fromCharCode(181);break;case"para":v_retval+=String.fromCharCode(182);break;case"middot":v_retval+=String.fromCharCode(183);break;case"cedil":v_retval+=String.fromCharCode(184);break;case"sup1":v_retval+=String.fromCharCode(185);break;case"ordm":v_retval+=String.fromCharCode(186);break;case"raquo":v_retval+=String.fromCharCode(187);break;case"frac14":v_retval+=String.fromCharCode(188);break;case"frac12":v_retval+=String.fromCharCode(189);break;case"frac34":v_retval+=String.fromCharCode(190);break;case"iquest":v_retval+=String.fromCharCode(191);break;case"Agrave":v_retval+=String.fromCharCode(192);break;case"Aacute":v_retval+=String.fromCharCode(193);break;case"Acirc":v_retval+=String.fromCharCode(194);break;case"Atilde":v_retval+=String.fromCharCode(195);break;case"Auml":v_retval+=String.fromCharCode(196);break;case"Aring":v_retval+=String.fromCharCode(197);break;case"AElig":v_retval+=String.fromCharCode(198);break;case"Ccedil":v_retval+=String.fromCharCode(199);break;case"Egrave":v_retval+=String.fromCharCode(200);break;case"Eacute":v_retval+=String.fromCharCode(201);break;case"Ecirc":v_retval+=String.fromCharCode(202);break;case"Euml":v_retval+=String.fromCharCode(203);break;case"Igrave":v_retval+=String.fromCharCode(204);break;case"Iacute":v_retval+=String.fromCharCode(205);break;case"Icirc":v_retval+=String.fromCharCode(206);break;case"Iuml":v_retval+=String.fromCharCode(207);break;case"ETH":v_retval+=String.fromCharCode(208);break;case"Ntilde":v_retval+=String.fromCharCode(209);break;case"Ograve":v_retval+=String.fromCharCode(210);break;case"Oacute":v_retval+=String.fromCharCode(211);break;case"Ocirc":v_retval+=String.fromCharCode(212);break;case"Otilde":v_retval+=String.fromCharCode(213);break;case"Ouml":v_retval+=String.fromCharCode(214);break;case"times":v_retval+=String.fromCharCode(215);break;case"Oslash":v_retval+=String.fromCharCode(216);break;case"Ugrave":v_retval+=String.fromCharCode(217);break;case"Uacute":v_retval+=String.fromCharCode(218);break;case"Ucirc":v_retval+=String.fromCharCode(219);break;case"Uuml":v_retval+=String.fromCharCode(220);break;case"Yacute":v_retval+=String.fromCharCode(221);break;case"THORN":v_retval+=String.fromCharCode(222);break;case"szlig":v_retval+=String.fromCharCode(223);break;case"agrave":v_retval+=String.fromCharCode(224);break;case"aacute":v_retval+=String.fromCharCode(225);break;case"acirc":v_retval+=String.fromCharCode(226);break;case"atilde":v_retval+=String.fromCharCode(227);break;case"auml":v_retval+=String.fromCharCode(228);break;case"aring":v_retval+=String.fromCharCode(229);break;case"aelig":v_retval+=String.fromCharCode(230);break;case"ccedil":v_retval+=String.fromCharCode(231);break;case"egrave":v_retval+=String.fromCharCode(232);break;case"eacute":v_retval+=String.fromCharCode(233);break;case"ecirc":v_retval+=String.fromCharCode(234);break;case"euml":v_retval+=String.fromCharCode(235);break;case"igrave":v_retval+=String.fromCharCode(236);break;case"iacute":v_retval+=String.fromCharCode(237);break;case"icirc":v_retval+=String.fromCharCode(238);break;case"iuml":v_retval+=String.fromCharCode(239);break;case"eth":v_retval+=String.fromCharCode(240);break;case"ntilde":v_retval+=String.fromCharCode(241);break;case"ograve":v_retval+=String.fromCharCode(242);break;case"oacute":v_retval+=String.fromCharCode(243);break;case"ocirc":v_retval+=String.fromCharCode(244);break;case"otilde":v_retval+=String.fromCharCode(245);break;case"ouml":v_retval+=String.fromCharCode(246);break;case"divide":v_retval+=String.fromCharCode(247);break;case"oslash":v_retval+=String.fromCharCode(248);break;case"ugrave":v_retval+=String.fromCharCode(249);break;case"uacute":v_retval+=String.fromCharCode(250);break;case"ucirc":v_retval+=String.fromCharCode(251);break;case"uuml":v_retval+=String.fromCharCode(252);break;case"yacute":v_retval+=String.fromCharCode(253);break;case"thorn":v_retval+=String.fromCharCode(254);break;case"yuml":v_retval+=String.fromCharCode(255);break;case"ndash":v_retval+=String.fromCharCode(8211);break;case"mdash":v_retval+=String.fromCharCode(8212);break;case"lsquo":v_retval+=String.fromCharCode(8216);break;case"rsquo":v_retval+=String.fromCharCode(8217);break;case"sbquo":v_retval+=String.fromCharCode(8218);break;case"ldquo":v_retval+=String.fromCharCode(8220);break;case"rdquo":v_retval+=String.fromCharCode(8221);break;case"bdquo":v_retval+=String.fromCharCode(8222);break;case"dagger":v_retval+=String.fromCharCode(8224);break;case"Dagger":v_retval+=String.fromCharCode(8225);break;case"permil":v_retval+=String.fromCharCode(8240);break;case"lsaquo":v_retval+=String.fromCharCode(8249);break;case"rsaquo":v_retval+=String.fromCharCode(8250);break;case"oline":v_retval+=String.fromCharCode(8254);break;case"frasl":v_retval+=String.fromCharCode(8260);break;case"larr":v_retval+=String.fromCharCode(8592);break;case"uarr":v_retval+=String.fromCharCode(8593);break;case"rarr":v_retval+=String.fromCharCode(8594);break;case"darr":v_retval+=String.fromCharCode(8595);break;case"trade":v_retval+=String.fromCharCode(8482);break;case"spades":v_retval+=String.fromCharCode(9824);break;case"clubs":v_retval+=String.fromCharCode(9827);break;case"hearts":v_retval+=String.fromCharCode(9829);break;case"diams":v_retval+=String.fromCharCode(9830);break;default:v_retval+="&"+v_entity+";";break}}i=v_sc_index}else{v_retval+=v_char}}else{v_retval+=v_char}}return v_retval}})(jQuery);
/*
* JSON Serializer Utility
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){a.extend({toJSON:function(h,j){j=a.extend({replacer:null,space:null,numberFormat:"",dateFormat:"",useUTCDate:true},j);var l=a.isFunction(j.replacer)?j.replacer:null,k=a.isArray(j.replacer)?j.replacer:null;if(window.JSON&&window.JSON.stringify&&j.numberFormat.length<=0&&j.dateFormat.length<=0&&j.useUTCDate){return window.JSON.stringify(h,l||k,j.space)}if(h===undefined){return undefined}if(l!==null&&!a.isArray(h)){h=l("",h)}function f(r,u,q){if(a.isFunction(r)){return}if(r===undefined){return"undefined"}if(r===null){return"null"}var v=typeof r;if(v==="boolean"){return r.toString()}var t=d(r,v);if(t!==false){return t}var o,w=u.length>0,z=u;if(w&&q>0){for(o=0;o<q-1;o++){z+=u}}else{z=""}if(a.isArray(r)){var n=[];for(o=0;o<r.length;o++){n.push((w?"\n"+z+u:"")+f(r[o],u,q+1)||"null")}return"["+n.join(",")+(w?"\n"+z:"")+"]"}if(a.isFunction(r.toJSON)){return f(r.toJSON(),u,q+1)}var y=[];for(var p in r){if(a.isFunction(r[p])){continue}if(k!==null&&k.indexOf(p)<0){continue}var A=r[p];if(l!==null){A=l(p,r[p]);if(A===undefined){continue}}var x=d(p,typeof p);if(x===false){continue}y.push((w?"\n"+z+u:"")+x+(w?" : ":":")+f(A,u,q+1))}return"{"+y.join(",")+(w?"\n"+z:"")+"}"}function d(t,v){if(t===null||t===undefined){return false}if(v==="number"){if(j.numberFormat.length>0){try{return t.format(j.numberFormat)}catch(n){}}return t.toString()}if(v==="string"){return a.quoteString(t)}if(a.isDate(t)){if(j.dateFormat.length>0){try{return a.quoteString(t.toString(j.dateFormat,j.useUTCDate))}catch(o){}if(a.isFunction(a.dateFormat)){return a.quoteString(a.dateFormat(j.dateFormat,t))}}var w=j.useUTCDate,s=(w?t.getUTCMonth():t.getMonth())+1,i=w?t.getUTCDate():t.getDate(),z=w?t.getUTCFullYear():t.getFullYear(),p=w?t.getUTCHours():t.getHours(),r=w?t.getUTCMinutes():t.getMinutes(),u=w?t.getUTCSeconds():t.getSeconds(),q=w?t.getUTCMilliseconds():t.getMilliseconds();if(q<100){q="0"+q}var y="Z";if(!w){y=t.getTimezoneOffset()<0?" +":" -";var x=Math.abs(t.getTimezoneOffset());y+=e(x/60)+e(x-(x/60*60))}return'"'+z+"-"+e(s)+"-"+e(i)+"T"+e(p)+":"+e(r)+":"+e(u)+"."+e(q)+y+'"'}return false}function e(i){return i<10?"0"+i:i}var m="";if(typeof j.space==="string"){m=j.space.length>10?j.space.substr(0,10):j.space}else{if(typeof j.space==="number"){if(j.space<=0){j.space=1}else{if(j.space>10){optons.space=10}}for(var g=0;g<j.space;g++){m+=" "}}}return f(h,m,0)},dump:function(d){return a.toJSON(d,{space:4,useUTCDate:false})},quoteString:function(d){if(d.match(b)){return'"'+d.replace(b,function(e){var f=c[e];if(typeof f==="string"){return f}f=e.charCodeAt();return"\\u00"+Math.floor(f/16).toString(16)+(f%16).toString(16)})+'"'}return'"'+d+'"'}});var b=/["\\\x00-\x1f\x7f-\x9f]/g;var c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}})(jQuery);
/*
* queryString Object
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
function queryString(b){var c=this;c.__isQS=true;c.__list={};c.count=0;var a=c.__list;c.equals=function(d){if(d===undefined||d===null){return false}if(typeof d==="string"&&d.length>0){d=new queryString(d)}return typeof d.__isQS==="boolean"&&c.count===d.count&&c.toString()===d.toString()};c.toString=function(){if(c.count<=0){return""}return jQuery.param(a)};c.toHash=function(){return a};c.item=function(d,e){if(d===undefined||d===null){throw"A name must be specified."}if(typeof d!=="string"){throw"The name must be a string."}d=d.toLowerCase();if(e===undefined){if(a[d]===undefined){throw'Variable does not exist: "'+d+'".'}return a[d]}c.add(d,e,true)};c.contains=function(d){if(d===undefined||d===null){throw"A name must be specified."}if(typeof d!=="string"){throw"The name must be a string."}return a[d.toLowerCase()]!==undefined};c.containsValue=function(e){if(e===undefined){throw"A value must be specified."}if(e!==null&&typeof e!=="string"&&!jQuery.isArray(e)){throw"The value must be a string or array."}for(var d in a){if(e===a[d]){return true}}return false};c.add=function(g,j,h){if(g===undefined||g===null){throw"A name must be specified."}if(typeof g!=="string"){throw"The name must be a string."}g=g.toLowerCase();if(jQuery.isFunction(j)){try{j=j()}catch(d){j=""}}if(typeof j!=="string"&&!jQuery.isArray(j)){j=j===undefined||j===null?"":String(j)}if(a[g]===undefined){a[g]=j;c.count++}else{if(h){a[g]=j}else{if(a[g]===null){a[g]=j;return}if(!jQuery.isArray(a[g])){a[g]=[a[g]]}if(jQuery.isArray(j)){for(var f in j){if(!jQuery.isFunction(j[f])){a[g].push(j[f]===null?"":j[f])}}}else{a[g].push(j===null?"":j)}}}};c.remove=function(d){if(d===undefined||d===null){throw"A name must be specified."}if(typeof d!=="string"){throw"The name must be a string."}d=d.toLowerCase();if(a[d]!==undefined){delete a[d];c.count--;if(c.count<0){c.count=0}return true}return false};c.clear=function(){c.__list=a={};c.count=0};c.load=function(g,h){if(g===undefined||g===null){g=String(window.location.search)}var d;if(typeof g!=="string"){if(jQuery.isArray(g)){if(!g.length){return}for(d=0;d<g.length;d++){if(!jQuery.isFunction(g[d])){c.add(g[d].name,g[d].value,h)}}return}for(var f in g){c.add(f,g[f],h)}return}else{if(g.length<=0){return}}var e=g.indexOf("?");if(e>=0){g=g.substring(e+1)}e=g.indexOf("#");if(e>=0){g=g.substring(0,e)}if(g.length<=0){return}e=-1;var j=g.split("&");for(d=0;d<j.length;d++){e=j[d].indexOf("=");if(e>=0){c.add(decodeURIComponent(j[d].substring(0,e)),decodeURIComponent(j[d].substring(e+1)),h)}}};c.mergeWith=function(f,d){if(f===undefined||f===null){return}if(typeof f==="string"){f=new queryString(f)}else{if(!f.__isQS){f=new queryString(f)}}for(var e in f.__list){var g=f.__list[e];if(g===undefined||(a[e]!==undefined&&d!==1&&d!==2)){continue}c.add(e,g,d===1)}};if(b!==undefined&&b!==null){c.load(b,false)}}queryString.load=function(a){if(a===undefined||a===null){a=String(window.location.search)}return new queryString(a)};
/*
* uri Object
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
function uri(d,c){var e=this;e.__isURI=true;e.protocol="";e.host="";e.port="";e.path="";e.file="";e.hash="";e.query=new queryString();if(typeof d==="string"&&d.length>0){a(d,c)}function a(g,f){if(typeof g!=="string"){g=String(g)}if(typeof f!=="boolean"){f=true}if(g.indexOf("\\")>=0){g=g.replace(/\\/g,"/")}var h=g.indexOf("#"),k=g.indexOf("?"),j="";if(h>=0){if(k>h){e.hash=g.substring(h+1,k);j=g.substring(k+1);g=g.substring(0,h)}else{e.hash=g.substring(h+1);g=g.substring(0,h);if(k>=0){j=g.substring(k+1,h);g=g.substring(0,k)}}}else{if(k>=0){j=g.substring(k+1);g=g.substring(0,k)}}if(f&&j.length>0){e.query.load(j)}if(!arguments.callee.REGEX){arguments.callee.REGEX=/^(([A-Z]+):\/\/)?([A-Z0-9\-\.]+)?(:([0-9]+))?(\/?[A-Z0-9\-\/_\.]+)?.*$/i}if(g.match(arguments.callee.REGEX)){e.protocol=RegExp.$2;e.host=RegExp.$3;e.port=RegExp.$5;e.path=RegExp.$6;if(e.path.length>0&&e.path.indexOf(".")>=0){var i=e.path.lastIndexOf("/");if(i<=0){e.file=i===0?e.path.substr(1):e.path;e.path="/"}else{e.file=e.path.substring(i+1);e.path=e.path.substring(0,i+1)}}b()}}function b(){var f=typeof e.file==="string"&&e.file.length>0;if(typeof e.path!=="string"||e.path.length<=0){e.path=f?"/":""}else{if(e.path.substr(0,1)!=="/"){e.path="/"+e.path}else{if(e.path.substr(e.path.length-1,1)!=="/"){e.path+="/"}}}if(f&&e.file.indexOf("/")>=0){e.file=e.file.replace(/\//g,"")}}e.toString=function(){var f="";if(typeof e.protocol==="string"&&e.protocol.length>0){f+=e.protocol+"://"}f+=e.host;if(typeof e.port==="string"&&e.port.length>0){f+=":"+e.port}b();f+=e.path+e.file;if(e.query.count>0){f+="?"+e.query.toString()}if(typeof e.hash==="string"&&e.hash.length>0){f+="#"+e.hash}return f};e.equals=function(f){if(f===undefined||f===null){return false}if(typeof f==="string"&&f.length>0){f=new uri(f)}return typeof f.__isURI==="boolean"&&e.protocol===f.protocol&&e.host===f.host&&e.port===f.port&&e.path===f.path&&e.file===f.file&&e.hash===f.hash&&e.query.equals(f.query)};e.load=function(g,f){if(typeof g!=="string"||g.length<=0){a(window.location.href,f)}else{a(g,f)}}}uri.load=function(b,a){if(typeof b==="boolean"){a=b}if(typeof b!=="string"||b.length<=0){b=window.location.href}return new uri(b,a)};
/*
* jQuery autoResize (textarea auto-resizer)
* Copyright James Padolsey http://james.padolsey.com
* Version 1.04
*/
(function(a){a.fn.autoResize=function(b){var c=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:0,limit:1000},b);this.filter("textarea").each(function(){var g=a(this).css({resize:"none","overflow-y":"hidden"}),f=g.height(),d=(function(){var j=["height","width","lineHeight","textDecoration","letterSpacing"],i={};a.each(j,function(k,l){i[l]=g.css(l)});return g.clone().removeAttr("id").removeAttr("name").css({position:"absolute",top:0,left:-9999}).css(i).attr("tabIndex","-1").insertBefore(g)})(),e=null,h=function(){d.height(0).val(a(this).val()).scrollTop(10000);var i=Math.max(d.scrollTop(),f)+c.extraSpace,j=a(this).add(d);if(e===i){return}e=i;if(i>=c.limit){a(this).css("overflow-y","");return}c.onResize.call(this);if(c.animate&&g.css("display")==="block"){j.stop().animate({height:i},c.animateDuration,c.animateCallback)}else{j.height(i)}};g.unbind(".dynSiz").bind("keyup.dynSiz",h).bind("keydown.dynSiz",h).bind("change.dynSiz",h)});return this}})(jQuery);
/*
* AJAX Processing UI Utility
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
function ajaxProcessor(a){this._init(a)}(function($){ajaxProcessor.prototype={options:{},window:null,_lastWinIsStatusWin:false,_waitStartFlag:false,_init:function(options){if(!$.ui.dialog){throw"AjaxProcessorException: Missing dependency: jQuery-ui-dialog plugin"}this.options=$.extend({processPage:null,redirect:null,statusWindowSize:{width:300,height:"auto"},errorWindowSize:{width:500,height:"auto"},loadingImage:"/images/loading.gif",success:null,error:null},options);if(uri){if(!(this.options.redirect instanceof uri)){this.options.redirect=new uri(this.options.redirect)}}},doRedirect:function(url){if(!uri){if(typeof url!=="string"){if(typeof this.options.redirect!=="string"){throw"AjaxProcessorException: Invalid redirect URL specified."}url=this.options.redirect}window.location.replace(url);return this}if(typeof url==="string"){url=new uri(url)}else{if(!(url instanceof uri)){url=this.options.redirect}}if(!url.path&&!url.file){throw"AjaxProcessorException: Invalid redirect URL specified."}var v_current_url=uri.load();if(v_current_url.path==url.path&&v_current_url.file==url.file){url.hash=""}window.location.replace(url.toString());return this},getLoadImage:function(styleString){return'<img src="'+this.options.loadingImage+'" alt="Loading..." title="Loading..."'+(styleString?' style="'+styleString+'"':"")+" />"},getLoadingHtml:function(text,topPadding){topPadding=typeof topPadding==="number"?topPadding:0;return'<br /><div style="text-align: center;'+(topPadding>0?" padding-top: "+topPadding+"px;":"")+'">'+(typeof text==="string"?text:"")+"<br />"+this.getLoadImage("padding-top: 5px;")+"</div>"},closeWindow:function(){if(this.window!==null){this.window.dialog("close").dialog("destroy").remove();this.window=null}return this},showWindow:function(options){var _self=this;var v_opts=$.extend({content:"",wait:false,reuse:false,isStatusWindow:false,position:"top"},options);this._lastWinIsStatusWin=v_opts.isStatusWindow;if(!v_opts.reuse&&this.window!==null){this.window.dialog("destroy").remove()}if(this.window===null||!v_opts.reuse){this.window=$("<div/>")}return this.window.html(v_opts.content).css("cursor",v_opts.wait?"wait":"default").bind("dialogclose",function(){_self.window.dialog("destroy").remove()}).bind("dialogopen",function(){_self.window.css("overflow-y","auto");_self.calcWindowMaxHeight()}).dialog(v_opts)},calcWindowMaxHeight:function(){var d=this.window.dialog("widget");var title=d.find(".ui-dialog-titlebar");var status=d.find(".ui-dialog-buttonpane");this.window.css("max-height",$(window).height()-(this.window.outerHeight(true)-this.window.height())-(title&&title.length?title.outerHeight(true):0)-(status&&status.length?status.outerHeight(true):0))},showStatusWindow:function(text,showLoadImage){if(!text){text="Please wait..."}if(typeof showLoadImage!=="boolean"){showLoadImage=true}return this.showWindow({width:this.options.statusWindowSize.width,height:this.options.statusWindowSize.height,title:"Status",content:showLoadImage?this.getLoadingHtml(text,20):text,closeOnEscape:false,draggable:false,maximize:false,modal:true,resizable:false,isStatusWindow:true})},showErrorWindow:function(text,showCloseButton){if(!this._lastWinIsStatusWin&&this.window!==null&&this.window.dialog("isOpen")===true){return this.window.html(text)}var _self=this;return this.showWindow({width:this._lastWinIsStatusWin||this.window===null?this.options.errorWindowSize.width:this.window.dialog("option","width"),height:this._lastWinIsStatusWin||this.window===null?this.options.errorWindowSize.height:this.window.dialog("option","height"),buttons:showCloseButton?{Close:function(){_self.closeWindow()}}:{},title:"Error Message",content:text,modal:true,maximize:true})},disableForm:function(root){var v_root=$(root||document);if(v_root.attr("enctype")=="multipart/form-data"||v_root.find(":file").length>0){return this}v_root.find(":input:enabled").attr("disabled",true).attr("autoajaxdisabled","1").each(function(){try{var $self=$(this);if($self.data("numeric")){$self.numeric("disable")}else{if($self.data("button")){$self.button("disable")}else{if($self.data("datepicker")){$self.datepicker("disable")}}}}catch(e){}});return this},enableForm:function(root){$(root||document).find('*[autoajaxdisabled="1"]:input:disabled').attr("disabled",false).removeAttr("autoajaxdisabled").each(function(){try{var $self=$(this);if($self.data("numeric")){$self.numeric("enable")}else{if($self.data("button")){$self.button("enable")}else{if($self.data("datepicker")){$self.datepicker("enable")}}}}catch(e){}});return this},dialogWaitStart:function(text){if(this.window!==null&&this.window.dialog("isOpen")===true){if(this._waitStartFlag){return this}if(typeof text!=="string"){text="Please wait..."}if($.isEmptyObject(this.window.dialog("option","buttons"))){this.window.append('<div class="ui-dialog-status">'+this.getLoadingHtml(text,0)+"</div>").parent().css("cursor","wait")}else{this.window.parent().css("cursor","wait").find(".ui-dialog-buttonpane").prepend('<div class="ui-dialog-status">'+this.getLoadingHtml(text,0)+"</div>").end().find(".ui-dialog-buttonpane button").button("disable")}this.calcWindowMaxHeight();this._waitStartFlag=true}else{this.showStatusWindow(text,true)}return this},dialogWaitEnd:function(){if(this.window!==null&&this.window.dialog("isOpen")===true){if(this._waitStartFlag){if($.isEmptyObject(this.window.dialog("option","buttons"))){this.window.find(".ui-dialog-status").remove().end().parent().css("cursor","default")}else{this.window.parent().css("cursor","default").find(".ui-dialog-buttonpane .ui-dialog-status").remove().end().find(".ui-dialog-buttonpane button").button("enable")}this.calcWindowMaxHeight()}else{this.window.dialog("option",{closeOnEscape:true,draggable:true,resizable:true})}}this._waitStartFlag=false;return this},getForm:function(){if(this.window===null||this.window.dialog("isOpen")!==true){return null}return this.window.find("form:first")[0]},getWidth:function(max){if(max==="auto"){return max}var width=$(window).width();return width>max+10?max:width-10},execute:function(ajaxOptions){if(!ajaxOptions){ajaxOptions={redirect:true,wait:false,disableForm:false}}ajaxOptions.data=this.__checkAjaxData(ajaxOptions.data);if(this.window===null||this.window.dialog("isOpen")!==true){ajaxOptions.disableForm=false}if(ajaxOptions.disableForm){ajaxOptions._root=this.window}var $self=this;$.ajax($.extend({beforeSend:function(xhr){$self.__beforeSend(xhr,ajaxOptions)},error:function(x,s,e){$self.__error(x,s,e)},success:function(d,t,x){$self.__success(d,t,x)},type:"POST",url:this.options.processPage.toString()},ajaxOptions));if(ajaxOptions.disableForm){this.disableForm(this.window)}return this},submitForm:function(form,ajaxOptions){if(!$.fn.ajaxSubmit){throw"AjaxProcessorException: Missing or invalid dependency: jQuery-form plugin."}if(!form){throw"AjaxProcessorException: No form element specified."}if(!ajaxOptions){ajaxOptions={redirect:true,wait:false,disableForm:false}}ajaxOptions.data=this.__checkAjaxData(ajaxOptions.data);$form=$(form);if(ajaxOptions.disableForm){ajaxOptions._root=$form}if(!(typeof ajaxOptions.url==="string"&&ajaxOptions.url.length)&&!(uri&&ajaxOptions.url instanceof uri)){var action=$form.attr("action");if(typeof action==="string"&&action.length&&action.indexOf("javascript:")<0){ajaxOptions.url=action}else{ajaxOptions.url=this.options.processPage.toString()}}if(typeof ajaxOptions.type!=="string"||!ajaxOptions.type.length){if($form.attr("method").length){ajaxOptions.type=$form.attr("method")}else{ajaxOptions.type="POST"}}var $self=this;$form.ajaxSubmit($.extend({beforeSend:function(xhr){$self.__beforeSend(xhr,ajaxOptions)},error:function(x,s,e){$self.__error(x,s,e)},success:function(d,t,x){$self.__success(d,t,x)}},ajaxOptions));if(ajaxOptions.disableForm){this.disableForm($form)}return this},executeMode:function(statusText,params,redirect,dataType){var v_redirect_is_func=$.isFunction(redirect);this.execute({autoAppendClose:true,data:params,dataType:dataType||"json",wait:true,waitText:statusText,redirect:redirect===undefined||v_redirect_is_func?true:redirect,victory:v_redirect_is_func?redirect:null});return this},executeModeConfirm:function(confirmText,statusText,params,redirect,dataType){if(!confirm(confirmText)){return this}return this.executeMode(statusText,params,redirect,dataType)},itemForm:function(width,height,title,params,saveAction,saveText,callback){this.showWindow({width:this.getWidth(width),height:height||"auto",modal:true,wait:true,title:title,content:this.getLoadingHtml("Please wait while the form is loaded...",20)});var $self=this;this.execute({autoProcess:false,data:params,dataType:"html",success:function(d){$self.window.html(d).css("cursor","default");if(callback){callback.call($self,d,$self.window)}var b={};if(saveAction){b[saveText||"Save"]=saveAction}b.Cancel=function(){$self.closeWindow()};$self.window.dialog("option","buttons",b);$self.calcWindowMaxHeight()}});return this},simpleItemForm:function(options){var o=$.extend({width:500,title:"Add/Edit Item",formMode:"item_form",saveMode:"item_save",params:null,callback:null,beforeSave:null,saveText:null,waitText:null,success:null,error:null},options);var $self=this;this.itemForm(o.width,"auto",o.title,$.extend({mode:o.formMode},o.params),function(){if($.isFunction(o.beforeSave)&&o.beforeSave.call($self)===false){return}$self.itemSave(null,$.extend({mode:o.saveMode},o.params),o.success,o.waitText,o.error)},o.saveText,o.callback);return this},itemSave:function(form,mode,victory,waitText,defeat){this.submitForm(form||this.getForm(),{wait:true,waitText:waitText||"Please wait while the data is saved...",disableForm:true,data:typeof mode==="string"?{mode:mode}:mode,dataType:"html",redirect:true,victory:victory,defeat:function(d,w,i){if($.isFunction(defeat)&&defeat.call(this,d,w,i)===false){return false}w.scrollTop(0);var $div=w.find("div#item_errors");if(!$div.length){w.prepend($div=$('<div id="item_errors"/>'))}$div.html(d);return false}});return this},__checkAjaxData:function(data){if(data&&queryString&&data instanceof queryString){return data.toHash()}else{if(data&&uri&&data instanceof uri){return data.query.toHash()}else{if(data&&typeof data==="string"&&queryString){return new queryString(data).toHash()}}}return data},__beforeSend:function(xhr,ajaxOptions){if(ajaxOptions.wait){this.dialogWaitStart(ajaxOptions.waitText)}if(!xhr){return}if(!(typeof ajaxOptions.redirect==="boolean"||typeof ajaxOptions.redirect==="string"||(uri&&ajaxOptions.redirect instanceof uri))){ajaxOptions.redirect=true}xhr.options={autoProcess:ajaxOptions.autoProcess===false?false:true,autoCloseWindow:ajaxOptions.autoCloseWindow===false?false:true,autoAppendClose:ajaxOptions.autoAppendClose===false?false:true,redirect:ajaxOptions.redirect,id:ajaxOptions.id,wait:ajaxOptions.wait,waitAutoEnd:ajaxOptions.waitAutoEnd===false?false:true,disableForm:ajaxOptions.disableForm,autoEnableForm:ajaxOptions.autoEnableForm===false?false:true,_root:ajaxOptions._root,victory:ajaxOptions.victory,defeat:ajaxOptions.defeat}},__error:function(xhr,s,e){if(!xhr){xhr={data:null}}if(!xhr.data){try{xhr.data=$.parseJSON(xhr.responseText)}catch(e){xhr.data=xhr.responseText}}if(!xhr.options){xhr.options={autoProcess:true,autoAppendClose:true,waitAutoEnd:true,autoEnableForm:true,id:null}}if($.isFunction(xhr.options.defeat)&&xhr.options.defeat.call(this,xhr.data,this.window,xhr.options.id)===false){this.__finishOperations(xhr.options);return}if($.isFunction(this.options.error)&&this.options.error.call(this,xhr.data,xhr.options.id)===false){this.__finishOperations(xhr.options);return}var v_text="A processing error occured";if(String(s)==="error"){v_text=xhr.data}else{if(s){v_text=String(s)+": "+xhr.data}else{if(xhr.options.autoProcess){if(xhr.data!==undefined&&xhr.data!==null){if(typeof xhr.data==="string"){v_text=xhr.data}else{if(typeof xhr.data.ReturnMessage==="string"){v_text=xhr.data.ReturnMessage}else{if(typeof xhr.data==="xml"){v_text=$(xhr.data).find("ReturnMessage").text()}}}}}else{v_text=xhr.data}}}this.__finishOperations(xhr.options);this.showErrorWindow(v_text,xhr.options.autoAppendClose)},__success:function(data,textStatus,xhr){if(!xhr){xhr={}}if(!xhr.options){xhr.options={autoProcess:true,waitAutoEnd:true,autoEnableForm:true,id:null,redirect:true}}if(xhr.options.autoProcess){var v_return_id=0;if(data===undefined||data===null){v_return_id=0}else{if(data.ReturnId){v_return_id=typeof data.ReturnId!=="number"?parseInt(data.ReturnId):data.ReturnId}else{if(typeof data==="xml"){v_return_id=parseInt($(data).find("ReturnId").text(),10)}else{if(typeof data==="string"){v_return_id=parseInt(data,10);if(isNaN(v_return_id)){v_return_id=parseInt($(data).text(),10)}}}}}if(isNaN(v_return_id)||v_return_id<=0){xhr.data=data;this.__error(xhr);return}}if(data.JavaScript&&typeof data.JavaScript==="string"){eval(data.JavaScript)}if($.isFunction(xhr.options.victory)&&xhr.options.victory.call(this,data,this.window,xhr.options.id)===false){this.__finishOperations(xhr.options);return}if($.isFunction(this.options.success)&&this.options.success.call(this,xhr.data,xhr.options.id)===false){this.__finishOperations(xhr.options);return}if(xhr.options.redirect===true){this.doRedirect();return}else{if(typeof xhr.options.redirect==="string"||(uri&&xhr.options.redirect instanceof uri)){this.doRedirect(xhr.options.redirect);return}}if(xhr.options.autoCloseWindow&&this.window!==null&&this.window.dialog("isOpen")===true){this.window.dialog("close")}else{this.__finishOperations(xhr.options)}},__finishOperations:function(opts){if(this.window&&this.window.css("cursor")==="wait"){this.window.css("cursor","default")}if(opts.disableForm&&opts.autoEnableForm&&opts._root){this.enableForm(opts._root)}if(opts.wait&&opts.waitAutoEnd){this.dialogWaitEnd()}}}})(jQuery);
/*
* jQuery UI Data Export v1.2
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){if(!uri){throw"Missing dependency: jQuery Onsharp URI."}a.widget("ui.dataexport",{version:"1.2",options:{disabled:false,processorPage:uri.load(false),customVars:null,title:null,showHelpText:true,helpText:null,helpFile:"/xml/data_import_export_help.xml",exportTypes:null,defaultFileName:"my_csv_file",defaultFileType:"csv",defaultFileDelimiter:","},_dialog:null,_frameClear:null,_defaultTypes:["csv","tab","custom","xls"],_create:function(){if(!a.fn.button){throw"Missing dependency: jQuery UI Button."}if(!a.fn.dialog){throw"Missing dependency: jQuery UI Dialog."}if(!a.fn.ajaxSubmit){throw"Missing dependency: jQuery Form plugin."}var b=this;if(!b.options.processorPage){throw"Invalid processor page specified."}b.widget().button(b.options).click(function(){b.open()})},destroy:function(){var b=this;b._removeFrame(b);b.close().widget().unbind("click",function(){b.open()}).button("destroy");a.Widget.prototype.destroy.apply(b);return b},_setOption:function(c,f){var e=this,b=e._dialog;switch(c){case"processorPage":case"exportTypes":case"helpFile":throw'The "'+c+'" option can only be set at initilization.';case"disabled":e.options.disabled=f;e.widget().button("option","disabled",f);if(f&&e.isOpen()){e.close()}break;case"customVars":e.options.customVars=f;break;case"title":e.options.title=f||a.ui.dataexport.globalization.defaultTitle;if(e.isOpen()){b.dialog("option","title",e.options.title)}break;case"helpText":e.options.helpText=f||a.ui.dataexport.globalization.defaultHelpText;if(e.isOpen()){b.find("#data_export_help_text").html(e.options.helpText)}break;case"defaultFileName":e.options.defaultFileName=f;if(e.isOpen()){b.find("#data_export_file_name").val(f)}break;case"defaultFileType":e.options.defaultFileType=f;break;case"defaultFileDelimiter":e.options.defaultFileDelimiter=f;if(e.isOpen()){e._setupDelimiterInput(e._getFileType("#data_export_type"))}break;default:e.widget().button("option",c,f);break}return e},isOpen:function(){return this._dialog!==null&&this._dialog.dialog("isOpen")===true},close:function(){if(this._dialog!==null){this._dialog.dialog("close").empty().dialog("destroy")}return this},open:function(){var d=this,c=d.options;var f='<form method="post" id="form_data_export" action="javascript:void(0);">';if(c.showHelpText){f+='<div id="data_export_help_text">'+(c.helpText||a.ui.dataexport.globalization.defaultHelpText)+"</div>"}f+="<label>"+a.ui.dataexport.globalization.labelFileType+'<br /><select id="data_export_type" name="export_type">';var g=c.exportTypes&&a.isArray(c.exportTypes)?c.exportTypes:d._defaultTypes;for(var b=0;b<g.length;b++){f+='<option value="'+g[b]+'">'+a.ui.dataexport.typeMap[g[b]].name+"</option>"}f+="</select></label><br /><br /><label>"+a.ui.dataexport.globalization.labelDelimiter+'<br /><input type="text" id="data_export_delimiter" name="export_delimiter" value="" /></label><br /><br /><label>'+a.ui.dataexport.globalization.labelFileName+'<br /><input type="text" id="data_export_file_name" name="export_file_name" value="'+c.defaultFileName.replace("{date}",Date.now().toString("yyyy_MM_dd"))+'" /> <span id="data_export_ext"></span></label></form>';var e={};e[a.ui.dataexport.globalization.buttonSave]=function(){var l=d._getFileType("#data_export_type"),j=a("#data_export_delimiter").val(),k=a("#data_export_file_name").val();if(l==="custom"&&j.length<=0){alert(a.ui.dataexport.globalization.errorNoDelimiter);return}if(k.length<=0){alert(a.ui.dataexport.globalization.errorNoFileName);return}var h=c.processorPage instanceof uri?c.processorPage:new uri(c.processorPage);h.query.load(a("#form_data_export").formToArray(),true);if(c.customVars){h.query.load(c.customVars,true)}d._removeFrame(d);a('<iframe id="data_export_frame" name="data_export_frame" src="'+h.toString()+'" />').bind("load",function(){d.close();setTimeout(function(){d._removeFrame(d)},10000)}).appendTo("body");var i={};i[a.ui.dataexport.globalization.buttonClose]=function(){d.close()};i[a.ui.dataexport.globalization.buttonCancel]=function(){d.close();d._removeFrame(d)};a(this).text(a.ui.dataexport.globalization.textGeneratingFile).dialog("option","buttons",i)};e[a.ui.dataexport.globalization.buttonCancel]=function(){d.close()};d._dialog=a('<div id="data_export_dialog"/>').html(f).dialog({autoOpen:false,buttons:e,modal:true,title:c.title||a.ui.dataexport.globalization.defaultTitle,width:400});d._setupDelimiterInput(c.defaultFileType);a("#data_export_type").find("option[value="+c.defaultFileType+"]").attr("selected",true).end().bind("change",function(){d._setupDelimiterInput(d._getFileType(this))});d._dialog.dialog("open");if(a.ui.help&&typeof c.helpFile==="string"&&c.helpFile.length>0){a(".ui-dialog-buttonset").append(a('<button type="button"/>').text(a.ui.dataexport.globalization.buttonHelp).help({xmlFile:c.helpFile}))}return d},_removeFrame:function(b){clearTimeout(b._frameClear);b._frameClear=null;a("#data_export_frame").remove()},_getFileType:function(c){try{var d=a(c).find("option:selected").val();return !d||!a.ui.dataexport.typeMap[d]?this.options.defaultFileType:d}catch(b){return this.options.defaultFileType}},_setupDelimiterInput:function(b){var c=a.ui.dataexport.typeMap[b];if(c.canModifyDelimiter===true){a("#data_export_delimiter").attr({disabled:false,maxlength:1,value:c.delimiter}).focus()}else{if(c.delimiter===undefined||c.delimiter===null){a("#data_export_delimiter").attr({disabled:true,maxlength:3,value:a.ui.dataexport.globalization.textNotAvailable})}else{a("#data_export_delimiter").attr({disabled:true,maxlength:1,value:c.delimiter})}}a("#data_export_ext").html(c.ext)}});a.ui.dataexport.globalization={defaultTitle:"Data Export",defaultHelpText:'Select the options below and click the "Save" button to export the current list to the specified format.',labelFileType:"File Type:",labelDelimiter:"Delimiter:",labelFileName:"File Name:",buttonSave:"Save",buttonCancel:"Cancel",buttonClose:"Close",buttonHelp:"Help",errorNoDelimiter:"Please specify a custom data delimiter.",errorNoFileName:"Please specify a filename to save to.",textGeneratingFile:"Please wait while the data file is generated. A file save dialog will appear when the data file has been generated.",textNotAvailable:"N/A"};a.ui.dataexport.typeMap={csv:{name:"Comma Delimited (CSV)",delimiter:",",ext:".csv"},tab:{name:"Tab Delimited",delimiter:"\t",ext:".txt"},html:{name:"HTML (table)",delimiter:null,ext:".html"},xml:{name:"XML",delimiter:null,ext:".xml"},custom:{name:"Custom Delimiter",delimiter:",",ext:".txt",canModifyDelimiter:true},xls:{name:"MS Excel (97-2003 XLS)",delimiter:null,ext:".xls"},ods:{name:"Open Office",delimiter:null,ext:".ods"},fixed:{name:"Fixed Width",delimiter:null,ext:".txt"},xlsx:{name:"MS Excel (2007 XLSX)",delimiter:null,ext:".xlsx"}}})(jQuery);
/*
* Onsharp UI DB Object Gallery v1.0
*
* Copyright 2011, Onsharp
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){a.widget("onsharpUI.dbobjgallery",{version:"1.0",options:{disabled:false,autoload:true,id:null,handler:null,overlay:true,customQuery:null,sort:true,pagination:null,autoPaginate:true},_overlay:null,_gallery:null,_filters:null,_pageCount:1,_page:1,_sortBy:null,_sortDirection:null,_create:function(){if(this.options.autoload){this._autoloadOptions()}if(!this.options.id){throw"DBObjGalleryException: id option must be specified upon initilization if the container element has no ID attribute or autoload is false."}this.element.addClass("ui-widget");this._createFilters();this._buildGallery();if(this.element.attr("disabled")||this.element.data("disabled")){this._setOption("disabled",true)}},_autoloadOptions:function(){this.options.id=this.element.attr("id");var b=this.element.data();if(b){if(typeof b["options-handler"]==="string"){this.options.handler=b["options-handler"]||null}if(b["options-overlay"]!==undefined){this.options.overlay=Boolean(b["options-overlay"])}if(b["options-custom-query"]){this.options.customQuery=new queryString(b["options-custom-query"])}if(b["options-sort"]!==undefined){this.options.sort=Boolean(b["options-sort"])}if(b["options-pagination"]!==undefined){this.options.pagination=b["options-pagination"]||null}if(b["options-auto-paginate"]!==undefined){this.options.autoPaginate=Boolean(b["options-auto-paginate"])}}},_createFilters:function(){var c=a("#"+this.options.id).siblings(".dbg-filters:first");if(c.length){var b=this;this._filters=c.filters({autoload:true,overlay:this.options.overlay,beforeStateSave:function(d,f){return b._trigger("filtersBeforeStateSave",null,f)},stateSave:function(d,f){b._trigger("filtersStateSave",null,f)},beforeReload:function(d,f){return b._trigger("filtersBeforeReload",null,f)},reload:function(d,f){b._trigger("filtersReload",null,f)},beforeGo:function(d,f){if(b._filters){b._filters.filters("option","overlay",false)}b._ajaxHandler("filtersBeforeGo","filtersGo",f,true);return false},go:function(d,f){b._trigger("filtersGo",null,f)},beforeRemoveAll:function(d,f){if(b._filters){b._filters.filters("option","overlay",false)}b._trigger("filtersBeforeRemoveAll",null,f)},removeAll:function(d,f){b._ajaxHandler(null,"filtersRemoveAll",f,true)},beforeLoadSaved:function(d,f){if(b._filters){b._filters.filters("option","overlay",false)}return b._trigger("filtersBeforeLoadSaved",null,f)},loadSaved:function(d,f){b._ajaxHandler(null,"filtersLoadSaved",f,true)},beforeSave:function(d,f){return b._trigger("filtersBeforeSave",null,f)},save:function(d,f){b._trigger("filtersSave",null,f)},help:function(d,f){b._trigger("filtersHelp",d,f)}})}},_buildGallery:function(){this._gallery=a("#"+this.options.id+"_gallery");if(this.options.sort){this._setupSort()}if(this.options.pagination&&this.options.autoPaginate){this._setupPagination()}},destroy:function(){this.hideOverlay();if(this._filters){this._filters.filters("destroy")}if(this.options.sort){this._removeSort()}if(this.options.pagination&&this.options.autoPaginate){this._removePagination()}this.element.removeClass("ui-widget ui-state-disabled");a.Widget.prototype.destroy.apply(this);return this},_setOption:function(b,c){switch(b){case"id":case"autoload":throw"DBObjGalleryException: "+b+" option can only be set upon initilization.";break;case"disabled":this.options.disabled=c;if(c){this.element.addClass("ui-state-disabled").prepend(a('<div class="dbobjgallery-disabled" style="position:relative"><div style="position:absolute;width:100%;height:'+this.element.height()+'px;z-index:99"></div></div>'));if(this._filters){this._filters.filters("disable")}}else{this.element.removeClass("ui-state-disabled").find(".dbobjgallery-disabled").remove();if(this._filters){this._filters.filters("enable")}}break;case"overlay":this.options.overlay=c;if(this._filters){this._filters.filters("option","overlay",c)}break;case"sort":this.options.sort=c?true:false;if(c){this._setupSort()}else{this._removeSort()}break;case"pagination":this.options.pagination=c;if(c&&this.options.autoPaginate){this._setupPagination()}else{this._removePagination()}break;case"autoPaginate":this.options.autoPaginate=c;if(c&&this.options.pagination){this._setupPagination()}else{this._removePagination()}break;default:a.Widget.prototype._setOption.apply(this,[b,c]);break}return this},_setupSort:function(){var b=this;this.element.find(".dbg-sort-link").bind("click.onsharpUI.dbobjgallery",function(){b.sort(a(this).data("sortby"),a(this).data("sortdirection"));return false})},_removeSort:function(){this.element.find(".dbg-sort-link").unbind("click.onsharpUI.dbobjgallery")},sort:function(b,c){if(this.options.disabled){return this}this._sortBy=b;this._sortDirection=c==="desc"?"desc":"asc";this._ajaxHandler("beforeSort","sort",{sortBy:this._sortBy,direction:this._sortDirection},false);return this},_setupPagination:function(){this._page=Number(this._gallery.data("current-page"))||1;this._pageCount=Number(this._gallery.data("page-count"))||1;var b=this;var c=this.element.find(".dbg-pagination > .pagination-links");c.find(".pagination-select").bind("change.onsharpUI.dbobjgallery",function(){b.loadPage(a(this).val())});c.find(".pagination-page-link").bind("click.onsharpUI.dbobjgallery",function(){b.loadPage(a(this).data("page"));return false})},_removePagination:function(){var b=this.element.find(".dbg-pagination > .pagination-links");b.find(".pagination-select").unbind("change.onsharpUI.dbobjgallery");b.find(".pagination-page-link").unbind("click.onsharpUI.dbobjgallery")},loadPage:function(b){if(!this.options.pagination||this.options.disabled){return this}var c=this._page;if(b==="first"){this._page=1}else{if(b==="last"){this._page=this._pageCount}else{if(b==="previous"){if(this._page>1){this._page--}}else{if(b==="next"){if(this._page<this._pageCount){this._page++}}else{if(this.options.pagination==="alpha"){this._setAlphaPage(b)}else{this._page=Number(b)||1;if(this._page<1){this._page=1}else{if(this._page>this._pageCount){this._page=this._pageCount}}}}}}}if(c!==this._page){this._ajaxHandler("beforePageLoad","pageLoad",{page:this._page},false)}return this},_setAlphaPage:function(e){if(e==="all"){this._page=0}else{if(e==="other"){this._page=27}else{if(typeof e==="string"&&e.length){var d=parseInt(e);if(!isNaN(d)){this._page=d}else{var b=e.charCodeAt(0);if(b>=65&&b<=90){this._page=b-64}else{if(b>=97&&b<=122){this._page=b-96}else{this._page=1}}}}else{if(typeof e==="number"){this._page=e}else{this._page=1}}}}if(this._page<0){this._page=1}else{if(this._page>27){this._page=27}}},reload:function(){if(this.options.disabled){return this}if(this._filters){this._filters.filters("option","overlay",false).filters("reload")}this._ajaxHandler(null,null,null,true);return this},showOverlay:function(){if(this.options.disabled){return this}a(document.body).addClass("wait");if(this._overlay&&this._overlay.dialog("isOpen")===true){return}this._overlay=a('<div style="text-align:center;padding-top:20px"></div>').html('<img src="'+a.onsharpUI.dbobjtable.globalization.loadingImage+'" alt="'+a.onsharpUI.dbobjtable.globalization.loadingText+'" title="'+a.onsharpUI.dbobjtable.globalization.loadingText+'" />').dialog({closeOnEscape:false,draggable:false,height:100,minHeight:100,modal:true,resizable:false});this._overlay.siblings(".ui-dialog-titlebar").remove();return this},hideOverlay:function(){if(this.options.disabled){return this}if(this._overlay&&this._overlay.dialog("isOpen")===true){this._overlay.dialog("close").dialog("destroy").remove()}a(document.body).removeClass("wait");this._overlay=null;return this},_ajaxHandler:function(d,c,f,g){var h=new queryString();if(this.options.customQuery){h.mergeWith(this.options.customQuery,1)}if(f&&f.query){h.mergeWith(f.query)}if(this._trigger("beforeLoad",null,{page:this._page,sortBy:this._sortBy,direction:this._sortDirection,query:h})===false){return}h.add(this.options.id+"_handle",true,true);h.add(this.options.id+"_page",this._page,true);h.add(this.options.id+"_sortby",this._sortBy,true);h.add(this.options.id+"_sortdir",this._sortDirection,true);if(f){f.query=h}else{f={query:h}}if(d&&this._trigger(d,null,f)===false){return}if(this.options.overlay){this.showOverlay()}var b=this,e=a("#"+this.options.id);a.ajax({url:this.options.handler||uri.load(false).toString(),type:"get",dataType:"html",data:h.toHash(),success:function(i){e.html(i);b._buildGallery()},complete:function(k,j){if(g&&b.options.overlay&&b._filters){b._filters.filters("option","overlay",true)}var i=true;if(c&&b._trigger(c,null,a.extend({status:j},f))===false){i=false}if(b._trigger("load",null,{status:j,page:b._page,sortBy:b._sortBy,direction:b._sortDirection})===false){i=false}if(i){b.hideOverlay()}}})}});a.onsharpUI.dbobjgallery.globalization={loadingImage:"/images/loading.gif",loadingText:"Please wait..."};a(function(){a(".dbg-autocreate").dbobjgallery({autoload:true})})})(jQuery);
/*
* Onsharp UI DB Object Table v1.0
*
* Copyright 2011, Onsharp
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){a.widget("onsharpUI.dbobjtable",{version:"1.0",options:{disabled:false,autoload:true,id:null,handler:null,overlay:true,customQuery:null,hoverHighlight:true,sort:true,pagination:null,actionMode:null,checkName:null,checked:[],tooltipWidth:"auto"},_overlay:null,_table:null,_filters:null,_pageCount:1,_page:1,_sortBy:null,_sortDirection:null,_create:function(){if(this.options.autoload){this._autoloadOptions()}if(!this.options.id){throw"DBObjTableException: id option must be specified upon initilization if the container element has no ID attribute."}if(!a.isArray(this.options.checked)){this.options.checked=[]}this.element.addClass("ui-widget");this._createFilters();this._buildTable();if(this.element.attr("disabled")){this._setOption("disabled",true)}},_autoloadOptions:function(){this.options.id=this.element.attr("id");var b=this.element.data();if(b){if(typeof b["options-handler"]==="string"){this.options.handler=b["options-handler"]||null}if(b["options-overlay"]!==undefined){this.options.overlay=Boolean(b["options-overlay"])}if(b["options-custom-query"]){this.options.customQuery=new queryString(b["options-custom-query"])}if(b["options-hover-highlight"]!==undefined){this.options.hoverHighlight=Boolean(b["options-hover-highlight"])}if(b["options-sort"]!==undefined){this.options.sort=Boolean(b["options-sort"])}if(b["options-pagination"]!==undefined){this.options.pagination=b["options-pagination"]||null}if(typeof b["options-action-mode"]==="string"){this.options.actionMode=b["options-action-mode"]||null}if(typeof b["options-check-name"]==="string"){this.options.checkName=b["options-check-name"]||null}if(typeof b["options-checked"]==="string"){this.options.checked=b["options-checked"].split(",")}else{if(a.isArray(b["options-checked"])){this.options.checked=b["options-checked"]}}if(b["options-tooltip-width"]!==undefined){this.options.tooltipWidth=b["options-tooltip-width"]||"auto"}}},_createFilters:function(){var c=a("#"+this.options.id).siblings(".dbt-filters:first");if(c.length){var b=this;this._filters=c.filters({autoload:true,overlay:this.options.overlay,beforeStateSave:function(d,f){return b._trigger("filtersBeforeStateSave",null,f)},stateSave:function(d,f){b._trigger("filtersStateSave",null,f)},beforeReload:function(d,f){return b._trigger("filtersBeforeReload",null,f)},reload:function(d,f){b._trigger("filtersReload",null,f)},beforeGo:function(d,f){if(b._filters){b._filters.filters("option","overlay",false)}b._ajaxHandler("filtersBeforeGo","filtersGo",f,true);return false},go:function(d,f){b._trigger("filtersGo",null,f)},beforeRemoveAll:function(d,f){if(b._filters){b._filters.filters("option","overlay",false)}b._trigger("filtersBeforeRemoveAll",null,f)},removeAll:function(d,f){b._ajaxHandler(null,"filtersRemoveAll",f,true)},beforeLoadSaved:function(d,f){if(b._filters){b._filters.filters("option","overlay",false)}return b._trigger("filtersBeforeLoadSaved",null,f)},loadSaved:function(d,f){b._ajaxHandler(null,"filtersLoadSaved",f,true)},beforeSave:function(d,f){return b._trigger("filtersBeforeSave",null,f)},save:function(d,f){b._trigger("filtersSave",null,f)},help:function(d,f){b._trigger("filtersHelp",d,f)}})}},_buildTable:function(){this._table=a("#"+this.options.id+"_table");if(this.options.hoverHighlight){this._setupHoverHighlight()}if(this.options.sort){this._setupSort()}if(this.options.pagination){this._setupPagination()}if(this.options.actionMode){this._table.find("tbody .dbt-tooltip").cluetip({local:true,showTitle:false,width:this.options.tooltipWidth})}if(this.options.checkName){if(this.options.checkName===true){this.options.checkName=this.options.id}var b=this;this._table.find('input[name="'+this.options.checkName+'_checkall"]').bind("click.onsharpUI.dbobjtable",function(){b._setAllChecked(a(this).attr("checked"),false)});this._table.find('input[name="'+this.options.checkName+'"]').bind("click.onsharpUI.dbobjtable",function(){var c=a(this);b._setItemChecked(c,c.attr("checked"))})}},destroy:function(){this.hideOverlay();if(this._filters){this._filters.filters("destroy")}if(this.options.hoverHighlight){this._removeHoverHighlight()}if(this.options.sort){this._removeSort()}if(this.options.pagination){this._removePagination()}if(this.options.checkName){this._table.find('input[name="'+this.options.checkName+'_checkall"]').unbind("click.onsharpUI.dbobjtable");this._table.find('input[name="'+this.options.checkName+'"]').unbind("click.onsharpUI.dbobjtable")}this.element.removeClass("ui-widget ui-state-disabled");a.Widget.prototype.destroy.apply(this);return this},_setOption:function(b,c){switch(b){case"id":case"checkName":case"autoload":throw"DBObjTableException: "+b+" option can only be set upon initilization.";break;case"disabled":this.options.disabled=c;if(c){this.element.addClass("ui-state-disabled").prepend(a('<div class="dbobjtable-disabled" style="position:relative"><div style="position:absolute;width:100%;height:'+this.element.height()+'px;z-index:99"></div></div>'));if(this._filters){this._filters.filters("disable")}}else{this.element.removeClass("ui-state-disabled").find(".dbobjtable-disabled").remove();if(this._filters){this._filters.filters("enable")}}break;case"overlay":this.options.overlay=c;if(this._filters){this._filters.filters("option","overlay",c)}break;case"hoverHighlight":this.options.hoverHighlight=c?true:false;if(c){this._setupHoverHighlight()}else{this._removeHoverHighlight()}break;case"sort":this.options.sort=c?true:false;if(c){this._setupSort()}else{this._removeSort()}break;case"pagination":this.options.pagination=c;if(c){this._setupPagination()}else{this._removePagination()}break;case"checked":this.options.checked=a.isArray(c)?c:[];this._setChecked(this.options.checked,true,true);break;default:a.Widget.prototype._setOption.apply(this,[b,c]);break}return this},_setupHoverHighlight:function(b){this._table.find("tbody tr").bind({"mouseover.onsharpUI.dbobjtable":function(){a(this).toggleClass("hover",true)},"mouseout.onsharpUI.dbobjtable":function(){a(this).toggleClass("hover",false)}})},_removeHoverHighlight:function(){this._table.find("tbody tr").unbind("mouseover.onsharpUI.dbobjtable mouseout.onsharpUI.dbobjtable")},_setupSort:function(){var b=this;this._table.find("thead .dbt-sortable").bind("click.onsharpUI.dbobjtable",function(){b.sort(a(this).data("sortby"),a(this).data("sortdirection"));return false})},_removeSort:function(){a("#"+this.options.id+"_table thead .dbt-sortable").unbind("click.onsharpUI.dbobjtable")},sort:function(b,c){if(this.options.disabled){return this}this._sortBy=b;this._sortDirection=c==="desc"?"desc":"asc";this._ajaxHandler("beforeSort","sort",{column:this._sortBy,direction:this._sortDirection},false);return this},_setupPagination:function(){this._page=Number(this._table.data("current-page"))||1;this._pageCount=Number(this._table.data("page-count"))||1;var b=this;var c=this.element.find(".data-table-pagination > .page-links");c.find(".dbt-page-select").bind("change.onsharpUI.dbobjtable",function(){b.loadPage(a(this).val())});c.find(".dbt-page-nav").bind("click.onsharpUI.dbobjtable",function(){b.loadPage(a(this).data("page"));return false})},_removePagination:function(){var b=this.element.find(".data-table-pagination > .page-links");b.find(".dbt-page-select").unbind("change.onsharpUI.dbobjtable");b.find(".dbt-page-nav").unbind("click.onsharpUI.dbobjtable")},loadPage:function(b){if(!this.options.pagination||this.options.disabled){return this}var c=this._page;if(b==="first"){this._page=1}else{if(b==="last"){this._page=this._pageCount}else{if(b==="previous"){if(this._page>1){this._page--}}else{if(b==="next"){if(this._page<this._pageCount){this._page++}}else{if(this.options.pagination==="alpha"){this._setAlphaPage(b)}else{this._page=Number(b)||1;if(this._page<1){this._page=1}else{if(this._page>this._pageCount){this._page=this._pageCount}}}}}}}if(c!==this._page){this._ajaxHandler("beforePageLoad","pageLoad",{page:this._page},false)}return this},_setAlphaPage:function(e){if(e==="all"){this._page=0}else{if(e==="other"){this._page=27}else{if(typeof e==="string"&&e.length){var d=parseInt(e);if(!isNaN(d)){this._page=d}else{var b=e.charCodeAt(0);if(b>=65&&b<=90){this._page=b-64}else{if(b>=97&&b<=122){this._page=b-96}else{this._page=1}}}}else{if(typeof e==="number"){this._page=e}else{this._page=1}}}}if(this._page<0){this._page=1}else{if(this._page>27){this._page=27}}},selectAll:function(){if(!this.options.disabled){this._setAllChecked(true,true)}return this},deselectAll:function(){if(!this.options.disabled){this._setAllChecked(false,true)}return this},select:function(b,c){if(!this.options.disabled){this._setChecked(b,true,c)}return this},deselect:function(b){if(!this.options.disabled){this._setChecked(b,false,false)}return this},_setChecked:function(e,c,f){if(!e||!this.options.checkName){return}var b=this._table.find('input[name="'+this.options.checkName+'"]');if(f){b.attr("checked",false);this.options.checked=[]}if(typeof e==="string"){this._setItemChecked(b.find('[value="'+e+'"]'),c)}else{if(a.isArray(e)){for(var d=0;d<e.length;d++){this._setItemChecked(b.find('[value="'+e[d]+'"]'),c)}}}},_setAllChecked:function(c,d){if(!this.options.checkName){return}if(d){this._table.find('input[name="'+this.options.checkName+'"_checkall]').attr("checked",c)}var b=this;this._table.find('input[name="'+this.options.checkName+'"]').each(function(){b._setItemChecked(a(this),c)});this._trigger(c?"selectAll":"deselectAll")},_setItemChecked:function(d,b){if(d&&d.length){var f=d.val(),c=this.options.checked.contains(f),e=d.attr("checked");if(b){if(!e){d.attr("checked",true)}if(!c){if(d.attr("type")==="radio"){this.options.checked=[f]}else{this.options.checked.push(f)}}if(!e||!c){this._trigger("deselect",null,{value:f})}}else{if(e){d.attr("checked",false)}if(c){this.options.checked.remove(f,a.compare)}a("#"+this.options.checkName+"_checkall").attr("checked",false);if(e||c){this._trigger("select",null,{value:f})}}}},reload:function(){if(this.options.disabled){return this}if(this._filters){this._filters.filters("option","overlay",false).filters("reload")}this._ajaxHandler(null,null,null,true);return this},showOverlay:function(){if(this.options.disabled){return this}a(document.body).addClass("wait");if(this._overlay&&this._overlay.dialog("isOpen")===true){return}this._overlay=a('<div style="text-align:center;padding-top:20px"></div>').html('<img src="'+a.onsharpUI.dbobjtable.globalization.loadingImage+'" alt="'+a.onsharpUI.dbobjtable.globalization.loadingText+'" title="'+a.onsharpUI.dbobjtable.globalization.loadingText+'" />').dialog({closeOnEscape:false,draggable:false,height:100,minHeight:100,modal:true,resizable:false});this._overlay.siblings(".ui-dialog-titlebar").remove();return this},hideOverlay:function(){if(this.options.disabled){return this}if(this._overlay&&this._overlay.dialog("isOpen")===true){this._overlay.dialog("close").dialog("destroy").remove()}a(document.body).removeClass("wait");this._overlay=null;return this},_ajaxHandler:function(e,c,g,h){var i=new queryString();if(this.options.customQuery){i.mergeWith(this.options.customQuery,1)}if(this.options.checkName){var d=a("#"+this.options.checkName+"_checkall");if(d){i.add(d.attr("name"),d.attr("checked"),true)}if(this.options.checked.length>0){i.add(this.options.checkName,this.options.checked.join(","),true)}}if(g&&g.query){i.mergeWith(g.query)}if(this._trigger("beforeLoad",null,{page:this._page,column:this._sortBy,direction:this._sortDirection,query:i})===false){return}i.add(this.options.id+"_handle",true,true);i.add(this.options.id+"_page",this._page,true);i.add(this.options.id+"_sortby",this._sortBy,true);i.add(this.options.id+"_sortdir",this._sortDirection,true);if(g){g.query=i}else{g={query:i}}if(e&&this._trigger(e,null,g)===false){return}if(this.options.overlay){this.showOverlay()}var b=this,f=a("#"+this.options.id);a.ajax({url:this.options.handler||uri.load(false).toString(),type:"get",dataType:"html",data:i.toHash(),success:function(j){f.html(j);b._buildTable()},complete:function(l,k){if(h&&b.options.overlay&&b._filters){b._filters.filters("option","overlay",true)}var j=true;if(c&&b._trigger(c,null,a.extend({status:k},g))===false){j=false}if(b._trigger("load",null,{status:k,page:b._page,column:b._sortBy,direction:b._sortDirection})===false){j=false}if(j){b.hideOverlay()}}})}});a.onsharpUI.dbobjtable.globalization={loadingImage:"/images/loading.gif",loadingText:"Please wait..."};a(function(){a(".dbt-autocreate").dbobjtable({autoload:true})})})(jQuery);
/*
* jQuery UI Dialog Maximize Extension v1.1
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* https://github.com/flamewave/jquery-ui-dialog-maximize/raw/master/GPL-LICENSE.txt
* https://github.com/flamewave/jquery-ui-dialog-maximize/raw/master/MIT-LICENSE.txt
*/
(function(a){if(a.ui.dialog){var c=a.ui.dialog.prototype._create;var b=a.ui.dialog.prototype.close;var d=a.ui.dialog.prototype.open;var e=a.ui.dialog.prototype._setOption;a.ui.dialog.maximizeExtension={version:"1.1",globalization:{textMaximize:"Maximize",textRestore:"Restore"}};a.extend(true,a.ui.dialog.prototype,{_isMaximized:false,_originals:null,options:{maximize:false,openMaximized:false,maximizeFx:{easing:null,duration:"normal",complete:null},restoreFx:{easing:null,duration:"normal",complete:null}},_setupMaximize:function(){var f=this;if(f.options.maximize!==true||f.uiDialog.find(".ui-dialog-titlebar-maximize").length){return}a('<a href="#" class="ui-dialog-titlebar-maximize ui-corner-all" role="button" title="'+a.ui.dialog.maximizeExtension.globalization.textMaximize+'"><span class="ui-icon ui-icon-extlink"></span></a>').insertBefore(f.uiDialog.find(".ui-dialog-titlebar .ui-dialog-titlebar-close")).click(function(g){g.preventDefault();if(f._isMaximized){f.restore()}else{f.maximize()}return false}).bind("mouseenter",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave",function(){a(this).removeClass("ui-state-hover")})},_removeMaximize:function(){this.uiDialog.find(".ui-dialog-titlebar-maximize").remove()},_create:function(){c.call(this);this._setupMaximize()},_setOption:function(f,g){if(f==="maximize"){if(g){this._setupMaximize()}else{this._removeMaximize()}}e.apply(this,arguments)},close:function(){if(!this._isOpen){return}b.call(this);if(this._isMaximized){this.options.position=this._originals.opts.position;this.options.width=this._originals.opts.width;this.options.height=this._originals.opts.height;if(this.options.maximize){this._setMaxRestoreIcon(false)}this._isMaximized=false;this._originals=null}},open:function(){if(this._isOpen){return}if(this.options.openMaximized){var f=this._calcMaxSize(true);this.options.position=["left","top"];this.options.width=f.w;this.options.height=f.h;if(this.options.maximize){this._setMaxRestoreIcon(true)}this._isMaximized=true}d.call(this)},isMaximized:function(){return this._isMaximized},maximize:function(f){if(this._isMaximized||!this._isOpen){return}this.moveToTop();var g=this._calcMaxSize(true);this._maxRestoreAnimated(f===undefined?this.options.maximizeFx:a.isFunction(f)?a.extend({},this.options.maximizeFx,{complete:f}):f,{left:a(window).scrollLeft(),top:a(window).scrollTop(),width:g.w+"px",height:g.h+"px"},{position:["left","top"],width:g.w,height:g.h},true);return this},restore:function(f){if(!this._isMaximized||this._originals===null||!this._isOpen){return}this.moveToTop();this._maxRestoreAnimated(f===undefined?this.options.restoreFx:a.isFunction(f)?a.extend({},this.options.restoreFx,{complete:f}):f,this._originals.rect,this._originals.opts,false);return this},_calcMaxSize:function(f){if(f){this._originals={opts:{position:this.options.position,width:this.options.width,height:this.options.height},rect:a.extend({width:this.uiDialog.innerWidth(),height:this.uiDialog.innerHeight()},this.uiDialog.position())}}return{w:a(window).width()-parseInt(a(document.body).css("padding-left"),10)-parseInt(a(document.body).css("padding-right"),10),h:a(window).height()-parseInt(a(document.body).css("padding-top"),10)-parseInt(a(document.body).css("padding-bottom"),10)}},_setMaxRestoreIcon:function(f){this.uiDialog.find(".ui-dialog-titlebar-maximize .ui-icon").toggleClass("ui-icon-extlink",!f).toggleClass("ui-icon-newwin",f).attr("title",f?a.ui.dialog.maximizeExtension.globalization.textRestore:a.ui.dialog.maximizeExtension.globalization.textMaximize)},_maxRestore:function(g,f){this._setOptions(g);if(this.options.maximize){this._setMaxRestoreIcon(f)}this._isMaximized=f;if(!f){this._originals=null}},_maxRestoreAnimated:function(f,k,j,i){var l=this;if(!f){l.uiDialog.css(k);l._maxRestore(j,i);l._trigger(i?"maximized":"restored");return}var m=-1,g=-1;l.uiDialog.animate(k,{duration:f.duration,easing:f.easing,step:function(n,h){if(h.prop=="width"){m=n}else{if(h.prop=="height"){g=n}}if(m!==-1&&g!==-1){l._setOptions({width:m,height:g});m=g=-1}},complete:function(){l._maxRestore(j,i);if(a.isFunction(f.complete)){f.complete.call(this)}l._trigger(i?"maximized":"restored")}})}})}})(jQuery);
/*
* Email Sending UI Utility v1.0
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){a.widget("ui.sendemail",{version:"1.0",options:{sendOnClick:false},_seInstance:null,_create:function(){this._seInstance=new b(this.options);var c=this;this.element.bind("click.sendemail",function(){if(c.options.sendOnClick){c._seInstance.send()}else{c._seInstance.show()}})},destroy:function(){this.element.unbind("click.sendemail");return this},_setOption:function(c,d){this._seInstance.options[c]=d;this.options[c]=d;return this},fromForm:function(){return this._seInstance.fromForm},suspend:function(){this._seInstance.suspend();return this},resume:function(){this._seInstance.resume();return this},close:function(){this._seInstance.close();return this},show:function(){this._seInstance.show();return this},submit:function(){this._seInstance.submit();return this},send:function(){this._seInstance.send();return this}});a.sendEmail=function(c,e){var d=new b(c);if(e!==false){d.show()}return d};function b(j){var h=false,c=null,g=false;this.options=a.extend(true,{processPage:"/ajax/send_email.ashx",possibleAttachments:[],attachments:[],attachmentUploadCount:0,isTextMessage:false,to:[],from:new email("null",""),replyTo:new email("null",""),subject:"",body:"",signature:"",priority:"normal",useHtml:true,replaceNewlines:true,title:"Send Email Form",tinyMCE:null,templateId:0,customParams:null,postRenderForm:null,beforeSubmit:null,beforeSend:null,setupQuery:null,success:null,fail:null,cancel:null},j);c=new ajaxProcessor(this.options);this.fromForm=false;if(this.options.useHtml){try{if(tinyMCE){g=true}}catch(i){g=false}}if(g){this.options.replaceNewlines=false}if(this.options.isTextMessage&&this.options.title==="Send Email Form"){this.options.title="Send Text Message Form"}this.suspend=function(){h=true};this.resume=function(){h=false;this._sendWorker()};this.close=function(){h=false;c.closeWindow()};this.show=function(){var l=c.showWindow({width:720,maximize:true,title:this.options.title,content:c.getLoadingHtml("Please wait while the form is loaded...",20),modal:true,wait:true,buttons:{}});var k=new queryString();this._parseSettings(true);this._settingsToQuery(k);k.load({mode:"send_email_form",possibleAttachments:a.isArray(this.options.possibleAttachments)?this.options.possibleAttachments.join(","):""},true);if(a.isFunction(this.options.setupQuery)){this.options.setupQuery.call(this,k)}var e=this;c.execute({data:k,error:function(m){l.html(m.responseText).css("cursor","default").dialog("option","buttons",{Close:function(){e.close()}})},success:function(m){l.html(m).css("cursor","default").dialog("option",{buttons:{Send:function(){e.submit()},Cancel:function(){e.close()}},close:function(){if(a.isFunction(e.options.cancel)){e.options.cancel.call(e)}}});if(g&&!e.options.isTextMessage){var n=e.options.tinyMCE;if(n===null||n===undefined){n={mode:"exact",elements:"send_email_body",gecko_spellcheck:true,constrain_menus:true,plugins:"advhr,advimage,advlink,advlist,contextmenu,fullscreen,inlinepopups,insertdatetime,nonbreaking,paste,preview,safari,searchreplace,spellchecker,style,table,visualchars,xhtmlxtras",spellchecker_rpc_url:"/TinyMCEHandler.aspx?module=SpellChecker",theme:"advanced",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_resizing:true,theme_advanced_resizing_use_cookie:false,theme_advanced_resize_horizontal:false,theme_advanced_buttons1:"newdocument,preview,fullscreen,|,code,cleanup,removeformat,|,selectall,cut,copy,paste,pastetext,pasteword,|,undo,redo,|,spellchecker,|,link,unlink,image,advhr,|,insertdate,inserttime,nonbreaking,|,search,replace,visualchars,visualaid,charmap",theme_advanced_buttons2:"styleprops,formatselect,fontselect,fontsizeselect,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,outdent,indent,|,blockquote,sub,sup",theme_advanced_buttons3:"forecolorpicker,backcolorpicker,|,tablecontrols,|,cite,ins,del,abbr,acronym,|,help"}}else{n.elements="send_email_body"}tinyMCE.init(n)}else{if(e.options.isTextMessage){a(".send-email-phone-remove").click(function(){a(this).parent().remove();return false});a("#send_email_cell_add").click(function(){var p=a("#send_email_phone_count");if(!p.length){return}var o=parseInt(p.val());if(isNaN(o)||o<=0){o=0}o++;c.execute({data:{mode:"add_text_recipient",count:o},dataType:"html",wait:false,success:function(q){var r=a("#send_email_phone_container"),s=a(q);r.append(s).attr({scrollTop:r.attr("scrollHeight")});s.find(".send-email-phone-remove").click(function(){a(this).parent().remove();return false});p.val(o)}});return false})}else{a("#send_email_body").autoResize()}}if(a.isFunction(e.options.postRenderForm)){e.options.postRenderForm.call(e,l)}}})};this.submit=function(){if(a.isFunction(this.options.beforeSubmit)){this.options.beforeSubmit.call(this)}this.fromForm=true;this.send()};this.send=function(){c.dialogWaitStart("Please wait while the "+(this.options.isTextMessage?"text message":"email")+"(s) are sent...");if(a.isFunction(this.options.beforeSend)){this.options.beforeSend.call(this)}if(!h){this._sendWorker()}};this._sendWorker=function(){var m=new queryString();this._parseSettings(false);this._settingsToQuery(m);m.load({mode:"send_email",fromForm:this.fromForm?"1":"0"},true);if(a.isFunction(this.options.setupQuery)){this.options.setupQuery.call(this,m)}var l={data:m,disableForm:true,success:e};var k=this;c.window.dialog("option","close",null);if(this.fromForm===true){if(g&&!k.options.isTextMessage){tinyMCE.get("send_email_body").save()}c.submitForm(a("#send_email_form"),l)}else{c.execute(l)}function e(n){if(n==="1"){if(a.isFunction(k.options.success)){k.options.success.call(k)}k.close()}else{if(k.fromForm){c.window.scrollTop(0).css("cursor","default");var o=c.window.find("div#item_errors");if(!o.length){c.window.prepend(o=a('<div id="item_errors"/>'))}o.html(n)}else{c.showErrorWindow(n)}c.enableForm(c.window);if(a.isFunction(k.options.fail)){k.options.fail.call(k,n)}c.dialogWaitEnd()}k.fromForm=false}};this._settingsToQuery=function(e){if(this.options.customParams!==null&&this.options.customParams!==undefined){e.load(this.options.customParams,true)}e.load({attachmentUploadCount:this.options.attachmentUploadCount,isTextMessage:this.options.isTextMessage,replyTo:this.options.replyTo===null||this.options.replyTo===undefined?"":this.options.replyTo.toString(),signature:this.options.signature,useHtml:this.options.useHtml?"1":"0",replaceNewlines:g||!this.options.replaceNewlines?"0":"1",templateid:this.options.templateId},true);if(this.fromForm!==true){e.load({attachments:a.isArray(this.options.attachments)?this.options.attachments.join(","):"",to:a.isArray(this.options.to)?this.options.to.join(","):"",from:this.options.from===null||this.options.from===undefined?"":this.options.from.toString(),priority:this._getPriority(),subject:this.options.subject,body:this.options.body},true)}};this._getPriority=function(){switch(this.options.priority){case 1:case"1":case"high":case"important":return"1";default:case 2:case"2":case"normal":return"2";case 3:case"3":case"low":return"3"}};this._parseSettings=function(k){if(k||this.fromForm){var e;if(this.options.possibleAttachments!==null&&this.options.possibleAttachments!==undefined){if(a.isArray(this.options.possibleAttachments)){for(e=0;e<this.options.possibleAttachments.length;e++){this.options.possibleAttachments[e]=d(this.options.possibleAttachments[e])}}else{this.options.possibleAttachments=[d(this.options.possibleAttachments)]}}if(this.options.attachments!==null&&this.options.attachments!==undefined){if(a.isArray(this.options.attachments)){for(e=0;e<this.options.attachments.length;e++){this.options.attachments[e]=d(this.options.attachments[e])}}else{this.options.attachments=[d(this.options.attachments)]}}if(this.options.to!==null&&this.options.to!==undefined){if(a.isArray(this.options.to)){for(e=0;e<this.options.to.length;e++){this.options.to[e]=f(this.options.to[e],false,"to")}}else{this.options.to=[f(this.options.to,false,"to")]}}if(this.options.from!==null&&this.options.from!==undefined){this.options.from=f(this.options.from,false,"from")}}if(this.options.replyTo!==null&&this.options.replyTo!==undefined){this.options.replyTo=f(this.options.replyTo,true,"reply to")}};function d(l){try{if(l!==null&&l!==undefined&&l.__isAttachment===true){return l}return new attachment(l,false)}catch(k){throw"SendEmailException: Unable to parse the provided attachment. Reason: "+(k.message||k.toString())}}function f(n,k,m){if(typeof n==="number"){return n}try{if(n!==null&&n!==undefined&&n.__isEmail===true){return n}return new email(n,k)}catch(l){throw"SendEmailException: Unable to parse the provided "+m+" email address. Reason: "+(l.message||l.toString())}}}})(jQuery);function email(a,c){this.__isEmail=true;this.address="";this.name="";this.toString=function(){if(this.name.length>0){return this.name+" <"+this.address+">"}return this.address};this.fromString=function(f,d){if(typeof f!=="string"||f.length<=0){if(d){this.address="";this.name="";return this}throw"EmailAddressException: value must be a non-empty string."}if(f.indexOf("<")>=0){var e=f.split("<");this.address=e[1].replace(/\</g,"").replace(/\>/g,"").trim();this.name=e[0].trim()}else{this.address=f;this.name=""}if(this.address.length<=0){throw"EmailAddressException: The passed string '"+f+"' could not be parsed to a valid email."}return this};if(typeof a==="string"){if(a.indexOf("<")>=0||typeof c==="boolean"){this.fromString(a,c);return}if(a.length<=0){throw"EmailAddressException: address must be a non-empty string."}this.address=a;this.name=typeof c==="string"?c:"";return}if(a.__isEmail===true){this.address=a.address;this.name=a.name;return}try{this.address=String(a.address)}catch(b){this.address=""}try{this.name=String(a.name)}catch(b){this.name=""}if(c!==true&&this.address.length<=0){throw"EmailAddressException: Unable to parse the specified value as an email address."}}email.compare=function(a,b){if(a===undefined){return b===undefined?0:-1}if(a===null){return b===null?0:-1}return $.compare(a.address,b.address)};function attachment(b,d,c){this.__isAttachment=true;this.file="";this.name="";this.isFullPath=false;this.toString=function(){if(this.name.length>0||this.isFullPath){return this.file+";"+this.name+";"+(this.isFullPath?"1":"0")}return this.file};this.fromString=function(g,e){if(typeof g!=="string"||g.length<=0){if(e){this.file="";this.name="";this.isFullPath=false;return this}throw"EmailAttachmentException: value must be a non-empty string."}if(g.indexOf(";")>=0){var f=g.split(";");this.file=f[0].trim();this.name=f[1].trim();if(f.length>2){this.isFullPath=f[2]==="1"}}else{this.file=g;this.name="";this.isFullPath=false}if(this.file.length<=0){throw"EmailAttachmentException: The passed string '"+g+"' could not be parsed to a valid Attachment."}return this};if(typeof b==="string"){if(b.indexOf(";")>=0||typeof d==="boolean"){this.fromString(b,d);return}if(b.length<=0){throw"EmailAttachmentException: file must be a non-empty string."}this.file=b;this.name=typeof d==="string"?d:"";this.isFullPath=c===true;return}if(b.__isAttachment===true){this.file=b.file;this.name=b.name;this.isFullPath=b.isFullPath;return}try{this.file=String(b.file)}catch(a){this.file=""}try{this.name=String(b.name)}catch(a){this.name=""}try{this.isFullPath=b.isFullPath===true}catch(a){this.isFullPath=false}if(d!==true&&this.file.length<=0){throw"EmailAttachmentException: Unable to parse the specified value as an email attachment."}}attachment.compare=function(a,b){if(a===undefined){return b===undefined?0:-1}if(a===null){return b===null?0:-1}return $.compare(a.file,b.file)};
/*
* jQuery UI Expandable v1.3
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* https://github.com/flamewave/jquery-ui-expandable/raw/master/GPL-LICENSE.txt
* https://github.com/flamewave/jquery-ui-expandable/raw/master/MIT-LICENSE.txt
*/
(function(a){a.widget("ui.expandable",{version:"1.3",options:{disabled:false,defaultState:null,titleSelector:"> h3",icon:{collapsed:"ui-icon-triangle-1-e",collapsedTitle:null,expanded:"ui-icon-triangle-1-s",expandedTitle:null},showFx:{effect:"slide",options:{direction:"up"},duration:"normal",callback:null},hideFx:{effect:"slide",options:{direction:"up"},duration:"normal",callback:null},ajax:{enabled:false,attr:"rel",cache:true,options:null}},_isTable:false,_headers:null,_getContentElement:function(b){return b.next()},_getContentContainer:function(b){return b.next()},_getIconContainer:function(b){return b},_create:function(){this._isTable=this.element.attr("tagName").toLowerCase()==="table";if(this._isTable&&(!this.options.titleSelector||!this.options.titleSelector.length||this.options.titleSelector.toLowerCase()==="> h3")){this.options.titleSelector="> tbody > tr:even"}if(this._isTable){this._getContentElement=function(b){return b.next().children("td,th").first()};this._getIconContainer=function(b){return b.find("th,td").first()}}this.element.addClass("ui-helper-reset ui-widget ui-expandable");this._headers=this.element.find(this.options.titleSelector);this._createExpandos()},destroy:function(){this.element.removeData("expandable.ajaxLoaded").removeClass("ui-helper-reset ui-widget ui-expandable");var b=this,c=this._useIcons();this._headers.each(function(f){var e=a(this),d=b._getContentContainer(e);e.removeClass("ui-widget-header ui-expandable-header ui-corner-top ui-corner-all ui-expandable-table-header").unbind("click.expandable");d.show().removeClass("ui-corner-bottom ui-widget-content ui-expandable-content ui-expandable-table-content");if(!b._isTable){d.next().remove()}if(c){b._removeIcon(e)}});this._headers=null;a.Widget.prototype.destroy.call(this);return this},refresh:function(){this._headers=this.element.find(this.options.titleSelector);this._createExpandos()},count:function(){return this._headers.length},_createExpandos:function(){var b=this,c=this._useIcons();this._headers.each(function(f){var e=a(this);if(e.data("expandable.created")===true){if(e.data("expandable.index")!==f){e.data("expandable.index",f).unbind("click.expandable").bind("click.expandable",function(){b.toggle(f)})}return}var g=b._getItemStateFromObj(f,e,b.options.defaultState,true),d=b._getContentContainer(e);e.data("expandable.created",true).data("expandable.index",f).bind("click.expandable",function(){b.toggle(f)});d[g?"show":"hide"]();if(g){b._loadContent(e)}if(b._isTable){e.addClass("ui-expandable-table-header");d.addClass("ui-expandable-table-content")}else{e.addClass("ui-helper-reset ui-widget-header ui-expandable-header").addClass(g?"ui-corner-top":"ui-corner-all");d.addClass("ui-helper-reset ui-corner-bottom ui-widget-content ui-expandable-content").after(a('<div class="ui-expandable-spacer">&nbsp;</div>'))}if(c){b._addIcon(e,g)}})},_useIcons:function(){return this.options.icon!==undefined&&this.options.icon!==null&&typeof this.options.icon.collapsed==="string"&&this.options.icon.collapsed.length>0&&typeof this.options.icon.expanded==="string"&&this.options.icon.expanded.length>0},_addIcon:function(b,c){this._getIconContainer(b).prepend(a('<span class="ui-icon ui-expandable-icon">&nbsp;</span>').addClass(c?this.options.icon.expanded:this.options.icon.collapsed).attr("title",c?(this.options.icon.expandedTitle||a.ui.expandable.globalization.defaultIconExpandedTitle):(this.options.icon.collapsedTitle||a.ui.expandable.globalization.defaultIconCollapsedTitle)))},_removeIcon:function(b){this._getIconContainer(b).children(".ui-expandable-icon").remove()},_setOption:function(b,d){var c=this;switch(b){case"disabled":if(d){this.disable()}else{this.enable()}break;case"icon":this._headers.each(function(){var e=a(this);c._removeIcon(e);c._addIcon(e,c._isExpanded(e))});case"defaultState":case"titleSelector":throw b+" option can only be set on creation.";default:a.Widget.prototype._setOption.call(this,b,d);break}return this},disable:function(b){this.options.disabled=!b;this._parseItems(b,function(c){if(c&&c.length){c.add(this._getContentContainer(c)).addClass("ui-expandable-disabled ui-state-disabled")}},null);return this},enable:function(b){this.options.disabled=!!b;this._parseItems(b,function(c){if(c&&c.length){c.add(this._getContentContainer(c)).removeClass("ui-expandable-disabled ui-state-disabled")}},null);return this},isExpanded:function(b){var c=true;this._parseItems(b,function(d){if(!this._isExpanded(d)){c=false;return false}},null);return c},setItemStates:function(e,b,c){if(this.options.disabled){return this}if(e===undefined||e===null){this.collapse(null,b)}else{var d=this;this._headers.each(function(g){var f=a(this);if(d._getItemStateFromObj(g,f,e,false)){d._expandItem(f,b,c)}else{d._collapseItem(f,b)}})}return this},toggle:function(b,c,d){if(!this.options.disabled){this._parseItems(b,function(e){this._toggleItem(e,c,d)},"toggleAll")}return this},expand:function(b,c,d){if(!this.options.disabled){this._parseItems(b,function(e){this._expandItem(e,c,d)},"expandAll")}return this},collapse:function(b,c){if(!this.options.disabled){this._parseItems(b,function(d){this._collapseItem(d,c)},"collapseAll")}return this},_isExpanded:function(b){return b&&b.length&&this._getContentContainer(b).is(":visible")},_toggleItem:function(b,c,d){if(!b||!b.length||b.hasClass("ui-state-disabled")){return}if(this._isExpanded(b)){this._collapseItem(b,c)}else{this._expandItem(b,c,d)}},_expandItem:function(f,g,h){if(!f||!f.length||f.hasClass("ui-state-disabled")||this._isExpanded(f)){return}f.find(".ui-expandable-icon").removeClass(this.options.icon.collapsed).addClass(this.options.icon.expanded).attr("title",this.options.icon.expandedTitle||a.ui.expandable.globalization.defaultIconExpandedTitle);if(!this._isTable){f.removeClass("ui-corner-all").addClass("ui-corner-top")}var e=this._getContentContainer(f);if(this.options.showFx&&g!==true){var d=this,c=typeof this.options.showFx.duration==="string"?this.options.showFx.duration:this.options.showFx.duration||400,b=function(){if(a.isFunction(d.options.showFx.callback)){d.options.showFx.callback()}d._trigger("expanded",null,{head:f[0],content:e[0]});d._loadContent(f,h)};if(a.effects&&a.effects[this.options.showFx.effect]){e.show(this.options.showFx.effect,this.options.showFx.options,c,b)}else{if(this.options.showFx.effect&&e[this.options.showFx.effect]){e[this.options.showFx.effect](c,b)}else{e.show(c,b)}}}else{e.show();this._trigger("expanded",null,{head:f[0],content:e[0]});this._loadContent(f,h)}},_collapseItem:function(f,g){if(!f||!f.length||f.hasClass("ui-state-disabled")||!this._isExpanded(f)){return}f.find(".ui-expandable-icon").removeClass(this.options.icon.expanded).addClass(this.options.icon.collapsed).attr("title",this.options.icon.collapsedTitle||a.ui.expandable.globalization.defaultIconCollapsedTitle);if(!this._isTable){f.removeClass("ui-corner-top").addClass("ui-corner-all")}var e=this._getContentContainer(f);if(this.options.hideFx&&g!==true){var d=this,c=typeof this.options.hideFx.duration==="string"?this.options.hideFx.duration:this.options.hideFx.duration||400,b=function(){if(a.isFunction(d.options.hideFx.callback)){d.options.hideFx.callback()}d._trigger("collapsed",null,{head:f[0],content:e[0]})};if(a.effects&&a.effects[this.options.hideFx.effect]){e.hide(this.options.hideFx.effect,this.options.hideFx.options,c,b)}else{if(e[this.options.hideFx.effect]){e[this.options.hideFx.effect](c,b)}else{e.hide(c,b)}}}else{e.hide();this._trigger("collapsed",null,{head:f[0],content:e[0]})}},loadContent:function(c,b){if(this.options.ajax&&this.options.ajax.enabled===true&&this.options.ajax.attr&&this.options.ajax.attr.length){this._parseItems(c,function(d){this._loadContent(d,b)},null)}return this},setContent:function(d,b){if(d===undefined||d===null){throw"No items specified."}if(a.isFunction(d)){d=d();if(d===undefined||d===null){throw"Function given to items parameter can not return an undefined or null value."}}if(typeof d==="string"){if(d==="first"||d==="last"){this._setItemContent(this._headers[d](),b,false,false)}else{this._setItemContent(this._headers.filter("#"+d),b,false,false)}return this}if(typeof d==="number"&&d>=0){this._setItemContent(this._headers.eq(d),b,false,false);return this}if(d instanceof jQuery){if(d.length===1){this._setItemContent(d,b,false,false)}else{if(d.length>1){var f=this;d.each(function(){f._setItemContent(a(this),b,false,false)})}}return this}for(var e in d){var c=parseInt(e);if(!isNaN(c)&&c>=0){this._setItemContent(this._headers.eq(c),d[e],false,false)}else{this._setItemContent(this._headers.filter("#"+e),d[e],false,false)}}return this},_setItemContent:function(c,b,d,e){if(!c||!c.length){return}if(a.isFunction(b)){b=b(c[0])}var f=this._getContentElement(c).html(b);if(d&&this.options.ajax.cache===true){c.data("expandable.ajaxLoaded",!e)}this._trigger(d&&e?"failedLoad":"contentSet",null,{head:c[0],content:f[0]})},_loadContent:function(d,c){if(!d||!d.length){return}if(this.options.ajax&&this.options.ajax.enabled===true&&this.options.ajax.attr&&this.options.ajax.attr.length&&(c||this.options.ajax.cache!==true||d.data("expandable.ajaxLoaded")!==true)){var h=d.attr(this.options.ajax.attr);if(h&&h.length){var g=this.options.ajax.options&&a.isFunction(this.options.ajax.options.success)?this.options.ajax.options.success:null;var b=this.options.ajax.options&&a.isFunction(this.options.ajax.options.error)?this.options.ajax.options.error:null;var e=a.extend(true,{url:h,dataType:"html"},this.options.ajax.options);var f=this;e.success=function(i,k,j){if(g!==null){i=g(i,k,j,d[0])}f._setItemContent(d,i,true,false)};e.error=function(j,k,i){if(b!==null){k=b(j,k,i,d[0])}f._setItemContent(d,k,true,true)};a.ajax(e)}}},_getItemStateFromObj:function(c,b,e,d){if(e===undefined||e===null){return d}if(typeof e==="boolean"){return e}if(a.isFunction(e)){return e(c,b[0])}if(a.isArray(e)){return e.length>=c?e[c]===true:d}if(e[c]!==undefined){return e[c]===true}if(e[c.toString()]!==undefined){return e[c.toString()]===true}var f=b.attr("id");if(f.length&&e[f]!==undefined){return e[f]===true}return d},_parseItems:function(e,c,b){var f=this;if(e===undefined||e===null){this._headers.each(function(){return c.call(f,a(this))});if(typeof b==="string"&&b.length){this._trigger(b,null,null)}return}if(a.isFunction(e)){e=e();if(e===undefined||e===null){throw"Function given to items parameter can not return an undefined or null value."}}if(typeof e==="string"){if(!e.length){throw"items can not be an empty string."}else{if(e==="first"||e==="last"){c.call(this,this._headers[e]())}else{c.call(this,this._headers.filter("#"+e))}}return}if(typeof e==="number"&&e>=0){c.call(this,this._headers.eq(e));return}if(e instanceof jQuery){if(e.length===1){c.call(this,e)}else{if(e.length>1){e.each(function(){return c.call(f,a(this))})}}return}if(a.isArray(e)&&e.length>0){for(var d=0;d<e.length;d++){if(typeof e[d]==="number"&&e[d]>=0){if(c.call(this,this._headers.eq(e[d]))===false){break}}else{if(typeof e[d]==="string"&&e[d].length){if(c.call(this,this._headers.filter("#"+e[d]))===false){break}}else{throw"Array items must be either a non-negative number or a non-empty string."}}}return}throw"items parameter must be either a function, non-empty string, non-negative number, jQuery object instance, or an array of (non-negative) numbers and/or HTML ID attribute string values."}});a.ui.expandable.globalization={defaultIconCollapsedTitle:"Click to expand",defaultIconExpandedTitle:"Click to collapse"}})(jQuery);
/*
* Onsharp UI Filters v1.0
*
* Copyright 2011, Onsharp
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){a.widget("onsharpUI.filters",{version:"1.0",options:{disabled:false,autoload:true,overlay:true,type:null,handler:null,closed:false,customQuery:null},_overlay:null,_create:function(){if(this.options.autoload){this._autoloadOptions()}if(!this.options.type){throw"FiltersException: type option must be specified."}this._setupExpando();this._setupButtons();if(this.element.attr("disabled")){this._setOption("disabled",true)}},_autoloadOptions:function(){var b=this.element.data();if(b){if(b["options-overlay"]!==undefined){this.options.overlay=Boolean(b["options-overlay"])}if(b["options-type"]!==undefined){this.options.type=b["options-type"]}if(typeof b["options-handler"]==="string"){this.options.handler=b["options-handler"]||null}if(b["options-closed"]!==undefined){this.options.closed=Boolean(b["options-closed"])}if(b["options-custom-query"]){this.options.customQuery=new queryString(b["options-custom-query"])}}},_setupExpando:function(){var b=this;this.element.expandable({defaultState:typeof this.options.closed==="boolean"?!this.options.closed:true,expanded:function(){b._saveState(false);b.element.removeClass("print-hide")},collapsed:function(){b._saveState(true);b.element.addClass("print-hide")}})},_setupButtons:function(){var b=this;this.element.find(".filter-go").addClass("print-hide").button().bind("click.onsharpUI.filters",function(){b._go(a(this.form));return false});this.element.find(".filter-remove").addClass("print-hide").button().bind("click.onsharpUI.filters",function(){b.removeAll();return false});this.element.find(".filter-load-saved").addClass("print-hide").button().bind("click.onsharpUI.filters",function(){b.loadSaved();return false});this.element.find(".filter-save").addClass("print-hide").button().bind("click.onsharpUI.filters",function(){b._save(a(this.form));return false});this.element.find(".filter-help").addClass("print-hide").button().bind("click.onsharpUI.filters",function(c){b._trigger("help",c,null);return false})},destroy:function(){this.hideOverlay();this.element.expandable("destroy");this.element.find("button.filter-go,button.filter-remove,button.filter-load-saved,button.filter-save,button.filter-help").button("destroy").unbind("click.onsharpUI.filters");a.Widget.prototype.destroy.apply(this);return this},_setOption:function(b,c){switch(b){case"autoload":case"type":throw"FiltersException: "+b+" can only be set upon initilization.";break;case"disabled":this.options.disabled=c;this.element.expandable(c?"disable":"enable").find(":input").attr("disabled",c);break;case"closed":this.options.closed=c;this.element.expandable(c?"collapse":"expand");break;default:a.Widget.prototype._setOption.apply(this,[b,c]);break}return this},saveState:function(){if(!this.options.disabled){this._saveState(!this.element.expandable("isExpanded"))}return this},_saveState:function(b){var c=this._createQuery();if(this._trigger("beforeStateSave",null,{isClosing:b,query:c})===false){return}c.add("fss"+this.options.type,true,true);c.add("value",b,true);this._ajaxHandle(false,c,false,false,"stateSaved")},reload:function(){if(this.options.disabled){return this}var b=this._createQuery();if(this._trigger("beforeReload",null,{query:b})===false){return}b.add("frl"+this.options.type,true,true);this._ajaxHandle(true,b,false,true,"reload");return this},go:function(){if(!this.options.disabled){this._go(this.element.parents("form"))}return this},_go:function(b){if(!b||!b.length){throw"FiltersException: no containing form found to submit."}var c=this._createQuery();c.load(b.formToArray());c.add("fg"+this.options.type,true,true);if(this._trigger("beforeGo",null,{query:c})===false){return}this._ajaxHandle(true,c,true,false,"go")},removeAll:function(){if(this.options.disabled){return this}var b=this._createQuery();if(this._trigger("beforeRemoveAll",null,{query:b})===false){return}b.add("frm"+this.options.type,true,true);this._ajaxHandle(true,b,false,true,"removeAll");return this},loadSaved:function(){if(this.options.disabled){return this}var b=this._createQuery();if(this._trigger("beforeLoadSaved",null,{query:b})===false){return}b.add("fls"+this.options.type,true,true);this._ajaxHandle(true,b,false,true,"loadSaved");return this},save:function(){if(!this.options.disabled){this._save(this.element.parents("form"))}return this},_save:function(b){if(!b||!b.length){throw"FiltersException: no containing form found to submit."}var c=this._createQuery();c.load(b.formToArray());if(this._trigger("beforeSave",null,{query:c})===false){return}c.add("fs"+this.options.type,true,true);this._ajaxHandle(true,c,true,false,"save")},showOverlay:function(){if(this.options.disabled){return this}a(document.body).addClass("wait");if(this._overlay&&this._overlay.dialog("isOpen")===true){return}this._overlay=a('<div style="text-align:center;padding-top:20px"></div>').html('<img src="'+a.onsharpUI.filters.globalization.loadingImage+'" alt="'+a.onsharpUI.filters.globalization.loadingText+'" title="'+a.onsharpUI.filters.globalization.loadingText+'" />').dialog({closeOnEscape:false,draggable:false,height:100,minHeight:100,modal:true,resizable:false});this._overlay.siblings(".ui-dialog-titlebar").remove();return this},hideOverlay:function(){if(this.options.disabled){return this}if(this._overlay&&this._overlay.dialog("isOpen")===true){this._overlay.dialog("close").dialog("destroy").remove()}a(document.body).removeClass("wait");this._overlay=null;return this},_createQuery:function(){var b=new queryString();if(this.options.customQuery){b.mergeWith(this.options.customQuery,1)}return b},_ajaxHandle:function(d,f,e,g,c){var b=this;if(this.options.overlay&&d){this.showOverlay()}a.ajax({url:this.options.handler||uri.load(false).toString(),type:e?"post":"get",dataType:"html",data:f.toHash(),success:function(h){if(g){b.element.find("#filter_form_items_"+b.options.type).html(h)}},complete:function(i,h){if(c&&b._trigger(c,null,{status:h})===false){return}b.hideOverlay()}})}});a.onsharpUI.filters.globalization={loadingImage:"/images/loading.gif",loadingText:"Please wait..."};a(function(){a(".filters-autocreate").filters({autoload:true})})})(jQuery);
/*
* jQuery UI Help v1.2
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
HelpWindow={};(function(a){var b=null;a.widget("ui.help",{version:"1.2",options:{xmlFile:"",cssPrint:"/css/compiled/print/onsharp.ui.help.print.min.css",defaultSection:"1",hideSections:null,tooltips:null},_dialog:null,_html:null,_create:function(){if(!a.fn.button){throw"Missing dependency: jQuery UI Button."}if(!a.fn.dialog){throw"Missing dependency: jQuery UI Dialog."}var c=this;if(!c.options.xmlFile){throw"Invalid XML file specified."}c.widget().button(c.options).click(function(){c.open(c.options.defaultSection)})},destroy:function(){var c=this;c.close().widget().unbind("click",function(){c.open(c.options.defaultSection)}).button("destroy");c._html=null;a.Widget.prototype.destroy.apply(c);return c},_setOption:function(c,e){var d=this;switch(c){case"disabled":d.options.disabled=e;d.widget().button("option","disabled",e);if(e&&d.isOpen()){d.close()}break;case"xmlFile":d.options.xmlFile=e;d._html=null;break;case"defaultSection":d.options.defaultSection=e;break;case"hideSections":d.options.hideSections=e;d._html=null;break;default:d.widget().button("option",c,e);break}return d},isOpen:function(){return this._dialog!==null&&this._dialog.dialog("isOpen")===true},close:function(){if(b===this){b=null}if(this._dialog!==null){this._dialog.dialog("close").empty().dialog("destroy")}a("#help_dialog,#help_print_css").remove();return this},open:function(c){b=this;var d=this;if(d._html===null){d._html=a.ui.help.globalization.textWait;d._parseXml(c);c=false}var e={};e[a.ui.help.globalization.buttonClose]=function(){d.close()};d._dialog=a('<div id="help_dialog"/>').html(d._html).dialog({buttons:e,close:function(){d.close()},modal:true,title:a.ui.help.globalization.title,width:a(window).width()-20,height:a(window).height()-20,resizeStop:function(){var f=d._dialog.dialog("option","height");d._html.css("height",f-107);d._html.find("div.help-menu").css("height",f-117);d._html.find("div.help-content").css("height",f-117)}});if(typeof d.options.cssPrint==="string"&&d.options.cssPrint.length){a("html head").append('<link type="text/css" rel="stylesheet" media="print" href="'+d.options.cssPrint+'" id="help_print_css" />')}if(c){d.showSection(c)}return d},showSection:function(d){b=this;var e=this,c=e.options;if(!e.isOpen()){e.open(false)}if(typeof d==="number"){d=d.toString()}if(typeof d!=="string"||(a.isArray(c.hideSections)&&c.hideSections.indexOf(d)>=0)){d=c.defaultSection}d=d.replace(/\./g,"-");e._html.find(".ui-state-default").removeClass("ui-state-default").addClass("item-state-default");e._html.find("#help_menu_section_"+d).removeClass("item-state-default").addClass("ui-state-default");e._html.find(".help-section-active").removeClass("help-section-active");if(!e._html.find("#help_section_"+d).addClass("help-section-active").length){e._html.find("#help_section_0").addClass("help-content-active")}return e},_parseXml:function(e){var f=this;if(!a.isArray(f.options.hideSections)){f.options.hideSections=[]}a.ajax({type:"GET",url:f.options.xmlFile,dataType:"xml",error:function(){alert(a.ui.help.globalization.errorFileLoad)},success:function(j){j=a(j);f._html=a('<div id="help_container"/>').css("height",a(window).height()-127);try{var i=a('<div class="help-menu"/>').css("height",a(window).height()-137).appendTo(f._html);c(j,"help menu_header",i,"header");d(j.find("help section_list"),i,false);c(j,"help menu_footer",i,"footer");var h=a('<div class="help-content ui-widget-content"/>').css("height",a(window).height()-137).appendTo(f._html);c(j,"help section_header",h,"header");j.find("help section:not(section_list section)").each(function(){var k=a(this);a('<div class="help-section"/>').attr("id","help_section_"+k.attr("id").replace(/\./g,"-")).html(k.text()).appendTo(h)});a('<div class="help-section"/>').attr("id","help_section_0").html(a.ui.help.globalization.errorInvalidSection).appendTo(h);c(j,"help section_footer",h,"footer")}catch(g){f._html.append("ERROR: "+g.message)}if(e){f._dialog.html(f._html);f.showSection(e)}}});function c(k,i,h,g){var j=k.find(i);if(j.length){a("<div/>").html(j.text()).attr("class",g).appendTo(h)}}function d(h,i,g){var j=h.children();if(j.length<=0){return}var k=g?a("<div/>").attr("class","sub-menu-container").appendTo(i):i;h.children().each(function(){if(this.nodeName.toUpperCase()==="SECTION"){var l=a(this),m=l.attr("id");if(f.options.hideSections.indexOf(m)<0){var n=a('<div class="help-menu-item ui-widget-content ui-corner-all item-state-default"/>').attr("id","help_menu_section_"+m.replace(/\./g,"-")).bind({mouseover:function(){a(this).removeClass("item-state-default").addClass("ui-state-hover")},mouseout:function(){var o=a(this);o.removeClass("ui-state-hover");if(!o.hasClass("ui-state-default")){o.addClass("item-state-default")}},click:function(){f.showSection(m)}}).text(l.attr("text")).appendTo(k);d(l,k,true)}}})}}});a.ui.help.showSection=function(c){if(b!==null){b.showSection(c)}};a.showHelpSection=function(c){if(b!==null){b.showSection(c)}};HelpWindow.ShowSection=function(c){if(b!==null){b.showSection(c)}};a.ui.help.globalization={title:"Help",textWait:"Please wait while the help content is loaded...",buttonClose:"Close",errorFileLoad:"An error occurred loading the help content file.",errorInvalidSection:"An invalid help section was specified. Please select the section you wish to view to the left."}})(jQuery);
/*
* jQuery UI Numeric Up/Down v1.4.2
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* https://github.com/flamewave/jquery-ui-numeric/raw/master/GPL-LICENSE.txt
* https://github.com/flamewave/jquery-ui-numeric/raw/master/MIT-LICENSE.txt
*/
(function(a){a.widget("ui.numeric",{version:"1.4.2",options:{disabled:false,keyboard:true,showCurrency:false,currencySymbol:null,title:null,buttons:true,upButtonIcon:"ui-icon-triangle-1-n",upButtonTitle:null,downButtonIcon:"ui-icon-triangle-1-s",downButtonTitle:null,emptyValue:0,minValue:false,maxValue:false,smallIncrement:1,increment:5,largeIncrement:10,calc:null,format:null},_adjustmentFlag:false,_keyDownFlag:false,_timer:null,_name:"numeric",_value:0,_create:function(){var k=this.element.attr("type").toLowerCase();if(k!=="text"&&k!=="number"){throw"numeric widget can only be applied to text and number inputs."}this._checkFormat();this._name=this.element.attr("id")||this.element.attr("name");this._value=this._getInputValue(this.element.attr("value"),true);if(this.options.minValue!==false&&this._value<this.options.minValue){this._value=this.options.minValue}if(this.options.maxValue!==false&&this._value>this.options.maxValue){this._value=this.options.maxValue}this.element.attr("value",this._format(this._value));this.element.attr("title",this.options.title||a.ui.numeric.globalization.defaultTooltip).wrap(a('<div class="ui-widget ui-widget-content ui-corner-all ui-numeric" />'));if(this.options.showCurrency){this._createCurrency()}if(this.options.buttons){this._createButtons()}var j=this;this.element.bind({keydown:function(l){return j._onKeyDown(l)},keyup:function(l){return j._onKeyUp(l)},change:function(l){return j._onChange(l)}});if(this.options.disabled||this.element.attr("disabled")){this._setOption("disabled",true)}a(window).bind("unload",function(){j.destroy()})},destroy:function(){var j=this;this.element.unbind({keydown:function(k){return j._onKeyDown(k)},keyup:function(k){return j._onKeyUp(k)},change:function(k){return j._onChange(k)}});if(this.options.showCurrency){a("#"+this._name+"_currency").remove()}if(this.options.buttons){a("#"+this._name+"_buttons").remove()}this.element.unwrap();a.Widget.prototype.destroy.call(this);a(window).unbind("unload",function(){j.destroy()})},_createCurrency:function(){this.element.before(a("<div/>").attr("id",this._name+"_currency").addClass("ui-numeric-currency").html(this.options.currencySymbol||Number.globalization.defaultCurrencyFormat.symbol))},_createButtons:function(){var k=a('<button type="button"></button>').attr("title",this.options.upButtonTitle||a.ui.numeric.globalization.defaultUpTooltip).bind({keydown:function(p){m(p,false)},keyup:function(){o()},mousedown:function(p){l(p,false)},mouseup:function(){o()}}).button({text:false,label:"U",icons:{primary:this.options.upButtonIcon}});var j=a('<button type="button"></button>').attr("title",this.options.downButtonTitle||a.ui.numeric.globalization.defaultDownTooltip).bind({keydown:function(p){m(p,true)},keyup:function(){o()},mousedown:function(p){l(p,true)},mouseup:function(){o()}}).button({text:false,label:"D",icons:{primary:this.options.downButtonIcon}});this._addButtons(k,j);var n=this;function m(p,q){if(p.which==32||p.which==13){l(p,q);p.target.focus()}}function l(p,r){(r?k:j).blur();var q=n._getIncrement(p.ctrlKey,p.shiftKey);n._adjustValueRecursive(r?-q.value:q.value,q.type)}function o(){clearTimeout(n._timer)}},_addButtons:function(k,j){this.element.after(a("<div/>").attr("id",this._name+"_buttons").addClass("ui-numeric-buttons").append(k).append(j))},_setOption:function(j,k){switch(j){case"disabled":this.element.parent()[k?"addClass":"removeClass"]("ui-numeric-disabled ui-state-disabled").attr("aria-disabled",k);this._adjustmentFlag=true;if(k){this.element.attr({disabled:"disabled",value:""})}else{this.element.removeAttr("disabled").attr("value",this._format(this._value))}this._adjustmentFlag=false;if(this.options.buttons){a("#"+this._name+"_buttons button").button(k?"disable":"enable")}break;case"emptyValue":this.options.emptyValue=k;this._setValue(this._value);break;case"minValue":this.options.minValue=k===false?false:b(k);if(this.options.minValue!==false&&this._value<this.options.minValue){this._setValue(this.options.minValue)}break;case"maxValue":this.options.maxValue=k===false?false:b(k);if(this.options.maxValue!==false&&this._value>this.options.maxValue){this._setValue(this.options.maxValue)}break;case"format":this.options.format=k;this._checkFormat();this._setValue(this._value);break;case"title":this.options.title=k||a.ui.numeric.globalization.defaultTooltip;this.element.attr("title",this.options.title);break;case"showCurrency":if(k&&!this.options.showCurrency){this._createCurrency()}else{if(!k&&this.options.showCurrency){a("#"+this._name+"_currency").remove()}}this.options.showCurrency=k;break;case"currencySymbol":this.options.currencySymbol=k||Number.globalization.defaultCurrencyFormat.symbol;if(this.options.showCurrency){a("#"+this._name+"_currency").html(this.options.currencySymbol)}break;case"buttons":if(k&&!this.options.buttons){this._createButtons()}else{if(!k&&this.options.buttons){a("#"+this._name+"_buttons").remove()}}this.options.buttons=k;break;case"upButtonIcon":this.options.upButtonIcon=k;if(this.options.buttons){a("#"+this._name+"_buttons").find("button:eq(0)").button("option","icons",{primary:k})}break;case"upButtonTitle":this.options.upButtonTitle=k||a.ui.numeric.globalization.defaultUpTooltip;if(this.options.buttons){a("#"+this._name+"_buttons").find("button:eq(0)").attr("title",this.options.upButtonTitle)}break;case"downButtonIcon":this.options.downButtonIcon=k;if(this.options.buttons){a("#"+this._name+"_buttons").find("button:eq(1)").button("option","icons",{primary:k})}break;case"downButtonTitle":this.options.downButtonTitle=k||a.ui.numeric.globalization.defaultDownTooltip;if(this.options.buttons){a("#"+this._name+"_buttons").find("button:eq(1)").attr("title",this.options.downButtonTitle)}break;default:a.Widget.prototype._setOption.call(this,j,k);break}return this},_checkFormat:function(){this.options.format=a.extend({},Number.globalization.defaultFormat,typeof this.options.format==="string"?{format:this.options.format}:this.options.format)},_getInputValue:function(k,j){k=k.replace(new RegExp(h(this.options.format.thousandsChar),"g"),"");if(this.options.format.decimalChar!=="."){k=k.replace(new RegExp(h(this.options.format.decimalChar),"g"),".")}return j?b(k):k},_setInputValue:function(j){this._adjustmentFlag=true;this.element.attr("value",this._format(j)).change();this._adjustmentFlag=false},_setValue:function(j){j=b(j);if(this.options.minValue!==false&&j<this.options.minValue){j=this.options.minValue}if(this.options.maxValue!==false&&j>this.options.maxValue){j=this.options.maxValue}this._value=j;if(!this.options.disabled){this._setInputValue(j)}},_format:function(j){return isNaN(j)||(this.options.emptyValue!==false&&j===this.options.emptyValue)?"":a.formatNumber(j,this.options.format)},_getIncrement:function(j,k){if(j){return{value:this.options.smallIncrement,type:2}}else{if(k){return{value:this.options.largeIncrement,type:3}}}return{value:this.options.increment,type:1}},_adjustValue:function(j,k){if(this.options.disabled){return}this._setValue(a.isFunction(this.options.calc)?this.options.calc(this._value,k,j<0?2:1):this._value+j);this.select()},_adjustValueRecursive:function(j,k){a.ui.numeric._current=this;a.ui.numeric._timerCallback(j,k,true)},_onKeyDown:function(j){if(this.options.disabled){return}var l=String.fromCharCode(a.keyCodeToCharCode(j.which,j.shiftKey)).toLowerCase();if(l===this.options.format.decimalChar.toLowerCase()||l==this.options.format.thousandsChar.toLowerCase()){this._keyDownFlag=true;return}switch(j.which){case 109:this._keyDownFlag=true;return;case 38:case 40:if(this.options.keyboard){var k=this._getIncrement(j.ctrlKey,j.shiftKey);this._adjustValue(j.which==40?-k.value:k.value,k.type)}return;case 33:if(this.options.keyboard){this._adjustValue(this.options.largeIncrement,3)}return;case 34:if(this.options.keyboard){this._adjustValue(-this.options.largeIncrement,3)}return;case 65:case 67:case 86:case 88:case 89:case 90:if(j.ctrlKey){return}break}if(c(j.which)){return}if(!d(j.which)){j.preventDefault();j.stopPropagation();return}},_onKeyUp:function(){var j=parseFloat(this._getInputValue(this.element.attr("value"),false));if(!isNaN(j)){this._value=j}this._keyDownFlag=false},_onChange:function(j){if(!this._adjustmentFlag&&!this._keyDownFlag){this._setValue(this._getInputValue(j.target.value),true)}},value:function(j){if(j===undefined){return this._value}this._setValue(j);return this},select:function(){if(!this.options.disabled){this.element.select()}return this}});a.ui.numeric.globalization={defaultTooltip:"Type a new value or use the buttons or keyboard arrow keys to change the value. Hold Ctrl or Shift for a smaller or larger increment, respectively.",defaultUpTooltip:"Increment the value. Hold Ctrl or Shift for a smaller or larger increment, respectively.",defaultDownTooltip:"Decrement the value. Hold Ctrl or Shift for a smaller or larger increment, respectively."};a.ui=a.ui||{};a.ui.numeric._current=null;a.ui.numeric._timerCallback=function(j,l,k){clearTimeout(a.ui.numeric._current._timer);a.ui.numeric._current._adjustValue(j,l);a.ui.numeric._current._timer=setTimeout("jQuery.ui.numeric._timerCallback("+j+","+l+",false)",k?1000:50)};var f={48:41,49:33,50:64,51:35,52:36,53:37,54:94,55:38,56:42,57:40,59:58,61:43,186:58,187:43,188:60,109:95,189:95,190:62,191:63,192:126,219:123,220:124,221:125,222:34};var e={59:59,61:61,96:48,97:49,98:50,99:51,100:52,101:53,102:54,103:55,104:56,105:57,106:42,107:43,109:45,110:46,111:47,186:59,187:61,188:44,109:45,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39};a.keyCodeToCharCode=function(j,k){if(j>=48&&j<=57&&!k){return j}if(j>=65&&j<=90){return k?j:j+32}if(j===9||j===32){return j}return k?f[j]:e[j]};function c(j){return(j<=47&&j!=32)||(j>=91&&j<=95)||(j>=112&&[188,190,191,192,219,220,221,222].indexOf(j)==-1)}function d(j){return(j>=48&&j<=57)||(j>=96&&j<=105)}function b(j){if(typeof j!=="number"){j=Number(j)}if(isNaN(j)){return 0}return j}function i(l,j){var m="";for(var k=0;k<j;k++){m+=l}return m}var g=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");function h(j){return j.replace(g,"\\$1")}a.formatNumber=function(q,r){r=a.extend({},Number.globalization.defaultFormat,typeof r==="string"?{format:r}:r);r.decimalChar=typeof r.decimalChar!=="string"||r.decimalChar.length<=0?Number.globalization.defaultFormat.decimalChar:r.decimalChar;r.thousandsChar=typeof r.thousandsChar!=="string"?Number.globalization.defaultFormat.thousandsChar:r.thousandsChar;if(r.decimalChar.length>1){throw"NumberFormatException: Can not have multiple characters as the decimal character."}if(r.thousandsChar.length>1){throw"NumberFormatException: Can not have multiple characters as the thousands separator."}if(typeof q!=="number"){if(typeof q==="string"){q=q.replace(new RegExp(h(r.thousandsChar),"g"),"");if(r.decimalChar!=="."){q=q.replace(new RegExp(h(r.decimalChar),"g"),".")}}q=Number(q);if(isNaN(q)){q=0}}if(typeof r.format!=="string"||r.format.length<=0){return r.decimalChar==="."?q.toString():q.toString().replace(/\./g,r.decimalChar)}var t=r.format.indexOf(".");if(t>=0&&r.format.indexOf(".",t+1)>=0){throw"NumberFormatException: Format string has multiple decimal characters."}var z=q.toString().replace(/-/g,""),s=r.format.replace(new RegExp("[^0#.]","g"),""),A=z.indexOf(".")<0?[z,""]:z.split("."),w=t<0?[s,""]:s.split(".");if(parseInt(q)===0){A[0]=w[0].indexOf("0")>=0?Number.globalization.padChar:""}var k;if(r.format.indexOf(",")>=0&&A[0].length>3){var y=[],l=A[0].length,o=Math.floor(l/3),p=A[0].length%3||3;for(k=0;k<l;k+=p){if(k!=0){p=3}y[y.length]=A[0].substr(k,p);o-=1}A[0]=y.join(r.thousandsChar)}if(w[1].length>0){if(A[1].length>0){if(A[1].length>w[1].length){A[1]=Number("0."+A[1]).roundRight(w[1].length).toString().split(".")[1]}var v=w[1].split(""),u=A[1].split("");for(k=0;k<u.length;k++){if(k>=v.length){break}v[k]=u[k]}A[1]=v.join("").replace(/#/g,"")}else{var x=0;A[1]="";while(w[1].charAt(x)==="0"){A[1]+=Number.globalization.padChar;x++}}}else{A[1]=""}var B=(A[1].length<=0)?A[0]:A[0]+r.decimalChar+A[1];if(q<0){B="-"+B}return r.format.replace(new RegExp("[0|#|,|.]+"),B)};Number.prototype.roundRight=function(j){j=b(j);var k=Math.pow(10,j);return Math.round(this*k)/k};Number.prototype.pad=function(k){k=b(k);var m=String(this.valueOf()),l=m.length;if(l<k){for(var j=l;j<k;j++){m=Number.globalization.padChar+m}}return m};Number.prototype.padRight=function(k){k=b(k);var m=String(this.valueOf()),l=m.length-(this%1>0?1:0);if(l<k){for(var j=l;j<k;j++){m=m+Number.globalization.padChar}}return m};Number.prototype.padDecimals=function(j){j=b(j);var k=String(this.valueOf()).split(".");if(k.length<=0){return j>0?Number.globalization.padChar+"."+i(Number.globalization.padChar,j):Number.globalization.padChar}if(k.length==1){return k[0]+(j>0?"."+i(Number.globalization.padChar,j):"")}return k[0]+(j>0?"."+parseInt(k[1]).padRight(j):"")};Number.prototype.getOrdinal=function(){if(this>100){return(this%100).getOrdinal()}if(this>=11&&this<=19){return Number.globalization.ordinals.th}switch(this%10){case 1:return Number.globalization.ordinals.st;case 2:return Number.globalization.ordinals.nd;case 3:return Number.globalization.ordinals.rd}return Number.globalization.ordinals.th};Number.prototype.format=function(j){a.formatNumber(this,j)};Number.prototype.formatCurrency=function(j){j=a.extend({},Number.globalization.defaultCurrencyFormat,j);var k=Math.abs(this).format(j);if(this<0){return j.noParens?"-"+j.symbol+k:"("+j.symbol+k+")"}return k};Number.globalization={defaultFormat:{format:null,decimalChar:".",thousandsChar:","},defaultCurrencyFormat:{symbol:"$",noParens:false,format:"#,##0.00",decimalChar:".",thousandsChar:","},padChar:"0",ordinals:{th:"th",st:"st",nd:"nd",rd:"rd"}}})(jQuery);
/*
* jQuery UI Password v1.1
*
* Copyright 2011, Tony Kramer
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function(a){a.widget("ui.password",{version:"1.1",options:{disabled:false,confirm:false,meter:true,generate:false},_cont:null,_create:function(){var c=this,b=c.options,e=c.widget(),d=e.attr("type").toLowerCase();if(d!=="text"&&d!=="password"){throw"password widget can only be applied to text and password inputs."}e.wrap(a('<div class="ui-widget ui-password" />'));c._cont=e.parent();c._checkGenerateOptions(b.generate,true);c._checkMeterOptions(b.meter,true);c._checkConfirmOptions(b.confirm,true);if(b.generate.enabled){c._createGenerate()}if(b.meter.enabled){c._createMeter()}if(b.confirm.enabled){c._createConfirm()}},destroy:function(){var b=this;if(b.options.generate.enabled){b._removeGenerate()}if(b.options.meter.enabled){b._removeMeter()}if(b.options.confirm.enabled){b._removeConfirm()}b.widget().unwrap();a.Widget.prototype.destroy.apply(b)},_setOption:function(b,e){var d=this,c=this.options;switch(b){case"disabled":c.disabled=e;if(d._cont!==null){d._cont[e?"addClass":"removeClass"]("ui-password-disabled ui-state-disabled").attr("aria-disabled",e);if(e){d.widget().attr("disabled","disabled")}else{d.widget().removeAttr("disabled")}if(c.generate&&c.generate.enabled){d._cont.find(".ui-password-generate").button(e?"disable":"enable")}}break;case"confirm":d._checkConfirmOptions(e);if(d._cont!==null){if(c.confirm.enabled){d._createConfirm()}else{d._removeConfirm()}}break;case"meter":d._checkMeterOptions(e);if(d._cont!==null){if(c.meter.enabled){d._createMeter()}else{d._removeMeter()}}break;case"generate":d._checkGenerateOptions(e);if(d._cont!==null){if(c.generate.enabled){d._createGenerate()}else{d._removeGenerate()}}break;default:a.Widget.prototype._setOption.apply(d,[b,e]);break}return d},_checkGenerateOptions:function(d,b){var c={enabled:true,length:8,text:a.ui.password.globalization.defaultGenerateText,method:null};if(typeof d==="boolean"){if(b){this.options.generate=a.extend(c,{enabled:d})}else{this.options.generate.enabled=d}}else{this.options.generate=a.extend(c,d)}},_checkMeterOptions:function(d,b){var c={enabled:true,multiplier:3.8,text:a.ui.password.globalization.defaultMeterText};if(typeof d==="boolean"){if(b){this.options.meter=a.extend(c,{enabled:d})}else{this.options.meter.enabled=d}}else{this.options.meter=a.extend(c,d)}},_checkConfirmOptions:function(d,b){var c={enabled:true,textMatch:a.ui.password.globalization.defaultTextMatch,textNoMatch:a.ui.password.globalization.defaultTextNoMatch};if(typeof d==="boolean"){if(b){this.options.confirm=a.extend(c,{enabled:d})}else{this.options.confirm.enabled=d}}else{this.options.confirm=a.extend(c,d)}},_updateMeter:function(e){var d=this,b=d.options.meter;if(!b.enabled){return}var c=null;if(a.isFunction(b.check)){c=b.check(e)}else{if(a.isFunction(a.checkPassword)){c=a.checkPassword(e)}else{throw"No password check method available."}}d._cont.find(".ui-password-meter").html(b.text.replace(/\{score\}/gi,c.score).replace(/\{complexity\}/gi,c.complexity)).css("background-position","-"+(c.score*b.multiplier)+"px").css("background-color",c.color?"rgb("+c.color.r+","+c.color.g+","+c.color.b+")":"")},_updateConfirm:function(e,d){var f=this,b=f.options.confirm;if(!b.enabled){return}if(e.length&&e===d){f._cont.find(".ui-password-confirm span").text(b.textMatch).addClass("ui-password-confirm-match").removeClass("ui-password-confirm-no-match")}else{f._cont.find(".ui-password-confirm span").text(b.textNoMatch).removeClass("ui-password-confirm-match").addClass("ui-password-confirm-no-match")}},_createGenerate:function(){var c=this,b=c.options.generate;if(c._cont.find(".ui-password-generate").length){return}c._cont.append(a('<button type="button" class="ui-password-generate" />').html(b.text).button().click(function(){var d=null;if(a.isFunction(b.create)){d=b.create(b.length)}else{if(a.isFunction(a.randomPassword)){d=a.randomPassword(b.length)}else{throw"No password generation method available."}}c.widget().val(d);c._updateMeter(d);if(c.options.confirm.enabled){c._cont.find(".ui-password-confirm input").val(d);c._updateConfirm(d,d)}}))},_removeGenerate:function(){this._cont.find(".ui-password-generate").remove()},_createMeter:function(){var b=this;if(b._cont.find(".ui-password-meter").length){return}b._cont.append(a('<div class="ui-widget-content ui-corner-all ui-password-meter" />'));b.widget().bind("keyup",function(){b._updateMeter(a(this).val())});b._updateMeter(b.widget().val())},_removeMeter:function(){var c=this,b=c._cont.find(".ui-password-meter");if(b.length){b.remove();c.widget().unbind("keyup",function(){c._updateMeter(a(this).val())})}},_createConfirm:function(){var b=this,c=b.widget();if(b._cont.find(".ui-password-confirm").length){return}b._cont.append(a('<div class="ui-password-confirm" />').append(a("<input />").attr("type",c.attr("type")).attr("name",c.attr("name")+"_confirm").bind("keyup",function(){b._updateConfirm(c.val(),a(this).val())})).append(a("<span />")));c.bind("keyup",function(){b._confirmOnChange()});b._updateConfirm(c.val(),"")},_removeConfirm:function(){var d=this,b=d._cont.find(".ui-password-confirm");if(b.length){b.remove();d.widget().unbind("keyup",function(){d._confirmOnChange()})}},_confirmOnChange:function(){this._updateConfirm(this.widget().val(),this._cont.find(".ui-password-confirm input").val())}});a.ui.password.globalization={defaultTextMatch:"Confirmed",defaultTextNoMatch:"Not Confirmed",defaultMeterText:"{score}% - {complexity}",defaultGenerateText:"Generate"}})(jQuery);
