var NexxarSubjects={selectedSubjectsQueryParam:"",checkSelectedSubjects:function(){var c=this.analyseSubjectsSettings();if(!c||c==null||c.length<=0){return}else{c.sort()}this.selectedSubjectsQueryParam=c.join("");subjectsID=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j");var d="";for(var b=0;b<subjectsID.length;b++){var e=0;for(var a=0;a<c.length;a++){if(c[a]==subjectsID[b]){e=1;break}}if(e==0){if(d.length>0){d+=", "}d+="#subjectID"+subjectsID[b]}}if(d.length>0){document.write('<style type="text/css">'+d+" { display: none; }</style>")}},addSubjectsParamToLinks:function(){if(!this.selectedSubjectsQueryParam||typeof(this.selectedSubjectsQueryParam)!="string"||this.selectedSubjectsQueryParam.length<=0){return}$("#subjectsMenuItems a, #inleaf a, #subjectsMenu a, #mainbar a, #leftbar a, #leftpanel a, #mainpanel a, #bodyContent a, #headerContent a, #language a, #inleaf a, #inleaf1 a, #inleaf2 a, #language").each(function(){var a=$(this).attr("href");if(!a||typeof(a)!="string"||a.length<=0){return}if(a.indexOf("?")<0){$(this).attr("href",a+"?subjects="+NexxarSubjects.selectedSubjectsQueryParam)}else{$(this).attr("href",a+"&subjects="+NexxarSubjects.selectedSubjectsQueryParam)}})},analyseSubjectsSettings:function(){var e=String(window.location.search).toLowerCase();if(e=="all"||e.match(/[?&]subjects=all/)){return new Array()}var a=e.match(/[?&]subjects=([0-9a-zA-Z]+)/);if(!a){a=e.match(/([0-9a-zA-Z]+)/);if(!a){return false}}a=String(a[1]);this.subjectsSelected=new Array();for(var c=0;c<a.length;c++){var d=0;for(var b=0;b<this.subjectsSelected.length;b++){if(this.subjectsSelected[b]==a.charAt(c)){d=1;break}}if(d==0){this.subjectsSelected[this.subjectsSelected.length]=a.charAt(c)}}return this.subjectsSelected},analyseSubmitFormValues:function(){if(!window.location.search||!String(window.location.search).match(/[&?]subject_[-a-z0-9_]+=1/)||String(window.location.search).match(/[&?]subject_all=1/)){return false}var b=new Array();try{b=geber_subjectsForm_getSubjectMenuList()}catch(g){}if(!b||b.length<=0){return false}var f="";var c="";for(var d=0;d<b.length;d++){var a=new RegExp("[?&]subject_("+b[d].name+"|"+String(d)+"|all)=1");if(String(window.location.search).match(a)){if(c.length<=0){c=b[d].path}f+=Number(d).toString(16)}}if(c.length>0&&String(window.location.pathname).indexOf(c)<0){c+=NexxarLib.getDefaultPageExtension();if(f&&f.length>0){c+="?subjects="+f}return window.location.href=NexxarLib.getBaseURLFull()+c}return false}};NexxarSubjects.analyseSubmitFormValues();NexxarSubjects.checkSelectedSubjects();$(document).ready(function(){NexxarSubjects.addSubjectsParamToLinks()});
