var switchcontent_ajax_msg="<em>Loading Ajax content...</em>";var switchcontent_ajax_bustcache=true;function switchcontent(B,A){this.className=B;this.collapsePrev=false;this.persistType="none";this.filter_content_tag=(typeof A!="undefined")?A.toLowerCase():"";this.ajaxheaders={};}switchcontent.prototype.setStatus=function(B,A){this.statusOpen=B;this.statusClosed=A;};switchcontent.prototype.setColor=function(A,B){this.colorOpen=A;this.colorClosed=B;};switchcontent.prototype.setPersist=function(A,B){if(A==true){if(typeof B=="undefined"){this.persistType="session";}else{this.persistType="days";this.persistDays=parseInt(B);}}else{this.persistType="none";}};switchcontent.prototype.collapsePrevious=function(A){this.collapsePrev=A;};switchcontent.prototype.setContent=function(A,B){this.ajaxheaders["header"+A]=B;};switchcontent.prototype.sweepToggle=function(B){if(typeof this.headers!="undefined"&&this.headers.length>0){for(var A=0;A<this.headers.length;A++){if(B=="expand"){this.expandcontent(this.headers[A]);}else{if(B=="contract"){this.contractcontent(this.headers[A]);}}}}};switchcontent.prototype.defaultExpanded=function(){var B=[];for(var A=0;(!this.collapsePrev&&A<arguments.length)||(this.collapsePrev&&A==0);A++){B[B.length]=arguments[A];}this.expandedindices=B.join(",");};switchcontent.prototype.togglecolor=function(B,A){if(typeof this.colorOpen!="undefined"){B.style.color=A;}};switchcontent.prototype.togglestatus=function(B,A){if(typeof this.statusOpen!="undefined"){B.firstChild.innerHTML=A;}};switchcontent.prototype.contractcontent=function(B){var A=document.getElementById(B.id.replace("-title",""));A.style.display="none";this.togglestatus(B,this.statusClosed);this.togglecolor(B,this.colorClosed);};switchcontent.prototype.expandcontent=function(B){var A=document.getElementById(B.id.replace("-title",""));if(B.ajaxstatus=="waiting"){switchcontent.connect(B.ajaxfile,B);}A.style.display="block";this.togglestatus(B,this.statusOpen);this.togglecolor(B,this.colorOpen);};switchcontent.prototype.toggledisplay=function(B){var A=document.getElementById(B.id.replace("-title",""));if(A.style.display=="block"){this.contractcontent(B);}else{this.expandcontent(B);if(this.collapsePrev&&typeof this.prevHeader!="undefined"&&this.prevHeader.id!=B.id){this.contractcontent(this.prevHeader);}}if(this.collapsePrev){this.prevHeader=B;}};switchcontent.prototype.collectElementbyClass=function(C){var D=new RegExp("(^|\\s+)"+C+"($|\\s+)","i");this.headers=[],this.innercontents=[];if(this.filter_content_tag!=""){var B=document.getElementsByTagName(this.filter_content_tag);}else{var B=document.all?document.all:document.getElementsByTagName("*");}for(var A=0;A<B.length;A++){if(typeof B[A].className=="string"&&B[A].className.search(D)!=-1){if(document.getElementById(B[A].id+"-title")!=null){this.headers[this.headers.length]=document.getElementById(B[A].id+"-title");this.innercontents[this.innercontents.length]=B[A];}}}};switchcontent.prototype.init=function(){var B=this;this.collectElementbyClass(this.className);if(this.headers.length==0){return ;}if(this.persistType=="days"&&(parseInt(switchcontent.getCookie(this.className+"_dtrack"))!=this.persistDays)){switchcontent.setCookie(this.className+"_d","",-1);}var C=(this.persistType=="session"&&switchcontent.getCookie(this.className)!="")?","+switchcontent.getCookie(this.className)+",":(this.persistType=="days"&&switchcontent.getCookie(this.className+"_d")!="")?","+switchcontent.getCookie(this.className+"_d")+",":(this.expandedindices)?","+this.expandedindices+",":"";for(var A=0;A<this.headers.length;A++){if(typeof this.ajaxheaders["header"+A]!="undefined"){this.headers[A].ajaxstatus="waiting";this.headers[A].ajaxfile=this.ajaxheaders["header"+A];}if(typeof this.statusOpen!="undefined"){this.headers[A].innerHTML='<span class="status"></span>'+this.headers[A].innerHTML;}if(C.indexOf(","+A+",")!=-1){this.expandcontent(this.headers[A]);if(this.collapsePrev){this.prevHeader=this.headers[A];}}else{this.contractcontent(this.headers[A]);}this.headers[A].onclick=function(){B.toggledisplay(this);};}switchcontent.dotask(window,function(){B.rememberpluscleanup();},"unload");};switchcontent.prototype.rememberpluscleanup=function(){var B=new Array("none");for(var A=0;A<this.innercontents.length;A++){if(this.persistType!="none"&&this.innercontents[A].style.display=="block"&&(!this.collapsePrev||(this.collapsePrev&&B.length<2))){B[B.length]=A;}this.headers[A].onclick=null;}if(B.length>1){B.shift();}if(typeof this.statusOpen!="undefined"){this.statusOpen=this.statusClosed=null;}if(this.persistType=="session"){switchcontent.setCookie(this.className,B.join(","));}else{if(this.persistType=="days"&&typeof this.persistDays=="number"){switchcontent.setCookie(this.className+"_d",B.join(","),this.persistDays);switchcontent.setCookie(this.className+"_dtrack",this.persistDays,this.persistDays);}}};switchcontent.dotask=function(B,C,A){var A=(window.addEventListener)?A:"on"+A;if(B.addEventListener){B.addEventListener(A,C,false);}else{if(B.attachEvent){B.attachEvent(A,C);}}};switchcontent.connect=function(A,E){var D=false;var C="";if(window.ActiveXObject){try{D=new ActiveXObject("Msxml2.XMLHTTP");}catch(B){try{D=new ActiveXObject("Microsoft.XMLHTTP");}catch(B){}}}else{if(window.XMLHttpRequest){D=new XMLHttpRequest();}else{return false;}}D.onreadystatechange=function(){switchcontent.loadpage(D,E);};if(switchcontent_ajax_bustcache){C=(A.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime();}D.open("GET",A+C,true);D.send(null);};switchcontent.loadpage=function(C,B){var A=document.getElementById(B.id.replace("-title",""));A.innerHTML=switchcontent_ajax_msg;if(C.readyState==4&&(C.status==200||window.location.href.indexOf("http")==-1)){A.innerHTML=C.responseText;B.ajaxstatus="loaded";}};switchcontent.getCookie=function(A){var B=new RegExp(A+"=[^;]+","i");if(document.cookie.match(B)){return document.cookie.match(B)[0].split("=")[1];}return"";};switchcontent.setCookie=function(B,C,E){if(typeof E!="undefined"){var A=new Date();var D=A.setDate(A.getDate()+E);document.cookie=B+"="+C+"; expires="+A.toGMTString();}else{document.cookie=B+"="+C;}};