(function(a){a.extend({_debug$:null,debug:function(c){var b=(a._debug$==true?true:false);a._debug$=(c?true:false);return b},log:function(b){if(a._debug$==true){window.console.debug(b)}}});a.fn.extend({log:function(b){if(a._debug$==true){return this.each(function(){if(typeof b!=="undefined"){a.log(b)}a.log(this)})}}});a(document).ready(function(){var b=a("html").attr("debug");if(b=="true"||b=="false"){a.debug(b=="true"?true:false)}});a(document).ready(function(){if(typeof window.console==="undefined"){function b(g){var h=null;if(typeof g==="undefined"){h="[undefined]"}else{if(typeof g==="boolean"){h=(g?"true":"false")}else{if(typeof g==="number"){h=""+g}else{if(typeof g==="string"){h=g}else{if(typeof g==="function"){h=g}else{if(typeof g==="object"){if(typeof g.nodeType!=="undefined"){if(g.nodeType==1){h="&lt;";h+=g.nodeName.toLowerCase();for(var f=0;f<g.attributes.length;f++){h+=" "+g.attributes[f].nodeName.toLowerCase()+'="'+g.attributes[f].nodeValue+'"'}h+="&gt;"}else{if(g.nodeType==2){h=g.nodeName+'="'+g.nodeValue}else{if(g.nodeType==3){h=g.nodeValue}}}}else{if(typeof g.toJSONString!=="undefined"){h=g.toJSONString()}else{if(typeof g.toString!=="undefined"){h=g.toString()}}}}}}}}}if(h==null){h="[unknown]"}return h}a(document).ready(function(){a("body").append('<div id="jQueryDebug"><ol></ol></div>');a("#jQueryDebug").css("display","none").css("fontFamily","monospace").css("backgroundColor","#ffffff").css("color","#000000").css("padding","10px 0px 10px 0px").css("border","4px solid #666699").css("margin","4px 4px 4px 4px");a("#jQueryDebug ol").css("margin","0px 0px 0px 0px").css("paddingRight","20px")});var e=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];var d=function(f){a("#jQueryDebug").css("display",a._debug$==true?"block":"none");a("#jQueryDebug ol").append("<li>"+b(f)+"</li>").css;a("#jQueryDebug ol li").css("borderBottom","1px solid #cccccc").css("padding","1px 10px 1px 10px")};window.console={};for(var c=0;c<e.length;c++){window.console[e[c]]=d}window.console.jQueryDebug=true}})})(jQuery);var BabelFish=(function(){var a={CALENDAR:"Calendar",CONFIRMACTION:"Confirm action",TABSLOADING:"Tab is loading",SHADOWBOX_OF:"of",SHADOWBOX_LOADING:"loading",SHADOWBOX_CANCEL:"Cancel",SHADOWBOX_NEXT:"Next",SHADOWBOX_PREVIOUS:"Previous",SHADOWBOX_PLAY:"Play",SHADOWBOX_PAUSE:"Pause",SHADOWBOX_CLOSE:"Close",SHADOWBOX_ERROR_SINGLE:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',SHADOWBOX_ERROR_SHARED:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',SHADOWBOX_ERROR_EITHER:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.',RATING_0:"RATING_0",RATING_1:"RATING_1",RATING_2:"RATING_2",RATING_3:"RATING_3",RATING_4:"RATING_4",RATING_5:"RATING_5",RATING_IS_DONE:"RATING_IS_DONE",RATING_DISABLED:"RATING_DISABLED"};return function(b){return a[b]||("Untranslated: "+b)}}());var Assets={Image:function(a){return"http://assets1.youserbase.org/images/"+a}};var GLOBALS={Language:"uk",URLS:{"Dropbox-Refresh":"uk/Dock/Dropbox/Get","Dropbox-Remove":"uk/Dock/Dropbox/Remove","Babelfish-Update":"uk/System/Babelfish/Update","Babelfish-Load":"uk/System/Babelfish/Load","Babelfish-Tell":"uk/System/Babelfish/Tell","Page-Load":"uk/System/Pages/Load"}};json_parse=(function(){var d,b,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},o,l=function(q){throw {name:"SyntaxError",message:q,at:d,text:o}},g=function(q){if(q&&q!==b){l("Expected '"+q+"' instead of '"+b+"'")}b=o.charAt(d);d+=1;return b},f=function(){var r,q="";if(b==="-"){q="-";g("-")}while(b>="0"&&b<="9"){q+=b;g()}if(b==="."){q+=".";while(g()&&b>="0"&&b<="9"){q+=b}}if(b==="e"||b==="E"){q+=b;g();if(b==="-"||b==="+"){q+=b;g()}while(b>="0"&&b<="9"){q+=b;g()}}r=+q;if(isNaN(r)){l("Bad number")}else{return r}},h=function(){var t,s,r="",q;if(b==='"'){while(g()){if(b==='"'){g();return r}else{if(b==="\\"){g();if(b==="u"){q=0;for(s=0;s<4;s+=1){t=parseInt(g(),16);if(!isFinite(t)){break}q=q*16+t}r+=String.fromCharCode(q)}else{if(typeof a[b]==="string"){r+=a[b]}else{break}}}else{r+=b}}}}l("Bad string")},k=function(){while(b&&b<=" "){g()}},c=function(){switch(b){case"t":g("t");g("r");g("u");g("e");return true;case"f":g("f");g("a");g("l");g("s");g("e");return false;case"n":g("n");g("u");g("l");g("l");return null}l("Unexpected '"+b+"'")},m,j=function(){var q=[];if(b==="["){g("[");k();if(b==="]"){g("]");return q}while(b){q.push(m());k();if(b==="]"){g("]");return q}g(",");k()}}l("Bad array")},e=function(){var r,q={};if(b==="{"){g("{");k();if(b==="}"){g("}");return q}while(b){r=h();k();g(":");if(Object.hasOwnProperty.call(q,r)){l('Duplicate key "'+r+'"')}q[r]=m();k();if(b==="}"){g("}");return q}g(",");k()}}l("Bad object")};m=function(){k();switch(b){case"{":return e();case"[":return j();case'"':return h();case"-":return f();default:return b>="0"&&b<="9"?f():c()}};return function(t,r){var q;o=t;d=0;b=" ";q=m();k();if(b){l("Syntax error")}return typeof r==="function"?(function s(y,x){var w,u,z=y[x];if(z&&typeof z==="object"){for(w in z){if(Object.hasOwnProperty.call(z,w)){u=s(z,w);if(u!==undefined){z[w]=u}else{delete z[w]}}}}return r.call(y,x,z)}({"":q},"")):q}}());if(typeof jQuery=="undefined"){throw"Unable to load Shadowbox, jQuery library not found"}var Shadowbox={};Shadowbox.lib={adapter:"jquery",getStyle:function(b,a){return jQuery(b).css(a)},setStyle:function(c,b,d){if(typeof b!="object"){var a={};a[b]=d;b=a}jQuery(c).css(b)},get:function(a){return(typeof a=="string")?document.getElementById(a):a},remove:function(a){jQuery(a).remove()},getTarget:function(a){return a.target},getPageXY:function(a){return[a.pageX,a.pageY]},preventDefault:function(a){a.preventDefault()},keyCode:function(a){return a.keyCode},addEvent:function(c,a,b){jQuery(c).bind(a,b)},removeEvent:function(c,a,b){jQuery(c).unbind(a,b)},append:function(b,a){jQuery(b).append(a)}};(function(a){a.fn.shadowbox=function(b){return this.each(function(){var e=a(this);var d=a.extend({},b||{},a.metadata?e.metadata():a.meta?e.data():{});var c=this.className||"";d.width=parseInt((c.match(/w:(\d+)/)||[])[1])||d.width;d.height=parseInt((c.match(/h:(\d+)/)||[])[1])||d.height;Shadowbox.setup(e,d)})}})(jQuery);if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox, no base library adapter found"}(function(){var version="2.0";var options={animate:true,animateFade:true,animSequence:"wh",flvPlayer:"flvplayer.swf",modal:false,overlayColor:"#000",overlayOpacity:0.8,flashBgColor:"#000000",autoplayMovies:true,showMovieControls:true,slideshowDelay:0,resizeDuration:0.55,fadeDuration:0.35,displayNav:true,continuous:false,displayCounter:true,counterType:"default",counterLimit:10,viewportPadding:20,handleOversize:"resize",handleException:null,handleUnsupported:"link",initialHeight:160,initialWidth:320,enableKeys:true,onOpen:null,onFinish:null,onChange:null,onClose:null,skipSetup:false,errors:{fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}},ext:{img:["png","jpg","jpeg","gif","bmp"],swf:["swf"],flv:["flv"],qt:["dv","mov","moov","movie","mp4"],wmp:["asf","wm","wmv"],qtwmp:["avi","mpg","mpeg"],iframe:["asp","aspx","cgi","cfm","htm","html","pl","php","php3","php4","php5","phtml","rb","rhtml","shtml","txt","vbs"]}};var SB=Shadowbox;var SL=SB.lib;var default_options;var RE={domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/,empty:/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i};var cache=[];var gallery;var current;var content;var content_id="shadowbox_content";var dims;var initialized=false;var activated=false;var slide_timer;var slide_start;var slide_delay=0;var ua=navigator.userAgent.toLowerCase();var client={isStrict:document.compatMode=="CSS1Compat",isOpera:ua.indexOf("opera")>-1,isIE:ua.indexOf("msie")>-1,isIE7:ua.indexOf("msie 7")>-1,isSafari:/webkit|khtml/.test(ua),isWindows:ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1,isMac:ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1,isLinux:ua.indexOf("linux")!=-1};client.isBorderBox=client.isIE&&!client.isStrict;client.isSafari3=client.isSafari&&!!(document.evaluate);client.isGecko=ua.indexOf("gecko")!=-1&&!client.isSafari;var ltIE7=client.isIE&&!client.isIE7;var plugins;if(navigator.plugins&&navigator.plugins.length){var detectPlugin=function(plugin_name){var detected=false;for(var i=0,len=navigator.plugins.length;i<len;++i){if(navigator.plugins[i].name.indexOf(plugin_name)>-1){detected=true;break}}return detected};var f4m=detectPlugin("Flip4Mac");plugins={fla:detectPlugin("Shockwave Flash"),qt:detectPlugin("QuickTime"),wmp:!f4m&&detectPlugin("Windows Media"),f4m:f4m}}else{var detectPlugin=function(plugin_name){var detected=false;try{var axo=new ActiveXObject(plugin_name);if(axo){detected=true}}catch(e){}return detected};plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}}var apply=function(o,e){for(var p in e){o[p]=e[p]}return o};var isLink=function(el){return el&&typeof el.tagName=="string"&&(el.tagName.toUpperCase()=="A"||el.tagName.toUpperCase()=="AREA")};SL.getViewportHeight=function(){var h=window.innerHeight;var mode=document.compatMode;if((mode||client.isIE)&&!client.isOpera){h=client.isStrict?document.documentElement.clientHeight:document.body.clientHeight}return h};SL.getViewportWidth=function(){var w=window.innerWidth;var mode=document.compatMode;if(mode||client.isIE){w=client.isStrict?document.documentElement.clientWidth:document.body.clientWidth}return w};SL.createHTML=function(obj){var html="<"+obj.tag;for(var attr in obj){if(attr=="tag"||attr=="html"||attr=="children"){continue}if(attr=="cls"){html+=' class="'+obj.cls+'"'}else{html+=" "+attr+'="'+obj[attr]+'"'}}if(RE.empty.test(obj.tag)){html+="/>"}else{html+=">";var cn=obj.children;if(cn){for(var i=0,len=cn.length;i<len;++i){html+=this.createHTML(cn[i])}}if(obj.html){html+=obj.html}html+="</"+obj.tag+">"}return html};var ease=function(x){return 1+Math.pow(x-1,3)};var animate=function(el,p,to,d,cb){var from=parseFloat(SL.getStyle(el,p));if(isNaN(from)){from=0}if(from==to){if(typeof cb=="function"){cb()}return}var delta=to-from;var op=p=="opacity";var unit=op?"":"px";var fn=function(ease){SL.setStyle(el,p,from+ease*delta+unit)};if(!options.animate&&!op||op&&!options.animateFade){fn(1);if(typeof cb=="function"){cb()}return}d*=1000;var begin=new Date().getTime();var end=begin+d;var timer=setInterval(function(){var time=new Date().getTime();if(time>=end){clearInterval(timer);fn(1);if(typeof cb=="function"){cb()}}else{fn(ease((time-begin)/d))}},10)};var clearOpacity=function(el){var s=el.style;if(client.isIE){if(typeof s.filter=="string"&&(/alpha/i).test(s.filter)){s.filter=s.filter.replace(/[\w\.]*alpha\(.*?\);?/i,"")}}else{s.opacity="";s["-moz-opacity"]="";s["-khtml-opacity"]=""}};var getComputedHeight=function(el){var h=Math.max(el.offsetHeight,el.clientHeight);if(!h){h=parseInt(SL.getStyle(el,"height"),10)||0;if(!client.isBorderBox){h+=parseInt(SL.getStyle(el,"padding-top"),10)+parseInt(SL.getStyle(el,"padding-bottom"),10)+parseInt(SL.getStyle(el,"border-top-width"),10)+parseInt(SL.getStyle(el,"border-bottom-width"),10)}}return h};var getPlayer=function(url){var m=url.match(RE.domain);var d=m&&document.domain==m[1];if(url.indexOf("#")>-1&&d){return"inline"}var q=url.indexOf("?");if(q>-1){url=url.substring(0,q)}if(RE.img.test(url)){return"img"}if(RE.swf.test(url)){return plugins.fla?"swf":"unsupported-swf"}if(RE.flv.test(url)){return plugins.fla?"flv":"unsupported-flv"}if(RE.qt.test(url)){return plugins.qt?"qt":"unsupported-qt"}if(RE.wmp.test(url)){if(plugins.wmp){return"wmp"}if(plugins.f4m){return"qt"}if(client.isMac){return plugins.qt?"unsupported-f4m":"unsupported-qtf4m"}return"unsupported-wmp"}else{if(RE.qtwmp.test(url)){if(plugins.qt){return"qt"}if(plugins.wmp){return"wmp"}return client.isMac?"unsupported-qt":"unsupported-qtwmp"}else{if(!d||RE.iframe.test(url)){return"iframe"}}}return"unsupported"};var handleClick=function(ev){var link;if(isLink(this)){link=this}else{link=SL.getTarget(ev);while(!isLink(link)&&link.parentNode){link=link.parentNode}}if(link){SB.open(link);if(gallery.length){SL.preventDefault(ev)}}};var toggleNav=function(id,on){var el=SL.get("shadowbox_nav_"+id);if(el){el.style.display=on?"":"none"}};var buildBars=function(cb){var obj=gallery[current];var title_i=SL.get("shadowbox_title_inner");title_i.innerHTML=obj.title||"";var nav=SL.get("shadowbox_nav");if(nav){var c,n,pl,pa,p;if(options.displayNav){c=true;var len=gallery.length;if(len>1){if(options.continuous){n=p=true}else{n=(len-1)>current;p=current>0}}if(options.slideshowDelay>0&&hasNext()){pa=slide_timer!="paused";pl=!pa}}else{c=n=pl=pa=p=false}toggleNav("close",c);toggleNav("next",n);toggleNav("play",pl);toggleNav("pause",pa);toggleNav("previous",p)}var counter=SL.get("shadowbox_counter");if(counter){var co="";if(options.displayCounter&&gallery.length>1){if(options.counterType=="skip"){var i=0,len=gallery.length,end=len;var limit=parseInt(options.counterLimit);if(limit<len){var h=Math.round(limit/2);i=current-h;if(i<0){i+=len}end=current+(limit-h);if(end>len){end-=len}}while(i!=end){if(i==len){i=0}co+='<a onclick="Shadowbox.change('+i+');"';if(i==current){co+=' class="shadowbox_counter_current"'}co+=">"+(++i)+"</a>"}}else{co=(current+1)+" "+SB.LANG.of+" "+len}}counter.innerHTML=co}cb()};var hideBars=function(anim,cb){var obj=gallery[current];var title=SL.get("shadowbox_title");var info=SL.get("shadowbox_info");var title_i=SL.get("shadowbox_title_inner");var info_i=SL.get("shadowbox_info_inner");var fn=function(){buildBars(cb)};var title_h=getComputedHeight(title);var info_h=getComputedHeight(info)*-1;if(anim){animate(title_i,"margin-top",title_h,0.35);animate(info_i,"margin-top",info_h,0.35,fn)}else{SL.setStyle(title_i,"margin-top",title_h+"px");SL.setStyle(info_i,"margin-top",info_h+"px");fn()}};var showBars=function(cb){var title_i=SL.get("shadowbox_title_inner");var info_i=SL.get("shadowbox_info_inner");var t=title_i.innerHTML!="";if(t){animate(title_i,"margin-top",0,0.35)}animate(info_i,"margin-top",0,0.35,cb)};var loadContent=function(){var obj=gallery[current];if(!obj){return}var changing=false;if(content){content.remove();changing=true}var p=obj.player=="inline"?"html":obj.player;if(typeof SB[p]!="function"){SB.raise("Unknown player "+obj.player)}content=new SB[p](content_id,obj);listenKeys(false);toggleLoading(true);hideBars(changing,function(){if(!content){return}if(!changing){SL.get("shadowbox").style.display=""}var fn=function(){resizeContent(function(){if(!content){return}showBars(function(){if(!content){return}SL.get("shadowbox_body_inner").innerHTML=SL.createHTML(content.markup(dims));toggleLoading(false,function(){if(!content){return}if(typeof content.onLoad=="function"){content.onLoad()}if(options.onFinish&&typeof options.onFinish=="function"){options.onFinish(gallery[current])}if(slide_timer!="paused"){SB.play()}listenKeys(true)})})})};if(typeof content.ready!="undefined"){var id=setInterval(function(){if(content){if(content.ready){clearInterval(id);id=null;fn()}}else{clearInterval(id);id=null}},100)}else{fn()}});if(gallery.length>1){var next=gallery[current+1]||gallery[0];if(next.player=="img"){var a=new Image();a.src=next.content}var prev=gallery[current-1]||gallery[gallery.length-1];if(prev.player=="img"){var b=new Image();b.src=prev.content}}};var setDimensions=function(height,width,resizable){resizable=resizable||false;var sb=SL.get("shadowbox_body");var h=height=parseInt(height);var w=width=parseInt(width);var view_h=SL.getViewportHeight();var view_w=SL.getViewportWidth();var border_w=parseInt(SL.getStyle(sb,"border-left-width"),10)+parseInt(SL.getStyle(sb,"border-right-width"),10);var extra_w=border_w+2*options.viewportPadding;if(w+extra_w>=view_w){w=view_w-extra_w}var border_h=parseInt(SL.getStyle(sb,"border-top-width"),10)+parseInt(SL.getStyle(sb,"border-bottom-width"),10);var bar_h=getComputedHeight(SL.get("shadowbox_title"))+getComputedHeight(SL.get("shadowbox_info"));var extra_h=border_h+2*options.viewportPadding+bar_h;if(h+extra_h>=view_h){h=view_h-extra_h}var drag=false;var resize_h=height;var resize_w=width;var handle=options.handleOversize;if(resizable&&(handle=="resize"||handle=="drag")){var change_h=(height-h)/height;var change_w=(width-w)/width;if(handle=="resize"){if(change_h>change_w){w=Math.round((width/height)*h)}else{if(change_w>change_h){h=Math.round((height/width)*w)}}resize_w=w;resize_h=h}else{var link=gallery[current];if(link){drag=link.player=="img"&&(change_h>0||change_w>0)}}}dims={height:h+border_h+bar_h,width:w+border_w,inner_h:h,inner_w:w,top:(view_h-(h+extra_h))/2+options.viewportPadding,resize_h:resize_h,resize_w:resize_w,drag:drag}};var resizeContent=function(cb){if(!content){return}setDimensions(content.height,content.width,content.resizable);if(cb){switch(options.animSequence){case"hw":adjustHeight(dims.inner_h,dims.top,true,function(){adjustWidth(dims.width,true,cb)});break;case"wh":adjustWidth(dims.width,true,function(){adjustHeight(dims.inner_h,dims.top,true,cb)});break;case"sync":default:adjustWidth(dims.width,true);adjustHeight(dims.inner_h,dims.top,true,cb)}}else{adjustWidth(dims.width,false);adjustHeight(dims.inner_h,dims.top,false);var c=SL.get(content_id);if(c){if(content.resizable&&options.handleOversize=="resize"){c.height=dims.resize_h;c.width=dims.resize_w}if(gallery[current].player=="img"&&options.handleOversize=="drag"){var top=parseInt(SL.getStyle(c,"top"));if(top+content.height<dims.inner_h){SL.setStyle(c,"top",dims.inner_h-content.height+"px")}var left=parseInt(SL.getStyle(c,"left"));if(left+content.width<dims.inner_w){SL.setStyle(c,"left",dims.inner_w-content.width+"px")}}}}};var adjustHeight=function(height,top,anim,cb){height=parseInt(height);var sb=SL.get("shadowbox_body");if(anim){animate(sb,"height",height,options.resizeDuration)}else{SL.setStyle(sb,"height",height+"px")}var s=SL.get("shadowbox");if(anim){animate(s,"top",top,options.resizeDuration,cb)}else{SL.setStyle(s,"top",top+"px");if(typeof cb=="function"){cb()}}};var adjustWidth=function(width,anim,cb){width=parseInt(width);var s=SL.get("shadowbox");if(anim){animate(s,"width",width,options.resizeDuration,cb)}else{SL.setStyle(s,"width",width+"px");if(typeof cb=="function"){cb()}}};var listenKeys=function(on){if(!options.enableKeys){return}SL[(on?"add":"remove")+"Event"](document,"keydown",handleKey)};var handleKey=function(e){var code=SL.keyCode(e);SL.preventDefault(e);if(code==81||code==88||code==27){SB.close()}else{if(code==37){SB.previous()}else{if(code==39){SB.next()}else{if(code==32){SB[(typeof slide_timer=="number"?"pause":"play")]()}}}}};var toggleLoading=function(on,cb){var loading=SL.get("shadowbox_loading");if(on){loading.style.display="";if(typeof cb=="function"){cb()}}else{var p=gallery[current].player;var anim=(p=="img"||p=="html");var fn=function(){loading.style.display="none";clearOpacity(loading);if(typeof cb=="function"){cb()}};if(anim){animate(loading,"opacity",0,options.fadeDuration,fn)}else{fn()}}};var fixTop=function(){SL.get("shadowbox_container").style.top=document.documentElement.scrollTop+"px"};var fixHeight=function(){SL.get("shadowbox_overlay").style.height=SL.getViewportHeight()+"px"};var hasNext=function(){return gallery.length>1&&(current!=gallery.length-1||options.continuous)};var toggleVisible=function(cb){var els,v=(cb)?"hidden":"visible";var hide=["select","object","embed"];for(var i=0;i<hide.length;++i){els=document.getElementsByTagName(hide[i]);for(var j=0,len=els.length;j<len;++j){els[j].style.visibility=v}}var so=SL.get("shadowbox_overlay");var sc=SL.get("shadowbox_container");var sb=SL.get("shadowbox");if(cb){SL.setStyle(so,{backgroundColor:options.overlayColor,opacity:0});if(!options.modal){SL.addEvent(so,"click",SB.close)}if(ltIE7){fixTop();fixHeight();SL.addEvent(window,"scroll",fixTop)}sb.style.display="none";sc.style.visibility="visible";animate(so,"opacity",parseFloat(options.overlayOpacity),options.fadeDuration,cb)}else{SL.removeEvent(so,"click",SB.close);if(ltIE7){SL.removeEvent(window,"scroll",fixTop)}sb.style.display="none";animate(so,"opacity",0,options.fadeDuration,function(){sc.style.visibility="hidden";sb.style.display="";clearOpacity(so)})}};Shadowbox.init=function(opts){if(initialized){return}if(typeof SB.LANG=="undefined"){SB.raise("No Shadowbox language loaded");return}if(typeof SB.SKIN=="undefined"){SB.raise("No Shadowbox skin loaded");return}apply(options,opts||{});var markup=SB.SKIN.markup.replace(/\{(\w+)\}/g,function(m,p){return SB.LANG[p]});var bd=document.body||document.documentElement;SL.append(bd,markup);if(ltIE7){SL.setStyle(SL.get("shadowbox_container"),"position","absolute");SL.get("shadowbox_body").style.zoom=1;var png=SB.SKIN.png_fix;if(png&&png.constructor==Array){for(var i=0;i<png.length;++i){var el=SL.get(png[i]);if(el){var match=SL.getStyle(el,"background-image").match(/url\("(.*\.png)"\)/);if(match){SL.setStyle(el,{backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+match[1]+",sizingMethod=scale);"})}}}}}for(var e in options.ext){RE[e]=new RegExp(".("+options.ext[e].join("|")+")s*$","i")}var id;SL.addEvent(window,"resize",function(){if(id){clearTimeout(id);id=null}id=setTimeout(function(){if(ltIE7){fixHeight()}resizeContent()},50)});if(!options.skipSetup){SB.setup()}initialized=true};Shadowbox.loadSkin=function(skin,dir){if(!(/\/$/.test(dir))){dir+="/"}skin=dir+skin+"/";document.write('<link rel="stylesheet" type="text/css" href="'+skin+'skin.css">');document.write('<script type="text/javascript" src="'+skin+'skin.js"><\/script>')};Shadowbox.loadLanguage=function(lang,dir){if(!(/\/$/.test(dir))){dir+="/"}document.write('<script type="text/javascript" src="'+dir+"shadowbox-"+lang+'.js"><\/script>')};Shadowbox.loadPlayer=function(players,dir){if(typeof players=="string"){players=[players]}if(!(/\/$/.test(dir))){dir+="/"}for(var i=0,len=players.length;i<len;++i){document.write('<script type="text/javascript" src="'+dir+"shadowbox-"+players[i]+'.js"><\/script>')}};Shadowbox.setup=function(links,opts){if(!links){var links=[];var a=document.getElementsByTagName("a"),rel;for(var i=0,len=a.length;i<len;++i){rel=a[i].getAttribute("rel");if(rel&&RE.rel.test(rel)){links[links.length]=a[i]}}}else{if(!links.length){links=[links]}}var link;for(var i=0,len=links.length;i<len;++i){link=links[i];if(typeof link.shadowboxCacheKey=="undefined"){link.shadowboxCacheKey=cache.length;SL.addEvent(link,"click",handleClick)}cache[link.shadowboxCacheKey]=this.buildCacheObj(link,opts)}};Shadowbox.buildCacheObj=function(link,opts){var href=link.href;var o={el:link,title:link.getAttribute("title"),player:getPlayer(href),options:apply({},opts||{}),content:href};var opt,l_opts=["player","title","height","width","gallery"];for(var i=0,len=l_opts.length;i<len;++i){opt=l_opts[i];if(typeof o.options[opt]!="undefined"){o[opt]=o.options[opt];delete o.options[opt]}}var rel=link.getAttribute("rel");if(rel){var match=rel.match(RE.gallery);if(match){o.gallery=escape(match[2])}var params=rel.split(";");for(var i=0,len=params.length;i<len;++i){match=params[i].match(RE.param);if(match){if(match[1]=="options"){eval("apply(o.options, "+match[2]+")")}else{o[match[1]]=match[2]}}}}return o};Shadowbox.applyOptions=function(opts){if(opts){default_options=apply({},options);options=apply(options,opts)}};Shadowbox.revertOptions=function(){if(default_options){options=default_options;default_options=null}};Shadowbox.open=function(obj,opts){this.revertOptions();if(isLink(obj)){if(typeof obj.shadowboxCacheKey=="undefined"||typeof cache[obj.shadowboxCacheKey]=="undefined"){obj=this.buildCacheObj(obj,opts)}else{obj=cache[obj.shadowboxCacheKey]}}if(obj.constructor==Array){gallery=obj;current=0}else{var copy=apply({},obj);if(!obj.gallery){gallery=[copy];current=0}else{current=null;gallery=[];var ci;for(var i=0,len=cache.length;i<len;++i){ci=cache[i];if(ci.gallery){if(ci.content==obj.content&&ci.gallery==obj.gallery&&ci.title==obj.title){current=gallery.length}if(ci.gallery==obj.gallery){gallery.push(apply({},ci))}}}if(current==null){gallery.unshift(copy);current=0}}}obj=gallery[current];if(obj.options||opts){this.applyOptions(apply(apply({},obj.options||{}),opts||{}))}var match,r;for(var i=0,len=gallery.length;i<len;++i){r=false;if(gallery[i].player=="unsupported"){r=true}else{if(match=RE.unsupported.exec(gallery[i].player)){if(options.handleUnsupported=="link"){gallery[i].player="html";var s,a,oe=options.errors;switch(match[1]){case"qtwmp":s="either";a=[oe.qt.url,oe.qt.name,oe.wmp.url,oe.wmp.name];break;case"qtf4m":s="shared";a=[oe.qt.url,oe.qt.name,oe.f4m.url,oe.f4m.name];break;default:s="single";if(match[1]=="swf"||match[1]=="flv"){match[1]="fla"}a=[oe[match[1]].url,oe[match[1]].name]}var msg=SB.LANG.errors[s].replace(/\{(\d+)\}/g,function(m,i){return a[i]});gallery[i].content='<div class="shadowbox_message">'+msg+"</div>"}else{r=true}}else{if(gallery[i].player=="inline"){var match=RE.inline.exec(gallery[i].content);if(match){var el;if(el=SL.get(match[1])){gallery[i].content=el.innerHTML}else{SB.raise("Cannot find element with id "+match[1])}}else{SB.raise("Cannot find element id for inline content")}}}}if(r){gallery.splice(i,1);if(i<current){--current}else{if(i==current){current=i>0?current-1:i}}--i;len=gallery.length}}if(gallery.length){if(options.onOpen&&typeof options.onOpen=="function"){options.onOpen(obj)}if(!activated){setDimensions(options.initialHeight,options.initialWidth);adjustHeight(dims.inner_h,dims.top,false);adjustWidth(dims.width,false);toggleVisible(loadContent)}else{loadContent()}activated=true}};Shadowbox.change=function(num){if(!gallery){return}if(!gallery[num]){if(!options.continuous){return}else{num=num<0?(gallery.length-1):0}}if(typeof slide_timer=="number"){clearTimeout(slide_timer);slide_timer=null;slide_delay=slide_start=0}current=num;if(options.onChange&&typeof options.onChange=="function"){options.onChange(gallery[current])}loadContent()};Shadowbox.next=function(){this.change(current+1)};Shadowbox.previous=function(){this.change(current-1)};Shadowbox.play=function(){if(!hasNext()){return}if(!slide_delay){slide_delay=options.slideshowDelay*1000}if(slide_delay){slide_start=new Date().getTime();slide_timer=setTimeout(function(){slide_delay=slide_start=0;SB.next()},slide_delay);toggleNav("play",false);toggleNav("pause",true)}};Shadowbox.pause=function(){if(typeof slide_timer=="number"){var time=new Date().getTime();slide_delay=Math.max(0,slide_delay-(time-slide_start));if(slide_delay){clearTimeout(slide_timer);slide_timer="paused"}toggleNav("pause",false);toggleNav("play",true)}};Shadowbox.close=function(){if(!activated){return}listenKeys(false);toggleVisible(false);if(content){content.remove();content=null}if(typeof slide_timer=="number"){clearTimeout(slide_timer)}slide_timer=null;slide_delay=0;if(options.onClose&&typeof options.onClose=="function"){options.onClose(gallery[current])}activated=false};Shadowbox.clearCache=function(){for(var i=0,len=cache.length;i<len;++i){if(cache[i].el){SL.removeEvent(cache[i].el,"click",handleClick);delete cache[i].el.shadowboxCacheKey}}cache=[]};Shadowbox.getPlugins=function(){return plugins};Shadowbox.getOptions=function(){return options};Shadowbox.getCurrent=function(){return gallery[current]};Shadowbox.getVersion=function(){return version};Shadowbox.getClient=function(){return client};Shadowbox.getContent=function(){return content};Shadowbox.getDimensions=function(){return dims};Shadowbox.raise=function(e){if(typeof options.handleException=="function"){options.handleException(e)}else{throw e}}})();if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox skin, base library not found."}Shadowbox.SKIN={markup:'<div id="shadowbox_container"><div id="shadowbox_overlay"></div><div id="shadowbox"><div id="shadowbox_title"><div id="shadowbox_title_inner"></div></div><div id="shadowbox_body"><div id="shadowbox_body_inner"></div><div id="shadowbox_loading"><div id="shadowbox_loading_indicator"></div><span><a onclick="Shadowbox.close();">{cancel}</a></span></div></div><div id="shadowbox_info"><div id="shadowbox_info_inner"><div id="shadowbox_counter"></div><div id="shadowbox_nav"><a id="shadowbox_nav_close" title="{close}" onclick="Shadowbox.close()"></a><a id="shadowbox_nav_next" title="{next}" onclick="Shadowbox.next()"></a><a id="shadowbox_nav_play" title="{play}" onclick="Shadowbox.play()"></a><a id="shadowbox_nav_pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="shadowbox_nav_previous" title="{previous}" onclick="Shadowbox.previous()"></a></div><div class="shadowbox_clear"></div></div></div></div></div>',png_fix:["shadowbox_nav_close","shadowbox_nav_next","shadowbox_nav_play","shadowbox_nav_pause","shadowbox_nav_previous"]};(function(){var a=Shadowbox;var b=a.lib;Shadowbox.html=function(d,c){this.id=d;this.obj=c;this.height=this.obj.height?parseInt(this.obj.height,10):300;this.width=this.obj.width?parseInt(this.obj.width,10):500};Shadowbox.html.prototype={markup:function(c){return{tag:"div",id:this.id,cls:"html",html:this.obj.content}},remove:function(){var c=b.get(this.id);if(c){b.remove(c)}}}})();(function(b){var a=null;b.fn.autogrow=function(c){return this.each(function(){new b.autogrow(this,c)})};b.autogrow=function(c,d){this.options=d||{};this.dummy=null;this.interval=null;this.line_height=this.options.lineHeight||parseInt(b(c).css("line-height"));this.min_height=this.options.minHeight||parseInt(b(c).css("min-height"));this.max_height=this.options.maxHeight||parseInt(b(c).css("max-height"));this.textarea=b(c);if(this.line_height==NaN){this.line_height=0}this.init()};b.autogrow.fn=b.autogrow.prototype={autogrow:"1.2.2"};b.autogrow.fn.extend=b.autogrow.extend=b.extend;b.autogrow.fn.extend({init:function(){var c=this;this.textarea.css({overflow:"hidden",display:"block"});this.textarea.bind("focus",function(){c.startExpand()}).bind("blur",function(){c.stopExpand()});this.checkExpand()},startExpand:function(){var c=this;this.interval=window.setInterval(function(){c.checkExpand()},400)},stopExpand:function(){clearInterval(this.interval)},checkExpand:function(){if(this.dummy==null){this.dummy=b("<div></div>");this.dummy.css({"font-size":this.textarea.css("font-size"),"font-family":this.textarea.css("font-family"),width:this.textarea.css("width"),padding:this.textarea.css("padding"),"line-height":this.line_height+"px","overflow-x":"hidden",position:"absolute",top:0,left:-9999}).appendTo("body")}var c=this.textarea.val().replace(/(<|>)/g,"");if($.browser.msie){c=c.replace(/\n/g,"<BR>new")}else{c=c.replace(/\n/g,"<br>new")}if(this.dummy.html()!=c){this.dummy.html(c);if(this.max_height>0&&(this.dummy.height()+this.line_height>this.max_height)){this.textarea.css("overflow-y","auto")}else{this.textarea.css("overflow-y","hidden");if(this.textarea.height()<this.dummy.height()+this.line_height||(this.dummy.height()<this.textarea.height())){this.textarea.animate({height:(this.dummy.height()+this.line_height)+"px"},100)}}}}})})(jQuery);jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
/*
 * jQuery Cycle Plugin (core engine only)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2009 M. Alsup
 * Version: 2.54 (23-FEB-2009)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.3 or later
 *
 * Originally based on the work of:
 *	1) Matt Oakes (http://portfolio.gizone.co.uk/applications/slideshow/)
 *	2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/)
 *	3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/)
 */
(function(g){var k="2.54";if(g.support==undefined){g.support={opacity:!(g.browser.msie&&/MSIE 6.0/.test(navigator.userAgent))}}function d(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments,""))}}g.fn.cycle=function(r,q){if(this.length==0&&r!="stop"){if(!g.isReady&&this.selector){d("DOM not ready, queuing slideshow");var s={s:this.selector,c:this.context};g(function(){g(s.s,s.c).cycle(r,q)});return}d("terminating; zero elements found by selector"+(g.isReady?"":" (DOM not ready)"));return this}return this.each(function(){r=l(this,r,q);if(r===false){return}if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var v=g(this);var w=r.slideExpr?g(r.slideExpr,this):v.children();var t=w.get();if(t.length<2){d("terminating; too few slides: "+t.length);return}var u=j(v,w,t,r);if(u===false){return}if(u.timeout||u.continuous){this.cycleTimeout=setTimeout(function(){c(t,u,0,!u.rev)},u.continuous?10:u.timeout+(u.delay||0))}})};function l(q,t,r){if(q.cycleStop==undefined){q.cycleStop=0}if(t===undefined||t===null){t={}}if(t.constructor==String){switch(t){case"stop":q.cycleStop++;if(q.cycleTimeout){clearTimeout(q.cycleTimeout)}q.cycleTimeout=0;g(q).removeData("cycle.opts");return false;case"pause":q.cyclePause=1;return false;case"resume":q.cyclePause=0;if(r===true){t=g(q).data("cycle.opts");if(!t){d("options not found, can not resume");return}if(q.cycleTimeout){clearTimeout(q.cycleTimeout);q.cycleTimeout=0}c(t.elements,t,1,1)}return false;default:t={fx:t}}}else{if(t.constructor==Number){var s=t;t=g(q).data("cycle.opts");if(!t){d("options not found, can not advance slide");return false}if(s<0||s>=t.elements.length){d("invalid slide index: "+s);return false}t.nextSlide=s;if(q.cycleTimeout){clearTimeout(this.cycleTimeout);q.cycleTimeout=0}if(typeof r=="string"){t.oneTimeFx=r}c(t.elements,t,1,s>=t.currSlide);return false}}return t}function j(E,A,t,G){var q=g.extend({},g.fn.cycle.defaults,G||{},g.metadata?E.metadata():g.meta?E.data():{});if(q.autostop){q.countdown=q.autostopCount||t.length}var H=E[0];E.data("cycle.opts",q);q.$cont=E;q.stopCount=H.cycleStop;q.elements=t;q.before=q.before?[q.before]:[];q.after=q.after?[q.after]:[];q.after.unshift(function(){q.busy=0});if(!g.support.opacity&&q.cleartype){q.after.push(function(){this.style.removeAttribute("filter")})}if(q.continuous){q.after.push(function(){c(t,q,0,!q.rev)})}m(q);if(!g.support.opacity&&q.cleartype&&!q.cleartypeNoBg){e(A)}if(E.css("position")=="static"){E.css("position","relative")}if(q.width){E.width(q.width)}if(q.height&&q.height!="auto"){E.height(q.height)}if(q.startingSlide){q.startingSlide=parseInt(q.startingSlide)}if(q.random){q.randomMap=[];for(var v=0;v<t.length;v++){q.randomMap.push(v)}q.randomMap.sort(function(I,w){return Math.random()-0.5});q.randomIndex=0;q.startingSlide=q.randomMap[0]}else{if(q.startingSlide>=t.length){q.startingSlide=0}}q.currSlide=q.startingSlide=q.startingSlide||0;var y=q.startingSlide;A.css({position:"absolute",top:0,left:0}).hide().each(function(w){var I=y?w>=y?t.length-(w-y):y-w:t.length-w;g(this).css("z-index",I)});g(t[y]).css("opacity",1).show();if(!g.support.opacity&&q.cleartype){t[y].style.removeAttribute("filter")}if(q.fit&&q.width){A.width(q.width)}if(q.fit&&q.height&&q.height!="auto"){A.height(q.height)}var u=q.containerResize&&!E.innerHeight();if(u){var B=0,s=0;for(var v=0;v<t.length;v++){var r=g(t[v]),z=r[0],D=r.outerWidth(),x=r.outerHeight();if(!D){D=z.offsetWidth}if(!x){x=z.offsetHeight}B=D>B?D:B;s=x>s?x:s}if(B>0&&s>0){E.css({width:B+"px",height:s+"px"})}}if(q.pause){E.hover(function(){this.cyclePause++},function(){this.cyclePause--})}a(q);if(!q.multiFx){var F=g.fn.cycle.transitions[q.fx];if(g.isFunction(F)){F(E,A,q)}else{if(q.fx!="custom"&&!q.multiFx){d("unknown transition: "+q.fx,"; slideshow terminating");return false}}}A.each(function(){var w=g(this);this.cycleH=(q.fit&&q.height)?q.height:w.height();this.cycleW=(q.fit&&q.width)?q.width:w.width()});q.cssBefore=q.cssBefore||{};q.animIn=q.animIn||{};q.animOut=q.animOut||{};A.not(":eq("+y+")").css(q.cssBefore);if(q.cssFirst){g(A[y]).css(q.cssFirst)}if(q.timeout){q.timeout=parseInt(q.timeout);if(q.speed.constructor==String){q.speed=g.fx.speeds[q.speed]||parseInt(q.speed)}if(!q.sync){q.speed=q.speed/2}while((q.timeout-q.speed)<250){q.timeout+=q.speed}}if(q.easing){q.easeIn=q.easeOut=q.easing}if(!q.speedIn){q.speedIn=q.speed}if(!q.speedOut){q.speedOut=q.speed}q.slideCount=t.length;q.currSlide=q.lastSlide=y;if(q.random){q.nextSlide=q.currSlide;if(++q.randomIndex==t.length){q.randomIndex=0}q.nextSlide=q.randomMap[q.randomIndex]}else{q.nextSlide=q.startingSlide>=(t.length-1)?0:q.startingSlide+1}var C=A[y];if(q.before.length){q.before[0].apply(C,[C,C,q,true])}if(q.after.length>1){q.after[1].apply(C,[C,C,q,true])}if(q.next){g(q.next).click(function(){return o(q,q.rev?-1:1)})}if(q.prev){g(q.prev).click(function(){return o(q,q.rev?1:-1)})}if(q.pager){b(t,q)}h(q,t);return q}function m(q){q.original={before:[],after:[]};q.original.cssBefore=g.extend({},q.cssBefore);q.original.cssAfter=g.extend({},q.cssAfter);q.original.animIn=g.extend({},q.animIn);q.original.animOut=g.extend({},q.animOut);g.each(q.before,function(){q.original.before.push(this)});g.each(q.after,function(){q.original.after.push(this)})}function a(w){var s=g.fn.cycle.transitions;if(w.fx.indexOf(",")>0){w.multiFx=true;w.fxs=w.fx.replace(/\s*/g,"").split(",");for(var u=0;u<w.fxs.length;u++){var v=w.fxs[u];var r=s[v];if(!r||!s.hasOwnProperty(v)||!g.isFunction(r)){d("discarding unknowtn transition: ",v);w.fxs.splice(u,1);u--}}if(!w.fxs.length){d("No valid transitions named; slideshow terminating.");return false}}else{if(w.fx=="all"){w.multiFx=true;w.fxs=[];for(p in s){var r=s[p];if(s.hasOwnProperty(p)&&g.isFunction(r)){w.fxs.push(p)}}}}if(w.multiFx&&w.randomizeEffects){var t=Math.floor(Math.random()*20)+30;for(var u=0;u<t;u++){var q=Math.floor(Math.random()*w.fxs.length);w.fxs.push(w.fxs.splice(q,1)[0])}d("randomized fx sequence: ",w.fxs)}}function h(r,q){r.addSlide=function(u,v){var t=g(u),w=t[0];if(!r.autostopCount){r.countdown++}q[v?"unshift":"push"](w);if(r.els){r.els[v?"unshift":"push"](w)}r.slideCount=q.length;t.css("position","absolute");t[v?"prependTo":"appendTo"](r.$cont);if(v){r.currSlide++;r.nextSlide++}if(!g.support.opacity&&r.cleartype&&!r.cleartypeNoBg){e(t)}if(r.fit&&r.width){t.width(r.width)}if(r.fit&&r.height&&r.height!="auto"){$slides.height(r.height)}w.cycleH=(r.fit&&r.height)?r.height:t.height();w.cycleW=(r.fit&&r.width)?r.width:t.width();t.css(r.cssBefore);if(r.pager){g.fn.cycle.createPagerAnchor(q.length-1,w,g(r.pager),q,r)}if(g.isFunction(r.onAddSlide)){r.onAddSlide(t)}else{t.hide()}}}g.fn.cycle.resetState=function(r,q){var q=q||r.fx;r.before=[];r.after=[];r.cssBefore=g.extend({},r.original.cssBefore);r.cssAfter=g.extend({},r.original.cssAfter);r.animIn=g.extend({},r.original.animIn);r.animOut=g.extend({},r.original.animOut);r.fxFn=null;g.each(r.original.before,function(){r.before.push(this)});g.each(r.original.after,function(){r.after.push(this)});var s=g.fn.cycle.transitions[q];if(g.isFunction(s)){s(r.$cont,g(r.elements),r)}};function c(x,q,w,y){if(w&&q.busy){g(x).stop(true,true);q.busy=false}if(q.busy){return}var u=q.$cont[0],A=x[q.currSlide],z=x[q.nextSlide];if(u.cycleStop!=q.stopCount||u.cycleTimeout===0&&!w){return}if(!w&&!u.cyclePause&&((q.autostop&&(--q.countdown<=0))||(q.nowrap&&!q.random&&q.nextSlide<q.currSlide))){if(q.end){q.end(q)}return}if(w||!u.cyclePause){var v=q.fx;A.cycleH=A.cycleH||A.offsetHeight;A.cycleW=A.cycleW||A.offsetWidth;z.cycleH=z.cycleH||z.offsetHeight;z.cycleW=z.cycleW||z.offsetWidth;if(q.multiFx){if(q.lastFx==undefined||++q.lastFx>=q.fxs.length){q.lastFx=0}v=q.fxs[q.lastFx];q.currFx=v}if(q.oneTimeFx){v=q.oneTimeFx;q.oneTimeFx=null}g.fn.cycle.resetState(q,v);if(q.before.length){g.each(q.before,function(B,C){if(u.cycleStop!=q.stopCount){return}C.apply(z,[A,z,q,y])})}var s=function(){g.each(q.after,function(B,C){if(u.cycleStop!=q.stopCount){return}C.apply(z,[A,z,q,y])})};if(q.nextSlide!=q.currSlide){q.busy=1;if(q.fxFn){q.fxFn(A,z,q,s,y)}else{if(g.isFunction(g.fn.cycle[q.fx])){g.fn.cycle[q.fx](A,z,q,s)}else{g.fn.cycle.custom(A,z,q,s,w&&q.fastOnEvent)}}}q.lastSlide=q.currSlide;if(q.random){q.currSlide=q.nextSlide;if(++q.randomIndex==x.length){q.randomIndex=0}q.nextSlide=q.randomMap[q.randomIndex]}else{var t=(q.nextSlide+1)==x.length;q.nextSlide=t?0:q.nextSlide+1;q.currSlide=t?x.length-1:q.nextSlide-1}if(q.pager){g.fn.cycle.updateActivePagerLink(q.pager,q.currSlide)}}var r=0;if(q.timeout&&!q.continuous){r=f(A,z,q,y)}else{if(q.continuous&&u.cyclePause){r=10}}if(r>0){u.cycleTimeout=setTimeout(function(){c(x,q,0,!q.rev)},r)}}g.fn.cycle.updateActivePagerLink=function(q,r){g(q).find("a").removeClass("activeSlide").filter("a:eq("+r+")").addClass("activeSlide")};function f(v,s,u,r){if(u.timeoutFn){var q=u.timeoutFn(v,s,u,r);if(q!==false){return q}}return u.timeout}g.fn.cycle.next=function(q){o(q,q.rev?-1:1)};g.fn.cycle.prev=function(q){o(q,q.rev?1:-1)};function o(r,u){var q=r.elements;var t=r.$cont[0],s=t.cycleTimeout;if(s){clearTimeout(s);t.cycleTimeout=0}if(r.random&&u<0){r.randomIndex--;if(--r.randomIndex==-2){r.randomIndex=q.length-2}else{if(r.randomIndex==-1){r.randomIndex=q.length-1}}r.nextSlide=r.randomMap[r.randomIndex]}else{if(r.random){if(++r.randomIndex==q.length){r.randomIndex=0}r.nextSlide=r.randomMap[r.randomIndex]}else{r.nextSlide=r.currSlide+u;if(r.nextSlide<0){if(r.nowrap){return false}r.nextSlide=q.length-1}else{if(r.nextSlide>=q.length){if(r.nowrap){return false}r.nextSlide=0}}}}if(g.isFunction(r.prevNextClick)){r.prevNextClick(u>0,r.nextSlide,q[r.nextSlide])}c(q,r,1,u>=0);return false}function b(r,s){var q=g(s.pager);g.each(r,function(t,u){g.fn.cycle.createPagerAnchor(t,u,q,r,s)});g.fn.cycle.updateActivePagerLink(s.pager,s.startingSlide)}g.fn.cycle.createPagerAnchor=function(t,u,r,s,v){var q=(g.isFunction(v.pagerAnchorBuilder))?v.pagerAnchorBuilder(t,u):'<a href="#">'+(t+1)+"</a>";if(!q){return}var w=g(q);if(w.parents("body").length==0){w.appendTo(r)}w.bind(v.pagerEvent,function(){v.nextSlide=t;var y=v.$cont[0],x=y.cycleTimeout;if(x){clearTimeout(x);y.cycleTimeout=0}if(g.isFunction(v.pagerClick)){v.pagerClick(v.nextSlide,s[v.nextSlide])}c(s,v,1,v.currSlide<t);return false});if(v.pauseOnPagerHover){w.hover(function(){v.$cont[0].cyclePause++},function(){v.$cont[0].cyclePause--})}};g.fn.cycle.hopsFromLast=function(t,s){var r,q=t.lastSlide,u=t.currSlide;if(s){r=u>q?u-q:t.slideCount-q}else{r=u<q?q-u:q+t.slideCount-u}return r};function e(s){function r(t){var t=parseInt(t).toString(16);return t.length<2?"0"+t:t}function q(w){for(;w&&w.nodeName.toLowerCase()!="html";w=w.parentNode){var t=g.css(w,"background-color");if(t.indexOf("rgb")>=0){var u=t.match(/\d+/g);return"#"+r(u[0])+r(u[1])+r(u[2])}if(t&&t!="transparent"){return t}}return"#ffffff"}s.each(function(){g(this).css("background-color",q(this))})}g.fn.cycle.commonReset=function(v,t,u,r,s,q){g(u.elements).not(v).hide();u.cssBefore.opacity=1;u.cssBefore.display="block";if(r!==false&&t.cycleW>0){u.cssBefore.width=t.cycleW}if(s!==false&&t.cycleH>0){u.cssBefore.height=t.cycleH}u.cssAfter=u.cssAfter||{};u.cssAfter.display="none";g(v).css("zIndex",u.slideCount+(q===true?1:0));g(t).css("zIndex",u.slideCount+(q===true?0:1))};g.fn.cycle.custom=function(B,v,q,s,r){var A=g(B),w=g(v);var t=q.speedIn,z=q.speedOut,u=q.easeIn,y=q.easeOut;w.css(q.cssBefore);if(r){if(typeof r=="number"){t=z=r}else{t=z=1}u=y=null}var x=function(){w.animate(q.animIn,t,u,s)};A.animate(q.animOut,z,y,function(){if(q.cssAfter){A.css(q.cssAfter)}if(!q.sync){x()}});if(q.sync){x()}};g.fn.cycle.transitions={fade:function(r,s,q){s.not(":eq("+q.currSlide+")").css("opacity",0);q.before.push(function(v,t,u){g.fn.cycle.commonReset(v,t,u);u.cssBefore.opacity=0});q.animIn={opacity:1};q.animOut={opacity:0};q.cssBefore={top:0,left:0}}};g.fn.cycle.ver=function(){return k};g.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!g.support.opacity,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0}})(jQuery);(function(a){a.extend({_debug$:null,debug:function(c){var b=(a._debug$==true?true:false);a._debug$=(c?true:false);return b},log:function(b){if(a._debug$==true){window.console.debug(b)}}});a.fn.extend({log:function(b){if(a._debug$==true){return this.each(function(){if(typeof b!=="undefined"){a.log(b)}a.log(this)})}}});a(document).ready(function(){var b=a("html").attr("debug");if(b=="true"||b=="false"){a.debug(b=="true"?true:false)}});a(document).ready(function(){if(typeof window.console==="undefined"){function b(g){var h=null;if(typeof g==="undefined"){h="[undefined]"}else{if(typeof g==="boolean"){h=(g?"true":"false")}else{if(typeof g==="number"){h=""+g}else{if(typeof g==="string"){h=g}else{if(typeof g==="function"){h=g}else{if(typeof g==="object"){if(typeof g.nodeType!=="undefined"){if(g.nodeType==1){h="&lt;";h+=g.nodeName.toLowerCase();for(var f=0;f<g.attributes.length;f++){h+=" "+g.attributes[f].nodeName.toLowerCase()+'="'+g.attributes[f].nodeValue+'"'}h+="&gt;"}else{if(g.nodeType==2){h=g.nodeName+'="'+g.nodeValue}else{if(g.nodeType==3){h=g.nodeValue}}}}else{if(typeof g.toJSONString!=="undefined"){h=g.toJSONString()}else{if(typeof g.toString!=="undefined"){h=g.toString()}}}}}}}}}if(h==null){h="[unknown]"}return h}a(document).ready(function(){a("body").append('<div id="jQueryDebug"><ol></ol></div>');a("#jQueryDebug").css("display","none").css("fontFamily","monospace").css("backgroundColor","#ffffff").css("color","#000000").css("padding","10px 0px 10px 0px").css("border","4px solid #666699").css("margin","4px 4px 4px 4px");a("#jQueryDebug ol").css("margin","0px 0px 0px 0px").css("paddingRight","20px")});var e=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];var d=function(f){a("#jQueryDebug").css("display",a._debug$==true?"block":"none");a("#jQueryDebug ol").append("<li>"+b(f)+"</li>").css;a("#jQueryDebug ol li").css("borderBottom","1px solid #cccccc").css("padding","1px 10px 1px 10px")};window.console={};for(var c=0;c<e.length;c++){window.console[e[c]]=d}window.console.jQueryDebug=true}})})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,m,l){var j=1.70158;var k=0;var g=m;if(h==0){return e}if((h/=l)==1){return e+m}if(!k){k=l*0.3}if(g<Math.abs(m)){g=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k))+e},easeOutElastic:function(f,h,e,m,l){var j=1.70158;var k=0;var g=m;if(h==0){return e}if((h/=l)==1){return e+m}if(!k){k=l*0.3}if(g<Math.abs(m)){g=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/g)}return g*Math.pow(2,-10*h)*Math.sin((h*l-j)*(2*Math.PI)/k)+m+e},easeInOutElastic:function(f,h,e,m,l){var j=1.70158;var k=0;var g=m;if(h==0){return e}if((h/=l/2)==2){return e+m}if(!k){k=l*(0.3*1.5)}if(g<Math.abs(m)){g=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k)*0.5+m+e},easeInBack:function(e,f,a,j,h,g){if(g==undefined){g=1.70158}return j*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,j,h,g){if(g==undefined){g=1.70158}return j*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,j,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return j/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return j/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});(function(b){b.fn.ajaxSubmit=function(s){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof s=="function"){s={success:s}}s=b.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},s||{});var u={};this.trigger("form-pre-serialize",[this,s,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(s.beforeSerialize&&s.beforeSerialize(this,s)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var l=this.formToArray(s.semantic);if(s.data){s.extraData=s.data;for(var e in s.data){if(s.data[e] instanceof Array){for(var f in s.data[e]){l.push({name:e,value:s.data[e][f]})}}else{l.push({name:e,value:s.data[e]})}}}if(s.beforeSubmit&&s.beforeSubmit(l,this,s)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[l,this,s,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var d=b.param(l);if(s.type.toUpperCase()=="GET"){s.url+=(s.url.indexOf("?")>=0?"&":"?")+d;s.data=null}else{s.data=d}var t=this,h=[];if(s.resetForm){h.push(function(){t.resetForm()})}if(s.clearForm){h.push(function(){t.clearForm()})}if(!s.dataType&&s.target){var o=s.success||function(){};h.push(function(j){b(s.target).html(j).each(o,arguments)})}else{if(s.success){h.push(s.success)}}s.success=function(v,k){for(var q=0,j=h.length;q<j;q++){h[q].apply(s,[v,k,t])}};var c=b("input:file",this).fieldValue();var r=false;for(var g=0;g<c.length;g++){if(c[g]){r=true}}if(s.iframe||r){if(b.browser.safari&&s.closeKeepAlive){b.get(s.closeKeepAlive,m)}else{m()}}else{b.ajax(s)}this.trigger("form-submit-notify",[this,s]);return this;function m(){var w=t[0];if(b(":input[name=submit]",w).length){alert('Error: Form elements must not be named "submit".');return}var q=b.extend({},b.ajaxSettings,s);var F=jQuery.extend(true,{},b.extend(true,{},b.ajaxSettings),q);var v="jqFormIO"+(new Date().getTime());var B=b('<iframe id="'+v+'" name="'+v+'" />');var D=B[0];if(b.browser.msie||b.browser.opera){D.src='javascript:false;document.write("");'}B.css({position:"absolute",top:"-1000px",left:"-1000px"});var E={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;B.attr("src","about:blank")}};var C=q.global;if(C&&!b.active++){b.event.trigger("ajaxStart")}if(C){b.event.trigger("ajaxSend",[E,q])}if(F.beforeSend&&F.beforeSend(E,F)===false){F.global&&jQuery.active--;return}if(E.aborted){return}var k=0;var y=0;var j=w.clk;if(j){var x=j.name;if(x&&!j.disabled){s.extraData=s.extraData||{};s.extraData[x]=j.value;if(j.type=="image"){s.extraData[name+".x"]=w.clk_x;s.extraData[name+".y"]=w.clk_y}}}setTimeout(function(){var I=t.attr("target"),G=t.attr("action");t.attr({target:v,method:"POST",action:q.url});if(!s.skipEncodingOverride){t.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(q.timeout){setTimeout(function(){y=true;z()},q.timeout)}var H=[];try{if(s.extraData){for(var J in s.extraData){H.push(b('<input type="hidden" name="'+J+'" value="'+s.extraData[J]+'" />').appendTo(w)[0])}}B.appendTo("body");D.attachEvent?D.attachEvent("onload",z):D.addEventListener("load",z,false);w.submit()}finally{t.attr("action",G);I?t.attr("target",I):t.removeAttr("target");b(H).remove()}},10);function z(){if(k++){return}D.detachEvent?D.detachEvent("onload",z):D.removeEventListener("load",z,false);var H=0;var I=true;try{if(y){throw"timeout"}var J,L;L=D.contentWindow?D.contentWindow.document:D.contentDocument?D.contentDocument:D.document;if(L.body==null&&!H&&b.browser.opera){H=1;k--;setTimeout(z,100);return}E.responseText=L.body?L.body.innerHTML:null;E.responseXML=L.XMLDocument?L.XMLDocument:L;E.getResponseHeader=function(N){var M={"content-type":q.dataType};return M[N]};if(q.dataType=="json"||q.dataType=="script"){var G=L.getElementsByTagName("textarea")[0];E.responseText=G?G.value:E.responseText}else{if(q.dataType=="xml"&&!E.responseXML&&E.responseText!=null){E.responseXML=A(E.responseText)}}J=b.httpData(E,q.dataType)}catch(K){I=false;b.handleError(q,E,"error",K)}if(I){q.success(J,"success");if(C){b.event.trigger("ajaxSuccess",[E,q])}}if(C){b.event.trigger("ajaxComplete",[E,q])}if(C&&!--b.active){b.event.trigger("ajaxStop")}if(q.complete){q.complete(E,I?"success":"error")}setTimeout(function(){B.remove();E.responseXML=null},100)}function A(G,H){if(window.ActiveXObject){H=new ActiveXObject("Microsoft.XMLDOM");H.async="false";H.loadXML(G)}else{H=(new DOMParser()).parseFromString(G,"text/xml")}return(H&&H.documentElement&&H.documentElement.tagName!="parsererror")?H:null}}};b.fn.ajaxForm=function(c){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){b(this).ajaxSubmit(c);return false}).each(function(){b(":submit,input:image",this).bind("click.form-plugin",function(f){var d=this.form;d.clk=this;if(this.type=="image"){if(f.offsetX!=undefined){d.clk_x=f.offsetX;d.clk_y=f.offsetY}else{if(typeof b.fn.offset=="function"){var g=b(this).offset();d.clk_x=f.pageX-g.left;d.clk_y=f.pageY-g.top}else{d.clk_x=f.pageX-this.offsetLeft;d.clk_y=f.pageY-this.offsetTop}}}setTimeout(function(){d.clk=d.clk_x=d.clk_y=null},10)})})};b.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){b(":submit,input:image",this).unbind("click.form-plugin")})};b.fn.formToArray=function(r){var q=[];if(this.length==0){return q}var d=this[0];var h=r?d.getElementsByTagName("*"):d.elements;if(!h){return q}for(var k=0,m=h.length;k<m;k++){var e=h[k];var f=e.name;if(!f){continue}if(r&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){q.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}var s=b.fieldValue(e,true);if(s&&s.constructor==Array){for(var g=0,c=s.length;g<c;g++){q.push({name:f,value:s[g]})}}else{if(s!==null&&typeof s!="undefined"){q.push({name:f,value:s})}}}if(!r&&d.clk){var l=d.getElementsByTagName("input");for(var k=0,m=l.length;k<m;k++){var o=l[k];var f=o.name;if(f&&!o.disabled&&o.type=="image"&&d.clk==o){q.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}}return q};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,q=c.type,r=c.tagName.toLowerCase();if(typeof j=="undefined"){j=true}if(j&&(!e||c.disabled||q=="reset"||q=="button"||(q=="checkbox"||q=="radio")&&!c.checked||(q=="submit"||q=="image")&&c.form&&c.form.clk!=c||r=="select"&&c.selectedIndex==-1)){return null}if(r=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(q=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=b.browser.msie&&!(h.attributes.value.specified)?h.text:h.value;if(g){return o}m.push(o)}}return m}return c.value};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();if(d=="text"||d=="password"||c=="textarea"){this.value=""}else{if(d=="checkbox"||d=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c==undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c==undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug&&window.console&&window.console.log){window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}}})(jQuery);(function(a){a.getlocations=function(h,f,g){if(typeof window.Get_Locations=="undefined"){var e=window.location;var j=new Object();j.location=e;j.baseref=a("base")?a("base").attr("href"):"";j.baseref_ie=j.baseref.replace(/([^\/])$|\/?[^\/]+\.(php|html|htm)$/i,"$1/");j.hash=e.hash;j.host=e.host;j.hostname=e.hostname;j.href=e.href;j.pathname=e.pathname;j.port=e.port;j.protocol=e.protocol;j.search=e.search;j.ssl=e.protocol.match(/https/);j.pathes=new Array();j.pathes=e.pathname.split("/");j.filename=j.pathes[j.pathes.length-1];j.topleveldomain=e.hostname.match(/[a-z]+$/i);var g=e.search.substr(1,e.search.length).split("&");var b=new Object();for(var c in g){var d=g[c].split("=");b[d[0]]=d[1]}j.params=b;window.Get_Locations=j}if(typeof h=="string"&&h!=""){h=(h.match(/^\/|^http/i))?h:Get_Locations.baseref_ie+h;if(typeof g=="string"&&g!=""){window.open(h,f,g)}else{if(typeof f=="string"&&f!=""){window.open(h,f)}else{window.location.href=h}}}return window.Get_Locations}})(jQuery);(function(a){a.fn.inputHint=function(e){e=a.extend({hintClass:"hint"},e||{});function d(){if(a(this).val()==""){a(this).addClass(e.hintClass).val(a(this).attr("hint"))}}function b(){if(a(this).hasClass(e.hintClass)){a(this).removeClass(e.hintClass).val("")}}this.focus(b).blur(d).blur();var c=this.parents("form:eq(0)");this.each(function(){var f=this;c.submit(function(){b.apply(f)})})}})(jQuery);(function($){$.fn.editable=function(target,options){var settings={target:target,name:"value",id:"id",type:"text",width:"auto",height:"auto",event:"click",onblur:"cancel",loadtype:"GET",loadtext:"Loading...",placeholder:"Click to edit",loaddata:{},submitdata:{}};if(options){$.extend(settings,options)}var plugin=$.editable.types[settings.type].plugin||function(){};var submit=$.editable.types[settings.type].submit||function(){};var buttons=$.editable.types[settings.type].buttons||$.editable.types.defaults.buttons;var content=$.editable.types[settings.type].content||$.editable.types.defaults.content;var element=$.editable.types[settings.type].element||$.editable.types.defaults.element;var reset=$.editable.types[settings.type].reset||$.editable.types.defaults.reset;var callback=settings.callback||function(){};if(!$.isFunction($(this)[settings.event])){$.fn[settings.event]=function(fn){return fn?this.bind(settings.event,fn):this.trigger(settings.event)}}$(this).attr("title",settings.tooltip);settings.autowidth="auto"==settings.width;settings.autoheight="auto"==settings.height;return this.each(function(){var self=this;var savedwidth=$(self).width();var savedheight=$(self).height();if(!$.trim($(this).html())){$(this).html(settings.placeholder)}$(this)[settings.event](function(e){if(self.editing){return}if(0==$(self).width()){settings.width=savedwidth;settings.height=savedheight}else{if(settings.width!="none"){settings.width=settings.autowidth?$(self).width():settings.width}if(settings.height!="none"){settings.height=settings.autoheight?$(self).height():settings.height}}if($(this).html().toLowerCase().replace(/;/,"")==settings.placeholder.toLowerCase().replace(/;/,"")){$(this).html("")}self.editing=true;self.revert=$(self).html();$(self).html("");var form=$("<form/>");if(settings.cssclass){if("inherit"==settings.cssclass){form.attr("class",$(self).attr("class"))}else{form.attr("class",settings.cssclass)}}if(settings.style){if("inherit"==settings.style){form.attr("style",$(self).attr("style"));form.css("display",$(self).css("display"))}else{form.attr("style",settings.style)}}var input=element.apply(form,[settings,self]);var input_content;if(settings.loadurl){var t=setTimeout(function(){input.disabled=true;content.apply(form,[settings.loadtext,settings,self])},100);var loaddata={};loaddata[settings.id]=self.id;if($.isFunction(settings.loaddata)){$.extend(loaddata,settings.loaddata.apply(self,[self.revert,settings]))}else{$.extend(loaddata,settings.loaddata)}$.ajax({type:settings.loadtype,url:settings.loadurl,data:loaddata,async:false,success:function(result){window.clearTimeout(t);input_content=result;input.disabled=false}})}else{if(settings.data){input_content=settings.data;if($.isFunction(settings.data)){input_content=settings.data.apply(self,[self.revert,settings])}}else{input_content=self.revert}}content.apply(form,[input_content,settings,self]);input.attr("name",settings.name);buttons.apply(form,[settings,self]);$(self).append(form);plugin.apply(form,[settings,self]);$(":input:visible:enabled:first",form).focus();if(settings.select){input.select()}input.keydown(function(e){if(e.keyCode==27){reset.apply(form,[settings,self]);return false}});var t;if("cancel"==settings.onblur){input.blur(function(e){t=setTimeout(function(){reset.apply(form,[settings,self])},500)})}else{if("submit"==settings.onblur){input.blur(function(e){form.submit()})}else{if($.isFunction(settings.onblur)){input.blur(function(e){settings.onblur.apply(self,[input.val(),settings])})}else{input.blur(function(e){})}}}form.submit(function(e){if(t){clearTimeout(t)}e.preventDefault();if(false!==submit.apply(form,[settings,self])){if($.isFunction(settings.target)){var str=settings.target.apply(self,[input.val(),settings]);$(self).html(str);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder)}}else{var submitdata={};submitdata[settings.name]=input.val();submitdata[settings.id]=self.id;if($.isFunction(settings.submitdata)){$.extend(submitdata,settings.submitdata.apply(self,[self.revert,settings]))}else{$.extend(submitdata,settings.submitdata)}$(self).html(settings.indicator);$.post(settings.target,submitdata,function(str){$(self).html(str);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder)}})}}return false})});this.reset=function(){$(self).html(self.revert);self.editing=false;if(!$.trim($(self).html())){$(self).html(settings.placeholder)}}})};$.editable={types:{defaults:{element:function(settings,original){var input=$('<input type="hidden">');$(this).append(input);return(input)},content:function(string,settings,original){$(":input:first",this).val(string)},reset:function(settings,original){original.reset()},buttons:function(settings,original){var form=this;if(settings.submit){if(settings.submit.match(/>$/)){var submit=$(settings.submit).click(function(){form.submit()})}else{var submit=$('<button type="submit">');submit.html(settings.submit)}$(this).append(submit)}if(settings.cancel){if(settings.cancel.match(/>$/)){var cancel=$(settings.cancel)}else{var cancel=$('<button type="cancel">');cancel.html(settings.cancel)}$(this).append(cancel);$(cancel).click(function(event){if($.isFunction($.editable.types[settings.type].reset)){var reset=$.editable.types[settings.type].reset}else{var reset=$.editable.types.defaults.reset}reset.apply(form,[settings,original]);return false})}}},text:{element:function(settings,original){var input=$("<input>");if(settings.width!="none"){input.width(settings.width)}if(settings.height!="none"){input.height(settings.height)}input.attr("autocomplete","off");$(this).append(input);return(input)}},textarea:{element:function(settings,original){var textarea=$("<textarea>");if(settings.rows){textarea.attr("rows",settings.rows)}else{textarea.height(settings.height)}if(settings.cols){textarea.attr("cols",settings.cols)}else{textarea.width(settings.width)}$(this).append(textarea);return(textarea)}},select:{element:function(settings,original){var select=$("<select>");$(this).append(select);return(select)},content:function(string,settings,original){if(String==string.constructor){eval("var json = "+string);for(var key in json){if(!json.hasOwnProperty(key)){continue}if("selected"==key){continue}var option=$("<option>").val(key).append(json[key]);$("select",this).append(option)}}$("select",this).children().each(function(){if($(this).val()==json.selected||$(this).text()==original.revert){$(this).attr("selected","selected")}})}}},addInputType:function(name,input){$.editable.types[name]=input}}})(jQuery);(function(a){a.jGrowl=function(b,c){if(a("#jGrowl").size()==0){a('<div id="jGrowl"></div>').addClass(a.jGrowl.defaults.position).appendTo("body")}a("#jGrowl").jGrowl(b,c)};a.fn.jGrowl=function(b,d){if(a.isFunction(this.each)){var c=arguments;return this.each(function(){var e=this;if(a(this).data("jGrowl.instance")==undefined){a(this).data("jGrowl.instance",a.extend(new a.fn.jGrowl(),{notifications:[],element:null,interval:null}));a(this).data("jGrowl.instance").startup(this)}if(a.isFunction(a(this).data("jGrowl.instance")[b])){a(this).data("jGrowl.instance")[b].apply(a(this).data("jGrowl.instance"),a.makeArray(c).slice(1))}else{a(this).data("jGrowl.instance").create(b,d)}})}};a.extend(a.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:false,position:"top-right",glue:"after",theme:"default",corners:"10px",check:250,life:3000,speed:"normal",easing:"swing",closer:true,closeTemplate:"&times;",closerTemplate:"<div>[ close all ]</div>",log:function(c,b,d){},beforeOpen:function(c,b,d){},open:function(c,b,d){},beforeClose:function(c,b,d){},close:function(c,b,d){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(b,c){var c=a.extend({},this.defaults,c);this.notifications.push({message:b,options:c});c.log.apply(this.element,[this.element,b,c])},render:function(d){var b=this;var c=d.message;var e=d.options;var d=a('<div class="jGrowl-notification ui-corner-all'+((e.group!=undefined&&e.group!="")?" "+e.group:"")+'"><div class="close">'+e.closeTemplate+'</div><div class="header">'+e.header+'</div><div class="message">'+c+"</div></div>").data("jGrowl",e).addClass(e.theme).children("div.close").bind("click.jGrowl",function(){a(this).parent().trigger("jGrowl.close")}).parent();a(d).bind("mouseover.jGrowl",function(){a("div.jGrowl-notification",b.element).data("jGrowl.pause",true)}).bind("mouseout.jGrowl",function(){a("div.jGrowl-notification",b.element).data("jGrowl.pause",false)}).bind("jGrowl.beforeOpen",function(){if(e.beforeOpen.apply(d,[d,c,e,b.element])!=false){a(this).trigger("jGrowl.open")}}).bind("jGrowl.open",function(){if(e.open.apply(d,[d,c,e,b.element])!=false){if(e.glue=="after"){a("div.jGrowl-notification:last",b.element).after(d)}else{a("div.jGrowl-notification:first",b.element).before(d)}a(this).animate(e.animateOpen,e.speed,e.easing,function(){if(a.browser.msie&&(parseInt(a(this).css("opacity"),10)===1||parseInt(a(this).css("opacity"),10)===0)){this.style.removeAttribute("filter")}a(this).data("jGrowl").created=new Date()})}}).bind("jGrowl.beforeClose",function(){if(e.beforeClose.apply(d,[d,c,e,b.element])!=false){a(this).trigger("jGrowl.close")}}).bind("jGrowl.close",function(){a(this).data("jGrowl.pause",true);a(this).animate(e.animateClose,e.speed,e.easing,function(){a(this).remove();var f=e.close.apply(d,[d,c,e,b.element]);if(a.isFunction(f)){f.apply(d,[d,c,e,b.element])}})}).trigger("jGrowl.beforeOpen");if(a.fn.corner!=undefined){a(d).corner(e.corners)}if(a("div.jGrowl-notification:parent",b.element).size()>1&&a("div.jGrowl-closer",b.element).size()==0&&this.defaults.closer!=false){a(this.defaults.closerTemplate).addClass("jGrowl-closer ui-state-highlight ui-corner-all").addClass(this.defaults.theme).appendTo(b.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){a(this).siblings().children("div.close").trigger("click.jGrowl");if(a.isFunction(b.defaults.closer)){b.defaults.closer.apply(a(this).parent()[0],[a(this).parent()[0]])}})}},update:function(){a(this.element).find("div.jGrowl-notification:parent").each(function(){if(a(this).data("jGrowl")!=undefined&&a(this).data("jGrowl").created!=undefined&&(a(this).data("jGrowl").created.getTime()+a(this).data("jGrowl").life)<(new Date()).getTime()&&a(this).data("jGrowl").sticky!=true&&(a(this).data("jGrowl.pause")==undefined||a(this).data("jGrowl.pause")!=true)){a(this).trigger("jGrowl.beforeClose")}});if(this.notifications.length>0&&(this.defaults.pool==0||a(this.element).find("div.jGrowl-notification:parent").size()<this.defaults.pool)){this.render(this.notifications.shift())}if(a(this.element).find("div.jGrowl-notification:parent").size()<2){a(this.element).find("div.jGrowl-closer").animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){a(this).remove()})}},startup:function(b){this.element=a(b).addClass("jGrowl").append('<div class="jGrowl-notification"></div>');this.interval=setInterval(function(){a(b).data("jGrowl.instance").update()},this.defaults.check);if(a.browser.msie&&parseInt(a.browser.version)<7&&!window.XMLHttpRequest){a(this.element).addClass("ie6")}},shutdown:function(){a(this.element).removeClass("jGrowl").find("div.jGrowl-notification").remove();clearInterval(this.interval)},close:function(){a(this.element).find("div.jGrowl-notification").each(function(){a(this).trigger("jGrowl.beforeClose")})}});a.jGrowl.defaults=a.fn.jGrowl.prototype.defaults})(jQuery);
/* Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.3
 * Requires jQuery 1.1.3+
 * Docs: http://docs.jquery.com/Plugins/livequery
 */
(function(a){a.extend(a.fn,{livequery:function(f,e,d){var c=this,g;if(a.isFunction(f)){d=e,e=f,f=undefined}a.each(a.livequery.queries,function(h,j){if(c.selector==j.selector&&c.context==j.context&&f==j.type&&(!e||e.$lqguid==j.fn.$lqguid)&&(!d||d.$lqguid==j.fn2.$lqguid)){return(g=j)&&false}});g=g||new a.livequery(this.selector,this.context,f,e,d);g.stopped=false;g.run();return this},expire:function(f,e,d){var c=this;if(a.isFunction(f)){d=e,e=f,f=undefined}a.each(a.livequery.queries,function(g,h){if(c.selector==h.selector&&c.context==h.context&&(!f||f==h.type)&&(!e||e.$lqguid==h.fn.$lqguid)&&(!d||d.$lqguid==h.fn2.$lqguid)&&!this.stopped){a.livequery.stop(h.id)}});return this}});a.livequery=function(c,e,g,f,d){this.selector=c;this.context=e||document;this.type=g;this.fn=f;this.fn2=d;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;f.$lqguid=f.$lqguid||a.livequery.guid++;if(d){d.$lqguid=d.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var c=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(d,e){c.fn2.apply(e)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var e=this;var f=this.elements,d=a(this.selector,this.context),c=d.not(f);this.elements=d;if(this.type){c.bind(this.type,this.fn);if(f.length>0){a.each(f,function(g,h){if(a.inArray(h,d)<0){a.event.remove(h,e.type,e.fn)}})}}else{c.each(function(){e.fn.apply(this)});if(this.fn2&&f.length>0){a.each(f,function(g,h){if(a.inArray(h,d)<0){e.fn2.apply(h)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var c=a.livequery.queue.length;while(c--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(d,e){if(!a.fn[e]){return}var c=a.fn[e];a.fn[e]=function(){var f=c.apply(this,arguments);a.livequery.run();return f}})},run:function(c){if(c!=undefined){if(a.inArray(c,a.livequery.queue)<0){a.livequery.queue.push(c)}}else{a.each(a.livequery.queries,function(d){if(a.inArray(d,a.livequery.queue)<0){a.livequery.queue.push(d)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(c){if(c!=undefined){a.livequery.queries[c].stop()}else{a.each(a.livequery.queries,function(d){a.livequery.queries[d].stop()})}}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove");a(function(){a.livequery.play()});var b=a.prototype.init;a.prototype.init=function(d,f){var e=b.apply(this,arguments);if(d&&d.selector){e.context=d.context,e.selector=d.selector}if(typeof d=="string"){e.context=f||document,e.selector=d}return e};a.prototype.init.prototype=a.prototype})(jQuery);(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata"}var data=$.data(elem,settings.single);if(data){return data}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1]}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return undefined}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML)}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr}}}}if(data.indexOf("{")<0){data="{"+data+"}"}data=eval("("+data+")");$.data(elem,settings.single,data);return data}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts)}})(jQuery);jQuery.fn.rte=function(a,b){if(!b||b.constructor!=Array){b=new Array()}$(this).each(function(c){var d=(this.id)?this.id:b.length;b[d]=new lwRTE(this,a||{})});return b};var lwRTE_resizer=function(a){this.drag=false;this.rte_zone=$(a).parents(".rte-zone")};lwRTE_resizer.mousedown=function(b,a){b.drag=true;b.event=(typeof(a)=="undefined")?window.event:a;b.rte_obj=$(".rte-resizer",b.rte_zone).prev().eq(0);$("body",document).css("cursor","se-resize");return false};lwRTE_resizer.mouseup=function(b,a){b.drag=false;$("body",document).css("cursor","auto");return false};lwRTE_resizer.mousemove=function(d,c){if(d.drag){c=(typeof(c)=="undefined")?window.event:c;var a=Math.max(1,d.rte_zone.width()+c.screenX-d.event.screenX);var b=Math.max(1,d.rte_obj.height()+c.screenY-d.event.screenY);d.rte_zone.width(a);d.rte_obj.height(b);d.event=c}return false};var lwRTE=function(a,b){this.css=[];this.css_class=b.frame_class||"";this.base_url=b.base_url||"";this.width=b.width||$(a).width()||"100%";this.height=b.height||$(a).height()||350;this.iframe=null;this.iframe_doc=null;this.textarea=null;this.event=null;this.range=null;this.toolbars={rte:"",html:""};this.controls={rte:{disable:{hint:"Source editor"}},html:{enable:{hint:"Visual editor"}}};$.extend(this.controls.rte,b.controls_rte||{});$.extend(this.controls.html,b.controls_html||{});$.extend(this.css,b.css||{});if(document.designMode||document.contentEditable){$(a).wrap($("<div></div>").addClass("rte-zone").width(this.width));$('<div class="rte-resizer"><a href="#"></a></div>').insertAfter(a);var c=new lwRTE_resizer(a);$(".rte-resizer a",$(a).parents(".rte-zone")).mousedown(function(d){$(document).mousemove(function(f){return lwRTE_resizer.mousemove(c,f)});$(document).mouseup(function(f){return lwRTE_resizer.mouseup(c,f)});return lwRTE_resizer.mousedown(c,d)});this.textarea=a;this.enable_design_mode()}};lwRTE.prototype.editor_cmd=function(c,a){this.iframe.contentWindow.focus();try{this.iframe_doc.execCommand(c,false,a)}catch(b){}this.iframe.contentWindow.focus()};lwRTE.prototype.get_toolbar=function(){var a=(this.iframe)?$(this.iframe):$(this.textarea);return(a.prev().hasClass("rte-toolbar"))?a.prev():null};lwRTE.prototype.activate_toolbar=function(c,a){var b=this.get_toolbar();if(b){b.remove()}$(c).before($(a).clone(true))};lwRTE.prototype.enable_design_mode=function(){var a=this;a.iframe=document.createElement("iframe");a.iframe.frameBorder=0;a.iframe.frameMargin=0;a.iframe.framePadding=0;a.iframe.width="100%";a.iframe.height=a.height||"100%";a.iframe.src="javascript:void(0);";if($(a.textarea).attr("class")){a.iframe.className=$(a.textarea).attr("class")}if($(a.textarea).attr("id")){a.iframe.id=$(a.textarea).attr("id")}if($(a.textarea).attr("name")){a.iframe.title=$(a.textarea).attr("name")}var f=$(a.textarea).val();$(a.textarea).hide().after(a.iframe).remove();a.textarea=null;var c="";for(var b in a.css){c+="<link type='text/css' rel='stylesheet' href='"+a.css[b]+"' />"}var g=(a.base_url)?"<base href='"+a.base_url+"' />":"";var d=(a.css_class)?"class='"+a.css_class+"'":"";var j="<html><head>"+g+c+"</head><body "+d+" style='padding:5px'>"+f+"</body></html>";a.iframe_doc=a.iframe.contentWindow.document;try{a.iframe_doc.designMode="on"}catch(h){$(a.iframe_doc).focus(function(){a.iframe_doc.designMode()})}a.iframe_doc.open();a.iframe_doc.write(j);a.iframe_doc.close();if(!a.toolbars.rte){a.toolbars.rte=a.create_toolbar(a.controls.rte)}a.activate_toolbar(a.iframe,a.toolbars.rte);$(a.iframe).parents("form").submit(function(){a.disable_design_mode(true)});$(a.iframe_doc).mouseup(function(e){if(a.iframe_doc.selection){a.range=a.iframe_doc.selection.createRange()}a.set_selected_controls((e.target)?e.target:e.srcElement,a.controls.rte)});$(a.iframe_doc).blur(function(e){if(a.iframe_doc.selection){a.range=a.iframe_doc.selection.createRange()}});$(a.iframe_doc).keyup(function(e){a.set_selected_controls(a.get_selected_element(),a.controls.rte)});if(!$.browser.msie){a.editor_cmd("styleWithCSS",false)}};lwRTE.prototype.disable_design_mode=function(b){var a=this;a.textarea=(b)?$('<input type="hidden" />').get(0):$("<textarea></textarea>").width("100%").height(a.height).get(0);if(a.iframe.className){a.textarea.className=a.iframe.className}if(a.iframe.id){a.textarea.id=a.iframe.id}if(a.iframe.title){a.textarea.name=a.iframe.title}$(a.textarea).val($("body",a.iframe_doc).html());$(a.iframe).before(a.textarea);if(!a.toolbars.html){a.toolbars.html=a.create_toolbar(a.controls.html)}if(b!=true){$(a.iframe_doc).remove();$(a.iframe).remove();a.iframe=a.iframe_doc=null;a.activate_toolbar(a.textarea,a.toolbars.html)}};lwRTE.prototype.toolbar_click=function(f,d){var b=d.exec;var a=d.args||[];var g=(f.tagName.toUpperCase()=="SELECT");$(".rte-panel",this.get_toolbar()).remove();if(b){if(g){a.push(f)}try{b.apply(this,a)}catch(c){}}else{if(this.iframe&&d.command){if(g){a=f.options[f.selectedIndex].value;if(a.length<=0){return}}this.editor_cmd(d.command,a)}}};lwRTE.prototype.create_toolbar=function(d){var c=this;var b=$("<div></div>").addClass("rte-toolbar").width("100%").append($("<ul></ul>")).append($("<div></div>").addClass("clear"));var h,a;for(var f in d){if(d[f].separator){a=$("<li></li>").addClass("separator")}else{if(d[f].init){try{d[f].init.apply(d[f],[this])}catch(g){}}if(d[f].select){h=$(d[f].select).change(function(j){c.event=j;c.toolbar_click(this,d[this.className]);return false})}else{h=$("<a href='#'></a>").attr("title",(d[f].hint)?d[f].hint:f).attr("rel",f).click(function(j){c.event=j;c.toolbar_click(this,d[this.rel]);return false})}a=$("<li></li>").append(h.addClass(f))}$("ul",b).append(a)}$(".enable",b).click(function(){c.enable_design_mode();return false});$(".disable",b).click(function(){c.disable_design_mode();return false});return b.get(0)};lwRTE.prototype.create_panel=function(h,c){var j=this;var e=j.get_toolbar();if(!e){return false}$(".rte-panel",e).remove();var f,b;var d=j.event.pageX;var g=j.event.pageY;var a=$("<div></div>").hide().addClass("rte-panel").css({left:d,top:g});$("<div></div>").addClass("rte-panel-title").html(h).append($("<a class='close' href='#'>X</a>").click(function(){a.remove();return false})).mousedown(function(){f=true;return false}).mouseup(function(){f=false;return false}).mousemove(function(k){if(f&&b){d-=b.pageX-k.pageX;g-=b.pageY-k.pageY;a.css({left:d,top:g})}b=k;return false}).appendTo(a);if(c){a.width(c)}e.append(a);return a};lwRTE.prototype.get_content=function(){return(this.iframe)?$("body",this.iframe_doc).html():$(this.textarea).val()};lwRTE.prototype.set_content=function(a){(this.iframe)?$("body",this.iframe_doc).html(a):$(this.textarea).val(a)};lwRTE.prototype.set_selected_controls=function(b,l){var h=this.get_toolbar();if(!h){return false}var k,a,d,f,m,c,j;try{for(k in l){f=l[k];d=$("."+k,h);d.removeClass("active");if(!f.tags){continue}a=b;do{if(a.nodeType!=1){continue}m=a.nodeName.toLowerCase();if($.inArray(m,f.tags)<0){continue}if(f.select){d=d.get(0);if(d.tagName.toUpperCase()=="SELECT"){d.selectedIndex=0;for(c=0;c<d.options.length;c++){j=d.options[c].value;if(j&&((f.tag_cmp&&f.tag_cmp(a,j))||m==j)){d.selectedIndex=c;break}}}}else{d.addClass("active")}}while(a=a.parentNode)}}catch(g){}return true};lwRTE.prototype.get_selected_element=function(){var c,b,a;var d=this.iframe.contentWindow;if(d.getSelection){try{b=d.getSelection();a=b.getRangeAt(0);c=a.commonAncestorContainer}catch(f){return false}}else{try{b=d.document.selection;a=b.createRange();c=a.parentElement()}catch(f){return false}}return c};lwRTE.prototype.get_selection_range=function(){var a=null;var c=this.iframe.contentWindow;this.iframe.focus();if(c.getSelection){a=c.getSelection().getRangeAt(0);if($.browser.opera){var b=a.startContainer;if(b.nodeType===Node.TEXT_NODE){a.setStartBefore(b.parentNode)}}}else{this.range.select();a=this.iframe_doc.selection.createRange()}return a};lwRTE.prototype.get_selected_text=function(){var a=this.iframe.contentWindow;if(a.getSelection){return a.getSelection().toString()}this.range.select();return a.document.selection.createRange().text};lwRTE.prototype.get_selected_html=function(){var b=null;var d=this.iframe.contentWindow;var a=this.get_selection_range();if(a){if(d.getSelection){var c=document.createElement("div");c.appendChild(a.cloneContents());b=c.innerHTML}else{b=a.htmlText}}return b};lwRTE.prototype.selection_replace_with=function(b){var a=this.get_selection_range();var c=this.iframe.contentWindow;if(!a){return}this.editor_cmd("removeFormat");if(c.getSelection){a.deleteContents();a.insertNode(a.createContextualFragment(b));this.editor_cmd("delete")}else{this.editor_cmd("delete");a.pasteHTML(b)}};var rte_tag="-rte-tmp-tag-";var rte_toolbar={s1:{separator:true},bold:{command:"bold",tags:["b","strong"]},italic:{command:"italic",tags:["i","em"]},strikeThrough:{command:"strikethrough",tags:["s","strike"]},underline:{command:"underline",tags:["u"]},s2:{separator:true},justifyLeft:{command:"justifyleft"},justifyCenter:{command:"justifycenter"},justifyRight:{command:"justifyright"},justifyFull:{command:"justifyfull"},s3:{separator:true},indent:{command:"indent"},outdent:{command:"outdent"},s4:{separator:true},subscript:{command:"subscript",tags:["sub"]},superscript:{command:"superscript",tags:["sup"]},s5:{separator:true},orderedList:{command:"insertorderedlist",tags:["ol"]},unorderedList:{command:"insertunorderedlist",tags:["ul"]},s6:{separator:true},block:{command:"formatblock",select:'<select>	<option value="">- format -</option>	<option value="<p>">Paragraph</option>	<option value="<h1>">Header 1</option>	<option value="<h2>">Header 2</options>	<option value="<h3>">Header 3</option>	<option value="<h4>">Header 4</options>	<option value="<h5>">Header 5</option>	<option value="<h6>">Header 6</options></select>	',tag_cmp:lwrte_block_compare,tags:["p","h1","h2","h3","h4","h5","h6"]},font:{command:"fontname",select:'<select>	<option value="">- font -</option>	<option value="arial">Arial</option>	<option value="comic sans ms">Comic Sans</option>	<option value="courier new">Courier New</options>	<option value="georgia">Georgia</option>	<option value="helvetica">Helvetica</options>	<option value="impact">Impact</option>	<option value="times new roman">Times</options>	<option value="trebuchet ms">Trebuchet</options>	<option value="verdana">Verdana</options></select>	',tags:["font"]},size:{command:"fontsize",select:'<select>	<option value="">-</option>	<option value="1">1 (8pt)</option>	<option value="2">2 (10pt)</option>	<option value="3">3 (12pt)</options>	<option value="4">4 (14pt)</option>	<option value="5">5 (16pt)</options>	<option value="6">6 (18pt)</option>	<option value="7">7 (20pt)</options></select>	',tags:["font"]},style:{exec:lwrte_style,init:lwrte_style_init},color:{exec:lwrte_color},image:{exec:lwrte_image,tags:["img"]},link:{exec:lwrte_link,tags:["a"]},unlink:{command:"unlink"},s8:{separator:true},removeFormat:{exec:lwrte_unformat},word:{exec:lwrte_cleanup_word},clear:{exec:lwrte_clear}};var html_toolbar={s1:{separator:true},word:{exec:lwrte_cleanup_word},clear:{exec:lwrte_clear}};function lwrte_block_compare(b,a){a=a.replace(/<([^>]*)>/,"$1");return(a.toLowerCase()==b.nodeName.toLowerCase())}function lwrte_style_init(b){var a=this;a.select='<select><option value="">- no css -</option></select>';if(false&&b.css.length){$.ajax({url:"styles.php",type:"POST",data:{css:b.css[b.css.length-1]},async:false,success:function(f){var e=f.split(",");var c="";for(var d in e){c+='<option value="'+e[d]+'">'+e[d]+"</option>"}a.select='<select><option value="">- css -</option>'+c+"</select>"}})}}function lwrte_style(b){if(b){try{var d=b.options[b.selectedIndex].value;var a=this;var c=a.get_selected_text();c='<span class="'+d+'">'+c+"</span>";a.selection_replace_with(c);b.selectedIndex=0}catch(f){}}}function lwrte_color(){var r=this;var a=r.create_panel("Set color for text",385);var o=false;var j=false;a.append('<div class="colorpicker1"><div class="rgb" id="rgb"></div></div><div class="colorpicker1"><div class="gray" id="gray"></div></div><div class="colorpicker2">	<div class="palette" id="palette"></div>	<div class="preview" id="preview"></div>	<div class="color" id="color"></div></div><div class="clear"></div><p class="submit"><button id="ok">Ok</button><button id="cancel">Cancel</button></p>').show();var l=$("#preview",a);var f=$("#color",a);var d=$("#palette",a);var b=["#660000","#990000","#cc0000","#ff0000","#333333","#006600","#009900","#00cc00","#00ff00","#666666","#000066","#000099","#0000cc","#0000ff","#999999","#909000","#900090","#009090","#ffffff","#cccccc","#ffff00","#ff00ff","#00ffff","#000000","#eeeeee"];for(var h=0;h<b.length;h++){$("<div></div>").addClass("item").css("background",b[h]).appendTo(d)}var q=$("#rgb").height();var k=$("#rgb").width()/6;$("#rgb,#gray,#palette",a).mousedown(function(s){o=true;return false}).mouseup(function(s){o=false;return false}).mouseout(function(s){j=false;return false}).mouseover(function(s){j=true;return false});$("#rgb").mousemove(function(s){if(o&&j){m(this,true,false,false,s)}return false});$("#gray").mousemove(function(s){if(o&&j){m(this,false,true,false,s)}return false});$("#palette").mousemove(function(s){if(o&&j){m(this,false,false,true,s)}return false});$("#rgb").click(function(s){m(this,true,false,false,s);return false});$("#gray").click(function(s){m(this,false,true,false,s);return false});$("#palette").click(function(s){m(this,false,false,true,s);return false});$("#cancel",a).click(function(){a.remove();return false});$("#ok",a).click(function(){var s=f.html();if(s.length>0&&s.charAt(0)=="#"){if(r.iframe_doc.selection){r.range.select()}r.editor_cmd("foreColor",s)}a.remove();return false});function g(u){var t="0123456789abcdef";return t.charAt(Math.floor(u/16))+t.charAt(u%16)}function e(t){var u={x:t.offsetLeft,y:t.offsetTop};if(t.offsetParent){var s=e(t.offsetParent);u.x+=s.x;u.y+=s.y}return u}function c(v,u){var s,z;u=u||window.event;var t=u.target||u.srcElement;var w=e(v);s=u.pageX-w.x;z=u.pageY-w.y;return{x:s,y:z}}function m(w,t,G,u,B){var s,z,E,C;var A=c(w,B);var F=A.x;var D=A.y;if(t){s=(F>=0)*(F<k)*255+(F>=k)*(F<2*k)*(2*255-F*255/k)+(F>=4*k)*(F<5*k)*(-4*255+F*255/k)+(F>=5*k)*(F<6*k)*255;z=(F>=0)*(F<k)*(F*255/k)+(F>=k)*(F<3*k)*255+(F>=3*k)*(F<4*k)*(4*255-F*255/k);E=(F>=2*k)*(F<3*k)*(-2*255+F*255/k)+(F>=3*k)*(F<5*k)*255+(F>=5*k)*(F<6*k)*(6*255-F*255/k);var v=(q-D)/q;s=128+(s-128)*v;z=128+(z-128)*v;E=128+(E-128)*v}else{if(G){s=z=E=(q-D)*1.7}else{if(u){F=Math.floor(F/10);D=Math.floor(D/10);C=b[F+D*5]}}}if(!u){C="#"+g(s)+g(z)+g(E)}l.css("background",C);f.html(C)}}function lwrte_image(){var self=this;var panel=self.create_panel("Insert image",385);panel.append('<p><label>URL</label><input type="text" id="url" size="30" value=""><button id="file">Upload</button><button id="view">View</button></p><div class="clear"></div><p class="submit"><button id="ok">Ok</button><button id="cancel">Cancel</button></p>').show();var url=$("#url",panel);var upload=$("#file",panel).upload({autoSubmit:false,action:"uploader.php",onSelect:function(){var file=this.filename();var ext=(/[.]/.exec(file))?/[^.]+$/.exec(file.toLowerCase()):"";if(!(ext&&/^(jpg|png|jpeg|gif)$/.test(ext))){alert("Invalid file extension");return}this.submit()},onComplete:function(response){if(response.length<=0){return}response=eval("("+response+")");if(response.error&&response.error.length>0){alert(response.error)}else{url.val((response.file&&response.file.length>0)?response.file:"")}}});$("#view",panel).click(function(){(url.val().length>0)?window.open(url.val()):alert("Enter URL of image to view");return false});$("#cancel",panel).click(function(){panel.remove();return false});$("#ok",panel).click(function(){var file=url.val();self.editor_cmd("insertImage",file);panel.remove();return false})}function lwrte_unformat(){this.editor_cmd("removeFormat");this.editor_cmd("unlink")}function lwrte_clear(){if(confirm("Clear Document?")){this.set_content("")}}function lwrte_cleanup_word(){this.set_content(a(this.get_content(),true,true,true));function a(d,b,e,f){d=d.replace(/<o:p>\s*<\/o:p>/g,"");d=d.replace(/<o:p>[\s\S]*?<\/o:p>/g,"&nbsp;");d=d.replace(/\s*mso-[^:]+:[^;"]+;?/gi,"");d=d.replace(/\s*MARGIN: 0cm 0cm 0pt\s*;/gi,"");d=d.replace(/\s*MARGIN: 0cm 0cm 0pt\s*"/gi,'"');d=d.replace(/\s*TEXT-INDENT: 0cm\s*;/gi,"");d=d.replace(/\s*TEXT-INDENT: 0cm\s*"/gi,'"');d=d.replace(/\s*TEXT-ALIGN: [^\s;]+;?"/gi,'"');d=d.replace(/\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi,'"');d=d.replace(/\s*FONT-VARIANT: [^\s;]+;?"/gi,'"');d=d.replace(/\s*tab-stops:[^;"]*;?/gi,"");d=d.replace(/\s*tab-stops:[^"]*/gi,"");if(b){d=d.replace(/\s*face="[^"]*"/gi,"");d=d.replace(/\s*face=[^ >]*/gi,"");d=d.replace(/\s*FONT-FAMILY:[^;"]*;?/gi,"")}d=d.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");if(e){d=d.replace(/<(\w[^>]*) style="([^\"]*)"([^>]*)/gi,"<$1$3")}d=d.replace(/<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi,"");d=d.replace(/<(?:META|LINK)[^>]*>\s*/gi,"");d=d.replace(/\s*style="\s*"/gi,"");d=d.replace(/<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi,"&nbsp;");d=d.replace(/<SPAN\s*[^>]*><\/SPAN>/gi,"");d=d.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");d=d.replace(/<SPAN\s*>([\s\S]*?)<\/SPAN>/gi,"$1");d=d.replace(/<FONT\s*>([\s\S]*?)<\/FONT>/gi,"$1");d=d.replace(/<\\?\?xml[^>]*>/gi,"");d=d.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,"");d=d.replace(/<\/?\w+:[^>]*>/gi,"");d=d.replace(/<\!--[\s\S]*?-->/g,"");d=d.replace(/<(U|I|STRIKE)>&nbsp;<\/\1>/g,"&nbsp;");d=d.replace(/<H\d>\s*<\/H\d>/gi,"");d=d.replace(/<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig,"");d=d.replace(/<(\w[^>]*) language=([^ |>]*)([^>]*)/gi,"<$1$3");d=d.replace(/<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi,"<$1$3");d=d.replace(/<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi,"<$1$3");if(f){d=d.replace(/<H(\d)([^>]*)>/gi,"<h$1>");d=d.replace(/<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi,"<$1>$2</$1>");d=d.replace(/<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi,"<$1>$2</$1>")}else{d=d.replace(/<H1([^>]*)>/gi,'<div$1><b><font size="6">');d=d.replace(/<H2([^>]*)>/gi,'<div$1><b><font size="5">');d=d.replace(/<H3([^>]*)>/gi,'<div$1><b><font size="4">');d=d.replace(/<H4([^>]*)>/gi,'<div$1><b><font size="3">');d=d.replace(/<H5([^>]*)>/gi,'<div$1><b><font size="2">');d=d.replace(/<H6([^>]*)>/gi,'<div$1><b><font size="1">');d=d.replace(/<\/H\d>/gi,"</font></b></div>");var c=new RegExp("(<P)([^>]*>[\\s\\S]*?)(</P>)","gi");d=d.replace(c,"<div$2</div>");d=d.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,"");d=d.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,"");d=d.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,"")}return d}}function lwrte_link(){var self=this;var panel=self.create_panel("Create link / Attach file",385);panel.append('<p><label>URL</label><input type="text" id="url" size="30" value=""><button id="file">Attach File</button><button id="view">View</button></p><div class="clear"></div><p><label>Title</label><input type="text" id="title" size="30" value=""><label>Target</label><select id="target"><option value="">default</option><option value="_blank">new</option></select></p><div class="clear"></div><p class="submit"><button id="ok">Ok</button><button id="cancel">Cancel</button></p>').show();$("#cancel",panel).click(function(){panel.remove();return false});var url=$("#url",panel);var upload=$("#file",panel).upload({autoSubmit:true,action:"uploader.php",onComplete:function(response){if(response.length<=0){return}response=eval("("+response+")");if(response.error&&response.error.length>0){alert(response.error)}else{url.val((response.file&&response.file.length>0)?response.file:"")}}});$("#view",panel).click(function(){(url.val().length>0)?window.open(url.val()):alert("Enter URL to view");return false});$("#ok",panel).click(function(){var url=$("#url",panel).val();var target=$("#target",panel).val();var title=$("#title",panel).val();if(self.get_selected_text().length<=0){alert("Select the text you wish to link!");return false}panel.remove();if(url.length<=0){return false}self.editor_cmd("unlink");self.editor_cmd("createLink",rte_tag);var tmp=$("<span></span>").append(self.get_selected_html());if(target.length>0){$('a[href*="'+rte_tag+'"]',tmp).attr("target",target)}if(title.length>0){$('a[href*="'+rte_tag+'"]',tmp).attr("title",title)}$('a[href*="'+rte_tag+'"]',tmp).attr("href",url);self.selection_replace_with(tmp.html());return false})}jQuery.extend({__stringPrototype:{JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"},blank:function(a){return/^\s*$/.test(this.s(a)||" ")},camelize:function(d){var b=this.s(d).split("-"),c;d=[b[0]];for(c=1;c<b.length;c++){d.push(b[c].charAt(0).toUpperCase()+b[c].substring(1))}d=d.join("");return this.r(arguments,0,d)},capitalize:function(a){a=this.s(a);a=a.charAt(0).toUpperCase()+a.substring(1).toLowerCase();return this.r(arguments,0,a)},dasherize:function(a){a=this.s(a).split("_").join("-");return this.r(arguments,0,a)},empty:function(a){return this.s(a)===""},endsWith:function(b,a){a=this.s(a);var c=a.length-b.length;return c>=0&&a.lastIndexOf(b)===c},escapeHTML:function(a){a=this.s(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return this.r(arguments,0,a)},evalJSON:function(sanitize,s){s=this.s(s);var json=this.unfilterJSON(false,s);try{if(!sanitize||this.isJSON(json)){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+s)},evalScripts:function(s){var scriptTags=this.extractScripts(this.s(s)),results=[];if(scriptTags.length>0){for(var i=0;i<scriptTags.length;i++){results.push(eval(scriptTags[i]))}}return results},extractScripts:function(c){var e=new RegExp(this.ScriptFragment,"img"),d=new RegExp(this.ScriptFragment,"im"),a=this.s(c).match(e)||[],f=[];if(a.length>0){for(var b=0;b<a.length;b++){f.push(a[b].match(d)[1]||"")}}return f},gsub:function(c,b,a){a=this.s(a);if(jQuery.isFunction(b)){a=this.sub(c,b,-1,a)}else{a=a.split(c).join(b)}return this.r(arguments,2,a)},include:function(b,a){return this.s(a).indexOf(b)>-1},inspect:function(b,c){c=this.s(c);var a;try{a=this.sub(/[\x00-\x1f\\]/,function(e){var f=jQuery.__stringPrototype.specialChar[e[0]];return f?f:"\\u00"+e[0].charCodeAt().toPaddedString(2,16)},-1,c)}catch(d){a=c}c=(b)?'"'+a.replace(/"/g,'\\"')+'"':"'"+a.replace(/'/g,"\\'")+"'";return this.r(arguments,1,c)},interpolate:function(f,e,c){c=this.s(c);if(!e){e=/(\#\{\s*(\w+)\s*\})/}var a=new RegExp(e.source,"g");var d=c.match(a),b;for(b=0;b<d.length;b++){c=c.replace(d[b],f[d[b].match(e)[2]])}return this.r(arguments,2,c)},isJSON:function(a){a=this.s(a);if(this.blank(a)){return false}a=a.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)},scan:function(c,b,a){a=this.s(a);this.sub(c,b,-1,a);return this.r(arguments,2,a)},startsWith:function(b,a){return this.s(a).indexOf(b)===0},strip:function(a){a=jQuery.trim(this.s(a));return this.r(arguments,0,a)},stripScripts:function(a){a=this.s(a).replace(new RegExp(this.ScriptFragment,"img"),"");return this.r(arguments,0,a)},stripTags:function(a){a=this.s(a).replace(/<\/?[^>]+>/gi,"");return this.r(arguments,0,a)},sub:function(h,d,e,c){c=this.s(c);if(h.source&&!h.global){var a=(h.ignoreCase)?"ig":"g";a+=(h.multiline)?"m":"";h=new RegExp(h.source,a)}var g=c.split(h),f=c.match(h);if(jQuery.browser.msie){if(c.indexOf(f[0])==0){g.unshift("")}if(c.lastIndexOf(f[f.length-1])==c.length-f[f.length-1].length){g.push("")}}e=(e<0)?(g.length-1):e||1;c=g[0];for(var b=1;b<g.length;b++){if(b<=e){if(jQuery.isFunction(d)){c+=d(f[b-1]||f)+g[b]}else{c+=d+g[b]}}else{c+=(f[b-1]||f)+g[b]}}return this.r(arguments,3,c)},succ:function(a){a=this.s(a);a=a.slice(0,a.length-1)+String.fromCharCode(a.charCodeAt(a.length-1)+1);return this.r(arguments,0,a)},times:function(d,c){c=this.s(c);var a="";for(var b=0;b<d;b++){a+=c}return this.r(arguments,1,a)},toJSON:function(a){return this.r(arguments,0,this.inspect(true,this.s(a)))},toQueryParams:function(f,c){c=this.s(c);var e=c.substring(c.indexOf("?")+1).split("#")[0].split(f||"&"),h={},b,a,d,g;for(b=0;b<e.length;b++){g=e[b].split("=");a=decodeURIComponent(g[0]);d=(g[1])?decodeURIComponent(g[1]):undefined;if(h[a]){if(typeof h[a]=="string"){h[a]=[h[a]]}h[a].push(d)}else{h[a]=d}}return h},truncate:function(c,a,b){b=this.s(b);c=c||30;a=(!a)?"...":a;b=(b.length>c)?b.slice(0,c-a.length)+a:String(b);return this.r(arguments,2,b)},underscore:function(a){a=this.sub(/[A-Z]/,function(b){return"_"+b.toLowerCase()},-1,this.s(a));if(a.charAt(0)=="_"){a=a.substring(1)}return this.r(arguments,0,a)},unescapeHTML:function(a){a=this.stripTags(this.s(a)).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");return this.r(arguments,0,a)},unfilterJSON:function(c,b){b=this.s(b);c=c||this.JSONFilter;var a=b.match(c);b=(a!==null)?a[1]:b;return this.r(arguments,1,jQuery.trim(b))},r:function(a,b,c){if(a.length>b||this.str===undefined){return c}else{this.str=""+c;return this}},s:function(a){if(a===""||a){return a}if(this.str===""||this.str){return this.str}return this}},string:function(a){if(a===String.prototype){jQuery.extend(String.prototype,jQuery.__stringPrototype)}else{return jQuery.extend({str:a},jQuery.__stringPrototype)}}});jQuery.__stringPrototype.parseQuery=jQuery.__stringPrototype.toQueryParams;(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:".",debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s)}else{alert(s)}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug=""}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter)}else{if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter)}}if(!p){p=detectParserForColumn(table,cells[i])}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(table.config.debug){log(parsersDebug)}return list}function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i]}}return parsers[0]}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i]}}return false}function buildCache(table){if(table.config.debug){var cacheTime=new Date()}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]))}cols.push(i);cache.normalized.push(cols);cols=null}if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime)}return cache}function getElementText(config,node){if(!node){return""}var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML}else{t=node.innerHTML}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node)}else{t=$(node).text()}}return t}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j])}}}if(table.config.appender){table.config.appender(table,rows)}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)}function buildHeaders(table){if(table.config.debug){var time=new Date()}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0}$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index)){this.sortDisabled=true}if(!this.sortDisabled){$(this).addClass(table.config.cssHeader)}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++))}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell)}}}return arr}function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true}return false}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true}return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table)}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i]}}}function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0}else{i=(v==(0||1))?v:0}return i}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true}}return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this)}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]])}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$("<colgroup>");$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($("<col>").css("width",$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date()}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime)}return cache}function sortText(a,b){return((a<b)?-1:((a>b)?1:0))}function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0))}function sortNumeric(a,b){return a-b}function sortNumericDesc(a,b){return b-a}function getCachedSortType(parsers,i){return parsers[i].type}this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies){return}var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j])}}}config.sortList.push([i,this.order])}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}}else{config.sortList.push([i,this.order])}}setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this)}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false}}if(a){parsers.push(parser)}};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i};this.isDigit=function(s,config){var DECIMAL="\\"+config.decimal;var exp="/(^[+]?0("+DECIMAL+"0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)"+DECIMAL+"(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*"+DECIMAL+"0+$)/";return RegExp(exp).test($.trim(s))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild){this.removeChild(this.firstChild)}}empty.apply(table.tBodies[0])}else{table.tBodies[0].innerHTML=""}}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""))},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s)},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s)},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s)},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s)},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2")}else{if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1")}else{if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")}}}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?"sortValue":c.parserMetadataName;return $(cell).metadata()[p]},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date()}$("tr:visible",table.tBodies[0]).filter(":even").removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(":odd").removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);(function(a){a.fn.tipsy=function(b){b=a.extend({fade:false,gravity:"n"},b||{});var c=null,d=false;this.hover(function(){a.data(this,"cancel.tipsy",true);var e=a.data(this,"active.tipsy");if(!e){e=a('<div class="tipsy"><div class="tipsy-inner">'+a(this).attr("title")+"</div></div>");e.css({position:"absolute",zIndex:100000});a(this).attr("title","");a.data(this,"active.tipsy",e)}var h=a.extend({},a(this).offset(),{width:this.offsetWidth,height:this.offsetHeight});e.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).appendTo(document.body);var f=e[0].offsetWidth,g=e[0].offsetHeight;switch(b.gravity.charAt(0)){case"n":e.css({top:h.top+h.height,left:h.left+h.width/2-f/2}).addClass("tipsy-north");break;case"s":e.css({top:h.top-g,left:h.left+h.width/2-f/2}).addClass("tipsy-south");break;case"e":e.css({top:h.top+h.height/2-g/2,left:h.left-f}).addClass("tipsy-east");break;case"w":e.css({top:h.top+h.height/2-g/2,left:h.left+h.width}).addClass("tipsy-west");break}if(b.fade){e.css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:1})}else{e.css({visibility:"visible"})}},function(){a.data(this,"cancel.tipsy",false);var e=this;setTimeout(function(){if(a.data(this,"cancel.tipsy")){return}var f=a.data(e,"active.tipsy");if(b.fade){f.stop().fadeOut(function(){a(this).remove()})}else{f.remove()}},100)})}})(jQuery);(function(a){a.extend(a.fn,{validate:function(b){if(!this.length){b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var c=a.data(this[0],"validator");if(c){return c}c=new a.validator(b,this[0]);a.data(this[0],"validator",c);if(c.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){c.cancelSubmit=true});this.submit(function(d){if(c.settings.debug){d.preventDefault()}function e(){if(c.settings.submitHandler){c.settings.submitHandler.call(c,c.currentForm);return false}return true}if(c.cancelSubmit){c.cancelSubmit=false;return e()}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;return false}return e()}else{c.focusInvalid();return false}})}return c},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var c=false;var b=a(this[0].form).validate();this.each(function(){c|=b.element(this)});return c}},removeAttrs:function(d){var b={},c=this;a.each(d.split(/\s/),function(e,f){b[f]=c.attr(f);c.removeAttr(f)});return b},rules:function(e,b){var g=this[0];if(e){var d=a.data(g.form,"validator").settings;var j=d.rules;var k=a.validator.staticRules(g);switch(e){case"add":a.extend(k,a.validator.normalizeRule(b));j[g.name]=k;if(b.messages){d.messages[g.name]=a.extend(d.messages[g.name],b.messages)}break;case"remove":if(!b){delete j[g.name];return k}var h={};a.each(b.split(/\s/),function(l,m){h[m]=k[m];delete k[m]});return h}}var f=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(g),a.validator.classRules(g),a.validator.attributeRules(g),a.validator.staticRules(g)),g);if(f.required){var c=f.required;delete f.required;f=a.extend({required:c},f)}return f}});a.extend(a.expr[":"],{blank:function(b){return !a.trim(b.value)},filled:function(b){return !!a.trim(b.value)},unchecked:function(b){return !b.checked}});a.format=function(b,c){if(arguments.length==1){return function(){var d=a.makeArray(arguments);d.unshift(b);return a.format.apply(this,d)}}if(arguments.length>2&&c.constructor!=Array){c=a.makeArray(arguments).slice(1)}if(c.constructor!=Array){c=[c]}a.each(c,function(d,e){b=b.replace(new RegExp("\\{"+d+"\\}","g"),e)});return b};a.validator=function(b,c){this.settings=a.extend({},a.validator.defaults,b);this.currentForm=c;this.init()};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(b){this.lastActive=b;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,b,this.settings.errorClass);this.errorsFor(b).hide()}},onfocusout:function(b){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b){if(b.name in this.submitted||b==this.lastElement){this.element(b)}},onclick:function(b){if(b.name in this.submitted){this.element(b)}},highlight:function(c,b){a(c).addClass(b)},unhighlight:function(c,b){a(c).removeClass(b)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.format("Please enter no more than {0} characters."),minlength:a.format("Please enter at least {0} characters."),rangelength:a.format("Please enter a value between {0} and {1} characters long."),range:a.format("Please enter a value between {0} and {1}."),max:a.format("Please enter a value less than or equal to {0}."),min:a.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=(this.groups={});a.each(this.settings.groups,function(e,f){a.each(f.split(/\s/),function(h,g){b[g]=e})});var d=this.settings.rules;a.each(d,function(e,f){d[e]=a.validator.normalizeRule(f)});function c(f){var e=a.data(this[0].form,"validator");e.settings["on"+f.type]&&e.settings["on"+f.type].call(e,this[0])}a(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",c).delegate("click",":radio, :checkbox",c);if(this.settings.invalidHandler){a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);if(!this.valid()){a(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var b=0,c=(this.currentElements=this.elements());c[b];b++){this.check(c[b])}return this.valid()},element:function(c){c=this.clean(c);this.lastElement=c;this.prepareElement(c);this.currentElements=a(c);var b=this.check(c);if(b){delete this.invalid[c.name]}else{this.invalid[c.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return b},showErrors:function(c){if(c){a.extend(this.errorMap,c);this.errorList=[];for(var b in c){this.errorList.push({message:c[b],element:this.findByName(b)[0]})}this.successList=a.grep(this.successList,function(d){return !(d.name in c)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(a.fn.resetForm){a(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(d){var c=0;for(var b in d){c++}return c},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name==b.name}).length==1&&b},elements:function(){var c=this,b={};return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&c.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!c.objectLength(a(this).rules())){return false}b[this.name]=true;return true})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.formSubmitted=false;this.currentElements=a([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(b){this.reset();this.toHide=this.errorsFor(b)},check:function(c){c=this.clean(c);if(this.checkable(c)){c=this.findByName(c.name)[0]}var h=a(c).rules();var d=false;for(method in h){var g={method:method,parameters:h[method]};try{var b=a.validator.methods[method].call(this,c.value,c,g.parameters);if(b=="dependency-mismatch"){d=true;continue}d=false;if(b=="pending"){this.toHide=this.toHide.not(this.errorsFor(c));return}if(!b){this.formatAndAdd(c,g);return false}}catch(f){this.settings.debug&&window.console&&console.log("exception occured when checking element "+c.id+", check the '"+g.method+"' method");throw f}}if(d){return}if(this.objectLength(h)){this.successList.push(c)}return true},customMetaMessage:function(b,d){if(!a.metadata){return}var c=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return c&&c.messages&&c.messages[d]},customMessage:function(c,d){var b=this.settings.messages[c];return b&&(b.constructor==String?b:b[d])},findDefined:function(){for(var b=0;b<arguments.length;b++){if(arguments[b]!==undefined){return arguments[b]}}return undefined},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,d){var c=this.defaultMessage(b,d.method);if(typeof c=="function"){c=c.call(this,d.parameters,b)}this.errorList.push({message:c,element:b});this.errorMap[b.name]=c;this.submitted[b.name]=c},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parents(this.settings.wrapper))}return b},defaultShowErrors:function(){for(var c=0;this.errorList[c];c++){var b=this.errorList[c];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass);this.showLabel(b.element,b.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var c=0;this.successList[c];c++){this.showLabel(this.successList[c])}}if(this.settings.unhighlight){for(var c=0,d=this.validElements();d[c];c++){this.settings.unhighlight.call(this,d[c],this.settings.errorClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(c,d){var b=this.errorsFor(c);if(b.length){b.removeClass().addClass(this.settings.errorClass);b.attr("generated")&&b.html(d)}else{b=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(c),generated:true}).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper){b=b.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(b).length){this.settings.errorPlacement?this.settings.errorPlacement(b,a(c)):b.insertAfter(c)}}if(!d&&this.settings.success){b.text("");typeof this.settings.success=="string"?b.addClass(this.settings.success):this.settings.success(b)}this.toShow=this.toShow.add(b)},errorsFor:function(b){return this.errors().filter("[for='"+this.idOrName(b)+"']")},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)},checkable:function(b){return/radio|checkbox/i.test(b.type)},findByName:function(b){var c=this.currentForm;return a(document.getElementsByName(b)).map(function(d,e){return e.form==c&&e.name==b&&e||null})},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b)){return this.findByName(b.name).filter(":checked").length}}return c.length},depend:function(c,b){return this.dependTypes[typeof c]?this.dependTypes[typeof c](c,b):true},dependTypes:{"boolean":function(c,b){return c},string:function(c,b){return !!a(c,b.form).length},"function":function(c,b){return c(b)}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true}},stopRequest:function(b,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[b.name];if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit()}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this])}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(c){var d={};var b=a(c).attr("class");b&&a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(d,a.validator.classRuleSettings[this])}});return d},attributeRules:function(c){var e={};var b=a(c);for(method in a.validator.methods){var d=b.attr(method);if(d){e[method]=d}}if(e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)){delete e.maxlength}return e},metadataRules:function(b){if(!a.metadata){return{}}var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(c){var d={};var b=a.data(c.form,"validator");if(b.settings.rules){d=a.validator.normalizeRule(b.settings.rules[c.name])||{}}return d},normalizeRules:function(c,b){a.each(c,function(f,e){if(e===false){delete c[f];return}if(e.param||e.depends){var d=true;switch(typeof e.depends){case"string":d=!!a(e.depends,b.form).length;break;case"function":d=e.depends.call(b,b);break}if(d){c[f]=e.param!==undefined?e.param:true}else{delete c[f]}}});a.each(c,function(d,e){c[d]=a.isFunction(e)?e(b):e});a.each(["minlength","maxlength","min","max"],function(){if(c[this]){c[this]=Number(c[this])}});a.each(["rangelength","range"],function(){if(c[this]){c[this]=[Number(c[this][0]),Number(c[this][1])]}});if(a.validator.autoCreateRanges){if(c.min&&c.max){c.range=[c.min,c.max];delete c.min;delete c.max}if(c.minlength&&c.maxlength){c.rangelength=[c.minlength,c.maxlength];delete c.minlength;delete c.maxlength}}if(c.messages){delete c.messages}return c},normalizeRule:function(c){if(typeof c=="string"){var b={};a.each(c.split(/\s/),function(){b[this]=true});c=b}return c},addMethod:function(b,d,c){a.validator.methods[b]=d;a.validator.messages[b]=c;if(d.length<3){a.validator.addClassRules(b,a.validator.normalizeRule(b))}},methods:{required:function(d,c,e){if(!this.depend(e,c)){return"dependency-mismatch"}switch(c.nodeName.toLowerCase()){case"select":var b=a("option:selected",c);return b.length>0&&(c.type=="select-multiple"||(a.browser.msie&&!(b[0].attributes.value.specified)?b[0].text:b[0].value).length>0);case"input":if(this.checkable(c)){return this.getLength(d,c)>0}default:return a.trim(d).length>0}},remote:function(f,c,g){if(this.optional(c)){return"dependency-mismatch"}var d=this.previousValue(c);if(!this.settings.messages[c.name]){this.settings.messages[c.name]={}}this.settings.messages[c.name].remote=typeof d.message=="function"?d.message(f):d.message;g=typeof g=="string"&&{url:g}||g;if(d.old!==f){d.old=f;var b=this;this.startRequest(c);var e={};e[c.name]=f;a.ajax(a.extend(true,{url:g,mode:"abort",port:"validate"+c.name,dataType:"json",data:e,success:function(j){if(j){var h=b.formSubmitted;b.prepareElement(c);b.formSubmitted=h;b.successList.push(c);b.showErrors()}else{var k={};k[c.name]=j||b.defaultMessage(c,"remote");b.showErrors(k)}d.valid=j;b.stopRequest(c,j)}},g));return"pending"}else{if(this.pending[c.name]){return"pending"}}return d.valid},minlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)>=d},maxlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)<=d},rangelength:function(d,b,e){var c=this.getLength(a.trim(d),b);return this.optional(b)||(c>=e[0]&&c<=e[1])},min:function(c,b,d){return this.optional(b)||c>=d},max:function(c,b,d){return this.optional(b)||c<=d},range:function(c,b,d){return this.optional(b)||(c>=d[0]&&c<=d[1])},email:function(c,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(c)},url:function(c,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(c)},date:function(c,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(c))},dateISO:function(c,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(c)},dateDE:function(c,b){return this.optional(b)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(c)},number:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(c)},numberDE:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(c)},digits:function(c,b){return this.optional(b)||/^\d+$/.test(c)},creditcard:function(f,c){if(this.optional(c)){return"dependency-mismatch"}if(/[^0-9-]+/.test(f)){return false}var g=0,e=0,b=false;f=f.replace(/\D/g,"");for(n=f.length-1;n>=0;n--){var d=f.charAt(n);var e=parseInt(d,10);if(b){if((e*=2)>9){e-=9}}g+=e;b=!b}return(g%10)==0},accept:function(c,b,d){d=typeof d=="string"?d:"png|jpe?g|gif";return this.optional(b)||c.match(new RegExp(".("+d+")$","i"))},equalTo:function(c,b,d){return c==a(d).val()}}})})(jQuery);(function(c){var b=c.ajax;var a={};c.ajax=function(e){e=c.extend(e,c.extend({},c.ajaxSettings,e));var d=e.port;if(e.mode=="abort"){if(a[d]){a[d].abort()}return(a[d]=b.apply(this,arguments))}return b.apply(this,arguments)}})(jQuery);(function(a){a.each({focus:"focusin",blur:"focusout"},function(c,b){a.event.special[b]={setup:function(){if(a.browser.msie){return false}this.addEventListener(c,a.event.special[b].handler,true)},teardown:function(){if(a.browser.msie){return false}this.removeEventListener(c,a.event.special[b].handler,true)},handler:function(d){arguments[0]=a.event.fix(d);arguments[0].type=b;return a.event.handle.apply(this,arguments)}}});a.extend(a.fn,{delegate:function(d,c,b){return this.bind(d,function(e){var f=a(e.target);if(f.is(c)){return b.apply(f,arguments)}})},triggerEvent:function(b,c){return this.triggerHandler(b,[a.event.fix({type:b,target:c})])}})})(jQuery);var Youserbase={CurrentTitle:document.title,Growl:{messages:[],notifier:function(){if(Youserbase.Growl.messages.length){while(message=Youserbase.Growl.messages.shift()){$.jGrowl(message.message,{sticky:message.sticky||false,header:message.header||"",theme:message.theme||null,life:5000})}}},add:function(a,b,d,c){Youserbase.Growl.messages.push({theme:a,message:b,header:d||"",sticky:c||false})}},loaded:false,consume:function(a){a=$(a||"body");$("form:not(.consumed)",a).addClass("consumed").submit(function(){if($(this).is("form.validate")&&!$(this).valid()){return false}if($(this).is(".ajax")){$(this).trigger("live_submit");return false}}).find(".validate").validate();$(".sortable:not(table)",a).removeClass("sortable").sortable({});$("table.sortable",a).removeClass("sortable").tablesorter().find("thead tr th").append('<span class="sort-icon asc">&#x25BC;</span><span class="sort-icon desc">&#x25B2;</span>');$("ul.tabify",a).removeClass("tabify").each(function(){var b=$("li",this),d=Math.max(b.index(b.filter(".ui-tabs-selected")),0),e=$("li:eq("+d+") a",this),g=e.attr("href");e.attr("href","#"+e.attr("title"));$(this).parent().tabs({spinner:BabelFish("TABSLOADING")+"&hellip;",selected:d,show:function(){$(document).trigger("change_title")},select:function(h,j){location.hash="#"+$(j.panel).attr("id")}}).tabs("url",d,g);if(location.hash){var f=location.hash.replace(/^#/,""),c=$("a",b);if(c.filter("[title="+f+"]").length){$(this).parent().tabs("select",c.index(c.filter("[title="+f+"]")))}}});$("select.slider:not(.consumed)",a).addClass("consumed").each(function(d){var c=$(this),e=$("option:first",c).val(),b=$("option:last",c).val();c.after('<div class="ui-slider"><span class="slider-boundary lower">'+e+'</span><span class="slider-boundary upper">'+b+"</span></div>").next().slider({min:e,max:b,startValue:$(this).find("option:selected").val(),stepping:$(this).find("option:odd:first").val()-$(this).find("option:even:first").val(),slide:function(g,f){c.val(f.value)}}).change(function(){$(this).next().slider("moveTo",$(this).val())})});$(".add_datepicker",a).removeClass("add_datepicker").datepicker({dateFormat:"yy-mm-dd",changeYear:true,changeMonth:true,yearRange:"1900:"+(new Date()).getFullYear()});$(".tipsify",a).removeClass("tipsify").each(function(){var b=$(this).hasClass("south")?"s":$(this).hasClass("west")?"w":$(this).hasClass("east")?"e":"n";$(this).tipsy({gravity:b})});$("textarea.autogrow",a).removeClass("autogrow").autogrow();$(".onchange_submit",a).removeClass("onchange_submit").change(function(){$(this).submit()}).find(":submit,:button").remove();$("select.select_or_input",a).removeClass("select_or_input").change(function(){if(parseInt($(this).val())<0){$(this).next().fadeIn().attr("disabled",false)}else{$(this).next().fadeOut().attr("disabled",true)}}).change();$(".highlight",a).removeClass("highlight").mouseenter(function(){if($(this).hasClass("column")||!$(this).hasClass("row")){var b=$(this).parent().children().index(this)+1;$("tr > *:nth-child("+b+")",$(this).closest("tbody")).addClass("highlighted")}if($(this).hasClass("row")||!$(this).hasClass("column")){$(this).closest("tr").addClass("highlighted")}}).mouseleave(function(){if($(this).is("td")){$("td.highlighted, th.highlighted",$(this).closest("tbody")).removeClass("highlighted")}else{$(".highlighted",$(this).closest("tbody")).removeClass("highlighted")}});$("div.pagination:not(.consumed)",a).addClass("consumed").each(function(){YB_Pagination.initialize(this)});$(".accordion").removeClass("accordion").accordion({active:false,alwaysOpen:false,autoHeight:false,clearStyle:true,header:".ui-accordion-header",navigation:true})}};$.jGrowl.defaults.position="bottom-left";$.datepicker.setDefaults({showOn:"both",buttonImageOnly:true,buttonImage:Assets.Image("famfamfam/calendar_view_day.png"),buttonText:BabelFish("CALENDAR")});$.tablesorter.defaults.widgets=["zebra"];$.tablesorter.defaults.widgetZebra={css:["a0","a1"]};$.tablesorter.addParser({id:"timestamp",is:function(a){return false},format:function(a){return $.trim(a).replace("&nbsp;","").length?$(a).attr("rel"):0},type:"numeric"});(function(b){var a=0;b("a.ajax").live("click",function(h){if(b(this).is(".confirm")){var g=b(this).attr("title")?'\n\n"'+b(this).attr("title")+'"':"";if(!confirm(BabelFish("CONFIRMACTION")+g)){return false}}var j=null,e=null,d=null,f=null,c=null;b(this).attr("className").replace(/target:('[^']+'|\S+)/,function(m,l){j=l});j=(j||"").replace(/closest:(.*)/,function(m,l){f=l;return""});b(this).attr("className").replace(/class:(?:(\'?)([^\']+)\\1|(\S+))/,function(o,m,l,q){e=l||q||null});b(this).attr("className").replace(/effect:(?:(\'?)([^\']+)\\1|(\S+))/,function(o,m,l,q){d=l||q||null});if(j=="tab"&&b(this).closest(".ui-tabs-panel").length){c=b(this).closest(".ui-tabs-panel")}else{if(j=="reload"&&b(this).closest(".ui-tabs-panel").length){var k=b("#"+b(this).closest(".ui-tabs-panel").attr("rel"));k.tabs("load",k.data("selected.tabs"))}else{if(j=="reload"){location.reload()}else{if(j){c=b(j)}else{if(!j&&f){c=b(this).closest(f)}else{if(b(this).next().is(".ajax_content")&&b(this).is(".toggle")){b(this).next().hide(d).queue(function(){b(this).remove()})}else{if(b(this).next().is(".ajax_content")){c=b(this).next()}else{c=b('<div style="display: none;"/>').addClass("ajax_content").html('<img src="'+Assets.Image("ajax_indicator_big.gif")+'"/>').insertAfter(this).show(d)}}}}}}}if(c){c.addClass(e).load(b(this).attr("href"))}return false});b("body").live("live_submit",function(d){var c=b(d.target);c.ajaxSubmit(function(j,e,k){var o=b(k[0]),l=null,m=null,q=null,f=null,h=null;o.attr("className").replace(/target:('[^']+'|\S+)/,function(s,r){l=r});l=(l||"").replace(/closest:(.*)/,function(s,r){f=r;return""});o.attr("className").replace(/class:(?:(\'?)([^\']+)\\1|(\S+))/,function(t,s,r,u){m=r||u||null});o.attr("className").replace(/effect:(?:(\'?)([^\']+)\\1|(\S+))/,function(t,s,r,u){q=r||u||null});if(l=="tab"&&o.closest(".ui-tabs-panel").length){h=o.closest(".ui-tabs-panel")}else{if(l=="reload"&&o.closest(".ui-tabs-panel").length){var g=b("#"+o.closest(".ui-tabs-panel").attr("rel"));g.tabs("load",g.data("selected.tabs"))}else{if(l=="reload"){location.reload()}else{if(l){h=b(l)}else{if(!l&&f){h=o.closest(f)}else{b(document).trigger("ajax_submit_complete",j)}}}}}if(h){h.html(j)}o.trigger("submitted",[j])})})})(jQuery);var BabelFish=(function(){var a={CALENDAR:"Calendar",CONFIRMACTION:"Confirm action",TABSLOADING:"Tab is loading",SHADOWBOX_OF:"of",SHADOWBOX_LOADING:"loading",SHADOWBOX_CANCEL:"Cancel",SHADOWBOX_NEXT:"Next",SHADOWBOX_PREVIOUS:"Previous",SHADOWBOX_PLAY:"Play",SHADOWBOX_PAUSE:"Pause",SHADOWBOX_CLOSE:"Close",SHADOWBOX_ERROR_SINGLE:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',SHADOWBOX_ERROR_SHARED:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',SHADOWBOX_ERROR_EITHER:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.',RATING_0:"RATING_0",RATING_1:"RATING_1",RATING_2:"RATING_2",RATING_3:"RATING_3",RATING_4:"RATING_4",RATING_5:"RATING_5",RATING_IS_DONE:"RATING_IS_DONE",RATING_DISABLED:"RATING_DISABLED"};return function(b){return a[b]||("Untranslated: "+b)}}());var Assets={Image:function(a){return"http://assets1.youserbase.org/images/"+a}};var GLOBALS={Language:"uk",URLS:{"Dropbox-Refresh":"uk/Dock/Dropbox/Get","Dropbox-Remove":"uk/Dock/Dropbox/Remove","Babelfish-Update":"uk/System/Babelfish/Update","Babelfish-Load":"uk/System/Babelfish/Load","Babelfish-Tell":"uk/System/Babelfish/Tell","Page-Load":"uk/System/Pages/Load"}};(function($){if($.fn.retrieve||$.fn.store){return}$.fn.retrieve=function(key){var $this=$(this),value=$this.data(key);if(!value&&$this.attr("class").indexOf("stored:"+key+":")!==-1){value=$this.attr("class").match("stored:"+key+":(\\S+)")[1];$this.removeClass("stored:"+key+":"+value);value=decodeURI(value);if(!value.match('^(null|true|false|{.*}|".*"|-?\\d+(?:\\.\\d+)?)$')){value='"'+value+'"'}eval("value = ("+value+");");$this.data(key,value)}return value};$.fn.store=function(key,value){$(this).data(key,value)}})(jQuery);$(".BACK").livequery("click",function(){history.back(1);return false});$(".DELETE").livequery("click",function(){var a=$(this).metadata().message;if(typeof(a)=="undefined"){a="DELETING OK?"}return confirm(a);return false});$(".CONFIRM").livequery("click",function(b){var a=$(this).metadata().message;if(typeof(a)=="undefined"){a="OK?"}return confirm(a)});$(".ALERT:not(select, option)").livequery("click",function(c){var b=$(this).metadata().message;var a=$(this).metadata().returning;if(typeof(b)=="undefined"){b="OK!"}if(typeof(a)=="undefined"){a=false}alert(b);return a});$("select.ALERT").livequery("change",function(c){$.log($(this).val());if(!$('option[value="'+$(this).val()+'"]',this).hasClass("ALERT")){$(".indication.none").slideUp("fast");return}var b=$(this).metadata().message;var a=$(this).metadata().returning;if(typeof(b)=="undefined"){b="OK!"}if(typeof(a)=="undefined"){a=false}alert(b);$(".indication.none").slideDown("slow");return a});$(".BLANK").livequery("click",function(a){$.getlocations($(this).attr("href"),"_blank");return false});$(".SCRIPT_LINK").livequery("click",function(a){$.getlocations($(this).metadata().link);return false});$(".OPEN_WINDOW").livequery("click",function(c){var b=$(this).metadata().width;var a=$(this).metadata().height;if(typeof(b)=="undefined"){b=screen.width*0.6}if(typeof(a)=="undefined"){a=screen.height*0.6}$.getlocations($(this).attr("href"),"_blank","width="+b+", height="+a+", scrollbars=yes");return false});$(".CLOSE").livequery("click",function(b){var a=$(this).metadata().DOM;$(a).hide();return false});$(".FILE_CHOOSEN").livequery("click",function(b){var a=$(this).metadata().DOM;var c=$(a);if(c.val()==""){c.parent().addClass("inputhint");alert($(this).metadata().message);return false}return true});$(".CLICK_INDICATOR").livequery("click",function(){$(this).addClass("indicator");return true});$(".image.youtube").live("mouseover",function(){var a=$(this);if(!a.data("url")){a.data("url",a.attr("src"))}if(!a.data("running")){a.data("running",true);a.data("index",-1);a.data("start",(new Date().getTime()));a.data("interval",setInterval(function(){var b=Math.floor(((new Date()).getTime()-a.data("start"))/1000);if(b>a.data("index")){a.attr("src",a.data("url").replace(/default\.jpg$/,((b%3)+1)+".jpg"));a.data("index",b)}},100))}}).live("mouseout",function(){var a=$(this);clearInterval(a.data("interval"));a.data("running",false);a.attr("src",a.data("url"))});(function(c){var b=[38,38,40,40,37,39,37,39,66,65],a=0;c(window).keyup(function(d){a+=(d.keyCode===b[a])?1:-a;if(a>=b.length){a=0;console.log("Konami cheat code enabled, you now have infinite lives and credits")}})})(jQuery);jQuery(function(c){var b=false;function d(l){var f=0,k=50,g="lb_"+(new Date()).getTime(),e=[],h=l.replace(new RegExp("<script[^>]*>([\\S\\s]*?)<\/script>","img"),function(m){e.push(m);return""}),j=c('<div id="'+g+'" style="position: absolute; left: -5000px; top: -5000px;"/>').html(h).appendTo("body");c("img",j).each(function(){f+=1;var m=new Image;m.onload=m.onerror=function(){f-=1};m.src=c(this).attr("src")});(function(){if(f&&k--){setTimeout(arguments.callee,10)}else{Shadowbox.open({player:"html",title:c(this).attr("title")||"",content:l,width:Math.max(500,j.outerWidth(true)+50),height:Math.max(300,j.outerHeight(true)+50)});j.remove();Shadowbox.applyOptions({onFinish:function(){var m;Youserbase.consume();while(m=e.shift()){c(m).appendTo(c("head"))}}})}})()}Shadowbox.LANG={code:GLOBALS.Language,of:BabelFish("SHADOWBOX_OF"),loading:BabelFish("SHADOWBOX_LOADING"),cancel:BabelFish("SHADOWBOX_CANCEL"),next:BabelFish("SHADOWBOX_NEXT"),previous:BabelFish("SHADOWBOX_PREVIOUS"),play:BabelFish("SHADOWBOX_PLAY"),pause:BabelFish("SHADOWBOX_PAUSE"),close:BabelFish("SHADOWBOX_CLOSE"),errors:{single:BabelFish("SHADOWBOX_ERROR_SINGLE"),shared:BabelFish("SHADOWBOX_ERROR_SHARED"),either:BabelFish("SHADOWBOX_ERROR_EITHER")}};var a=null;Shadowbox.init({skipSetup:true,animSequence:"sync",enableKeys:false,onOpen:function(){a=a||document.title;c(document).trigger("change_title");b=true},onClose:function(){if(a){Youserbase.CurrentTitle=a}c(document).trigger("change_title");a=null;b=false}});c("a.lightbox:not(.close)").live("click",function(e){if((e.button!=(c.browser.msie?1:0))||e.metaKey||e.shiftKey||e.altKey){return}c.get(c(this).attr("href"),d);return false});c(".lightbox.close").live("click",function(){Shadowbox.close();return false});c("body").ajaxComplete(function(e,f){if(!f){return}if(f.getResponseHeader("X-Close-Lightbox")){Shadowbox.close()}});c(document).bind("submitted.lightbox",function(f,e){if(b&&e.length){d(e)}}).keydown(function(e){if(b&&e.keyCode==27){Shadowbox.close();return false}})});var YB_Pagination={options:{origin:["top","left"]},initialize:function(a){$(".divider",a).each(function(){var d=$(this).attr("rel").split("-",4);var c=$("<div/>").addClass("more").hide();for(var b=parseInt(d[0]);b<=d[1];b++){c.append($("<a/>").attr({href:d[3]+b,className:d[2]}).text(b+1)).append("\n")}$(this).css({cursor:"pointer"}).prepend(c).click(function(e){$("div.more:visible",e.target).hide("scale",YB_Pagination.options,null,function(){YB_Pagination.unregister_hide()});if($("div.more",this).is(":not(:visible)")){$("div.more:visible").hide("scale",YB_Pagination.options);$("div.more",this).show("scale",YB_Pagination.options,null,function(){YB_Pagination.register_hide()})}})})},click_handled:false,click_handler:function(a){if($(a.target).parents().andSelf().is(".divider")){return}YB_Pagination.unregister_hide();$("div.more:visible").hide("scale",YB_Pagination.options,"fast")},register_hide:function(){if(YB_Pagination.click_handled){return}YB_Pagination.click_handled=true;$("body").click(YB_Pagination.click_handler)},unregister_hide:function(){if(!YB_Pagination.click_handled){return}YB_Pagination.click_handled=false;$("body").unbind("click",YB_Pagination.click_handler)}};jQuery(function(c){if(!c("meta[name=PollAdress]").length){return}var e=null,a=c("meta[name=PollAdress]").attr("content"),d=c("meta[name=PollFrequency]").attr("content")||30000,b=null;function f(){if(e&&((new Date()).getTime()-e)>d){c.getJSON(a,function(g){c.each(g,function(h){if(g[h]!==c.trim(c("#poll_"+h).text())){c("#poll_"+h).text(g[h]).parent().effect("pulsate",{times:2},1000)}});e=(new Date()).getTime()})}window.clearTimeout(b);b=window.setTimeout(arguments.callee,d);e=(new Date()).getTime()}c(window.document).blur(function(){window.clearTimeout(b)}).focus(f);f()});(function(f){var c=200,b=[BabelFish("RATING_0"),BabelFish("RATING_1"),BabelFish("RATING_2"),BabelFish("RATING_3"),BabelFish("RATING_4"),BabelFish("RATING_5")],e=BabelFish("IS_DONE"),d=BabelFish("DISABLED"),a="";f(".ratingbox:not(.disable, .isdone)").livequery("mousemove",function(k){var o=f(this),j=o.hasClass("ratingbox_small")?50:100,m=o.hasClass("ratingbox_small")?26:50,g=k.clientX-o.offset().left,l=Math.round(Math.min(j,Math.max(0,g-m))/(j/10)),h=(l==Math.round(l)&&l!=10)?l+".0":l;f(".indicator > span:first",o).hide().siblings().show().text(b[Math.round(l/2)]);f(".rating_user .index",o).width(g);f(".score",o).text(h)});f(".ratingbox:not(.disable, .isdone)").livequery("mouseenter",function(g){var h=f(this);f(".rating_user",h).show();a=f(".score",h).text()});f(".ratingbox.isdone").livequery("mouseenter",function(g){var h=f(this);f(".indicator > span:first",h).hide().siblings().show().text(e);a=f(".score",h).text()});f(".ratingbox:not(.disable)").livequery("mouseleave",function(g){var h=f(this);f(".rating_user",h).hide();f(".indicator > span:first",h).show().siblings().hide();f(".score",h).text(a)});f(".ratingbox:not(.disable, .isdone)").livequery("click",function(h){var j=f(this),g=f(".score",j).text();f(".rating_user",j).hide();f(".rating_user",j).hide();f(".indicator > span:first",j).show().siblings().hide();f(".score",j).text(a);f(".ratingbox_canvas, .score",j).toggle();f(".ajax_indicator",j).toggle();f.get("Ratings/Display/Save?device_id="+j.retrieve("device_id")+"&table="+j.retrieve("table")+"&tab="+j.retrieve("tab")+"&rating="+g+"&sheet_tab="+j.retrieve("sheet_tab"));f(".phonesheet").load("datasheets/datasheets/phonesheet?device_id="+j.retrieve("device_id")+"&tab="+j.retrieve("sheet_tab"))})})(jQuery);if(window.jQuery){(function(a){a.rating={cancel:"Cancel Rating",cancelValue:"",split:0,starWidth:16,groups:{},event:{fill:function(f,c,b,d){this.drain(f);a(c).prevAll(".star_group_"+f).andSelf().addClass("star_"+(d||"hover"));var e=a(c).children("a");val=e.text();if(b.focus){b.focus.apply(a.rating.groups[f].valueElem[0],[val,e[0]])}},drain:function(d,c,b){a.rating.groups[d].valueElem.siblings(".star_group_"+d).removeClass("star_on").removeClass("star_hover")},reset:function(e,c,b){if(!a(a.rating.groups[e].current).is(".cancel")){a(a.rating.groups[e].current).prevAll(".star_group_"+e).andSelf().addClass("star_on")}var d=a(c).children("a");val=d.text();if(b.blur){b.blur.apply(a.rating.groups[e].valueElem[0],[val,d[0]])}},click:function(e,c,b){a.rating.groups[e].current=c;var d=a(c).children("a");val=d.text();a.rating.groups[e].valueElem.val(val);a.rating.event.drain(e,c,b);a.rating.event.reset(e,c,b);if(b.callback){b.callback.apply(a.rating.groups[e].valueElem[0],[val,d[0]])}}}};a.fn.rating=function(b){if(this.length==0){return this}b=a.extend({},a.rating,b||{});this.each(function(d){var e=a.extend({},b||{},(a.metadata?a(this).metadata():(a.meta?a(this).data():null))||{});var h=this.name.replace(/\[|\]/,"_");if(!a.rating.groups[h]){a.rating.groups[h]={count:0}}d=a.rating.groups[h].count;a.rating.groups[h].count++;a.rating.groups[h].readOnly=a.rating.groups[h].readOnly||e.readOnly||a(this).attr("disabled");if(d==0){a.rating.groups[h].valueElem=a('<input type="hidden" name="'+h+'" value=""'+(e.readOnly?' disabled="disabled"':"")+">");a(this).before(a.rating.groups[h].valueElem);if(a.rating.groups[h].readOnly||e.required){}else{a(this).before(a('<div class="cancel"><a title="'+e.cancel+'">'+e.cancelValue+"</a></div>").mouseover(function(){a.rating.event.drain(h,this,e);a(this).addClass("star_on")}).mouseout(function(){a.rating.event.reset(h,this,e);a(this).removeClass("star_on")}).click(function(){a.rating.event.click(h,this,e)}))}}eStar=a('<div class="star"><a title="'+(this.title||this.value)+'">'+this.value+"</a></div>");a(this).after(eStar);if(e.half){e.split=2}if(typeof e.split=="number"&&e.split>0){var c=(a.fn.width?a(eStar).width():0)||e.starWidth;var g=(d%e.split),f=Math.floor(c/e.split);a(eStar).width(f).find("a").css({"margin-left":"-"+(g*f)+"px"})}a(eStar).addClass("star_group_"+h);if(a.rating.groups[h].readOnly){a(eStar).addClass("star_readonly")}else{a(eStar).addClass("star_live").mouseover(function(){a.rating.event.drain(h,this,e);a.rating.event.fill(h,this,e,"hover")}).mouseout(function(){a.rating.event.drain(h,this,e);a.rating.event.reset(h,this,e)}).click(function(){a.rating.event.click(h,this,e)})}if(this.checked){a.rating.groups[h].current=eStar}a(this).remove();if(d+1==this.length){a.rating.event.reset(h,this,e)}});for(n in a.rating.groups){(function(f,d,e){if(!f){return}a.rating.event.fill(e,f,b||{},"on");a(d).val(a(f).children("a").text())})(a.rating.groups[n].current,a.rating.groups[n].valueElem,n)}return this};a(function(){a("input[type=radio].star").rating()})})(jQuery)}$(document).ready(function(){$(".all_components").draggable({helper:"clone"});$(".components").droppable({accept:".all_components",activeClass:"droppable-active",hoverClass:"droppable-hover",drop:function(a,b){$(this).append('<option selected="selected" value='+b.draggable.html()+">"+b.draggable.html()+"</option>")}});$(".all_functions").draggable({helper:"clone"});$(".components").droppable({accept:".all_functions",activeClass:"droppable-active",hoverClass:"droppable-hover",drop:function(a,b){$(this).append('<option selected="selected" value='+b.draggable.html()+">"+b.draggable.html()+"</option>")}});$(".all_equipment").draggable({helper:"clone"});$(".components").droppable({accept:".all_equipment",activeClass:"droppable-active",hoverClass:"droppable-hover",drop:function(a,b){$(this).append('<option selected="selected" value='+b.draggable.html()+">"+b.draggable.html()+"</option>")}})});$(".rating_box").live("click",function(){var b=$("input[name='device_id']").val();var c=$("input[name='sheet_tab']").val();var a=$("input[name='link']").val();$.get(a,{device_id:b,tab:c},function(d){$("div .phonesheet").replaceWith(d)})});$(".rating_help").live("click",function(){$(".help").toggle()});var YB_Messages={open:function(a){a=$(a);a.after($("<div/>").addClass("message_content").hide().load(a.attr("href"),function(){a.addClass("open").parents("td").addClass("open").parents("tr").removeClass("new");$(this).show("blind")}))},close:function(a){a=$(a);a.next().hide("blind",{},"normal",function(){a.removeClass("open").parents("td").removeClass("open").end().next().remove()})}};