Source Code Cross Referenced for menu_jsp.java in  » ERP-CRM-Financial » SourceTap-CRM » org » apache » jsp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » SourceTap CRM » org.apache.jsp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        package org.apache.jsp;
0002:
0003:        import javax.servlet.*;
0004:        import javax.servlet.http.*;
0005:        import javax.servlet.jsp.*;
0006:        import org.apache.jasper.runtime.*;
0007:        import org.ofbiz.base.util.*;
0008:        import org.ofbiz.security.*;
0009:        import com.sourcetap.sfa.ui.UIScreenSection;
0010:        import java.util.Date;
0011:        import java.util.List;
0012:        import java.util.Map;
0013:        import java.util.Vector;
0014:        import java.util.ArrayList;
0015:        import java.util.Enumeration;
0016:        import java.util.Iterator;
0017:        import java.util.HashMap;
0018:        import java.util.Calendar;
0019:        import java.util.StringTokenizer;
0020:        import java.text.SimpleDateFormat;
0021:        import java.text.DecimalFormat;
0022:        import java.text.ParseException;
0023:        import java.sql.Timestamp;
0024:        import java.sql.Time;
0025:        import java.sql.*;
0026:        import org.ofbiz.entity.util.SequenceUtil;
0027:        import org.ofbiz.security.*;
0028:        import org.ofbiz.entity.*;
0029:        import org.ofbiz.entity.condition.*;
0030:        import org.ofbiz.entity.model.*;
0031:        import org.ofbiz.base.util.*;
0032:        import com.sourcetap.sfa.ui.*;
0033:        import com.sourcetap.sfa.event.*;
0034:        import com.sourcetap.sfa.util.UserInfo;
0035:
0036:        public class menu_jsp extends HttpJspBase {
0037:
0038:            /*
0039:             *  Takes a string in the following format:
0040:             *    formatString
0041:             *  Where the first letter is lowercase, and
0042:             *  subsequent unique words begin with an upper case.
0043:             *  The function will convert a java string to a regular
0044:             *  string in title case format.
0045:             */
0046:            String formatJavaString(String s) {
0047:                char ca[] = s.toCharArray();
0048:                StringBuffer sb = new StringBuffer();
0049:                int previous = 0;
0050:                for (int i = 0; i < ca.length; i++) {
0051:                    if (i == s.length() - 1) {
0052:                        sb.append(s.substring(previous, previous + 1)
0053:                                .toUpperCase());
0054:                        sb.append(s.substring(previous + 1, s.length()));
0055:                    }
0056:                    if (Character.isUpperCase(ca[i])) {
0057:                        sb.append(s.substring(previous, previous + 1)
0058:                                .toUpperCase());
0059:                        sb.append(s.substring(previous + 1, i));
0060:                        sb.append(" ");
0061:                        previous = i;
0062:                    }
0063:                }
0064:                return sb.toString();
0065:            }
0066:
0067:            /**
0068:             Properties must include:
0069:              NAME-name of the select used in name-value form submit.
0070:              VALUE_FIELD-the value sent in form submit.
0071:              DISPLAY_FIELD-the field used in the display of the drop-down. use a
0072:              Properties can include:
0073:              Selected-The value to test for, and set selected on the drop-down
0074:              EMPTY_FIRST: if just a blank field use "{field display vaalue}, else if value supplied use "{field value}, {field value display name}"
0075:             */
0076:            String buildDropDown(List l, Map properties) {
0077:                StringBuffer returnString = new StringBuffer();
0078:                GenericValue genericValue = null;
0079:                Iterator i = l.iterator();
0080:                String selected = ((String) (properties.get("SELECTED") != null ? properties
0081:                        .get("SELECTED")
0082:                        : ""));
0083:                String display = ((String) (properties.get("DISPLAY_FIELD") != null ? properties
0084:                        .get("DISPLAY_FIELD")
0085:                        : ""));
0086:                String selectJavaScript = ((String) (properties
0087:                        .get("SELECT_JAVASCRIPT") != null ? properties
0088:                        .get("SELECT_JAVASCRIPT") : ""));
0089:                returnString.append("<select name=\"" + properties.get("NAME")
0090:                        + "\" " + selectJavaScript + " >");
0091:                if (properties.get("EMPTY_FIRST") != null) {
0092:                    String empty = (String) properties.get("EMPTY_FIRST");
0093:                    if (empty.indexOf(",") != -1) {
0094:                        StringTokenizer tok = new StringTokenizer(empty, ",");
0095:                        returnString.append("<option value=\""
0096:                                + ((String) tok.nextElement()).trim() + "\">"
0097:                                + ((String) tok.nextElement()).trim());
0098:                    } else {
0099:                        returnString.append("<option value=\"\">" + empty);
0100:                    }
0101:                }
0102:                try {
0103:                    while (i.hasNext()) {
0104:                        genericValue = (GenericValue) i.next();
0105:                        returnString.append("<option value=\""
0106:                                + String.valueOf(genericValue
0107:                                        .get((String) properties
0108:                                                .get("VALUE_FIELD"))) + "\"");
0109:                        if (String.valueOf(
0110:                                genericValue.get((String) properties
0111:                                        .get("VALUE_FIELD"))).equals(selected)) {
0112:                            returnString.append(" SELECTED ");
0113:                        }
0114:                        returnString.append(" >");
0115:                        if (display.indexOf(",") != -1) {
0116:                            StringTokenizer tok = new StringTokenizer(display,
0117:                                    ",");
0118:                            while (tok.hasMoreElements()) {
0119:                                String elem = (String) tok.nextElement();
0120:                                returnString.append(String.valueOf(genericValue
0121:                                        .get(elem.trim())));
0122:                                returnString.append(" ");
0123:                            }
0124:                        } else {
0125:                            returnString.append(genericValue.get(display));
0126:                        }
0127:                    }
0128:                } catch (Exception e) {
0129:                    e.printStackTrace();
0130:                }
0131:                returnString.append("</select>");
0132:                return returnString.toString();
0133:            }
0134:
0135:            String buildStringDropDown(List l, Map properties) {
0136:                StringBuffer returnString = new StringBuffer();
0137:                String value = "";
0138:                Iterator i = l.iterator();
0139:                String selected = ((String) (properties.get("SELECTED") != null ? properties
0140:                        .get("SELECTED")
0141:                        : ""));
0142:                String display = ((String) (properties.get("DISPLAY_FIELD") != null ? properties
0143:                        .get("DISPLAY_FIELD")
0144:                        : ""));
0145:                String selectJavaScript = ((String) (properties
0146:                        .get("SELECT_JAVASCRIPT") != null ? properties
0147:                        .get("SELECT_JAVASCRIPT") : ""));
0148:                returnString.append("<select name=\"" + properties.get("NAME")
0149:                        + "\" " + selectJavaScript + " >");
0150:                if (properties.get("EMPTY_FIRST") != null) {
0151:                    String empty = (String) properties.get("EMPTY_FIRST");
0152:                    if (empty.indexOf(",") != -1) {
0153:                        StringTokenizer tok = new StringTokenizer(empty, ",");
0154:                        returnString.append("<option value=\""
0155:                                + ((String) tok.nextElement()).trim() + "\">"
0156:                                + ((String) tok.nextElement()).trim());
0157:                    } else {
0158:                        returnString.append("<option value=\"\">" + empty);
0159:                    }
0160:                }
0161:                while (i.hasNext()) {
0162:                    value = (String) i.next();
0163:                    returnString.append("<option value=\"" + value + "\"");
0164:                    if (value.equals(selected)) {
0165:                        returnString.append(" SELECTED ");
0166:                    }
0167:                    returnString.append(" >");
0168:                    if (display.indexOf(",") != -1) {
0169:                        StringTokenizer tok = new StringTokenizer(display, ",");
0170:                        while (tok.hasMoreElements()) {
0171:                            String elem = (String) tok.nextElement();
0172:                            returnString.append(value);
0173:                            returnString.append(" ");
0174:                        }
0175:                    } else {
0176:                        returnString.append(value);
0177:                    }
0178:                }
0179:                returnString.append("</select>");
0180:                return returnString.toString();
0181:            }
0182:
0183:            String buildFieldDropDown(Vector fields, String entityName,
0184:                    HashMap properties) {
0185:                if (properties == null)
0186:                    properties = new HashMap();
0187:                StringBuffer returnString = new StringBuffer();
0188:                ModelField modelField = null;
0189:                String selected = ((String) (properties.get("SELECTED") != null ? properties
0190:                        .get("SELECTED")
0191:                        : ""));
0192:                returnString.append("<select name=\"" + entityName + "\" >");
0193:                if (properties.get("EMPTY_FIRST") != null)
0194:                    returnString.append("<option value=\"\">"
0195:                            + properties.get("EMPTY_FIRST"));
0196:                for (int i = 0; i < fields.size(); i++) {
0197:                    modelField = (ModelField) fields.get(i);
0198:                    returnString.append("<option value=\""
0199:                            + modelField.getName() + "\"");
0200:                    if ((modelField.getName()).equals(selected)) {
0201:                        returnString.append(" SELECTED ");
0202:                    }
0203:                    returnString.append(" >"
0204:                            + formatJavaString(modelField.getName()));
0205:                }
0206:                returnString.append("</select>");
0207:                return returnString.toString();
0208:            }
0209:
0210:            /**
0211:             * Checks a List of fields to see if the string
0212:             * that is passed in exists in the vector.  If so,
0213:             * it returns the ModelField for the named field, else
0214:             * it returns null.
0215:             */
0216:            ModelField contains(List v, String s) {
0217:                ModelField field;
0218:                for (int i = 0; i < v.size(); i++) {
0219:                    field = (ModelField) v.get(i);
0220:                    if (field.getName().equals(s))
0221:                        return field;
0222:                }
0223:                return null;
0224:            }
0225:
0226:            String buildUIFieldDropDown(String sectionName, List fields,
0227:                    String entityName, HashMap properties) {
0228:                if (properties == null)
0229:                    properties = new HashMap();
0230:                StringBuffer returnString = new StringBuffer();
0231:                UIFieldInfo fieldInfo = null;
0232:                String selected = ((String) (properties.get("SELECTED") != null ? properties
0233:                        .get("SELECTED")
0234:                        : ""));
0235:                returnString.append("<select name=\"" + entityName + "\" >");
0236:                if (properties.get("EMPTY_FIRST") != null)
0237:                    returnString.append("<option value=\"\">"
0238:                            + properties.get("EMPTY_FIRST"));
0239:                for (int i = 0; i < fields.size(); i++) {
0240:                    fieldInfo = (UIFieldInfo) fields.get(i);
0241:                    if (fieldInfo.getIsVisible() && !fieldInfo.getIsReadOnly()) {
0242:                        String attrId = UIWebUtility.getHtmlName(sectionName,
0243:                                fieldInfo, 0);
0244:                        String attrName = fieldInfo.getDisplayLabel();
0245:                        returnString.append("<option value=\"" + attrId + "\"");
0246:                        if (attrName.equals(selected)) {
0247:                            returnString.append(" SELECTED ");
0248:                        }
0249:                        returnString.append(" >" + attrName);
0250:                    }
0251:                }
0252:                returnString.append("</select>");
0253:                return returnString.toString();
0254:            }
0255:
0256:            /**
0257:             * Given a ModelField and a value, this function checks the datatype for the field, and
0258:             * converts the value to the correct datatype.
0259:             */
0260:            GenericValue setCorrectDataType(GenericValue entity,
0261:                    ModelField curField, String value) {
0262:                ModelFieldTypeReader modelFieldTypeReader = new ModelFieldTypeReader(
0263:                        "mysql");
0264:                ModelFieldType mft = modelFieldTypeReader
0265:                        .getModelFieldType(curField.getType());
0266:                String fieldType = mft.getJavaType();
0267:                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
0268:                SimpleDateFormat timeFormat = new SimpleDateFormat(
0269:                        "yyyy-MM-dd hh:mm a");
0270:
0271:                if (fieldType.equals("java.lang.String")
0272:                        || fieldType.equals("String")) {
0273:                    if (mft.getType().equals("indicator")) {
0274:                        if (value.equals("on"))
0275:                            entity.set(curField.getName(), "Y");
0276:                        else if (value.equals("off"))
0277:                            entity.set(curField.getName(), "N");
0278:                        else
0279:                            entity.set(curField.getName(), value);
0280:                    } else
0281:                        entity.set(curField.getName(), value);
0282:                } else if (fieldType.equals("java.sql.Timestamp")
0283:                        || fieldType.equals("Timestamp")) {
0284:                    if (value.trim().length() == 0) {
0285:                        entity.set(curField.getName(), null);
0286:                    } else {
0287:                        try {
0288:                            entity.set(curField.getName(), new Timestamp(
0289:                                    timeFormat.parse(value).getTime()));
0290:                        } catch (ParseException e) {
0291:                            e.printStackTrace();
0292:                        } //WTD: Implement error processing for ParseException.  i.e. get rid of the printStackTrace()
0293:                    }
0294:                } else if (fieldType.equals("java.sql.Time")
0295:                        || fieldType.equals("Time")) {
0296:                    if (value.trim().length() == 0) {
0297:                        entity.set(curField.getName(), null);
0298:                    } else {
0299:                        try {
0300:                            entity.set(curField.getName(), new Time(timeFormat
0301:                                    .parse(value).getTime()));
0302:                        } catch (ParseException e) {
0303:                            e.printStackTrace();
0304:                        } //WTD: Implement error processing for ParseException.  i.e. get rid of the printStackTrace()
0305:                    }
0306:                } else if (fieldType.equals("java.util.Date")) {
0307:                    if (value.trim().length() == 0) {
0308:                        entity.set(curField.getName(), null);
0309:                    } else {
0310:                        try {
0311:                            entity.set(curField.getName(), new java.sql.Date(
0312:                                    dateFormat.parse(value).getTime()));
0313:                        } catch (ParseException e) {
0314:                            e.printStackTrace();
0315:                        } //WTD: Implement error processing for ParseException.  i.e. get rid of the printStackTrace()
0316:                    }
0317:                } else if (fieldType.equals("java.sql.Date")
0318:                        || fieldType.equals("Date")) {
0319:                    if (value.trim().length() == 0) {
0320:                        entity.set(curField.getName(), null);
0321:                    } else {
0322:                        try {
0323:                            entity.set(curField.getName(), new java.sql.Date(
0324:                                    dateFormat.parse(value).getTime()));
0325:                        } catch (ParseException e) {
0326:                            e.printStackTrace();
0327:                        } //WTD: Implement error processing for ParseException.  i.e. get rid of the printStackTrace()
0328:                    }
0329:                } else if (fieldType.equals("java.lang.Integer")
0330:                        || fieldType.equals("Integer")) {
0331:                    if (value.trim().length() == 0)
0332:                        value = "0";
0333:                    entity.set(curField.getName(), Integer.valueOf(value));
0334:                } else if (fieldType.equals("java.lang.Long")
0335:                        || fieldType.equals("Long")) {
0336:                    if (value.trim().length() == 0)
0337:                        value = "0";
0338:                    entity.set(curField.getName(), Long.valueOf(value));
0339:                } else if (fieldType.equals("java.lang.Float")
0340:                        || fieldType.equals("Float")) {
0341:                    if (value.trim().length() == 0)
0342:                        value = "0.0";
0343:                    entity.set(curField.getName(), Float.valueOf(value));
0344:                } else if (fieldType.equals("java.lang.Double")
0345:                        || fieldType.equals("Double")) {
0346:                    if (value.trim().length() == 0 || value == null)
0347:                        value = "0";
0348:                    entity.set(curField.getName(), Double.valueOf(value));
0349:                }
0350:                return entity;
0351:            }
0352:
0353:            String getFieldValue(List l, String fieldName, String equalsValue,
0354:                    String returnFieldName) {
0355:                Iterator i = l.iterator();
0356:                GenericEntity genericEntity = null;
0357:                String retVal = "";
0358:                //TODO: add StringTokenizer to parse multiple fields.
0359:                while (i.hasNext()) {
0360:                    genericEntity = (GenericValue) i.next();
0361:                    if (String.valueOf(genericEntity.get(fieldName)).equals(
0362:                            equalsValue))
0363:                        retVal = String.valueOf(genericEntity
0364:                                .get(returnFieldName));
0365:                }
0366:                return retVal;
0367:            }
0368:
0369:            String getFieldValue(HttpServletRequest request, String fieldName) {
0370:                return (request.getParameter(fieldName) != null ? request
0371:                        .getParameter(fieldName) : "");
0372:            }
0373:
0374:            Vector getGenericValue(List l, String fieldName, String equalsValue) {
0375:                Vector returnVector = new Vector();
0376:                GenericValue genericValue = null;
0377:                GenericValue genericValues[] = (GenericValue[]) l
0378:                        .toArray(new GenericValue[0]);
0379:                for (int i = 0; i < genericValues.length; i++) {
0380:                    genericValue = (GenericValue) genericValues[i];
0381:                    if (String.valueOf(genericValue.get(fieldName)).equals(
0382:                            equalsValue))
0383:                        returnVector.add(genericValue);
0384:                }
0385:                return returnVector;
0386:            }
0387:
0388:            String getDateTimeFieldValue(List l, String fieldName,
0389:                    String equalsValue, String returnFieldName,
0390:                    String dateFormatString) {
0391:                GenericValue genericValue = null;
0392:                GenericValue genericValues[] = (GenericValue[]) l
0393:                        .toArray(new GenericValue[0]);
0394:                String retVal = "";
0395:                SimpleDateFormat dateFormat = new SimpleDateFormat(
0396:                        dateFormatString);
0397:                for (int i = 0; i < genericValues.length; i++) {
0398:                    genericValue = genericValues[i];
0399:                    try {
0400:                        if (dateFormat.parse(genericValue.getString(fieldName))
0401:                                .equals(dateFormat.parse(equalsValue)))
0402:                            retVal = String.valueOf(genericValue
0403:                                    .get(returnFieldName));
0404:                    } catch (ParseException e) {
0405:                        e.printStackTrace();
0406:                    }
0407:                }
0408:                return retVal;
0409:            }
0410:
0411:            Vector getDateTimeGenericValue(List l, String fieldName,
0412:                    String equalsValue, String dateFormatString) {
0413:                Vector returnVector = new Vector();
0414:                GenericValue genericValue = null;
0415:                GenericValue genericValues[] = (GenericValue[]) l
0416:                        .toArray(new GenericValue[0]);
0417:                String retVal = "";
0418:                SimpleDateFormat dateFormat = new SimpleDateFormat(
0419:                        dateFormatString);
0420:                for (int i = 0; i < genericValues.length; i++) {
0421:                    genericValue = genericValues[i];
0422:                    try {
0423:                        if (dateFormat.parse(genericValue.getString(fieldName))
0424:                                .equals(dateFormat.parse(equalsValue)))
0425:                            returnVector.add(genericValue);
0426:                    } catch (ParseException e) {
0427:                        e.printStackTrace();
0428:                    }
0429:                }
0430:                return returnVector;
0431:            }
0432:
0433:            String getStatesDropDown(String name, String selected) {
0434:                if (name == null)
0435:                    return null;
0436:                StringBuffer returnString = new StringBuffer();
0437:                returnString.append("<select class=\"\" name=\"" + name
0438:                        + "\" >");
0439:                returnString.append("<option "
0440:                        + (selected == null || selected.equals("") ? "selected"
0441:                                : "") + " >");
0442:                returnString
0443:                        .append("<option "
0444:                                + (selected != null && selected.equals("AK") ? "selected"
0445:                                        : "") + " >AK");
0446:                returnString
0447:                        .append("<option"
0448:                                + (selected != null
0449:                                        && selected.equalsIgnoreCase("AL") ? " selected"
0450:                                        : "") + ">AL");
0451:                returnString
0452:                        .append("<option"
0453:                                + (selected != null
0454:                                        && selected.equalsIgnoreCase("AR") ? " selected"
0455:                                        : "") + ">AR");
0456:                returnString
0457:                        .append("<option"
0458:                                + (selected != null
0459:                                        && selected.equalsIgnoreCase("AZ") ? " selected"
0460:                                        : "") + ">AZ");
0461:                returnString
0462:                        .append("<option"
0463:                                + (selected != null
0464:                                        && selected.equalsIgnoreCase("CA") ? " selected"
0465:                                        : "") + ">CA");
0466:                returnString
0467:                        .append("<option"
0468:                                + (selected != null
0469:                                        && selected.equalsIgnoreCase("CO") ? " selected"
0470:                                        : "") + ">CO");
0471:                returnString
0472:                        .append("<option"
0473:                                + (selected != null
0474:                                        && selected.equalsIgnoreCase("CT") ? " selected"
0475:                                        : "") + ">CT");
0476:                returnString
0477:                        .append("<option"
0478:                                + (selected != null
0479:                                        && selected.equalsIgnoreCase("DC") ? " selected"
0480:                                        : "") + ">DC");
0481:                returnString
0482:                        .append("<option"
0483:                                + (selected != null
0484:                                        && selected.equalsIgnoreCase("DE") ? " selected"
0485:                                        : "") + ">DE");
0486:                returnString
0487:                        .append("<option"
0488:                                + (selected != null
0489:                                        && selected.equalsIgnoreCase("FL") ? " selected"
0490:                                        : "") + ">FL");
0491:                returnString
0492:                        .append("<option"
0493:                                + (selected != null
0494:                                        && selected.equalsIgnoreCase("GA") ? " selected"
0495:                                        : "") + ">GA");
0496:                returnString
0497:                        .append("<option"
0498:                                + (selected != null
0499:                                        && selected.equalsIgnoreCase("GU") ? " selected"
0500:                                        : "") + ">GU");
0501:                returnString
0502:                        .append("<option"
0503:                                + (selected != null
0504:                                        && selected.equalsIgnoreCase("HI") ? " selected"
0505:                                        : "") + ">HI");
0506:                returnString
0507:                        .append("<option"
0508:                                + (selected != null
0509:                                        && selected.equalsIgnoreCase("IA") ? " selected"
0510:                                        : "") + ">IA");
0511:                returnString
0512:                        .append("<option"
0513:                                + (selected != null
0514:                                        && selected.equalsIgnoreCase("ID") ? " selected"
0515:                                        : "") + ">ID");
0516:                returnString
0517:                        .append("<option"
0518:                                + (selected != null
0519:                                        && selected.equalsIgnoreCase("IL") ? " selected"
0520:                                        : "") + ">IL");
0521:                returnString
0522:                        .append("<option"
0523:                                + (selected != null
0524:                                        && selected.equalsIgnoreCase("IN") ? " selected"
0525:                                        : "") + ">IN");
0526:                returnString
0527:                        .append("<option"
0528:                                + (selected != null
0529:                                        && selected.equalsIgnoreCase("KS") ? " selected"
0530:                                        : "") + ">KS");
0531:                returnString
0532:                        .append("<option"
0533:                                + (selected != null
0534:                                        && selected.equalsIgnoreCase("KY") ? " selected"
0535:                                        : "") + ">KY");
0536:                returnString
0537:                        .append("<option"
0538:                                + (selected != null
0539:                                        && selected.equalsIgnoreCase("LA") ? " selected"
0540:                                        : "") + ">LA");
0541:                returnString
0542:                        .append("<option"
0543:                                + (selected != null
0544:                                        && selected.equalsIgnoreCase("MA") ? " selected"
0545:                                        : "") + ">MA");
0546:                returnString
0547:                        .append("<option"
0548:                                + (selected != null
0549:                                        && selected.equalsIgnoreCase("MD") ? " selected"
0550:                                        : "") + ">MD");
0551:                returnString
0552:                        .append("<option"
0553:                                + (selected != null
0554:                                        && selected.equalsIgnoreCase("ME") ? " selected"
0555:                                        : "") + ">ME");
0556:                returnString
0557:                        .append("<option"
0558:                                + (selected != null
0559:                                        && selected.equalsIgnoreCase("MI") ? " selected"
0560:                                        : "") + ">MI");
0561:                returnString
0562:                        .append("<option"
0563:                                + (selected != null
0564:                                        && selected.equalsIgnoreCase("MN") ? " selected"
0565:                                        : "") + ">MN");
0566:                returnString
0567:                        .append("<option"
0568:                                + (selected != null
0569:                                        && selected.equalsIgnoreCase("MO") ? " selected"
0570:                                        : "") + ">MO");
0571:                returnString
0572:                        .append("<option"
0573:                                + (selected != null
0574:                                        && selected.equalsIgnoreCase("MS") ? " selected"
0575:                                        : "") + ">MS");
0576:                returnString
0577:                        .append("<option"
0578:                                + (selected != null
0579:                                        && selected.equalsIgnoreCase("MT") ? " selected"
0580:                                        : "") + ">MT");
0581:                returnString
0582:                        .append("<option"
0583:                                + (selected != null
0584:                                        && selected.equalsIgnoreCase("NC") ? " selected"
0585:                                        : "") + ">NC");
0586:                returnString
0587:                        .append("<option"
0588:                                + (selected != null
0589:                                        && selected.equalsIgnoreCase("ND") ? " selected"
0590:                                        : "") + ">ND");
0591:                returnString
0592:                        .append("<option"
0593:                                + (selected != null
0594:                                        && selected.equalsIgnoreCase("NE") ? " selected"
0595:                                        : "") + ">NE");
0596:                returnString
0597:                        .append("<option"
0598:                                + (selected != null
0599:                                        && selected.equalsIgnoreCase("NH") ? " selected"
0600:                                        : "") + ">NH");
0601:                returnString
0602:                        .append("<option"
0603:                                + (selected != null
0604:                                        && selected.equalsIgnoreCase("NJ") ? " selected"
0605:                                        : "") + ">NJ");
0606:                returnString
0607:                        .append("<option"
0608:                                + (selected != null
0609:                                        && selected.equalsIgnoreCase("NM") ? " selected"
0610:                                        : "") + ">NM");
0611:                returnString
0612:                        .append("<option"
0613:                                + (selected != null
0614:                                        && selected.equalsIgnoreCase("NV") ? " selected"
0615:                                        : "") + ">NV");
0616:                returnString
0617:                        .append("<option"
0618:                                + (selected != null
0619:                                        && selected.equalsIgnoreCase("NY") ? " selected"
0620:                                        : "") + ">NY");
0621:                returnString
0622:                        .append("<option"
0623:                                + (selected != null
0624:                                        && selected.equalsIgnoreCase("OH") ? " selected"
0625:                                        : "") + ">OH");
0626:                returnString
0627:                        .append("<option"
0628:                                + (selected != null
0629:                                        && selected.equalsIgnoreCase("OK") ? " selected"
0630:                                        : "") + ">OK");
0631:                returnString
0632:                        .append("<option"
0633:                                + (selected != null
0634:                                        && selected.equalsIgnoreCase("OR") ? " selected"
0635:                                        : "") + ">OR");
0636:                returnString
0637:                        .append("<option"
0638:                                + (selected != null
0639:                                        && selected.equalsIgnoreCase("PA") ? " selected"
0640:                                        : "") + ">PA");
0641:                returnString
0642:                        .append("<option"
0643:                                + (selected != null
0644:                                        && selected.equalsIgnoreCase("PR") ? " selected"
0645:                                        : "") + ">PR");
0646:                returnString
0647:                        .append("<option"
0648:                                + (selected != null
0649:                                        && selected.equalsIgnoreCase("RI") ? " selected"
0650:                                        : "") + ">RI");
0651:                returnString
0652:                        .append("<option"
0653:                                + (selected != null
0654:                                        && selected.equalsIgnoreCase("SC") ? " selected"
0655:                                        : "") + ">SC");
0656:                returnString
0657:                        .append("<option"
0658:                                + (selected != null
0659:                                        && selected.equalsIgnoreCase("SD") ? " selected"
0660:                                        : "") + ">SD");
0661:                returnString
0662:                        .append("<option"
0663:                                + (selected != null
0664:                                        && selected.equalsIgnoreCase("TN") ? " selected"
0665:                                        : "") + ">TN");
0666:                returnString
0667:                        .append("<option"
0668:                                + (selected != null
0669:                                        && selected.equalsIgnoreCase("TX") ? " selected"
0670:                                        : "") + ">TX");
0671:                returnString
0672:                        .append("<option"
0673:                                + (selected != null
0674:                                        && selected.equalsIgnoreCase("UT") ? " selected"
0675:                                        : "") + ">UT");
0676:                returnString
0677:                        .append("<option"
0678:                                + (selected != null
0679:                                        && selected.equalsIgnoreCase("VA") ? " selected"
0680:                                        : "") + ">VA");
0681:                returnString
0682:                        .append("<option"
0683:                                + (selected != null
0684:                                        && selected.equalsIgnoreCase("VI") ? " selected"
0685:                                        : "") + ">VI");
0686:                returnString
0687:                        .append("<option"
0688:                                + (selected != null
0689:                                        && selected.equalsIgnoreCase("VT") ? " selected"
0690:                                        : "") + ">VT");
0691:                returnString
0692:                        .append("<option"
0693:                                + (selected != null
0694:                                        && selected.equalsIgnoreCase("WA") ? " selected"
0695:                                        : "") + ">WA");
0696:                returnString
0697:                        .append("<option"
0698:                                + (selected != null
0699:                                        && selected.equalsIgnoreCase("WI") ? " selected"
0700:                                        : "") + ">WI");
0701:                returnString
0702:                        .append("<option"
0703:                                + (selected != null
0704:                                        && selected.equalsIgnoreCase("WV") ? " selected"
0705:                                        : "") + ">WV");
0706:                returnString
0707:                        .append("<option"
0708:                                + (selected != null
0709:                                        && selected.equalsIgnoreCase("WY") ? " selected"
0710:                                        : "") + ">WY");
0711:                returnString.append("</select>");
0712:                return returnString.toString();
0713:            }
0714:
0715:            private static java.util.Vector _jspx_includes;
0716:
0717:            static {
0718:                _jspx_includes = new java.util.Vector(11);
0719:                _jspx_includes.add("/includes/crossbrowser.js");
0720:                _jspx_includes.add("/includes/outlook.js");
0721:                _jspx_includes.add("/includes/header.jsp");
0722:                _jspx_includes.add("/includes/oldFunctions.jsp");
0723:                _jspx_includes.add("/includes/oldDeclarations.jsp");
0724:                _jspx_includes.add("/includes/windowTitle.jsp");
0725:                _jspx_includes.add("/includes/userStyle.jsp");
0726:                _jspx_includes.add("/includes/uiFunctions.js");
0727:                _jspx_includes.add("/includes/onBeforeUnload.jsp");
0728:                _jspx_includes.add("/includes/ts_picker.js");
0729:                _jspx_includes.add("/includes/getMenuPrivileges.jsp");
0730:            }
0731:
0732:            private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_ofbiz_url;
0733:
0734:            public menu_jsp() {
0735:                _jspx_tagPool_ofbiz_url = new org.apache.jasper.runtime.TagHandlerPool();
0736:            }
0737:
0738:            public java.util.List getIncludes() {
0739:                return _jspx_includes;
0740:            }
0741:
0742:            public void _jspDestroy() {
0743:                _jspx_tagPool_ofbiz_url.release();
0744:            }
0745:
0746:            public void _jspService(HttpServletRequest request,
0747:                    HttpServletResponse response) throws java.io.IOException,
0748:                    ServletException {
0749:
0750:                JspFactory _jspxFactory = null;
0751:                javax.servlet.jsp.PageContext pageContext = null;
0752:                HttpSession session = null;
0753:                ServletContext application = null;
0754:                ServletConfig config = null;
0755:                JspWriter out = null;
0756:                Object page = this ;
0757:                JspWriter _jspx_out = null;
0758:
0759:                try {
0760:                    _jspxFactory = JspFactory.getDefaultFactory();
0761:                    response.setContentType("text/html;charset=ISO-8859-1");
0762:                    pageContext = _jspxFactory.getPageContext(this , request,
0763:                            response, null, true, 8192, true);
0764:                    application = pageContext.getServletContext();
0765:                    config = pageContext.getServletConfig();
0766:                    session = pageContext.getSession();
0767:                    out = pageContext.getOut();
0768:                    _jspx_out = out;
0769:
0770:                    out.write("<BASE target=\"content\">\r\n\r\n");
0771:                    out.write("\r\n");
0772:                    out.write("\r\n");
0773:                    out.write("\r\n");
0774:                    out
0775:                            .write("<script language=\"JavaScript1.2\">\r\n\r\n// ---------------------------------------------------------------------------\r\n// this script is copyright (c) 2001 by Michael Wallner!\r\n// http://www.wallner-software.com\r\n// mailto:dhtml@wallner-software.com\r\n//\r\n// you may use this script on web pages of your own\r\n// you must not remove this copyright note!\r\n//\r\n// This script featured on Dynamic Drive (http://www.dynamicdrive.com)\r\n// Visit http://www.dynamicdrive.com for full source to this script and more\r\n// ---------------------------------------------------------------------------\r\n\r\n\r\n// ---------------------------------------------------------------------------\r\n//                 crossbrowser DHTML functions version 1.0\r\n//\r\n// supported browsers:  IE4, IE5, NS4, NS6, MOZ, OP5\r\n// ---------------------------------------------------------------------------\r\n\r\n\r\n//get browser info\r\n//ermittle den verwendeten Browser\r\n//UnterstĂ¼tzt IE4, IE5, IE6?, NS4, NS6, Mozilla5 und Opera5\r\n//(Achtung op5 kann sich auch als NS oder IE ausgeben!)\r\n");
0776:                    out
0777:                            .write("function browserType() {\r\n  this.name = navigator.appName;\r\n  this.version = navigator.appVersion;\t\t\t        //Version string\r\n  this.dom=document.getElementById?1:0\t\t\t                //w3-dom\r\n  this.op5=(this.name.indexOf(\"Opera\") > -1 && (this.dom))?1:0\t //Opera Browser\r\n  this.ie4=(document.all && !this.dom)?1:0\t\t\t           //ie4\r\n  this.ie5=(this.dom && this.version.indexOf(\"MSIE \") > -1)?1:0\t     //IE5, IE6?\r\n  this.ns4=(document.layers && !this.dom)?1:0\t\t\t           //NS4\r\n  this.ns5=(this.dom && this.version.indexOf(\"MSIE \") == -1)?1:0 //NS6, Mozilla5\r\n\r\n  //test if op5 telling \"i'm ie...\" (works because op5 doesn't support clip)\r\n  //testen ob sich ein op5 als ie5 'ausgibt' (funktioniert weil op5 kein clip\r\n  //unterstĂ¼tzt)\r\n  if (this.ie4 || this.ie5) {\r\n    document.write('");
0778:                    out
0779:                            .write("<DIV id=testOpera style=\"position:absolute; visibility:hidden\">TestIfOpera5");
0780:                    out
0781:                            .write("</DIV>');\r\n    if (document.all['testOpera'].style.clip=='rect()') {\r\n      this.ie4=0;\r\n      this.ie5=0;\r\n      this.op5=1;\r\n    }\r\n  }\r\n\r\n  this.ok=(this.ie4 || this.ie5 || this.ns4 || this.ns5 || this.op5) //any DHTML\r\n  eval (\"bt=this\");\r\n}\r\nbrowserType();\r\n\r\n\r\n//crossbrowser replacement for getElementById (find ns4 sublayers also!)\r\n//ersetzte 'getElementById' (findet auch sublayers in ns4)\r\nfunction getObj(obj){\r\n//do not use 'STYLE=' attribut in ");
0782:                    out
0783:                            .write("<DIV> tags for NS4!\r\n//zumindest beim NS 4.08 dĂ¼rfen ");
0784:                    out
0785:                            .write("<DIV> Tags keine 'STYLE=' Angabe beinhalten\r\n//sonst werden die restlichen Layers nicht gefunden! class= ist jedoch erlaubt!\r\n\r\n  //search layer for ns4\r\n  //Recursive Suche nach Layer fĂ¼r NS4\r\n  function getRefNS4(doc,obj){\r\n    var fobj=0;\r\n    var c=0\r\n      while (c ");
0786:                    out
0787:                            .write("< doc.layers.length) {\r\n        if (doc.layers[c].name==obj) return doc.layers[c];\r\n\tfobj=getRefNS4(doc.layers[c].document,obj)\r\n\tif (fobj != 0) return fobj\r\n\tc++;\r\n      }\r\n      return 0;\r\n  }\r\n\r\n  return (bt.dom)?document.getElementById(obj):(bt.ie4)?\r\n         document.all[obj]:(bt.ns4)?getRefNS4(document,obj):0\r\n}\r\n\r\n\r\n//get the actual browser window size\r\n//ermittle die grĂ¶ĂŸe der Browser Anzeigefläche\r\n//op5 supports offsetXXXX ans innerXXXX but offsetXXXX only after pageload!\r\n//op5 unterstĂ¼tzt sowohl innerXXXX als auch offsetXXXX aber offsetXXXX erst\r\n//nach dem vollständigen Laden der Seite!\r\nfunction createPageSize(){\r\n  this.width=(bt.ns4 || bt.ns5 || bt.op5)?innerWidth:document.body.offsetWidth;\r\n  this.height=(bt.ns4 || bt.ns5 || bt.op5)?innerHeight:document.body.offsetHeight;\r\n  return this;\r\n}\r\nvar screenSize = new createPageSize();\r\n\r\n//create a crossbrowser layer object\r\nfunction createLayerObject(name) {\r\n  this.name=name;\r\n  this.obj=getObj(name);\r\n  this.css=(bt.ns4)?obj:obj.style;\r\n  this.x=parseInt(this.css.left);\r\n");
0788:                    out
0789:                            .write("  this.y=parseInt(this.css.top);\r\n  this.show=b_show;\r\n  this.hide=b_hide;\r\n  this.moveTo=b_moveTo;\r\n  this.moveBy=b_moveBy;\r\n  this.writeText=b_writeText;\r\n  return this;\r\n}\r\n  \r\n//crossbrowser show\r\nfunction b_show(){\r\n//  this.visibility='visible'\r\n  this.css.visibility='visible';\r\n}\r\n\r\n//crossbrowser hide\r\nfunction b_hide(){\r\n//  this.visibility='hidden'\r\n  this.css.visibility='hidden';\r\n}\r\n\r\n//crossbrowser move absolute\r\nfunction b_moveTo(x,y){\r\n  this.x = x;\r\n  this.y = y;\r\n  this.css.left=x;\r\n  this.css.top=y;\r\n}\r\n\r\n//crossbrowser move relative\r\nfunction b_moveBy(x,y){\r\n  this.moveTo(this.x+x, this.y+y)\r\n}\r\n\r\n//write text into a layer (not supported by Opera 5!)\r\n//this function is not w3c-dom compatible but ns6\r\n//support innerHTML also!\r\n//Opera 5 does not support change of layer content!!\r\nfunction b_writeText(text) {\r\n   if (bt.ns4) {\r\n     this.obj.document.write(text);\r\n     this.obj.document.close();\r\n   }\r\n   else {\r\n     this.obj.innerHTML=text;\r\n   }\r\n}\r\n");
0790:                    out.write("</SCRIPT>\r\n\r\n\r\n");
0791:                    out.write("\r\n");
0792:                    out
0793:                            .write("<script language=\"JavaScript1.2\">\r\n// ---------------------------------------------------------------------------\r\n// this script is copyright (c) 2001 by Michael Wallner!\r\n// http://www.wallner-software.com\r\n// mailto:dhtml@wallner-software.com\r\n//\r\n// you may use this script on web pages of your own\r\n// you must not remove this copyright note!\r\n//\r\n// This script featured on Dynamic Drive (http://www.dynamicdrive.com)\r\n// Visit http://www.dynamicdrive.com for full source to this script and more\r\n// ---------------------------------------------------------------------------\r\n\r\n// ---------------------------------------------------------------------------\r\n//                   Outlook like navigation bar version 1.2\r\n//\r\n// supported browsers:  IE4, IE5, NS4, NS6, MOZ, OP5\r\n// needed script files: crossbrowser.js\r\n//\r\n// History:\r\n// 1.0: initial version\r\n// 1.1: no Reload in IE and NS6\r\n// 1.2: no Reload in OP5 if width is not changed\r\n// ---------------------------------------------------------------------------\r\n");
0794:                    out
0795:                            .write("\r\n//add one button to a panel\r\n//einen Button zu einem Panel hinzufĂ¼gen\r\n//img:    image name - Name der Bilddatei\r\n//label:  button caption - Beschriftung des Buttons\r\n//action: javascript on MouseUp event - Javascript beim onMouseUp event\r\nfunction b_addButton(img, label, action) {\r\n  this.img[this.img.length]=img;\r\n  this.lbl[this.lbl.length]=label;\r\n  this.act[this.act.length]=action;\r\n  this.sta[this.sta.length]=0;\r\n\r\n  return this\r\n}\r\n\r\n//reset all panel buttons  (ns4, op5)\r\n//alle Panel Buttons zurĂ¼cksetzten (ns4, op5)\r\nfunction b_clear() {\r\nvar i\r\n  for (i=0;i");
0796:                    out
0797:                            .write("<this.sta.length;i++) {\r\n    if (this.sta[i] != 0)\r\n      this.mOut(i);\r\n  }\r\n}\r\n\r\n\r\n//----------------------------------------------------------------------------\r\n// Panel functions for Netscape 4\r\n//----------------------------------------------------------------------------\r\n\r\n// write new htmlcode into the button layer\r\n// schreibe den neuen HTML Code in den Button Layer\r\nfunction b_mOver_ns4(nr) {\r\n  this.clear();\r\n  l=this.obj.layers[0].layers[nr].document;\r\n  l.open();\r\n  l.write(\"");
0798:                    out.write("<Center>\");\r\n  l.write(\"");
0799:                    out.write("<SPAN class='imgbout'>\");\r\n  l.write(\"");
0800:                    out
0801:                            .write("<A href='#' onmouseOut='\"+this.v+\".mOut(\"+nr+\")' \");\r\n  l.write(\"onMousedown='\"+this.v+\".mDown(\"+nr+\")'>");
0802:                    out
0803:                            .write("<img  src='\"+this.img[nr]);\r\n  l.write(\"' border=0>");
0804:                    out.write("</A>");
0805:                    out.write("</SPAN>");
0806:                    out
0807:                            .write("<Font size=3 weight=bold face=Arial color=black>\");\r\n  l.write(this.lbl[nr]+\"");
0808:                    out.write("</FONT>");
0809:                    out.write("<");
0810:                    out.write("<BR>");
0811:                    out
0812:                            .write("<BR>\");\r\n  l.close();\r\n  this.sta[nr]=1;\r\n}\r\n\r\nfunction b_mOut_ns4(nr) {\r\n  l=this.obj.layers[0].layers[nr].document;\r\n  l.open();\r\n  l.write(\"");
0813:                    out.write("<Center>\")\r\n  l.write(\"");
0814:                    out.write("<SPAN class='imgnob'>\")\r\n  l.write(\"");
0815:                    out
0816:                            .write("<A href='#' onmouseOver='\"+this.v+\".mOver(\"+nr+\")' \");\r\n  l.write(\"onmouseOut='\"+this.v+\".mOut(\"+nr+\")'>");
0817:                    out
0818:                            .write("<img  src='\"+this.img[nr]);\r\n  l.write(\"' border=0>");
0819:                    out.write("</A>");
0820:                    out.write("</SPAN>");
0821:                    out
0822:                            .write("<Font size=3 weight=bold Face=Arial color=black>\");\r\n  l.write(this.lbl[nr]+\"");
0823:                    out.write("</FONT>");
0824:                    out.write("<BR>");
0825:                    out
0826:                            .write("<BR>\");\r\n  l.close();\r\n  this.sta[nr]=0;\r\n}\r\n\r\nfunction b_mDown_ns4(nr) {\r\n  l=this.obj.layers[0].layers[nr].document;\r\n  l.open();\r\n  l.write(\"");
0827:                    out.write("<Center>\")\r\n  l.write(\"");
0828:                    out.write("<SPAN class='imgbin'>\")\r\n  l.write(\"");
0829:                    out
0830:                            .write("<A href='#' onmouseOver='\"+this.v+\".mOver(\"+nr+\")' \");\r\n  l.write(\"onmouseOut='\"+this.v+\".mOut(\"+nr+\")' onMouseup='\"+this.act[nr]);\r\n  l.write(\";\"+this.v+\".mOver(\"+nr+\")'>");
0831:                    out
0832:                            .write("<img  src='\"+this.img[nr]);\r\n  l.write(\"' border=0>");
0833:                    out.write("</A>");
0834:                    out.write("</SPAN>");
0835:                    out
0836:                            .write("<Font size=3 weight=bold Face=Arial color=black>\");\r\n  l.write(this.lbl[nr]+\"");
0837:                    out.write("</FONT>");
0838:                    out.write("<BR>");
0839:                    out
0840:                            .write("<BR>\");\r\n  l.close();\r\n  this.sta[nr]=1;\r\n}\r\n\r\n//test if scroll buttons should be visible\r\n//teste ob Scroll-Buttons sichtbar sein sollen\r\nfunction b_testScroll_ns4() {\r\nvar i\r\nvar j\r\nvar k\r\n\r\n  i=this.obj.clip.bottom;\r\n  j=this.obj.layers[0].clip.bottom;\r\n  k=parseInt(this.obj.layers[0].top);\r\n\r\n  if (k==38)\r\n    this.obj.layers[2].visibility='hide';\r\n  else\r\n    this.obj.layers[2].visibility='show';\r\n\r\n  if ((j+k)");
0841:                    out
0842:                            .write("<i) {\r\n    this.obj.layers[3].visibility='hide';\r\n  }\r\n  else\r\n    this.obj.layers[3].visibility='show';\r\n}\r\n\r\n//scroll the panel content up\r\n//scrolle den Panel Inhalt nach Oben\r\nfunction b_up_ns4(nr) {\r\n    this.ftop = this.ftop - 5;\r\n    this.obj.layers[0].top=this.ftop;\r\n    nr--\r\n    if (nr>0)\r\n      setTimeout(this.v+'.up('+nr+');',10);\r\n    else\r\n      this.testScroll();\r\n}\r\n\r\n//scroll the panel content down\r\n//scrolle den Panel Inhalt nach Unten\r\nfunction b_down_ns4(nr) {\r\n    this.ftop = this.ftop + 5;\r\n    if (this.ftop>=38) {\r\n      this.ftop=38;\r\n      nr=0;\r\n    }\r\n    this.obj.layers[0].top=this.ftop;\r\n    nr--\r\n\r\n    if (nr>0)\r\n      setTimeout(this.v+'.down('+nr+');',10);\r\n    else\r\n      this.testScroll();\r\n}\r\n\r\n//----------------------------------------------------------------------------\r\n// Panel functions for Opera5\r\n//----------------------------------------------------------------------------\r\n\r\n//show one panelbutton layer and hide the others two\r\n//zeige einen Panel Button Layer und verstecke die anderen beiden\r\n");
0843:                    out
0844:                            .write("function b_mOver_op5(nr) {\r\n  var obj0=getObj(this.name+'_b'+nr+'0')\r\n  var obj1=getObj(this.name+'_b'+nr+'1')\r\n  var obj2=getObj(this.name+'_b'+nr+'2')\r\n\r\n  this.clear();\r\n  obj1.style.visibility=\"VISIBLE\";\r\n  obj0.style.visibility=\"HIDDEN\";\r\n  obj2.style.visibility=\"HIDDEN\";\r\n  this.sta[nr]=1;\r\n}\r\n\r\nfunction b_mOut_op5(nr) {\r\n  var obj0=getObj(this.name+'_b'+nr+'0')\r\n  var obj1=getObj(this.name+'_b'+nr+'1')\r\n  var obj2=getObj(this.name+'_b'+nr+'2')\r\n\r\n  obj2.style.visibility=\"visible\";\r\n  obj0.style.visibility=\"hidden\";\r\n  obj1.style.visibility=\"hidden\";\r\n  this.sta[nr]=1;\r\n}\r\n\r\nfunction b_mDown_op5(nr) {\r\n  var obj0=getObj(this.name+'_b'+nr+'0')\r\n  var obj1=getObj(this.name+'_b'+nr+'1')\r\n  var obj2=getObj(this.name+'_b'+nr+'2')\r\n\r\n  obj0.style.visibility=\"visible\";\r\n  obj1.style.visibility=\"hidden\";\r\n  obj2.style.visibility=\"hidden\";\r\n  this.sta[nr]=1;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Panel functions for ie4, ie5, ns5, op5\r\n// ---------------------------------------------------------------------------\r\n");
0845:                    out
0846:                            .write("\r\n//test if scroll buttons should be visible\r\n//teste ob Scroll-Buttons sichtbar sein sollen\r\nfunction b_testScroll() {\r\n\r\n  if (bt.op5) {\r\n    var i=parseInt(this.obj.style.pixelHeight);\r\n    var j=parseInt(this.objf.style.pixelHeight);\r\n  }\r\n  else {\r\n    var i=parseInt(this.obj.style.height);\r\n    var j=parseInt(this.objf.style.height);\r\n  }\r\n  var k=parseInt(this.objf.style.top);\r\n\r\n\r\n  if (k==38)\r\n    this.objm1.style.visibility='hidden';\r\n  else\r\n    this.objm1.style.visibility='visible';\r\n\r\n  if ((j+k)");
0847:                    out
0848:                            .write("<i) {\r\n    this.objm2.style.visibility='hidden';\r\n  }\r\n  else\r\n    this.objm2.style.visibility='visible';\r\n}\r\n\r\n//scroll the panel content up\r\n//scrolle den Panel Inhalt nach Oben\r\nfunction b_up(nr) {\r\n    this.ftop = this.ftop - 5;\r\n    this.objf.style.top=this.ftop;\r\n    nr--\r\n    if (nr>0)\r\n      setTimeout(this.v+'.up('+nr+');',10);\r\n    else\r\n      this.testScroll();\r\n}\r\n\r\n//scroll the panel content down\r\n//scrolle den Panel Inhalt nach Unten\r\nfunction b_down(nr) {\r\n    this.ftop = this.ftop + 5;\r\n    if (this.ftop>=38) {\r\n      this.ftop=38;\r\n      nr=0;\r\n    }\r\n    this.objf.style.top=this.ftop;\r\n    nr--\r\n\r\n    if (nr>0)\r\n      setTimeout(this.v+'.down('+nr+');',10);\r\n    else\r\n      this.testScroll();\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Panel object\r\n// ---------------------------------------------------------------------------\r\n\r\n//create one panel\r\nfunction createPanel(name,caption) {\r\n  this.name=name;                  // panel layer ID\r\n  this.ftop=38;                    // actual panel scroll position\r\n");
0849:                    out
0850:                            .write("  this.obj=null;                   // panel layer object\r\n  this.objc=null;                  // caption layer object\r\n  this.objf=null;                  // panel field layer object\r\n  this.objm1=null;                 // scroll button up\r\n  this.objm2=null;                 // scroll button down\r\n  this.caption=caption;            // panel caption\r\n  this.img=new Array();            // button images\r\n  this.lbl=new Array();            // button labels\r\n  this.act=new Array();            // button actions\r\n  this.sta=new Array();            // button status (internal)\r\n  this.addButton=b_addButton;      // add one button to panel\r\n  this.clear=b_clear;              // reset all buttons\r\n  if (bt.ns4) {                          // functions for ns4\r\n    this.mOver=b_mOver_ns4;              // handles mouseOver event\r\n    this.mOut=b_mOut_ns4;                // handles mouseOut & mouseUp event\r\n    this.mDown=b_mDown_ns4;              // handles mouseDown event\r\n    this.testScroll=b_testScroll_ns4;    // test if scroll buttons visible\r\n");
0851:                    out
0852:                            .write("    this.up=b_up_ns4;                    // scroll panel buttons up\r\n    this.down=b_down_ns4;                // scroll panel buttons down\r\n  }\r\n  if (bt.op5) {                          // functions for op5\r\n    this.mOver=b_mOver_op5;              // handles mouseOver event\r\n    this.mOut=b_mOut_op5;                // handles mouseOut & mouseUp event\r\n    this.mDown=b_mDown_op5;              // handles mouseDown event\r\n  }\r\n  if (!bt.ns4) {                     // functions for all browsers but ns4\r\n    this.testScroll=b_testScroll;    // test if scroll buttons should be visible\r\n    this.up=b_up;                    // scroll panel buttons up\r\n    this.down=b_down;                // scroll panel buttons down\r\n  }\r\n\r\n  this.v = this.name + \"var\";   // global var of 'this'\r\n  eval(this.v + \"=this\");\r\n\r\n  return this\r\n}\r\n\r\n//add one panel to the outlookbar\r\nfunction b_addPanel(panel) {\r\n  panel.name=this.name+'_panel'+this.panels.length\r\n  this.panels[this.panels.length] = panel;\r\n}\r\n\r\n//write style sheets\r\n//schreibe die Style sheets\r\n");
0853:                    out
0854:                            .write("function b_writeStyle() {\r\n\r\n  document.write('");
0855:                    out
0856:                            .write("<STYLE TYPE=\"text/css\">');\r\n\r\n  document.write('.button {width:300; text-align:center; font-family:arial;');\r\n  document.write(' font-size:8pt; font-weight:bold; cursor:hand; border-width:2;');\r\n  document.write(' border-style:outset; border-color:silver; ');\r\n  document.write('background-color:silver;}');\r\n\r\n  document.write('.noLine {text-decoration:none;}');\r\n\r\n  document.write('.imgB {color:black; font-weight:bold; font-family:arial; font-size:8pt; cursor:default;}');\r\n\r\n  if (bt.op5) {\r\n    document.write('.imgbin {border-width:3; border-style:inset; ');\r\n    document.write('border-color:white; cursor:hand;}');\r\n  }\r\n  else {\r\n    document.write('.imgbin {border-width:3; border-style:inset; ');\r\n    document.write('border-color:silver; cursor:hand;}');\r\n  }\r\n\r\n  if (bt.op5) {\r\n    document.write('.imgbout {border-width:3; border-style:outset; ');\r\n    document.write('border-color:white; cursor:hand;}');\r\n  }\r\n  else {\r\n    document.write('.imgbout {border-width:3; border-style:outset; ');\r\n    document.write('border-color:silver; cursor:hand;}');\r\n");
0857:                    out
0858:                            .write("  }\r\n\r\n  document.write(' .imgnob {border-width:3; border-style:solid; ');\r\n  document.write('border-color:'+this.bgcolor+';}');\r\n\r\n  document.write('");
0859:                    out
0860:                            .write("</STYLE>');\r\n\r\n}\r\n\r\n// Draw the Outlook Bar\r\nfunction b_draw() {\r\nvar i;\r\nvar j;\r\nvar t=0;\r\nvar h;\r\nvar c=0;\r\n\r\n  this.writeStyle();\r\n\r\n  if (bt.ns5 || bt.op5) c=6;       //two times border width\r\n\r\n\r\n\r\n  if (bt.ns4) {                 //draw OutlookBar for ns4\r\n    //OutlookBar layer..\r\n    document.write('");
0861:                    out
0862:                            .write("<layer bgcolor='+this.bgcolor+' name='+this.name+' left=');\r\n    document.write(this.xpos+' top='+this.ypos+' width='+this.width);\r\n    document.write(' clip=\"0,0,'+this.width+','+this.height+'\">');\r\n\r\n    //one layer for every panel...\r\n    for (i=0;i");
0863:                    out
0864:                            .write("<this.panels.length;i++) {\r\n      document.write('");
0865:                    out
0866:                            .write("<Layer name='+this.name+'_panel'+i+' width='+this.width);\r\n       document.write(' top='+i*28+' bgcolor='+this.bgcolor);\r\n       document.write(' clip=\"0,0,'+this.width+',');\r\n       document.write(this.height-(this.panels.length-1)*28+'\">');\r\n\r\n       //one layer to host the panel buttons\r\n       document.write('");
0867:                    out
0868:                            .write("<Layer top=38 width='+this.width+'>');\r\n        mtop=0\r\n\r\n        //one layer for every button\r\n        for (j=0;j");
0869:                    out
0870:                            .write("<this.panels[i].img.length;j++) {\r\n          document.write('");
0871:                    out
0872:                            .write("<Layer top='+mtop+' width='+this.width);\r\n          document.write('>");
0873:                    out.write("<Center>");
0874:                    out
0875:                            .write("<SPAN class=imgnob>');\r\n          document.write(\"");
0876:                    out
0877:                            .write("<A href='#' onmouseOut='\"+this.panels[i].v);\r\n          document.write(\".rst(\"+j+\")' onmouseOver='\"+this.panels[i].v);\r\n          document.write(\".mOver(\"+j+\")'>");
0878:                    out
0879:                            .write("<img  src='\"+this.panels[i].img[j]);\r\n          document.write(\"' border=0>");
0880:                    out.write("</A>");
0881:                    out.write("</SPAN>\");\r\n          document.write(\"");
0882:                    out
0883:                            .write("<Font size=3 weight=bold face=arial color=black>\");\r\n          document.write(this.panels[i].lbl[j]+\"");
0884:                    out.write("</FONT>");
0885:                    out.write("<BR>");
0886:                    out.write("<BR>\");\r\n         document.write('");
0887:                    out
0888:                            .write("</Layer>');\r\n         mtop=mtop+this.buttonspace;\r\n        }\r\n\r\n       document.write('");
0889:                    out
0890:                            .write("</Layer>');\r\n\r\n       //one layer for the panels caption\r\n       document.write('");
0891:                    out
0892:                            .write("<Layer top=0 width='+this.width+' clip=\"0,0,');\r\n       document.write(this.width+',28\" bgcolor=silver class=button ');\r\n       document.write('onmouseOver=\"'+this.panels[i].v+'.clear();\">');\r\n       document.write('");
0893:                    out
0894:                            .write("<A class=noLine href=\"javascript:'+this.v+'.showPanel(');\r\n       document.write(i+');\" onmouseOver=\"'+this.panels[i].v+'.clear();\">');\r\n       document.write('");
0895:                    out
0896:                            .write("<Font Color=black weight=bold class=noLine>'+this.panels[i].caption);\r\n       document.write('");
0897:                    out.write("</Font>");
0898:                    out.write("</A>");
0899:                    out
0900:                            .write("</Layer>');\r\n\r\n       //two layers for scroll-up -down buttons\r\n       document.write('");
0901:                    out
0902:                            .write("<Layer visibility=hide top=40 left='+(this.width-20));\r\n       document.write('>");
0903:                    out
0904:                            .write("<A href=\"#\" onClick=\"'+this.panels[i].v+'.down(16);\" ');\r\n       document.write('onmouseOver=\"'+this.panels[i].v+'.clear();\">");
0905:                    out
0906:                            .write("<img ');\r\n       document.write('width=16 height=16 src=/sfaimages/arrowup.gif border=0>');\r\n       document.write('");
0907:                    out.write("</A>");
0908:                    out.write("</LAYER>");
0909:                    out
0910:                            .write("<Layer top=');\r\n       document.write((this.height-(this.panels.length)*28)+'");
0911:                    out
0912:                            .write("<Layer top=');\r\n       document.write((this.height-(this.panels.length)*28)+' left=');\r\n       document.write((this.width-20)+'>");
0913:                    out
0914:                            .write("<A href=\"#\" onClick=\"');\r\n       document.write(this.panels[i].v+'.up(16);\" onmouseOver=\"');\r\n       document.write(this.panels[i].v+'.clear();\">");
0915:                    out
0916:                            .write("<img width=16 height=16 ');\r\n       document.write('src=/sfaimages/arrowdown.gif border=0>");
0917:                    out.write("</A>");
0918:                    out.write("</LAYER>');\r\n\r\n      document.write('");
0919:                    out.write("</LAYER>');\r\n    }\r\n    document.write('");
0920:                    out
0921:                            .write("</LAYER>');\r\n  }\r\n  else {                             //draw Outlook bar for all browsers but ns4\r\n\r\n    //OutlookBar layer..\r\n    document.write('");
0922:                    out
0923:                            .write("<DIV id='+this.name+' Style=\"position:absolute; left:');\r\n    document.write(this.xpos+'; top:'+this.ypos+'; width:'+this.width);\r\n    document.write('; height:'+this.height+'; background-color:'+this.bgcolor)\r\n    document.write('; clip:rect(0,'+this.width+','+this.height+',0)\">');\r\n    h=this.height-((this.panels.length-1)*28)\r\n\r\n    //one layer for every panel...\r\n    for (i=0;i");
0924:                    out
0925:                            .write("<this.panels.length;i++) {\r\n      document.write('");
0926:                    out
0927:                            .write("<DIV id='+this.name+'_panel'+i);\r\n      document.write(' Style=\"position:absolute; left:0; top:'+t);\r\n      document.write('; width:'+this.width+'; height:'+h+'; clip:rect(0px, ');\r\n      document.write(this.width+'px, '+h+'px, 0px); background-color:');\r\n      document.write(this.bgcolor+';\">')\r\n      t=t+28;\r\n\r\n       //one layer to host the panel buttons\r\n      document.write('");
0928:                    out
0929:                            .write("<div id='+this.name+'_panel'+i);\r\n      document.write('_f Style=\"position:absolute; left:0; top:38; width:');\r\n      document.write(this.width+'; height:');\r\n      document.write((this.panels[i].img.length*this.buttonspace));\r\n      document.write('; background-color:'+this.bgcolor+';\">')\r\n      mtop=0\r\n\r\n      //one (ie4, ie5, ns5) or three layers (op5) for every button\r\n      for (j=0;j");
0930:                    out
0931:                            .write("<this.panels[i].img.length;j++) {\r\n        if (bt.op5) {\r\n          document.write('");
0932:                    out
0933:                            .write("<DIV id='+this.name+'_panel'+i+'_b'+j);\r\n          document.write('0 class=imgB Style=\"position:absolute; ');\r\n          document.write('visibility:hidden; left:0; width:'+this.width);\r\n          document.write('; top:'+mtop+'; text-align:center;\">');\r\n          document.write('");
0934:                    out
0935:                            .write("<img  src='+this.panels[i].img[j]);\r\n          document.write(' class=imgbin onmouseUp=\\''+this.panels[i].v);\r\n          document.write('.mOver('+j+');'+this.panels[i].act[j]);\r\n          document.write(';\\' onmouseOut=\"'+this.panels[i].v+'.mOut('+j);\r\n          document.write(');\">");
0936:                    out.write("<BR>'+this.panels[i].lbl[j]+'");
0937:                    out.write("</DIV>');\r\n\r\n          document.write('");
0938:                    out
0939:                            .write("<DIV id='+this.name+'_panel'+i+'_b'+j+'1 class=imgB');\r\n          document.write(' Style=\"position:absolute; visibility:hidden; ');\r\n          document.write('left:0; width:'+this.width+'; top:'+mtop);\r\n          document.write('; text-align:center;\">');\r\n          document.write('");
0940:                    out
0941:                            .write("<img  src='+this.panels[i].img[j]);\r\n          document.write(' class=imgbout onmouseDown=\"'+this.panels[i].v);\r\n          document.write('.mDown('+j+');\" onmouseUp=\\''+this.panels[i].v);\r\n          document.write('.mOver('+j+');'+this.panels[i].act[j]);\r\n          document.write(';\\' onmouseOut=\"'+this.panels[i].v+'.mOut('+j);\r\n          document.write(');\">");
0942:                    out.write("<BR>'+this.panels[i].lbl[j]+'");
0943:                    out.write("</DIV>');\r\n\r\n          document.write('");
0944:                    out
0945:                            .write("<DIV id='+this.name+'_panel'+i+'_b'+j);\r\n          document.write('2 class=imgB Style=\"position:absolute; ');\r\n          document.write('visibility:visible; left:0; width:'+this.width);\r\n          document.write('; top:'+mtop+'; text-align:center;\">');\r\n          document.write('");
0946:                    out
0947:                            .write("<img  src='+this.panels[i].img[j]+' class=imgnob ');\r\n          document.write('onmouseOver=\"'+this.panels[i].v+'.mOver('+j);\r\n          document.write(');\">");
0948:                    out.write("<BR>'+this.panels[i].lbl[j]+'");
0949:                    out
0950:                            .write("</DIV>');\r\n        }\r\n        else {\r\n          document.write('");
0951:                    out
0952:                            .write("<DIV id='+this.name+'_panel'+i+'_b'+j+' class=imgB ');\r\n          document.write('Style=\"position:absolute; left:0; width:'+this.width);\r\n          document.write('; top:'+mtop+'; text-align:center;\">');\r\n          document.write('");
0953:                    out
0954:                            .write("<img  src='+this.panels[i].img[j]+' class=imgnob ');\r\n          document.write('onmouseOver=\"this.className=\\'imgbout\\';\" ');\r\n          document.write('onmouseDown=\"this.className=\\'imgbin\\';\" ');\r\n          document.write('onmouseUp=\\'this.className=\"imgbout\";');\r\n          document.write(this.panels[i].act[j]+';\\' ');\r\n          document.write('onmouseOut=\"this.className=\\'imgnob\\';\">");
0955:                    out
0956:                            .write("<BR>');\r\n          document.write(this.panels[i].lbl[j]+'");
0957:                    out
0958:                            .write("</DIV>');\r\n        }\r\n        mtop=mtop+this.buttonspace;\r\n      }\r\n\r\n      document.write('");
0959:                    out
0960:                            .write("</DIV>');\r\n\r\n      //one layer for the panels caption if not op5!\r\n      if (!bt.op5) {\r\n        document.write('");
0961:                    out
0962:                            .write("<DIV id='+this.name+'_panel'+i+'_c class=button ');\r\n        document.write('onClick=\"javascript:'+this.v+'.showPanel('+i);\r\n        document.write(');\" style=\"position:absolute; left:0; top:0; width:');\r\n        document.write((this.width-c)+'; height:'+(28-c)+';\">");
0963:                    out
0964:                            .write("<A href=\"#\" ');\r\n        document.write('onClick=\"'+this.v+'.showPanel('+i+');this.blur();');\r\n        document.write('return false;\" class=noLine>");
0965:                    out
0966:                            .write("<FONT weight=bold color=black ');\r\n        document.write('class=noLine\">'+this.panels[i].caption);\r\n        document.write('");
0967:                    out.write("</FONT>");
0968:                    out.write("</A>");
0969:                    out
0970:                            .write("</DIV>')\r\n      }\r\n      //two layers for scroll-up -down buttons\r\n      document.write('");
0971:                    out
0972:                            .write("<DIV id='+this.name+'_panel'+i);\r\n      document.write('_m1 style=\"position:absolute; top:40; left:');\r\n      document.write((this.width-20)+';\">");
0973:                    out
0974:                            .write("<A href=\"#\" onClick=\"');\r\n      document.write(this.panels[i].v+'.down(16);this.blur();return false;\" ');\r\n      document.write('onmouseOver=\"'+this.panels[i].v+'.clear();\">');\r\n      document.write('");
0975:                    out
0976:                            .write("<img width=16 height=16 src=/sfaimages/arrowup.gif border=0>');\r\n      document.write('");
0977:                    out.write("</A>");
0978:                    out.write("</DIV>');\r\n      document.write('");
0979:                    out
0980:                            .write("<DIV id='+this.name+'_panel'+i);\r\n      document.write('_m2 style=\"position:absolute;  top:');\r\n      document.write((this.height-(this.panels.length)*28)+'; left:');\r\n      document.write((this.width-20)+';\">");
0981:                    out
0982:                            .write("<A href=\"#\" onClick=\"');\r\n      document.write(this.panels[i].v+'.up(16);this.blur();return false\" ');\r\n      document.write('onmouseOver=\"'+this.panels[i].v+'.clear();\">');\r\n      document.write('");
0983:                    out
0984:                            .write("<img width=16 height=16 src=/sfaimages/arrowdown.gif border=0>');\r\n      document.write('");
0985:                    out.write("</A>");
0986:                    out.write("</DIV>');\r\n\r\n\r\n      document.write('");
0987:                    out
0988:                            .write("</DIV>')\r\n\r\n    }\r\n    //Opera bug (Clip!)\r\n    //op5 doesn't support layer clipping! so use top layers for panel caption\r\n    //and two top layers with background-color like page color to hide\r\n    //panel content outside of the outlookbar.\r\n    //op5 unterstĂ¼tzt kein Clip bei Layers! darum erzeugen wir drei top level\r\n    //layers fĂ¼r die Panel Ăœberschrift und zwei top Layers mit der gleichen\r\n    //Hintergrundfarbe wie die HTML Seite um den Panel Inhalt auĂŸerhalb des\r\n    //Outlook Bars zu verdecken!\r\n    if (bt.op5) {\r\n      //one layers for panel captions if op5\r\n      for (i=0;i");
0989:                    out
0990:                            .write("<this.panels.length;i++) {\r\n        document.write('");
0991:                    out
0992:                            .write("<DIV id='+this.name+'_panel'+i);\r\n        document.write('_c class=button onmouseOver=\"'+this.panels[i].v);\r\n        document.write('.clear();\" onClick=\"'+this.v+'.showPanel('+i);\r\n        document.write(');\" style=\"position:absolute; left:0; top:0; width:');\r\n        document.write((this.width-c)+'; height:'+(28-c)+';\">');\r\n        document.write('");
0993:                    out
0994:                            .write("<A href=\"#\" ');\r\n        document.write('onClick=\"'+this.v+'.showPanel('+i+');this.blur();');\r\n        document.write('return false;\" class=noLine>");
0995:                    out
0996:                            .write("<FONT weight=bold color=black ');\r\n        document.write('class=noLine\">'+this.panels[i].caption);\r\n        document.write('");
0997:                    out.write("</FONT>");
0998:                    out.write("</A>");
0999:                    out
1000:                            .write("</DIV>')\r\n      }\r\n      //two layers to hide 'nonvisible' part of panel\r\n      //(op5 doesn't support clipping!)\r\n      //document.write('");
1001:                    out
1002:                            .write("<DIV style=\"position:absolute; left:0; top:');\r\n      //document.write(this.height+'; height:300; width:'+this.width);\r\n      //document.write('; background-color:'+this.pagecolor+';\">");
1003:                    out.write("</DIV>');\r\n      //document.write('");
1004:                    out
1005:                            .write("<DIV style=\"position:absolute; left:0; top:-300; ');\r\n      //document.write('height:300; width:'+this.width+'; background-color:');\r\n      //document.write(this.pagecolor+';\">");
1006:                    out.write("</DIV>');\r\n    }\r\n    document.write('");
1007:                    out.write("</DIV>');\r\n\r\n  }\r\n  for (i=0;i");
1008:                    out
1009:                            .write("<this.panels.length;i++) {\r\n    this.panels[i].obj=getObj(this.name+'_panel'+i);\r\n    if (!bt.ns4) {\r\n      this.panels[i].objc=getObj(this.name+'_panel'+i+'_c');\r\n      this.panels[i].objf=getObj(this.name+'_panel'+i+'_f');\r\n      this.panels[i].objm1=getObj(this.name+'_panel'+i+'_m1');\r\n      this.panels[i].objm2=getObj(this.name+'_panel'+i+'_m2');\r\n    }\r\n    this.panels[i].testScroll();\r\n  }\r\n\r\n// SFOWLER - 03/04/02 this causes the session id to be corrupted after it times out.\r\n//  //activate last panel\r\n//  //op5 dosen't support cookies!\r\n//  //so get actual panel from url paramter\r\n//  if (bt.op5) {\r\n//    if (document.location.search=='')  {\r\n//      this.showPanel(0);\r\n//    }\r\n//    else\r\n//      this.showPanel(document.location.search.substr(1,1));\r\n//  }\r\n//  else {\r\n//    //actual panel is saved in a cookie\r\n//    if (document.cookie)\r\n//      this.showPanel(document.cookie);\r\n//    else\r\n//      this.showPanel(0);\r\n//  }\r\n//\r\n}\r\n\r\n\r\n// ---------------------------------------------------------------------------\r\n");
1010:                    out
1011:                            .write("// outlookbar function for ns4\r\n// ---------------------------------------------------------------------------\r\n\r\nfunction b_showPanel_ns4(nr) {\r\nvar i\r\nvar l\r\n//  document.cookie=nr;\r\n  l = this.panels.length;\r\n  for (i=0;i");
1012:                    out
1013:                            .write("<l;i++) {\r\n    if (i>nr) {\r\n      this.panels[i].obj.top=this.height-((l-i)*28)-1;\r\n    }\r\n    else {\r\n      this.panels[i].obj.top=i*28;\r\n    }\r\n  }\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// outlookbar function for ie4, ie5, ns5, op5\r\n// ---------------------------------------------------------------------------\r\n\r\nfunction b_showPanel(nr) {\r\nvar i\r\nvar l\r\nvar o\r\n  //document.cookie=nr;\r\n  this.aktPanel=nr;\r\n  l = this.panels.length;\r\n  for (i=0;i");
1014:                    out
1015:                            .write("<l;i++) {\r\n    if (i>nr) {\r\n      this.panels[i].obj.style.top=this.height-((l-i)*28);\r\n      //Opera doesn't support clip:rect()!\r\n      //so hide non visible panels\r\n      //and move panel caption\r\n      if (bt.op5) {\r\n        this.panels[i].objf.style.visibility='hidden';\r\n        this.panels[i].objc.style.top=this.height-((l-i)*28);\r\n      }\r\n    }\r\n    else {\r\n      this.panels[i].obj.style.top=i*28;\r\n      //Opera doesn't support clip:rect()!\r\n      //so show visible panel\r\n      //and move panel caption\r\n      if (bt.op5) {\r\n        this.panels[i].objf.style.visibility='visible';\r\n        this.panels[i].objc.style.top=i*28;\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n//resize the Outlook Like Bar\r\n//IE4/5 & NS6 -> resize all layers (width & height)\r\n//op5         -> resize only height - reload on width change\r\n//ns4         -> reload on any change!\r\n//\r\n//if you change the width of a layer (style=\"text-align:center;\") then\r\n//the content will not be moved!\r\nfunction b_resize(x,y,width,height) {\r\nvar o\r\nvar i\r\nvar j\r\nvar h\r\n");
1016:                    out
1017:                            .write("var c=(bt.ns5)?6:0;\r\n\r\n   if (bt.ns4)\r\n     location.reload();\r\n   else {\r\n     if (bt.op5 && (width!=this.width))\r\n       if (location.href.indexOf('?')!=-1)\r\n         location.href=location.href.replace(/\\?./,\"?\"+this.aktPanel)\r\n       else\r\n         location.href= location.href+'?'+this.aktPanel;\r\n     else {\r\n       this.xpos=x;\r\n       this.yPos=y;\r\n       this.width=width\r\n       this.height=height\r\n\r\n       o=getObj(this.name);\r\n       o.style.left=x;\r\n       o.style.top=y;\r\n       o.style.width=width;\r\n       o.style.height=height;\r\n       o.style.clip='rect(0px '+this.width+'px '+this.height+'px 0px)';\r\n\r\n       h=this.height-((this.panels.length-1)*28)\r\n\r\n       for (i=0; i");
1018:                    out
1019:                            .write("<this.panels.length; i++) {\r\n\r\n         o=getObj(this.name+'_panel'+i+'_c');\r\n         o.style.width=(this.width-c);\r\n\r\n         if (!bt.op5)\r\n           for (j=0;j");
1020:                    out
1021:                            .write("<this.panels[i].img.length;j++) {\r\n             o=getObj(this.name+'_panel'+i+'_b'+j);\r\n             o.style.width=this.width;\r\n           }\r\n\r\n         this.panels[i].objm1.style.left=(this.width-20);\r\n         this.panels[i].objm2.style.top=(this.height-(this.panels.length)*28);\r\n         this.panels[i].objm2.style.left=(this.width-20);\r\n         this.panels[i].objf.style.width=this.width;\r\n         this.panels[i].obj.style.width=this.width\r\n         this.panels[i].obj.style.height=h\r\n         this.panels[i].obj.style.pixelHeight=h\r\n         this.panels[i].obj.style.clip='rect(0px '+this.width+'px '+h+'px 0px)';\r\n\r\n         this.panels[i].testScroll();\r\n       }\r\n     }\r\n     this.showPanel(this.aktPanel);\r\n   }\r\n}\r\n\r\n\r\n\r\n// ---------------------------------------------------------------------------\r\n// OutlookBar object for ie4, ie5, ns5, op5\r\n// ---------------------------------------------------------------------------\r\n\r\nfunction createOutlookBar(name,x,y,width,height,bgcolor,pagecolor) {\r\n  this.aktPanel=0;                        // last open panel\r\n");
1022:                    out
1023:                            .write("  this.name=name                          // OutlookBar name\r\n  this.xpos=x;                            // bar x-pos\r\n  this.ypos=y;                            // bar y-pos\r\n  this.width=width;                       // bar width\r\n  this.height=height;                     // bar height\r\n  this.bgcolor=bgcolor;                   // bar background color\r\n  this.pagecolor=pagecolor;               // page bgcolor (op5!)\r\n  this.buttonspace=74;                     // distance of panel buttons\r\n  this.panels=new Array()                 // OutlookBar panels\r\n  this.addPanel=b_addPanel;               // add new panel to bar\r\n  this.writeStyle=b_writeStyle;\r\n  this.draw=b_draw;                       // write HTML code of bar\r\n  if (bt.ns4)\r\n    this.showPanel=b_showPanel_ns4;       // make a panel visible (ns4)\r\n  else\r\n    this.showPanel=b_showPanel;           // make a panel visible (!=ns4)\r\n\r\n  this.resize=b_resize;                   // resize Outlook Like Bar\r\n\r\n  this.v = name + \"var\";                  // global var of 'this'\r\n");
1024:                    out
1025:                            .write("  eval(this.v + \"=this\");\r\n\r\n  return this\r\n}\r\n");
1026:                    out.write("</SCRIPT>\r\n");
1027:                    out.write("\r\n");
1028:                    out.write("\r\n");
1029:                    out.write("\r\n");
1030:                    out.write("\r\n");
1031:                    out.write("\r\n");
1032:                    out.write("\r\n");
1033:                    out.write("\r\n");
1034:                    out.write("\r\n");
1035:                    out.write("\r\n");
1036:                    out.write("\r\n");
1037:                    out.write("\r\n\r\n");
1038:                    out.write("\r\n");
1039:                    out.write("\r\n");
1040:                    out.write("\r\n");
1041:                    out.write("\r\n");
1042:                    out.write("\r\n");
1043:                    out.write("\r\n\r\n");
1044:                    out.write("\r\n");
1045:                    out.write("\r\n");
1046:                    out.write("\r\n");
1047:                    out.write("\r\n");
1048:                    out.write("\r\n");
1049:                    out.write("\r\n");
1050:                    out.write("\r\n");
1051:                    out.write("\r\n");
1052:                    out.write("\r\n\r\n");
1053:                    out.write("\r\n\r\n");
1054:                    org.ofbiz.security.Security security = null;
1055:                    synchronized (application) {
1056:                        security = (org.ofbiz.security.Security) pageContext
1057:                                .getAttribute("security",
1058:                                        PageContext.APPLICATION_SCOPE);
1059:                        if (security == null) {
1060:                            throw new java.lang.InstantiationException(
1061:                                    "bean security not found within scope");
1062:                        }
1063:                    }
1064:                    out.write("\r\n");
1065:                    org.ofbiz.entity.GenericDelegator delegator = null;
1066:                    synchronized (application) {
1067:                        delegator = (org.ofbiz.entity.GenericDelegator) pageContext
1068:                                .getAttribute("delegator",
1069:                                        PageContext.APPLICATION_SCOPE);
1070:                        if (delegator == null) {
1071:                            throw new java.lang.InstantiationException(
1072:                                    "bean delegator not found within scope");
1073:                        }
1074:                    }
1075:                    out.write("\r\n");
1076:                    com.sourcetap.sfa.event.GenericWebEventProcessor webEventProcessor = null;
1077:                    synchronized (application) {
1078:                        webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) pageContext
1079:                                .getAttribute("webEventProcessor",
1080:                                        PageContext.APPLICATION_SCOPE);
1081:                        if (webEventProcessor == null) {
1082:                            try {
1083:                                webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) java.beans.Beans
1084:                                        .instantiate(this .getClass()
1085:                                                .getClassLoader(),
1086:                                                "com.sourcetap.sfa.event.GenericWebEventProcessor");
1087:                            } catch (ClassNotFoundException exc) {
1088:                                throw new InstantiationException(exc
1089:                                        .getMessage());
1090:                            } catch (Exception exc) {
1091:                                throw new ServletException(
1092:                                        "Cannot create bean of class "
1093:                                                + "com.sourcetap.sfa.event.GenericWebEventProcessor",
1094:                                        exc);
1095:                            }
1096:                            pageContext.setAttribute("webEventProcessor",
1097:                                    webEventProcessor,
1098:                                    PageContext.APPLICATION_SCOPE);
1099:                        }
1100:                    }
1101:                    out.write("\r\n");
1102:                    com.sourcetap.sfa.event.GenericEventProcessor eventProcessor = null;
1103:                    synchronized (application) {
1104:                        eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) pageContext
1105:                                .getAttribute("eventProcessor",
1106:                                        PageContext.APPLICATION_SCOPE);
1107:                        if (eventProcessor == null) {
1108:                            try {
1109:                                eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) java.beans.Beans
1110:                                        .instantiate(this .getClass()
1111:                                                .getClassLoader(),
1112:                                                "com.sourcetap.sfa.event.GenericEventProcessor");
1113:                            } catch (ClassNotFoundException exc) {
1114:                                throw new InstantiationException(exc
1115:                                        .getMessage());
1116:                            } catch (Exception exc) {
1117:                                throw new ServletException(
1118:                                        "Cannot create bean of class "
1119:                                                + "com.sourcetap.sfa.event.GenericEventProcessor",
1120:                                        exc);
1121:                            }
1122:                            pageContext.setAttribute("eventProcessor",
1123:                                    eventProcessor,
1124:                                    PageContext.APPLICATION_SCOPE);
1125:                        }
1126:                    }
1127:                    out.write("\r\n");
1128:                    com.sourcetap.sfa.ui.UICache uiCache = null;
1129:                    synchronized (application) {
1130:                        uiCache = (com.sourcetap.sfa.ui.UICache) pageContext
1131:                                .getAttribute("uiCache",
1132:                                        PageContext.APPLICATION_SCOPE);
1133:                        if (uiCache == null) {
1134:                            try {
1135:                                uiCache = (com.sourcetap.sfa.ui.UICache) java.beans.Beans
1136:                                        .instantiate(this .getClass()
1137:                                                .getClassLoader(),
1138:                                                "com.sourcetap.sfa.ui.UICache");
1139:                            } catch (ClassNotFoundException exc) {
1140:                                throw new InstantiationException(exc
1141:                                        .getMessage());
1142:                            } catch (Exception exc) {
1143:                                throw new ServletException(
1144:                                        "Cannot create bean of class "
1145:                                                + "com.sourcetap.sfa.ui.UICache",
1146:                                        exc);
1147:                            }
1148:                            pageContext.setAttribute("uiCache", uiCache,
1149:                                    PageContext.APPLICATION_SCOPE);
1150:                        }
1151:                    }
1152:                    out.write("\r\n\r\n");
1153:                    out.write("<!-- [oldFunctions.jsp] Begin -->\r\n");
1154:                    out.write("\r\n");
1155:                    out.write("<!-- [oldFunctions.jsp] End -->\r\n\r\n");
1156:                    out.write("\r\n");
1157:                    out.write("<!-- [oldDeclarations.jsp] Start -->\r\n\r\n");
1158:                    GenericValue userLogin = (GenericValue) session
1159:                            .getAttribute("_USER_LOGIN_");
1160:                    out.write("\r\n");
1161:                    UserInfo userInfo = (UserInfo) session
1162:                            .getAttribute("userInfo");
1163:                    out.write("\r\n\r\n");
1164:                    String partyId = "";
1165:                    if (userLogin != null)
1166:                        partyId = userLogin.getString("partyId");
1167:
1168:                    out.write("\r\n\r\n");
1169:
1170:                    DecimalFormat decimalFormat = new DecimalFormat("#,###.##");
1171:                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
1172:                            "MM/dd/yyyy");
1173:                    SimpleDateFormat simpleTimeFormat = new SimpleDateFormat(
1174:                            "K:mm a");
1175:
1176:                    out.write("\r\n\r\n");
1177:                    String controlPath = (String) request
1178:                            .getAttribute("_CONTROL_PATH_");
1179:                    out.write("\r\n");
1180:                    String contextRoot = (String) request
1181:                            .getAttribute("_CONTEXT_ROOT_");
1182:                    out.write("\r\n\r\n");
1183:                    String pageName = UtilFormatOut
1184:                            .checkNull((String) pageContext
1185:                                    .getAttribute("PageName"));
1186:                    out.write("\r\n\r\n");
1187:                    String companyName = UtilProperties.getPropertyValue(
1188:                            contextRoot + "/WEB-INF/sfa.properties",
1189:                            "company.name");
1190:                    out.write("\r\n");
1191:                    String companySubtitle = UtilProperties.getPropertyValue(
1192:                            contextRoot + "/WEB-INF/sfa.properties",
1193:                            "company.subtitle");
1194:                    out.write("\r\n");
1195:                    String headerImageUrl = UtilProperties.getPropertyValue(
1196:                            contextRoot + "/WEB-INF/sfa.properties",
1197:                            "header.image.url");
1198:                    out.write("\r\n\r\n");
1199:                    String headerBoxBorderColor = UtilProperties
1200:                            .getPropertyValue(contextRoot
1201:                                    + "/WEB-INF/sfa.properties",
1202:                                    "header.box.border.color", "black");
1203:                    out.write("\r\n");
1204:                    String headerBoxBorderWidth = UtilProperties
1205:                            .getPropertyValue(contextRoot
1206:                                    + "/WEB-INF/sfa.properties",
1207:                                    "header.box.border.width", "1");
1208:                    out.write("\r\n");
1209:                    String headerBoxTopColor = UtilProperties.getPropertyValue(
1210:                            contextRoot + "/WEB-INF/sfa.properties",
1211:                            "header.box.top.color", "#336699");
1212:                    out.write("\r\n");
1213:                    String headerBoxBottomColor = UtilProperties
1214:                            .getPropertyValue(contextRoot
1215:                                    + "/WEB-INF/sfa.properties",
1216:                                    "header.box.bottom.color", "#cccc99");
1217:                    out.write("\r\n");
1218:                    String headerBoxBottomColorAlt = UtilProperties
1219:                            .getPropertyValue(contextRoot
1220:                                    + "/WEB-INF/sfa.properties",
1221:                                    "header.box.bottom.alt.color", "#eeeecc");
1222:                    out.write("\r\n");
1223:                    String headerBoxTopPadding = UtilProperties
1224:                            .getPropertyValue(contextRoot
1225:                                    + "/WEB-INF/sfa.properties",
1226:                                    "header.box.top.padding", "4");
1227:                    out.write("\r\n");
1228:                    String headerBoxBottomPadding = UtilProperties
1229:                            .getPropertyValue(contextRoot
1230:                                    + "/WEB-INF/sfa.properties",
1231:                                    "header.box.bottom.padding", "2");
1232:                    out.write("\r\n\r\n");
1233:                    String boxBorderColor = UtilProperties.getPropertyValue(
1234:                            contextRoot + "/WEB-INF/sfa.properties",
1235:                            "box.border.color", "black");
1236:                    out.write("\r\n");
1237:                    String boxBorderWidth = UtilProperties.getPropertyValue(
1238:                            contextRoot + "/WEB-INF/sfa.properties",
1239:                            "box.border.width", "1");
1240:                    out.write("\r\n");
1241:                    String boxTopColor = UtilProperties.getPropertyValue(
1242:                            contextRoot + "/WEB-INF/sfa.properties",
1243:                            "box.top.color", "#336699");
1244:                    out.write("\r\n");
1245:                    String boxBottomColor = UtilProperties.getPropertyValue(
1246:                            contextRoot + "/WEB-INF/sfa.properties",
1247:                            "box.bottom.color", "white");
1248:                    out.write("\r\n");
1249:                    String boxBottomColorAlt = UtilProperties.getPropertyValue(
1250:                            contextRoot + "/WEB-INF/sfa.properties",
1251:                            "box.bottom.alt.color", "white");
1252:                    out.write("\r\n");
1253:                    String boxTopPadding = UtilProperties.getPropertyValue(
1254:                            contextRoot + "/WEB-INF/sfa.properties",
1255:                            "box.top.padding", "4");
1256:                    out.write("\r\n");
1257:                    String boxBottomPadding = UtilProperties.getPropertyValue(
1258:                            contextRoot + "/WEB-INF/sfa.properties",
1259:                            "box.bottom.padding", "4");
1260:                    out.write("\r\n");
1261:                    String userStyleSheet = "/sfa/includes/maincss.css";
1262:                    out.write("\r\n");
1263:                    String alphabet[] = { "a", "b", "c", "d", "e", "f", "g",
1264:                            "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
1265:                            "r", "s", "t", "u", "v", "w", "x", "y", "z", "*" };
1266:                    out.write("\r\n\r\n");
1267:                    out.write("<!-- [oldDeclarations.jsp] End -->\r\n\r\n");
1268:                    out.write("\r\n\r\n");
1269:                    out.write("<HTML>\r\n");
1270:                    out.write("<HEAD>\r\n\r\n");
1271:
1272:                    String clientRequest = (String) session
1273:                            .getAttribute("_CLIENT_REQUEST_");
1274:                    //out.write("Client request: " + clientRequest + "<BR>");
1275:                    String hostName = "";
1276:                    if (clientRequest != null
1277:                            && clientRequest.indexOf("//") > 0) {
1278:                        int startPos = clientRequest.indexOf("//") + 2;
1279:                        int endPos = clientRequest.indexOf(":", startPos);
1280:                        if (endPos < startPos)
1281:                            endPos = clientRequest.indexOf("/", startPos);
1282:                        if (endPos < startPos)
1283:                            hostName = clientRequest.substring(startPos);
1284:                        else
1285:                            hostName = clientRequest
1286:                                    .substring(startPos, endPos);
1287:                    } else {
1288:                        hostName = "";
1289:                    }
1290:                    //out.write("Host name: " + hostName + "<BR>");
1291:
1292:                    out.write("\r\n\r\n");
1293:                    out.write("<title>");
1294:                    out.print(hostName);
1295:                    out.write(" - Sales Force Automation - ");
1296:                    out.print(companyName);
1297:                    out.write("</title>\r\n\r\n");
1298:                    out.write("\r\n");
1299:                    out.write("<!-- [userStyle.jsp] Start -->\r\n\r\n");
1300:
1301:                    //------------ Get the style sheet
1302:                    String styleSheetId = null;
1303:
1304:                    ModelEntity entityStyleUser = delegator
1305:                            .getModelEntity("UiUserTemplate");
1306:                    HashMap hashMapStyleUser = new HashMap();
1307:                    if (userLogin != null) {
1308:                        String ulogin = userLogin.getString("userLoginId");
1309:                        hashMapStyleUser.put("userLoginId", ulogin);
1310:                    } else {
1311:                        hashMapStyleUser.put("userLoginId", "Default");
1312:                    }
1313:                    GenericPK stylePk = new GenericPK(entityStyleUser,
1314:                            hashMapStyleUser);
1315:                    GenericValue userTemplate = delegator
1316:                            .findByPrimaryKey(stylePk);
1317:                    if (userTemplate != null) {
1318:                        styleSheetId = userTemplate.getString("styleSheetId");
1319:                    }
1320:
1321:                    if (styleSheetId == null) {
1322:                        hashMapStyleUser.put("userLoginId", "Default");
1323:                        stylePk = new GenericPK(entityStyleUser,
1324:                                hashMapStyleUser);
1325:                        userTemplate = delegator.findByPrimaryKey(stylePk);
1326:                        if (userTemplate != null) {
1327:                            styleSheetId = userTemplate
1328:                                    .getString("styleSheetId");
1329:                        }
1330:                    }
1331:
1332:                    if (styleSheetId != null) {
1333:                        ModelEntity entityStyle = delegator
1334:                                .getModelEntity("UiStyleTemplate");
1335:                        HashMap hashMapStyle = new HashMap();
1336:                        hashMapStyle.put("styleSheetId", styleSheetId);
1337:                        stylePk = new GenericPK(entityStyle, hashMapStyle);
1338:                        GenericValue styleTemplate = delegator
1339:                                .findByPrimaryKey(stylePk);
1340:                        userStyleSheet = styleTemplate
1341:                                .getString("styleSheetLoc");
1342:
1343:                        if (userStyleSheet == null) {
1344:                            userStyleSheet = "/sfa/includes/maincss.css";
1345:                        }
1346:                    }
1347:
1348:                    out.write("\r\n");
1349:                    out.write("<link rel=\"stylesheet\" href=\"");
1350:                    out.print(userStyleSheet);
1351:                    out.write("\" type=\"text/css\">\r\n\r\n");
1352:                    out.write("<!-- [userStyle.jsp] End -->\r\n\r\n");
1353:                    out.write("\r\n");
1354:                    out
1355:                            .write("<LINK rel=\"stylesheet\" type=\"text/css\" href=\"/sfa/css/gridstyles.css\">\r\n");
1356:                    out
1357:                            .write("<script language=\"JavaScript\" >\r\n\r\n  function sendDropDown(elementName, idName, fieldName, findClass, paramName, paramValue, frm, action)\r\n  {\r\n        var sUrl = '");
1358:                    if (_jspx_meth_ofbiz_url_0(pageContext))
1359:                        return;
1360:                    out
1361:                            .write("?findMode=filter&fieldName=' +\r\n\t\t\tfieldName + '&idName=' + idName + '&param_' + paramName + '=' + paramValue +\r\n\t\t\t'&formName=' + frm.name + '&elementName=' + elementName + '&findClass=' + findClass + '&action=' + action;\r\n        document.anchors('searchA').href=sUrl;\r\n        document.anchors('searchA').click();\r\n  }\r\n\r\n\r\n  function sendData(ele, frm, action){\r\n    if(ele.tagName != 'SELECT'){\r\n      if(ele.value.length > 0){\r\n        entity = ele.getAttribute(\"entityName\");\r\n        field = ele.getAttribute(\"fieldName\");\r\n        idName = ele.getAttribute(\"idName\");\r\n        findClass = ele.getAttribute(\"findClass\");\r\n        findValue = ele.value;\r\n        elementName = ele.name;\r\n        var sUrl = '");
1362:                    if (_jspx_meth_ofbiz_url_1(pageContext))
1363:                        return;
1364:                    out
1365:                            .write("?entityName=' + entity + '&fieldName=' +\r\n\t\t\tfield + '&idName=' + idName + '&findByLikeValue=' + findValue + '&formName=' + frm.name +\r\n\t\t\t'&elementName=' + elementName + '&findClass=' + findClass + '&action=' + action;\r\n        document.anchors('searchA').href=sUrl;\r\n        document.anchors('searchA').click();\r\n      } else {\r\n        //alert('Enter search criteria to find a value.');\r\n        //frm.item(ele.name).value = 'Enter search criteria.';\r\n      }\r\n    }\r\n  }\r\n\r\n  function updateForm(){\r\n    var innDoc = document.frames('searchIFrame').document;\r\n    var innHtml = innDoc.body.innerHTML;\r\n    if(innHtml.length > 0){\r\n      var sDiv = innDoc.all('searchResultDiv');\r\n      if(sDiv != null){\r\n        var formName = sDiv.getAttribute(\"formName\");\r\n        var fieldName = sDiv.getAttribute(\"fieldName\");\r\n        var elementName = sDiv.getAttribute(\"elementName\");\r\n        var findClass = sDiv.getAttribute(\"findClass\");\r\n        var findMode = sDiv.getAttribute(\"findMode\");\r\n        var showMultiple = sDiv.getAttribute(\"showMultiple\");\r\n");
1366:                    out
1367:                            .write("        var nde = innDoc.all(elementName);\r\n        var existingNode = document.all(elementName);\r\n        if(nde != null){\r\n          var frm = document.forms(formName);\r\n          if(nde.tagName == 'SELECT'){\r\n            var opts = nde.children.tags('OPTION');\r\n            if ( findMode == 'filter')\r\n            {\r\n\t\t\t\tvar oldOpts = existingNode.children.tags('OPTION');\r\n//\t\t\t\talert('oldOpts.length = ' + oldOpts.length);\r\n//\t\t\t\talert('opts.length = ' + opts.length);\r\n\t\t\t\tvar numOpt = existingNode.options.length;\r\n//\t\t\t\talert('numOpt = ' + numOpt);\r\n\t\t\t\tfor (var i=0; i");
1368:                    out
1369:                            .write("<numOpt;i++)\r\n\t\t\t\t\texistingNode.options.remove(numOpt - 1 - i);\r\n\t\t\t\tfor (var i=0; i");
1370:                    out
1371:                            .write("<opts.length;i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar opt = document.createElement(\"option\");\r\n\t\t\t\t\topt.setAttribute(\"value\", opts(i).value);\r\n\t\t\t\t\topt.innerText = opts(i).innerText;\r\n\t\t\t\t\texistingNode.appendChild(opt);\r\n\t\t\t\t}\r\n            }\r\n            else if(opts.length");
1372:                    out
1373:                            .write("<=0){\r\n              //alert('No results were found.  Please try another search.');\r\n              existingNode.focus();\r\n            } else {\r\n              var ele = document.createElement(nde.tagName);\r\n              ele.id = nde.name;\r\n              ele.name = nde.name;\r\n              ele.setAttribute(\"className\", existingNode.getAttribute(\"className\"));\r\n\t\t\t  ele.setAttribute(\"entityName\", sDiv.getAttribute(\"entityName\"));\r\n              ele.setAttribute(\"fieldName\", sDiv.getAttribute(\"fieldName\"));\r\n              ele.setAttribute(\"elementName\", sDiv.getAttribute(\"elementName\"));\r\n              ele.setAttribute(\"idName\",  sDiv.getAttribute(\"idName\"));\r\n              ele.setAttribute(\"findClass\",  sDiv.getAttribute(\"findClass\"));\r\n              if (showMultiple == \"true\") ele.multiple = true;\r\n              ele.tabIndex = existingNode.tabIndex;\r\n              ele.attachEvent(\"onchange\", searchAgain);\r\n              for(var i=0;i");
1374:                    out
1375:                            .write("<opts.length;i++){\r\n                var opt = document.createElement(\"option\");\r\n                opt.setAttribute(\"value\", opts(i).value);\r\n                opt.innerText = opts(i).innerText;\r\n                ele.appendChild(opt);\r\n              }\r\n              var opt = document.createElement(\"option\");\r\n              opt.setAttribute(\"value\", \"search again\");\r\n              opt.innerText = \"Search again...\";\r\n              ele.appendChild(opt);\r\n              var sRepNde = elementName + 'Holder';\r\n              var repNde = document.all(sRepNde);\r\n              repNde.replaceChild(ele, existingNode);\r\n              ele.focus();\r\n\t      ele.fireEvent(\"onchange\");\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  function searchAgain(sel, frm){\r\n    if(sel.tagName == 'SELECT'){\r\n      var fieldName = sel.getAttribute('fieldName');\r\n      var findClass = sel.getAttribute('findClass');\r\n      var elementName = sel.name;\r\n      var formName = frm.name;\r\n      var existingNode = document.all(elementName);\r\n");
1376:                    out
1377:                            .write("      if(sel.value == 'search again'){\r\n        var ele = document.createElement(\"INPUT\");\r\n        ele.id = sel.name;\r\n        ele.name = sel.name;\r\n        ele.type = \"TEXT\";\r\n        ele.setAttribute(\"className\", existingNode.getAttribute(\"className\"));\r\n        ele.setAttribute(\"entityName\", sel.getAttribute(\"entityName\"));\r\n        ele.setAttribute(\"fieldName\", fieldName);\r\n        ele.setAttribute(\"elementName\", elementName);\r\n        ele.setAttribute(\"idName\",  sel.getAttribute(\"idName\"));\r\n        ele.setAttribute(\"findClass\",  findClass);\r\n        ele.tabIndex = sel.tabIndex;\r\n        var sRepNde = elementName + 'Holder';\r\n        var repNde = document.all(sRepNde);\r\n        repNde.replaceChild(ele, existingNode);\r\n        ele.focus();\r\n      }\r\n    }\r\n  }\r\n\r\n  // currently only used by accountPopup to force activity_accountId to be a select field\r\n  function forceSearchAgain(sel, frm){\r\n    if(sel.tagName == 'SELECT'){\r\n      var fieldName = sel.getAttribute('fieldName');\r\n      var findClass = sel.getAttribute('findClass');\r\n");
1378:                    out
1379:                            .write("      var elementName = sel.name;\r\n      var formName = frm.name;\r\n      var existingNode = document.all(elementName);\r\n\t  var ele = document.createElement(\"INPUT\");\r\n\t  ele.id = sel.name;\r\n\t  ele.name = sel.name;\r\n\t  ele.type = \"TEXT\";\r\n\t  ele.setAttribute(\"className\", existingNode.getAttribute(\"className\"));\r\n\t  ele.setAttribute(\"entityName\", sel.getAttribute(\"entityName\"));\r\n\t  ele.setAttribute(\"fieldName\", fieldName);\r\n\t  ele.setAttribute(\"elementName\", elementName);\r\n\t  ele.setAttribute(\"idName\",  sel.getAttribute(\"idName\"));\r\n\t  ele.setAttribute(\"findClass\",  findClass);\r\n\t  ele.tabIndex = sel.tabIndex;\r\n\t  var sRepNde = elementName + 'Holder';\r\n\t  var repNde = document.all(sRepNde);\r\n\t  repNde.replaceChild(ele, existingNode);\r\n    }\r\n  }\r\n\r\nvar currentCol = 0;\r\nvar previousCol = -1;\r\nvar reverse = false;\r\n\r\n  function CompareAlpha(a, b) {\r\n    if (a[currentCol] ");
1380:                    out
1381:                            .write("< b[currentCol]) { return -1; }\r\n    if (a[currentCol] > b[currentCol]) { return 1; }\r\n    return 0;\r\n  }\r\n\r\n  function CompareAlphaIgnore(a, b) {\r\n    strA = a[currentCol].toLowerCase();\r\n    strB = b[currentCol].toLowerCase();\r\n    if (strA ");
1382:                    out
1383:                            .write("< strB) { return -1;\r\n    } else {\r\n      if (strA > strB) { return 1;\r\n      } else { return 0;\r\n      }\r\n    }\r\n  }\r\n\r\n  function CompareDate(a, b) {\r\n    datA = new Date(a[currentCol]);\r\n    datB = new Date(b[currentCol]);\r\n    if (datA ");
1384:                    out
1385:                            .write("< datB) { return -1;\r\n    } else {\r\n      if (datA > datB) { return 1;\r\n      } else { return 0;\r\n      }\r\n    }\r\n  }\r\n\r\n  function CompareDateEuro(a, b) {\r\n    strA = a[currentCol].split(\".\");\r\n    strB = b[currentCol].split(\".\");\r\n    datA = new Date(strA[2], strA[1], strA[0]);\r\n    datB = new Date(strB[2], strB[1], strB[0]);\r\n    if (datA ");
1386:                    out
1387:                            .write("< datB) { return -1;\r\n    } else {\r\n      if (datA > datB) { return 1;\r\n      } else { return 0;\r\n      }\r\n    }\r\n  }\r\n\r\n  function CompareNumeric(a, b) {\r\n    numA = a[currentCol];\r\n    numB = b[currentCol];\r\n    if (isNaN(numA)) { return 0;\r\n    } else {\r\n      if (isNaN(numB)) { return 0;\r\n      } else { return numA - numB;\r\n      }\r\n    }\r\n  }\r\n\r\nfunction TableSort(myTable, myCol, myType) {\r\n\r\n  var mySource = document.all(myTable);\r\n  var myRows = mySource.rows.length;\r\n  var myCols = mySource.rows(0).cells.length;\r\n  currentCol = myCol\r\n\r\n  var theadrow = mySource.parentElement.tHead;\r\n  var imgcol= theadrow.all('srtImg');\r\n  for(var x = 0; x ");
1388:                    out
1389:                            .write("< imgcol.length; x++){\r\n    imgcol[x].src = \"dude07232001blank.gif\";\r\n    imgcol[x].alt = \"sort\";\r\n  }\r\n\r\n  if(previousCol == myCol){\r\n    if(reverse == false){\r\n      imgcol[myCol-1].src = \"dude07232001down.gif\";\r\n      reverse = true;\r\n    } else {\r\n      imgcol[myCol-1].src = \"dude07232001up.gif\";\r\n      reverse = false;\r\n    }\r\n  } else {\r\n    reverse = false;\r\n    imgcol[myCol-1].src = \"dude07232001up.gif\";\r\n  }\r\n\r\n  myArray = new Array(myRows)\r\n  for (i=0; i ");
1390:                    out
1391:                            .write("< myRows; i++) {\r\n    myArray[i] = new Array(myCols)\r\n    for (j=0; j ");
1392:                    out
1393:                            .write("< myCols; j++) {\r\n      myArray[i][j] = document.all(myTable).rows(i).cells(j).innerHTML;\r\n    }\r\n  }\r\n\r\n  if (myCol == previousCol) {\r\n    myArray.reverse();\r\n  } else {\r\n    switch (myType) {\r\n      case \"a\":\r\n        myArray.sort(CompareAlpha);\r\n        break;\r\n      case \"ai\":\r\n        myArray.sort(CompareAlphaIgnore);\r\n        break;\r\n      case \"d\":\r\n        myArray.sort(CompareDate);\r\n        break;\r\n      case \"de\":\r\n        myArray.sort(CompareDateEuro);\r\n        break;\r\n      case \"n\":\r\n        myArray.sort(CompareNumeric);\r\n        break;\r\n      default:\r\n        myArray.sort();\r\n    }\r\n  }\r\n\r\n\r\n  // Re-write the table contents\r\n  for (i=0; i ");
1394:                    out.write("< myRows; i++) {\r\n    for (j=0; j ");
1395:                    out
1396:                            .write("< myCols; j++) {\r\n      mySource.rows(i).cells(j).innerHTML = myArray[i][j];\r\n    }\r\n  }\r\n\r\n  previousCol = myCol;\r\n  highlightSelectedRow();\r\n  return 0;\r\n\r\n}\r\n\r\n  function fixSize() {\r\n      // The body represents the outer-most frameset for frameset documents.\r\n      if ( parent.name == \"content\" )\r\n      {\r\n\t      maxH = parent.document.body.clientHeight - 150;\r\n\t      topH = document.body.scrollHeight + 10;\r\n\t      if ( topH > maxH )\r\n\t      \ttopH = maxH;\r\n\t      \t\r\n\t      parent.document.body.rows = topH + \", *\"\r\n\t      //window.frames.headerFrame.document.body.rows = window.frames.headerFrame.document.body.scrollHeight + \", *\" \r\n\t      // Walk into the header frame and get the scrollHeight - \r\n\t      // this represents the height of the contents in pixels. \r\n\t  }\r\n  }\r\n");
1397:                    out.write("</script>\r\n\r\n\r\n");
1398:                    out.write("\r\n\r\n");
1399:                    out.write("</HEAD>\r\n\r\n");
1400:                    out.write("<BASE TARGET=\"content\">\r\n");
1401:                    out.write("<!--");
1402:                    out
1403:                            .write("<BODY CLASS=\"bodyform\" onbeforeunload=\"verifyClose()\">-->\r\n");
1404:                    out.write("<BODY CLASS=\"bodyform\"\">\r\n\r\n");
1405:                    out.write("\r\n");
1406:                    out.write("<!-- onBeforeUnload.jsp - Start -->\r\n\r\n");
1407:                    out
1408:                            .write("<SCRIPT LANGUAGE=\"JScript\" TYPE=\"text/javascript\" FOR=window EVENT=onbeforeunload>\r\n return doOnBeforeUnload();\r\n");
1409:                    out.write("</SCRIPT>\r\n\r\n");
1410:                    out
1411:                            .write("<SCRIPT LANGUAGE=\"JScript\" TYPE=\"text/javascript\">\r\n\r\n // Create variable we can change to prevent the check from being done.\r\n var checkForChanges = true;\r\n \r\n function doOnBeforeUnload() {\r\n  // This script fires when anything is about to cause the current page to be unloaded.\r\n  // If any unsaved changes have been made, this script returns a non-empty string, which\r\n  // causes a response window to warn the user that changes will be lost, and to allow\r\n  // them to cancel.\r\n \r\n  // In free form, tabular, and select screen sections built by the UI builder,\r\n  // the preSubmit method fired by the onSubmit event of the form removes this script from\r\n  // the onBeforeUnload event, which prevents this check from happening if the Save button\r\n  // was just clicked.\r\n \r\n // alert(\"event.fromElement: \" + event.fromElement);\r\n \r\n  // See if the checkForChanges flag has been cleared. If so, just allow the\r\n  // body unload to continue.\r\n  if (!checkForChanges) return;\r\n \r\n  // Look at all forms on the page to see if any of them have any changes.\r\n");
1412:                    out
1413:                            .write("  var vFormC = document.forms;\r\n  for (var vFormNbr = 0; vFormNbr ");
1414:                    out
1415:                            .write("< vFormC.length; vFormNbr++) {\r\n   //alert(\"[verifyClose] Window name: \" + window.name);\r\n   //alert(\"[verifyClose] Checking form #\" + vFormNbr);\r\n   var vFormObj = vFormC.item(vFormNbr);\r\n   //alert(\"[verifyClose] Form name is \" + vFormObj.name);\r\n \r\n   // Check the action.  If it's query or view mode, don't bother checking this form.\r\n   var vActionObj = vFormObj.elements.item(\"action\");\r\n   if (vActionObj != null) {\r\n    var vAction = vActionObj.value;\r\n    if (vAction!=null) {\r\n     //alert(\"Action: \" + vAction);\r\n     if (vAction==\"");
1416:                    out.print(UIScreenSection.ACTION_INSERT);
1417:                    out.write("\" ||\r\n         vAction==\"");
1418:                    out.print(UIScreenSection.ACTION_UPDATE);
1419:                    out.write("\" ||\r\n         vAction==\"");
1420:                    out.print(UIScreenSection.ACTION_UPDATE_SELECT);
1421:                    out
1422:                            .write("\") {\r\n \r\n      // This is an updateable form in an updateable mode. Check for changes.\r\n \r\n      // Look through all the objects in the form to see if there are any unsaved changes.\r\n      var vElemC = vFormObj.elements;\r\n      for (var vElemNbr = 0; vElemNbr ");
1423:                    out
1424:                            .write("< vElemC.length; vElemNbr++) {\r\n       var vElemObj = vElemC.item(vElemNbr);\r\n \r\n       // Find out if this is the \"add\" or \"delete\" select object that appears on a \"select\" type screen section.\r\n       //alert(\"[window.onbeforeunload] Object name: \" + vElemObj.name);\r\n       if (vElemObj.name.indexOf(\"DBSel\")>=0) {\r\n        // This is the add or delete select object.  See if there are any items in it.  If so, it means\r\n        // the user has made changes.\r\n        if (vElemObj.length > 0) {\r\n         // Changes have been made.  Trigger the response window.\r\n         return \"IF YOU CLICK OK, YOUR CHANGES WILL BE LOST.\";\r\n        } else {\r\n         // No changes in this add or delete select object.\r\n        }\r\n       } else {\r\n        // Object is not the add or delete select object.\");\r\n        // See if this element is an original value field.\r\n        var vOrigPrefix = \"");
1425:                    out.print(UIWebUtility.HTML_NAME_PREFIX_ORIGINAL);
1426:                    out
1427:                            .write("\";\r\n        if (vElemObj.name.indexOf(vOrigPrefix)==0) {\r\n         // This is an original value field.  Compare its value to the current value field.\r\n         var vOrigElemObj = vElemObj;\r\n         var vOrigElemName = vOrigElemObj.name;\r\n         var vCurElemName = vOrigElemName.substring(vOrigPrefix.length, vOrigElemName.length);\r\n         var vCurElemObj = vElemC.item(vCurElemName);\r\n         var vCurElemTagName = vCurElemObj.tagName;\r\n         var vCurElemType = vCurElemObj.type;\r\n         if (vCurElemObj!=null) {\r\n          // Got the current field. Compare the values.\r\n          var vCurValue;\r\n          if (vCurElemTagName==\"INPUT\" && vCurElemType==\"checkbox\") {\r\n           // This is a check box.  Use special processing to get current value.\r\n           vCurValue = vCurElemObj.checked ? \"Y\" : \"N\";\r\n          } else {\r\n           // Not a check box.\r\n           vCurValue = vCurElemObj.value;\r\n          }\r\n          var vOrigValue = vOrigElemObj.value;\r\n          if (vCurValue != vOrigValue) {\r\n           // This field was changed.  Trigger the response window.\r\n");
1428:                    out
1429:                            .write("    //       alert('Field ' + vCurElemName + ' changed.');\r\n    //       alert('Original Value: ' + vOrigValue);\r\n    //       alert('Current Value: ' + vCurValue);\r\n           return \"IF YOU CLICK OK, YOUR CHANGES WILL BE LOST.\";\r\n          }\r\n         }\r\n        }\r\n       }\r\n      }\r\n     }\r\n    }\r\n   }\r\n  }\r\n }\r\n");
1430:                    out.write("</SCRIPT>\r\n\r\n");
1431:                    out.write("<!-- onBeforeUnload.jsp - End -->\r\n\r\n\r\n");
1432:                    out.write("\r\n\r\n");
1433:                    out
1434:                            .write("<script>\r\n// Title: Timestamp picker\r\n// Description: See the demo at url\r\n// URL: http://us.geocities.com/tspicker/\r\n// Script featured on: http://javascriptkit.com/script/script2/timestamp.shtml\r\n// Version: 1.0\r\n// Date: 12-05-2001 (mm-dd-yyyy)\r\n// Author: Denis Gritcyuk ");
1435:                    out.write("<denis@softcomplex.com>; ");
1436:                    out
1437:                            .write("<tspicker@yahoo.com>\r\n// Notes: Permission given to use this script in any kind of applications if\r\n//    header lines are left unchanged. Feel free to contact the author\r\n//    for feature requests and/or donations\r\n\r\nfunction setCalendarHasFocus(aFormObj, aHasFocus) {\r\n\t// Set hidden variable to show that a popup calendar is about to\r\n\t// be displayed.  This variable will be tested in the onBeforeUnload\r\n\t// handling to avoid popping up a confimation prompt.\r\n\talert(\"setCalendarHasFocus start - \" + aHasFocus);\r\n\tvar vCalendarHasFocusObj = aFormObj.elements.item(\"calendarHasFocus\");\r\n\tif (vCalendarHasFocusObj == null) {\r\n\t\t//alert(\"Did not find calendarHasFocus hidden field\");\r\n\t} else {\r\n\t\t//alert(\"Found calendarHasFocus hidden field\");\r\n\t\tif (aHasFocus) {\r\n\t\t\t//alert(\"Setting calendarHasFocus to true\");\r\n\t\t\tvCalendarHasFocusObj.value = \"true\";\r\n\t\t} else {\r\n\t\t\t//alert(\"Setting calendarHasFocus to false\");\r\n\t\t\tvCalendarHasFocusObj.value = \"false\";\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction show_calendar(str_target, str_datetime, isDateTime) {\r\n");
1438:                    out
1439:                            .write("//\talert(\"show_calendar start\");\r\n\tvar arr_months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\r\n\t\t\"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\r\n\tvar week_days = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\r\n\tvar n_weekstart = 1; // day week starts from (normally 0 or 1)\r\n\r\n\tvar dt_datetime = (str_datetime == null || str_datetime ==\"\" ?  new Date() :  str2datetime(str_datetime) );\r\n\tvar dt_prev_month = new Date(dt_datetime);\r\n\tdt_prev_month.setMonth(dt_datetime.getMonth()-1);\r\n\tvar dt_next_month = new Date(dt_datetime);\r\n\tdt_next_month.setMonth(dt_datetime.getMonth()+1);\r\n\tvar dt_firstday = new Date(dt_datetime);\r\n\tdt_firstday.setDate(1);\r\n\tdt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);\r\n\tvar dt_lastday = new Date(dt_next_month);\r\n\tdt_lastday.setDate(0);\r\n\t\r\n\t// html generation (feel free to tune it for your particular application)\r\n\t// print calendar header\r\n\tvar str_buffer = new String (\r\n\t\t\"");
1440:                    out.write("<html>\\n\"+\r\n\t\t\" ");
1441:                    out.write("<head>\\n\"+\r\n\t\t\"  ");
1442:                    out.write("<title>Calendar");
1443:                    out.write("</title>\\n\"+\r\n\t\t\" ");
1444:                    out.write("</head>\\n\"+\r\n\t\t\" ");
1445:                    out.write("<body bgcolor=\\\"White\\\">\\n\"+\r\n\t\t\"  ");
1446:                    out
1447:                            .write("<table class=\\\"clsOTable\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\"   ");
1448:                    out.write("<tr>\\n\" +\r\n\t\t\"    ");
1449:                    out
1450:                            .write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\"     ");
1451:                    out
1452:                            .write("<table cellspacing=\\\"1\\\" cellpadding=\\\"3\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\"      ");
1453:                    out.write("<tr>\\n\" +\r\n\t\t\"       ");
1454:                    out
1455:                            .write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\"        ");
1456:                    out
1457:                            .write("<a href=\\\"javascript:window.opener.show_calendar('\"+\r\n\t\t           str_target + \"', '\" + dt2dtstr(dt_prev_month)+\"'+' ' +document.cal.time.value);\\\">\" +\r\n\t\t\"         ");
1458:                    out
1459:                            .write("<img src=\\\"/sfaimages/prev.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\"           alt=\\\"previous month\\\">\\n\" +\r\n\t\t\"        ");
1460:                    out.write("</a>\\n\" +\r\n\t\t\"       ");
1461:                    out.write("</td>\\n\" +\r\n\t\t\"       ");
1462:                    out
1463:                            .write("<td bgcolor=\\\"#4682B4\\\" colspan=\\\"5\\\">\\n\" +\r\n\t\t\"        ");
1464:                    out
1465:                            .write("<font color=\\\"white\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\"         \" + arr_months[dt_datetime.getMonth()] + \" \" + dt_datetime.getFullYear() + \"\\n\" +\r\n\t\t\"        ");
1466:                    out.write("</font>\\n\" +\r\n\t\t\"       ");
1467:                    out.write("</td>\\n\" +\r\n\t\t\"       ");
1468:                    out
1469:                            .write("<td bgcolor=\\\"#4682B4\\\" align=\\\"right\\\">\\n\" +\r\n\t\t\"        ");
1470:                    out
1471:                            .write("<a href=\\\"javascript:window.opener.show_calendar('\" +\r\n\t\t           str_target+\"', '\"+dt2dtstr(dt_next_month)+\"'+' ' +document.cal.time.value);\\\">\\n\" +\r\n\t\t\"         ");
1472:                    out
1473:                            .write("<img src=\\\"/sfaimages/next.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\"           alt=\\\"next month\\\">\\n\" +\r\n\t\t\"        ");
1474:                    out.write("</a>\\n\" +\r\n\t\t\"       ");
1475:                    out.write("</td>\\n\" +\r\n\t\t\"      ");
1476:                    out
1477:                            .write("</tr>\\n\"\r\n\t);\r\n\r\n\tvar dt_current_day = new Date(dt_firstday);\r\n\t// print weekdays titles\r\n\tstr_buffer += \"      ");
1478:                    out.write("<tr>\\n\";\r\n\tfor (var n=0; n");
1479:                    out.write("<7; n++)\r\n\t\tstr_buffer += \"       ");
1480:                    out
1481:                            .write("<td bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\"       ");
1482:                    out
1483:                            .write("<font color=\\\"white\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\"        \" + week_days[(n_weekstart+n)%7] + \"\\n\" +\r\n\t\t\"       ");
1484:                    out.write("</font>");
1485:                    out
1486:                            .write("</td>\\n\";\r\n\t// print calendar table\r\n\tstr_buffer += \"      ");
1487:                    out
1488:                            .write("</tr>\\n\";\r\n\twhile (dt_current_day.getMonth() == dt_datetime.getMonth() ||\r\n\t\tdt_current_day.getMonth() == dt_firstday.getMonth()) {\r\n\t\t// print row heder\r\n\t\tstr_buffer += \"      ");
1489:                    out
1490:                            .write("<tr>\\n\";\r\n\t\tfor (var n_current_wday=0; n_current_wday");
1491:                    out
1492:                            .write("<7; n_current_wday++) {\r\n\t\t\t\tif (dt_current_day.getDate() == dt_datetime.getDate() &&\r\n\t\t\t\t\tdt_current_day.getMonth() == dt_datetime.getMonth())\r\n\t\t\t\t\t// print current date\r\n\t\t\t\t\tstr_buffer += \"       ");
1493:                    out
1494:                            .write("<td bgcolor=\\\"#FFB6C1\\\" align=\\\"right\\\">\\n\";\r\n\t\t\t\telse if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)\r\n\t\t\t\t\t// weekend days\r\n\t\t\t\t\tstr_buffer += \"       ");
1495:                    out
1496:                            .write("<td bgcolor=\\\"#DBEAF5\\\" align=\\\"right\\\">\\n\";\r\n\t\t\t\telse\r\n\t\t\t\t\t// print working days of current month\r\n\t\t\t\t\tstr_buffer += \"       ");
1497:                    out
1498:                            .write("<td bgcolor=\\\"white\\\" align=\\\"right\\\">\\n\";\r\n\r\n\t\t\t\tif (isDateTime == \"1\" )\r\n\t\t\t\t\tstr_buffer += \"        ");
1499:                    out
1500:                            .write("<a href=\\\"javascript:window.opener.\" + str_target +\r\n\t\t\t\t\t\t\".value='\"+dt2dtstr(dt_current_day)+\"'+' ' +document.cal.time.value;window.close();\\\">\\n\";\r\n\t\t\t\telse\r\n\t\t\t\t\tstr_buffer += \"        ");
1501:                    out
1502:                            .write("<a href=\\\"javascript:window.opener.\" + str_target +\r\n\t\t\t\t\t\t\".value='\"+dt2dtstr(dt_current_day)+\"';window.close();\\\">\\n\";\r\n\t\t\t\t\t\r\n\t\t\t\tif (dt_current_day.getMonth() == dt_datetime.getMonth())\r\n\t\t\t\t\t// print days of current month\r\n\t\t\t\t\tstr_buffer += \"         ");
1503:                    out
1504:                            .write("<font color=\\\"black\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\";\r\n\t\t\t\telse \r\n\t\t\t\t\t// print days of other months\r\n\t\t\t\t\tstr_buffer += \"         ");
1505:                    out
1506:                            .write("<font color=\\\"gray\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\";\r\n\t\t\t\t\t\r\n\t\t\t\tstr_buffer += \"          \" + dt_current_day.getDate() + \"\\n\" +\r\n\t\t\t\t\"         ");
1507:                    out.write("</font>\\n\" +\r\n\t\t\t\t\"        ");
1508:                    out.write("</a>\\n\" +\r\n\t\t\t\t\"       ");
1509:                    out
1510:                            .write("</td>\\n\";\r\n\t\t\t\tdt_current_day.setDate(dt_current_day.getDate()+1);\r\n\t\t}\r\n\t\t// print row footer\r\n\t\tstr_buffer += \"      ");
1511:                    out
1512:                            .write("</tr>\\n\";\r\n\t}\r\n\t// print calendar footer\r\n\tstr_buffer +=\r\n\t\t\"      ");
1513:                    out
1514:                            .write("<form name=\\\"cal\\\">\\n\" +\r\n\t\t\"       ");
1515:                    out.write("<tr>\\n\" +\r\n\t\t\"        ");
1516:                    out
1517:                            .write("<td colspan=\\\"7\\\" bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\"         ");
1518:                    out
1519:                            .write("<font color=\\\"White\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\"          Time:\\n\" +\r\n\t\t\"          ");
1520:                    out
1521:                            .write("<input type=\\\"text\\\" name=\\\"time\\\" value=\\\"\" + dt2tmstr(dt_datetime) +\r\n\t\t\"\\\" size=\\\"8\\\" maxlength=\\\"8\\\">\\n\" +\r\n\t\t\"         ");
1522:                    out.write("</font>\\n\" +\r\n\t\t\"        ");
1523:                    out.write("</td>\\n\" +\r\n\t\t\"       ");
1524:                    out.write("</tr>\\n\" +\r\n\t\t\"      ");
1525:                    out.write("</form>\\n\" +\r\n\t\t\"     ");
1526:                    out.write("</table>\\n\" +\r\n\t\t\"    ");
1527:                    out.write("</tr>\\n\" +\r\n\t\t\"   ");
1528:                    out.write("</td>\\n\" +\r\n\t\t\"  ");
1529:                    out.write("</table>\\n\" +\r\n\t\t\" ");
1530:                    out.write("</body>\\n\" +\r\n\t\t\"");
1531:                    out
1532:                            .write("</html>\\n\";\r\n\r\n\t//alert(\"Fixin to open window\");\r\n\tvar vWinCal = window.open(\"\", \"Calendar\", \r\n\t\t\"width=200,height=250,status=no,resizable=yes,top=200,left=200\");\r\n\t//alert(\"Fixin to set window opener to self\");\r\n\tvWinCal.opener = self;\r\n\tvar calc_doc = vWinCal.document;\r\n\t//alert(\"Fixin to write str_buffer\");\r\n\tcalc_doc.write (str_buffer);\r\n\tcalc_doc.close();\r\n}\r\n// datetime parsing and formatting routimes. modify them if you wish other datetime format\r\nfunction str2datetime (str_datetime) {\r\n\tvar re_date = /^(\\d+)\\/(\\d+)\\/(\\d+)\\s+(\\d+)\\:(\\d+)\\:(\\d+)$/;\r\n\tif (!re_date.exec(str_datetime))\r\n\t\treturn str2date(str_datetime)\r\n\treturn (new Date (RegExp.$3, RegExp.$1-1, RegExp.$2, RegExp.$4, RegExp.$5, RegExp.$6));\r\n}\r\nfunction str2date (str_date) {\r\n\tvar re_date = /^(\\d+)\\/(\\d+)\\/(\\d+)$/;\r\n\tif (!re_date.exec(str_date))\r\n\t\treturn alert(\"Invalid Date format: \"+ str_date);\r\n\treturn (new Date (RegExp.$3, RegExp.$1-1, RegExp.$2, 0, 0, 0));\r\n}\r\n\r\nfunction dt2dtstr (dt_datetime) {\r\n\treturn (new String (\r\n\t\t\t(dt_datetime.getMonth()+1)+\"/\"+dt_datetime.getDate()+\"/\"+dt_datetime.getFullYear()));\r\n");
1533:                    out
1534:                            .write("}\r\nfunction dt2tmstr (dt_datetime) {\r\n\treturn (new String (\r\n\t\t\tdt_datetime.getHours()+\":\"+dt_datetime.getMinutes()+\":\"+dt_datetime.getSeconds()));\r\n}\r\n\r\n");
1535:                    out.write("</script>\r\n");
1536:                    out.write("\r\n\r\n");
1537:                    out.write("\r\n");
1538:
1539:                    // Define the roles.
1540:                    String ROLE_SFA_ADMIN = "SFA_ADMIN";
1541:                    String ROLE_SFA_USER = "SFA_USER";
1542:                    String ROLE_SFA_LEADS_ADMIN = "SFA_LEADS_ADMIN";
1543:                    String ROLE_SFA_LEADS_USER = "SFA_LEADS_USER";
1544:
1545:                    // Define menu items on Sales menu.
1546:                    Integer MENU_DASHBOARD = new Integer(100);
1547:                    Integer MENU_LEADS = new Integer(101);
1548:                    Integer MENU_ACCOUNTS = new Integer(102);
1549:                    Integer MENU_CONTACTS = new Integer(103);
1550:                    Integer MENU_OPPORTUNITIES = new Integer(104);
1551:                    Integer MENU_ACTIVITIES = new Integer(105);
1552:                    Integer MENU_TIME_MANAGEMENT = new Integer(106);
1553:                    Integer MENU_FORECASTS = new Integer(107);
1554:                    Integer MENU_PRODUCTS = new Integer(108);
1555:                    Integer MENU_TERRITORIES = new Integer(109);
1556:                    Integer MENU_XFER = new Integer(110);
1557:
1558:                    // Define menu items on Services menu.
1559:                    Integer MENU_ISSUE_TRACKING = new Integer(200);
1560:                    Integer MENU_CURRENT_ISSUES = new Integer(201);
1561:                    Integer MENU_ISSUE_CHARTS = new Integer(202);
1562:
1563:                    // Define menu items on Reports menu.
1564:                    Integer MENU_ACCOUNT_LIST_RPT = new Integer(300);
1565:                    Integer MENU_CONTACT_LIST_RPT = new Integer(301);
1566:                    Integer MENU_PIPELINE_RPT = new Integer(302);
1567:                    Integer MENU_PIPELINE_CHART = new Integer(303);
1568:                    Integer MENU_WIN_LOSS_RPT = new Integer(304);
1569:                    Integer MENU_ACTIVITIES_RPT = new Integer(305);
1570:                    Integer MENU_OPPORTUNITY_OVERVIEW_RPT = new Integer(306);
1571:                    Integer MENU_REPORT_BUILDER_RPT = new Integer(307);
1572:
1573:                    // Define menu items on Admin menu.
1574:                    Integer MENU_MY_COMPANY = new Integer(400);
1575:                    Integer MENU_APPLICATIONS = new Integer(401);
1576:                    Integer MENU_SCREENS = new Integer(402);
1577:                    Integer MENU_ENTITIES = new Integer(403);
1578:                    Integer MENU_CODES = new Integer(404);
1579:                    Integer MENU_DISPLAY_TYPES = new Integer(405);
1580:                    Integer MENU_PREFERENCES = new Integer(406);
1581:                    Integer MENU_LEAD_QUEUES = new Integer(407);
1582:                    Integer MENU_LEAD_RULES = new Integer(408);
1583:                    Integer MENU_STEPS_TO_CLOSE = new Integer(409);
1584:                    Integer MENU_REPLICATION = new Integer(410);
1585:                    Integer MENU_SQL_QUERY = new Integer(411);
1586:                    Integer MENU_USER_TRANSFER = new Integer(412);
1587:
1588:                    // Define privileges for SFA Admin role.
1589:                    ArrayList menuPrivsSfaAdmin = new ArrayList();
1590:                    menuPrivsSfaAdmin.add(MENU_DASHBOARD);
1591:                    menuPrivsSfaAdmin.add(MENU_LEADS);
1592:                    menuPrivsSfaAdmin.add(MENU_ACCOUNTS);
1593:                    menuPrivsSfaAdmin.add(MENU_CONTACTS);
1594:                    menuPrivsSfaAdmin.add(MENU_OPPORTUNITIES);
1595:                    menuPrivsSfaAdmin.add(MENU_ACTIVITIES);
1596:                    menuPrivsSfaAdmin.add(MENU_TIME_MANAGEMENT);
1597:                    menuPrivsSfaAdmin.add(MENU_FORECASTS);
1598:                    menuPrivsSfaAdmin.add(MENU_PRODUCTS);
1599:                    menuPrivsSfaAdmin.add(MENU_TERRITORIES);
1600:                    menuPrivsSfaAdmin.add(MENU_XFER);
1601:                    menuPrivsSfaAdmin.add(MENU_ISSUE_TRACKING);
1602:                    menuPrivsSfaAdmin.add(MENU_CURRENT_ISSUES);
1603:                    menuPrivsSfaAdmin.add(MENU_ISSUE_CHARTS);
1604:                    menuPrivsSfaAdmin.add(MENU_ACCOUNT_LIST_RPT);
1605:                    menuPrivsSfaAdmin.add(MENU_CONTACT_LIST_RPT);
1606:                    menuPrivsSfaAdmin.add(MENU_PIPELINE_RPT);
1607:                    menuPrivsSfaAdmin.add(MENU_PIPELINE_CHART);
1608:                    menuPrivsSfaAdmin.add(MENU_WIN_LOSS_RPT);
1609:                    menuPrivsSfaAdmin.add(MENU_ACTIVITIES_RPT);
1610:                    menuPrivsSfaAdmin.add(MENU_OPPORTUNITY_OVERVIEW_RPT);
1611:                    menuPrivsSfaAdmin.add(MENU_REPORT_BUILDER_RPT);
1612:                    menuPrivsSfaAdmin.add(MENU_MY_COMPANY);
1613:                    menuPrivsSfaAdmin.add(MENU_APPLICATIONS);
1614:                    menuPrivsSfaAdmin.add(MENU_SCREENS);
1615:                    menuPrivsSfaAdmin.add(MENU_ENTITIES);
1616:                    menuPrivsSfaAdmin.add(MENU_CODES);
1617:                    menuPrivsSfaAdmin.add(MENU_DISPLAY_TYPES);
1618:                    menuPrivsSfaAdmin.add(MENU_PREFERENCES);
1619:                    menuPrivsSfaAdmin.add(MENU_LEAD_QUEUES);
1620:                    menuPrivsSfaAdmin.add(MENU_LEAD_RULES);
1621:                    menuPrivsSfaAdmin.add(MENU_STEPS_TO_CLOSE);
1622:                    menuPrivsSfaAdmin.add(MENU_REPLICATION);
1623:                    menuPrivsSfaAdmin.add(MENU_SQL_QUERY);
1624:                    menuPrivsSfaAdmin.add(MENU_USER_TRANSFER);
1625:
1626:                    // Define privileges for SFA User role.
1627:                    ArrayList menuPrivsSfaUser = new ArrayList();
1628:                    menuPrivsSfaUser.add(MENU_DASHBOARD);
1629:                    menuPrivsSfaUser.add(MENU_LEADS);
1630:                    menuPrivsSfaUser.add(MENU_ACCOUNTS);
1631:                    menuPrivsSfaUser.add(MENU_CONTACTS);
1632:                    menuPrivsSfaUser.add(MENU_OPPORTUNITIES);
1633:                    menuPrivsSfaUser.add(MENU_ACTIVITIES);
1634:                    menuPrivsSfaUser.add(MENU_TIME_MANAGEMENT);
1635:                    menuPrivsSfaUser.add(MENU_FORECASTS);
1636:                    menuPrivsSfaUser.add(MENU_PRODUCTS);
1637:                    menuPrivsSfaUser.add(MENU_XFER);
1638:                    menuPrivsSfaUser.add(MENU_ISSUE_TRACKING);
1639:                    menuPrivsSfaUser.add(MENU_CURRENT_ISSUES);
1640:                    menuPrivsSfaUser.add(MENU_ISSUE_CHARTS);
1641:                    menuPrivsSfaUser.add(MENU_ACCOUNT_LIST_RPT);
1642:                    menuPrivsSfaUser.add(MENU_CONTACT_LIST_RPT);
1643:                    menuPrivsSfaUser.add(MENU_PIPELINE_RPT);
1644:                    menuPrivsSfaUser.add(MENU_PIPELINE_CHART);
1645:                    menuPrivsSfaUser.add(MENU_WIN_LOSS_RPT);
1646:                    menuPrivsSfaUser.add(MENU_ACTIVITIES_RPT);
1647:                    menuPrivsSfaUser.add(MENU_OPPORTUNITY_OVERVIEW_RPT);
1648:                    menuPrivsSfaUser.add(MENU_REPORT_BUILDER_RPT);
1649:                    menuPrivsSfaUser.add(MENU_REPLICATION);
1650:                    menuPrivsSfaUser.add(MENU_XFER);
1651:
1652:                    // Define privileges for SFA Leads Admin role.
1653:                    ArrayList menuPrivsSfaLeadsAdmin = new ArrayList();
1654:                    menuPrivsSfaLeadsAdmin.add(MENU_DASHBOARD);
1655:                    menuPrivsSfaLeadsAdmin.add(MENU_LEADS);
1656:                    menuPrivsSfaLeadsAdmin.add(MENU_ACCOUNTS);
1657:                    menuPrivsSfaLeadsAdmin.add(MENU_CONTACTS);
1658:                    menuPrivsSfaLeadsAdmin.add(MENU_ACTIVITIES);
1659:                    menuPrivsSfaLeadsAdmin.add(MENU_TIME_MANAGEMENT);
1660:                    menuPrivsSfaLeadsAdmin.add(MENU_TERRITORIES);
1661:                    menuPrivsSfaLeadsAdmin.add(MENU_XFER);
1662:                    menuPrivsSfaLeadsAdmin.add(MENU_ISSUE_TRACKING);
1663:                    menuPrivsSfaLeadsAdmin.add(MENU_CURRENT_ISSUES);
1664:                    menuPrivsSfaLeadsAdmin.add(MENU_ISSUE_CHARTS);
1665:                    menuPrivsSfaLeadsAdmin.add(MENU_ACTIVITIES_RPT);
1666:                    menuPrivsSfaLeadsAdmin.add(MENU_REPORT_BUILDER_RPT);
1667:                    menuPrivsSfaLeadsAdmin.add(MENU_MY_COMPANY);
1668:                    menuPrivsSfaLeadsAdmin.add(MENU_SCREENS);
1669:                    menuPrivsSfaLeadsAdmin.add(MENU_CODES);
1670:                    menuPrivsSfaLeadsAdmin.add(MENU_PREFERENCES);
1671:                    menuPrivsSfaLeadsAdmin.add(MENU_LEAD_QUEUES);
1672:                    menuPrivsSfaLeadsAdmin.add(MENU_LEAD_RULES);
1673:                    menuPrivsSfaLeadsAdmin.add(MENU_XFER);
1674:
1675:                    // Define privileges for SFA Leads User role.
1676:                    ArrayList menuPrivsSfaLeadsUser = new ArrayList();
1677:                    menuPrivsSfaLeadsUser.add(MENU_DASHBOARD);
1678:                    menuPrivsSfaLeadsUser.add(MENU_LEADS);
1679:                    menuPrivsSfaLeadsUser.add(MENU_ACTIVITIES);
1680:                    menuPrivsSfaLeadsUser.add(MENU_TIME_MANAGEMENT);
1681:                    menuPrivsSfaLeadsUser.add(MENU_ACTIVITIES_RPT);
1682:                    menuPrivsSfaLeadsUser.add(MENU_REPORT_BUILDER_RPT);
1683:                    menuPrivsSfaLeadsUser.add(MENU_XFER);
1684:
1685:                    ArrayList menuPrivileges = new ArrayList();
1686:
1687:                    String module = "getMenuPrivileges";
1688:
1689:                    if (userInfo != null && userInfo.getPartyId() != null
1690:                            && !userInfo.getPartyId().equals("")) {
1691:
1692:                        // User is logged in. Get the user's roles.
1693:                        HashMap partyRoleFindMap = new HashMap();
1694:                        partyRoleFindMap.put("partyId", userInfo.getPartyId());
1695:                        try {
1696:                            List partyRoleL = delegator.findByAnd("PartyRole",
1697:                                    partyRoleFindMap);
1698:
1699:                            Iterator partyRoleI = partyRoleL.iterator();
1700:                            while (partyRoleI.hasNext()) {
1701:                                GenericValue partyRoleGV = (GenericValue) partyRoleI
1702:                                        .next();
1703:                                String roleTypeId = partyRoleGV
1704:                                        .getString("roleTypeId") == null ? ""
1705:                                        : partyRoleGV.getString("roleTypeId");
1706:
1707:                                if (roleTypeId.equals(ROLE_SFA_ADMIN)) {
1708:                                    menuPrivileges.addAll(menuPrivsSfaAdmin);
1709:                                } else if (roleTypeId.equals(ROLE_SFA_USER)) {
1710:                                    menuPrivileges.addAll(menuPrivsSfaUser);
1711:                                } else if (roleTypeId
1712:                                        .equals(ROLE_SFA_LEADS_ADMIN)) {
1713:                                    menuPrivileges
1714:                                            .addAll(menuPrivsSfaLeadsAdmin);
1715:                                } else if (roleTypeId
1716:                                        .equals(ROLE_SFA_LEADS_USER)) {
1717:                                    menuPrivileges
1718:                                            .addAll(menuPrivsSfaLeadsUser);
1719:                                }
1720:                            }
1721:
1722:                        } catch (Exception e) {
1723:                            Debug.logError("Error retrieving user roles: "
1724:                                    + e.getLocalizedMessage(), module);
1725:                            out.write("Error retrieving user roles: "
1726:                                    + e.getLocalizedMessage());
1727:                            return;
1728:                        }
1729:
1730:                    }
1731:
1732:                    out.write("\r\n");
1733:                    out.write("\r\n\r\n");
1734:                    out
1735:                            .write("<STYLE>\r\n  div    {\r\n         position:absolute;\r\n         }\r\n");
1736:                    out.write("</STYLE>\r\n\r\n");
1737:                    out
1738:                            .write("<SCRIPT>\r\n\r\n// ---------------------------------------------------------------------------\r\n// Example of howto: use OutlookBar\r\n// ---------------------------------------------------------------------------\r\n\r\n\r\n  //create OutlookBar\r\n  var o = new createOutlookBar('Bar',0,0,screenSize.width,screenSize.height,'#6699CC','white')//'#000099') // OutlookBar\r\n  var p\r\n  var mtarget = \"parent.mainwindow.content.location\"\r\n\r\n  //create first panel\r\n  p = new createPanel('l4','Sales');\r\n\r\n");
1739:                    if (menuPrivileges.contains(MENU_DASHBOARD)) {
1740:                        out
1741:                                .write("\r\n  p.addButton('/sfaimages/screens.gif','Dashboard', mtarget+'=\"/sfa/control/frontpage\"');\r\n");
1742:                    }
1743:                    out.write("\r\n  \r\n");
1744:                    if (menuPrivileges.contains(MENU_LEADS)) {
1745:                        out
1746:                                .write("\r\n  p.addButton('/sfaimages/leads.gif','Leads', mtarget+'=\"/sfa/control/leadHome?action=");
1747:                        out.print(UIScreenSection.ACTION_QUERY);
1748:                        out.write("&savedQueryName=");
1749:                        out.print(UIQuery.LAST_QUERY_NAME_URL_ENCODED);
1750:                        out.write("\"');\r\n");
1751:                    }
1752:                    out.write("\r\n  \r\n");
1753:                    if (menuPrivileges.contains(MENU_ACCOUNTS)) {
1754:                        out
1755:                                .write("\r\n  p.addButton('/sfaimages/accounts.gif','Accounts', mtarget+'=\"/sfa/control/accounts\"');\r\n");
1756:                    }
1757:                    out.write("\r\n  \r\n");
1758:                    if (menuPrivileges.contains(MENU_CONTACTS)) {
1759:                        out
1760:                                .write("\r\n  p.addButton('/sfaimages/contacts.gif','Contacts', mtarget+'=\"/sfa/control/contacts\"');\r\n");
1761:                    }
1762:                    out.write("\r\n  \r\n");
1763:                    if (menuPrivileges.contains(MENU_OPPORTUNITIES)) {
1764:                        out
1765:                                .write("\r\n  p.addButton('/sfaimages/opportunities.gif','Opportunities', mtarget+'=\"/sfa/control/deals\"');\r\n");
1766:                    }
1767:                    out.write("\r\n  \r\n");
1768:                    if (menuPrivileges.contains(MENU_ACTIVITIES)) {
1769:                        out
1770:                                .write("\r\n  p.addButton('/sfaimages/activities.gif','Activities', mtarget+'=\"/sfa/control/activities\"');\r\n");
1771:                    }
1772:                    out.write("\r\n  \r\n");
1773:                    if (menuPrivileges.contains(MENU_TIME_MANAGEMENT)) {
1774:                        out
1775:                                .write("\r\n  p.addButton('/sfaimages/clock.gif','Time Management', mtarget+'=\"/sfa/control/activityCalendar\"');\r\n");
1776:                    }
1777:                    out.write("\r\n  \r\n");
1778:                    if (menuPrivileges.contains(MENU_FORECASTS)) {
1779:                        out
1780:                                .write("\r\n  p.addButton('/sfaimages/forecasts.gif','Forecasts', mtarget+'=\"/sfa/control/forecasts\"');\r\n");
1781:                    }
1782:                    out.write("\r\n  \r\n");
1783:                    if (menuPrivileges.contains(MENU_PRODUCTS)) {
1784:                        out
1785:                                .write("\r\n  p.addButton('/sfaimages/products.gif','Products', mtarget+'=\"/sfa/control/productsAdmin\"');\r\n");
1786:                    }
1787:                    out.write("\r\n  \r\n");
1788:                    if (menuPrivileges.contains(MENU_TERRITORIES)) {
1789:                        out
1790:                                .write("\r\n  p.addButton('/sfaimages/territories.gif','Territories', mtarget+'=\"/sfa/control/territory\"');\r\n");
1791:                    }
1792:                    out.write("\r\n\r\n  ");
1793:                    if (menuPrivileges.contains(MENU_REPORT_BUILDER_RPT)) {
1794:                        out
1795:                                .write("\r\n  p.addButton('/sfaimages/quotas.gif','Report Builder', mtarget+'=\"/sfa/reports/uiReport.jsp?action=start\"');\r\n");
1796:                    }
1797:                    out.write("\r\n\r\n\r\n");
1798:                    if (menuPrivileges.contains(MENU_XFER)) {
1799:                        out
1800:                                .write("\r\n  p.addButton('/sfaimages/Refresh24.gif','Import/Export', mtarget+'=\"/sfa/control/xferHome\"');\r\n");
1801:                    }
1802:                    out
1803:                            .write("\r\n  \r\n  o.addPanel(p);\r\n\r\n  p = new createPanel('p','Services');\r\n");
1804:                    if (menuPrivileges.contains(MENU_ISSUE_TRACKING)) {
1805:                        out
1806:                                .write("\r\n  p.addButton('/sfaimages/issues.gif','Issue Tracking', mtarget+'=\"/sfa/control/issues\"');\r\n");
1807:                    }
1808:                    out.write("\r\n  \r\n");
1809:                    if (menuPrivileges.contains(MENU_CURRENT_ISSUES)) {
1810:                        out
1811:                                .write("\r\n  p.addButton('/sfaimages/issuelist.gif','Current Issues', mtarget+'=\"/sfa/control/issueListReportQuery?action=");
1812:                        out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
1813:                        out.write("\"');\r\n");
1814:                    }
1815:                    out.write("\r\n  \r\n");
1816:                    if (menuPrivileges.contains(MENU_ISSUE_CHARTS)) {
1817:                        out
1818:                                .write("\r\n // p.addButton('/sfaimages/forecasts.gif','Issue Charts', mtarget+'=\"/sfa/control/issueChartFrame?chart=1\"');\r\n");
1819:                    }
1820:                    out
1821:                            .write("\r\n  \r\n  o.addPanel(p);\r\n\r\n  p = new createPanel('l','Reports');\r\n");
1822:                    if (menuPrivileges.contains(MENU_REPORT_BUILDER_RPT)) {
1823:                        out
1824:                                .write("\r\n  p.addButton('/sfaimages/quotas.gif','Report Builder', mtarget+'=\"/sfa/reports/uiReport.jsp?action=start\"');\r\n");
1825:                    }
1826:                    out.write("\r\n");
1827:                    if (menuPrivileges.contains(MENU_ACCOUNT_LIST_RPT)) {
1828:                        out
1829:                                .write("\r\n  p.addButton('/sfaimages/accounts.gif','Account List', mtarget+'=\"/sfa/control/accountListReportQuery?action=");
1830:                        out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
1831:                        out.write("\"');\r\n");
1832:                    }
1833:                    out.write("\r\n  \r\n");
1834:                    if (menuPrivileges.contains(MENU_CONTACT_LIST_RPT)) {
1835:                        out
1836:                                .write("\r\n  p.addButton('/sfaimages/contacts.gif','Contact List', mtarget+'=\"/sfa/control/contactListReportQuery?action=");
1837:                        out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
1838:                        out.write("\"');\r\n");
1839:                    }
1840:                    out.write("\r\n  \r\n");
1841:                    if (menuPrivileges.contains(MENU_PIPELINE_RPT)) {
1842:                        out
1843:                                .write("\r\n  p.addButton('/sfaimages/quotas.gif','Pipeline Report', mtarget+'=\"/sfa/control/opportunityPipelineReportQuery?action=");
1844:                        out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
1845:                        out.write("\"');\r\n");
1846:                    }
1847:                    out.write("\r\n  \r\n");
1848:                    if (menuPrivileges.contains(MENU_PIPELINE_CHART)) {
1849:                        out
1850:                                .write("\r\n  //p.addButton('/sfaimages/forecasts.gif','Pipeline Chart', mtarget+'=\"/sfa/control/pipelineChart\"');\r\n");
1851:                    }
1852:                    out.write("\r\n  \r\n");
1853:                    if (menuPrivileges.contains(MENU_WIN_LOSS_RPT)) {
1854:                        out
1855:                                .write("\r\n  //p.addButton('/sfaimages/winloss.gif','Win Loss', mtarget+'=\"/sfa/control/frontpage\"');\r\n");
1856:                    }
1857:                    out.write("\r\n  \r\n");
1858:                    if (menuPrivileges.contains(MENU_ACTIVITIES_RPT)) {
1859:                        out
1860:                                .write("\r\n  p.addButton('/sfaimages/clock.gif','Activities', mtarget+'=\"/sfa/control/activitiesReportQuery?action=");
1861:                        out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
1862:                        out.write("\"');\r\n");
1863:                    }
1864:                    out.write("\r\n\r\n");
1865:                    if (menuPrivileges.contains(MENU_ACTIVITIES_RPT)) {
1866:                        out
1867:                                .write("\r\n  p.addButton('/sfaimages/leads.gif','Lead Report', mtarget+'=\"/sfa/control/leadReport?groupName=status\"');\r\n");
1868:                    }
1869:                    out.write("  \r\n  \r\n");
1870:                    if (menuPrivileges.contains(MENU_OPPORTUNITY_OVERVIEW_RPT)) {
1871:                        out
1872:                                .write("\r\n  p.addButton('/sfaimages/opportunities.gif','Opportunity Overview', mtarget+'=\"/sfa/control/opportunityOverviewReportQuery?action=");
1873:                        out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
1874:                        out.write("\"');\r\n");
1875:                    }
1876:                    out
1877:                            .write("\r\n\r\n  o.addPanel(p);\r\n\r\n  p = new createPanel('l2','Admin');\r\n");
1878:                    if (menuPrivileges.contains(MENU_MY_COMPANY)) {
1879:                        out
1880:                                .write("\r\n  p.addButton('/sfaimages/accounts.gif','My Company', mtarget+'=\"/sfa/control/myCompany\"');\r\n");
1881:                    }
1882:                    out.write("\r\n\r\n");
1883:                    if (menuPrivileges.contains(MENU_APPLICATIONS)) {
1884:                        out
1885:                                .write("\r\n  p.addButton('/sfaimages/applications.gif','Applications', mtarget+'=\"/sfa/control/applications\"');\r\n");
1886:                    }
1887:                    out.write("\r\n\r\n");
1888:                    if (menuPrivileges.contains(MENU_SCREENS)) {
1889:                        out
1890:                                .write("\r\n  p.addButton('/sfaimages/screens.gif','Screens', mtarget+'=\"/sfa/control/uiScreen\"');\r\n");
1891:                    }
1892:                    out.write("\r\n\r\n");
1893:                    if (menuPrivileges.contains(MENU_ENTITIES)) {
1894:                        out
1895:                                .write("\r\n  p.addButton('/sfaimages/account.gif','Entities', mtarget+'=\"/sfa/control/uiEntity\"');\r\n");
1896:                    }
1897:                    out.write("\r\n\r\n");
1898:                    if (menuPrivileges.contains(MENU_CODES)) {
1899:                        out
1900:                                .write("\r\n  p.addButton('/sfaimages/codes.gif','Codes', mtarget+'=\"/sfa/control/codes\"');\r\n");
1901:                    }
1902:                    out.write("\r\n\r\n");
1903:                    if (menuPrivileges.contains(MENU_DISPLAY_TYPES)) {
1904:                        out
1905:                                .write("\r\n  p.addButton('/sfaimages/display.gif','Display Types', mtarget+'=\"/sfa/control/uiDisplayType\"');\r\n");
1906:                    }
1907:                    out.write("\r\n\r\n");
1908:                    if (menuPrivileges.contains(MENU_PREFERENCES)) {
1909:                        out
1910:                                .write("\r\n  p.addButton('/sfaimages/admin3.gif','Preferences', mtarget+'=\"/sfa/control/preferences\"');\r\n");
1911:                    }
1912:                    out.write("\r\n\r\n");
1913:                    if (menuPrivileges.contains(MENU_LEAD_QUEUES)) {
1914:                        out
1915:                                .write("\r\n  p.addButton('/sfaimages/leadQueue.gif','Lead Queues', mtarget+'=\"/sfa/control/leadQueues\"');\r\n");
1916:                    }
1917:                    out.write("\r\n\r\n");
1918:                    if (menuPrivileges.contains(MENU_LEAD_RULES)) {
1919:                        out
1920:                                .write("\r\n  p.addButton('/sfaimages/leadRule.gif', 'Lead Rules', mtarget+'=\"/sfa/control/leadRules\"');\r\n");
1921:                    }
1922:                    out.write("\r\n\r\n");
1923:                    if (menuPrivileges.contains(MENU_STEPS_TO_CLOSE)) {
1924:                        out
1925:                                .write("\r\n  p.addButton('/sfaimages/admin4.gif','Steps To Close', mtarget+'=\"/sfa/control/stepsToCloseAdmin\"');\r\n");
1926:                    }
1927:                    out.write("\r\n\r\n");
1928:                    if (menuPrivileges.contains(MENU_REPLICATION)) {
1929:                        out
1930:                                .write("\r\n  p.addButton('/sfaimages/admin2.gif','Replication', mtarget+'=\"/sfa/control/replicationLogin\"');\r\n");
1931:                    }
1932:                    out.write("\r\n\r\n");
1933:                    if (menuPrivileges.contains(MENU_SQL_QUERY)) {
1934:                        out
1935:                                .write("\r\n  p.addButton('/sfaimages/search.gif','Sql Query', mtarget+'=\"/sfa/control/sqlQueryInput\"');\r\n");
1936:                    }
1937:                    out.write("\r\n\r\n");
1938:                    if (menuPrivileges.contains(MENU_USER_TRANSFER)) {
1939:                        out
1940:                                .write("\r\n  p.addButton('/sfaimages/contacts.gif','User Transfer', mtarget+'=\"/sfa/control/contactTransfer\"');\r\n");
1941:                    }
1942:                    out
1943:                            .write("\r\n\r\n  o.addPanel(p);\r\n\r\n\r\n\r\n  o.draw();         //draw the OutlookBar\r\n  o.showPanel(0);\r\n\r\n//-----------------------------------------------------------------------------\r\n//functions to manage window resize\r\n//-----------------------------------------------------------------------------\r\n//resize OP5 (test screenSize every 100ms)\r\nfunction resize_op5() {\r\n  if (bt.op5) {\r\n    o.showPanel(o.aktPanel);\r\n    var s = new createPageSize();\r\n    if ((screenSize.width!=s.width) || (screenSize.height!=s.height)) {\r\n      screenSize=new createPageSize();\r\n      //need setTimeout or resize on window-maximize will not work correct!\r\n      //benötige das setTimeout oder das Maximieren funktioniert nicht richtig\r\n      setTimeout(\"o.resize(0,0,screenSize.width,screenSize.height)\",100);\r\n    }\r\n    setTimeout(\"resize_op5()\",100);\r\n  }\r\n}\r\n\r\n//resize IE & NS (onResize event!)\r\nfunction myOnResize() {\r\n  if (bt.ie4 || bt.ie5 || bt.ns5) {\r\n    var s=new createPageSize();\r\n    o.resize(0,0,s.width,s.height);\r\n  }\r\n  else\r\n    if (bt.ns4) location.reload();\r\n");
1944:                    out.write("}\r\n\r\n");
1945:                    out.write("</SCRIPT>\r\n\r\n\r\n\r\n");
1946:                    out.write("</head>\r\n");
1947:                    out
1948:                            .write("<!-- need an onResize event to redraw outlookbar after pagesize changes! -->\r\n");
1949:                    out
1950:                            .write("<!-- OP5 does not support onResize event! use setTimeout every 100ms -->\r\n");
1951:                    out
1952:                            .write("<body onLoad=\"resize_op5();\" onResize=\"myOnResize();\">\r\n\r\n");
1953:                } catch (Throwable t) {
1954:                    out = _jspx_out;
1955:                    if (out != null && out.getBufferSize() != 0)
1956:                        out.clearBuffer();
1957:                    if (pageContext != null)
1958:                        pageContext.handlePageException(t);
1959:                } finally {
1960:                    if (_jspxFactory != null)
1961:                        _jspxFactory.releasePageContext(pageContext);
1962:                }
1963:            }
1964:
1965:            private boolean _jspx_meth_ofbiz_url_0(
1966:                    javax.servlet.jsp.PageContext pageContext) throws Throwable {
1967:                JspWriter out = pageContext.getOut();
1968:                /* ----  ofbiz:url ---- */
1969:                org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_0 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
1970:                        .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
1971:                _jspx_th_ofbiz_url_0.setPageContext(pageContext);
1972:                _jspx_th_ofbiz_url_0.setParent(null);
1973:                int _jspx_eval_ofbiz_url_0 = _jspx_th_ofbiz_url_0.doStartTag();
1974:                if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
1975:                    if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
1976:                        javax.servlet.jsp.tagext.BodyContent _bc = pageContext
1977:                                .pushBody();
1978:                        out = _bc;
1979:                        _jspx_th_ofbiz_url_0.setBodyContent(_bc);
1980:                        _jspx_th_ofbiz_url_0.doInitBody();
1981:                    }
1982:                    do {
1983:                        out.write("/testServer");
1984:                        int evalDoAfterBody = _jspx_th_ofbiz_url_0
1985:                                .doAfterBody();
1986:                        if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
1987:                            break;
1988:                    } while (true);
1989:                    if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
1990:                        out = pageContext.popBody();
1991:                }
1992:                if (_jspx_th_ofbiz_url_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
1993:                    return true;
1994:                _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_0);
1995:                return false;
1996:            }
1997:
1998:            private boolean _jspx_meth_ofbiz_url_1(
1999:                    javax.servlet.jsp.PageContext pageContext) throws Throwable {
2000:                JspWriter out = pageContext.getOut();
2001:                /* ----  ofbiz:url ---- */
2002:                org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_1 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
2003:                        .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
2004:                _jspx_th_ofbiz_url_1.setPageContext(pageContext);
2005:                _jspx_th_ofbiz_url_1.setParent(null);
2006:                int _jspx_eval_ofbiz_url_1 = _jspx_th_ofbiz_url_1.doStartTag();
2007:                if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
2008:                    if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
2009:                        javax.servlet.jsp.tagext.BodyContent _bc = pageContext
2010:                                .pushBody();
2011:                        out = _bc;
2012:                        _jspx_th_ofbiz_url_1.setBodyContent(_bc);
2013:                        _jspx_th_ofbiz_url_1.doInitBody();
2014:                    }
2015:                    do {
2016:                        out.write("/testServer");
2017:                        int evalDoAfterBody = _jspx_th_ofbiz_url_1
2018:                                .doAfterBody();
2019:                        if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
2020:                            break;
2021:                    } while (true);
2022:                    if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
2023:                        out = pageContext.popBody();
2024:                }
2025:                if (_jspx_th_ofbiz_url_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
2026:                    return true;
2027:                _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_1);
2028:                return false;
2029:            }
2030:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.