/* This file was compressed using sharpNet performance and health module. http://www.tiagodherbe.eu */ 
(function(JQ){jQuery.extend({trace:function(msg,isDebug){if(isDebug===false)return;if((typeof(Debug)!=="undefined")&&Debug.writeln){Debug.writeln(msg);}
if(window.console&&window.console.log){window.console.log(msg);}
if(window.opera){window.opera.postError(msg);}
if(window.debugService){window.debugService.trace(msg);}},highlightAccessKeys:function(options){JQ(function(){var requiresHighlighting,requiresShiftAlt,accessKeysHighlighted,accessKeyPopups,accessKeyPopupFields,settings;requiresHighlighting=!/opera/.test(navigator.userAgent);if(!requiresHighlighting)return;requiresShiftAlt=JQ.browser.mozilla;accessKeysHighlighted=false;accessKeyPopups=[];accessKeyPopupFields=[];settings=JQ.extend({debug:false,highlightClass:"akh__highlighted",popupClass:"akh__popup",highlightMode:"popup",accessKeyTag:"em",offsets:{label:{left:-20,top:2},button:{left:-3,top:-3},anchor:{left:2,top:9},text:{left:-3,top:-3},other:{left:-3,top:-3}}},options);var isSelectorMatch=function(element,selector){return JQ(element).filter(selector).length==1;};var getOffset=function(element){if(isSelectorMatch(element,"label")){return settings.offsets.label;}else if(isSelectorMatch(element,":button, :submit, :reset, :image")){return settings.offsets.button;}else if(isSelectorMatch(element,"a")){return settings.offsets.anchor;}else if(isSelectorMatch(element,":text, textarea")){return settings.offsets.text;}else{return settings.offsets.other;};};var getPopupLocation=function(element){var popupLocation=JQ(element).offset();var offset=getOffset(element);popupLocation.left=popupLocation.left+offset.left;popupLocation.top=popupLocation.top+offset.top;return popupLocation;};var createPopup=function(field,accessKey){var popupLocation=getPopupLocation(field);var popup=JQ(document.createElement("div")).text(accessKey).css("left",popupLocation.left).css("top",popupLocation.top).addClass(settings.popupClass).appendTo("body").get(0);accessKeyPopups.push(popup);accessKeyPopupFields.push(field);return popup;};var clearPopups=function(){JQ(accessKeyPopups).remove();accessKeyPopups=[];accessKeyPopupFields=[];};var insertAccessKeyTags=function(){JQ("label[for], label[accesskey]").each(function(){var relatedFieldId="#"+JQ(this).attr("for");var accessKey=JQ.trim(relatedFieldId!=="#"?JQ(relatedFieldId).attr("accesskey"):"");if(typeof(accessKey)==="undefined"||accessKey===""){accessKey=JQ(this).attr("accesskey");}
if(typeof(accessKey)==="undefined"||accessKey==="")return true;var labelHtml=JQ(this).html();var accessKeyIndex=labelHtml.toUpperCase().indexOf(accessKey.toUpperCase());if(accessKeyIndex<0)return true;var accessKeyMarkup="<"+settings.accessKeyTag+">"+labelHtml.substr(accessKeyIndex,1)+"</"+settings.accessKeyTag+">";var newLabelHtmlLeft=labelHtml.substring(0,accessKeyIndex);var newLabelHtmlRight=labelHtml.substr(accessKeyIndex+1);var newLabelHtml=newLabelHtmlLeft+accessKeyMarkup+newLabelHtmlRight;if(labelHtml.indexOf(accessKeyMarkup)<0)JQ(this).html(newLabelHtml);});};var createPopups=function(){if(settings.highlightMode=="popup"){clearPopups();var accessKeyPopupFormFields=[];JQ("label > "+settings.accessKeyTag).each(function(){var text=JQ(this).text();var label=JQ(this).parent();var formField=JQ("#"+label.attr("htmlFor"));var accessKey=formField.attr("accessKey")!=""?formField.attr("accessKey"):label.attr("accessKey");if(text.toUpperCase()==accessKey.toUpperCase()){createPopup(label[0],accessKey);}
accessKeyPopupFormFields.push(formField[0]);});JQ("a[href][accesskey], textarea[accesskey], input[accesskey]").each(function(){if(JQ.inArray(this,accessKeyPopupFormFields)===-1){createPopup(this,this.accessKey);}});}};var refreshPopups=function(){clearPopups();createPopups();};var doHighlightAccessKeys=function(highlight){if(settings.highlightMode==="popup"){var i=0;JQ.each(accessKeyPopups,function(){var field=accessKeyPopupFields[i];i++;var popupLocation=getPopupLocation(field);JQ(this).css("left",popupLocation.left).css("top",popupLocation.top).toggle(highlight);});}else if(settings.highlightMode==="toggleClass"){JQ("label > "+settings.accessKeyTag).each(function(){var text=JQ(this).text();var label=JQ(this).parent();var formField=JQ("#"+label.attr("htmlFor"));var accessKey=formField.attr("accessKey")!==""?formField.attr("accessKey"):label.attr("accessKey");if(text.toUpperCase()===accessKey.toUpperCase()){JQ(this).toggleClass(settings.highlightClass,highlight);}});}};var highlightAccessKeys=function(){doHighlightAccessKeys(true);};var unhighlightAccessKeys=function(){doHighlightAccessKeys(false);};JQ(document).keydown(function(e){JQ.trace("AccessKeyHighlighter document.keyDown: keyCode="+e.keyCode+", altKey="+e.altKey+", shiftKey="+e.shiftKey,settings.debug);if(!accessKeysHighlighted&&((e.keyCode==18&&!requiresShiftAlt)||(e.keyCode==16&&e.altKey&&requiresShiftAlt)||(e.keyCode==18&&e.shiftKey&&requiresShiftAlt))){highlightAccessKeys();accessKeysHighlighted=true;}}).keyup(function(e){JQ.trace("AccessKeyHighlighter document.keyUp: keyCode="+e.keyCode+", altKey="+e.altKey+", shiftKey="+e.shiftKey,settings.debug);if(accessKeysHighlighted){unhighlightAccessKeys();accessKeysHighlighted=false;}});JQ(window).resize(function(e){JQ.trace("resize event",settings.debug);if(accessKeysHighlighted&&settings.highlightMode=="popup"){unhighlightAccessKeys();accessKeysHighlighted=false;}}).blur(function(e){JQ.trace("blur event",settings.debug);if(accessKeysHighlighted){unhighlightAccessKeys();accessKeysHighlighted=false;}}).focus(function(e){JQ.trace("focus event",settings.debug);if(accessKeysHighlighted){unhighlightAccessKeys();accessKeysHighlighted=false;}});insertAccessKeyTags();createPopups();});JQ(window).unload(function(){JQ(document).unbind();JQ(window).unbind();});}});})(jQuery);JQ(function(){JQ.highlightAccessKeys();});