Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / theme / custom_corners / js / js.php
blob4c22b19209e97d602a28fb29c5efa5f237185305
1 <script type="text/javascript" charset="utf-8">
2 /* <![CDATA[ */
3 var CSSClass={};CSSClass.is=function(e,c){if(typeof e=="string")e=document.getElementById(e);var classes=e.className;if(!classes)return false;if(classes==c)return true;return e.className.search("\\b"+c+"\\b")!=-1;};CSSClass.add=function(e,c){if(typeof e=="string")e=document.getElementById(e);if(CSSClass.is(e,c))return;if(e.className)c=" "+c;e.className+=c;};CSSClass.remove=function(e,c){if(typeof e=="string")e=document.getElementById(e);e.className=e.className.replace(new RegExp("\\b"+c+"\\b\\s*","g"),"");};
5 var script = {
6 corrections: function () {
7 if (top.user) {
8 top.document.getElementsByTagName('frameset')[0].rows = "117,30%,0,200";
11 // check for layouttabel and add layouttable classes to body
12 var tagname = 'nolayouttable';
13 if (document.getElementById('middle-column')) {
14 var lc = document.getElementById('left-column');
15 var rc = document.getElementById('right-column');
16 if ( lc && rc ) {
17 tagname = 'haslayouttable rightandleftcolumn';
18 } else if (lc) {
19 tagname = 'haslayouttable onlyleftcolumn';
20 } else if (rc) {
21 tagname = 'haslayouttable onlyrightcolumn';
22 } else {
23 tagname = 'haslayouttable onlymiddlecolumn';
27 function setbodytag (tagname) {
28 var bd = document.getElementsByTagName('body')[0];
29 if (bd) {
30 CSSClass.add(bd, tagname);
31 } else {
32 setTimeout(function() { setbodytag(tagname) }, 30);
36 setTimeout(function() { setbodytag(tagname) }, 30);
39 init: function() {
40 script.corrections();
43 /* ]]> */
44 </script>