function jshGetEvent(A){if((!A)&&window.event){return window.event}return A}function jshGetSourceElement(B){var A=null;if(!B){B=jshGetEvent(B)}if(B&&B.srcElement){A=B.srcElement}else{if(B&&B.target){A=B.target}else{A=null}}return A}function jshIsEmpty(A){if(A){if((A.length>0)&&(A!="undefined")){return false}}return true}function jshIsEmptyTrim(A){if(A){A=jshTrim(A)}return jshIsEmpty(A)}function jshIsNumeric(B){var D="0123456789.";var C=true;var A;for(i=0;i<B.length&&C==true;i++){A=B.charAt(i);if(D.indexOf(A)==-1){C=false}}return C}function jshIsNonEmpty(A){return(!jshIsEmpty(A))}function jshIsNonEmptyTrim(A){return(!jshIsEmptyTrim(A))}function jshTrim(A){if(A.replace){A=A.replace(/^\s+|\s+$/g,"")}return A}function jshGetElementBy(B,A){if(B&&A){return $(B).getElementsBySelector(A.toLowerCase())}return null}function jshGetFirstElementBy(C,B){if(C&&B){var A=jshGetElementBy(C,B);if(A&&A.length>0){return A[0]}}return null}function jshGetFirstFormElement(A){return jshGetFirstElementBy(A,"form")}function jshRemoveAllElementsBy(C,B){var D=jshGetElementBy(C,B);if(D){for(var A=0;A<D.length;A++){C.removeChild(D[A])}}}function jshGetSelectedValue(A){if(A&&A.options){return A.options[A.selectedIndex].value}return""}function jshSetOpacity(B,A){if(B){if(A>1){A=1}else{if(A<0){A=0}}B.style.opacity=A;B.style.MozOpacity=A;B.style.KhtmlOpacity=A;B.style.filter="alpha(opacity="+Math.round(A*100)+")";B.jshOpacity=A}}function jshClearOpacity(A){if(A){A.style.opacity="";A.style.MozOpacity="";A.style.KhtmlOpacity="";A.style.filter="";A.jshOpacity=null}}function jshSetFloat(A,B){if(A){A.style.cssFloat=B;A.style.styleFloat=B}}function Static_jshFadeElement(B,E,A,D){if(B&&E&&(A==B.jshFadeDir)){var C=B.jshOpacity;if(A){C+=E}else{C-=E}jshSetOpacity(B,C);if(A==B.jshFadeDir){if((A&&(B.jshOpacity<B.jshFinalyOpacity))||(!A&&(B.jshOpacity>B.jshFinalyOpacity))){setTimeout(function(){Static_jshFadeElement(B,E,A,D)},D)}else{jshSetOpacity(B,B.jshFinalyOpacity)}}}}function jshFadeElement(D,G,B,A,F){if(D){if(!F){F=(A)?1:0}if(D.jshOpacity==null){D.jshOpacity=(A)?0:1}D.jshFinalyOpacity=F;D.jshFadeDir=A;var E=D;var C=0;setTimeout(function(){Static_jshFadeElement(E,1/B,A,G*1/B)},G/B)}}function jshSetBackgroundPosition(B,A,C){if(B&&B.style){if(!A||(A==NaN)){A=0}if(!C||(C==NaN)){C=0}if(B.style.backgroundPositionX){B.style.backgroundPositionX=A+"px";B.style.backgroundPositionY=C+"px"}else{B.style.backgroundPosition=A+"px "+C+"px"}}}function jshGetBackgroundPosition(B){var C=new Array();if(B&&B.style){if(B.style.backgroundPositionX){C[0]=parseInt(B.style.backgroundPositionX);C[1]=parseInt(B.style.backgroundPositionY)}else{var A=B.style.backgroundPosition.split(" ");C[0]=parseInt(A[0]);C[1]=parseInt(A[1])}}if((!C[0])||(C[0]==NaN)){C[0]=0}if((!C[1])||(C[1]==NaN)){C[1]=0}return C}function jshGetWindowSize(){var A=$(new Array());if(document.clientHeight){A[0]=document.clientWidth;A[1]=document.clientHeight}else{if(document.documentElement&&document.documentElement.clientHeight){A[0]=document.documentElement.clientWidth;A[1]=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){A[0]=document.body.clientWidth;A[1]=document.body.clientHeight}}}return A}function jshToParamString(A,C){var D="";if(!C){C=""}if(A){for(var B in A){if(typeof (A[B])!="object"){if(D.length>0){D+="&"}D+=C+B.gsub(" ","")+"="+A[B]}}}return D}function jshStripParameter(B,D){if(B.indexOf("?"+D+"=")>-1||B.indexOf("&"+D+"=")>-1){var E=(B.indexOf("?"+D+"=")>-1)?"?":"&";var C=B.substring(0,B.indexOf(E+D+"=")+1);var A=B.substring(B.indexOf(E+D+"=")+1);if(A.indexOf("&")>-1){return C+A.substring(A.indexOf("&")+1)}else{return C.substring(0,C.length-1)}}else{return B}}function jshAppendParameter(B,C,D,A){if(B){B=jshStripParameter(B,C);if(B.indexOf("?")>=0){B+="&"}else{B+="?"}B+=C+"="+D;if(A==true){B=jshAppendParameter(B,"rand",jshRound(Math.random(),4))}}return B}function jshObjectArrayToParamString(C,D){var E="";if(C&&(C.length>0)){var A=null;for(var B=0;B<C.length;B++){A=C[B];if(A){if(B>0){E+="&"}E+=jshToParamString(A,D+B)}}}return E}function jshEvalJSON(F,A){var E=null;try{E=F.toString().evalJSON(true)}catch(D){}if((A>=0)&&E){if(E.length){for(var C=0;C<E.length;C++){for(var B in E[C]){if(E[C][B].toString().isJSON()){try{E[C][B]=jshEvalJSON(E[C][B],A-1)}catch(D){}}}}}else{for(var B in E){if(E[B].toString().isJSON()){E[B]=jshEvalJSON(E[B],A-1)}}}}return E}function jshConstructMockEvent(A){var B=new Object();B.srcElement=A;return B}function jshConstrcutMockResponse(B,A){if(!A){A=-1}if(!B){B="Default Mock Response message!"}var C=new Object();C.message=B;C.statusCode=A;return C}function jshBorderOffset(A,C){var B=$([0,0]);if(A){B[0]=parseInt(A.getStyle("borderLeftWidth"))+parseInt(A.getStyle("borderRightWidth"));B[1]=parseInt(A.getStyle("borderBottomWidth"))+parseInt(A.getStyle("borderTopWidth"));if((!((B[0]<0)||(B[0]>=0))&&(C!=null))){B[0]=C[0]}if((!((B[1]<0)||(B[1]>=0))&&(C!=null))){B[1]=C[1]}}return B}function jshBorderOffsets(C,E){var D=$([0,0]);if(C&&C.length){var B;for(var A=0;A<C.length;A++){B=jshBorderOffset(C[A],E);D[0]+=B[0];D[1]+=B[1]}}return D}function jshMarginOffset(A,C){var B=$([0,0]);if(A){B[0]=parseInt(A.getStyle("marginLeft"))+parseInt(A.getStyle("marginRight"));B[1]=parseInt(A.getStyle("marginBottom"))+parseInt(A.getStyle("marginTop"));if((B[0]==null)||(isNaN(B[0]))){if(C&&(C[0]>=0)){B[0]=C[0]}}if((B[1]==null)||(isNaN(B[1]))){if(C&&(C[1]>=0)){B[1]=C[1]}}}return B}var jshOverlayPosition={TopLeft:0,TopRight:1,BottomLeft:2,BottomRight:3,Center:4};function jshOverlay(I,D,G,F,E){if(I&&D){var C=Position.cumulativeOffset(D);var H=$(D).getDimensions();var B=$(I).getDimensions();var A=jshBorderOffset(D);if(A[0]&&A[1]){A[0]/=2;A[1]/=2}else{A[0]=0;A[1]=0}switch(G){case jshOverlayPosition.TopLeft:I.style.top=(C[1]+E+A[1])+"px";I.style.left=(C[0]+F+A[0])+"px";break;case jshOverlayPosition.TopRight:I.style.top=(C[1]+E+A[1])+"px";I.style.left=(C[0]+H.width-B.width+F-A[0])+"px";break;case jshOverlayPosition.BottomLeft:I.style.top=(C[1]+H.height-B.height+E+A[1])+"px";I.style.left=(C[0]+F+A[0])+"px";break;case jshOverlayPosition.BottomRight:I.style.top=(C[1]+H.height-B.height+E-A[1])+"px";I.style.left=(C[0]+H.width-B.width+F-A[0])+"px";default:break}}}function jshIsVisible(A){var B=false;if(A&&A.style){if(A.style.visibility=="hidden"||A.style.display=="none"){B=false}else{B=true}}return B}function jshSetOptionSelected(A,C){if(A&&A.options&&C){for(var B=0;B<A.options.length;B++){if(A.options[B].value==C){A.options[B].selected=true}else{A.options[B].selected=false}}}}function jshGetChildIndexWithin(D,A,F){if(D&&A&&F){var E;var B=0;for(var C=0;C<D.childNodes.length;C++){E=D.childNodes[C];if(E){if(jshIsVisible(E)){if(Position.within(E,A,F)){return B}else{B++}}}}}return -1}function jshGetClosestVisbleChildNode(C,A,B){var D=null;if(C&&A&&C.childNodes&&(C.childNodes.length>A)){if(jshIsVisible(C.childNodes[A])){D=C.childNodes[A]}else{if(B){D=jshGetClosestVisbleChildNode(C,A+1,B)}else{D=jshGetClosestVisbleChildNode(C,A-1,B)}}}return D}function jshGetBrowserWindowSize(B){B=B?B:window;var C=B.innerWidth||(B.document.documentElement.clientWidth||B.document.body.clientWidth);var A=B.innerHeight||(B.document.documentElement.clientHeight||B.document.body.clientHeight);return[C,A]}function jshRegisterScrollWheelEvent(A,B){if(A&&B){A.onmousewheel=B;if(A.addEventListener){A.addEventListener("DOMMouseScroll",B,false)}}}function jshGetMousePositionFromScrollEvent(B,E){var D=$(new Array());if(B){if(B.clientX){D[0]=B.clientX;D[1]=B.clientY}else{if(B.screenX){D[0]=B.screenX;D[1]=B.screenY}else{if(B.x){D[0]=B.x;D[1]=B.y}}}}if(!jshIsIE6Or7()){var A=E;if(!A){A=jshGetSourceElement(B)}var C=Position.page(A);D[0]+=C[0];D[1]+=C[1]}return D}function jshIsFF3(){if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){var A=new Number(RegExp.$1);if(A>=3){return true}}return false}function jshScrolledUp(A){var B=false;if(A){var C=0;if(A.wheelDelta){C=A.wheelDelta/120}else{if(A.detail){C=A.detail/-3}}if(C>0){B=true}}return B}function jshScrolledDown(A){return(!jshScrolledUp(A))}function jshIsIE6Or7(){if(navigator&&navigator.userAgent){if((navigator.userAgent.indexOf("MSIE 6")>=0)||(navigator.userAgent.indexOf("MSIE 7")>=0)){return true}}return false}function jshCalculateProportionalDimensions(D,E){var A=$(new Array());var B=(E[0]>E[1])?0:1;var C=(B==0)?1:0;var D=D[C]/D[B];A[B]=E[B];A[C]=Math.round(A[B]*D);if(A[C]>E[C]){D=A[B]/A[C];A[C]=E[C];A[B]=Math.round(A[C]*D)}return A}function jshRound(C,B){if(C){if(!B){B=1}var A=Math.pow(10,B);C=Math.round(C*A)/A}return C}function jshTruncate(B,A,C){var D="";if(!C){C="&#133;"}if(B){D=B;if(B.length>A){D=B.substring(0,A);D+=C}}return D}function jshEqualsAny(A,C){if(A&&C){for(var B=0;B<C.length;B++){if(C[B]){if(C[B].toLowerCase()==A.toLowerCase()){return true}}}}return false}function jshDefaultEmpty(B,A){if(!A){A=""}if(!B){B=A}return B}function jshForceSpaces(F,D){var E="";if(F){if(!D||(D<1)){D=20}var B=0;var C;var A;while(B<F.length){A=((B+D)>F.length)?F.length:(B+D);C=F.substring(B,A);if(C.indexOf(" ")<0){C+=" "}E+=C;B=A}}return E}function jshGetExtensionFromUrl(A,H,C){var E="";if(A){var I="";var D=A.lastIndexOf(".");if(D>=0){I=A.substring(D+1)}var G=I.indexOf("&");var F=I.indexOf("?");if((G>=0)||(F>=0)){if((F<G)&&(F>=0)){G=F}I=I.substring(0,G)}I=jshTrim(I);if(!jshIsEmpty(I)&&H&&H.length>0){for(var B=0;B<H.length;B++){if(I==H[B]){E=I;break}}}else{E=I}if(jshIsEmpty(E)){E=C}}return E}function jshGetAfterLastSlashFromUrl(A){var B="";A=jshGetCleanUrl(A);if(A){var C=A.lastIndexOf("/");if(C>=0){last=A.substring(C+1)}last=jshTrim(last);if(!jshIsEmpty(last)){B=last}}return B}function jshIndexOfNode(C){var B=C.up();for(var A=0;A<B.childNodes.length;A++){if(B.childNodes[A]==C){return A}}return -1}function jshGetCleanUrl(B){var A=B+"";if(A.indexOf("?")>0){A=A.substring(0,A.indexOf("?"))}if(A.indexOf(";jsessionid")>0){A=A.substring(0,A.indexOf(";jsessionid"))}return A};