Browse Source

Bug #2867 - Trimming trailing whitespace in all (system range) javascript files.

Ivan Tcholakov 15 years ago
parent
commit
760d14b72e

+ 1 - 1
main/admin/calendar_tbl_change.js

@@ -60,7 +60,7 @@ function initCalendar() {
     if (!year && !month && !day) {
     if (!year && !month && !day) {
         day = window.opener.day;
         day = window.opener.day;
         month = window.opener.month;
         month = window.opener.month;
-        year  = window.opener.year;   
+        year  = window.opener.year;
         if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
         if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
             dt      = new Date();
             dt      = new Date();
             year    = dt.getFullYear();
             year    = dt.getFullYear();

+ 1 - 1
main/blog/tbl_change.js

@@ -60,7 +60,7 @@ function initCalendar() {
     if (!year && !month && !day) {
     if (!year && !month && !day) {
 		day = window.opener.day;
 		day = window.opener.day;
 		month = window.opener.month;
 		month = window.opener.month;
-		year  = window.opener.year;   
+		year  = window.opener.year;
         if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
         if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
             dt      = new Date();
             dt      = new Date();
             year    = dt.getFullYear();
             year    = dt.getFullYear();

+ 1 - 1
main/calendar/tbl_change.js

@@ -60,7 +60,7 @@ function initCalendar() {
     if (!year && !month && !day) {
     if (!year && !month && !day) {
 		day = window.opener.day;
 		day = window.opener.day;
 		month = window.opener.month;
 		month = window.opener.month;
-		year  = window.opener.year;   
+		year  = window.opener.year;
         if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
         if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
             dt      = new Date();
             dt      = new Date();
             year    = dt.getFullYear();
             year    = dt.getFullYear();

+ 71 - 71
main/inc/lib/asciimath/ASCIIMathML.js

@@ -3,8 +3,8 @@ ASCIIMathML.js
 ==============
 ==============
 This file contains JavaScript functions to convert ASCII math notation
 This file contains JavaScript functions to convert ASCII math notation
 and LaTeX to Presentation MathML. Simple graphics commands are also
 and LaTeX to Presentation MathML. Simple graphics commands are also
-translated to SVG images. The conversion is done while the (X)HTML 
-page loads, and should work with Firefox/Mozilla/Netscape 7+ and Internet 
+translated to SVG images. The conversion is done while the (X)HTML
+page loads, and should work with Firefox/Mozilla/Netscape 7+ and Internet
 Explorer 6/7 + MathPlayer (http://www.dessci.com/en/products/mathplayer/) +
 Explorer 6/7 + MathPlayer (http://www.dessci.com/en/products/mathplayer/) +
 Adobe SVGview 3.03 (http://www.adobe.com/svg/viewer/install/).
 Adobe SVGview 3.03 (http://www.adobe.com/svg/viewer/install/).
 
 
@@ -28,22 +28,22 @@ it under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation; either version 2.1 of the License, or (at
 the Free Software Foundation; either version 2.1 of the License, or (at
 your option) any later version.
 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 Lesser General Public License 
+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 Lesser General Public License
 (at http://www.gnu.org/licences/lgpl.html) for more details.
 (at http://www.gnu.org/licences/lgpl.html) for more details.
 */
 */
 
 
 var mathcolor = "blue";        // change it to "" (to inherit) or another color
 var mathcolor = "blue";        // change it to "" (to inherit) or another color
 //var mathfontsize = "1em";      // change to e.g. 1.2em for larger math
 //var mathfontsize = "1em";      // change to e.g. 1.2em for larger math
 var mathfontsize = "1.2em";      // Modified by Ivan Tcholakov, 10-AUG-2009.
 var mathfontsize = "1.2em";      // Modified by Ivan Tcholakov, 10-AUG-2009.
-var mathfontfamily = "serif";  // change to "" to inherit (works in IE) 
+var mathfontfamily = "serif";  // change to "" to inherit (works in IE)
                                // or another family (e.g. "arial")
                                // or another family (e.g. "arial")
 var automathrecognize = false; // writing "amath" on page makes this true
 var automathrecognize = false; // writing "amath" on page makes this true
 var checkForMathML = true;     // check if browser can display MathML
 var checkForMathML = true;     // check if browser can display MathML
 var notifyIfNoMathML = true;   // display note at top if no MathML capability
 var notifyIfNoMathML = true;   // display note at top if no MathML capability
 var alertIfNoMathML = false;   // show alert box if no MathML capability
 var alertIfNoMathML = false;   // show alert box if no MathML capability
-var translateOnLoad = true;    // set to false to do call translators from js 
+var translateOnLoad = true;    // set to false to do call translators from js
 var translateLaTeX = true;     // false to preserve $..$, $$..$$
 var translateLaTeX = true;     // false to preserve $..$, $$..$$
 var translateLaTeXformatting = true; // false to preserve \emph,\begin{},\end{}
 var translateLaTeXformatting = true; // false to preserve \emph,\begin{},\end{}
 var translateASCIIMath = true; // false to preserve `..`
 var translateASCIIMath = true; // false to preserve `..`
@@ -59,7 +59,7 @@ var dsvglocation = ""; // path to d.svg (blank if same as ASCIIMathML.js loc)
 
 
 var isIE = document.createElementNS==null;
 var isIE = document.createElementNS==null;
 
 
-if (document.getElementById==null) 
+if (document.getElementById==null)
   alert("This webpage requires a recent browser such as\
   alert("This webpage requires a recent browser such as\
 \nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")
 \nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")
 
 
@@ -79,7 +79,7 @@ function AMnoMathMLNote() {
   an.appendChild(document.createTextNode("ASCIIMathML"));
   an.appendChild(document.createTextNode("ASCIIMathML"));
   an.setAttribute("href","http://www.chapman.edu/~jipsen/asciimath.html");
   an.setAttribute("href","http://www.chapman.edu/~jipsen/asciimath.html");
   nd.appendChild(an);
   nd.appendChild(an);
-  nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));  
+  nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
   an = AMcreateElementXHTML("a");
   an = AMcreateElementXHTML("a");
   an.appendChild(document.createTextNode("MathPlayer"));
   an.appendChild(document.createTextNode("MathPlayer"));
   an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
   an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
@@ -90,7 +90,7 @@ function AMnoMathMLNote() {
 }
 }
 
 
 function AMisMathMLavailable() {
 function AMisMathMLavailable() {
-  if (navigator.appName.slice(0,8)=="Netscape") 
+  if (navigator.appName.slice(0,8)=="Netscape")
     if (navigator.appVersion.slice(0,1)>="5") return null;
     if (navigator.appVersion.slice(0,1)>="5") return null;
     else return AMnoMathMLNote();
     else return AMnoMathMLNote();
   else if (navigator.appName.slice(0,9)=="Microsoft")
   else if (navigator.appName.slice(0,9)=="Microsoft")
@@ -121,7 +121,7 @@ var AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF
 var AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];
 var AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];
 var AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
 var AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
 
 
-var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4, 
+var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
     RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8,
     RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8,
     LEFTRIGHT = 9, TEXT = 10; // token types
     LEFTRIGHT = 9, TEXT = 10; // token types
 
 
@@ -358,8 +358,8 @@ var AMnames = []; //list of input symbols
 function AMinitSymbols() {
 function AMinitSymbols() {
   var texsymbols = [], i;
   var texsymbols = [], i;
   for (i=0; i<AMsymbols.length; i++)
   for (i=0; i<AMsymbols.length; i++)
-    if (AMsymbols[i].tex) 
-      texsymbols[texsymbols.length] = {input:AMsymbols[i].tex, 
+    if (AMsymbols[i].tex)
+      texsymbols[texsymbols.length] = {input:AMsymbols[i].tex,
         tag:AMsymbols[i].tag, output:AMsymbols[i].output, ttype:AMsymbols[i].ttype};
         tag:AMsymbols[i].tag, output:AMsymbols[i].output, ttype:AMsymbols[i].ttype};
   AMsymbols = AMsymbols.concat(texsymbols);
   AMsymbols = AMsymbols.concat(texsymbols);
   AMsymbols.sort(compareNames);
   AMsymbols.sort(compareNames);
@@ -382,7 +382,7 @@ function AMcreateMmlNode(t,frag) {
 }
 }
 
 
 function define(oldstr,newstr) {
 function define(oldstr,newstr) {
-  AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr, 
+  AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr,
                                  tex:null, ttype:DEFINITION}]);
                                  tex:null, ttype:DEFINITION}]);
   AMsymbols.sort(compareNames);
   AMsymbols.sort(compareNames);
   for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
   for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
@@ -391,14 +391,14 @@ function define(oldstr,newstr) {
 function AMremoveCharsAndBlanks(str,n) {
 function AMremoveCharsAndBlanks(str,n) {
 //remove n characters and any following blanks
 //remove n characters and any following blanks
   var st;
   var st;
-  if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ") 
+  if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ")
     st = str.slice(n+1);
     st = str.slice(n+1);
   else st = str.slice(n);
   else st = str.slice(n);
   for (var i=0; i<st.length && st.charCodeAt(i)<=32; i=i+1);
   for (var i=0; i<st.length && st.charCodeAt(i)<=32; i=i+1);
   return st.slice(i);
   return st.slice(i);
 }
 }
 
 
-function AMposition(arr, str, n) { 
+function AMposition(arr, str, n) {
 // return position >=n where str appears or would be inserted
 // return position >=n where str appears or would be inserted
 // assumes arr is sorted
 // assumes arr is sorted
   if (n==0) {
   if (n==0) {
@@ -439,7 +439,7 @@ function AMgetSymbol(str) {
   AMpreviousSymbol=AMcurrentSymbol;
   AMpreviousSymbol=AMcurrentSymbol;
   if (match!=""){
   if (match!=""){
     AMcurrentSymbol=AMsymbols[mk].ttype;
     AMcurrentSymbol=AMsymbols[mk].ttype;
-    return AMsymbols[mk]; 
+    return AMsymbols[mk];
   }
   }
 // if str[0] is a digit or - return maxsubstring of digits.digits
 // if str[0] is a digit or - return maxsubstring of digits.digits
   AMcurrentSymbol=CONST;
   AMcurrentSymbol=CONST;
@@ -510,21 +510,21 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
     return [null,str];
     return [null,str];
   }
   }
   if (symbol.ttype == DEFINITION) {
   if (symbol.ttype == DEFINITION) {
-    str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length); 
+    str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);
     symbol = AMgetSymbol(str);
     symbol = AMgetSymbol(str);
   }
   }
   switch (symbol.ttype) {
   switch (symbol.ttype) {
   case UNDEROVER:
   case UNDEROVER:
   case CONST:
   case CONST:
-    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
     return [AMcreateMmlNode(symbol.tag,        //its a constant
     return [AMcreateMmlNode(symbol.tag,        //its a constant
                              document.createTextNode(symbol.output)),str];
                              document.createTextNode(symbol.output)),str];
   case LEFTBRACKET:   //read (expr+)
   case LEFTBRACKET:   //read (expr+)
     AMnestingDepth++;
     AMnestingDepth++;
-    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
     result = AMparseExpr(str,true);
     result = AMparseExpr(str,true);
     AMnestingDepth--;
     AMnestingDepth--;
-    if (typeof symbol.invisible == "boolean" && symbol.invisible) 
+    if (typeof symbol.invisible == "boolean" && symbol.invisible)
       node = AMcreateMmlNode("mrow",result[0]);
       node = AMcreateMmlNode("mrow",result[0]);
     else {
     else {
       node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
       node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
@@ -556,7 +556,7 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
       str = AMremoveCharsAndBlanks(str,i+1);
       str = AMremoveCharsAndBlanks(str,i+1);
       return [AMcreateMmlNode("mrow",newFrag),str];
       return [AMcreateMmlNode("mrow",newFrag),str];
   case UNARY:
   case UNARY:
-      str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+      str = AMremoveCharsAndBlanks(str,symbol.input.length);
       result = AMparseSexpr(str);
       result = AMparseSexpr(str);
       if (result[0]==null) return [AMcreateMmlNode(symbol.tag,
       if (result[0]==null) return [AMcreateMmlNode(symbol.tag,
                              document.createTextNode(symbol.output)),str];
                              document.createTextNode(symbol.output)),str];
@@ -602,7 +602,7 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
         return [node,result[1]];
         return [node,result[1]];
       }
       }
   case BINARY:
   case BINARY:
-    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
     result = AMparseSexpr(str);
     result = AMparseSexpr(str);
     if (result[0]==null) return [AMcreateMmlNode("mo",
     if (result[0]==null) return [AMcreateMmlNode("mo",
                            document.createTextNode(symbol.input)),str];
                            document.createTextNode(symbol.input)),str];
@@ -611,16 +611,16 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
     if (result2[0]==null) return [AMcreateMmlNode("mo",
     if (result2[0]==null) return [AMcreateMmlNode("mo",
                            document.createTextNode(symbol.input)),str];
                            document.createTextNode(symbol.input)),str];
     AMremoveBrackets(result2[0]);
     AMremoveBrackets(result2[0]);
-    if (symbol.input=="root" || symbol.input=="stackrel") 
+    if (symbol.input=="root" || symbol.input=="stackrel")
       newFrag.appendChild(result2[0]);
       newFrag.appendChild(result2[0]);
     newFrag.appendChild(result[0]);
     newFrag.appendChild(result[0]);
     if (symbol.input=="frac") newFrag.appendChild(result2[0]);
     if (symbol.input=="frac") newFrag.appendChild(result2[0]);
     return [AMcreateMmlNode(symbol.tag,newFrag),result2[1]];
     return [AMcreateMmlNode(symbol.tag,newFrag),result2[1]];
   case INFIX:
   case INFIX:
-    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
     return [AMcreateMmlNode("mo",document.createTextNode(symbol.output)),str];
     return [AMcreateMmlNode("mo",document.createTextNode(symbol.output)),str];
   case SPACE:
   case SPACE:
-    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
     node = AMcreateElementMathML("mspace");
     node = AMcreateElementMathML("mspace");
     node.setAttribute("width","1ex");
     node.setAttribute("width","1ex");
     newFrag.appendChild(node);
     newFrag.appendChild(node);
@@ -633,7 +633,7 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
   case LEFTRIGHT:
   case LEFTRIGHT:
 //    if (rightvert) return [null,str]; else rightvert = true;
 //    if (rightvert) return [null,str]; else rightvert = true;
     AMnestingDepth++;
     AMnestingDepth++;
-    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
     result = AMparseExpr(str,false);
     result = AMparseExpr(str,false);
     AMnestingDepth--;
     AMnestingDepth--;
     var st = "";
     var st = "";
@@ -651,7 +651,7 @@ function AMparseSexpr(str) { //parses str and returns [node,tailstr]
     }
     }
   default:
   default:
 //alert("default");
 //alert("default");
-    str = AMremoveCharsAndBlanks(str,symbol.input.length); 
+    str = AMremoveCharsAndBlanks(str,symbol.input.length);
     return [AMcreateMmlNode(symbol.tag,        //its a constant
     return [AMcreateMmlNode(symbol.tag,        //its a constant
                              document.createTextNode(symbol.output)),str];
                              document.createTextNode(symbol.output)),str];
   }
   }
@@ -719,9 +719,9 @@ function AMparseExpr(str,rightbracket) {
       node.appendChild(result[0]);
       node.appendChild(result[0]);
       newFrag.appendChild(node);
       newFrag.appendChild(node);
       symbol = AMgetSymbol(str);
       symbol = AMgetSymbol(str);
-    } 
+    }
     else if (node!=undefined) newFrag.appendChild(node);
     else if (node!=undefined) newFrag.appendChild(node);
-  } while ((symbol.ttype != RIGHTBRACKET && 
+  } while ((symbol.ttype != RIGHTBRACKET &&
            (symbol.ttype != LEFTRIGHT || rightbracket)
            (symbol.ttype != LEFTRIGHT || rightbracket)
            || AMnestingDepth == 0) && symbol!=null && symbol.output!="");
            || AMnestingDepth == 0) && symbol!=null && symbol.output!="");
   if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {
   if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {
@@ -733,7 +733,7 @@ function AMparseExpr(str,rightbracket) {
       var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue;
       var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue;
       if (right==")" || right=="]") {
       if (right==")" || right=="]") {
         var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue;
         var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue;
-        if (left=="(" && right==")" && symbol.output != "}" || 
+        if (left=="(" && right==")" && symbol.output != "}" ||
             left=="[" && right=="]") {
             left=="[" && right=="]") {
         var pos = []; // positions of commas
         var pos = []; // positions of commas
         var matrix = true;
         var matrix = true;
@@ -741,12 +741,12 @@ function AMparseExpr(str,rightbracket) {
         for (i=0; matrix && i<m; i=i+2) {
         for (i=0; matrix && i<m; i=i+2) {
           pos[i] = [];
           pos[i] = [];
           node = newFrag.childNodes[i];
           node = newFrag.childNodes[i];
-          if (matrix) matrix = node.nodeName=="mrow" && 
-            (i==m-1 || node.nextSibling.nodeName=="mo" && 
+          if (matrix) matrix = node.nodeName=="mrow" &&
+            (i==m-1 || node.nextSibling.nodeName=="mo" &&
             node.nextSibling.firstChild.nodeValue==",")&&
             node.nextSibling.firstChild.nodeValue==",")&&
             node.firstChild.firstChild.nodeValue==left &&
             node.firstChild.firstChild.nodeValue==left &&
             node.lastChild.firstChild.nodeValue==right;
             node.lastChild.firstChild.nodeValue==right;
-          if (matrix) 
+          if (matrix)
             for (var j=0; j<node.childNodes.length; j++)
             for (var j=0; j<node.childNodes.length; j++)
               if (node.childNodes[j].firstChild.nodeValue==",")
               if (node.childNodes[j].firstChild.nodeValue==",")
                 pos[i][pos[i].length]=j;
                 pos[i][pos[i].length]=j;
@@ -891,7 +891,7 @@ function AMprocessNodeR(n, linebreaks) {
           checkForMathML = false;
           checkForMathML = false;
           var nd = AMisMathMLavailable();
           var nd = AMisMathMLavailable();
           AMnoMathML = nd != null;
           AMnoMathML = nd != null;
-          if (AMnoMathML && notifyIfNoMathML) 
+          if (AMnoMathML && notifyIfNoMathML)
             if (alertIfNoMathML)
             if (alertIfNoMathML)
               alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n\
               alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n\
                 or Firefox/Mozilla/Netscape");
                 or Firefox/Mozilla/Netscape");
@@ -1037,7 +1037,7 @@ function LMnoMathMLNote() {
   an.appendChild(document.createTextNode("LaTeXMathML"));
   an.appendChild(document.createTextNode("LaTeXMathML"));
   an.setAttribute("href","http://www.maths.nott.ac.uk/personal/drw/lm.html");
   an.setAttribute("href","http://www.maths.nott.ac.uk/personal/drw/lm.html");
   nd.appendChild(an);
   nd.appendChild(an);
-  nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+")); 
+  nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
   an = LMcreateElementXHTML("a");
   an = LMcreateElementXHTML("a");
   an.appendChild(document.createTextNode("MathPlayer"));
   an.appendChild(document.createTextNode("MathPlayer"));
   an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
   an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
@@ -1067,7 +1067,7 @@ var LMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF
 var LMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
 var LMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
 
 
 //var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
 //var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
-//    RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8, TEXT = 10, 
+//    RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8, TEXT = 10,
 var BIG = 11, LONG = 12, STRETCHY = 13, MATRIX = 14; // token types
 var BIG = 11, LONG = 12, STRETCHY = 13, MATRIX = 14; // token types
 
 
 var LMsqrt = {input:"\\sqrt",	tag:"msqrt", output:"sqrt",	ttype:UNARY},
 var LMsqrt = {input:"\\sqrt",	tag:"msqrt", output:"sqrt",	ttype:UNARY},
@@ -2126,10 +2126,10 @@ function LMprocessNode(n, linebreaks, spanclassLM) {
       st = n.innerHTML;
       st = n.innerHTML;
     } catch(err) {}
     } catch(err) {}
     var am = /amath|agraph/i.test(st);
     var am = /amath|agraph/i.test(st);
-    if ((st==null || st.indexOf("\$ ")!=-1 || st.indexOf("\$<")!=-1 || 
+    if ((st==null || st.indexOf("\$ ")!=-1 || st.indexOf("\$<")!=-1 ||
          st.indexOf("\\begin")!=-1 || am || st.slice(-1)=="$" ||
          st.indexOf("\\begin")!=-1 || am || st.slice(-1)=="$" ||
          st.indexOf("\$\n")!=-1)&& !/edit-content|HTMLArea|wikiedit/.test(st)){
          st.indexOf("\$\n")!=-1)&& !/edit-content|HTMLArea|wikiedit/.test(st)){
-      if (!avoidinnerHTML && translateLaTeXformatting) 
+      if (!avoidinnerHTML && translateLaTeXformatting)
         st = simpleLaTeXformatting(st);
         st = simpleLaTeXformatting(st);
       if (st!=null && am && !avoidinnerHTML) {
       if (st!=null && am && !avoidinnerHTML) {
 //alert(st)
 //alert(st)
@@ -2189,10 +2189,10 @@ it under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation; either version 2.1 of the License, or (at
 the Free Software Foundation; either version 2.1 of the License, or (at
 your option) any later version.
 your option) any later version.
 
 
-This program is distributed in the hope that it will be useful, 
+This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
-General Public License (at http://www.gnu.org/license/lgpl.html) 
+General Public License (at http://www.gnu.org/license/lgpl.html)
 for more details.*/
 for more details.*/
 
 
 // you can change these
 // you can change these
@@ -2246,7 +2246,7 @@ var aboveleft = "aboveleft";
 var aboveright = "aboveright";
 var aboveright = "aboveright";
 var belowleft = "belowleft";
 var belowleft = "belowleft";
 var belowright = "belowright";
 var belowright = "belowright";
-var xmin, xmax, ymin, ymax, xscl, yscl, 
+var xmin, xmax, ymin, ymax, xscl, yscl,
     xgrid, ygrid, xtick, ytick, initialized;
     xgrid, ygrid, xtick, ytick, initialized;
 var strokewidth, strokedasharray, stroke, fill, strokeopacity, fillopacity;
 var strokewidth, strokedasharray, stroke, fill, strokeopacity, fillopacity;
 var fontstyle, fontfamily, fontsize, fontweight, fontstroke, fontfill;
 var fontstyle, fontfamily, fontsize, fontweight, fontstroke, fontfill;
@@ -2268,7 +2268,7 @@ var arccsc = function(x) { return arcsin(1/x) };
 var arccot = function(x) { return arctan(1/x) };
 var arccot = function(x) { return arctan(1/x) };
 var sinh = function(x) { return (Math.exp(x)-Math.exp(-x))/2 };
 var sinh = function(x) { return (Math.exp(x)-Math.exp(-x))/2 };
 var cosh = function(x) { return (Math.exp(x)+Math.exp(-x))/2 };
 var cosh = function(x) { return (Math.exp(x)+Math.exp(-x))/2 };
-var tanh = 
+var tanh =
   function(x) { return (Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x)) };
   function(x) { return (Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x)) };
 var sech = function(x) { return 1/cosh(x) };
 var sech = function(x) { return 1/cosh(x) };
 var csch = function(x) { return 1/sinh(x) };
 var csch = function(x) { return 1/sinh(x) };
@@ -2359,7 +2359,7 @@ function isSVGavailable() {
   an.setAttribute("href",
   an.setAttribute("href",
     "http://www.chapman.edu/~jipsen/svg/svgenabledmozillafirefox.html");
     "http://www.chapman.edu/~jipsen/svg/svgenabledmozillafirefox.html");
   nd.appendChild(an);
   nd.appendChild(an);
-  if (navigator.appName.slice(0,8)=="Netscape") 
+  if (navigator.appName.slice(0,8)=="Netscape")
     if (window['SVGElement']) return null;
     if (window['SVGElement']) return null;
     else return nd;
     else return nd;
   else if (navigator.appName.slice(0,9)=="Microsoft")
   else if (navigator.appName.slice(0,9)=="Microsoft")
@@ -2391,7 +2391,7 @@ function getY(evt) { // return mouse y-coord in user coordinate system
 
 
 function translateandeval(src) { //modify user input to JavaScript syntax
 function translateandeval(src) { //modify user input to JavaScript syntax
   var errstr;
   var errstr;
-  // replace plot(f(x),...) with plot("f(x)",...)  
+  // replace plot(f(x),...) with plot("f(x)",...)
   src = src.replace(/plot\(\x20*([^\"f\[][^\n\r;]+?)\,/g,"plot\(\"$1\",");
   src = src.replace(/plot\(\x20*([^\"f\[][^\n\r;]+?)\,/g,"plot\(\"$1\",");
   src = src.replace(/plot\(\x20*([^\"f\[][^\n\r;]+)\)/g,"plot(\"$1\")");
   src = src.replace(/plot\(\x20*([^\"f\[][^\n\r;]+)\)/g,"plot(\"$1\")");
 
 
@@ -2406,7 +2406,7 @@ function translateandeval(src) { //modify user input to JavaScript syntax
     with (Math) eval(src);          // here the svgpicture object is created
     with (Math) eval(src);          // here the svgpicture object is created
   } catch(err) {
   } catch(err) {
     if (err!="wait") {
     if (err!="wait") {
-      if (typeof err=="object") 
+      if (typeof err=="object")
         errstr = err.name+" "+err.message+" "+err.number+" "+err.description;
         errstr = err.name+" "+err.message+" "+err.number+" "+err.description;
       else errstr = err;
       else errstr = err;
       alert(errstr+"\n"+src)
       alert(errstr+"\n"+src)
@@ -2437,7 +2437,7 @@ use Firefox 2.0 or later");
   }
   }
  if (nd == null) {
  if (nd == null) {
   for (index = 0; index < len; index++) {
   for (index = 0; index < len; index++) {
-   width = null; height = null; 
+   width = null; height = null;
    xmin = null; xmax = null; ymin = null; ymax = null;
    xmin = null; xmax = null; ymin = null; ymax = null;
    xscl = null; xgrid = null; yscl = null; ygrid = null;
    xscl = null; xgrid = null; yscl = null; ygrid = null;
    initialized = false;
    initialized = false;
@@ -2468,7 +2468,7 @@ use Firefox 2.0 or later");
    }
    }
    if (ht==null) ht ="";
    if (ht==null) ht ="";
 //   if (ht!="") defaultborder = 25;
 //   if (ht!="") defaultborder = 25;
-   if (ht=="" || src=="") 
+   if (ht=="" || src=="")
     if (document.getElementById("picture"+(index+1)+"input")==null) {
     if (document.getElementById("picture"+(index+1)+"input")==null) {
       node = myCreateElementXHTML("textarea");
       node = myCreateElementXHTML("textarea");
       arr = src.split("\n");
       arr = src.split("\n");
@@ -2566,7 +2566,7 @@ function changepicturesize(evt,factor) {
   updatePicture(name);
   updatePicture(name);
 }
 }
 
 
-var sinceFirstClick = 0; // ondblclick simulation from 
+var sinceFirstClick = 0; // ondblclick simulation from
 var dblClkTimer;         // http://www.enja.org/david/?cat=13 Thanks!
 var dblClkTimer;         // http://www.enja.org/david/?cat=13 Thanks!
 function timer() {
 function timer() {
   if(sinceFirstClick<60) {
   if(sinceFirstClick<60) {
@@ -2589,7 +2589,7 @@ function mClick(evt) {
       clearTimeout(dblClkTimer);
       clearTimeout(dblClkTimer);
       sinceFirstClick = 0;
       sinceFirstClick = 0;
       dblClkTimer = setTimeout("timer()",10);
       dblClkTimer = setTimeout("timer()",10);
-    }	      
+    }
   } else {
   } else {
     sinceFirstClick = 0;
     sinceFirstClick = 0;
     dblClkTimer = setTimeout("timer()",10);
     dblClkTimer = setTimeout("timer()",10);
@@ -2622,9 +2622,9 @@ function initPicture(x_min,x_max,y_min,y_max) { // set up the graph
   if (y_max!=null) ymax = y_max;
   if (y_max!=null) ymax = y_max;
   if (xmin==null) xmin = defaultxmin;
   if (xmin==null) xmin = defaultxmin;
   if (xmax==null) xmax = defaultxmax;
   if (xmax==null) xmax = defaultxmax;
- if (typeof xmin != "number" || typeof xmax != "number" || xmin >= xmax) 
+ if (typeof xmin != "number" || typeof xmax != "number" || xmin >= xmax)
    alert("Picture requires at least two numbers: xmin < xmax");
    alert("Picture requires at least two numbers: xmin < xmax");
- else if (y_max != null && (typeof y_min != "number" || 
+ else if (y_max != null && (typeof y_min != "number" ||
           typeof y_max != "number" || y_min >= y_max))
           typeof y_max != "number" || y_min >= y_max))
    alert("initPicture(xmin,xmax,ymin,ymax) requires numbers ymin < ymax");
    alert("initPicture(xmin,xmax,ymin,ymax) requires numbers ymin < ymax");
  else {
  else {
@@ -2633,7 +2633,7 @@ function initPicture(x_min,x_max,y_min,y_max) { // set up the graph
     if (width==null || width=="") width=defaultwidth;
     if (width==null || width=="") width=defaultwidth;
   }
   }
   picture.setAttribute("width",width);
   picture.setAttribute("width",width);
-  if (height==null) { 
+  if (height==null) {
     height = picture.getAttribute("height");
     height = picture.getAttribute("height");
     if (height==null || height=="") height=defaultheight;
     if (height==null || height=="") height=defaultheight;
   }
   }
@@ -2661,15 +2661,15 @@ function initPicture(x_min,x_max,y_min,y_max) { // set up the graph
       throw "wait";
       throw "wait";
     }
     }
     svgpicture = picture.getSVGDocument().getElementById("root");
     svgpicture = picture.getSVGDocument().getElementById("root");
-    while (svgpicture.childNodes.length>0) 
-      svgpicture.removeChild(svgpicture.lastChild); 
+    while (svgpicture.childNodes.length>0)
+      svgpicture.removeChild(svgpicture.lastChild);
     svgpicture.setAttribute("width",width);
     svgpicture.setAttribute("width",width);
     svgpicture.setAttribute("height",height);
     svgpicture.setAttribute("height",height);
     svgpicture.setAttribute("name",picture.getAttribute("id"));
     svgpicture.setAttribute("name",picture.getAttribute("id"));
     doc = picture.getSVGDocument();
     doc = picture.getSVGDocument();
     var nd = document.getElementById(picture.getAttribute("id")+"mml");
     var nd = document.getElementById(picture.getAttribute("id")+"mml");
     if (nd!=null) // clear out MathML layer
     if (nd!=null) // clear out MathML layer
-      while (nd.childNodes.length>0) nd.removeChild(nd.lastChild); 
+      while (nd.childNodes.length>0) nd.removeChild(nd.lastChild);
   } else {
   } else {
     var qnode = document.createElementNS("http://www.w3.org/2000/svg","svg");
     var qnode = document.createElementNS("http://www.w3.org/2000/svg","svg");
     qnode.setAttribute("id",picture.getAttribute("id"));
     qnode.setAttribute("id",picture.getAttribute("id"));
@@ -2729,7 +2729,7 @@ function line(p,q,id,endpts) { // segment connecting points p,q (coordinates in
     (height-p[1]*yunitlength-origin[1])+" "+
     (height-p[1]*yunitlength-origin[1])+" "+
     (q[0]*xunitlength+origin[0])+","+(height-q[1]*yunitlength-origin[1]));
     (q[0]*xunitlength+origin[0])+","+(height-q[1]*yunitlength-origin[1]));
   node.setAttribute("stroke-width", strokewidth);
   node.setAttribute("stroke-width", strokewidth);
-  if (strokedasharray!=null) 
+  if (strokedasharray!=null)
     node.setAttribute("stroke-dasharray", strokedasharray);
     node.setAttribute("stroke-dasharray", strokedasharray);
   node.setAttribute("stroke", stroke);
   node.setAttribute("stroke", stroke);
   node.setAttribute("fill", fill);
   node.setAttribute("fill", fill);
@@ -2771,7 +2771,7 @@ function path(plist,id,c,endpts) {
   }
   }
   node.setAttribute("d", st);
   node.setAttribute("d", st);
   node.setAttribute("stroke-width", strokewidth);
   node.setAttribute("stroke-width", strokewidth);
-  if (strokedasharray!=null) 
+  if (strokedasharray!=null)
     node.setAttribute("stroke-dasharray", strokedasharray);
     node.setAttribute("stroke-dasharray", strokedasharray);
   node.setAttribute("stroke", stroke);
   node.setAttribute("stroke", stroke);
   node.setAttribute("fill", fill);
   node.setAttribute("fill", fill);
@@ -2818,11 +2818,11 @@ function circle(center,radius,id) { // coordinates in units
   node.setAttribute("fill-opacity", fillopacity);
   node.setAttribute("fill-opacity", fillopacity);
 }
 }
 
 
-function loop(p,d,id) { 
+function loop(p,d,id) {
 // d is a direction vector e.g. [1,0] means loop starts in that direction
 // d is a direction vector e.g. [1,0] means loop starts in that direction
   if (d==null) d=[1,0];
   if (d==null) d=[1,0];
   path([p,[p[0]+d[0],p[1]+d[1]],[p[0]-d[1],p[1]+d[0]],p],id,"C");
   path([p,[p[0]+d[0],p[1]+d[1]],[p[0]-d[1],p[1]+d[0]],p],id,"C");
-  if (marker=="arrow" || marker=="arrowdot") 
+  if (marker=="arrow" || marker=="arrowdot")
     arrowhead([p[0]+Math.cos(1.4)*d[0]-Math.sin(1.4)*d[1],
     arrowhead([p[0]+Math.cos(1.4)*d[0]-Math.sin(1.4)*d[1],
                p[1]+Math.sin(1.4)*d[0]+Math.cos(1.4)*d[1]],p);
                p[1]+Math.sin(1.4)*d[0]+Math.cos(1.4)*d[1]],p);
 }
 }
@@ -2925,7 +2925,7 @@ function text(p,st,pos,id,fontsty) {
         node.style.position = "absolute";
         node.style.position = "absolute";
         dnode.appendChild(node);
         dnode.appendChild(node);
       }
       }
-      while (node.childNodes.length>0) node.removeChild(node.lastChild); 
+      while (node.childNodes.length>0) node.removeChild(node.lastChild);
       node.appendChild(document.createTextNode(st));
       node.appendChild(document.createTextNode(st));
 //      node.lastChild.nodeValue = st;
 //      node.lastChild.nodeValue = st;
       node.style.left = ""+(p[0]*xunitlength+origin[0])+"px";
       node.style.left = ""+(p[0]*xunitlength+origin[0])+"px";
@@ -2958,7 +2958,7 @@ function text(p,st,pos,id,fontsty) {
     svgpicture.appendChild(node);
     svgpicture.appendChild(node);
     node.appendChild(doc.createTextNode(st));
     node.appendChild(doc.createTextNode(st));
   }
   }
-  while (node.childNodes.length>1) node.removeChild(node.lastChild); 
+  while (node.childNodes.length>1) node.removeChild(node.lastChild);
 //  node.appendChild(document.createTextNode("\xA0"+st+"\xA0"));
 //  node.appendChild(document.createTextNode("\xA0"+st+"\xA0"));
 //alert("here");
 //alert("here");
   node.lastChild.nodeValue = "\xA0"+st+"\xA0";
   node.lastChild.nodeValue = "\xA0"+st+"\xA0";
@@ -3075,7 +3075,7 @@ function dot(center, typ, label, pos, id) {
     node.setAttribute("fill", (typ=="open"?"white":
     node.setAttribute("fill", (typ=="open"?"white":
                               (typ=="closed"?stroke:markerfill)));
                               (typ=="closed"?stroke:markerfill)));
   }
   }
-  if (label!=null) 
+  if (label!=null)
     text(center,label,(pos==null?"below":pos),(id==null?id:id+"label"))
     text(center,label,(pos==null?"below":pos),(id==null?id:id+"label"))
 }
 }
 
 
@@ -3099,7 +3099,7 @@ function arrowhead(p,q) { // draw arrowhead at q (in units) add size param
     node.setAttribute("fill", stroke); /*was arrowfill*/
     node.setAttribute("fill", stroke); /*was arrowfill*/
     node.setAttribute("stroke-opacity", strokeopacity);
     node.setAttribute("stroke-opacity", strokeopacity);
     node.setAttribute("fill-opacity", fillopacity);
     node.setAttribute("fill-opacity", fillopacity);
-    svgpicture.appendChild(node);    
+    svgpicture.appendChild(node);
   }
   }
 }
 }
 
 
@@ -3253,7 +3253,7 @@ function mathjs(st) {
       j--;
       j--;
       while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z")
       while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z")
         j--;
         j--;
-    } else { 
+    } else {
       return "Error: incorrect syntax in "+st+" at position "+j;
       return "Error: incorrect syntax in "+st+" at position "+j;
     }
     }
     //find right argument
     //find right argument
@@ -3280,7 +3280,7 @@ function mathjs(st) {
       k++;
       k++;
       while (k<st.length && (ch=st.charAt(k))>="a" && ch<="z" ||
       while (k<st.length && (ch=st.charAt(k))>="a" && ch<="z" ||
                ch>="A" && ch<="Z") k++;
                ch>="A" && ch<="Z") k++;
-    } else { 
+    } else {
       return "Error: incorrect syntax in "+st+" at position "+k;
       return "Error: incorrect syntax in "+st+" at position "+k;
     }
     }
     st = st.slice(0,j+1)+"Math.pow("+st.slice(j+1,i)+","+st.slice(i+1,k)+")"+
     st = st.slice(0,j+1)+"Math.pow("+st.slice(j+1,i)+","+st.slice(i+1,k)+")"+
@@ -3313,7 +3313,7 @@ function mathjs(st) {
       j--;
       j--;
       while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z")
       while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z")
         j--;
         j--;
-    } else { 
+    } else {
       return "Error: incorrect syntax in "+st+" at position "+j;
       return "Error: incorrect syntax in "+st+" at position "+j;
     }
     }
     st = st.slice(0,j+1)+"factorial("+st.slice(j+1,i)+")"+st.slice(i+1);
     st = st.slice(0,j+1)+"factorial("+st.slice(j+1,i)+")"+st.slice(i+1);
@@ -3325,7 +3325,7 @@ function plot(fun,x_min,x_max,points,id,endpts) {
   var pth = [];
   var pth = [];
   var f = function(x) { return x }, g = fun;
   var f = function(x) { return x }, g = fun;
   var name = null;
   var name = null;
-  if (typeof fun=="string") 
+  if (typeof fun=="string")
     eval("g = function(x){ with(Math) return "+mathjs(fun)+" }");
     eval("g = function(x){ with(Math) return "+mathjs(fun)+" }");
   else if (typeof fun=="object") {
   else if (typeof fun=="object") {
     eval("f = function(t){ with(Math) return "+mathjs(fun[0])+" }");
     eval("f = function(t){ with(Math) return "+mathjs(fun[0])+" }");
@@ -3353,7 +3353,7 @@ function plot(fun,x_min,x_max,points,id,endpts) {
 
 
 function slopefield(fun,dx,dy) {
 function slopefield(fun,dx,dy) {
   var g = fun;
   var g = fun;
-  if (typeof fun=="string") 
+  if (typeof fun=="string")
     eval("g = function(x,y){ with(Math) return "+mathjs(fun)+" }");
     eval("g = function(x,y){ with(Math) return "+mathjs(fun)+" }");
   var gxy,x,y,u,v,dz;
   var gxy,x,y,u,v,dz;
   if (dx==null) dx=1;
   if (dx==null) dx=1;
@@ -3427,8 +3427,8 @@ function calculate(inputId,outputId) {
   } catch(e) {
   } catch(e) {
     err = "syntax incomplete";
     err = "syntax incomplete";
   }
   }
-  if (!isNaN(res) && res!="Infinity") 
-    str = "`"+str+" =` "+(Math.abs(res-Math.round(res*1000000)/1000000)<1e-15?Math.round(res*1000000)/1000000:res)+err; 
+  if (!isNaN(res) && res!="Infinity")
+    str = "`"+str+" =` "+(Math.abs(res-Math.round(res*1000000)/1000000)<1e-15?Math.round(res*1000000)/1000000:res)+err;
   else if (str!="") str = "`"+str+"` = undefined"; //debug:+mathjs(str);
   else if (str!="") str = "`"+str+"` = undefined"; //debug:+mathjs(str);
   var outnode = document.getElementById(outputId);
   var outnode = document.getElementById(outputId);
   var n = outnode.childNodes.length;
   var n = outnode.childNodes.length;

+ 61 - 61
main/inc/lib/javascript/jquery.autocomplete.js

@@ -12,7 +12,7 @@
  */
  */
 
 
 ;(function($) {
 ;(function($) {
-	
+
 $.fn.extend({
 $.fn.extend({
 	autocomplete: function(urlOrData, options) {
 	autocomplete: function(urlOrData, options) {
 		var isUrl = typeof urlOrData == "string";
 		var isUrl = typeof urlOrData == "string";
@@ -22,13 +22,13 @@ $.fn.extend({
 			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
 			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
 			max: options && !options.scroll ? 10 : 150
 			max: options && !options.scroll ? 10 : 150
 		}, options);
 		}, options);
-		
+
 		// if highlight is set to false, replace it with a do-nothing function
 		// if highlight is set to false, replace it with a do-nothing function
 		options.highlight = options.highlight || function(value) { return value; };
 		options.highlight = options.highlight || function(value) { return value; };
-		
+
 		// if the formatMatch option is not specified, then use formatItem for backwards compatibility
 		// if the formatMatch option is not specified, then use formatItem for backwards compatibility
 		options.formatMatch = options.formatMatch || options.formatItem;
 		options.formatMatch = options.formatMatch || options.formatItem;
-		
+
 		return this.each(function() {
 		return this.each(function() {
 			new $.Autocompleter(this, options);
 			new $.Autocompleter(this, options);
 		});
 		});
@@ -77,9 +77,9 @@ $.Autocompleter = function(input, options) {
 		mouseDownOnSelect: false
 		mouseDownOnSelect: false
 	};
 	};
 	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
 	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
-	
+
 	var blockSubmit;
 	var blockSubmit;
-	
+
 	// prevent form submit in opera when selecting with return key
 	// prevent form submit in opera when selecting with return key
 	$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
 	$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
 		if (blockSubmit) {
 		if (blockSubmit) {
@@ -87,13 +87,13 @@ $.Autocompleter = function(input, options) {
 			return false;
 			return false;
 		}
 		}
 	});
 	});
-	
+
 	// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
 	// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
 	$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
 	$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
 		// track last key pressed
 		// track last key pressed
 		lastKeyPressCode = event.keyCode;
 		lastKeyPressCode = event.keyCode;
 		switch(event.keyCode) {
 		switch(event.keyCode) {
-		
+
 			case KEY.UP:
 			case KEY.UP:
 				event.preventDefault();
 				event.preventDefault();
 				if ( select.visible() ) {
 				if ( select.visible() ) {
@@ -102,7 +102,7 @@ $.Autocompleter = function(input, options) {
 					onChange(0, true);
 					onChange(0, true);
 				}
 				}
 				break;
 				break;
-				
+
 			case KEY.DOWN:
 			case KEY.DOWN:
 				event.preventDefault();
 				event.preventDefault();
 				if ( select.visible() ) {
 				if ( select.visible() ) {
@@ -111,7 +111,7 @@ $.Autocompleter = function(input, options) {
 					onChange(0, true);
 					onChange(0, true);
 				}
 				}
 				break;
 				break;
-				
+
 			case KEY.PAGEUP:
 			case KEY.PAGEUP:
 				event.preventDefault();
 				event.preventDefault();
 				if ( select.visible() ) {
 				if ( select.visible() ) {
@@ -120,7 +120,7 @@ $.Autocompleter = function(input, options) {
 					onChange(0, true);
 					onChange(0, true);
 				}
 				}
 				break;
 				break;
-				
+
 			case KEY.PAGEDOWN:
 			case KEY.PAGEDOWN:
 				event.preventDefault();
 				event.preventDefault();
 				if ( select.visible() ) {
 				if ( select.visible() ) {
@@ -129,7 +129,7 @@ $.Autocompleter = function(input, options) {
 					onChange(0, true);
 					onChange(0, true);
 				}
 				}
 				break;
 				break;
-			
+
 			// matches also semicolon
 			// matches also semicolon
 			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
 			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
 			case KEY.TAB:
 			case KEY.TAB:
@@ -141,11 +141,11 @@ $.Autocompleter = function(input, options) {
 					return false;
 					return false;
 				}
 				}
 				break;
 				break;
-				
+
 			case KEY.ESC:
 			case KEY.ESC:
 				select.hide();
 				select.hide();
 				break;
 				break;
-				
+
 			default:
 			default:
 				clearTimeout(timeout);
 				clearTimeout(timeout);
 				timeout = setTimeout(onChange, options.delay);
 				timeout = setTimeout(onChange, options.delay);
@@ -196,16 +196,16 @@ $.Autocompleter = function(input, options) {
 		$input.unbind();
 		$input.unbind();
 		$(input.form).unbind(".autocomplete");
 		$(input.form).unbind(".autocomplete");
 	});
 	});
-	
-	
+
+
 	function selectCurrent() {
 	function selectCurrent() {
 		var selected = select.selected();
 		var selected = select.selected();
 		if( !selected )
 		if( !selected )
 			return false;
 			return false;
-		
+
 		var v = selected.result;
 		var v = selected.result;
 		previousValue = v;
 		previousValue = v;
-		
+
 		if ( options.multiple ) {
 		if ( options.multiple ) {
 			var words = trimWords($input.val());
 			var words = trimWords($input.val());
 			if ( words.length > 1 ) {
 			if ( words.length > 1 ) {
@@ -213,26 +213,26 @@ $.Autocompleter = function(input, options) {
 			}
 			}
 			v += options.multipleSeparator;
 			v += options.multipleSeparator;
 		}
 		}
-		
+
 		$input.val(v);
 		$input.val(v);
 		hideResultsNow();
 		hideResultsNow();
 		$input.trigger("result", [selected.data, selected.value]);
 		$input.trigger("result", [selected.data, selected.value]);
 		return true;
 		return true;
 	}
 	}
-	
+
 	function onChange(crap, skipPrevCheck) {
 	function onChange(crap, skipPrevCheck) {
 		if( lastKeyPressCode == KEY.DEL ) {
 		if( lastKeyPressCode == KEY.DEL ) {
 			select.hide();
 			select.hide();
 			return;
 			return;
 		}
 		}
-		
+
 		var currentValue = $input.val();
 		var currentValue = $input.val();
-		
+
 		if ( !skipPrevCheck && currentValue == previousValue )
 		if ( !skipPrevCheck && currentValue == previousValue )
 			return;
 			return;
-		
+
 		previousValue = currentValue;
 		previousValue = currentValue;
-		
+
 		currentValue = lastWord(currentValue);
 		currentValue = lastWord(currentValue);
 		if ( currentValue.length >= options.minChars) {
 		if ( currentValue.length >= options.minChars) {
 			$input.addClass(options.loadingClass);
 			$input.addClass(options.loadingClass);
@@ -244,7 +244,7 @@ $.Autocompleter = function(input, options) {
 			select.hide();
 			select.hide();
 		}
 		}
 	};
 	};
-	
+
 	function trimWords(value) {
 	function trimWords(value) {
 		if ( !value ) {
 		if ( !value ) {
 			return [""];
 			return [""];
@@ -257,14 +257,14 @@ $.Autocompleter = function(input, options) {
 		});
 		});
 		return result;
 		return result;
 	}
 	}
-	
+
 	function lastWord(value) {
 	function lastWord(value) {
 		if ( !options.multiple )
 		if ( !options.multiple )
 			return value;
 			return value;
 		var words = trimWords(value);
 		var words = trimWords(value);
 		return words[words.length - 1];
 		return words[words.length - 1];
 	}
 	}
-	
+
 	// fills in the input box w/the first match (assumed to be the best match)
 	// fills in the input box w/the first match (assumed to be the best match)
 	// q: the term entered
 	// q: the term entered
 	// sValue: the first matching result
 	// sValue: the first matching result
@@ -330,14 +330,14 @@ $.Autocompleter = function(input, options) {
 			success(term, data);
 			success(term, data);
 		// if an AJAX url has been supplied, try loading the data now
 		// if an AJAX url has been supplied, try loading the data now
 		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
 		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
-			
+
 			var extraParams = {
 			var extraParams = {
 				timestamp: +new Date()
 				timestamp: +new Date()
 			};
 			};
 			$.each(options.extraParams, function(key, param) {
 			$.each(options.extraParams, function(key, param) {
 				extraParams[key] = typeof param == "function" ? param() : param;
 				extraParams[key] = typeof param == "function" ? param() : param;
 			});
 			});
-			
+
 			$.ajax({
 			$.ajax({
 				// try to leverage ajaxQueue plugin to abort previous requests
 				// try to leverage ajaxQueue plugin to abort previous requests
 				mode: "abort",
 				mode: "abort",
@@ -361,7 +361,7 @@ $.Autocompleter = function(input, options) {
 			failure(term);
 			failure(term);
 		}
 		}
 	};
 	};
-	
+
 	function parse(data) {
 	function parse(data) {
 		var parsed = [];
 		var parsed = [];
 		var rows = data.split("\n");
 		var rows = data.split("\n");
@@ -416,25 +416,25 @@ $.Autocompleter.Cache = function(options) {
 
 
 	var data = {};
 	var data = {};
 	var length = 0;
 	var length = 0;
-	
+
 	function matchSubset(s, sub) {
 	function matchSubset(s, sub) {
-		if (!options.matchCase) 
+		if (!options.matchCase)
 			s = s.toLowerCase();
 			s = s.toLowerCase();
 		var i = s.indexOf(sub);
 		var i = s.indexOf(sub);
 		if (i == -1) return false;
 		if (i == -1) return false;
 		return i == 0 || options.matchContains;
 		return i == 0 || options.matchContains;
 	};
 	};
-	
+
 	function add(q, value) {
 	function add(q, value) {
 		if (length > options.cacheLength){
 		if (length > options.cacheLength){
 			flush();
 			flush();
 		}
 		}
-		if (!data[q]){ 
+		if (!data[q]){
 			length++;
 			length++;
 		}
 		}
 		data[q] = value;
 		data[q] = value;
 	}
 	}
-	
+
 	function populate(){
 	function populate(){
 		if( !options.data ) return false;
 		if( !options.data ) return false;
 		// track the matches
 		// track the matches
@@ -443,23 +443,23 @@ $.Autocompleter.Cache = function(options) {
 
 
 		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
 		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
 		if( !options.url ) options.cacheLength = 1;
 		if( !options.url ) options.cacheLength = 1;
-		
+
 		// track all options for minChars = 0
 		// track all options for minChars = 0
 		stMatchSets[""] = [];
 		stMatchSets[""] = [];
-		
+
 		// loop through the array and create a lookup structure
 		// loop through the array and create a lookup structure
 		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
 		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
 			var rawValue = options.data[i];
 			var rawValue = options.data[i];
 			// if rawValue is a string, make an array otherwise just reference the array
 			// if rawValue is a string, make an array otherwise just reference the array
 			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
 			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
-			
+
 			var value = options.formatMatch(rawValue, i+1, options.data.length);
 			var value = options.formatMatch(rawValue, i+1, options.data.length);
 			if ( value === false )
 			if ( value === false )
 				continue;
 				continue;
-				
+
 			var firstChar = value.charAt(0).toLowerCase();
 			var firstChar = value.charAt(0).toLowerCase();
 			// if no lookup array for this character exists, look it up now
 			// if no lookup array for this character exists, look it up now
-			if( !stMatchSets[firstChar] ) 
+			if( !stMatchSets[firstChar] )
 				stMatchSets[firstChar] = [];
 				stMatchSets[firstChar] = [];
 
 
 			// if the match is a string
 			// if the match is a string
@@ -468,7 +468,7 @@ $.Autocompleter.Cache = function(options) {
 				data: rawValue,
 				data: rawValue,
 				result: options.formatResult && options.formatResult(rawValue) || value
 				result: options.formatResult && options.formatResult(rawValue) || value
 			};
 			};
-			
+
 			// push the current match into the set list
 			// push the current match into the set list
 			stMatchSets[firstChar].push(row);
 			stMatchSets[firstChar].push(row);
 
 
@@ -486,15 +486,15 @@ $.Autocompleter.Cache = function(options) {
 			add(i, value);
 			add(i, value);
 		});
 		});
 	}
 	}
-	
+
 	// populate any existing data
 	// populate any existing data
 	setTimeout(populate, 25);
 	setTimeout(populate, 25);
-	
+
 	function flush(){
 	function flush(){
 		data = {};
 		data = {};
 		length = 0;
 		length = 0;
 	}
 	}
-	
+
 	return {
 	return {
 		flush: flush,
 		flush: flush,
 		add: add,
 		add: add,
@@ -502,7 +502,7 @@ $.Autocompleter.Cache = function(options) {
 		load: function(q) {
 		load: function(q) {
 			if (!options.cacheLength || !length)
 			if (!options.cacheLength || !length)
 				return null;
 				return null;
-			/* 
+			/*
 			 * if dealing w/local data and matchContains than we must make sure
 			 * if dealing w/local data and matchContains than we must make sure
 			 * to loop through all the data collections looking for matches
 			 * to loop through all the data collections looking for matches
 			 */
 			 */
@@ -522,9 +522,9 @@ $.Autocompleter.Cache = function(options) {
 							}
 							}
 						});
 						});
 					}
 					}
-				}				
+				}
 				return csub;
 				return csub;
-			} else 
+			} else
 			// if the exact item exists, use it
 			// if the exact item exists, use it
 			if (data[q]){
 			if (data[q]){
 				return data[q];
 				return data[q];
@@ -552,7 +552,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 	var CLASSES = {
 	var CLASSES = {
 		ACTIVE: "ac_over"
 		ACTIVE: "ac_over"
 	};
 	};
-	
+
 	var listItems,
 	var listItems,
 		active = -1,
 		active = -1,
 		data,
 		data,
@@ -560,7 +560,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 		needsInit = true,
 		needsInit = true,
 		element,
 		element,
 		list;
 		list;
-	
+
 	// Create results
 	// Create results
 	function init() {
 	function init() {
 		if (!needsInit)
 		if (!needsInit)
@@ -570,11 +570,11 @@ $.Autocompleter.Select = function (options, input, select, config) {
 		.addClass(options.resultsClass)
 		.addClass(options.resultsClass)
 		.css("position", "absolute")
 		.css("position", "absolute")
 		.appendTo(document.body);
 		.appendTo(document.body);
-	
+
 		list = $("<ul/>").appendTo(element).mouseover( function(event) {
 		list = $("<ul/>").appendTo(element).mouseover( function(event) {
 			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
 			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
 	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
 	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
-			    $(target(event)).addClass(CLASSES.ACTIVE);            
+			    $(target(event)).addClass(CLASSES.ACTIVE);
 	        }
 	        }
 		}).click(function(event) {
 		}).click(function(event) {
 			$(target(event)).addClass(CLASSES.ACTIVE);
 			$(target(event)).addClass(CLASSES.ACTIVE);
@@ -587,13 +587,13 @@ $.Autocompleter.Select = function (options, input, select, config) {
 		}).mouseup(function() {
 		}).mouseup(function() {
 			config.mouseDownOnSelect = false;
 			config.mouseDownOnSelect = false;
 		});
 		});
-		
+
 		if( options.width > 0 )
 		if( options.width > 0 )
 			element.css("width", options.width);
 			element.css("width", options.width);
-			
+
 		needsInit = false;
 		needsInit = false;
-	} 
-	
+	}
+
 	function target(event) {
 	function target(event) {
 		var element = event.target;
 		var element = event.target;
 		while(element && element.tagName != "LI")
 		while(element && element.tagName != "LI")
@@ -620,7 +620,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
             }
             }
         }
         }
 	};
 	};
-	
+
 	function movePosition(step) {
 	function movePosition(step) {
 		active += step;
 		active += step;
 		if (active < 0) {
 		if (active < 0) {
@@ -629,13 +629,13 @@ $.Autocompleter.Select = function (options, input, select, config) {
 			active = 0;
 			active = 0;
 		}
 		}
 	}
 	}
-	
+
 	function limitNumberOfItems(available) {
 	function limitNumberOfItems(available) {
 		return options.max && options.max < available
 		return options.max && options.max < available
 			? options.max
 			? options.max
 			: available;
 			: available;
 	}
 	}
-	
+
 	function fillList() {
 	function fillList() {
 		list.empty();
 		list.empty();
 		var max = limitNumberOfItems(data.length);
 		var max = limitNumberOfItems(data.length);
@@ -657,7 +657,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 		if ( $.fn.bgiframe )
 		if ( $.fn.bgiframe )
 			list.bgiframe();
 			list.bgiframe();
 	}
 	}
-	
+
 	return {
 	return {
 		display: function(d, q) {
 		display: function(d, q) {
 			init();
 			init();
@@ -709,7 +709,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 					maxHeight: options.scrollHeight,
 					maxHeight: options.scrollHeight,
 					overflow: 'auto'
 					overflow: 'auto'
 				});
 				});
-				
+
                 if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
                 if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
 					var listHeight = 0;
 					var listHeight = 0;
 					listItems.each(function() {
 					listItems.each(function() {
@@ -722,7 +722,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
 						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
 						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
 					}
 					}
                 }
                 }
-                
+
             }
             }
 		},
 		},
 		selected: function() {
 		selected: function() {

+ 72 - 72
main/inc/lib/javascript/jquery.customselect.js

@@ -3,201 +3,201 @@
 ;(function($){
 ;(function($){
 
 
   $.fn.extend({
   $.fn.extend({
-  
+
     //計算文字Byte數,並回傳
     //計算文字Byte數,並回傳
     getByteLength: function(strIN){
     getByteLength: function(strIN){
         var i, cnt=0;
         var i, cnt=0;
-            
-        for (i=0; i<strIN.length; i++){            
+
+        for (i=0; i<strIN.length; i++){
             if (escape(strIN.charAt(i)).length >= 4) cnt+=2;
             if (escape(strIN.charAt(i)).length >= 4) cnt+=2;
-            else cnt++;            
-        } 
-            
+            else cnt++;
+        }
+
         return cnt;
         return cnt;
-    } 
-    
+    }
+
   });
   });
-  
+
   $.fn.extend({
   $.fn.extend({
-  
+
     //檢查文字的Byte數,超�?�limit指定的個數的話,就回傳true 和 未超�?�之�?的文字index
     //檢查文字的Byte數,超�?�limit指定的個數的話,就回傳true 和 未超�?�之�?的文字index
     getIndexByByte: function(strIN,limit){
     getIndexByByte: function(strIN,limit){
         var i, cnt=0;
         var i, cnt=0;
-            
-        for (i=0; i<strIN.length; i++){            
+
+        for (i=0; i<strIN.length; i++){
             if (escape(strIN.charAt(i)).length >= 4) cnt+=2;
             if (escape(strIN.charAt(i)).length >= 4) cnt+=2;
-            else cnt++;            
-            
+            else cnt++;
+
             if(cnt>limit)
             if(cnt>limit)
             {
             {
                 return [true,i];
                 return [true,i];
             }
             }
-        } 
-            
+        }
+
         return false;
         return false;
-    } 
-    
+    }
+
   });
   });
-  
+
   $.fn.extend({
   $.fn.extend({
 
 
     finalselect: function(options) {
     finalselect: function(options) {
-        
+
         var settings =
         var settings =
-	    {	
+	    {
 	        id:null,
 	        id:null,
 		    animalSpeed:100,
 		    animalSpeed:100,
-            selectWidth:"190px",		   
+            selectWidth:"190px",
             selectImage:"image/select.png",
             selectImage:"image/select.png",
             selectText:"My friend",
             selectText:"My friend",
-		    zIndex: 0,    
+		    zIndex: 0,
 		    viewHeight:"100px",
 		    viewHeight:"100px",
 		    viewWidth:"300px",
 		    viewWidth:"300px",
 		    viewMouseoverColor:"#cfdfff",//#dcdcdc
 		    viewMouseoverColor:"#cfdfff",//#dcdcdc
 		    viewTop:"28px",//top,bottom
 		    viewTop:"28px",//top,bottom
 		    viewLeft:" -1px"//left,right
 		    viewLeft:" -1px"//left,right
 	    };
 	    };
-	    
-	    
+
+
         if (typeof(options)!='undefined')
         if (typeof(options)!='undefined')
 	    {
 	    {
 	        //將整批options的值assign給settings
 	        //將整批options的值assign給settings
 		    jQuery.extend(settings, options);
 		    jQuery.extend(settings, options);
 	    }
 	    }
-             
+
         var tmp='<div id="'+settings.id+'-select" style="cursor:default;font-size:12px;z-index:'+settings.zIndex+';border: solid 0px #999; padding: 0px; width: 180px; position: relative;">'
         var tmp='<div id="'+settings.id+'-select" style="cursor:default;font-size:12px;z-index:'+settings.zIndex+';border: solid 0px #999; padding: 0px; width: 180px; position: relative;">'
         tmp+='<div id="'+settings.id+'-Text" style="background: url('+settings.selectImage+') no-repeat 0 0; width: '+settings.selectWidth+'; height: 21px; color: Black; padding: 0  0 0 0;">';
         tmp+='<div id="'+settings.id+'-Text" style="background: url('+settings.selectImage+') no-repeat 0 0; width: '+settings.selectWidth+'; height: 21px; color: Black; padding: 0  0 0 0;">';
         tmp+='<div class="textshow" style="padding: 0px;">'+settings.selectText+'</div><div class="valueshow" style="display:none;"></div></div><div id="'+settings.id+'-selectshow" style="overflow-y:auto; overflow-x:hidden; height:'+settings.viewHeight+';width:'+settings.viewWidth+'; display:none; position: absolute; left:'+settings.viewLeft+'; top:'+settings.viewTop+'; border: solid 1px #999; background: white;"></div></div>';
         tmp+='<div class="textshow" style="padding: 0px;">'+settings.selectText+'</div><div class="valueshow" style="display:none;"></div></div><div id="'+settings.id+'-selectshow" style="overflow-y:auto; overflow-x:hidden; height:'+settings.viewHeight+';width:'+settings.viewWidth+'; display:none; position: absolute; left:'+settings.viewLeft+'; top:'+settings.viewTop+'; border: solid 1px #999; background: white;"></div></div>';
-        
+
 
 
-        
+
         var _handler = function() {
         var _handler = function() {
             // 從這裡開始
             // 從這裡開始
             $(this).html(tmp);
             $(this).html(tmp);
             bindArrowClick();
             bindArrowClick();
             bindSelectMouseover();
             bindSelectMouseover();
             bindSelectMouseleave();
             bindSelectMouseleave();
-            
+
         };
         };
-        
-        
-        
+
+
+
         var bindArrowClick=function(){
         var bindArrowClick=function(){
             var tmp=$('#'+settings.id+'-Text');
             var tmp=$('#'+settings.id+'-Text');
-            $("#"+settings.id+'-Text').bind("click", function(e){            
+            $("#"+settings.id+'-Text').bind("click", function(e){
                 var obj=$('#'+settings.id+'-selectshow');
                 var obj=$('#'+settings.id+'-selectshow');
                 if(obj.css('display')=='none')
                 if(obj.css('display')=='none')
                 {
                 {
-                   // obj.slide();                
-                   obj.slideDown(settings.animalSpeed,function(){                        
-                        obj.show();                       
+                   // obj.slide();
+                   obj.slideDown(settings.animalSpeed,function(){
+                        obj.show();
                         obj.css('overflow','auto');
                         obj.css('overflow','auto');
                         obj.css('overflow-x','hidden');
                         obj.css('overflow-x','hidden');
                     });
                     });
                 }
                 }
                 else
                 else
                 {
                 {
-                    obj.slideUp(settings.animalSpeed,function(){                        
+                    obj.slideUp(settings.animalSpeed,function(){
                         obj.hide();
                         obj.hide();
                     });
                     });
                 }
                 }
-       
+
             });
             });
         };
         };
-        
+
         var bindItemMouseover=function(){
         var bindItemMouseover=function(){
-        
+
             var inx=0;
             var inx=0;
             while($(".selectitem",$("#"+settings.id+"-selectshow")).get(inx)!=null)
             while($(".selectitem",$("#"+settings.id+"-selectshow")).get(inx)!=null)
             {
             {
                 var item=$(".selectitem",$("#"+settings.id+"-selectshow")).get(inx);
                 var item=$(".selectitem",$("#"+settings.id+"-selectshow")).get(inx);
-                
+
                 $(item).bind("mouseover", function(e){
                 $(item).bind("mouseover", function(e){
                   $(this).css('background-color',settings.viewMouseoverColor);
                   $(this).css('background-color',settings.viewMouseoverColor);
                 });
                 });
-                
+
                 $(item).bind("mouseout", function(e){
                 $(item).bind("mouseout", function(e){
                   $(this).css('background-color','#fff');
                   $(this).css('background-color','#fff');
                 });
                 });
-                
+
                 $(item).bind("click", function(e){
                 $(item).bind("click", function(e){
-                 
-                    var tmpstr=$(".thistext",$(this)).html();                     
-                    var arr=$().getIndexByByte(tmpstr,30); 
+
+                    var tmpstr=$(".thistext",$(this)).html();
+                    var arr=$().getIndexByByte(tmpstr,30);
                     if(arr[0]==true)
                     if(arr[0]==true)
-                        tmpstr=tmpstr.substring(0,arr[1])+'...';                    
+                        tmpstr=tmpstr.substring(0,arr[1])+'...';
 
 
                     $(".textshow",$("#"+settings.id+"-Text")).html(tmpstr);
                     $(".textshow",$("#"+settings.id+"-Text")).html(tmpstr);
                     document.getElementById(settings.id+'-selectshow').style.display="none";
                     document.getElementById(settings.id+'-selectshow').style.display="none";
-                    
+
                     $(".valueshow",$("#"+settings.id+"-Text")).html($(".selectvalue",$(this)).html());
                     $(".valueshow",$("#"+settings.id+"-Text")).html($(".selectvalue",$(this)).html());
-                    
+
                 });
                 });
 
 
                 inx++;
                 inx++;
             }
             }
 
 
         }
         }
-        
+
         var bindSelectMouseover=function(){
         var bindSelectMouseover=function(){
             $('#'+settings.id+'-Text').bind("mouseover",function(){
             $('#'+settings.id+'-Text').bind("mouseover",function(){
                 if($.browser.msie==false)
                 if($.browser.msie==false)
                     $('#'+settings.id+'-Text').css("background-position","0 -21px");
                     $('#'+settings.id+'-Text').css("background-position","0 -21px");
             });
             });
         }
         }
-        
+
         var bindSelectMouseleave=function(){
         var bindSelectMouseleave=function(){
             $('#'+settings.id+'-Text').bind("mouseout",function(){
             $('#'+settings.id+'-Text').bind("mouseout",function(){
                 if($.browser.msie==false)
                 if($.browser.msie==false)
                     $('#'+settings.id+'-Text').css("background-position","0 0px");
                     $('#'+settings.id+'-Text').css("background-position","0 0px");
             });
             });
         }
         }
-        
+
         this.setViewTop = function(top){
         this.setViewTop = function(top){
             $('#'+settings.id+'-selectshow').css('top',top+'px');
             $('#'+settings.id+'-selectshow').css('top',top+'px');
-        } 
-        
+        }
+
         this.setViewLeft = function(left){
         this.setViewLeft = function(left){
             $('#'+settings.id+'-selectshow').css('left',left+'px');
             $('#'+settings.id+'-selectshow').css('left',left+'px');
-        }     
-        
+        }
+
         this.getLength = function(){
         this.getLength = function(){
             return $('.selectitem',$('#'+settings.id+'-selectshow')).length;
             return $('.selectitem',$('#'+settings.id+'-selectshow')).length;
-        }   
-       
-       
+        }
+
+
         //add item到select裡�?�
         //add item到select裡�?�
         //在傳itemtext時,用<span class="thistext"></span>包起�?顯示的 "文字"
         //在傳itemtext時,用<span class="thistext"></span>包起�?顯示的 "文字"
         //例如:<span class="thistext">哇哈哈</span>,這樣select�?�擇後,就會顯示 "哇哈哈"
         //例如:<span class="thistext">哇哈哈</span>,這樣select�?�擇後,就會顯示 "哇哈哈"
-        this.addItem = function(itemtext,itemvalue){            
-            
+        this.addItem = function(itemtext,itemvalue){
+
             var itemhtml='<div class="selectitem"><div class="selecttext">'+itemtext
             var itemhtml='<div class="selectitem"><div class="selecttext">'+itemtext
             +'</div><div class="selectvalue" style=" display:none;">'+itemvalue+'</div></div><div class="selectborder"><div>';
             +'</div><div class="selectvalue" style=" display:none;">'+itemvalue+'</div></div><div class="selectborder"><div>';
-            
-            $("#"+settings.id+'-selectshow').html($("#"+settings.id+'-selectshow').html()+itemhtml);           
-            
-            bindItemMouseover();             
+
+            $("#"+settings.id+'-selectshow').html($("#"+settings.id+'-selectshow').html()+itemhtml);
+
+            bindItemMouseover();
         };
         };
-        
+
         this.removeItem = function(index){
         this.removeItem = function(index){
             if($('.selectitem',$('#'+settings.id+'-selectshow')).length>index)
             if($('.selectitem',$('#'+settings.id+'-selectshow')).length>index)
             $($('.selectitem',$('#'+settings.id+'-selectshow')).get(index)).remove();
             $($('.selectitem',$('#'+settings.id+'-selectshow')).get(index)).remove();
             if($('.selectborder',$('#'+settings.id+'-selectshow')).length>index)
             if($('.selectborder',$('#'+settings.id+'-selectshow')).length>index)
             $($('.selectborder',$('#'+settings.id+'-selectshow')).get(index)).remove();
             $($('.selectborder',$('#'+settings.id+'-selectshow')).get(index)).remove();
         }
         }
-        
-        
-        
+
+
+
         this.getValue = function(){
         this.getValue = function(){
             return $('.valueshow',$('#'+settings.id+'-Text')).html();
             return $('.valueshow',$('#'+settings.id+'-Text')).html();
         }
         }
-        
+
         this.getText = function(){
         this.getText = function(){
             return $('.textshow',$('#'+settings.id+'-Text')).html();
             return $('.textshow',$('#'+settings.id+'-Text')).html();
         }
         }
-        
+
 
 
-        return this.each(_handler);     
+        return this.each(_handler);
     }
     }
 
 
   });
   });

+ 4 - 4
main/inc/lib/javascript/jquery.js

@@ -582,7 +582,7 @@ jQuery.extend = jQuery.fn.extend = function() {
 
 
 				// Recurse if we're merging object values
 				// Recurse if we're merging object values
 				if ( deep && copy && typeof copy == "object" && !copy.nodeType )
 				if ( deep && copy && typeof copy == "object" && !copy.nodeType )
-					target[ name ] = jQuery.extend( deep, 
+					target[ name ] = jQuery.extend( deep,
 						// Never move original objects, clone them
 						// Never move original objects, clone them
 						src || ( copy.length != null ? [ ] : { } )
 						src || ( copy.length != null ? [ ] : { } )
 					, copy );
 					, copy );
@@ -2882,7 +2882,7 @@ jQuery.extend({
 
 
 		if ( xml && data.documentElement.tagName == "parsererror" )
 		if ( xml && data.documentElement.tagName == "parsererror" )
 			throw "parsererror";
 			throw "parsererror";
-			
+
 		// Allow a pre-filtering function to sanitize the response
 		// Allow a pre-filtering function to sanitize the response
 		if( filter )
 		if( filter )
 			data = filter( data, type );
 			data = filter( data, type );
@@ -3469,7 +3469,7 @@ jQuery.fn.extend({
 			parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
 			parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
 
 
 			// Subtract element margins
 			// Subtract element margins
-			// note: when an element has margin: auto the offsetLeft and marginLeft 
+			// note: when an element has margin: auto the offsetLeft and marginLeft
 			// are the same in Safari causing offset.left to incorrectly be 0
 			// are the same in Safari causing offset.left to incorrectly be 0
 			offset.top  -= num( this, 'marginTop' );
 			offset.top  -= num( this, 'marginTop' );
 			offset.left -= num( this, 'marginLeft' );
 			offset.left -= num( this, 'marginLeft' );
@@ -3500,7 +3500,7 @@ jQuery.fn.extend({
 // Create scrollLeft and scrollTop methods
 // Create scrollLeft and scrollTop methods
 jQuery.each( ['Left', 'Top'], function(i, name) {
 jQuery.each( ['Left', 'Top'], function(i, name) {
 	var method = 'scroll' + name;
 	var method = 'scroll' + name;
-	
+
 	jQuery.fn[ method ] = function(val) {
 	jQuery.fn[ method ] = function(val) {
 		if (!this[0]) return;
 		if (!this[0]) return;
 
 

+ 2 - 2
main/inc/lib/javascript/jquery.tabs.js

@@ -470,7 +470,7 @@ $.fn.tabs = function(initial, settings) {
                 if (!$.browser.msie) { // not in IE to prevent ClearType font issue
                 if (!$.browser.msie) { // not in IE to prevent ClearType font issue
                     resetCSS['opacity'] = '';
                     resetCSS['opacity'] = '';
                 }
                 }
-                
+
                 // switch tab, animation prevents browser scrolling to the fragment
                 // switch tab, animation prevents browser scrolling to the fragment
                 function switchTab() {
                 function switchTab() {
                     if (settings.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
                     if (settings.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
@@ -478,7 +478,7 @@ $.fn.tabs = function(initial, settings) {
                     }
                     }
                     toHide.animate(hideAnim, hideSpeed, function() { //
                     toHide.animate(hideAnim, hideSpeed, function() { //
                         $(clicked).parents('li:eq(0)').addClass(settings.selectedClass).siblings().removeClass(settings.selectedClass);
                         $(clicked).parents('li:eq(0)').addClass(settings.selectedClass).siblings().removeClass(settings.selectedClass);
-                        toHide.addClass(settings.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.                        
+                        toHide.addClass(settings.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
                         if (typeof onHide == 'function') {
                         if (typeof onHide == 'function') {
                             onHide(clicked, toShow[0], toHide[0]);
                             onHide(clicked, toShow[0], toHide[0]);
                         }
                         }

+ 51 - 51
main/inc/lib/javascript/thickbox.js

@@ -4,13 +4,13 @@
  * Copyright (c) 2007 cody lindley
  * Copyright (c) 2007 cody lindley
  * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
  * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 */
 */
-		  
+
 var tb_pathToImage = "main/img/loadingAnimation.gif";
 var tb_pathToImage = "main/img/loadingAnimation.gif";
 
 
 /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
 /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
 
 
 //on page load call tb_init
 //on page load call tb_init
-$(document).ready(function(){   
+$(document).ready(function(){
 	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
 	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
 	imgLoader = new Image();// preload image
 	imgLoader = new Image();// preload image
 	imgLoader.src = tb_pathToImage;
 	imgLoader.src = tb_pathToImage;
@@ -18,7 +18,7 @@ $(document).ready(function(){
 //
 //
 function load_thick (hrefinfo,textinfo) {
 function load_thick (hrefinfo,textinfo) {
     imgLoader = new Image();// preload image
     imgLoader = new Image();// preload image
-    imgLoader.src = tb_pathToImage;	
+    imgLoader.src = tb_pathToImage;
 	name_user=textinfo.replace(/\+/g," ");
 	name_user=textinfo.replace(/\+/g," ");
     tb_show(name_user,hrefinfo, '');
     tb_show(name_user,hrefinfo, '');
 }
 }
@@ -50,29 +50,29 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 				$("#TB_overlay").click(tb_remove);
 				$("#TB_overlay").click(tb_remove);
 			}
 			}
 		}
 		}
-		
+
 		if(tb_detectMacXFF()){
 		if(tb_detectMacXFF()){
 			$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
 			$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
 		}else{
 		}else{
 			$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
 			$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
 		}
 		}
-		
+
 		if(caption===null){caption="";}
 		if(caption===null){caption="";}
 		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
 		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
 		$('#TB_load').show();//show loader
 		$('#TB_load').show();//show loader
-		
+
 		var baseURL;
 		var baseURL;
 	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
 	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
 			baseURL = url.substr(0, url.indexOf("?"));
 			baseURL = url.substr(0, url.indexOf("?"));
-	   }else{ 
+	   }else{
 	   		baseURL = url;
 	   		baseURL = url;
 	   }
 	   }
-	   
+
 	   var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
 	   var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
 	   var urlType = baseURL.toLowerCase().match(urlString);
 	   var urlType = baseURL.toLowerCase().match(urlString);
 
 
 		if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
 		if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
-				
+
 			TB_PrevCaption = "";
 			TB_PrevCaption = "";
 			TB_PrevURL = "";
 			TB_PrevURL = "";
 			TB_PrevHTML = "";
 			TB_PrevHTML = "";
@@ -85,7 +85,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 				TB_TempArray = $("a[@rel="+imageGroup+"]").get();
 				TB_TempArray = $("a[@rel="+imageGroup+"]").get();
 				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
 				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
 					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
 					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
-						if (!(TB_TempArray[TB_Counter].href == url)) {						
+						if (!(TB_TempArray[TB_Counter].href == url)) {
 							if (TB_FoundURL) {
 							if (TB_FoundURL) {
 								TB_NextCaption = TB_TempArray[TB_Counter].title;
 								TB_NextCaption = TB_TempArray[TB_Counter].title;
 								TB_NextURL = TB_TempArray[TB_Counter].href;
 								TB_NextURL = TB_TempArray[TB_Counter].href;
@@ -97,15 +97,15 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 							}
 							}
 						} else {
 						} else {
 							TB_FoundURL = true;
 							TB_FoundURL = true;
-							TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);											
+							TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);
 						}
 						}
 				}
 				}
 			}
 			}
 
 
 			imgPreloader = new Image();
 			imgPreloader = new Image();
-			imgPreloader.onload = function(){		
+			imgPreloader.onload = function(){
 			imgPreloader.onload = null;
 			imgPreloader.onload = null;
-				
+
 			// Resizing large images - orginal by Christian Montoya edited by me.
 			// Resizing large images - orginal by Christian Montoya edited by me.
 			var pagesize = tb_getPageSize();
 			var pagesize = tb_getPageSize();
 			var x = pagesize[0] - 150;
 			var x = pagesize[0] - 150;
@@ -113,51 +113,51 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 			var imageWidth = imgPreloader.width;
 			var imageWidth = imgPreloader.width;
 			var imageHeight = imgPreloader.height;
 			var imageHeight = imgPreloader.height;
 			if (imageWidth > x) {
 			if (imageWidth > x) {
-				imageHeight = imageHeight * (x / imageWidth); 
-				imageWidth = x; 
-				if (imageHeight > y) { 
-					imageWidth = imageWidth * (y / imageHeight); 
-					imageHeight = y; 
+				imageHeight = imageHeight * (x / imageWidth);
+				imageWidth = x;
+				if (imageHeight > y) {
+					imageWidth = imageWidth * (y / imageHeight);
+					imageHeight = y;
 				}
 				}
-			} else if (imageHeight > y) { 
-				imageWidth = imageWidth * (y / imageHeight); 
-				imageHeight = y; 
-				if (imageWidth > x) { 
-					imageHeight = imageHeight * (x / imageWidth); 
+			} else if (imageHeight > y) {
+				imageWidth = imageWidth * (y / imageHeight);
+				imageHeight = y;
+				if (imageWidth > x) {
+					imageHeight = imageHeight * (x / imageWidth);
 					imageWidth = x;
 					imageWidth = x;
 				}
 				}
 			}
 			}
 			// End Resizing
 			// End Resizing
-			
+
 			TB_WIDTH = imageWidth + 30;
 			TB_WIDTH = imageWidth + 30;
 			TB_HEIGHT = imageHeight + 60;
 			TB_HEIGHT = imageHeight + 60;
-			$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>"); 		
-			
+			$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");
+
 			$("#TB_closeWindowButton").click(tb_remove);
 			$("#TB_closeWindowButton").click(tb_remove);
-			
+
 			if (!(TB_PrevHTML === "")) {
 			if (!(TB_PrevHTML === "")) {
 				function goPrev(){
 				function goPrev(){
 					if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
 					if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
 					$("#TB_window").remove();
 					$("#TB_window").remove();
 					$("body").append("<div id='TB_window'></div>");
 					$("body").append("<div id='TB_window'></div>");
 					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
 					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
-					return false;	
+					return false;
 				}
 				}
 				$("#TB_prev").click(goPrev);
 				$("#TB_prev").click(goPrev);
 			}
 			}
-			
-			if (!(TB_NextHTML === "")) {		
+
+			if (!(TB_NextHTML === "")) {
 				function goNext(){
 				function goNext(){
 					$("#TB_window").remove();
 					$("#TB_window").remove();
 					$("body").append("<div id='TB_window'></div>");
 					$("body").append("<div id='TB_window'></div>");
-					tb_show(TB_NextCaption, TB_NextURL, imageGroup);				
-					return false;	
+					tb_show(TB_NextCaption, TB_NextURL, imageGroup);
+					return false;
 				}
 				}
 				$("#TB_next").click(goNext);
 				$("#TB_next").click(goNext);
-				
+
 			}
 			}
 
 
-			document.onkeydown = function(e){ 	
+			document.onkeydown = function(e){
 				if (e == null) { // ie
 				if (e == null) { // ie
 					keycode = event.keyCode;
 					keycode = event.keyCode;
 				} else { // mozilla
 				} else { // mozilla
@@ -175,18 +175,18 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 						document.onkeydown = "";
 						document.onkeydown = "";
 						goPrev();
 						goPrev();
 					}
 					}
-				}	
+				}
 			};
 			};
-			
+
 			tb_position();
 			tb_position();
 			$("#TB_load").remove();
 			$("#TB_load").remove();
 			$("#TB_ImageOff").click(tb_remove);
 			$("#TB_ImageOff").click(tb_remove);
 			$("#TB_window").css({display:"block"}); //for safari using css instead of show
 			$("#TB_window").css({display:"block"}); //for safari using css instead of show
 			};
 			};
-			
+
 			imgPreloader.src = url;
 			imgPreloader.src = url;
 		}else{//code to show html
 		}else{//code to show html
-			
+
 			var queryString = url.replace(/^[^\?]+\??/,'');
 			var queryString = url.replace(/^[^\?]+\??/,'');
 			var params = tb_parseQuery( queryString );
 			var params = tb_parseQuery( queryString );
 
 
@@ -194,8 +194,8 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
 			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
 			ajaxContentW = TB_WIDTH - 30;
 			ajaxContentW = TB_WIDTH - 30;
 			ajaxContentH = TB_HEIGHT - 45;
 			ajaxContentH = TB_HEIGHT - 45;
-			
-			if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window		
+
+			if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window
 					urlNoQuery = url.split('TB_');
 					urlNoQuery = url.split('TB_');
 					$("#TB_iframeContent").remove();
 					$("#TB_iframeContent").remove();
 					if(params['modal'] != "true"){//iframe no modal
 					if(params['modal'] != "true"){//iframe no modal
@@ -210,7 +210,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
 						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
 						}else{//ajax modal
 						}else{//ajax modal
 						$("#TB_overlay").unbind();
 						$("#TB_overlay").unbind();
-						$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");	
+						$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
 						}
 						}
 					}else{//this means the window is already up, we are just loading new content via ajax
 					}else{//this means the window is already up, we are just loading new content via ajax
 						$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
 						$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
@@ -219,17 +219,17 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 						$("#TB_ajaxWindowTitle").html(caption);
 						$("#TB_ajaxWindowTitle").html(caption);
 					}
 					}
 			}
 			}
-					
+
 			$("#TB_closeWindowButton").click(tb_remove);
 			$("#TB_closeWindowButton").click(tb_remove);
-			
-				if(url.indexOf('TB_inline') != -1){	
+
+				if(url.indexOf('TB_inline') != -1){
 					$("#TB_ajaxContent").append($('#' + params['inlineId']).children());
 					$("#TB_ajaxContent").append($('#' + params['inlineId']).children());
 					$("#TB_window").unload(function () {
 					$("#TB_window").unload(function () {
 						$('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
 						$('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
 					});
 					});
 					tb_position();
 					tb_position();
 					$("#TB_load").remove();
 					$("#TB_load").remove();
-					$("#TB_window").css({display:"block"}); 
+					$("#TB_window").css({display:"block"});
 				}else if(url.indexOf('TB_iframe') != -1){
 				}else if(url.indexOf('TB_iframe') != -1){
 					tb_position();
 					tb_position();
 					if($.browser.safari){//safari needs help because it will not fire iframe onload
 					if($.browser.safari){//safari needs help because it will not fire iframe onload
@@ -244,11 +244,11 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 						$("#TB_window").css({display:"block"});
 						$("#TB_window").css({display:"block"});
 					});
 					});
 				}
 				}
-			
+
 		}
 		}
 
 
 		if(!params['modal']){
 		if(!params['modal']){
-			document.onkeyup = function(e){ 	
+			document.onkeyup = function(e){
 				if (e == null) { // ie
 				if (e == null) { // ie
 					keycode = event.keyCode;
 					keycode = event.keyCode;
 				} else { // mozilla
 				} else { // mozilla
@@ -256,10 +256,10 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
 				}
 				}
 				if(keycode == 27){ // close
 				if(keycode == 27){ // close
 					tb_remove();
 					tb_remove();
-				}	
+				}
 			};
 			};
 		}
 		}
-		
+
 	} catch(e) {
 	} catch(e) {
 		//nothing here
 		//nothing here
 	}
 	}
@@ -325,10 +325,10 @@ function tb_detectMacXFF() {
 function TB_special(pi_href){
 function TB_special(pi_href){
 	// get caption: either title or name attribute
 	// get caption: either title or name attribute
 	var caption = this.title || this.name || "";
 	var caption = this.title || this.name || "";
-		
+
 	// get rel attribute for image groups
 	// get rel attribute for image groups
 	var group = this.rel || false;
 	var group = this.rel || false;
-		
+
 	// display the box for the elements href
 	// display the box for the elements href
 	TB_show(caption, pi_href, group);
 	TB_show(caption, pi_href, group);
 }
 }

+ 8 - 8
main/inc/lib/javascript/upload.js

@@ -6,10 +6,10 @@
  * Upload class. Used to pack functions into one practical object.
  * Upload class. Used to pack functions into one practical object.
  * Call like this: var myUpload = new upload(5);
  * Call like this: var myUpload = new upload(5);
  */
  */
-function upload(latency){ 
+function upload(latency){
 	/**
 	/**
 	 * Starts the timer
 	 * Starts the timer
-	 * Call like this: 
+	 * Call like this:
 	 * @param	string	Name of the DOM element we need to update
 	 * @param	string	Name of the DOM element we need to update
 	 * @param	string	Loading image to display
 	 * @param	string	Loading image to display
 	 * @return	true
 	 * @return	true
@@ -21,7 +21,7 @@ function upload(latency){
 		__progress_bar_interval = setTimeout(__display_progress_bar,latency,__progress_bar_text);
 		__progress_bar_interval = setTimeout(__display_progress_bar,latency,__progress_bar_text);
 		__upload_form_domid  = formid;
 		__upload_form_domid  = formid;
 	}
 	}
-	
+
 	/**
 	/**
 	 * Starts the timer of the real upload progress
 	 * Starts the timer of the real upload progress
 	 */
 	 */
@@ -30,22 +30,22 @@ function upload(latency){
 		__progress_bar_uploadid = upload_id;
 		__progress_bar_uploadid = upload_id;
 		__progress_bar_waitAfterUpload = waitAfterUpload;
 		__progress_bar_waitAfterUpload = waitAfterUpload;
 		__upload_form_domid  = formid;
 		__upload_form_domid  = formid;
-		__progress_bar_interval = setInterval(__refreshUpload,latency);		
+		__progress_bar_interval = setInterval(__refreshUpload,latency);
 		document.getElementById(domid+'_container').style.display = 'block';
 		document.getElementById(domid+'_container').style.display = 'block';
 		if(waitAfterUpload){
 		if(waitAfterUpload){
 			document.getElementById(domid+'_waiter_container').style.display = 'block';
 			document.getElementById(domid+'_waiter_container').style.display = 'block';
 		}
 		}
-		
-		
+
+
 	}
 	}
-	
+
 	/**
 	/**
 	 * Function called by a timer to update every x seconds the progress bar
 	 * Function called by a timer to update every x seconds the progress bar
 	 */
 	 */
 	function __refreshUpload(){
 	function __refreshUpload(){
 		xajax_updateProgress(__progress_bar_domid, __progress_bar_uploadid, __progress_bar_waitAfterUpload);
 		xajax_updateProgress(__progress_bar_domid, __progress_bar_uploadid, __progress_bar_waitAfterUpload);
 	}
 	}
-	
+
 	/**
 	/**
 	 * Displays the progress bar in the given DOM element
 	 * Displays the progress bar in the given DOM element
 	 */
 	 */

File diff suppressed because it is too large
+ 0 - 0
main/inc/lib/mediaplayer/swfobject.js


File diff suppressed because it is too large
+ 0 - 0
main/inc/lib/swfobject/swfobject.js


+ 64 - 64
main/inc/lib/swfobject/swfobject_source/swfobject_source.js

@@ -22,22 +22,22 @@
  * production scripts are merged.
  * production scripts are merged.
  *
  *
  * Links:
  * Links:
- * http://blog.deconcept.com/swfobject/ 
+ * http://blog.deconcept.com/swfobject/
  * http://code.google.com/p/swfobject/
  * http://code.google.com/p/swfobject/
  *
  *
  * License:
  * License:
  * The MIT License - http://www.opensource.org/licenses/mit-license.php
  * The MIT License - http://www.opensource.org/licenses/mit-license.php
  *
  *
- * Authors:   
+ * Authors:
  * (c) 2007 Geoff Stearns (SWFObject 1.5)
  * (c) 2007 Geoff Stearns (SWFObject 1.5)
  * For SWFObject 2.2, a list of the authors may be seen at:
  * For SWFObject 2.2, a list of the authors may be seen at:
- * http://code.google.com/p/swfobject/people/list 
+ * http://code.google.com/p/swfobject/people/list
  *
  *
  * This hybrid solution has been prepared by Ivan Tcholakov, July 2009.
  * This hybrid solution has been prepared by Ivan Tcholakov, July 2009.
  *
  *
  */
  */
 
 
- 
+
 /******************************************************************************/
 /******************************************************************************/
 
 
 
 
@@ -279,12 +279,12 @@ var SWFObject = deconcept.SWFObject;
 /******************************************************************************/
 /******************************************************************************/
 
 
 
 
-/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
-	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/>
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
 */
 */
 
 
 var swfobject = function() {
 var swfobject = function() {
-	
+
 	var UNDEF = "undefined",
 	var UNDEF = "undefined",
 		OBJECT = "object",
 		OBJECT = "object",
 		SHOCKWAVE_FLASH = "Shockwave Flash",
 		SHOCKWAVE_FLASH = "Shockwave Flash",
@@ -292,11 +292,11 @@ var swfobject = function() {
 		FLASH_MIME_TYPE = "application/x-shockwave-flash",
 		FLASH_MIME_TYPE = "application/x-shockwave-flash",
 		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
 		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
 		ON_READY_STATE_CHANGE = "onreadystatechange",
 		ON_READY_STATE_CHANGE = "onreadystatechange",
-		
+
 		win = window,
 		win = window,
 		doc = document,
 		doc = document,
 		nav = navigator,
 		nav = navigator,
-		
+
 		plugin = false,
 		plugin = false,
 		domLoadFnArr = [main],
 		domLoadFnArr = [main],
 		regObjArr = [],
 		regObjArr = [],
@@ -311,11 +311,11 @@ var swfobject = function() {
 		dynamicStylesheet,
 		dynamicStylesheet,
 		dynamicStylesheetMedia,
 		dynamicStylesheetMedia,
 		autoHideShow = true,
 		autoHideShow = true,
-	
+
 	/* Centralized function for browser feature detection
 	/* Centralized function for browser feature detection
 		- User agent string detection is only used when no good alternative is possible
 		- User agent string detection is only used when no good alternative is possible
 		- Is executed directly for optimal performance
 		- Is executed directly for optimal performance
-	*/	
+	*/
 	ua = function() {
 	ua = function() {
 		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
 		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
 			u = nav.userAgent.toLowerCase(),
 			u = nav.userAgent.toLowerCase(),
@@ -353,21 +353,21 @@ var swfobject = function() {
 		}
 		}
 		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
 		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
 	}(),
 	}(),
-	
+
 	/* Cross-browser onDomLoad
 	/* Cross-browser onDomLoad
 		- Will fire an event as soon as the DOM of a web page is loaded
 		- Will fire an event as soon as the DOM of a web page is loaded
 		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
 		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
 		- Regular onload serves as fallback
 		- Regular onload serves as fallback
-	*/ 
+	*/
 	onDomLoad = function() {
 	onDomLoad = function() {
 		if (!ua.w3) { return; }
 		if (!ua.w3) { return; }
-		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
 			callDomLoadFunctions();
 			callDomLoadFunctions();
 		}
 		}
 		if (!isDomLoaded) {
 		if (!isDomLoaded) {
 			if (typeof doc.addEventListener != UNDEF) {
 			if (typeof doc.addEventListener != UNDEF) {
 				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
 				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
-			}		
+			}
 			if (ua.ie && ua.win) {
 			if (ua.ie && ua.win) {
 				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
 				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
 					if (doc.readyState == "complete") {
 					if (doc.readyState == "complete") {
@@ -402,7 +402,7 @@ var swfobject = function() {
 			addLoadEvent(callDomLoadFunctions);
 			addLoadEvent(callDomLoadFunctions);
 		}
 		}
 	}();
 	}();
-	
+
 	function callDomLoadFunctions() {
 	function callDomLoadFunctions() {
 		if (isDomLoaded) { return; }
 		if (isDomLoaded) { return; }
 		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
 		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
@@ -416,19 +416,19 @@ var swfobject = function() {
 			domLoadFnArr[i]();
 			domLoadFnArr[i]();
 		}
 		}
 	}
 	}
-	
+
 	function addDomLoadEvent(fn) {
 	function addDomLoadEvent(fn) {
 		if (isDomLoaded) {
 		if (isDomLoaded) {
 			fn();
 			fn();
 		}
 		}
-		else { 
+		else {
 			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
 			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
 		}
 		}
 	}
 	}
-	
+
 	/* Cross-browser onload
 	/* Cross-browser onload
 		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
 		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
-		- Will fire an event as soon as a web page including all of its assets are loaded 
+		- Will fire an event as soon as a web page including all of its assets are loaded
 	 */
 	 */
 	function addLoadEvent(fn) {
 	function addLoadEvent(fn) {
 		if (typeof win.addEventListener != UNDEF) {
 		if (typeof win.addEventListener != UNDEF) {
@@ -451,11 +451,11 @@ var swfobject = function() {
 			win.onload = fn;
 			win.onload = fn;
 		}
 		}
 	}
 	}
-	
+
 	/* Main function
 	/* Main function
 		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
 		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
 	*/
 	*/
-	function main() { 
+	function main() {
 		if (plugin) {
 		if (plugin) {
 			testPlayerVersion();
 			testPlayerVersion();
 		}
 		}
@@ -463,7 +463,7 @@ var swfobject = function() {
 			matchVersions();
 			matchVersions();
 		}
 		}
 	}
 	}
-	
+
 	/* Detect the Flash Player version for non-Internet Explorer browsers
 	/* Detect the Flash Player version for non-Internet Explorer browsers
 		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
 		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
 		  a. Both release and build numbers can be detected
 		  a. Both release and build numbers can be detected
@@ -500,7 +500,7 @@ var swfobject = function() {
 			matchVersions();
 			matchVersions();
 		}
 		}
 	}
 	}
-	
+
 	/* Perform Flash Player and SWF version matching; static publishing only
 	/* Perform Flash Player and SWF version matching; static publishing only
 	*/
 	*/
 	function matchVersions() {
 	function matchVersions() {
@@ -549,7 +549,7 @@ var swfobject = function() {
 					setVisibility(id, true);
 					setVisibility(id, true);
 					if (cb) {
 					if (cb) {
 						var o = getObjectById(id); // test whether there is an HTML object element or not
 						var o = getObjectById(id); // test whether there is an HTML object element or not
-						if (o && typeof o.SetVariable != UNDEF) { 
+						if (o && typeof o.SetVariable != UNDEF) {
 							cbObj.success = true;
 							cbObj.success = true;
 							cbObj.ref = o;
 							cbObj.ref = o;
 						}
 						}
@@ -559,7 +559,7 @@ var swfobject = function() {
 			}
 			}
 		}
 		}
 	}
 	}
-	
+
 	function getObjectById(objectIdStr) {
 	function getObjectById(objectIdStr) {
 		var r = null;
 		var r = null;
 		var o = getElementById(objectIdStr);
 		var o = getElementById(objectIdStr);
@@ -576,7 +576,7 @@ var swfobject = function() {
 		}
 		}
 		return r;
 		return r;
 	}
 	}
-	
+
 	/* Requirements for Adobe Express Install
 	/* Requirements for Adobe Express Install
 		- only one instance can be active at a time
 		- only one instance can be active at a time
 		- fp 6.0.65 or higher
 		- fp 6.0.65 or higher
@@ -586,7 +586,7 @@ var swfobject = function() {
 	function canExpressInstall() {
 	function canExpressInstall() {
 		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
 		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
 	}
 	}
-	
+
 	/* Show the Adobe Express Install dialog
 	/* Show the Adobe Express Install dialog
 		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
 		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
 	*/
 	*/
@@ -636,7 +636,7 @@ var swfobject = function() {
 			createSWF(att, par, replaceElemIdStr);
 			createSWF(att, par, replaceElemIdStr);
 		}
 		}
 	}
 	}
-	
+
 	/* Functions to abstract and display alternative content
 	/* Functions to abstract and display alternative content
 	*/
 	*/
 	function displayAltContent(obj) {
 	function displayAltContent(obj) {
@@ -659,7 +659,7 @@ var swfobject = function() {
 		else {
 		else {
 			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
 			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
 		}
 		}
-	} 
+	}
 
 
 	function abstractAltContent(obj) {
 	function abstractAltContent(obj) {
 		var ac = createElement("div");
 		var ac = createElement("div");
@@ -682,7 +682,7 @@ var swfobject = function() {
 		}
 		}
 		return ac;
 		return ac;
 	}
 	}
-	
+
 	/* Cross-browser dynamic SWF creation
 	/* Cross-browser dynamic SWF creation
 	*/
 	*/
 	function createSWF(attObj, parObj, id) {
 	function createSWF(attObj, parObj, id) {
@@ -715,7 +715,7 @@ var swfobject = function() {
 				}
 				}
 				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
 				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
 				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
 				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
-				r = getElementById(attObj.id);	
+				r = getElementById(attObj.id);
 			}
 			}
 			else { // well-behaving browsers
 			else { // well-behaving browsers
 				var o = createElement(OBJECT);
 				var o = createElement(OBJECT);
@@ -741,14 +741,14 @@ var swfobject = function() {
 		}
 		}
 		return r;
 		return r;
 	}
 	}
-	
+
 	function createObjParam(el, pName, pValue) {
 	function createObjParam(el, pName, pValue) {
 		var p = createElement("param");
 		var p = createElement("param");
-		p.setAttribute("name", pName);	
+		p.setAttribute("name", pName);
 		p.setAttribute("value", pValue);
 		p.setAttribute("value", pValue);
 		el.appendChild(p);
 		el.appendChild(p);
 	}
 	}
-	
+
 	/* Cross-browser SWF removal
 	/* Cross-browser SWF removal
 		- Especially needed to safely and completely remove a SWF in Internet Explorer
 		- Especially needed to safely and completely remove a SWF in Internet Explorer
 	*/
 	*/
@@ -771,7 +771,7 @@ var swfobject = function() {
 			}
 			}
 		}
 		}
 	}
 	}
-	
+
 	function removeObjectInIE(id) {
 	function removeObjectInIE(id) {
 		var obj = getElementById(id);
 		var obj = getElementById(id);
 		if (obj) {
 		if (obj) {
@@ -783,7 +783,7 @@ var swfobject = function() {
 			obj.parentNode.removeChild(obj);
 			obj.parentNode.removeChild(obj);
 		}
 		}
 	}
 	}
-	
+
 	/* Functions to optimize JavaScript compression
 	/* Functions to optimize JavaScript compression
 	*/
 	*/
 	function getElementById(id) {
 	function getElementById(id) {
@@ -794,19 +794,19 @@ var swfobject = function() {
 		catch (e) {}
 		catch (e) {}
 		return el;
 		return el;
 	}
 	}
-	
+
 	function createElement(el) {
 	function createElement(el) {
 		return doc.createElement(el);
 		return doc.createElement(el);
 	}
 	}
-	
+
 	/* Updated attachEvent function for Internet Explorer
 	/* Updated attachEvent function for Internet Explorer
 		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
 		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
-	*/	
+	*/
 	function addListener(target, eventType, fn) {
 	function addListener(target, eventType, fn) {
 		target.attachEvent(eventType, fn);
 		target.attachEvent(eventType, fn);
 		listenersArr[listenersArr.length] = [target, eventType, fn];
 		listenersArr[listenersArr.length] = [target, eventType, fn];
 	}
 	}
-	
+
 	/* Flash Player and SWF content version matching
 	/* Flash Player and SWF content version matching
 	*/
 	*/
 	function hasPlayerVersion(rv) {
 	function hasPlayerVersion(rv) {
@@ -816,10 +816,10 @@ var swfobject = function() {
 		v[2] = parseInt(v[2], 10) || 0;
 		v[2] = parseInt(v[2], 10) || 0;
 		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
 		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
 	}
 	}
-	
+
 	/* Cross-browser dynamic CSS creation
 	/* Cross-browser dynamic CSS creation
 		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
 		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
-	*/	
+	*/
 	function createCSS(sel, decl, media, newStyle) {
 	function createCSS(sel, decl, media, newStyle) {
 		if (ua.ie && ua.mac) { return; }
 		if (ua.ie && ua.mac) { return; }
 		var h = doc.getElementsByTagName("head")[0];
 		var h = doc.getElementsByTagName("head")[0];
@@ -829,7 +829,7 @@ var swfobject = function() {
 			dynamicStylesheet = null;
 			dynamicStylesheet = null;
 			dynamicStylesheetMedia = null;
 			dynamicStylesheetMedia = null;
 		}
 		}
-		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
 			// create dynamic stylesheet + get a global reference to it
 			// create dynamic stylesheet + get a global reference to it
 			var s = createElement("style");
 			var s = createElement("style");
 			s.setAttribute("type", "text/css");
 			s.setAttribute("type", "text/css");
@@ -852,7 +852,7 @@ var swfobject = function() {
 			}
 			}
 		}
 		}
 	}
 	}
-	
+
 	function setVisibility(id, isVisible) {
 	function setVisibility(id, isVisible) {
 		if (!autoHideShow) { return; }
 		if (!autoHideShow) { return; }
 		var v = isVisible ? "visible" : "hidden";
 		var v = isVisible ? "visible" : "hidden";
@@ -871,7 +871,7 @@ var swfobject = function() {
 		var hasBadChars = regex.exec(s) != null;
 		var hasBadChars = regex.exec(s) != null;
 		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
 		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
 	}
 	}
-	
+
 	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
 	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
 	*/
 	*/
 	var cleanup = function() {
 	var cleanup = function() {
@@ -899,11 +899,11 @@ var swfobject = function() {
 			});
 			});
 		}
 		}
 	}();
 	}();
-	
+
 	return {
 	return {
 		/* Public API
 		/* Public API
 			- Reference: http://code.google.com/p/swfobject/wiki/documentation
 			- Reference: http://code.google.com/p/swfobject/wiki/documentation
-		*/ 
+		*/
 		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
 		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
 			if (ua.w3 && objectIdStr && swfVersionStr) {
 			if (ua.w3 && objectIdStr && swfVersionStr) {
 				var regObj = {};
 				var regObj = {};
@@ -918,13 +918,13 @@ var swfobject = function() {
 				callbackFn({success:false, id:objectIdStr});
 				callbackFn({success:false, id:objectIdStr});
 			}
 			}
 		},
 		},
-		
+
 		getObjectById: function(objectIdStr) {
 		getObjectById: function(objectIdStr) {
 			if (ua.w3) {
 			if (ua.w3) {
 				return getObjectById(objectIdStr);
 				return getObjectById(objectIdStr);
 			}
 			}
 		},
 		},
-		
+
 		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
 		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
 			var callbackObj = {success:false, id:replaceElemIdStr};
 			var callbackObj = {success:false, id:replaceElemIdStr};
 			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
 			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
@@ -941,7 +941,7 @@ var swfobject = function() {
 					att.data = swfUrlStr;
 					att.data = swfUrlStr;
 					att.width = widthStr;
 					att.width = widthStr;
 					att.height = heightStr;
 					att.height = heightStr;
-					var par = {}; 
+					var par = {};
 					if (parObj && typeof parObj === OBJECT) {
 					if (parObj && typeof parObj === OBJECT) {
 						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
 						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
 							par[j] = parObj[j];
 							par[j] = parObj[j];
@@ -978,19 +978,19 @@ var swfobject = function() {
 			}
 			}
 			else if (callbackFn) { callbackFn(callbackObj);	}
 			else if (callbackFn) { callbackFn(callbackObj);	}
 		},
 		},
-		
+
 		switchOffAutoHideShow: function() {
 		switchOffAutoHideShow: function() {
 			autoHideShow = false;
 			autoHideShow = false;
 		},
 		},
-		
+
 		ua: ua,
 		ua: ua,
-		
+
 		getFlashPlayerVersion: function() {
 		getFlashPlayerVersion: function() {
 			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
 			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
 		},
 		},
-		
+
 		hasFlashPlayerVersion: hasPlayerVersion,
 		hasFlashPlayerVersion: hasPlayerVersion,
-		
+
 		createSWF: function(attObj, parObj, replaceElemIdStr) {
 		createSWF: function(attObj, parObj, replaceElemIdStr) {
 			if (ua.w3) {
 			if (ua.w3) {
 				return createSWF(attObj, parObj, replaceElemIdStr);
 				return createSWF(attObj, parObj, replaceElemIdStr);
@@ -999,29 +999,29 @@ var swfobject = function() {
 				return undefined;
 				return undefined;
 			}
 			}
 		},
 		},
-		
+
 		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
 		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
 			if (ua.w3 && canExpressInstall()) {
 			if (ua.w3 && canExpressInstall()) {
 				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
 				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
 			}
 			}
 		},
 		},
-		
+
 		removeSWF: function(objElemIdStr) {
 		removeSWF: function(objElemIdStr) {
 			if (ua.w3) {
 			if (ua.w3) {
 				removeSWF(objElemIdStr);
 				removeSWF(objElemIdStr);
 			}
 			}
 		},
 		},
-		
+
 		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
 		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
 			if (ua.w3) {
 			if (ua.w3) {
 				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
 				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
 			}
 			}
 		},
 		},
-		
+
 		addDomLoadEvent: addDomLoadEvent,
 		addDomLoadEvent: addDomLoadEvent,
-		
+
 		addLoadEvent: addLoadEvent,
 		addLoadEvent: addLoadEvent,
-		
+
 		getQueryParamValue: function(param) {
 		getQueryParamValue: function(param) {
 			var q = doc.location.search || doc.location.hash;
 			var q = doc.location.search || doc.location.hash;
 			if (q) {
 			if (q) {
@@ -1038,7 +1038,7 @@ var swfobject = function() {
 			}
 			}
 			return "";
 			return "";
 		},
 		},
-		
+
 		// For internal usage only
 		// For internal usage only
 		expressInstallCallback: function() {
 		expressInstallCallback: function() {
 			if (isExpressInstallActive) {
 			if (isExpressInstallActive) {
@@ -1052,7 +1052,7 @@ var swfobject = function() {
 					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
 					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
 				}
 				}
 				isExpressInstallActive = false;
 				isExpressInstallActive = false;
-			} 
+			}
 		}
 		}
 	};
 	};
 }();
 }();

+ 46 - 46
main/inc/lib/xajax/xajax_js/xajax_uncompressed.js

@@ -27,11 +27,11 @@ function Xajax()
 			alert("Xajax Debug:\n " + text);
 			alert("Xajax Debug:\n " + text);
 		}
 		}
 	};
 	};
-	
+
 	this.workId = 'xajaxWork'+ new Date().getTime();
 	this.workId = 'xajaxWork'+ new Date().getTime();
 	this.depth = 0;
 	this.depth = 0;
 	this.responseErrorsForAlert = ["400","401","402","403","404","500","501","502","503"];
 	this.responseErrorsForAlert = ["400","401","402","403","404","500","501","502","503"];
-	
+
 	//Get the XMLHttpRequest Object
 	//Get the XMLHttpRequest Object
 	this.getRequestObject = function()
 	this.getRequestObject = function()
 	{
 	{
@@ -65,9 +65,9 @@ function Xajax()
 		}
 		}
 		if(!req && window.createRequest)
 		if(!req && window.createRequest)
 			req = window.createRequest();
 			req = window.createRequest();
-		
+
 		if (!req) this.DebugMessage("Request Object Instantiation failed.");
 		if (!req) this.DebugMessage("Request Object Instantiation failed.");
-			
+
 		return req;
 		return req;
 	}
 	}
 
 
@@ -86,7 +86,7 @@ function Xajax()
 		}
 		}
 		return returnObj;
 		return returnObj;
 	}
 	}
-	
+
 	// xajax.include(sFileName) dynamically includes an external javascript file
 	// xajax.include(sFileName) dynamically includes an external javascript file
 	this.include = function(sFileName)
 	this.include = function(sFileName)
 	{
 	{
@@ -96,7 +96,7 @@ function Xajax()
 		objScript.src = sFileName;
 		objScript.src = sFileName;
 		objHead[0].appendChild(objScript);
 		objHead[0].appendChild(objScript);
 	}
 	}
-	
+
 	this.stripOnPrefix = function(sEventName)
 	this.stripOnPrefix = function(sEventName)
 	{
 	{
 		sEventName = sEventName.toLowerCase();
 		sEventName = sEventName.toLowerCase();
@@ -104,10 +104,10 @@ function Xajax()
 		{
 		{
 			sEventName = sEventName.replace(/on/,'');
 			sEventName = sEventName.replace(/on/,'');
 		}
 		}
-		
+
 		return sEventName;
 		return sEventName;
 	}
 	}
-	
+
 	this.addOnPrefix = function(sEventName)
 	this.addOnPrefix = function(sEventName)
 	{
 	{
 		sEventName = sEventName.toLowerCase();
 		sEventName = sEventName.toLowerCase();
@@ -115,10 +115,10 @@ function Xajax()
 		{
 		{
 			sEventName = 'on' + sEventName;
 			sEventName = 'on' + sEventName;
 		}
 		}
-		
+
 		return sEventName;
 		return sEventName;
 	}
 	}
-	
+
 	// xajax.addHandler adds an event handler to an element
 	// xajax.addHandler adds an event handler to an element
 	this.addHandler = function(sElementId, sEvent, sFunctionName)
 	this.addHandler = function(sElementId, sEvent, sFunctionName)
 	{
 	{
@@ -133,7 +133,7 @@ function Xajax()
 			eval("this.$('"+sElementId+"').attachEvent('"+sAltEvent+"',"+sFunctionName+",false);");
 			eval("this.$('"+sElementId+"').attachEvent('"+sAltEvent+"',"+sFunctionName+",false);");
 		}
 		}
 	}
 	}
-	
+
 	// xajax.removeHandler removes an event handler from an element
 	// xajax.removeHandler removes an event handler from an element
 	this.removeHandler = function(sElementId, sEvent, sFunctionName)
 	this.removeHandler = function(sElementId, sEvent, sFunctionName)
 	{
 	{
@@ -148,7 +148,7 @@ function Xajax()
 			eval("this.$('"+sElementId+"').detachEvent('"+sAltEvent+"',"+sFunctionName+",false);");
 			eval("this.$('"+sElementId+"').detachEvent('"+sAltEvent+"',"+sFunctionName+",false);");
 		}
 		}
 	}
 	}
-	
+
 	// xajax.create creates a new child node under a parent
 	// xajax.create creates a new child node under a parent
 	this.create = function(sParentId, sTag, sId)
 	this.create = function(sParentId, sTag, sId)
 	{
 	{
@@ -158,7 +158,7 @@ function Xajax()
 		if (objParent)
 		if (objParent)
 			objParent.appendChild(objElement);
 			objParent.appendChild(objElement);
 	}
 	}
-	
+
 	// xajax.insert inserts a new node before another node
 	// xajax.insert inserts a new node before another node
 	this.insert = function(sBeforeId, sTag, sId)
 	this.insert = function(sBeforeId, sTag, sId)
 	{
 	{
@@ -176,7 +176,7 @@ function Xajax()
 		objElement.setAttribute('id',sId);
 		objElement.setAttribute('id',sId);
 		objSibling.parentNode.insertBefore(objElement, objSibling.nextSibling);
 		objSibling.parentNode.insertBefore(objElement, objSibling.nextSibling);
 	}
 	}
-	
+
 	this.getInput = function(sType, sName, sId)
 	this.getInput = function(sType, sName, sId)
 	{
 	{
 		var Obj;
 		var Obj;
@@ -193,7 +193,7 @@ function Xajax()
 		}
 		}
 		return Obj;
 		return Obj;
 	}
 	}
-	
+
 	// xajax.createInput creates a new input node under a parent
 	// xajax.createInput creates a new input node under a parent
 	this.createInput = function(sParentId, sType, sName, sId)
 	this.createInput = function(sParentId, sType, sName, sId)
 	{
 	{
@@ -202,7 +202,7 @@ function Xajax()
 		if (objParent && objElement)
 		if (objParent && objElement)
 			objParent.appendChild(objElement);
 			objParent.appendChild(objElement);
 	}
 	}
-	
+
 	// xajax.insertInput creates a new input node before another node
 	// xajax.insertInput creates a new input node before another node
 	this.insertInput = function(sBeforeId, sType, sName, sId)
 	this.insertInput = function(sBeforeId, sType, sName, sId)
 	{
 	{
@@ -221,7 +221,7 @@ function Xajax()
 			objSibling.parentNode.insertBefore(objElement, objSibling.nextSibling);
 			objSibling.parentNode.insertBefore(objElement, objSibling.nextSibling);
 		}
 		}
 	}
 	}
-		
+
 	// xajax.remove deletes an element
 	// xajax.remove deletes an element
 	this.remove = function(sId)
 	this.remove = function(sId)
 	{
 	{
@@ -231,16 +231,16 @@ function Xajax()
 			objElement.parentNode.removeChild(objElement);
 			objElement.parentNode.removeChild(objElement);
 		}
 		}
 	}
 	}
-	
+
 	//xajax.replace searches for text in an attribute of an element and replaces it
 	//xajax.replace searches for text in an attribute of an element and replaces it
 	//with a different text
 	//with a different text
 	this.replace = function(sId,sAttribute,sSearch,sReplace)
 	this.replace = function(sId,sAttribute,sSearch,sReplace)
 	{
 	{
 		var bFunction = false;
 		var bFunction = false;
-		
+
 		if (sAttribute == "innerHTML")
 		if (sAttribute == "innerHTML")
 			sSearch = this.getBrowserHTML(sSearch);
 			sSearch = this.getBrowserHTML(sSearch);
-		
+
 		eval("var txt=this.$('"+sId+"')."+sAttribute);
 		eval("var txt=this.$('"+sId+"')."+sAttribute);
 		if (typeof txt == "function")
 		if (typeof txt == "function")
         {
         {
@@ -267,7 +267,7 @@ function Xajax()
 			}
 			}
 		}
 		}
 	}
 	}
-	
+
 	// xajax.getFormValues() builds a query string XML message from the elements of a form object
 	// xajax.getFormValues() builds a query string XML message from the elements of a form object
 	// * The first argument is the id of the form
 	// * The first argument is the id of the form
 	// * The second argument (optional) can be set to true if you want to submit disabled elements
 	// * The second argument (optional) can be set to true if you want to submit disabled elements
@@ -282,7 +282,7 @@ function Xajax()
 		var prefix="";
 		var prefix="";
 		if(arguments.length > 2)
 		if(arguments.length > 2)
 			prefix = arguments[2];
 			prefix = arguments[2];
-		
+
 		if (typeof(frm) == "string")
 		if (typeof(frm) == "string")
 			objForm = this.$(frm);
 			objForm = this.$(frm);
 		else
 		else
@@ -318,15 +318,15 @@ function Xajax()
 					{
 					{
 						sXml += name+"="+encodeURIComponent(formElements[i].value);
 						sXml += name+"="+encodeURIComponent(formElements[i].value);
 					}
 					}
-				} 
+				}
 			}
 			}
 		}
 		}
-		
+
 		sXml +="</q></xjxquery>";
 		sXml +="</q></xjxquery>";
-		
+
 		return sXml;
 		return sXml;
 	}
 	}
-	
+
 	// Generates an XML message that xajax can understand from a javascript object
 	// Generates an XML message that xajax can understand from a javascript object
 	this.objectToXML = function(obj)
 	this.objectToXML = function(obj)
 	{
 	{
@@ -339,7 +339,7 @@ function Xajax()
 					continue;
 					continue;
 				if (obj[i] && typeof(obj[i]) == 'function')
 				if (obj[i] && typeof(obj[i]) == 'function')
 					continue;
 					continue;
-					
+
 				var key = i;
 				var key = i;
 				var value = obj[i];
 				var value = obj[i];
 				if (value && typeof(value)=="object" && this.depth <= 50)
 				if (value && typeof(value)=="object" && this.depth <= 50)
@@ -348,9 +348,9 @@ function Xajax()
 					value = this.objectToXML(value);
 					value = this.objectToXML(value);
 					this.depth--;
 					this.depth--;
 				}
 				}
-				
+
 				sXml += "<e><k>"+key+"</k><v>"+value+"</v></e>";
 				sXml += "<e><k>"+key+"</k><v>"+value+"</v></e>";
-				
+
 			}
 			}
 			catch(e)
 			catch(e)
 			{
 			{
@@ -358,7 +358,7 @@ function Xajax()
 			}
 			}
 		}
 		}
 		sXml += "</xjxobj>";
 		sXml += "</xjxobj>";
-	
+
 		return sXml;
 		return sXml;
 	}
 	}
 
 
@@ -394,7 +394,7 @@ function Xajax()
 				}
 				}
 			}
 			}
 			return data;
 			return data;
-		}		
+		}
 	}
 	}
 
 
 	this.loadingFunction = function(){};
 	this.loadingFunction = function(){};
@@ -473,7 +473,7 @@ function Xajax()
 		{
 		{
 			if (r.readyState != 4)
 			if (r.readyState != 4)
 				return;
 				return;
-			
+
 			if (r.status==200)
 			if (r.status==200)
 			{
 			{
 				if (xajaxDebug) xajax.DebugMessage("Received:\n" + r.responseText);
 				if (xajaxDebug) xajax.DebugMessage("Received:\n" + r.responseText);
@@ -488,7 +488,7 @@ function Xajax()
 						errorString += "\nYou have whitespace in your response.";
 						errorString += "\nYou have whitespace in your response.";
 					alert(errorString);
 					alert(errorString);
 					document.body.style.cursor = 'default';
 					document.body.style.cursor = 'default';
-					if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';				
+					if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';
 				}
 				}
 			}
 			}
 			else {
 			else {
@@ -498,9 +498,9 @@ function Xajax()
 					alert(errorString);
 					alert(errorString);
 				}
 				}
 				document.body.style.cursor = 'default';
 				document.body.style.cursor = 'default';
-				if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';								
+				if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';
 			}
 			}
-			
+
 			delete r;
 			delete r;
 			r = null;
 			r = null;
 		}
 		}
@@ -510,7 +510,7 @@ function Xajax()
 		delete r;
 		delete r;
 		return true;
 		return true;
 	}
 	}
-	
+
 	//Gets the text as it would be if it were being retrieved from
 	//Gets the text as it would be if it were being retrieved from
 	//the innerHTML property in the current browser
 	//the innerHTML property in the current browser
 	this.getBrowserHTML = function(html)
 	this.getBrowserHTML = function(html)
@@ -526,11 +526,11 @@ function Xajax()
 		}
 		}
 		tmpXajax.innerHTML = html;
 		tmpXajax.innerHTML = html;
 		var browserHTML = tmpXajax.innerHTML;
 		var browserHTML = tmpXajax.innerHTML;
-		tmpXajax.innerHTML = '';	
-		
+		tmpXajax.innerHTML = '';
+
 		return browserHTML;
 		return browserHTML;
 	}
 	}
-	
+
 	// Tests if the new Data is the same as the extant data
 	// Tests if the new Data is the same as the extant data
 	this.willChange = function(element, attribute, newData)
 	this.willChange = function(element, attribute, newData)
 	{
 	{
@@ -544,7 +544,7 @@ function Xajax()
 		}
 		}
 		elementObject = this.$(element);
 		elementObject = this.$(element);
 		if (elementObject) {
 		if (elementObject) {
-			var oldData;		
+			var oldData;
 			eval("oldData=this.$('"+element+"')."+attribute);
 			eval("oldData=this.$('"+element+"')."+attribute);
 			if (newData !== oldData)
 			if (newData !== oldData)
 				return true;
 				return true;
@@ -552,13 +552,13 @@ function Xajax()
 
 
 		return false;
 		return false;
 	}
 	}
-	
+
 	//Returns the source code of the page after it's been modified by xajax
 	//Returns the source code of the page after it's been modified by xajax
 	this.viewSource = function()
 	this.viewSource = function()
 	{
 	{
 		return "<html>"+document.getElementsByTagName("HTML")[0].innerHTML+"</html>";
 		return "<html>"+document.getElementsByTagName("HTML")[0].innerHTML+"</html>";
 	}
 	}
-	
+
 	//Process XML xajaxResponses returned from the request
 	//Process XML xajaxResponses returned from the request
 	this.processResponse = function(xml)
 	this.processResponse = function(xml)
 	{
 	{
@@ -569,7 +569,7 @@ function Xajax()
 		xml = xml.documentElement;
 		xml = xml.documentElement;
 		if (xml == null)
 		if (xml == null)
 			return;
 			return;
-		
+
 		var skipCommands = 0;
 		var skipCommands = 0;
 		for (var i=0; i<xml.childNodes.length; i++)
 		for (var i=0; i<xml.childNodes.length; i++)
 		{
 		{
@@ -633,7 +633,7 @@ function Xajax()
 						} else {
 						} else {
 							var internalData = xml.childNodes[i].childNodes[j].firstChild.nodeValue;
 							var internalData = xml.childNodes[i].childNodes[j].firstChild.nodeValue;
 						}
 						}
-					
+
 						if (xml.childNodes[i].childNodes[j].nodeName == "s")
 						if (xml.childNodes[i].childNodes[j].nodeName == "s")
 						{
 						{
 							search = internalData;
 							search = internalData;
@@ -648,7 +648,7 @@ function Xajax()
 					data = xml.childNodes[i].firstChild.nodeValue;
 					data = xml.childNodes[i].firstChild.nodeValue;
 				else
 				else
 					data = "";
 					data = "";
-				
+
 				if (objElement != "XJX_SKIP") objElement = this.$(id);
 				if (objElement != "XJX_SKIP") objElement = this.$(id);
 				var cmdFullname;
 				var cmdFullname;
 				try
 				try
@@ -782,7 +782,7 @@ function Xajax()
 				delete internalData;
 				delete internalData;
 				delete j;
 				delete j;
 				delete k;
 				delete k;
-			}	
+			}
 		}
 		}
 		delete xml;
 		delete xml;
 		delete i;
 		delete i;

+ 26 - 26
main/messages/cookies.js

@@ -16,7 +16,7 @@ function Set_Cookie( name, value, expires, path, domain, secure ) {
 
 
 	document.cookie = name + "=" +escape( value ) +
 	document.cookie = name + "=" +escape( value ) +
 		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
 		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
-		( ( path ) ? ";path=" + path : "" ) + 
+		( ( path ) ? ";path=" + path : "" ) +
 		( ( domain ) ? ";domain=" + domain : "" ) +
 		( ( domain ) ? ";domain=" + domain : "" ) +
 		( ( secure ) ? ";secure" : "" );
 		( ( secure ) ? ";secure" : "" );
 }
 }
@@ -42,15 +42,15 @@ function set_url(ref)
 }
 }
 function mostrar_aviso()
 function mostrar_aviso()
 {
 {
-	
+
 	document.getElementById("box").style.visibility="visible";
 	document.getElementById("box").style.visibility="visible";
-	
+
 }
 }
 
 
 function ocultar_aviso()
 function ocultar_aviso()
 {
 {
 	document.getElementById("box").style.visibility="hidden";
 	document.getElementById("box").style.visibility="hidden";
-	
+
 }
 }
 
 
 function notificar()
 function notificar()
@@ -60,22 +60,22 @@ function notificar()
 }
 }
 
 
 function vernuevos()
 function vernuevos()
-{ 
+{
 
 
 	xmlHttp=GetXmlHttpObject(stateChanged)
 	xmlHttp=GetXmlHttpObject(stateChanged)
 	xmlHttp.open("GET", url , true)
 	xmlHttp.open("GET", url , true)
 	xmlHttp.send(null)
 	xmlHttp.send(null)
-} 
+}
 
 
-function stateChanged() 
-{ 
+function stateChanged()
+{
 
 
-	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") 
+	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{
 	{
-		document.getElementById("nuevos").innerHTML=xmlHttp.responseText 
+		document.getElementById("nuevos").innerHTML=xmlHttp.responseText
 		if(Get_Cookie("nuevos")==null || xmlHttp.responseText-Get_Cookie("nuevos")>0 )
 		if(Get_Cookie("nuevos")==null || xmlHttp.responseText-Get_Cookie("nuevos")>0 )
 		{
 		{
-		
+
 			mostrar_aviso()
 			mostrar_aviso()
 			setTimeout("ocultar_aviso()",7000);
 			setTimeout("ocultar_aviso()",7000);
 		}
 		}
@@ -84,39 +84,39 @@ function stateChanged()
 }
 }
 
 
 	function GetXmlHttpObject(handler)
 	function GetXmlHttpObject(handler)
-{ 
+{
 	var objXmlHttp=null
 	var objXmlHttp=null
 	if (navigator.userAgent.indexOf("Opera")>=0)
 	if (navigator.userAgent.indexOf("Opera")>=0)
 	{
 	{
 		objXmlHttp=new XMLHttpRequest()
 		objXmlHttp=new XMLHttpRequest()
 		objXmlHttp.onload=handler
 		objXmlHttp.onload=handler
-		objXmlHttp.onerror=handler 
+		objXmlHttp.onerror=handler
 		return objXmlHttp
 		return objXmlHttp
 	}
 	}
 	if (navigator.userAgent.indexOf("MSIE")>=0)
 	if (navigator.userAgent.indexOf("MSIE")>=0)
-	{ 
+	{
 		var strName="Msxml2.XMLHTTP"
 		var strName="Msxml2.XMLHTTP"
 		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
 		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
 		{
 		{
 			strName="Microsoft.XMLHTTP"
 			strName="Microsoft.XMLHTTP"
-		} 
+		}
 		try
 		try
-		{ 
+		{
 			objXmlHttp=new ActiveXObject(strName)
 			objXmlHttp=new ActiveXObject(strName)
-			objXmlHttp.onreadystatechange=handler 
+			objXmlHttp.onreadystatechange=handler
 			return objXmlHttp
 			return objXmlHttp
-		} 
+		}
 		catch(e)
 		catch(e)
-		{ 
-		alert("Error. Scripting for ActiveX might be disabled") 
-		return 	
-		} 
-	} 
+		{
+		alert("Error. Scripting for ActiveX might be disabled")
+		return
+		}
+	}
 	if (navigator.userAgent.indexOf("Mozilla")>=0)
 	if (navigator.userAgent.indexOf("Mozilla")>=0)
 	{
 	{
 		objXmlHttp=new XMLHttpRequest()
 		objXmlHttp=new XMLHttpRequest()
 		objXmlHttp.onload=handler
 		objXmlHttp.onload=handler
-		objXmlHttp.onerror=handler 
+		objXmlHttp.onerror=handler
 		return objXmlHttp
 		return objXmlHttp
-	}	
-} 
+	}
+}

+ 3 - 3
main/newscorm/dtree.js

@@ -81,11 +81,11 @@ function dTree(objName) {
 		inOrder					: false
 		inOrder					: false
 
 
 	}
 	}
-	
+
 	this.icon = {
 	this.icon = {
 
 
 		root				: '../img/lp.gif',
 		root				: '../img/lp.gif',
-		
+
 		folder			: '../img/folder.gif',
 		folder			: '../img/folder.gif',
 
 
 		folderOpen	: '../img/folderopen.gif',
 		folderOpen	: '../img/folderopen.gif',
@@ -523,7 +523,7 @@ dTree.prototype.closeAllChildren = function(node) {
 
 
 			this.aNodes[n]._io = false;
 			this.aNodes[n]._io = false;
 
 
-			this.closeAllChildren(this.aNodes[n]);		
+			this.closeAllChildren(this.aNodes[n]);
 
 
 		}
 		}
 
 

+ 7 - 7
main/newscorm/js/api_wrapper.js

@@ -7,7 +7,7 @@
  * @package scorm.js
  * @package scorm.js
  */
  */
 /**
 /**
- * Initialisation of the SCORM API section. 
+ * Initialisation of the SCORM API section.
  * Find the SCO functions (startTimer, computeTime, etc in the second section)
  * Find the SCO functions (startTimer, computeTime, etc in the second section)
  * Find the Dokeos-proper functions (checkAnswers, etc in the third section)
  * Find the Dokeos-proper functions (checkAnswers, etc in the third section)
  */
  */
@@ -215,7 +215,7 @@ function doLMSSetValue(name, value)
 function doLMSCommit()
 function doLMSCommit()
 {
 {
 	if(API == null)
 	if(API == null)
-	{      
+	{
 		alert(errMsgLocate +"\nLMSCommit was not successful.");
 		alert(errMsgLocate +"\nLMSCommit was not successful.");
 		return "false";
 		return "false";
 	}
 	}
@@ -329,7 +329,7 @@ function convertTotalSeconds(ts)
 	var strSec = new String(sec);
 	var strSec = new String(sec);
 	var strWholeSec = strSec;
 	var strWholeSec = strSec;
 	var strFractionSec = "";
 	var strFractionSec = "";
-	
+
 	if (strSec.indexOf(".") != -1)
 	if (strSec.indexOf(".") != -1)
 	{
 	{
 		strWholeSec =  strSec.substring(0, strSec.indexOf("."));
 		strWholeSec =  strSec.substring(0, strSec.indexOf("."));
@@ -361,7 +361,7 @@ function convertTotalSeconds(ts)
  * Handles the use of the back button (saves data and closes SCO)
  * Handles the use of the back button (saves data and closes SCO)
  */
  */
 function doBack()
 function doBack()
-{  
+{
 	checkAnswers(true);
 	checkAnswers(true);
 	doLMSSetValue( "cmi.core.exit", "suspend" );
 	doLMSSetValue( "cmi.core.exit", "suspend" );
 	computeTime();
 	computeTime();
@@ -451,7 +451,7 @@ function checkAnswers(interrupted)
 					{
 					{
 						interactionAnswers += idAnswer+'__|';// changed by isaac flores
 						interactionAnswers += idAnswer+'__|';// changed by isaac flores
 						myScore +=questions_answers_ponderation[idQuestion][idAnswer];
 						myScore +=questions_answers_ponderation[idQuestion][idAnswer];
-						
+
 						/*for(k=0;k<questions_answers_correct[idQuestion].length;k++)
 						/*for(k=0;k<questions_answers_correct[idQuestion].length;k++)
 						{
 						{
 							if(questions_answers_correct[idQuestion][k] == idAnswer)
 							if(questions_answers_correct[idQuestion][k] == idAnswer)
@@ -641,8 +641,8 @@ function checkAnswers(interrupted)
 			doLMSSetValue('cmi.interactions.'+idQuestion+'.student_response',interactionAnswers);
 			doLMSSetValue('cmi.interactions.'+idQuestion+'.student_response',interactionAnswers);
 			doLMSSetValue('cmi.interactions.'+idQuestion+'.result',interactionScore);
 			doLMSSetValue('cmi.interactions.'+idQuestion+'.result',interactionScore);
 			//correct responses work by pattern, see SCORM Runtime Env Doc
 			//correct responses work by pattern, see SCORM Runtime Env Doc
-			//doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',questions_answers_correct[idQuestion]);		
-			//doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',interactionCorrectResponses);		
+			//doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',questions_answers_correct[idQuestion]);
+			//doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',interactionCorrectResponses);
 		}
 		}
 	}
 	}
 	doLMSSetValue('cmi.core.score.min',0);
 	doLMSSetValue('cmi.core.score.min',0);

+ 12 - 12
main/plugin/hotspot/JavaScriptFlashGateway.js

@@ -74,7 +74,7 @@ function Exception(name, message)
 }
 }
 
 
 /**
 /**
- * Set the name of the exception. 
+ * Set the name of the exception.
  */
  */
 Exception.prototype.setName = function(name)
 Exception.prototype.setName = function(name)
 {
 {
@@ -82,7 +82,7 @@ Exception.prototype.setName = function(name)
 }
 }
 
 
 /**
 /**
- * Get the exception's name. 
+ * Get the exception's name.
  */
  */
 Exception.prototype.getName = function()
 Exception.prototype.getName = function()
 {
 {
@@ -90,7 +90,7 @@ Exception.prototype.getName = function()
 }
 }
 
 
 /**
 /**
- * Set a message on the exception. 
+ * Set a message on the exception.
  */
  */
 Exception.prototype.setMessage = function(msg)
 Exception.prototype.setMessage = function(msg)
 {
 {
@@ -98,7 +98,7 @@ Exception.prototype.setMessage = function(msg)
 }
 }
 
 
 /**
 /**
- * Get the exception message. 
+ * Get the exception message.
  */
  */
 Exception.prototype.getMessage = function()
 Exception.prototype.getMessage = function()
 {
 {
@@ -153,7 +153,7 @@ FlashTag.prototype.setBgcolor = function(bgc)
 }
 }
 
 
 /**
 /**
- * Sets any variables to be passed into the Flash content. 
+ * Sets any variables to be passed into the Flash content.
  */
  */
 FlashTag.prototype.setFlashvars = function(fv)
 FlashTag.prototype.setFlashvars = function(fv)
 {
 {
@@ -161,7 +161,7 @@ FlashTag.prototype.setFlashvars = function(fv)
 }
 }
 
 
 /**
 /**
- * Get the Flash tag as a string. 
+ * Get the Flash tag as a string.
  */
  */
 FlashTag.prototype.toString = function()
 FlashTag.prototype.toString = function()
 {
 {
@@ -189,7 +189,7 @@ FlashTag.prototype.toString = function()
     else
     else
     {
     {
         flashTag += '<embed src="'+this.src+'" ';
         flashTag += '<embed src="'+this.src+'" ';
-        flashTag += 'quality="high" '; 
+        flashTag += 'quality="high" ';
         flashTag += 'bgcolor="#'+this.bgcolor+'" ';
         flashTag += 'bgcolor="#'+this.bgcolor+'" ';
         flashTag += 'width="'+this.width+'" ';
         flashTag += 'width="'+this.width+'" ';
         flashTag += 'height="'+this.height+'" ';
         flashTag += 'height="'+this.height+'" ';
@@ -209,7 +209,7 @@ FlashTag.prototype.toString = function()
 }
 }
 
 
 /**
 /**
- * Write the Flash tag out. Pass in a reference to the document to write to. 
+ * Write the Flash tag out. Pass in a reference to the document to write to.
  */
  */
 FlashTag.prototype.write = function(doc)
 FlashTag.prototype.write = function(doc)
 {
 {
@@ -218,7 +218,7 @@ FlashTag.prototype.write = function(doc)
 
 
 /**
 /**
  * The FlashSerializer serializes JavaScript variables of types object, array, string,
  * The FlashSerializer serializes JavaScript variables of types object, array, string,
- * number, date, boolean, null or undefined into XML. 
+ * number, date, boolean, null or undefined into XML.
  */
  */
 
 
 /**
 /**
@@ -296,9 +296,9 @@ FlashSerializer.prototype.serialize = function(args)
 FlashSerializer.prototype._serializeXML = function(obj)
 FlashSerializer.prototype._serializeXML = function(obj)
 {
 {
     var doc = new Object();
     var doc = new Object();
-    doc.xml = '<fp>'; 
+    doc.xml = '<fp>';
     this._serializeNode(obj, doc, null);
     this._serializeNode(obj, doc, null);
-    doc.xml += '</fp>'; 
+    doc.xml += '</fp>';
     return doc.xml;
     return doc.xml;
 }
 }
 
 
@@ -401,7 +401,7 @@ function FlashProxy(uid, proxySwfName)
  * Call a function in your Flash content.  Arguments should be:
  * Call a function in your Flash content.  Arguments should be:
  * 1. ActionScript function name to call,
  * 1. ActionScript function name to call,
  * 2. any number of additional arguments of type object,
  * 2. any number of additional arguments of type object,
- *    array, string, number, boolean, date, null, or undefined. 
+ *    array, string, number, boolean, date, null, or undefined.
  */
  */
 FlashProxy.prototype.call = function()
 FlashProxy.prototype.call = function()
 {
 {

+ 8 - 8
main/plugin/hotspot/hotspot.js

@@ -10,11 +10,11 @@ function validateFlashVar(counter, lang_1, lang_2)
 	return true;
 	return true;
 	//alert(counter);
 	//alert(counter);
 	//alert(flashVar);
 	//alert(flashVar);
-	
+
 	if(counter != flashVar)
 	if(counter != flashVar)
 	{
 	{
 		alert(lang_1 + counter + lang_2);
 		alert(lang_1 + counter + lang_2);
-		
+
 		return false;
 		return false;
 	}
 	}
 	else
 	else
@@ -36,20 +36,20 @@ function updateFlashVar()
  * @param   int     ID of the area (square or ellipse)
  * @param   int     ID of the area (square or ellipse)
  * @param   int     Whether the answer is correct or not
  * @param   int     Whether the answer is correct or not
  * @param   int     X-coordinate (horizontal) of the answer point
  * @param   int     X-coordinate (horizontal) of the answer point
- * @param   int     Y-coordinate (vertical) of the answer point 
+ * @param   int     Y-coordinate (vertical) of the answer point
  */
  */
 function saveHotspot(question_id, hotspot_id, answer, hotspot_x, hotspot_y)
 function saveHotspot(question_id, hotspot_id, answer, hotspot_x, hotspot_y)
 {
 {
 	newHotspot = document.createElement("input");
 	newHotspot = document.createElement("input");
 	newHotspot.type = "hidden";
 	newHotspot.type = "hidden";
 	newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]";
 	newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]";
-	newHotspot.value = hotspot_x + ";" + hotspot_y;	
+	newHotspot.value = hotspot_x + ";" + hotspot_y;
 	document.frm_exercise.appendChild(newHotspot);
 	document.frm_exercise.appendChild(newHotspot);
-	
+
 	newHotspot = document.createElement("input");
 	newHotspot = document.createElement("input");
 	newHotspot.type = "hidden";
 	newHotspot.type = "hidden";
 	newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]";
 	newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]";
-	newHotspot.value = answer;	
+	newHotspot.value = answer;
 	document.frm_exercise.appendChild(newHotspot);
 	document.frm_exercise.appendChild(newHotspot);
 }
 }
 /*
 /*
@@ -67,11 +67,11 @@ function saveDelineationUserAnswer(question_id, hotspot_id, answer, coordinates)
 	newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]";
 	newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]";
 	newHotspot.value = coordinates;
 	newHotspot.value = coordinates;
 	document.frm_exercise.appendChild(newHotspot);
 	document.frm_exercise.appendChild(newHotspot);
-	
+
 	newHotspot = document.createElement("input");
 	newHotspot = document.createElement("input");
 	newHotspot.type = "hidden";
 	newHotspot.type = "hidden";
 	newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]";
 	newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]";
-	newHotspot.value = answer;	
+	newHotspot.value = answer;
 	document.frm_exercise.appendChild(newHotspot);
 	document.frm_exercise.appendChild(newHotspot);
 }
 }
 
 

+ 1 - 1
main/plugin/hotspot/jsmethods.js

@@ -7,7 +7,7 @@ var requiredMinorVersion = 0;
 var requiredRevision = 0;
 var requiredRevision = 0;
 // the version of javascript supported
 // the version of javascript supported
 var jsVersion = 1.0;
 var jsVersion = 1.0;
-// 
+//
 
 
 var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
 var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
 var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
 var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;

Some files were not shown because too many files changed in this diff