/* jquery.showhide A more robust replacement for jQuery's .toggle() function. Built by Dana Woodman . Minified at http://fmarcia.info/jsmin/test.html (using the "Agressive" option) */ (function($){var debug=function(msg){if(window.console){console.log(msg);};};var Toggle=function($obj){var show,hide,update_cookie,show_text=$obj.o.plus_text,hide_text=$obj.o.minus_text,shown=$obj.o.default_open,$target=($obj.o.target_obj)?eval($obj.o.target_obj):$obj.next(),$focus_target=($obj.o.focus_target)?eval($obj.o.focus_target):null,display=($target.css('display')===('inline'||'block'))?$target.css('display'):'block';if($obj.cookies_installed&&$obj.o.use_cookie){shown=$.cookie($obj.o.cookie_name)==='true'?true:false;};show_text=(!show_text&&!shown)?$obj.html():show_text;hide_text=(!hide_text&&shown)?$obj.html():hide_text;update_cookie=function(val){if($obj.cookies_installed&&$obj.o.use_cookie){$.cookie($obj.o.cookie_name,val);};};show=function(){($obj.o.minus_class)?$obj.addClass($obj.o.minus_class):null;($obj.o.plus_class)?$obj.removeClass($obj.o.plus_class):null;($obj.o.show_class)?$target.addClass($obj.o.show_class):null;($obj.o.hide_class)?$target.removeClass($obj.o.hide_class):null;$target.css('display',display);($focus_target)?$focus_target.focus():null;(hide_text)?$obj.html(hide_text):null;shown=true;update_cookie(shown);};hide=function(){($obj.o.plus_class)?$obj.addClass($obj.o.plus_class):null;($obj.o.minus_class)?$obj.removeClass($obj.o.minus_class):null;($obj.o.hide_class)?$target.addClass($obj.o.hide_class):null;($obj.o.show_class)?$target.removeClass($obj.o.show_class):null;$target.css('display','none');(show_text)?$obj.html(show_text):null;shown=false;update_cookie(shown);};(shown)?show():hide();$obj.click(function(){(shown)?hide():show();return false;});};$.fn.showhide=function(options){var cookies_installed=false,opts;try{$.cookie();cookies_installed=true}catch(err){debug('[ERROR] jQuery Cookies plugin not installed!\n\tPlease install the jQuery Cookies plugin if you want to use the cookies feature of this plugin.');};var opts=$.extend({},$.fn.showhide.defaults,options);return this.each(function(){var $obj=$(this);$obj.cookies_installed=cookies_installed;$obj.o=$.meta?$.extend({},opts,$this.data()):opts;var $toggle=new Toggle($obj);});};$.fn.showhide.defaults={target_obj:null,focus_target:null,default_open:true,show_class:'show',hide_class:'hide',plus_class:'plus',plus_text:null,minus_class:'minus',minus_text:null,use_cookie:false,cookie_expires:365,cookie_name:'show_target'};})(jQuery);