YAHOO.namespace("Contacting");(function(){var cookiename='yuishowexclusive';YAHOO.Contacting.ShowExclusive=function(name,ids,show_id,turn_off){this.turn_off=turn_off;this.name=name;this.ids=ids;if(turn_off)return this;this.hide_all(true);if(YAHOO.util.Cookie.get(cookiename)){for(var i=0;i<this.ids.length;i++){if(this._check_cookie(this.ids[i]))this.show(this.ids[i],true);}}else{if(show_id)this.show(show_id);}}
YAHOO.Contacting.ShowExclusive.prototype.show=function(id,not_exclusive){if(this.turn_off)return;if(!not_exclusive)this.hide_all();YAHOO.util.Dom.removeClass(id,'hide');this._check_cookie(null,null,id);}
YAHOO.Contacting.ShowExclusive.prototype.hide_all=function(no_cookies){for(var i=0;i<this.ids.length;i++){YAHOO.util.Dom.addClass(this.ids[i],'hide');if(!no_cookies)this._check_cookie(null,this.ids[i],null);}}
YAHOO.Contacting.ShowExclusive.prototype.show_all=function(no_cookies){for(var i=0;i<this.ids.length;i++){YAHOO.util.Dom.removeClass(this.ids[i],'hide');if(!no_cookies)this._check_cookie(null,null,this.ids[i]);}}
YAHOO.Contacting.ShowExclusive.prototype._check_cookie=function(exists,remove,add){if(add||YAHOO.util.Cookie.get(cookiename)){var value;var new_values=new Array();if(value=YAHOO.util.Cookie.getSub(cookiename,this.name)){var values=value.split('/');for(var i=0,j=values.length;i<j;i++){if(exists&&values[i]==exists)return 1;if(remove&&values[i]!=remove)new_values.push(values[i]);if(add&&values[i]!=add)new_values.push(values[i]);}}
if(add)new_values.push(add);if(add||remove){YAHOO.util.Cookie.removeSub(cookiename,this.name,{path:"/"});if(new_values.length)
YAHOO.util.Cookie.setSub(cookiename,this.name,new_values.join('/'),{path:"/"});}}
return 0;}})();YAHOO.register("yuishowexclusive",YAHOO.Contacting.ShowExclusive,{version:"1.0",build:"1"});