- }
- // 4.1.2 Current color is the pointer one
- else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
- && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
- if (theAction == 'out') {
- newColor = theDefaultColor;
- }
- else if (theAction == 'click' && theMarkColor != '') {
- newColor = theMarkColor;
- marked_row[theRowNum] = true;
- //document.getElementById('msg[' + theRowNum + ']').checked = true;
- }
- }
- // 4.1.3 Current color is the marker one
- else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
- if (theAction == 'click') {
- newColor = (thePointerColor != '')
- ? thePointerColor
- : theDefaultColor;
- marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
- ? true
- : null;
- //document.getElementById('msg[' + theRowNum + ']').checked = false;
- }
- } // end 4
-
- // 5. Sets the new color...
- if (newColor) {
- var c = null;
- // 5.1 ... with DOM compatible browsers except Opera
- if (domDetect) {
- for (c = 0; c < rowCellsCnt; c++) {
- theCells[c].setAttribute('bgcolor', newColor, 0);
- } // end for
- }
- // 5.2 ... with other browsers
- else {
- for (c = 0; c < rowCellsCnt; c++) {
- theCells[c].style.backgroundColor = newColor;
- }
- }
- } // end 5
-
- return true;
-} // end of the 'setPointer()' function
-EOS;
- $js = "\n".'<script language="JavaScript" type="text/javascript">' .
- "\n<!--\n" . $js;
- if ($compose_new_win == '1') {
- if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
- $compose_width = '640';
- }
- if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
- $compose_height = '550';
- }
- $js .= "\nfunction comp_in_new(comp_uri) {\n".
- " if (!comp_uri) {\n".
- ' comp_uri = "'.$compose_uri."\";\n".
- ' }'. "\n".
- ' var newwin = window.open(comp_uri' .
- ', "_blank",'.
- '"width='.$compose_width. ',height='.$compose_height.
- ',scrollbars=yes,resizable=yes,status=yes");'."\n".
- "}\n\n";
- }
- $js .= "// -->\n</script>\n";
- $onload = '';
- displayHtmlHeader ('SquirrelMail', $js);
- break;
-
- default:
- $js = '<script language="JavaScript" type="text/javascript">' .
- "\n<!--\n" .
- "function checkForm() {\n".
- "var f = document.forms.length;\n".
- "var i = 0;\n".
- "var pos = -1;\n".
- "while( pos == -1 && i < f ) {\n".
- "var e = document.forms[i].elements.length;\n".
- "var j = 0;\n".
- "while( pos == -1 && j < e ) {\n".
- "if ( document.forms[i].elements[j].type == 'text' " .
- "|| document.forms[i].elements[j].type == 'password' ) {\n".
- "pos = j;\n".
- "}\n".
- "j++;\n".
- "}\n".
- "i++;\n".
- "}\n".
- "if( pos >= 0 ) {\n".
- "document.forms[i-1].elements[pos].focus();\n".
- "}\n".
- "$xtra\n".
- "}\n";
-
- if ($compose_new_win == '1') {
- if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
- $compose_width = '640';
- }
- if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
- $compose_height = '550';
- }
- $js .= "function comp_in_new(comp_uri) {\n".
- " if (!comp_uri) {\n".
- ' comp_uri = "'.$compose_uri."\";\n".
- ' }'. "\n".
- ' var newwin = window.open(comp_uri' .
- ', "_blank",'.
- '"width='.$compose_width. ',height='.$compose_height.
- ',scrollbars=yes,resizable=yes,status=yes");'."\n".
- "}\n\n";
-
- }
- $js .= "// -->\n". "</script>\n";
-
- $onload = 'onload="checkForm();"';
- displayHtmlHeader ('SquirrelMail', $js);
- break;
-