/* Covered under MIT License: http://www.opensource.org/licenses/mit-license.php */
//hoverIntent
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode}catch(e){p=this}}if(p==this){return false}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.mouseover(handleHover).mouseout(handleHover)}})(jQuery);
//corner
(function(C){var E=(function(){if(!C.browser.msie){return false}var H=document.createElement("div");try{H.style.setExpression("width","0+0")}catch(G){return false}return true})();function D(G,H){return parseInt(C.css(G,H))||0}function B(G){var G=parseInt(G).toString(16);return(G.length<2)?"0"+G:G}function F(I){for(;I&&I.nodeName.toLowerCase()!="html";I=I.parentNode){var G=C.css(I,"backgroundColor");if(G=="rgba(0, 0, 0, 0)"){continue}if(G.indexOf("rgb")>=0){var H=G.match(/\d+/g);return"#"+B(H[0])+B(H[1])+B(H[2])}if(G&&G!="transparent"){return G}}return"#ffffff"}function A(I,G,H){switch(I){case"round":return Math.round(H*(1-Math.cos(Math.asin(G/H))));case"cool":return Math.round(H*(1+Math.cos(Math.asin(G/H))));case"sharp":return Math.round(H*(1-Math.cos(Math.acos(G/H))));case"bite":return Math.round(H*(Math.cos(Math.asin((H-G-1)/H))));case"slide":return Math.round(H*(Math.atan2(G,H/G)));case"jut":return Math.round(H*(Math.atan2(H,(H-G-1))));case"curl":return Math.round(H*(Math.atan(G)));case"tear":return Math.round(H*(Math.cos(G)));case"wicked":return Math.round(H*(Math.tan(G)));case"long":return Math.round(H*(Math.sqrt(G)));case"sculpt":return Math.round(H*(Math.log((H-G-1),H)));case"dog":return(G&1)?(G+1):H;case"dog2":return(G&2)?(G+1):H;case"dog3":return(G&3)?(G+1):H;case"fray":return(G%2)*H;case"notch":return H;case"bevel":return G+1}}C.fn.corner=function(K){if(this.length==0){if(!C.isReady&&this.selector){var R=this.selector,O=this.context;C(function(){C(R,O).corner(K)})}return this}K=(K||"").toLowerCase();var H=/keep/.test(K);var L=((K.match(/cc:(#[0-9a-f]+)/)||[])[1]);var P=((K.match(/sc:(#[0-9a-f]+)/)||[])[1]);var J=parseInt((K.match(/(\d+)px/)||[])[1])||10;var Q=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var M=((K.match(Q)||["round"])[0]);var N={T:0,B:1};var G={TL:/top|tl/.test(K),TR:/top|tr/.test(K),BL:/bottom|bl/.test(K),BR:/bottom|br/.test(K)};if(!G.TL&&!G.TR&&!G.BL&&!G.BR){G={TL:1,TR:1,BL:1,BR:1}}var I=document.createElement("div");I.style.overflow="hidden";I.style.height="1px";I.style.backgroundColor=P||"transparent";I.style.borderStyle="solid";return this.each(function(W){var T={T:parseInt(C.css(this,"paddingTop"))||0,R:parseInt(C.css(this,"paddingRight"))||0,B:parseInt(C.css(this,"paddingBottom"))||0,L:parseInt(C.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined){this.style.zoom=1}if(!H){this.style.border="none"}I.style.borderColor=L||F(this.parentNode);var Y=C.curCSS(this,"height");for(var U in N){var Z=N[U];if((Z&&(G.BL||G.BR))||(!Z&&(G.TL||G.TR))){I.style.borderStyle="none "+(G[U+"R"]?"solid":"none")+" none "+(G[U+"L"]?"solid":"none");var a=document.createElement("div");C(a).addClass("jquery-corner");var S=a.style;Z?this.appendChild(a):this.insertBefore(a,this.firstChild);if(Z&&Y!="auto"){if(C.css(this,"position")=="static"){this.style.position="relative"}S.position="absolute";S.bottom=S.left=S.padding=S.margin="0";if(E){S.setExpression("width","this.parentNode.offsetWidth")}else{S.width="100%"}}else{if(!Z&&C.browser.msie){if(C.css(this,"position")=="static"){this.style.position="relative"}S.position="absolute";S.top=S.left=S.right=S.padding=S.margin="0";if(E){var b=D(this,"borderLeftWidth")+D(this,"borderRightWidth");S.setExpression("width","this.parentNode.offsetWidth - "+b+'+ "px"')}else{S.width="100%"}}else{S.margin=!Z?"-"+T.T+"px -"+T.R+"px "+(T.T-J)+"px -"+T.L+"px":(T.B-J)+"px -"+T.R+"px -"+T.B+"px -"+T.L+"px"}}for(var V=0;V<J;V++){var c=Math.max(0,A(M,V,J));var X=I.cloneNode(false);X.style.borderWidth="0 "+(G[U+"R"]?c:0)+"px 0 "+(G[U+"L"]?c:0)+"px";Z?a.appendChild(X):a.insertBefore(X,a.firstChild)}}}})};C.fn.uncorner=function(){C("div.jquery-corner",this).remove();return this}})(jQuery);
//jquery.greyBoxExtend.js
greyBoxInitialized=false;greyBoxShowing=false;greyBoxHoverIntentConfig={sensitivity:3,interval:200,over:function(){},timeout:500,out:function(){}};greyBoxCloseFunction=function(){};jQuery.ShowGreyBox=function(C,B,A){if(greyBoxShowing){return }greyBoxShowing=true;greyBoxSettings=jQuery.extend({height:"auto",width:550,onGreyBoxShow:function(){},onGreyBoxExit:function(){},onGreyBoxError:function(){},attachGreyBoxElementsTo:"#sidebar",localElementSelector:""},B);var D=jQuery.extend({url:C,type:"post",dataType:"html",cache:false,success:function(F){GreyBox.success(F)},error:function(F,H,G){greyBoxSettings.onGreyBoxError()}},A);if(!greyBoxInitialized){try{GreyBox.initialize()}catch(E){}}greyBoxCloseFunction=greyBoxSettings.onGreyBoxExit;GreyBox.showWindow(D);greyBoxSettings.onGreyBoxShow()};var GreyBox={initialize:function(){greyBoxInitialized=true;if(typeof document.body.style.maxHeight==="undefined"){jQuery(greyBoxSettings.attachGreyBoxElementsTo).append('<iframe id="greyBoxHideSelect"></iframe>')}jQuery(greyBoxSettings.attachGreyBoxElementsTo).append('<div id="greyBoxOverlay"></div><div id="greyBoxWindow"><div id="greyBoxClose"><div id="greyBoxCloseImg"></div> Close</div><div id="greyBoxContent"></div></div>');jQuery(greyBoxSettings.attachGreyBoxElementsTo).css({"z-index":0});jQuery(window).resize(GreyBox.position);jQuery(window).scroll(GreyBox.position);jQuery("#greyBoxOverlay,#greyBoxClose").click(function(){GreyBox.close()});document.onkeyup=function(A){if(A==null){keycode=event.keyCode}else{keycode=A.which}if(keycode==27){GreyBox.close()}}},close:function(){jQuery("#greyBoxWindow,#greyBoxOverlay").slideUp();if(typeof document.body.style.maxHeight==="undefined"){jQuery("#greyBoxHideSelect").hide()}greyBoxShowing=false;greyBoxCloseFunction()},position:function(){if(greyBoxShowing){var B=greyBoxSettings.width;var A=greyBoxSettings.height;jQuery("#greyBoxWindow").css({width:B+"px",height:A});GreyBox.centerWindow()}},showWindow:function(A){if(greyBoxSettings.localElementSelector==""){jQuery.ajax(A);if(jQuery("#greyBoxWindow").css("height")!=greyBoxSettings.height){jQuery("#greyBoxWindow").css("height",greyBoxSettings.height)}}else{GreyBox.success(jQuery(greyBoxSettings.localElementSelector).html());GreyBox.position();greyBoxSettings.onGreyBoxShow()}},centerWindow:function(){jQuery("#greyBoxWindow").css("marginLeft","-"+parseInt((greyBoxSettings.width/2),10)+"px");if(!(jQuery.browser.msie&&jQuery.browser.version<7)){curTop=GreyBox.windowHeight();if(curTop!=0){jQuery("#greyBoxWindow").css("marginTop","-"+curTop+"px")}}},windowHeight:function(){curTop=(parseInt(document.getElementById("greyBoxWindow").offsetHeight,10)/2);return curTop},success:function(A){jQuery("#greyBoxContent").html(A);jQuery("#greyBoxOverlay").show();jQuery("#greyBoxHideSelect").show();jQuery("#greyBoxWindow").show();greyBoxShowing=true;GreyBox.centerWindow()}};jQuery.each(GreyBox,function(A){jQuery.fn[A]=this});
//cluetip
(function(F){F.cluetip={version:"1.0.4"};var J,I,H,E,G,B,K,D;F.fn.cluetip=function(M,L){if(typeof M=="object"){L=M;M=null}if(M=="destroy"){return this.unbind(".cluetip")}return this.each(function(l){var T=this,W=F(this);var h=F.extend(true,{},F.fn.cluetip.defaults,L||{},F.metadata?W.metadata():F.meta?W.data():{});var P=false;var a=+h.cluezIndex;W.data("thisInfo",{title:T.title,zIndex:a});var t=false,s=0;if(!F("#cluetip").length){F(['<div id="cluetip">','<div id="cluetip-outer">','<h3 id="cluetip-title"></h3>','<div id="cluetip-inner"></div>',"</div>",'<div id="cluetip-extra"></div>','<div id="cluetip-arrows" class="cluetip-arrows"></div>',"</div>"].join(""))[C](A).hide();J=F("#cluetip").css({position:"absolute"});H=F("#cluetip-outer").css({position:"relative",zIndex:a});I=F("#cluetip-inner");E=F("#cluetip-title");G=F("#cluetip-arrows");B=F('<div id="cluetip-waitimage"></div>').css({position:"absolute"}).insertBefore(J).hide()}var k=(h.dropShadow)?+h.dropShadowSteps:0;if(!K){K=F([]);for(var w=0;w<k;w++){K=K.add(F("<div></div>").css({zIndex:a-1,opacity:0.1,top:1+w,left:1+w}))}K.css({position:"absolute",backgroundColor:"#000"}).prependTo(J)}var f=W.attr(h.attribute),S=h.cluetipClass;if(!f&&!h.splitTitle&&!M){return true}if(h.local&&h.localPrefix){f=h.localPrefix+f}if(h.local&&h.hideLocal){F(f+":first").hide()}var g=parseInt(h.topOffset,10),c=parseInt(h.leftOffset,10);var b,u,Y=isNaN(parseInt(h.height,10))?"auto":(/\D/g).test(h.height)?h.height:h.height+"px";var N,U,m,AA,o,v;var Z=parseInt(h.width,10)||275,x=Z+(parseInt(J.css("paddingLeft"),10)||0)+(parseInt(J.css("paddingRight"),10)||0)+k,d=this.offsetWidth,V,n,AB,p,O;var r;var j=(h.attribute!="title")?W.attr(h.titleAttribute):"";if(h.splitTitle){if(j==undefined){j=""}r=j.split(h.splitTitle);j=r.shift()}if(h.escapeTitle){j=j.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;")}var R;function z(){return false}var X=function(AC){if(!h.onActivate(W)){return false}t=true;J.removeClass().css({width:Z});if(f==W.attr("href")){W.css("cursor",h.cursor)}if(h.hoverClass){W.addClass(h.hoverClass)}U=m=W.offset().top;V=W.offset().left;p=AC.pageX;o=AC.pageY;if(T.tagName.toLowerCase()!="area"){N=F(document).scrollTop();O=F(window).width()}if(h.positionBy=="fixed"){n=d+V+c;J.css({left:n})}else{n=(d>V&&V>x)||V+d+x+c>O?V-x-c:d+V+c;if(T.tagName.toLowerCase()=="area"||h.positionBy=="mouse"||d+x>O){if(p+20+x>O){J.addClass(" cluetip-"+S);n=(p-x-c)>=0?p-x-c-parseInt(J.css("marginLeft"),10)+parseInt(I.css("marginRight"),10):p-(x/2)}else{n=p+c}}var AD=n<0?AC.pageY+g:AC.pageY;J.css({left:(n>0&&h.positionBy!="bottomTop")?n:(p+(x/2)>O)?O/2-x/2:Math.max(p-(x/2),0),zIndex:W.data("thisInfo").zIndex});G.css({zIndex:W.data("thisInfo").zIndex+1})}u=F(window).height();if(M){if(typeof M=="function"){M=M(T)}I.html(M);q(AD)}else{if(r){var AF=r.length;I.html(r[0]);if(AF>1){for(var AE=1;AE<AF;AE++){I.append('<div class="split-body">'+r[AE]+"</div>")}}q(AD)}else{if(!h.local&&f.indexOf("#")!=0){if(/\.(jpe?g|tiff?|gif|png)$/i.test(f)){I.html('<img src="'+f+'" alt="'+j+'" />');q(AD)}else{if(P&&h.ajaxCache){I.html(P);q(AD)}else{var AJ=h.ajaxSettings.beforeSend,AG=h.ajaxSettings.error,AH=h.ajaxSettings.success,AM=h.ajaxSettings.complete;var AL={cache:false,url:f,beforeSend:function(i){if(AJ){AJ.call(T,i,J,I)}H.children().empty();if(h.waitImage){B.css({top:o+20,left:p+20,zIndex:W.data("thisInfo").zIndex-1}).show()}},error:function(i,AN){if(t){if(AG){AG.call(T,i,AN,J,I)}else{I.html("<i>sorry, the contents could not be loaded</i>")}}},success:function(i,AN){P=h.ajaxProcess.call(T,i);if(t){if(AH){AH.call(T,i,AN,J,I)}I.html(P)}},complete:function(i,AN){if(AM){AM.call(T,i,AN,J,I)}D=F("#cluetip-inner img").length;if(D&&!F.browser.opera){F("#cluetip-inner img").bind("load error",function(){D--;if(D<1){B.hide();if(t){q(AD)}}})}else{B.hide();if(t){q(AD)}}}};var AI=F.extend(true,{},h.ajaxSettings,AL);F.ajax(AI)}}}else{if(h.local){var AK=F(f+(/#\S+$/.test(f)?"":":eq("+l+")")).clone(true).show();I.html(AK);q(AD)}}}}};var q=function(AD){J.addClass("cluetip-"+S);if(h.truncate){var AE=I.text().slice(0,h.truncate)+"...";I.html(AE)}function i(){}j?E.show().html(j):(h.showTitle)?E.show().html("&nbsp;"):E.hide();if(h.sticky){var AC=F('<div id="cluetip-close"><a href="#">'+h.closeText+"</a></div>");(h.closePosition=="bottom")?AC.appendTo(I):(h.closePosition=="title")?AC.prependTo(E):AC.prependTo(I);AC.bind("click.cluetip",function(){e();return false});if(h.mouseOutClose){J.bind("mouseleave.cluetip",function(){e()})}else{J.unbind("mouseleave.cluetip")}}var AF="";H.css({zIndex:W.data("thisInfo").zIndex,overflow:Y=="auto"?"visible":"auto",height:Y});b=Y=="auto"?Math.max(J.outerHeight(),J.height()):parseInt(Y,10);AA=m;v=N+u;if(h.positionBy=="fixed"){AA=m-h.dropShadowSteps+g}else{if((n<p&&Math.max(n,0)+x>p)||h.positionBy=="bottomTop"){if(m+b+g>v&&o-N>b+g){AA=o-b-g;AF="top"}else{AA=o+g;AF="bottom"}}else{if(m+b+g>v){AA=(b>=u)?N:v-b-g}else{if(W.css("display")=="block"||T.tagName.toLowerCase()=="area"||h.positionBy=="mouse"){AA=AD-g}else{AA=m-h.dropShadowSteps}}}}if(AF==""){n<V?AF="left":AF="right"}J.css({top:AA+"px"}).removeClass().addClass("clue-"+AF+"-"+S).addClass(" cluetip-"+S);if(h.arrows){var AG=(m-AA-h.dropShadowSteps);G.css({top:(/(left|right)/.test(AF)&&n>=0&&AG>0)?AG+"px":/(left|right)/.test(AF)?0:""}).show()}else{G.hide()}K.hide();J.hide()[h.fx.open](h.fx.open!="show"&&h.fx.openSpeed);if(h.dropShadow){K.css({height:b,width:Z,zIndex:W.data("thisInfo").zIndex-1}).show()}if(F.fn.bgiframe){J.bgiframe()}if(h.delayedClose>0){s=setTimeout(e,h.delayedClose)}h.onShow.call(T,J,I)};var y=function(i){t=false;B.hide();if(!h.sticky||(/click|toggle/).test(h.activation)){e();clearTimeout(s)}if(h.hoverClass){W.removeClass(h.hoverClass)}};var e=function(){H.parent().hide().removeClass();h.onHide.call(T,J,I);W.removeClass("cluetip-clicked");if(j){W.attr(h.titleAttribute,j)}W.css("cursor","");if(h.arrows){G.css({top:""})}};F(document).bind("hideCluetip",function(i){e()});if((/click|toggle/).test(h.activation)){W.bind("click.cluetip",function(i){if(J.is(":hidden")||!W.is(".cluetip-clicked")){X(i);F(".cluetip-clicked").removeClass("cluetip-clicked");W.addClass("cluetip-clicked")}else{y(i)}this.blur();return false})}else{if(h.activation=="focus"){W.bind("focus.cluetip",function(i){X(i)});W.bind("blur.cluetip",function(i){y(i)})}else{W[h.clickThrough?"unbind":"bind"]("click",z);var Q=function(i){if(h.tracking==true){var AD=n-i.pageX;var AC=AA?AA-i.pageY:m-i.pageY;W.bind("mousemove.cluetip",function(AE){J.css({left:AE.pageX+AD,top:AE.pageY+AC})})}};if(F.fn.hoverIntent&&h.hoverIntent){W.hoverIntent({sensitivity:h.hoverIntent.sensitivity,interval:h.hoverIntent.interval,over:function(i){X(i);Q(i)},timeout:h.hoverIntent.timeout,out:function(i){y(i);W.unbind("mousemove.cluetip")}})}else{W.bind("mouseenter.cluetip",function(i){X(i);Q(i)}).bind("mouseleave.cluetip",function(i){y(i);W.unbind("mousemove.cluetip")})}W.bind("mouseenter.cluetip",function(i){W.attr("title","")}).bind("mouseleave.cluetip",function(i){W.attr("title",W.data("thisInfo").title)})}}})};F.fn.cluetip.defaults={width:275,height:"auto",cluezIndex:97,positionBy:"auto",topOffset:15,leftOffset:15,local:false,localPrefix:null,hideLocal:true,attribute:"rel",titleAttribute:"title",splitTitle:"",escapeTitle:false,showTitle:true,cluetipClass:"default",hoverClass:"",waitImage:true,cursor:"help",arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:"hover",clickThrough:false,tracking:false,delayedClose:0,closePosition:"top",closeText:"Close",truncate:0,fx:{open:"show",openSpeed:""},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(L){return true},onShow:function(M,L){},onHide:function(M,L){},ajaxCache:true,ajaxProcess:function(L){L=L.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,"").replace(/<(link|meta)[^>]+>/g,"");return L},ajaxSettings:{dataType:"html"},debug:false};var C="appendTo",A="body";F.cluetip.setup=function(L){if(L&&L.insertionType&&(L.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){C=L.insertionType}if(L&&L.insertionElement){A=L.insertionElement}}})(jQuery);