
(function($){$.fn.hint=function(blurClass){if(!blurClass)blurClass='blur';return this.each(function(){var $input=$(this),title=$input.attr('title'),$form=$(this.form),$win=$(window);function remove(){if(this.value===title&&$input.hasClass(blurClass)){$input.val('').removeClass(blurClass);}}
if(this.value===title&&!$input.hasClass(blurClass)){$input.val(title).addClass(blurClass);}
if(title){$input.blur(function(){if(this.value===''){$input.val(title).addClass(blurClass);}}).focus(remove).blur();$form.submit(remove);$win.unload(remove);}});};})(jQuery);(function($){$.fn.truncate=function(options){var defaults={length:50,ellipsisText:"...",moreLinkActive:false};var options=$.extend(defaults,options);return this.each(function(){var text=$jQ(this).text();if(text.length>options.length&&text!=options.ellipsisText){var moreText=text.substring(options.length,text.length);text=text.substring(0,options.length).replace(/\s+$/,'');$jQ(this).attr('alt',moreText);var moreLink;if(options.moreLinkActive){moreLink=$jQ('<a>').attr('href','#more').html(options.ellipsisText);$jQ(this).html(text).after(moreLink);}else{moreLink=options.ellipsisText;$jQ(this).html(text).append(moreLink);}
$jQ('a[href="#more"]').click(function(){$jQ(this).hide();$jQ('<span>').hide().html($jQ(this).attr('alt')).after(this).show('slow');return false;});}});};})(jQuery);(function($){$.fn.setTextStyleByLength=function(options){var defaults={largeTitleClass:'largeTitle',mediumTitleClass:'mediumTitle',smallTitleClass:'smallTitle',shortestLength:18,longestLength:33};var options=$.extend(defaults,options);return this.each(function(){var title=$jQ(this);if(title.html().length<=options.shortestLength){$jQ(title).addClass(options.largeTitleClass);}else if(title.html().length>options.shortestLength&&title.html().length<=options.longestLength){$jQ(title).addClass(options.mediumTitleClass);}else if(title.html().length>options.longestLength){$jQ(title).addClass(options.smallTitleClass);}});};})(jQuery);(function($){$.toFixedWidth=function(value,length,fill){var result=value.toString();if(!fill)fill='0';var padding=length-result.length;if(padding<0){result=result.substr(-padding);}
else{for(var n=0;n<padding;n++)
result=fill+result;}
return result;};})(jQuery);(function($){$.fn.seoUrl=function(args1,args2){args1=replaceChars(args1);var input=args1;if(args2!=undefined){args2=replaceChars(args2);if(args1.indexOf(args2)>-1){input=args1;}else if(args2.indexOf(args1)>-1){input=args2;}else{input=args1+"_"+args2;}}
return input;};})(jQuery);function replaceChars(s){return s.toLowerCase().replace("&","and").replace(/ /g,"_").replace(/[^a-z0-9_]/g,"");}
(function($){$.formatDate=function(date,pattern){var result=[];while(pattern.length>0){$.formatDate.patternParts.lastIndex=0;var matched=$.formatDate.patternParts.exec(pattern);if(matched){result.push($.formatDate.patternValue[matched[0]].call(this,date));pattern=pattern.slice(matched[0].length);}else{result.push(pattern.charAt(0));pattern=pattern.slice(1);}}
return result.join('');};$.formatDate.patternParts=/^(yy(yy)?|M(M(M(M)?)?)?|d(d)?|EEE(E)?|a|H(H)?|h(h)?|m(m)?|s(s)?|S)/;$.formatDate.monthNames=['January','February','March','April','May','June','July','August','September','October','November','December'];$.formatDate.dayNames=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];$.formatDate.patternValue={yy:function(date){return $jQ.toFixedWidth(date.getFullYear(),2);},yyyy:function(date){return date.getFullYear().toString();},MMMM:function(date){return $.formatDate.monthNames[date.getMonth()];},MMM:function(date){return $.formatDate.monthNames[date.getMonth()].substr(0,3);},MM:function(date){return $jQ.toFixedWidth(date.getMonth()+1,2);},M:function(date){return date.getMonth()+1;},dd:function(date){return $jQ.toFixedWidth(date.getDate(),2);},d:function(date){return date.getDate();},EEEE:function(date){return $.formatDate.dayNames[date.getDay()];},EEE:function(date){return $.formatDate.dayNames[date.getDay()].substr(0,3);},HH:function(date){return $jQ.toFixedWidth(date.getHours(),2);},H:function(date){return date.getHours();},hh:function(date){var hours=date.getHours();return $jQ.toFixedWidth(hours>12?hours-12:hours,2);},h:function(date){return date.getHours()%12;},mm:function(date){return $jQ.toFixedWidth(date.getMinutes(),2);},m:function(date){return date.getMinutes();},ss:function(date){return $jQ.toFixedWidth(date.getSeconds(),2);},s:function(date){return date.getSeconds();},S:function(date){return $jQ.toFixedWidth(date.getMilliseconds(),3);},a:function(date){return date.getHours()<12?'AM':'PM';}};})(jQuery);