NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name UC Berkeley Schedule Enhancer (UCBSE) // @description Enhances the look and feel of the UC Berkeley schedule making it easier to read and search for classes. // @namespace http://osoc.berkeley.edu/OSOC/ // @include http://osoc.berkeley.edu/OSOC/* // ==/UserScript== // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // // // Want to make this script better? Fork us on github! // https://github.com/athk/UCBSE // if("undefined"==typeof GM_deleteValue||"undefined"==typeof GM_addStyle)GM_addStyle=function(b){var c=document.createElement("style");c.textContent=b;(b=document.getElementsByTagName("head")[0])&&b.appendChild(c)},GM_deleteValue=function(b){localStorage.removeItem(b)},GM_getValue=function(b,c){var d=localStorage.getItem(b);if(!d)return c;var a=d[0],d=d.substring(1);switch(a){case "b":return"true"==d;case "n":return Number(d);default:return d}},GM_log=function(b){console.log(b)},GM_registerMenuCommand= function(){},GM_setValue=function(b,c){c=(typeof c)[0]+c;localStorage.setItem(b,c)},GM_xmlhttpRequest="undefined"!=typeof safari?function(b){b.requestType="GM_xmlhttpRequest";"undefined"!=typeof b.onload&&(b.XHRID=xhrQueue.count,xhrQueue.onloads[xhrQueue.count]=b.onload,safari.self.tab.dispatchMessage("GM_xmlhttpRequest",b),xhrQueue.count++)}:"undefined"!=typeof opera?function(b){b.requestType="GM_xmlhttpRequest";var c=-1==b.url.indexOf(location.hostname);if("undefined"!=typeof b.onload&&c)b.XHRID= xhrQueue.count,xhrQueue.onloads[xhrQueue.count]=b.onload,opera.extension.postMessage(JSON.stringify(b)),xhrQueue.count++;else{var d=new XMLHttpRequest;d.onreadystatechange=function(){if(b.onreadystatechange)b.onreadystatechange(d);if(4==d.readyState&&b.onload)b.onload(d)};d.onerror=function(){if(b.onerror)b.onerror(d)};try{d.open(b.method,b.url,!0)}catch(a){if(b.onerror)b.onerror({readyState:4,responseHeaders:"",responseText:"",responseXML:"",status:403,statusText:"Forbidden"});return}if(b.headers)for(name in b.headers)d.setRequestHeader(name, b.headers[name]);d.send(b.data);return d}}:function(b){var c=new XMLHttpRequest;c.onreadystatechange=function(){if(b.onreadystatechange)b.onreadystatechange(c);if(4==c.readyState&&b.onload)b.onload(c)};c.onerror=function(){if(b.onerror)b.onerror(c)};try{c.open(b.method,b.url,!0)}catch(d){if(b.onerror)b.onerror({readyState:4,responseHeaders:"",responseText:"",responseXML:"",status:403,statusText:"Forbidden"});return}if(b.headers)for(name in b.headers)c.setRequestHeader(name,b.headers[name]);c.send(b.data); return c};JSON.stringify=JSON.stringify||function(b){var c=typeof b;if("object"!=c||null===b)return"string"==c&&(b='"'+b+'"'),""+b;var d,a,f=[],g=b&&b.constructor==Array;for(d in b)a=b[d],c=typeof a,"string"==c?a='"'+a+'"':"object"==c&&null!==a&&(a=JSON.stringify(a)),f.push((g?"":'"'+d+'":')+(""+a));return(g?"[":"{")+(""+f)+(g?"]":"}")};JSON.parse=JSON.parse||function(b){""===b&&(b='""');eval("var p="+b+";");return p}; function post_to_url(b,c,d,a){var d=d||"post",a=a||"_self",f=document.createElement("form");f.setAttribute("method",d);f.setAttribute("action",b);f.setAttribute("target",a);for(var g in c)b=document.createElement("input"),b.setAttribute("type","hidden"),b.setAttribute("name",g),b.setAttribute("value",c[g]),f.appendChild(b);document.body.appendChild(f);f.submit()}function associativeArrayToString(b){var c="{ ",d;for(d in b)c+="'"+d+"' : '"+b[d]+"', ";c=c.replace(/,[\s]*$/,"");return c+"}"} function tokenize(b){b=b.match(/[A-Za-z0-9.-]+/g)+"";return b.split(",")}function toggleColumn(b,c){var d=document.getElementById(b);hasClass(d,"hide"+c)?removeClass(d,"hide"+c):addClass(d,"hide"+c)} function createToggleColumnElement(b,c,d,a){var a=a||"enhanced",f=document.createElement("div");f.setAttribute("class","checkboxElement");var g=document.createElement("input");g.setAttribute("type","checkbox");g.setAttribute("onclick",'toggleColumn("'+a+'", '+c+")");d=document.createTextNode(d);g.addEventListener("click",function(){!1==GM_getValue("isCol"+c)?GM_setValue("isCol"+c,!0):GM_setValue("isCol"+c,!1)},!1);var h=document.getElementById(a).className;!1!=GM_getValue("isCol"+c)?(document.getElementById(a).className= h.replace("hide"+c,""),g.setAttribute("checked","yes")):document.getElementById(a).className+=" hide"+c;f.appendChild(g);f.appendChild(d);b.appendChild(f)}function popupwindow(b,c,d,a){b=window.open(b,c,"width="+d+",height="+a);window.focus&&b.focus();return!1}function highlightRow(b){hasClass(b,"highlightonclick")?removeClass(b,"highlightonclick"):addClass(b,"highlightonclick")} function addHighlightedCourse(b){UCBSE.highlightedCourses.push(b);GM_setValue("highlightArrayJSON",JSON.stringify(UCBSE.highlightedCourses));document.getElementById("counter").innerHTML=UCBSE.highlightedCourses.length}function removeHighlightedCourse(b,c){c=c||UCBSE.searchCourses(b,UCBSE.highlightedCourses);UCBSE.highlightedCourses.splice(c,1);GM_setValue("highlightArrayJSON",JSON.stringify(UCBSE.highlightedCourses));document.getElementById("counter").innerHTML=UCBSE.highlightedCourses.length} function highlightListener(b){var c=UCBSE.searchCourses(b,UCBSE.highlightedCourses);null!=c?removeHighlightedCourse(b,c):addHighlightedCourse(b);highlightedCoursesTableCreator(UCBSE.highlightedCoursesContainer)} function schedulebuilderListener(b){try{GM_xmlhttpRequest({method:"GET",url:"http://schedulebuilder.berkeley.edu/explore/department/"+UCBSE.term+"/"+UCBSE.year+"/"+b.getSchedulebuilderId()+"/courses.json",onload:function(c){for(var c=JSON.parse(c.responseText),a=0,f=c.courses.length;a<f;a++)if(c.courses[a].identifier==b.getCourseNum()){window.open("http://schedulebuilder.berkeley.edu/explore/courses/"+UCBSE.termAbrev+"/"+UCBSE.year+"/"+c.courses[a].id+"/");break}}})}catch(c){alert("It looks like your browser dosent support GM_xmlhttpRequest. The schedulebuilder link cannot work without it. Please use a different browser such as Firefox or Chrome.")}} function toggleClassPersistent(b){!1!=GM_getValue(b)?GM_setValue(b,!1):GM_setValue(b,!0)} function highlightedCoursesTableCreator(b){var c=document.createElement("table");c.setAttribute("cellspacing","0");c.innerHTML='<thead><tr><th></th><th>CCN</th><th colspan="3" align="left">Course</th><th align="left">Class<br>Type</th><th align="left">Section<br>Number</th><th align="left">Units</th><th align="left">Instructor</th><th align="left">Days</th><th align="left">Time</th><th align="left">Location</th><th></th></tr></thead>';for(var d=0,a=UCBSE.highlightedCourses.length;d<a;d++){var f=document.createElement("tr"), g=UCBSE.highlightedCourses[d],h="",h=h+'<td style="white-space:nowrap;">[ <a>X</a> ]</td>',h=h+('<td><input type="text" onclick="select()" class="ccnInput" value="'+nullToEmpty(g.ccn)+'" ></td>'),h=h+("<td>"+nullToEmpty(g.departmentAbrev)+"</td>"),h=h+("<td>"+nullToEmpty(g.courseNum)+"</td>"),h=h+("<td>"+nullToEmpty(g.title)+"</td>"),h=h+("<td>"+nullToEmpty(g.classType)+"</td>"),h=h+("<td>"+nullToEmpty(g.secNum)+"</td>"),h=h+("<td>"+nullToEmpty(g.units)+"</td>"),h=h+("<td>"+nullToEmpty(g.instructor)+ "</td>"),h=h+("<td>"+nullToEmpty(g.days)+"</td>"),h=h+("<td>"+nullToEmpty(g.time)+"</td>"),h=h+("<td>"+nullToEmpty(g.room)+"</td>"),h=h+"<td>";!0==g.enrollmentLink&&(h+='<a href="http://infobears.berkeley.edu:3400/osc/?_InField1=RESTRIC&_InField2='+g.ccn+'&_InField3=12B4" target="_blank" alt="Enrollment">[E]</a> ');g.bookLink&&(h+='<a href="'+g.bookLink+'" target="_blank" alt="Books">[B]</a>');h+="</td>";f.innerHTML=h;f.getElementsByTagName("a")[0].addEventListener("click",function(a){return function(){removeHighlightedCourse(a); highlightedCoursesTableCreator(b);UCBSE.tbodyCoursesHTML=UCBSE.tbodyCoursesHTML||UCBSE.table.getElementsByClassName("course");var c=UCBSE.tbodyCoursesHTML[UCBSE.searchCourses(a,UCBSE.courseList)];removeClass(c,"highlightonclick")}}(g),!1);c.appendChild(f)}d=document.createElement("tfoot");a=document.createElement("tr");f=document.createElement("td");f.setAttribute("colspan","6");g=document.createElement("div");h=document.createElement("a");h.innerHTML="clear all highlighted courses";h.addEventListener("click", function(){!0==confirm("Are you sure you want to clear all highlighted courses?")&&(UCBSE.highlightedCourses=[],GM_setValue("highlightArrayJSON",JSON.stringify(UCBSE.highlightedCourses)),highlightedCoursesTableCreator(b))},!1);g.appendChild(document.createTextNode("[ "));g.appendChild(h);g.appendChild(document.createTextNode(" ]"));f.appendChild(g);a.appendChild(f);f=document.createElement("td");f.setAttribute("colspan","7");f.appendChild(closeContainer("highlightedCourses",800,"isHigh"));a.appendChild(f); d.appendChild(a);c.appendChild(d);b.firstChild?b.replaceChild(c,b.firstChild):b.appendChild(c)} function closeContainer(b,c,d){var a=document.createElement("div");a.setAttribute("id","close");a.appendChild(document.createTextNode("[ "));var f=document.createElement("a");f.innerHTML="close";f.setAttribute("onclick","toggleColumn('"+b+"', "+c+")");void 0!==typeof d&&f.addEventListener("click",function(){toggleClassPersistent(d)},!1);a.appendChild(f);a.appendChild(document.createTextNode(" ]"));return a}function spaceToPlus(b){return b.replace(" ","+")} function strip(b){var c=document.createElement("DIV");c.innerHTML=b;return c.textContent||c.innerText}function insertAfter(b,c){b.parentNode.insertBefore(c,b.nextSibling)}function toggleMaximize(){var b=document.getElementById("enhanced");hasClass(b,"enhancedFull")?(GM_setValue("isMaximum",!1),removeClass(b,"enhancedFull"),addClass(b,"enhanced")):(removeClass(b,"enhanced"),addClass(b,"enhancedFull"),GM_setValue("isMaximum",!0))} function toggleCCNBg(){var b=document.getElementById("enhanced");!1==GM_getValue("isBg")?(removeClass(b,"nobg"),GM_setValue("isBg",!0)):(addClass(b,"nobg"),GM_setValue("isBg",!1))}function hasClass(b,c){return"undefined"==typeof b||null==b?!1:b.className.match(RegExp("(\\s|^)"+c+"(\\s|$)"))}function addClass(b,c){hasClass(b,c)||(b.className+=" "+c)}function removeClass(b,c){hasClass(b,c)&&(b.className=b.className.replace(RegExp("(\\s|^)"+c+"(\\s|$)")," "))} function stripSpace(b){return b.replace(/^(\s| )+/,"").replace(/(\s| )+$/,"")}function nullToEmpty(b){return b?b:""}var UCBSE=UCBSE||{};UCBSE.highlightedCourses=GM_getValue("highlightArrayJSON")?JSON.parse(GM_getValue("highlightArrayJSON")):[];var temp=tokenize(strip((document.body.innerHTML.match(/request for .+:/)+"").replace("request for ","").replace(":","")));UCBSE.term=temp[0];UCBSE.termAbrev="Fall"==UCBSE.term?"FL":"SP";UCBSE.year=temp[1]; UCBSE.termTelebearsOracle="Fall"==UCBSE.term?"fa":"sp";UCBSE.termTelebearsOracle+=UCBSE.year.substring(2,4);UCBSE.searchCourses=function(b,c){c=c||this.courseList;b.ccn=b.ccn||b.getCCN();b.courseNum=b.courseNum||b.getCourseNum();b.secNum=b.secNum||b.getSecNum();b.classType=b.classType||b.getClassType();for(i=0;i<c.length;i++){var d=c[i];if(b.ccn==d.ccn&&b.courseNum==d.courseNum&&b.secNum==d.secNum&&b.classType==d.classType)return i}return null};UCBSE.prevDept="";UCBSE.prevDeptAbrev="";UCBSE.tbodyCoursesHTML; UCBSE.Course=function(){var b={"AEROSPACE STUDIES":{abrev:"AEROSPC",schedulebuilderId:97},"AFRICAN AMERICAN STUDIES":{abrev:"AFRICAM",schedulebuilderId:1},"AGRICULTURAL AND ENVIRON CHEMISTRY":{abrev:"AGR CHM",schedulebuilderId:2},"ANCIENT HISTORY AND MED. ARCH.":{abrev:"AHMA",schedulebuilderId:6},"AMERICAN STUDIES":{abrev:"AMERSTD",schedulebuilderId:5},ANTHROPOLOGY:{abrev:"ANTHRO",schedulebuilderId:7},ARABIC:{abrev:"ARABIC",schedulebuilderId:106},ARCHITECTURE:{abrev:"ARCH",schedulebuilderId:9},"AGRICULTURAL AND RESOURCE ECONOMICS":{abrev:"A,RESEC", schedulebuilderId:4},"PRACTICE OF ART":{abrev:"ART",schedulebuilderId:11},"ASIAN AMERICAN STUDIES":{abrev:"ASAMST",schedulebuilderId:13},"ASIAN STUDIES":{abrev:"ASIANST",schedulebuilderId:14},"APPLIED SCIENCE AND TECHNOLOGY":{abrev:"AST",schedulebuilderId:8},ASTRONOMY:{abrev:"ASTRON",schedulebuilderId:15},BENGALI:{abrev:"BANGLA",schedulebuilderId:142},BIOENGINEERING:{abrev:"BIO ENG",schedulebuilderId:16},BIOLOGY:{abrev:"BIOLOGY",schedulebuilderId:159},BIOPHYSICS:{abrev:"BIOPHY",schedulebuilderId:17}, BUDDHISM:{abrev:"BUDDHSM"},"GROUP IN BUDDHIST STUDIES":{abrev:"BUDDSTD",schedulebuilderId:18},CATALAN:{abrev:"CATALAN",schedulebuilderId:154},"CELTIC STUDIES":{abrev:"CELTIC",schedulebuilderId:26},"COMPUTATIONAL AND GENOMIC BIOLOGY":{abrev:"CGB",schedulebuilderId:39},CHEMISTRY:{abrev:"CHEM",schedulebuilderId:28},"CHICANO STUDIES":{abrev:"CHICANO",schedulebuilderId:29},CHINESE:{abrev:"CHINESE",schedulebuilderId:45},"CHEMICAL & BIOMOLECULAR ENGINEERING":{abrev:"CHM ENG",schedulebuilderId:27},"CIVIL AND ENVIRONMENTAL ENGINEERING":{abrev:"CIV ENG", schedulebuilderId:31},CLASSICS:{abrev:"CLASSIC",schedulebuilderId:32},"NEW MEDIA":{abrev:"CNM",schedulebuilderId:115},"COGNITIVE SCIENCE":{abrev:"COG SCI",schedulebuilderId:35},"COLLEGE WRITING PROGRAM":{abrev:"COLWRIT",schedulebuilderId:36},"COMPARATIVE LITERATURE":{abrev:"COM LIT",schedulebuilderId:38},"COMPARATIVE BIOCHEMISTRY":{abrev:"COMPBIO",schedulebuilderId:37},"COMPUTER SCIENCE":{abrev:"COMPSCI",schedulebuilderId:53},"CRITICAL THEORY GRADUATE GROUP":{abrev:"CRIT TH",schedulebuilderId:40}, CUNEIFORM:{abrev:"CUNEIF",schedulebuilderId:107},"CITY AND REGIONAL PLANNING":{abrev:"CY PLAN",schedulebuilderId:30},DEMOGRAPHY:{abrev:"DEMOG",schedulebuilderId:41},"DEVELOPMENT STUDIES":{abrev:"DEV STD",schedulebuilderId:42},DUTCH:{abrev:"DUTCH",schedulebuilderId:70},"EAST EUROPEAN STUDIES":{abrev:"EAEURST",schedulebuilderId:135},"EAST ASIAN LANGUAGES AND CULTURES":{abrev:"EA LANG",schedulebuilderId:44},ECONOMICS:{abrev:"ECON",schedulebuilderId:50},EDUCATION:{abrev:"EDUC",schedulebuilderId:51},EGYPTIAN:{abrev:"EGYPT", schedulebuilderId:108},"ELECTRICAL ENGINEERING":{abrev:"EL ENG",schedulebuilderId:52},"ENERGY AND RESOURCES GROUP":{abrev:"ENE,RES",schedulebuilderId:54},ENGINEERING:{abrev:"ENGIN",schedulebuilderId:55},ENGLISH:{abrev:"ENGLISH",schedulebuilderId:56},"ENVIRONMENTAL DESIGN":{abrev:"ENV DES",schedulebuilderId:57},"ENVIRONMENTAL ECONOMICS AND POLICY":{abrev:"ENVECON",schedulebuilderId:3},"ENVIRONMENTAL SCIENCES":{abrev:"ENV SCI",schedulebuilderId:59},"EARTH AND PLANETARY SCIENCE":{abrev:"EPS",schedulebuilderId:43}, "ENVIRON SCI POLICY, AND MANAGEMENT":{abrev:"ESPM",schedulebuilderId:58},"ETHNIC STUDIES GRADUATE GROUP":{abrev:"ETH GRP",schedulebuilderId:61},"ETHNIC STUDIES":{abrev:"ETH STD",schedulebuilderId:60},"EURASIAN STUDIES":{abrev:"EURA ST",schedulebuilderId:136},"EVE/WKND MASTERS IN BUS. ADM.":{abrev:"EWMBA",schedulebuilderId:22},FILIPINO:{abrev:"FILIPN",schedulebuilderId:162},"FILM AND MEDIA":{abrev:"FILM",schedulebuilderId:62},FOLKLORE:{abrev:"FOLKLOR",schedulebuilderId:63},FRENCH:{abrev:"FRENCH",schedulebuilderId:64}, GEOGRAPHY:{abrev:"GEOG",schedulebuilderId:67},GERMAN:{abrev:"GERMAN",schedulebuilderId:68},"GLOBAL METROPOLITAN STUDIES":{abrev:"GMS",schedulebuilderId:1170},"GLOBAL POVERTY AND PRACTICE":{abrev:"GPP",schedulebuilderId:204},GREEK:{abrev:"GREEK",schedulebuilderId:33},"GRAD STUDENT PROF DEVELOPMENT PGM":{abrev:"GSPDP",schedulebuilderId:72},"GENDER AND WOMEN'S STUDIES":{abrev:"GWS",schedulebuilderId:65},HEBREW:{abrev:"HEBREW",schedulebuilderId:109},"HINDI-URDU":{abrev:"HIN-URD",schedulebuilderId:143}, "HISTORY OF ART":{abrev:"HISTART",schedulebuilderId:12},HISTORY:{abrev:"HISTORY",schedulebuilderId:75},"HEALTH AND MEDICAL SCIENCES":{abrev:"HMEDSCI",schedulebuilderId:74},"INTERNATIONAL AND AREA STUDIES":{abrev:"IAS",schedulebuilderId:80},"INTERDEPARTMENTAL STUDIES":{abrev:"IDS"},"INDIGENOUS LANGUAGES OF AMERICAS":{abrev:"ILA",schedulebuilderId:155},"INDUSTRIAL ENGIN AND OPER RESEARCH":{abrev:"IND ENG",schedulebuilderId:76},INFORMATION:{abrev:"INFO",schedulebuilderId:77},"INFORMATION SYSTEMS AND MANAGEMENT":{abrev:"INFOSYS"}, "INTEGRATIVE BIOLOGY":{abrev:"INTEGBI",schedulebuilderId:78},IRANIAN:{abrev:"IRANIAN",schedulebuilderId:111},"INTERDISCIPLINARY STUDIES FIELD MAJ":{abrev:"ISF",schedulebuilderId:79},"ITALIAN STUDIES":{abrev:"ITALIAN",schedulebuilderId:81},JAPANESE:{abrev:"JAPAN",schedulebuilderId:46},"JEWISH STUDIES":{abrev:"JEWISH",schedulebuilderId:82},JOURNALISM:{abrev:"JOURN",schedulebuilderId:83},KHMER:{abrev:"KHMER",schedulebuilderId:144},KOREAN:{abrev:"KOREAN",schedulebuilderId:48},"LANGUAGE PROFICIENCY PROGRAM":{abrev:"LAN PRO", schedulebuilderId:73},"LANGUAGE PROFICIENCY PROGRAM":{abrev:"LANGPRO"},"LATIN AMERICAN STUDIES":{abrev:"LATAMST",schedulebuilderId:85},LATIN:{abrev:"LATIN",schedulebuilderId:34},LAW:{abrev:"LAW",schedulebuilderId:86},"LANDSCAPE ARCHITECTURE":{abrev:"LD ARCH",schedulebuilderId:84},"LEGAL STUDIES":{abrev:"LEGALST",schedulebuilderId:87},"LESBIAN GAY BISEXUAL TRANSGENDER ST":{abrev:"LGBT",schedulebuilderId:66},LINGUISTICS:{abrev:"LINGUIS",schedulebuilderId:89},"LETTERS AND SCIENCE":{abrev:"LNS",schedulebuilderId:88}, "MALAY/INDONESIAN":{abrev:"MALAY/I",schedulebuilderId:145},"MASS COMMUNICATIONS":{abrev:"MASSCOM",schedulebuilderId:90},MATHEMATICS:{abrev:"MATH",schedulebuilderId:92},"MATERIALS SCIENCE AND ENGINEERING":{abrev:"MAT SCI",schedulebuilderId:91},"MASTERS IN BUSINESS ADMINISTRATION":{abrev:"MBA",schedulebuilderId:21},"MOLECULAR AND CELL BIOLOGY":{abrev:"MCELLBI",schedulebuilderId:100},"MECHANICAL ENGINEERING":{abrev:"MEC ENG",schedulebuilderId:93},"MEDIA STUDIES":{abrev:"MEDIAST",schedulebuilderId:160}, "MEDIEVAL STUDIES":{abrev:"MED ST",schedulebuilderId:94},"MIDDLE EASTERN STUDIES":{abrev:"M E STU",schedulebuilderId:95},"MASTERS IN FINANCIAL ENGINEERING":{abrev:"MFE",schedulebuilderId:24},"MILITARY AFFAIRS":{abrev:"MIL AFF",schedulebuilderId:96},"MILITARY SCIENCE":{abrev:"MIL SCI",schedulebuilderId:98},MUSIC:{abrev:"MUSIC",schedulebuilderId:101},"NATIVE AMERICAN STUDIES":{abrev:"NATAMST",schedulebuilderId:103},"NATURAL RESOURCES":{abrev:"NAT RES",schedulebuilderId:104},"NAVAL SCIENCE":{abrev:"NAV SCI", schedulebuilderId:99},"NEAR EASTERN STUDIES":{abrev:"NE STUD",schedulebuilderId:105},NEUROSCIENCE:{abrev:"NEUROSC",schedulebuilderId:114},"NANOSCALE SCIENCE AND ENGINEERING":{abrev:"NSE",schedulebuilderId:102},"NUCLEAR ENGINEERING":{abrev:"NUC ENG",schedulebuilderId:116},"NUTRITIONAL SCIENCES AND TOXICOLOGY":{abrev:"NUSCTX",schedulebuilderId:117},"NEW MEDIA":{abrev:"NWMEDIA",schedulebuilderId:115},OPTOMETRY:{abrev:"OPTOM",schedulebuilderId:118},"PEACE AND CONFLICT STUDIES":{abrev:"PACS",schedulebuilderId:120}, "PUBLIC HEALTH":{abrev:"PB HLTH",schedulebuilderId:128},PERSIAN:{abrev:"PERSIAN",schedulebuilderId:110},"PH.D. IN BUSINESS ADMINISTRATION":{abrev:"PHDBA",schedulebuilderId:25},PHILOSOPHY:{abrev:"PHILOS",schedulebuilderId:121},"PHYSICAL EDUCATION":{abrev:"PHYS ED",schedulebuilderId:122},PHYSICS:{abrev:"PHYSICS",schedulebuilderId:123},"PLANT AND MICROBIAL BIOLOGY":{abrev:"PLANTBI",schedulebuilderId:124},"POLITICAL ECONOMY OF INDUSTRIAL SOC":{abrev:"POLECIS",schedulebuilderId:125},"POLITICAL SCIENCE":{abrev:"POL SCI", schedulebuilderId:126},PORTUGUESE:{abrev:"PORTUG",schedulebuilderId:153},PSYCHOLOGY:{abrev:"PSYCH",schedulebuilderId:127},"PUBLIC POLICY":{abrev:"PUB POL",schedulebuilderId:129},PUNJABI:{abrev:"PUNJABI",schedulebuilderId:146},"RELIGIOUS STUDIES":{abrev:"RELIGST",schedulebuilderId:130},RHETORIC:{abrev:"RHETOR",schedulebuilderId:131},SANSKRIT:{abrev:"SANSKR",schedulebuilderId:147},"SOUTH ASIAN":{abrev:"S ASIAN",schedulebuilderId:140},SCANDINAVIAN:{abrev:"SCANDIN",schedulebuilderId:132},"SCIENCE AND MATHEMATICS EDUCATION":{abrev:"SCMATHE", schedulebuilderId:133},"SOUTHEAST ASIAN":{abrev:"SEASIAN",schedulebuilderId:141},SEMITICS:{abrev:"SEMITIC",schedulebuilderId:112},"SLAVIC LANGUAGES AND LITERATURES":{abrev:"SLAVIC",schedulebuilderId:134},SOCIOLOGY:{abrev:"SOCIOL",schedulebuilderId:138},"SOCIAL WELFARE":{abrev:"SOC WEL",schedulebuilderId:137},SPANISH:{abrev:"SPANISH",schedulebuilderId:152},"SOUTH AND SOUTHEAST ASIAN STUDIES":{abrev:"S,SEASN",schedulebuilderId:139},STATISTICS:{abrev:"STAT",schedulebuilderId:156},STUDIES:{abrev:"STUDIES"}, TAGALOG:{abrev:"TAGALG",schedulebuilderId:148},TAMIL:{abrev:"TAMIL",schedulebuilderId:149},TELUGU:{abrev:"TELUGU",schedulebuilderId:161},THAI:{abrev:"THAI",schedulebuilderId:150},"THEATER DANCE, AND PERFORMANCE ST":{abrev:"THEATER",schedulebuilderId:157},TIBETAN:{abrev:"TIBETAN",schedulebuilderId:49},TURKISH:{abrev:"TURKISH",schedulebuilderId:113},"UNDERGRAD. BUSINESS ADMINISTRATION":{abrev:"UGBA",schedulebuilderId:20},"UNDERGRAD INTERDISCIPLINARY STUDIES":{abrev:"UGIS",schedulebuilderId:158},"UNIVERSITY EXTENSION":{abrev:"UNIVEXT"}, VIETNAMESE:{abrev:"VIETNMS",schedulebuilderId:151},"VISION SCIENCE":{abrev:"VIS SCI",schedulebuilderId:119},"VISUAL STUDIES":{abrev:"VIS STD",schedulebuilderId:10},"EXECUTIVE MASTERS IN BUS. ADM.":{abrev:"XMBA",schedulebuilderId:23},YIDDISH:{abrev:"YIDDISH",NINJACOURSESID:69}},c=null,d=null;return{getSchedulebuilderId:function(){var a=this.department;return b.hasOwnProperty(a)&&b[a].hasOwnProperty("schedulebuilderId")?b[a].schedulebuilderId:null},getDepartment:function(){return this.department},getDepartmentAbrev:function(){return this.departmentAbrev}, getCourseNum:function(){return this.courseNum},getCCN:function(){return this.ccn},getPS:function(){return this.ps},getSecNum:function(){return this.secNum},getClassType:function(){return this.classType},getTitle:function(){return this.title},getCatalogDescLink:function(){return this.catalogDescLink},getLocn:function(){return this.locn},getInstructor:function(){return this.instructor},getLastName:function(){return this.lastName},getNote:function(){return this.note},getBookLink:function(){return this.bookLink}, getUnits:function(){return this.units},getFinalExamGroup:function(){return this.finalExamGroup},getRestrictions:function(){return this.restrictions},getLimit:function(){return this.limit},getEnrolled:function(){return this.enrolled},getWaitlist:function(){return this.waitlist},getAvailSeats:function(){return this.availSeats},getEnrollmentLink:function(){return this.enrollmentLink},getEnrollmentMsg:function(){return this.enrollmentMsg},getStatusLastChanged:function(){return this.statusLastChanged}, getSessionDates:function(){return this.sessionDates},getSummerFees:function(){return this.summerFees},getCourseWebsite:function(){return this.courseWebsite},getDays:function(){return this.days},getRoom:function(){return this.room},getTime:function(){return this.time},getInField3:function(){return this.inField3},setDepartment:function(a){this.department=a},setDepartmentAbrev:function(a){this.departmentAbrev=a},setCCN:function(a){this.ccn=a},setPS:function(a){this.ps=a},setSecNum:function(a){this.secNum= a},setClassType:function(a){this.classType=a},setTitle:function(a){this.title=a},setCatalogDescLink:function(a){this.catalogDescLink=a},setLocn:function(a){this.locn=a},setInstructor:function(a){this.instructor=a},setLastName:function(a){this.lastName=a},setNote:function(a){this.note=a},setBookLink:function(a){this.bookLink=a},setUnits:function(a){this.units=a},setFinalExamGroup:function(a){this.finalExamGroup=a},setRestrictions:function(a){this.restrictions=a},setLimit:function(a){this.limit=a}, setEnrolled:function(a){this.enrolled=a},setWaitlist:function(a){this.waitlist=a},setAvailSeats:function(a){this.availSeats=a},setEnrollmentLink:function(a){this.enrollmentLink=a},setEnrollmentMsg:function(a){this.enrollmentMsg=a},setStatusLastChanged:function(a){this.statusLastChanged=a},setSessionDates:function(a){this.sessionDates=a},setSummerFees:function(a){this.summerFees=a},setCourseWebsite:function(a){this.courseWebsite=a},setDays:function(a){this.days=a},setRoom:function(a){this.room=a}, setTime:function(a){this.time=a},parseTT:function(a){for(var b=a.querySelectorAll("TT"),a=a.querySelectorAll('TD[ALIGN="right"] FONT[size="1"] B'),c=0,d=b.length;c<d;c++){var j=a[c+1].innerHTML;j.match("Location:")?this.parseLocn(b[c].innerHTML):j.match("Instructor:")?this.parseInstructor(b[c].innerHTML):j.match("Status/Last Changed:")?this.parseStatus(b[c].innerHTML):j.match("Course Control Number:")?this.parseCourseControlNumber(b[c].innerHTML):j.match("Units/Credit:")?this.units=b[c].innerHTML: j.match("Final Exam Group:")?this.parseFinalExamGroup(b[c].innerHTML):j.match("Restrictions:")?this.restrictions=b[c].innerHTML:j.match("Note:")?this.parseNote(b[c].innerHTML):j.match("Enrollment on ")?this.parseEnrollment(b[c].innerHTML):j.match("Session Dates:")?this.sessionDates=b[c].innerHTML:j.match("Summer Fees:")&&(this.summerFees=b[c].innerHTML)}},extractHref:function(a){if("string"!=typeof a)throw Error("extractHref : Paramater is not a string");a=a.match(/(href=\")([^\"]*)(\")/gi);if(null== a)return null;a=a[0];a=a.replace(/^href[\s]*=[\s]*"/,"");return a=a.replace(/\"$/,"")},parseInstructor:function(a){a&&(this.instructor=stripSpace(a),this.lastName=a.replace(/,[^$]*$/g,""))},parseCourseTitle:function(a){a=a.getElementsByClassName("coursetitle")[0];this.title=strip(a.innerHTML)},parseLocn:function(a){var b=a.match(/^[\s]*[MTWFuhSA]{1,7}[\s]+[0-9\-AP]+,/);if(null!=b){if((c=a.match(/^[\s]*(M|Tu|W|Th|F|SA|Su){1,7}[\s]/))?this.days=c[0]:a.match(/^[\s]*MTWTF[\s]/)&&(this.days="MTuWThF"), b=a.replace(/^[\s]*[MTWFuhSA]{1,7}[\s]*/,""),d=b.match(/^[0-9\-AP]+/),null!=d)this.time=d[0],this.room=b=b.replace(/^[0-9\-AP]+,[\s]*/,"")}else a.match(/^UNSCHED/)?(this.room=b=a.replace(/^UNSCHED\s*/,""),this.days="UNSCHED"):a.match(/CANCELLED/)?this.days="CANCELLED":this.locn=a},parseCourseControlNumber:function(a){var b=a.match(/^[0-9]+/);null==b&&(b=a.match(/^[0-9A-Za-z ]+(?=\s*<)?/));this.ccn=b[0]},parseEnrollment:function(a){var b=a.match(/[0-9]+/g);null==b?(this.enrollmentMsg=a,this.availSeats= this.waitlist=this.enrolled=this.limit=null):(this.enrollmentMsg=null,this.limit=parseInt(b[0]),this.enrolled=parseInt(b[1]),this.waitlist=parseInt(b[2]),this.availSeats=parseInt(b[3]))},parseLinks:function(a){function b(a,c){for(var d=0,f=a.length;d<f;d++)if(a[d].getAttribute("name")==c)return a[d].getAttribute("value")}for(var a=a.getElementsByTagName("input"),c=0,d=a.length;c<d;c++){var j=a[c].getAttribute("value");null!=j.match(/(catalog description)/)?(j=[],j.p_dept_name=spaceToPlus(stripSpace(this.department)), j.p_dept_cd=spaceToPlus(stripSpace(this.departmentAbrev)),j.p_title="",j.p_number=this.courseNum,this.catalogDescLink="http://osoc.berkeley.edu/catalog/gcc_search_sends_request?p_dept_cd="+j.p_dept_cd+"&p_title=&p_number="+j.p_number):null!=j.match(/Click here for current enrollment/)?(this.enrollmentLink=!0,this.inField3=b(a,"_InField3")):null!=j.match(/View Books/)&&(j=[],j["bookstore_id-1"]=b(a,"bookstore_id-1"),j["term_id-1"]=b(a,"term_id-1"),j["div-1"]=b(a,"div-1"),j["crn-1"]=this.ccn,this.bookLink= "http://www.bkstr.com/webapp/wcs/stores/servlet/booklookServlet?bookstore_id-1="+j["bookstore_id-1"]+"&term_id-1="+j["term_id-1"]+"&crn-1="+this.ccn)}},parseCourse:function(a){var a=a.querySelector('TBODY TR TD FONT[size="2"] B').innerHTML,c=this.extractHref(a);c?(this.courseWebsite=c,str=a.match(/^[A-Z0-9.,&$#@\s]+/i),str=str[0]):str=a;if(str){str=tokenize(str);for(var a=str.length-4,c="",d=0;d<a;d++)c+=str[d]+" ";this.department=stripSpace(c);this.department!=UCBSE.prevDept?(UCBSE.prevDept=this.department, c=this.department,c=b.hasOwnProperty(c)?b[c].abrev:c,this.departmentAbrev=c,UCBSE.prevDeptAbrev=this.departmentAbrev):this.departmentAbrev=UCBSE.prevDeptAbrev;this.courseNum=str[a];this.ps=str[a+1];this.secNum=str[a+2];this.classType=str[a+3]}},parseNote:function(a){this.note=stripSpace(a)},parseStatus:function(a){this.statusLastChanged=stripSpace(a)},parseFinalExamGroup:function(a){var b=a.match("^[0-9][0-9]*(?=:)");this.finalExamGroup=null!=b?b[0]:a},log:function(){console.log("\nTitle: "+this.title+ "\nDepartment: "+this.department+"\nPS: "+this.ps+"\nSection Number"+this.secNum+"\nLocation: "+this.locn+"\nClass Type: "+this.classType+"\nInstructor: "+this.instructor+"\nStatus Last Changed: "+this.statusLastChanged+"\nBook Link: "+this.bookLink+"\nCCN: "+this.ccn+"\nUnits: "+this.units+"\nFinal Exam Group: "+this.finalExamGroup+"\nRestructions: "+this.restrictions+"\nNote: "+this.note+"\nLimit: "+this.limit+"\nEnrolled: "+this.enrolled+"\nWaitlist: "+this.waitlist+"\nAvailble Seats: "+this.availSeats+ "\nCatalog Description Link: "+this.catalogDescLink+"\nEnrollment Link: "+this.enrollmentLink+"\nDays: "+this.days+"\nRoom: "+this.room+"\nTime: "+this.time)},needSecondRow:function(){return this.note||this.summerFees||this.sessionDates?!0:!1},needRowBorder:function(){return this.needSecondRow()?"":" rowBorder"},fancyCourseControlNumber:function(a){var b="",c="",c=1==this.isFull()?c+"full":0==this.isFull()?c+"open":-1==this.isFull()?c+"openButWaitlist":c+"full",b=b+('<td class="ccn '+this.needRowBorder()+ '"><div class="col2">'),b=null!=a.match(/[0-9]+/)?b+('<input type="text" onclick="select()" class="ccnInput '+c+'" value="'+a+'" >'):b+("<b>"+a+"</b>");return b+"</div></td>"},fancyDays:function(a){dayArr=[];fanDays="";if(a.match(/UNSCHED/))return'<div class="unsched">UNSCHED</div>';if(a.match(/CANCELLED/))return'<div class="unsched">CANCELLED</div>';a.match(/M/)?dayArr.push("M"):dayArr.push("--");a.match(/Tu/)?dayArr.push("Tu"):dayArr.push("--");a.match(/W/)?dayArr.push("W"):dayArr.push("--");a.match(/Th/)? dayArr.push("Th"):dayArr.push("--");a.match(/F/)?dayArr.push("F"):dayArr.push("--");a.match(/SA/)&&dayArr.push("SA");a.match(/Su/)&&!a.match(/SA/)?(dayArr.push("--"),dayArr.push("Su")):a.match(/Su/)&&dayArr.push("Su");for(var a=0,b=dayArr.length;a<b;a++)day=dayArr.shift(),fanDays="--"!=day?fanDays+('<div class="dayActive">'+day+"</div>"):fanDays+('<div class="dayInactive">'+day+"</div>");return fanDays},isFull:function(){if(!this.days)return 0;if(this.days.match(/CANCELLED/)||this.limit==this.enrolled)return 1; if(this.enrolled<this.limit&&0<this.waitlist)return-1;if(this.enrolled<this.limit)return 0},isFinalExamGroup:function(){return""==this.finalExamGroup?!1:!0}}}; UCBSE.courseList=function(){for(var b=document.querySelectorAll("TABLE"),c=document.querySelectorAll('IMG[src="http://schedule.berkeley.edu/graphs/hr2.gif"]'),d=[],a=1,f=b.length;a<f-1;a++){var g=new UCBSE.Course;g.parseTT(b[a]);g.parseCourse(b[a]);g.parseCourseTitle(b[a]);g.parseLinks(b[a]);d.push(g)}g=document.body;a=1;for(f=b.length;a<f-1;a++)g.removeChild(b[a]);a=0;for(f=c.length;a<f;a++)g.removeChild(c[a]);b=document.querySelectorAll('IMG[src="http://schedule.berkeley.edu/graphs/sp.gif"]');for(a= 0;a<b.length;a++)b[a].parentNode.removeChild(b[a]);return d}(); UCBSE.css=function(){var b=document.querySelector("HEAD"),c=document.createElement("style");css="";css+="body { font-family:arial, tahoma, verdana; font-size:1em; } ";css+="table, tr, td { font-size:.9em; } ";css+="table { empty-cells:show; }";css+=".enhancedFull { width:100%; }";css+=".enhanced { width:auto; }";for(var d=1;23>=d;d++)css+="table.hide"+d+" .col"+d+",";css+="table.hide"+d+" .col"+d;css+="{ display:none;}";for(d=1;23>=d;d++)css+=".col"+d+",";css+=".col"+d;css+="{ display: table-cell; }"; css+=".col24, .col23, .col22, .col21, .col20, .col19 { padding:0 2px; }";css+="table.hide200 .col200 { display:none; }";css+="div.hide900 { display:none; background-color:#000; }";css+="div.hide800 { display:none; background-color:#000; }";css+="a {color:#336699}";css+=".topRow { font-weight: bold; text-align: center; } ";css+=".title { background-color:#e8f1fa; }";css+=".title, .title a { color: #336699; font-weight:bold; text-decoration:none; }";css+=".title td { font-size:1.1em; }";css+=".titleLeftBorder { border-left: 5px solid #336699; border-right:2px solid #FFF; padding: 0 .2em; }"; css+=".title a:hover { background-color:transparent; text-decoration:underline; }";css+=".courseBody { text-align: center; }";css+=".courseBodyLec > td { text-align: center; font-weight:bold; background-color:#000000;}";css+=".courseTopPadding > td { padding-top:1em; }";css+=".courseBottomPadding > td { padding-top:1px; }";css+=".smallLabel { font-weight:normal; color:#6e96be; text-align:center;}";css+=".col11, .col12, .col13, .col14 { display:inline; margin:0 auto; text-align:center; }";css+=".enrollmentMsg { /*background-color:#d4d4d4;*/ text-align:center; }"; css+=".col18 { margin:0 auto; display:inline; }";css+=".enrollData, .enrollDataLeft, .enrollDataRight { text-align:center;}";css+=".enrollDataLeft { border-left:1px dotted #CCC;}";css+=".enrollDataRight { border-right:1px dotted #CCC;}";css+=".enrollDataFiller { border-left:1px dotted #CCC; border-right:1px dotted #CCC; }";css+=".ccnInput { width:40px; border:0px solid #CCC; font-size:1em; font-weight:bold; font-family: arial, verdana, tahoma;}";css+=".departmentTopPadding > td { padding-top:2em; }"; css+=".department { color:#dddddd; background-color:#252c58; font-size:2em; padding-left:.2em;}";css+=".rowBorder { border-bottom:1px dotted #CCC; }";css+=".note, .summerFees, .sessionDates { color:#6e6e6e; }";css+=".note { max-width:400px; }";css+=".statusLastChanged, .restrictions { text-align:center; font-family:arial; font-weight:normal; }";css+=".statusLastChanged, .col16 { width:110px; }";css+=".restrictions, .col15 { width:110px;}";css+=".ccn { margin:auto; text-align:center; white-space:nowrap; border-right: 1px dotted #CCC;}"; css+=".classType { width:30px; }";css+=".secNum { width:30px; }";css+=".units { width:40px; text-align:center; }";css+=".instructor { text-align:left; }";css+=".instructor small { font-weight:normal; }";css+=".locn { text-align:left; }";css+=".finalExamGroup { max-width:30px; text-align:center; }";css+=".col10 { width:30px; text-align:center; }";css+=".days { min-width:115px; max-width:140px; text-align:center; white-space:nowrap;}";css+=".time { text-align:left; }";css+=".room { text-align:left; }"; css+=".links { white-space:nowrap; text-align:left; }";css+=".full { background-color:#ff9b9b; color:#520e0e;}";css+=".open { background-color:#c5ffc8; color:#15520e;}";css+=".openButWaitlist { background-color:#ffd563; color:#473608;}";css+=".unsched { background-color:#dddddd; color:#333; margin-right:1px;}";css+=".dayActive { background-color:#c5ffc8; color:#18571b;}";css+=".dayInactive { color:#999; background-color:#dddddd; }";css+=".dayActive, .dayInactive { font-weight:normal; float:left; margin-right:1px; width:20px; text-align:center; padding:1px;}"; css+=".adviceLinks { font-size:.8em; font-weight:normal;}";css+="tbody.highlight:hover, tbody.primary:hover { background-color:#dfffa4; }";css+="tbody.primary { background-color:#f1f1f1; }";css+="tbody.primary tr:first-child > td { font-weight:bold; }";css+="tbody.primary .rowBorder { border-bottom:1px dotted #CCC; }";css+="tbody.highlightonclick, tbody.highlightonclick:active, tbody.highlightonclick:visited { background-color:#fff98a; }";css+="tbody.highlightonclick:hover { background-color:#ffd964; }"; css+=".highlightCursor, a { cursor:pointer; }";css+=".key { background-color:#e8f1fa; color:#226699; font-size:.9em; font-family:Helvetica, Arial, sans-serif; text-align:left; color:#336699; padding:5px; border-radius:5px; width:600px; margin: 5px 0; }";css+="table.hide300 { display:none; background-color:#000; }";css+="table.nobg .open, table.nobg .openButWaitlist, table.nobg .full { background-color:transparent; color:#000;}";css+="#sidebar {width:330px; float:right; text-align:center;z-index:100; position:fixed; right:10px; top:10px; color:#666;}"; css+="#sidebar a {color:#9f911e;}";css+="#sidebar a:hover {color:#9f911e; text-decoration: underline; background-color:transparent;}";css+="#controls { float:left; background-color:#f3f3f3; font-size:.7em; font-family: arial, tahoma, verdana; padding:5px; color:#666; margin:5px 0 0 0; border:1px solid #CCC; text-align:center; opacity: .9; border-radius:5px; }";css+="#controls hr { background-color:#CCC; height:1px; border:0px; float:left; width:100%;}";css+="#controls input { padding:0px; margin:2px 2px 0 2px; }"; css+=".checkboxElement {float:left; width:150px; text-align:left;}";css+="#controls a {color:#666666;}";css+="#controls a:hover {color:#9f911e; text-decoration: underline; background-color:transparent;}";css+="#configContainer { float:top left; text-align:center; background-color:#fffcb8; font-size:.7em; font-family:arial, tahoma, san-serif; padding:5px; border:1px solid #decc35; opacity:.8; border-radius:5px; }";css+="#configContainer a, #configContainer { -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -o-user-select: none; user-select: none; }"; css+="#highlightedCourses * {font-family: arial, tahoma, sans-serif;}";css+="#highlightedCourses {float:left; position:fixed; z-index:100;}";css+="#highlightedCourses table { background-color:#f3f3f3; border:1px solid #CCC; padding:5px; font-size:10pt; color:#666; opacity:.95; border-radius:5px; }";css+="#highlightedCourses tr td { padding:2px; }";css+="#highlightedCourses tfoot tr > td {border-top: 1px solid #CCC;}";css+="#highlightedCourses a {font-size:8pt;}";css+="#close a, #close { color:#666; font-size:8pt; }"; css+="#highlightedCourses hr { background-color:#CCC; height:1px; border:0px; float:left; width:100%;}";css+="#close {float:right;}";c.innerHTML=css;b.appendChild(c);c=document.createElement("script");c.appendChild(document.createTextNode(highlightRow));c.appendChild(document.createTextNode(popupwindow));c.appendChild(document.createTextNode(post_to_url));c.appendChild(document.createTextNode(toggleColumn));c.appendChild(document.createTextNode(hasClass));c.appendChild(document.createTextNode(addClass)); c.appendChild(document.createTextNode(removeClass));b.appendChild(c)}(); UCBSE.key=function(){var b=document.createElement("table");b.setAttribute("id","key");b.innerHTML='<tr><td><div class="key"><b>Key</b><ul><li><span class="open">GREEN</span> indicates that the class is open and there are seats available.</li><li><span class="openButWaitlist">ORANGE</span> indicates there are seats are available, but there is a waitlist.</li><li><span class="full">RED</span> indicates that the class is full or has been cancelled.</li><li><b>Course Highlighting</b> - Courses can be highlighted in yellow by clicking on the blank space in the Course Number column.</li><li><b>[E]</b> = Enrollment</li><li><b>[B]</b> = Book</li><li><b>[K]</b> = Koofers</li><li><b>[ME]</b> = myEdu</li><li><b>[CR]</b> = CourseRank</li><li><b>[NC]</b> = Ninja Courses</li><li><b>[SB]</b> = ScheduleBuilder</li><li><b>[TO]</b> = Telebears Oracle</li><li><b>HKN links</b> -- HKN links are availble under "Instructor" for EE and CS courses</li></div></tr></td>';document.body.insertBefore(b, document.body.firstChild.nextSibling.nextSibling)}(); UCBSE.table=function(b){var c=document.body;c.setAttribute("background","");var d=document.createElement("table");d.setAttribute("id","enhanced");!1!=GM_getValue("isMaximum")?d.setAttribute("class","enhancedFull"):d.setAttribute("class","enhanced");d.setAttribute("cellspacing","0");for(var a="",f="",g="",h="",j=0,k=b.length;j<k;j++){var e=b[j];g!==e.getDepartmentAbrev()&&(""!=g&&(a+='<tr class="departmentTopPadding"><td colspan="18"></td></tr>'),g=e.getDepartmentAbrev(),a+="<tr>",a+='<td colspan="18" class="department">'+ nullToEmpty(e.getDepartment())+"</td>",a+="</tr>",a+='<tr class="topRow">',a+='<td class="col1" align="right">Course<br>Number</td>',a+='<td align="center"><div class="col2">CCN</div></td>',a+='<td><div class="col3">Class<br>Type</div></td>',a+='<td><div class="col4">Section<br>Number</div></td>',a+='<td><div class="col5">Units</div></td>',a+='<td><div class="col6">Instructor</div></td>',a+='<td><div class="col7">Days</div></td>',a+='<td><div class="col8">Time</div></td>',a+='<td><div class="col9">Location</div></td>', a+='<td><div class="col10">Final<br>Exam<br>Group</div></td>',a+='<td colspan="8"></td>',a+="</tr>");if(f!==e.getCourseNum()||h!==e.getDepartmentAbrev())f=e.getCourseNum(),h=e.getDepartmentAbrev(),a+='<tr class="courseTopPadding"><td colspan="18"></td></tr>',a+='<tr class="title">',a+='<td align="right" valign="middle" class="titleLeftBorder col1">'+nullToEmpty(e.getCourseNum())+"</td>",a+='<td colspan="9" valign="middle">',a+='<div style="float:left;">',a+='<a href="'+e.getCatalogDescLink()+'" target="_blank">'+ nullToEmpty(e.getTitle())+"</a>",e.getCourseWebsite()&&(a+=' <a href="'+e.getCourseWebsite()+'" target="_blank">(Course Website)</a>'),a+="</div>",a+='<div style="float:right;" class="adviceLinks">',deptAbrev=e.getDepartmentAbrev(),a+='<a class="col19" href="http://www.koofers.com/search?q='+encodeURI(deptAbrev+" "+e.getCourseNum())+'" target="_blank">[K]</a>',a+='<a class="col20" href="http://www.myedu.com/search?q='+encodeURI(deptAbrev+" "+e.getCourseNum())+"&doctype=course&facets=school-name:University+of+California%2C+Berkeley|dept-abbrev:"+ encodeURI(deptAbrev)+'&search_school=University+of+California%2C+Berkeley&config=" target="_blank">[ME]</a> ',a+='<a class="schedulebuilder col21" target="_blank">[SB]</a> ',a+='<a class="col22" href="http://www.ninjacourses.com/explore/1/course/L & S/'+e.getCourseNum()+'/" target="_blank">[NC]</a> ',a="LNS"!=deptAbrev?a+('<a class="col23" href="https://www.courserank.com/berkeley/search#query='+encodeURI(deptAbrev+" "+e.getCourseNum())+'&filter_term_currentYear=on" target="_blank">[CR]</a>'):a+('<a class="col23" href="https://www.courserank.com/berkeley/search#query='+ encodeURI("L ~ S "+e.getCourseNum())+'&filter_term_currentYear=on" target="_blank">[CR]</a>'),a+='<a class="col24" href="http://www.telebearsoracle.com/#'+e.ccn+",semester:"+UCBSE.termTelebearsOracle+'" target="_blank">[TO]</a>',a+="</div>",a+='<div style="clear:both"></div>',a+="</td>",a+='<td align="center"><div class="smallLabel col11"><small>Limit</small></div></td>',a+='<td align="center"><div class="smallLabel col12"><small>Enrolled</small></div></td>',a+='<td align="center"><div class="smallLabel col13"><small>Waitlist</small></div></td>', a+='<td align="center"><div class="smallLabel col14"><small>Avail<br>Seats</small></div></td>',a+='<td class="col15"><div class="smallLabel"><small>Restrictions</small></div></td>',a+='<td class="col16"><div class="smallLabel"><small>Status</small></div></td>',a+="<td></td>",a+="</td>",a+="</tr>",a+='<tr class="courseBottomPadding"><td colspan="13"></td></tr>';a+="<tbody ";a+='class="course highlight ';"P"==e.getPS()&&(a+="primary ");null!=UCBSE.searchCourses(e,UCBSE.highlightedCourses)&&(a+="highlightonclick"); a+='"';a+=">";a+='<td class="col1 highlightCursor" onclick="javascript:highlightRow(this.parentNode.parentNode);"></td>';a+=e.fancyCourseControlNumber(e.getCCN());needRowBorder=e.needRowBorder();a+='<td class="'+needRowBorder+'"><div class="classType col3">'+nullToEmpty(e.getClassType())+"</div></td>";a+='<td class="'+needRowBorder+'"><div class="secNum col4">'+nullToEmpty(e.getSecNum())+"</div></td>";a+='<td class="'+needRowBorder+'"><div class="units col5">'+nullToEmpty(e.getUnits())+"</div></td>"; a+='<td class="'+needRowBorder+'"><div class="instructor col6">';(instructor=e.getInstructor())&&instructor.match(/THE STAFF/)?a+=instructor.match(/THE STAFF/):instructor&&"COMPSCI"==g?a+='<a href="https://hkn.eecs.berkeley.edu/coursesurveys/course/CS/'+e.getCourseNum()+'" target="_blank">'+instructor+"</a> <small>[HKN]</small>":instructor&&"EL ENG"==g?a+='<a href="https://hkn.eecs.berkeley.edu/coursesurveys/course/EE/'+e.getCourseNum()+'" target="_blank">'+instructor+"</a> <small>[HKN]</small>": instructor&&(a+='<a href="http://www.ratemyprofessors.com/SelectTeacher.jsp?the_dept=All&sid=1072&orderby=TLName&letter='+e.getLastName()+'" target="_blank">'+instructor+"</a>");a+="</div></td>";e.getLocn()?(numCol=e.isFinalExamGroup()?3:4,a+='<td colspan="'+numCol+'" class="'+needRowBorder+'"><div class="locn col9">'+nullToEmpty(e.getLocn())+"</div></td>"):(numCol=e.isFinalExamGroup()?1:2,a+='<td class="'+needRowBorder+'"><div class="days col7">'+e.fancyDays(e.getDays())+"</div></td>",a+='<td class="'+ needRowBorder+'"><div class="time col8">'+nullToEmpty(e.getTime())+"</div></td>",a+='<td colspan="'+numCol+'" class="'+needRowBorder+'"><div class="room col9">'+nullToEmpty(e.getRoom())+"</div></td>");e.isFinalExamGroup()&&(a+='<td class="'+needRowBorder+'"><div class="finalExamGroup col10">'+nullToEmpty(e.getFinalExamGroup())+"</div></td>");e.getEnrollmentMsg()?a+='<td colspan="4" class="enrollDataLeft enrollDataRight '+needRowBorder+'"><div class="enrollmentMsg col18">'+e.getEnrollmentMsg()+"</div></td>": (e.getPS(),a+='<td class="enrollDataLeft'+needRowBorder+'"><div class="col11">'+e.getLimit()+"</div></td>",a+='<td class="enrollData'+needRowBorder+'"><div class="col12">'+e.getEnrolled()+"</div></td>",a+='<td class="enrollData'+needRowBorder+'"><div class="col13">'+e.getWaitlist()+"</div></td>",a+='<td class="enrollDataRight'+needRowBorder+'"><div class="col14">'+e.getAvailSeats()+"</td>");a+='<td class="'+needRowBorder+' col15"><div class="restrictions"><small>'+nullToEmpty(e.getRestrictions())+ "</small></div></td>";a+='<td class="'+needRowBorder+' col16"><div class="statusLastChanged"><small>'+nullToEmpty(e.getStatusLastChanged())+"</small></div></td>";a+='<td class="col17"><div class="links">';!0==e.getEnrollmentLink()&&(a+='<a href="http://infobears.berkeley.edu:3400/osc/?_InField1=RESTRIC&_InField2='+e.getCCN()+"&_InField3="+e.getInField3()+'" target="_blank" alt="Enrollment">[E]</a> ');e.getBookLink()&&(a+='<a href="'+e.getBookLink()+'" target="_blank" alt="Books">[B]</a>');a+="</div></td>"; a+="</tr>";e.needSecondRow()&&(a+='<tr class="">',a+='<td class="highlightCursor col1" onclick="javascript:highlightRow(this.parentNode.parentNode);"></td>',a+='<td class="ccn rowBorder"></td>',a+='<td class="rowBorder"></td>',a+='<td class="rowBorder"></td>',a+='<td class="rowBorder"></td>',a+='<td class="rowBorder" colspan="5">',e.getSummerFees()&&(a+='<p class="col200 summerFees"><small><b>Summer Fees:</b> '+e.getSummerFees()+"</small></p>"),e.getSessionDates()&&(a+='<p class="col200 sessionDates"><small><b>Session Dates</b> '+ e.getSessionDates()+"</small></p>"),e.getNote()&&(a+='<p class="col200 note"><small><b>Note:</b> '+e.getNote()+"</small></p>"),a+="</td>",a+='<td colspan="4" class="rowBorder enrollDataLeft enrollDataRight"></td>',a+='<td class="rowBorder col15"></td>',a+='<td class="rowBorder col16"></td>',a+='<td class="links col17"></td>',a+="</tr>");a+="</tbody>"}d.innerHTML=a;f=d.getElementsByClassName("highlightCursor");g=!1;h=a=0;for(k=f.length;h<k;h++)e=b[a],f[h].addEventListener("click",function(a){return function(){highlightListener(a)}}(e), !1),e.needSecondRow()?g?(a++,g=!1):g=!0:a++;g=f="";h=d.getElementsByClassName("schedulebuilder");a=j=0;for(k=b.length;a<k;a++)if(e=b[a],e.getCourseNum()!=f||e.getDepartmentAbrev()!=g)f=e.getCourseNum(),g=e.getDepartmentAbrev(),h[j].addEventListener("click",function(a){return function(){schedulebuilderListener(a)}}(e),!1),j++;c.insertBefore(d,c.firstChild.nextSibling.nextSibling.nextSibling);return d}(UCBSE.courseList); UCBSE.controls=function(){var b=document.createElement("div");b.setAttribute("id","controls");GM_getValue("isControls")?b.setAttribute("class","col900"):b.setAttribute("class","col900 hide900");var c=document.createElement("div"),d=document.createElement("a");d.innerHTML="Report Bug";d.setAttribute("href","http://goo.gl/aJgTR");d.setAttribute("target","_blank");var a=document.createElement("a");a.innerHTML="Homepage";a.setAttribute("href","http://userscripts.org/scripts/show/105611");a.setAttribute("target", "_blank");var f=document.createElement("a");f.innerHTML="Facebook";f.setAttribute("href","http://www.facebook.com/ucbse");f.setAttribute("target","_blank");c.appendChild(d);c.appendChild(document.createTextNode(" | "));c.appendChild(a);c.appendChild(document.createTextNode(" | "));c.appendChild(f);b.appendChild(c);b.appendChild(document.createElement("hr"));c=document.createElement("div");c.setAttribute("class","checkboxElement");d=document.createElement("input");d.setAttribute("type","checkbox"); a=document.createTextNode("Maximize Table");d.addEventListener("click",toggleMaximize,!1);!0==GM_getValue("isMaximum")&&d.setAttribute("checked","yes");c.appendChild(d);c.appendChild(a);b.appendChild(c);c=document.createElement("div");c.setAttribute("class","checkboxElement");d=document.createElement("input");d.setAttribute("type","checkbox");a=document.createTextNode("CCN Background Colors");!1!=GM_getValue("isBg")?d.setAttribute("checked","yes"):(f=document.getElementById("enhanced"),addClass(f, "nobg"));d.addEventListener("click",toggleCCNBg,!1);c.appendChild(d);c.appendChild(a);b.appendChild(c);createToggleColumnElement(b,300,"Key","key");b.appendChild(document.createElement("hr"));createToggleColumnElement(b,1,"Course Number");createToggleColumnElement(b,2,"CCN");createToggleColumnElement(b,3,"Class Type");createToggleColumnElement(b,4,"Section Number");createToggleColumnElement(b,5,"Units");createToggleColumnElement(b,6,"Instructor");b.appendChild(document.createElement("hr"));createToggleColumnElement(b, 7,"Days");createToggleColumnElement(b,8,"Time");createToggleColumnElement(b,9,"Location");createToggleColumnElement(b,10,"Final Exam Group");b.appendChild(document.createElement("hr"));createToggleColumnElement(b,11,"Limit");createToggleColumnElement(b,12,"Enrolled");createToggleColumnElement(b,13,"Waitlist");createToggleColumnElement(b,14,"Avail Seats");b.appendChild(document.createElement("hr"));createToggleColumnElement(b,15,"Restrictions");createToggleColumnElement(b,16,"Status");createToggleColumnElement(b, 17,"Links");b.appendChild(document.createElement("hr"));createToggleColumnElement(b,18,"Enrollment Message");createToggleColumnElement(b,200,"Second Row");b.appendChild(document.createElement("hr"));createToggleColumnElement(b,19,"Koofers Link");createToggleColumnElement(b,20,"MyEdu Link");createToggleColumnElement(b,21,"ScheduleBuilder Link");createToggleColumnElement(b,22,"NinjaCourses Link");createToggleColumnElement(b,23,"CourseRank Link");createToggleColumnElement(b,24,"TelebearsOracle Link"); b.appendChild(document.createElement("hr"));b.appendChild(closeContainer("controls",900,"isControls"));c=document.createElement("div");c.setAttribute("id","configContainer");d=document.createElement("a");d.setAttribute("unselectable","on");d.addEventListener("click",function(){toggleClassPersistent("isHigh")},!1);d.setAttribute("onclick","toggleColumn('highlightedCourses', 800)");d.innerHTML="Highlighted Courses (";a=document.createElement("span");a.setAttribute("id","counter");a.innerHTML=UCBSE.highlightedCourses.length; d.appendChild(a);d.innerHTML+=")";c.appendChild(d);c.appendChild(document.createTextNode(" | "));d=document.createElement("a");d.setAttribute("onclick","toggleColumn('controls', 900)");d.setAttribute("unselectable","on");d.addEventListener("click",function(){toggleClassPersistent("isControls")},!1);d.innerHTML="Configuration";c.appendChild(d);d=document.createElement("div");d.setAttribute("id","sidebar");d.appendChild(c);d.appendChild(b);document.body.insertBefore(d,document.body.firstChild);UCBSE.highlightedCoursesContainer= document.createElement("div");UCBSE.highlightedCoursesContainer.setAttribute("id","highlightedCourses");GM_getValue("isHigh")?UCBSE.highlightedCoursesContainer.setAttribute("class","col800"):UCBSE.highlightedCoursesContainer.setAttribute("class","col800 hide800");highlightedCoursesTableCreator(UCBSE.highlightedCoursesContainer);document.body.insertBefore(UCBSE.highlightedCoursesContainer,document.body.firstChild)}();