// jquery.dimensions
(function($){$.dimensions={version:"1.2"};$.each(["Height","Width"],function(i,name){$.fn["inner"+name]=function(){if(!this[0]){return}var torl=name=="Height"?"Top":"Left",borr=name=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+name]:num(this,name.toLowerCase())+num(this,"padding"+torl)+num(this,"padding"+borr)};$.fn["outer"+name]=function(options){if(!this[0]){return}var torl=name=="Height"?"Top":"Left",borr=name=="Height"?"Bottom":"Right";options=$.extend({margin:false},options||{});var val=this.is(":visible")?this[0]["offset"+name]:num(this,name.toLowerCase())+num(this,"border"+torl+"Width")+num(this,"border"+borr+"Width")+num(this,"padding"+torl)+num(this,"padding"+borr);return val+(options.margin?(num(this,"margin"+torl)+num(this,"margin"+borr)):0)}});$.each(["Left","Top"],function(i,name){$.fn["scroll"+name]=function(val){if(!this[0]){return}return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=="Left"?val:$(window)["scrollLeft"](),name=="Top"?val:$(window)["scrollTop"]()):this["scroll"+name]=val}):this[0]==window||this[0]==document?self[(name=="Left"?"pageXOffset":"pageYOffset")]||$.boxModel&&document.documentElement["scroll"+name]||document.body["scroll"+name]:this[0]["scroll"+name]}});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,"marginTop");offset.left-=num(elem,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent}return $(offsetParent)}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0}})(jQuery);
//ddaccordion
var ddaccordion={contentclassname:{},expandone:function(headerclass,selected){this.toggleone(headerclass,selected,"expand")},collapseone:function(headerclass,selected){this.toggleone(headerclass,selected,"collapse")},expandall:function(headerclass){var $=jQuery;var $headers=$("."+headerclass);$("."+this.contentclassname[headerclass]+":hidden").each(function(){$headers.eq(parseInt($(this).attr("contentindex"))).trigger("evt_accordion")})},collapseall:function(headerclass){var $=jQuery;var $headers=$("."+headerclass);$("."+this.contentclassname[headerclass]+":visible").each(function(){$headers.eq(parseInt($(this).attr("contentindex"))).trigger("evt_accordion")})},toggleone:function(headerclass,selected,optstate){var $=jQuery;var $targetHeader=$("."+headerclass).eq(selected);var $subcontent=$("."+this.contentclassname[headerclass]).eq(selected);if(typeof optstate=="undefined"||optstate=="expand"&&$subcontent.is(":hidden")||optstate=="collapse"&&$subcontent.is(":visible")){$targetHeader.trigger("evt_accordion")}},expandit:function($targetHeader,$targetContent,config,useractivated){$targetContent.slideDown(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr("headerindex")),$targetContent.css("display"),useractivated)});this.transformHeader($targetHeader,config,"expand")},collapseit:function($targetHeader,$targetContent,config,isuseractivated){$targetContent.slideUp(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr("headerindex")),$targetContent.css("display"),isuseractivated)});this.transformHeader($targetHeader,config,"collapse")},transformHeader:function($targetHeader,config,state){$targetHeader.addClass((state=="expand")?config.cssclass.expand:config.cssclass.collapse).removeClass((state=="expand")?config.cssclass.collapse:config.cssclass.expand);if(config.htmlsetting.location=="src"){$targetHeader=($targetHeader.is("img"))?$targetHeader:$targetHeader.find("img").eq(0);$targetHeader.attr("src",(state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}else{if(config.htmlsetting.location=="prefix"){$targetHeader.find(".accordprefix").html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}else{if(config.htmlsetting.location=="suffix"){$targetHeader.find(".accordsuffix").html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}}}},urlparamselect:function(headerclass){var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)","i"));if(result!=null){result=RegExp.$1.split(",")}return result},getCookie:function(Name){var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re)){return document.cookie.match(re)[0].split("=")[1]}return null},setCookie:function(name,value){document.cookie=name+"="+value+"; path=/"},init:function(config){document.write('<style type="text/css">\n');document.write("."+config.contentclass+"{display: none}\n");document.write("</style>");jQuery(document).ready(function($){ddaccordion.urlparamselect(config.headerclass);var persistedheaders=ddaccordion.getCookie(config.headerclass);ddaccordion.contentclassname[config.headerclass]=config.contentclass;config.cssclass={collapse:config.toggleclass[0],expand:config.toggleclass[1]};config.revealtype=/^(click)|(mouseover)$/i.test(config.revealtype)?config.revealtype.replace(/mouseover/i,"mouseenter"):"click";config.htmlsetting={location:config.togglehtml[0],collapse:config.togglehtml[1],expand:config.togglehtml[2]};config.oninit=(typeof config.oninit=="undefined")?function(){}:config.oninit;config.onopenclose=(typeof config.onopenclose=="undefined")?function(){}:config.onopenclose;var lastexpanded={};var expandedindices=ddaccordion.urlparamselect(config.headerclass)||((config.persiststate&&persistedheaders!=null)?persistedheaders:config.defaultexpanded);if(typeof expandedindices=="string"){expandedindices=expandedindices.replace(/c/ig,"").split(",")}var $subcontents=$("."+config.contentclass);if(expandedindices.length==1&&expandedindices[0]=="-1"){expandedindices=[]}if(config.collapseprev&&expandedindices.length>1){expandedindices=[expandedindices.pop()]}if(config.onemustopen&&expandedindices.length==0){expandedindices=[0]}$("."+config.headerclass).each(function(index){if(/(prefix)|(suffix)/i.test(config.htmlsetting.location)&&$(this).html()!=""){$('<span class="accordprefix"></span>').prependTo(this);$('<span class="accordsuffix"></span>').appendTo(this)}$(this).attr("headerindex",index+"h");$subcontents.eq(index).attr("contentindex",index+"c");var $subcontent=$subcontents.eq(index);var needle=(typeof expandedindices[0]=="number")?index:index+"";if(jQuery.inArray(needle,expandedindices)!=-1){if(config.animatedefault==false){$subcontent.show()}ddaccordion.expandit($(this),$subcontent,config,false);lastexpanded={$header:$(this),$content:$subcontent}}else{$subcontent.hide();config.onopenclose($(this).get(0),parseInt($(this).attr("headerindex")),$subcontent.css("display"),false);ddaccordion.transformHeader($(this),config,"collapse")}});$("."+config.headerclass).bind("evt_accordion",function(){var $subcontent=$subcontents.eq(parseInt($(this).attr("headerindex")));if($subcontent.css("display")=="none"){ddaccordion.expandit($(this),$subcontent,config,true);if(config.collapseprev&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit(lastexpanded.$header,lastexpanded.$content,config,true)}lastexpanded={$header:$(this),$content:$subcontent}}else{if(!config.onemustopen||config.onemustopen&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit($(this),$subcontent,config,true)}}});$("."+config.headerclass).bind(config.revealtype,function(){if(config.revealtype=="mouseenter"){clearTimeout(config.revealdelay);var headerindex=parseInt($(this).attr("headerindex"));config.revealdelay=setTimeout(function(){ddaccordion.expandone(config.headerclass,headerindex)},config.mouseoverdelay||0)}else{$(this).trigger("evt_accordion");return false}});$("."+config.headerclass).bind("mouseleave",function(){clearTimeout(config.revealdelay)});config.oninit($("."+config.headerclass).get(),expandedindices);$(window).bind("unload",function(){$("."+config.headerclass).unbind();var expandedindices=[];$("."+config.contentclass+":visible").each(function(index){expandedindices.push($(this).attr("contentindex"))});if(config.persiststate==true){expandedindices=(expandedindices.length==0)?"-1c":expandedindices;ddaccordion.setCookie(config.headerclass,expandedindices)}})})}};
//jquery.easing
jQuery.extend(jQuery.easing,{easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2){return 2*c*t*t/(d*d)+b}var ts=t-d/2;return -2*c*ts*ts/(d*d)+2*c*ts/d+c/2+b},easeout:function(x,t,b,c,d){return -c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}if(t<d/2){return flip*(Math.exp(Math.log(c/2)/(d/2)*t))+b}return flip*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing.bounceout(x,d-t,0,c,d)+b},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b}}}},bounceinout:function(x,t,b,c,d){if(t<d/2){return jQuery.easing.bouncein(x,t*2,0,c,d)*0.5+b}return jQuery.easing.bounceout(x,t*2-d,0,c,d)*0.5+c*0.5+b},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d/2)==2){return b+c}if(!p){p=d*(0.3*1.5)}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b}});
//ui.tabs
(function($){$.ui=$.ui||{};$.fn.tabs=function(){var method=typeof arguments[0]=="string"&&arguments[0];var args=method&&Array.prototype.slice.call(arguments,1)||arguments;return method=="length"?$.data(this[0],"tabs").$tabs.length:this.each(function(){if(method){var tabs=$.data(this,"tabs");if(tabs){tabs[method].apply(tabs,args)}}else{new $.ui.tabs(this,args[0]||{})}})};$.ui.tabs=function(el,options){var self=this;this.options=$.extend({},$.ui.tabs.defaults,options);this.element=el;if(options.selected===null){this.options.selected=null}this.options.event+=".tabs";$(el).bind("setData.tabs",function(event,key,value){if((/^selected/).test(key)){self.select(value)}else{self.options[key]=value;self.tabify()}}).bind("getData.tabs",function(event,key){return self.options[key]});$.data(el,"tabs",this);this.tabify(true)};$.ui.tabs.defaults={selected:0,unselect:false,event:"click",disabled:[],cookie:null,spinner:"Loading&#8230;",cache:false,idPrefix:"ui-tabs-",ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:"<div></div>",navClass:"ui-tabs-nav",selectedClass:"ui-tabs-selected",unselectClass:"ui-tabs-unselect",disabledClass:"ui-tabs-disabled",panelClass:"ui-tabs-panel",hideClass:"ui-tabs-hide",loadingClass:"ui-tabs-loading"};$.extend($.ui.tabs.prototype,{tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+$.data(a)},ui:function(tab,panel){return{instance:this,options:this.options,tab:tab,panel:panel}},tabify:function(init){this.$lis=$("li:has(a[href])",this.element);this.$tabs=this.$lis.map(function(){return $("a",this)[0]});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace("#","")){self.$panels=self.$panels.add(a.hash)}else{if($(a).attr("href")!="#"){$.data(a,"href.tabs",a.href);$.data(a,"load.tabs",a.href);var id=self.tabId(a);a.href="#"+id;var $panel=$("#"+id);if(!$panel.length){$panel=$(o.panelTemplate).attr("id",id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.element);$panel.data("destroy.tabs",true)}self.$panels=self.$panels.add($panel)}else{o.disabled.push(i+1)}}});if(init){$(this.element).hasClass(o.navClass)||$(this.element).addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.hasClass(o.panelClass)||$this.addClass(o.panelClass)});this.$tabs.each(function(i,a){if(location.hash){if(a.hash==location.hash){o.selected=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr("id");$toShow.attr("id","");setTimeout(function(){$toShow.attr("id",toShowId)},500)}scrollTo(0,0);return false}}else{if(o.cookie){var index=parseInt($.cookie("ui-tabs"+$.data(self.element)),10);if(index&&self.$tabs[index]){o.selected=index;return false}}else{if(self.$lis.eq(i).hasClass(o.selectedClass)){o.selected=i;return false}}}});this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(o.selected!==null){this.$panels.eq(o.selected).show().removeClass(o.hideClass);this.$lis.eq(o.selected).addClass(o.selectedClass)}var href=o.selected!==null&&$.data(this.$tabs[o.selected],"load.tabs");if(href){this.load(o.selected)}o.disabled=$.unique(o.disabled.concat($.map(this.$lis.filter("."+o.disabledClass),function(n,i){return self.$lis.index(n)}))).sort();$(window).bind("unload",function(){self.$tabs.unbind(".tabs");self.$lis=self.$tabs=self.$panels=null})}for(var i=0,li;li=this.$lis[i];i++){$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass(o.selectedClass)?"addClass":"removeClass"](o.disabledClass)}if(o.cache===false){this.$tabs.removeData("cache.tabs")}var hideFx,showFx,baseFx={"min-width":0,duration:1},baseDuration="normal";if(o.fx&&o.fx.constructor==Array){hideFx=o.fx[0]||baseFx,showFx=o.fx[1]||baseFx}else{hideFx=showFx=o.fx||baseFx}var resetCSS={display:"",overflow:"",height:""};if(!$.browser.msie){resetCSS.opacity=""}function hideTab(clicked,$hide,$show){$hide.animate(hideFx,hideFx.duration||baseDuration,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideFx.opacity){$hide[0].style.filter=""}if($show){showTab(clicked,$show,$hide)}})}function showTab(clicked,$show,$hide){if(showFx===baseFx){$show.css("display","block")}$show.animate(showFx,showFx.duration||baseDuration,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showFx.opacity){$show[0].style.filter=""}$(self.element).triggerHandler("tabsshow",[self.ui(clicked,$show[0])],o.show)})}function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show)}this.$tabs.unbind(".tabs").bind(o.event,function(){var $li=$(this).parents("li:eq(0)"),$hide=self.$panels.filter(":visible"),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||$(this).hasClass(o.loadingClass)||$(self.element).triggerHandler("tabsselect",[self.ui(this,$show[0])],o.select)===false){this.blur();return false}self.options.selected=self.$tabs.index(this);if(o.unselect){if($li.hasClass(o.selectedClass)){self.options.selected=null;$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false}else{if(!$hide.length){self.$panels.stop();var a=this;self.load(self.$tabs.index(this),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show)});this.blur();return false}}}if(o.cookie){$.cookie("ui-tabs"+$.data(self.element),self.options.selected,o.cookie)}self.$panels.stop();if($show.length){var a=this;self.load(self.$tabs.index(this),$hide.length?function(){switchTab(a,$li,$hide,$show)}:function(){$li.addClass(o.selectedClass);showTab(a,$show)})}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if($.browser.msie){this.blur()}return false});if(!(/^click/).test(o.event)){this.$tabs.bind("click.tabs",function(){return false})}},add:function(url,label,index){if(index==undefined){index=this.$tabs.length}var o=this.options;var $li=$(o.tabTemplate.replace(/#\{href\}/,url).replace(/#\{label\}/,label));$li.data("destroy.tabs",true);var id=url.indexOf("#")==0?url.replace("#",""):this.tabId($("a:first-child",$li)[0]);var $panel=$("#"+id);if(!$panel.length){$panel=$(o.panelTemplate).attr("id",id).addClass(o.panelClass).addClass(o.hideClass);$panel.data("destroy.tabs",true)}if(index>=this.$lis.length){$li.appendTo(this.element);$panel.appendTo(this.element.parentNode)}else{$li.insertBefore(this.$lis[index]);$panel.insertBefore(this.$panels[index])}o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this.tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],"load.tabs");if(href){this.load(index,href)}}$(this.element).triggerHandler("tabsadd",[this.ui(this.$tabs[index],this.$panels[index])],o.add)},remove:function(index){var o=this.options,$li=this.$lis.eq(index).remove(),$panel=this.$panels.eq(index).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1){this.select(index+(index+1<this.$tabs.length?1:-1))}o.disabled=$.map($.grep(o.disabled,function(n,i){return n!=index}),function(n,i){return n>=index?--n:n});this.tabify();$(this.element).triggerHandler("tabsremove",[this.ui($li.find("a")[0],$panel[0])],o.remove)},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1){return}var $li=this.$lis.eq(index).removeClass(o.disabledClass);if($.browser.safari){$li.css("display","inline-block");setTimeout(function(){$li.css("display","block")},0)}o.disabled=$.grep(o.disabled,function(n,i){return n!=index});$(this.element).triggerHandler("tabsenable",[this.ui(this.$tabs[index],this.$panels[index])],o.enable)},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.$lis.eq(index).addClass(o.disabledClass);o.disabled.push(index);o.disabled.sort();$(this.element).triggerHandler("tabsdisable",[this.ui(this.$tabs[index],this.$panels[index])],o.disable)}},select:function(index){if(typeof index=="string"){index=this.$tabs.index(this.$tabs.filter("[href$="+index+"]")[0])}this.$tabs.eq(index).trigger(this.options.event)},load:function(index,callback){var self=this,o=this.options,$a=this.$tabs.eq(index),a=$a[0],bypassCache=callback==undefined||callback===false,url=$a.data("load.tabs");callback=callback||function(){};if(!url||($.data(a,"cache.tabs")&&!bypassCache)){callback();return}if(o.spinner){var $span=$("span",a);$span.data("label.tabs",$span.html()).html("<em>"+o.spinner+"</em>")}var finish=function(){self.$tabs.filter("."+o.loadingClass).each(function(){$(this).removeClass(o.loadingClass);if(o.spinner){var $span=$("span",this);$span.html($span.data("label.tabs")).removeData("label.tabs")}});self.xhr=null};var ajaxOptions=$.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(a.hash).html(r);finish();callback();if(o.cache){$.data(a,"cache.tabs",true)}$(self.element).triggerHandler("tabsload",[self.ui(self.$tabs[index],self.$panels[index])],o.load);o.ajaxOptions.success&&o.ajaxOptions.success(r,s)}});if(this.xhr){this.xhr.abort();finish()}$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions)},0)},url:function(index,url){this.$tabs.eq(index).removeData("cache.tabs").data("load.tabs",url)},destroy:function(){var o=this.options;$(this.element).unbind(".tabs").removeClass(o.navClass).removeData("tabs");this.$tabs.each(function(){var href=$.data(this,"href.tabs");if(href){this.href=href}var $this=$(this).unbind(".tabs");$.each(["href","load","cache"],function(i,prefix){$this.removeData(prefix+".tabs")})});this.$lis.add(this.$panels).each(function(){if($.data(this,"destroy.tabs")){$(this).remove()}else{$(this).removeClass([o.selectedClass,o.unselectClass,o.disabledClass,o.panelClass,o.hideClass].join(" "))}})}})})(jQuery);
//thickbox

//jquery.ajaxContent
(function($){$.fn.ajaxContent=function(options){var defaults=$.extend({},$.fn.ajaxContent.defaults,options);if(defaults.debug=="true"){debug(this)}return this.each(function(){var $obj=$(this);var href=$obj.attr("href");var o=$.metadata?$.extend({},defaults,$obj.metadata()):defaults;if(o.bind!=""){var binds=o.bind.split(",");for(var i=0;i<binds.length;i++){var queryString=setQueryString(binds);var url=href+queryString;$obj.attr({href:url});if($(binds[i]).attr("type")=="radio"||$(binds[i]).attr("type")=="checkbox"){$("input[name="+$(binds[i]).attr("name")+"]").change(function(){var queryString=setQueryString(binds);var url=href+queryString;$obj.attr({href:url})})}else{$(binds[i]).change(function(){var queryString=setQueryString(binds);var url=href+queryString;$obj.attr({href:url})})}}}var $target=$(o.target);$obj.bind(o.event,function(){if(o.loader=="true"){if(o.loaderType=="img"){$target.html('<img src="'+o.loadingMsg+'"/>')}else{$target.html(o.loadingMsg)}}$("a."+o.currentClass).removeClass(o.currentClass);$obj.addClass(o.currentClass);$.ajax({type:o.type,url:$obj.attr("href"),cache:"false",beforeSend:function(){if(typeof o.beforeSend=="function"){o.beforeSend($obj,$target)}},success:function(msg){$target.html(msg);if(o.extend=="true"){$(o.filter,$target).ajaxContent({target:o.ex_target,type:o.ex_type,event:o.ex_event,loader:o.ex_loader,loaderType:o.ex_loaderType,loadingMsg:o.ex_loadingMsg,errorMsg:o.ex_errorMsg,currentClass:o.ex_currentClass,success:o.ex_success,beforeSend:o.ex_beforeSend,error:o.ex_error,bind:o.ex_bind})}if(typeof o.success=="function"){o.success($obj,$target,msg)}},error:function(){$target.html("<p>"+o.errorMsg+"</p>");if(typeof o.error=="function"){o.error($target)}}});return false})})};function debug($obj){if(window.console&&window.console.log){window.console.log("selection count: "+$obj.size()+"  with class:"+$obj.attr("class"))}}function setQueryString(binds){var queryString="?";for(var i=0;i<binds.length;i++){if($(binds[i]).attr("type")=="radio"){queryString+=$("input[name="+$(binds[i]).attr("name")+"]").fieldSerialize()}else{if($(binds[i]).attr("type")=="checkbox"){queryString+=$(binds[i]).attr("name")+"="+$("input[name="+$(binds[i]).attr("name")+"]").fieldValue()}else{queryString+=$(binds[i]).fieldSerialize()}}if(i!=binds.length-1){queryString+="&"}}return queryString}})(jQuery);$.fn.ajaxContent.defaults={target:"#ajaxContent",type:"get",event:"click",loader:"true",loaderType:"text",loadingMsg:"Loading...",errorMsg:"An error occured durign the page requesting process!",currentClass:"selected",success:"",beforeSend:"",error:"",bind:"",debug:"false",extend:"false",filter:"",ex_target:"",ex_type:"get",ex_event:"click",ex_loader:"true",ex_loaderType:"text",ex_loadingMsg:"Loading...",ex_errorMsg:"An error occured durign the page requesting process!",ex_currentClass:"selected",ex_success:"",ex_beforeSend:"",ex_error:"",ex_bind:""};
//jquery.form
(function($){$.fn.ajaxSubmit=function(options){if(typeof options=="function"){options={success:options}}options=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},options||{});var veto={};$.event.trigger("form.pre.serialize",[this,options,veto]);if(veto.veto){return this}var a=this.formToArray(options.semantic);if(options.data){for(var n in options.data){a.push({name:n,value:options.data[n]})}}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){return this}$.event.trigger("form.submit.validate",[a,this,options,veto]);if(veto.veto){return this}var q=$.param(a);if(options.type.toUpperCase()=="GET"){options.url+=(options.url.indexOf("?")>=0?"&":"?")+q;options.data=null}else{options.data=q}var $form=this,callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm()})}if(options.clearForm){callbacks.push(function(){$form.clearForm()})}if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){if(this.evalScripts){$(options.target).attr("innerHTML",data).evalScripts().each(oldSuccess,arguments)}else{$(options.target).html(data).each(oldSuccess,arguments)}})}else{if(options.success){callbacks.push(options.success)}}options.success=function(data,status){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](data,status,$form)}};var files=$("input:file",this).fieldValue();var found=false;for(var j=0;j<files.length;j++){if(files[j]){found=true}}if(options.iframe||found){fileUpload()}else{$.ajax(options)}$.event.trigger("form.submit.notify",[this,options]);return this;function fileUpload(){var form=$form[0];var opts=$.extend({},$.ajaxSettings,options);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$('<iframe id="'+id+'" name="'+id+'" />');var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src='javascript:false;document.write("");'}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=opts.global;if(g&&!$.active++){$.event.trigger("ajaxStart")}if(g){$.event.trigger("ajaxSend",[xhr,opts])}var cbInvoked=0;var timedOut=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var encAttr=form.encoding?"encoding":"enctype";var t=$form.attr("target");$form.attr({target:id,method:"POST",action:opts.url});form[encAttr]="multipart/form-data";if(opts.timeout){setTimeout(function(){timedOut=true;cb()},opts.timeout)}form.submit();$form.attr("target",t)},10);function cb(){if(cbInvoked++){return}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(timedOut){throw"timeout"}var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(opts.dataType=="json"||opts.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];data=ta?ta.value:xhr.responseText;if(opts.dataType=="json"){eval("data = "+data)}else{$.globalEval(data)}}else{if(opts.dataType=="xml"){data=xhr.responseXML;if(!data&&xhr.responseText!=null){data=toXml(xhr.responseText)}}else{data=xhr.responseText}}}catch(e){ok=false;$.handleError(opts,xhr,"error",e)}if(ok){opts.success(data,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,opts])}}if(g){$.event.trigger("ajaxComplete",[xhr,opts])}if(g&&!--$.active){$.event.trigger("ajaxStop")}if(opts.complete){opts.complete(xhr,ok?"success":"error")}setTimeout(function(){$io.remove();xhr.responseXML=null},100)}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s)}else{doc=(new DOMParser()).parseFromString(s,"text/xml")}return(doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=options;$(":submit,input:image",this).click(clickHandler)})};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var $form=this.form;$form.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){$form.clk_x=e.offsetX;$form.clk_y=e.offsetY}else{if(typeof $.fn.offset=="function"){var offset=$(this).offset();$form.clk_x=e.pageX-offset.left;$form.clk_y=e.pageY-offset.top}else{$form.clk_x=e.pageX-this.offsetLeft;$form.clk_y=e.pageY-this.offsetTop}}}setTimeout(function(){$form.clk=$form.clk_x=$form.clk_y=null},10)}function submitHandler(){var id=this.formPluginId;var options=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(options);return false}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler)})};$.fn.formToArray=function(semantic){var a=[];if(this.length==0){return a}var form=this[0];var els=semantic?form.getElementsByTagName("*"):form.elements;if(!els){return a}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue}if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y})}continue}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]})}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v})}}}if(!semantic&&form.clk){var inputs=form.getElementsByTagName("input");for(var i=0,max=inputs.length;i<max;i++){var input=inputs[i];var n=input.name;if(n&&!input.disabled&&input.type=="image"&&form.clk==input){a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y})}}}return a};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic))};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return}var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]})}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v})}}});return $.param(a)};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue}v.constructor==Array?$.merge(val,v):val.push(v)}return val};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful=="undefined"){successful=true}if(successful&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null}if(tag=="select"){var index=el.selectedIndex;if(index<0){return null}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes.value.specified)?op.text:op.value;if(one){return v}a.push(v)}}return a}return el.value};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields()})};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value=""}else{if(t=="checkbox"||t=="radio"){this.checked=false}else{if(tag=="select"){this.selectedIndex=-1}}}})};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})}})(jQuery);
//jquery.jkoutlinemenu
var jkoutlinemenu={effectduration:200,outlinemenulabels:[],outlinemenus:[],zIndexVal:1000,$shimobj:null,addshim:function(){$(document.body).append('<IFRAME id="outlineiframeshim" src="'+(location.protocol=="https:"?"blank.htm":"about:blank")+'" style="display:none; left:0; top:0; z-index:999; position:absolute; filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>');this.$shimobj=$("#outlineiframeshim")},alignmenu:function(e,outlinemenu_pos){var outlinemenu=this.outlinemenus[outlinemenu_pos];var $anchor=outlinemenu.$anchorobj;var $menu=outlinemenu.$menuobj;var menuleft=($(window).width()-(outlinemenu.offsetx-$(document).scrollLeft())>outlinemenu.actualwidth)?outlinemenu.offsetx:outlinemenu.offsetx-outlinemenu.actualwidth+outlinemenu.anchorwidth;var menutop=($(window).height()-(outlinemenu.offsety-$(document).scrollTop()+outlinemenu.anchorheight)>outlinemenu.actualheight)?outlinemenu.offsety+outlinemenu.anchorheight:outlinemenu.offsety-outlinemenu.actualheight;$menu.css({left:menuleft+"px",top:menutop+"px"});this.$shimobj.css({width:outlinemenu.actualwidth+"px",height:outlinemenu.actualheight+"px",left:menuleft+"px",top:menutop+"px",display:"block"})},showmenu:function(e,outlinemenu_pos){var outlinemenu=this.outlinemenus[outlinemenu_pos];var $menu=outlinemenu.$menuobj;var $menuinner=outlinemenu.$menuinner;if($menu.css("display")=="none"){this.alignmenu(e,outlinemenu_pos);$menu.css("z-index",++this.zIndexVal);$menu.show(this.effectduration,function(){$menuinner.css("visibility","visible")})}else{if($menu.css("display")=="block"&&e.type=="click"){this.hidemenu(e,outlinemenu_pos)}}return false},hidemenu:function(e,outlinemenu_pos){var outlinemenu=this.outlinemenus[outlinemenu_pos];var $menu=outlinemenu.$menuobj;var $menuinner=outlinemenu.$menuinner;$menuinner.css("visibility","hidden");this.$shimobj.css({display:"none",left:0,top:0});$menu.hide(this.effectduration)},definemenu:function(anchorid,menuid,revealtype,optwidth,optheight){var $=jQuery;this.outlinemenulabels.push([anchorid,menuid,revealtype,optwidth,optheight])},render:function($){for(var i=0,labels=this.outlinemenulabels[i];i<this.outlinemenulabels.length;i++,labels=this.outlinemenulabels[i]){this.outlinemenus.push({$anchorobj:$("#"+labels[0]),$menuobj:$("#"+labels[1]),$menuinner:$("#"+labels[1]).children("ul:first-child"),revealtype:labels[2]});var outlinemenu=this.outlinemenus[i];outlinemenu.$anchorobj.add(outlinemenu.$menuobj).attr("_outlinemenupos",i+"pos");outlinemenu.$menuobj.css(parseInt(labels[3])>10?{width:parseInt(labels[3])+"px"}:{});outlinemenu.$menuobj.css(parseInt(labels[4])<outlinemenu.$menuobj.height()?{height:parseInt(labels[4])+"px",overflow:"scroll",overflowX:"hidden"}:{});outlinemenu.actualwidth=outlinemenu.$menuobj.outerWidth();outlinemenu.actualheight=outlinemenu.$menuobj.outerHeight();outlinemenu.offsetx=outlinemenu.$anchorobj.offset().left;outlinemenu.offsety=outlinemenu.$anchorobj.offset().top;outlinemenu.anchorwidth=outlinemenu.$anchorobj.outerWidth();outlinemenu.anchorheight=outlinemenu.$anchorobj.outerHeight();outlinemenu.$menuobj.css("z-index",++this.zIndexVal).hide();outlinemenu.$menuinner.css("visibility","hidden");outlinemenu.$anchorobj.bind(outlinemenu.revealtype=="click"?"click":"mouseenter",function(e){return jkoutlinemenu.showmenu(e,parseInt(this.getAttribute("_outlinemenupos")))});outlinemenu.$anchorobj.bind("mouseleave",function(e){var $menu=jkoutlinemenu.outlinemenus[parseInt(this.getAttribute("_outlinemenupos"))].$menuobj;if(e.relatedTarget!=$menu.get(0)&&$(e.relatedTarget).parents("#"+$menu.get(0).id).length==0){jkoutlinemenu.hidemenu(e,parseInt(this.getAttribute("_outlinemenupos")))}});outlinemenu.$menuobj.bind("click mouseleave",function(e){jkoutlinemenu.hidemenu(e,parseInt(this.getAttribute("_outlinemenupos")))})}$(document).bind("click",function(e){for(var i=0;i<jkoutlinemenu.outlinemenus.length;i++){jkoutlinemenu.hidemenu(e,i)}});$(window).bind("resize",function(){for(var i=0;i<jkoutlinemenu.outlinemenus.length;i++){var outlinemenu=jkoutlinemenu.outlinemenus[i];outlinemenu.offsetx=outlinemenu.$anchorobj.offset().left;outlinemenu.offsety=outlinemenu.$anchorobj.offset().top}});jkoutlinemenu.addshim()}};jQuery(document).ready(function($){jkoutlinemenu.render($)});
//animatedcollapse
var animatedcollapse={divholders:{},divgroups:{},lastactiveingroup:{},show:function(divids){if(typeof divids=="object"){for(var i=0;i<divids.length;i++){this.showhide(divids[i],"show")}}else{this.showhide(divids,"show")}setTimeout("DrawBackground()",20)},hide:function(divids){if(typeof divids=="object"){for(var i=0;i<divids.length;i++){this.showhide(divids[i],"hide")}}else{this.showhide(divids,"hide")}},toggle:function(divid){this.showhide(divid,"toggle")},addDiv:function(divid,attrstring){this.divholders[divid]=({id:divid,$divref:null,attrs:attrstring});this.divholders[divid].getAttr=function(name){var attr=new RegExp(name+"=([^,]+)","i");return(attr.test(this.attrs)&&parseInt(RegExp.$1)!=0)?RegExp.$1:null}},showhide:function(divid,action){var $divref=this.divholders[divid].$divref;if(this.divholders[divid]&&$divref.length==1){var targetgroup=this.divgroups[$divref.attr("groupname")];if($divref.attr("groupname")&&targetgroup.count>1&&(action=="show"||action=="toggle"&&$divref.css("display")=="none")){if(targetgroup.lastactivedivid&&targetgroup.lastactivedivid!=divid){this.slideengine(targetgroup.lastactivedivid,"hide")}this.slideengine(divid,"show");targetgroup.lastactivedivid=divid}else{this.slideengine(divid,action)}}},slideengine:function(divid,action){var $divref=this.divholders[divid].$divref;if(this.divholders[divid]&&$divref.length==1){var animateSetting={height:action};if($divref.attr("fade")){animateSetting.opacity=action}$divref.animate(animateSetting,$divref.attr("speed")?parseInt($divref.attr("speed")):500);return false}},generatemap:function(){var map={};for(var i=0;i<arguments.length;i++){if(arguments[i][1]!=null){map[arguments[i][0]]=arguments[i][1]}}return map},init:function(){var ac=this;jQuery(document).ready(function($){var persistopenids=ac.getCookie("acopendivids");var groupswithpersist=ac.getCookie("acgroupswithpersist");if(persistopenids!=null){persistopenids=(persistopenids=="nada")?[]:persistopenids.split(",")}groupswithpersist=(groupswithpersist==null||groupswithpersist=="nada")?[]:groupswithpersist.split(",");jQuery.each(ac.divholders,function(){this.$divref=$("#"+this.id);if((this.getAttr("persist")||jQuery.inArray(this.getAttr("group"),groupswithpersist)!=-1)&&persistopenids!=null){var cssdisplay=(jQuery.inArray(this.id,persistopenids)!=-1)?"block":"none"}else{var cssdisplay=this.getAttr("hide")?"none":null}this.$divref.css(ac.generatemap(["height",this.getAttr("height")],["display",cssdisplay]));this.$divref.attr(ac.generatemap(["groupname",this.getAttr("group")],["fade",this.getAttr("fade")],["speed",this.getAttr("speed")]));if(this.getAttr("group")){var targetgroup=ac.divgroups[this.getAttr("group")]||(ac.divgroups[this.getAttr("group")]={});targetgroup.count=(targetgroup.count||0)+1;if(!targetgroup.lastactivedivid&&this.$divref.css("display")!="none"||cssdisplay=="block"){targetgroup.lastactivedivid=this.id}this.$divref.css({display:"none"})}});jQuery.each(ac.divgroups,function(){if(this.lastactivedivid){ac.divholders[this.lastactivedivid].$divref.show()}});var $allcontrols=$("*[rel]").filter('[@rel^="collapse-"], [@rel^="expand-"], [@rel^="toggle-"]');var controlidentifiers=/(collapse-)|(expand-)|(toggle-)/;$allcontrols.each(function(){$(this).click(function(){var relattr=this.getAttribute("rel");var divid=relattr.replace(controlidentifiers,"");var doaction=(relattr.indexOf("collapse-")!=-1)?"hide":(relattr.indexOf("expand-")!=-1)?"show":"toggle";return ac.showhide(divid,doaction)})});$(window).bind("unload",function(){ac.uninit()})})},uninit:function(){var opendivids="",groupswithpersist="";jQuery.each(this.divholders,function(){if(this.$divref.css("display")!="none"){opendivids+=this.id+","}if(this.getAttr("group")&&this.getAttr("persist")){groupswithpersist+=this.getAttr("group")+","}});opendivids=(opendivids=="")?"nada":opendivids.replace(/,$/,"");groupswithpersist=(groupswithpersist=="")?"nada":groupswithpersist.replace(/,$/,"");this.setCookie("acopendivids",opendivids);this.setCookie("acgroupswithpersist",groupswithpersist)},getCookie:function(Name){var re=new RegExp(Name+"=[^;]*","i");if(document.cookie.match(re)){return document.cookie.match(re)[0].split("=")[1]}return null},setCookie:function(name,value,days){if(typeof days!="undefined"){var expireDate=new Date();expireDate.setDate(expireDate.getDate()+days);document.cookie=name+"="+value+"; path=/; expires="+expireDate.toGMTString()}else{document.cookie=name+"="+value+"; path=/"}}};
//jquery.jforms
$.fn.jForms=function(options){var lastKeypress=0;var keyBuffer="";var self=this;var defaults={imagePath:"/niceforms/default/",listSize:20};if($.browser.safari){return false}var opts=$.extend(defaults,options);var imagePath=opts.imagePath;var images=[imagePath+"button_left_xon.gif",imagePath+"button_right_xon.gif",imagePath+"input_left_xon.gif",imagePath+"input_right_xon.gif",imagePath+"txtarea_bl_xon.gif",imagePath+"txtarea_br_xon.gif",imagePath+"txtarea_cntr_xon.gif",imagePath+"txtarea_l_xon.gif",imagePath+"txtarea_tl_xon.gif",imagePath+"txtarea_tr_xon.gif"];var imgs=new Array();for(var i=0;i<images.length;i++){imgs[i]=$("<img>").attr("src",images[i])}$(self).attr("autocomplete","off").addClass("niceforms");$(":text,:password",self).each(function(){$(this).addClass("textinput").before('<img src = "'+imagePath+'input_left.gif" class="inputCorner" />').after('<img src="'+imagePath+'input_right.gif" class="inputCorner" />').focus(function(){$(this).css("background-position","bottom").prev().attr("src",imagePath+"input_left_xon.gif");$(this).next().attr("src",imagePath+"input_right_xon.gif")}).blur(function(){$(this).css("background-position","top").prev().attr("src",imagePath+"input_left.gif");$(this).next().attr("src",imagePath+"input_right.gif")})});$("select",self).each(function(){$("body").append('<ul id = "'+this.id+'_fake_list" class="fake_list"></ul>');$(this).children().each(function(){$("#"+$(this).parent().attr("id")+"_fake_list").append("<li>"+$(this).text()+"</li>")});$("#"+this.id+"_fake_list").css("height",($("#"+this.id+"_fake_list li:first").height()+4)*($("#"+this.id+"_fake_list li").size()<opts.listSize?$("#"+this.id+"_fake_list li").size():opts.listSize)).css("width",$(this).width()+18).toggle();$("#"+this.id+"_fake_list > li").hover(function(){$(this).addClass("selected")},function(){$(this).removeClass("selected")}).each(function(i){$(this).click(function(){var id=$(this).parent().attr("id");$("#"+id).toggle();$("#"+id.replace("_list","")).attr("value",$(this).text());$("#"+id.replace("_fake_list","")).attr("selectedIndex",i).change();$("#"+id+" >  li").removeClass("selected");$(this).addClass("selected")})});$(this).before('<div class="selectArea" style="width:'+($(this).width()+43)+'px"><div class="left"></div><div class="right"><a class="selectButton" href="javascript:;" onclick="$(\'#'+this.id+'_fake\').focus().click()"></a></div><input type = "text" class="center" style="width:'+($(this).width())+'px;cursor:default" id="'+this.id+'_fake"  value="'+this[this.selectedIndex].text+'"  /></div>').css("position","absolute").css("left","-6000px");$("#"+this.id+"_fake").click(function(){$("#"+this.id+"_list").focus();$("#"+this.id+"_list").css("left",$(this).offset().left-8);if(($("#"+this.id+"_list").height()+$(this).offset().top-document.documentElement.scrollTop)>$(window).height()){$("#"+this.id+"_list").css("top",$(this).offset().top-$("#"+this.id+"_list").height()-4)}else{$("#"+this.id+"_list").css("top",$(this).offset().top+$(this).height()+4)}$("#"+this.id+"_list > li").removeClass("selected");$("#"+this.id+"_list > li").get($("#"+this.id.replace("_fake","")).attr("selectedIndex")).className="selected";$(".fake_list:visible:not(#"+this.id+"_list)").toggle();$list=$("#"+this.id+"_list");$list.toggle();var offSet=(($(".selected",$list).length>0?$(".selected",$list).offset().top:0)-$list.offset().top);$list.animate({scrollTop:offSet})}).css("font-size",$(this).css("font-size")).css("padding","2px 0px 2px 2px").keyup(function(e){var pressedKey=e.charCode||e.keyCode||-1;var $dd=$("#"+this.id.replace("_fake",""));$("#"+this.id+"_list > li").removeClass("selected");switch(pressedKey){case 40:var curr=($dd.attr("selectedIndex")+1>=$("option",$dd).length?0:$dd.attr("selectedIndex")+1);break;case 38:var curr=($dd.attr("selectedIndex")-1<0?$("option",$dd).length-1:$dd.attr("selectedIndex")-1);break;case 13:$("#"+this.id+"_list").toggle();return false;break;default:var t=new Date();if(t.getTime()-lastKeypress>1000){lastKeypress=t.getTime();keyBuffer=""}keyBuffer+=String.fromCharCode(pressedKey).toLowerCase();curr=-1;$("#"+this.id+"_list > li").each(function(i){if($(this).text().toLowerCase().indexOf(keyBuffer)==0&&curr==-1){curr=i;return}});break}if(curr==-1){curr=0}$($("#"+this.id+"_list > li").get(curr)).addClass("selected").focus();$list=$("#"+this.id+"_list");var offSet=(($(".selected",$list).length>0?$(".selected",$list).offset().top:0)-$list.offset().top);$list.attr("scrollTop",offSet);$dd.attr("selectedIndex",curr).change();$(this).attr("value",$($("#"+this.id+"_list > li").get(curr)).text());return false}).focus(function(){$(document).keypress(function(e){var pressedKey=e.charCode||e.keyCode||-1;if(pressedKey==13){return false}})}).blur(function(){$(document).unbind("keypress").unbind("click")})});$(":checkbox",self).each(function(){$(this).before('<div style="margin: 1px;" id="'+this.id+'_fake"></div>');$(this).addClass("outtaHere");this.checked?$("label[for="+this.id+"]").addClass("chosen"):"";$("#"+this.id+"_fake").addClass(this.checked?"checkboxAreaChecked":"checkboxArea").click(function(){$("label[for="+this.id.replace("_fake","")+"]").click();$("#"+this.id.replace("_fake","")).attr("checked")?$("#"+this.id.replace("_fake","")).attr("checked",""):$("#"+this.id.replace("_fake","")).attr("checked","checked")});$("label[for="+this.id+"]").click(function(){$("#"+$(this).attr("for")).attr("checked")?$(this).removeClass("chosen"):$(this).addClass("chosen");$("#"+$(this).attr("for")+"_fake").addClass($("#"+$(this).attr("for")).attr("checked")?"checkboxArea":"checkboxAreaChecked").removeClass($("#"+$(this).attr("for")).attr("checked")?"checkboxAreaChecked":"checkboxArea")})});$(":radio",self).each(function(){$(this).after('<div style="margin: 1px;" id="'+this.id+'_fake"></div>').addClass("outtaHere");this.checked?$("label[for="+this.id+"]").addClass("chosen"):"";$("#"+this.id+"_fake").addClass(this.checked?"radioAreaChecked":"radioArea").click(function(){$(":radio[name="+$("#"+this.id.replace("_fake","")).attr("name")+"]").each(function(){this.checked=false});$("#"+this.id.replace("_fake","")).attr("checked","checked");$("label[for="+this.id.replace("_fake","")+"]").click()});$("label[for="+this.id+"]").click(function(){$(":radio[name="+$("#"+$(this).attr("for")).attr("name")+"]").each(function(){$("label[for="+this.id+"]").removeClass("chosen");$("#"+this.id+"_fake").addClass("radioArea").removeClass("radioAreaChecked");$("label[for="+this.id.replace("_fake","")+"]").removeClass("chosen")});$(this).addClass("chosen");$("#"+$(this).attr("for")+"_fake").addClass("radioAreaChecked")})});$("textarea",self).each(function(){$(this).replaceWith('<div style="width: '+($(this).width()+20)+"px; height: "+($(this).height()+20)+'px;" class="txtarea" id = "'+this.id+'_fake"><div class="tr"><img src="/niceforms/default/txtarea_tl.gif" class="txt_corner"></div><div class="cntr"><div style="height: '+($(this).height()+10)+'px;" class="cntr_l"></div></div><div class="br"><img src="'+imagePath+'txtarea_bl.gif" class="txt_corner"></div></div>');$("#"+this.id+"_fake .cntr").append($(this))}).focus(function(){$("#"+this.id+"_fake .tr").removeClass("tr").addClass("tr_xon");$("#"+this.id+"_fake .br").removeClass("br").addClass("br_xon");$("#"+this.id+"_fake .cntr").removeClass("cntr").addClass("cntr_xon");$("#"+this.id+"_fake .cntr_l").removeClass("cntr_").addClass("cntr_l_xon");$("#"+this.id+"_fake img:first").attr("src",imagePath+"txtarea_tl_xon.gif");$("#"+this.id+"_fake img:last").attr("src",imagePath+"txtarea_bl_xon.gif")}).blur(function(){$("#"+this.id+"_fake .tr_xon").addClass("tr").removeClass("tr_xon");$("#"+this.id+"_fake .br_xon").addClass("br").removeClass("br_xon");$("#"+this.id+"_fake .cntr_xon").addClass("cntr").removeClass("cntr_xon");$("#"+this.id+"_fake .cntr_l_xon").addClass("cntr_").removeClass("cntr_l_xon");$("#"+this.id+"_fake img:first").attr("src",imagePath+"txtarea_tl.gif");$("#"+this.id+"_fake img:last").attr("src",imagePath+"txtarea_bl.gif")});$(":button,:submit",self).each(function(){$(this).before('<img class="buttonImg" src="'+imagePath+'button_left.gif">').after('<img class="buttonImg" src="'+imagePath+'button_right.gif">').addClass("buttonSubmit").hover(function(){$(this).prev().attr("src",imagePath+"button_left_xon.gif");$(this).next().attr("src",imagePath+"button_right_xon.gif");$(this).addClass("buttonSubmitHovered").removeClass("buttonSubmit")},function(){$(this).prev().attr("src",imagePath+"button_left.gif");$(this).next().attr("src",imagePath+"button_right.gif");$(this).removeClass("buttonSubmitHovered").addClass("buttonSubmit")})});return self};
//jquery.cluetip
(function($){var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=="object"){options=js;js=null}return this.each(function(index){var $this=$(this);var opts=$.extend(false,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=parseInt(opts.cluezIndex,10)-1;var isActive=false,closeOnDelay=0;if(!$("#cluetip").length){$cluetipInner=$('<div id="cluetip-inner"></div>');$cluetipTitle=$('<h3 id="cluetip-title"></h3>');$cluetipOuter=$('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle);$cluetip=$('<div id="cluetip"></div>').css({zIndex:opts.cluezIndex}).append($cluetipOuter).append('<div id="cluetip-extra"></div>')[insertionType](insertionElement).hide();$('<div id="cluetip-waitimage"></div>').css({position:"absolute",zIndex:cluezIndex-1}).insertBefore("#cluetip").hide();$cluetip.css({position:"absolute",zIndex:cluezIndex});$cluetipOuter.css({position:"relative",zIndex:cluezIndex+1});$cluetipArrows=$('<div id="cluetip-arrows" class="cluetip-arrows"></div>').css({zIndex:cluezIndex+1}).appendTo("#cluetip")}var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<dropShadowSteps;i++){$dropShadow=$dropShadow.add($("<div></div>").css({zIndex:cluezIndex-i-1,opacity:0.1,top:1+i,left:1+i}))}$dropShadow.css({position:"absolute",backgroundColor:"#000"}).prependTo($cluetip)}var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js){return true}if(opts.local&&opts.hideLocal){$(tipAttribute+":first").hide()}var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight;var defHeight=isNaN(parseInt(opts.height,10))?"auto":(/\D/g).test(opts.height)?opts.height:opts.height+"px";var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=isNaN(parseInt(opts.width,10))?275:parseInt(opts.width,10);var tipWidth=tipInnerWidth+(parseInt($cluetip.css("paddingLeft"))||0)+(parseInt($cluetip.css("paddingRight"))||0)+dropShadowSteps;var linkWidth=this.offsetWidth;var linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!="title")?$this.attr(opts.titleAttribute):"";if(opts.splitTitle){if(tipTitle==undefined){tipTitle=""}tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift()}var localContent;var activate=function(event){if(!opts.onActivate($this)){return false}isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr("href")){$this.css("cursor",opts.cursor)}$this.attr("title","");if(opts.hoverClass){$this.addClass(opts.hoverClass)}linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if($this[0].tagName.toLowerCase()!="area"){sTop=$(document).scrollTop();winWidth=$(window).width()}if(opts.positionBy=="fixed"){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX})}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if($this[0].tagName.toLowerCase()=="area"||opts.positionBy=="mouse"||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(" cluetip-"+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css("marginLeft"),10)+parseInt($cluetipInner.css("marginRight"),10):mouseX-(tipWidth/2)}else{posX=mouseX+lOffset}}var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!="bottomTop")?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0)})}wHeight=$(window).height();if(js){$cluetipInner.html(js);cluetipShow(pY)}else{if(tipParts){var tpl=tipParts.length;for(var i=0;i<tpl;i++){if(i==0){$cluetipInner.html(tipParts[i])}else{$cluetipInner.append('<div class="split-body">'+tipParts[i]+"</div>")}}cluetipShow(pY)}else{if(!opts.local&&tipAttribute.indexOf("#")!=0){if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY)}else{var ajaxSettings=opts.ajaxSettings;ajaxSettings.url=tipAttribute;ajaxSettings.beforeSend=function(){$cluetipOuter.children().empty();if(opts.waitImage){$("#cluetip-waitimage").css({top:mouseY+20,left:mouseX+20}).show()}};ajaxSettings.error=function(){if(isActive){$cluetipInner.html("<i>sorry, the contents could not be loaded</i>")}};ajaxSettings.success=function(data){cluetipContents=opts.ajaxProcess(data);if(isActive){$cluetipInner.html(cluetipContents)}};ajaxSettings.complete=function(){imgCount=$("#cluetip-inner img").length;if(imgCount&&!$.browser.opera){$("#cluetip-inner img").load(function(){imgCount--;if(imgCount<1){$("#cluetip-waitimage").hide();if(isActive){cluetipShow(pY)}}})}else{$("#cluetip-waitimage").hide();if(isActive){cluetipShow(pY)}}};$.ajax(ajaxSettings)}}else{if(opts.local){var $localContent=$(tipAttribute+":first");var localCluetip=$.fn.wrapInner?$localContent.wrapInner("<div></div>").children().clone(true):$localContent.html();$.fn.wrapInner?$cluetipInner.empty().append(localCluetip):$cluetipInner.html(localCluetip);cluetipShow(pY)}}}}};var cluetipShow=function(bpY){$cluetip.addClass("cluetip-"+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+"...";$cluetipInner.html($truncloaded)}function doNothing(){}tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html("&nbsp;"):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('<div id="cluetip-close"><a href="#">'+opts.closeText+"</a></div>");(opts.closePosition=="bottom")?$closeLink.appendTo($cluetipInner):(opts.closePosition=="title")?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.click(function(){cluetipClose();return false});if(opts.mouseOutClose){if($.fn.hoverIntent&&opts.hoverIntent){$cluetip.hoverIntent({over:doNothing,timeout:opts.hoverIntent.timeout,out:function(){$closeLink.trigger("click")}})}else{$cluetip.hover(doNothing,function(){$closeLink.trigger("click")})}}else{$cluetip.unbind("mouseout")}}var direction="";$cluetipOuter.css({overflow:defHeight=="auto"?"visible":"auto",height:defHeight});tipHeight=defHeight=="auto"?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=="fixed"){tipY=posY-opts.dropShadowSteps+tOffset}else{if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||opts.positionBy=="bottomTop"){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction="top"}else{tipY=mouseY+tOffset;direction="bottom"}}else{if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset}else{if($this.css("display")=="block"||$this[0].tagName.toLowerCase()=="area"||opts.positionBy=="mouse"){tipY=bpY-tOffset}else{tipY=posY-opts.dropShadowSteps}}}}if(direction==""){posX<linkLeft?direction="left":direction="right"}$cluetip.css({top:tipY+"px"}).removeClass().addClass("clue-"+direction+"-"+ctClass).addClass(" cluetip-"+ctClass);if(opts.arrows){var bgY=(posY-tipY-opts.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(direction)&&posX>=0&&bgY>0)?bgY+"px":/(left|right)/.test(direction)?0:""}).show()}else{$cluetipArrows.hide()}$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.open!="show"&&opts.fx.openSpeed);if(opts.dropShadow){$dropShadow.css({height:tipHeight,width:tipInnerWidth}).show()}if($.fn.bgiframe){$cluetip.bgiframe()}if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose)}opts.onShow($cluetip,$cluetipInner)};var inactivate=function(){isActive=false;$("#cluetip-waitimage").hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay)}if(opts.hoverClass){$this.removeClass(opts.hoverClass)}$(".cluetip-clicked").removeClass("cluetip-clicked")};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass().end().children().empty();if(tipTitle){$this.attr(opts.titleAttribute,tipTitle)}$this.css("cursor","");if(opts.arrows){$cluetipArrows.css({top:""})}};if((/click|toggle/).test(opts.activation)){$this.click(function(event){if($cluetip.is(":hidden")||!$this.is(".cluetip-clicked")){activate(event);$(".cluetip-clicked").removeClass("cluetip-clicked");$this.addClass("cluetip-clicked")}else{inactivate(event)}this.blur();return false})}else{if(opts.activation=="focus"){$this.focus(function(event){activate(event)});$this.blur(function(event){inactivate(event)})}else{$this.click(function(){if($this.attr("href")&&$this.attr("href")==tipAttribute&&!opts.clickThrough){return false}});var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.mousemove(function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY})})}};if($.fn.hoverIntent&&opts.hoverIntent){$this.mouseover(function(){$this.attr("title","")}).hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event)},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind("mousemove")}})}else{$this.hover(function(event){activate(event);mouseTracks(event)},function(event){inactivate(event);$this.unbind("mousemove")})}}}})};$.fn.cluetip.defaults={width:275,height:"auto",cluezIndex:97,positionBy:"auto",topOffset:15,leftOffset:15,local:false,hideLocal:true,attribute:"rel",titleAttribute:"title",splitTitle:"",showTitle:true,cluetipClass:"default",hoverClass:"",waitImage:true,cursor:"help",arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:"hover",clickThrough:false,tracking:false,delayedClose:0,closePosition:"top",closeText:"Close",truncate:0,fx:{open:"show",openSpeed:""},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true},onShow:function(ct,c){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g,"").replace(/<(link|title)(.|\s)*?\/(link|title)>/g,"");return data},ajaxSettings:{dataType:"html"},debug:false};var insertionType="appendTo",insertionElement="body";$.cluetip={};$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType}if(options&&options.insertionElement){insertionElement=options.insertionElement}}})(jQuery);
//hoverintent
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode}catch(e){p=this}}if(p==this){return false}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.mouseover(handleHover).mouseout(handleHover)}})(jQuery);
//documentready
$(document).ready(function(){$(".clickme").cluetip({local:true,activation:"click",sticky:true,closePosition:"top",closeText:'<img class="zatvori_okvir" src="/images/zatvori.gif" alt="" />',cluetipClass:"rounded",dropShadow:false,width:450,positionBy:'bottomTop'})});
//treeview
(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter("."+c1);this.filter("."+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this},replaceClass:function(c1,c2){return this.filter("."+c1).removeClass(c1).addClass(c2).end()},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className)},function(){$(this).removeClass(className)})},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback){callback.apply(this,arguments)}})},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback)}else{this.hide();if(callback){this.each(callback)}}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide()}return this.filter(":has(>ul)")},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){toggler.apply($(this).next())}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend('<div class="'+CLASSES.hitarea+'"/>').find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea "});$(this).addClass(classes)})}this.find("div."+CLASSES.hitarea).click(toggler)},treeview:function(settings){settings=$.extend({cookieId:"treeview"},settings);if(settings.add){return this.trigger("add",[settings.add])}if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments)}}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true}));return false}}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler())}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle)}}function serialize(){function binary(arg){return arg?1:0}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0});$.cookie(settings.cookieId,data.join(""))}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]()})}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments)}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase()});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show()}break}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show()}return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler)})}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview})(jQuery);