function switchcontent(className, filtertag){ this.className=className this.collapsePrev=false this.persistType="none" this.filter_content_tag=(typeof filtertag!="undefined")? filtertag.toLowerCase() : "" } switchcontent.prototype.setStatus=function(openHTML, closeHTML){ this.statusOpen=openHTML this.statusClosed=closeHTML } switchcontent.prototype.setColor=function(openColor, closeColor){ this.colorOpen=openColor this.colorClosed=closeColor } switchcontent.prototype.setPersist=function(bool, days){ if (bool==true){ if (typeof days=="undefined") this.persistType="session" else{ this.persistType="days" this.persistDays=parseInt(days) } } else this.persistType="none" } switchcontent.prototype.collapsePrevious=function(bool){ this.collapsePrev=bool } switchcontent.prototype.sweepToggle=function(setting){ if (typeof this.headers!="undefined" && this.headers.length>0){ for (var i=0; i1) opencontents.shift() if (typeof this.statusOpen!="undefined") this.statusOpen=this.statusClosed=null if (this.persistType=="session") switchcontent.setCookie(this.className, opencontents.join(",")) else if (this.persistType=="days" && typeof this.persistDays=="number"){ switchcontent.setCookie(this.className+"_d", opencontents.join(","), this.persistDays) switchcontent.setCookie(this.className+"_dtrack", this.persistDays, this.persistDays) } } switchcontent.dotask=function(target, functionref, tasktype){ var tasktype=(window.addEventListener)? tasktype : "on"+tasktype if (target.addEventListener) target.addEventListener(tasktype, functionref, false) else if (target.attachEvent) target.attachEvent(tasktype, functionref) } switchcontent.getCookie=function(Name){ var re=new RegExp(Name+"=[^;]+", "i"); if (document.cookie.match(re)) return document.cookie.match(re)[0].split("=")[1] return "" } switchcontent.setCookie=function(name, value, days){ if (typeof days!="undefined"){ var expireDate = new Date() var expstring=expireDate.setDate(expireDate.getDate()+days) document.cookie = name+"="+value+"; expires="+expireDate.toGMTString() } else document.cookie = name+"="+value }