














function makeFormObj (formName, formType, formTitle, formDescription, publishFolder, workflowType, workflowOptionsStr, approverListStr)
{ 
logEnter("makeFormObj");
var iVar;
this.formName = formName;
this.formType = formType;
this.formTitle = formTitle;
this.formDescription = formDescription;
this.publishFolder = publishFolder;
this.workflowType = workflowType;
this.workflowOption = new Array();
this.approverList = new Array ();
if (workflowType == "h_ApprovalCycle" || workflowType == "h_EditorInChief") {
for (iVar=0;iVar<7;iVar++) {
var lastChar = (workflowOptionsStr.indexOf(":") == -1) ? 999 : workflowOptionsStr.indexOf(":");
this.workflowOption[iVar] = workflowOptionsStr.substring(0, lastChar);
workflowOptionsStr = workflowOptionsStr.substring(this.workflowOption[iVar].length + 1);
}
this.workflowOption["apprRead"] = this.workflowOption[0];
this.workflowOption["apprEdit"] = this.workflowOption[1];
this.workflowOption["apprPutHow"] = this.workflowOption[2];
this.workflowOption["apprFolder"] = this.workflowOption[3];
this.workflowOption["rejectDest"] = this.workflowOption[4];
this.workflowOption["inProccessFolder"] = this.workflowOption[6];
for (iVar=0;iVar<4;iVar++) {
var lastChar = (approverListStr.indexOf(":") == -1) ? 999 : approverListStr.indexOf(":");
var nextName = approverListStr.substring(0, lastChar);
if (nextName != "") {
this.approverList[iVar] = nextName;
approverListStr = approverListStr.substring(this.approverList[iVar].length + 1);
}
else {
break;
}
}
}
else {
this.workflowOption[0] = workflowOptionsStr;
}
this.fieldDef = new Array ();
logExit("makeFormObj"); 
};




























function _DocAuthorField() { 
logEnter("_DocAuthorField");
logExit("_DocAuthorField"); 
};
oNS3BugWorkAround = new _DocAuthorField();
_DocAuthorField.prototype = new _Field();
_DocAuthorField.prototype.init = authorField_init;
_DocAuthorField.prototype.initChild = authorField_initChild;
_DocAuthorField.prototype.getEditModeHTML = getAuthorEditHTML;
_DocAuthorField.prototype.getReadModeHTML = getAuthorReadHTML;
function authorField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function authorField_initChild(){ 
logEnter("authorField_initChild");
logExit("authorField_initChild"); 
};
function getAuthorEditHTML(pageFrame, fieldIndex) { 
logEnter("getAuthorEditHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle + ". " + fieldObj.fieldLabel, pageFrame.h_OriginatorDisplayName, (fieldIndex+1)-staticTextCount + ".");
logExit("getAuthorEditHTML"); 
};
function getAuthorReadHTML(pageFrame, fieldIndex) { 
logEnter("getAuthorReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle, pageFrame.h_OriginatorDisplayName);
logExit("getAuthorReadHTML"); 
};














function _DocCreatedField() { 
logEnter("_DocCreatedField");
logExit("_DocCreatedField"); 
};
oNS3BugWorkAround = new _DocCreatedField();
_DocCreatedField.prototype = new _Field();
_DocCreatedField.prototype.init = createdDateField_init;
_DocCreatedField.prototype.initChild = createdDateField_initChild;
_DocCreatedField.prototype.getEditModeHTML = getCreatedDateEditHTML;
_DocCreatedField.prototype.getReadModeHTML = getCreatedDateReadHTML;
function createdDateField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function createdDateField_initChild(){ 
logEnter("createdDateField_initChild");
logExit("createdDateField_initChild"); 
};
function getCreatedDateEditHTML(pageFrame, fieldIndex) { 
logEnter("getCreatedDateEditHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle + ". " + fieldObj.fieldLabel, getDisplayableDateTime(pageFrame.h_DocCreated, " "), (fieldIndex+1)-staticTextCount + ".");
logExit("getCreatedDateEditHTML"); 
};
function getCreatedDateReadHTML(pageFrame, fieldIndex) { 
logEnter("getCreatedDateReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle, getDisplayableDateTime(pageFrame.h_DocCreated, " "));
logExit("getCreatedDateReadHTML"); 
};













function _DateControlField() { 
logEnter("_DateControlField");
logExit("_DateControlField"); 
};
oNS3BugWorkAround = new _DateControlField();
_DateControlField.prototype = new _Field();
_DateControlField.prototype.init = dateField_init;
_DateControlField.prototype.initChild = dateField_initChild;
_DateControlField.prototype.getEditModeHTML = getDateEditHTML;
_DateControlField.prototype.modifyFieldAttributes = modifyDateControlFieldAttributes;
_DateControlField.prototype.saveFieldAttributes = saveDateControlFieldAttributes;
function dateField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function dateField_initChild(){ 
logEnter("dateField_initChild");
logExit("dateField_initChild"); 
};
function getDateEditHTML(pageFrame, fieldIndex) { 
logEnter("getDateEditHTML");
var currentFieldValue = eval(this.fieldName);
var fieldValue="";
if (pageFrame.h_IsNewDoc=="1") {
if(currentFieldValue=="") {
fieldValue = getTodaysDate();
}
else {
fieldValue = currentFieldValue;
}
}
else {
fieldValue = currentFieldValue;
}
var htmlText = "<INPUT STYLE=\"font-size: small;\" TITLE=\"" + this.fieldTitle + "\" TYPE=text NAME=" + this.fieldName + " SIZE=" + "10" + " VALUE=\"" + fieldValue + "\">";
if (currentMember.isADAEnabled()!="1") htmlText += D_DatePickerHTML( this.fieldName);
pageInput (pageFrame, this.fieldTitle + ". " + this.fieldLabel, htmlText, (fieldIndex+1)-staticTextCount + ".");
logExit("getDateEditHTML"); 
};
function modifyDateControlFieldAttributes(pageFrame) { 
logEnter("modifyDateControlFieldAttributes");
var oldStr = new Array("'", "\"","<",">");var newStr = new Array("\\\'", "&quot;","&lt;","&gt;");
pageFrame.document.write("<INPUT type=hidden NAME=\"h_FieldDefaultValue\" VALUE=\"" + replaceStrList(pageFrame.h_FieldDefaultValue, oldStr, newStr) + "\">");
pageInput (pageFrame, 'Other settings:', '<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td align='+"right"+' width=3% valign=top><INPUT TITLE="' + 'Required field' + '" TYPE=checkbox NAME="h_getFieldIsRequired" VALUE="h_True"' + ((pageFrame.h_FieldIsRequired=='h_True')?' checked':'') + '><INPUT TYPE=hidden NAME="h_FieldIsRequired"></td><td valign=top>' + 'Alert the author if they forget to fill out this field.' + '</td></tr></table>');
logExit("modifyDateControlFieldAttributes"); 
};
function saveDateControlFieldAttributes(pageFrame) { 
logEnter("saveDateControlFieldAttributes");
h_FieldDefaultValue = theForm.h_FieldDefaultValue.value;
theForm.h_FieldIsRequired.value = (theForm.h_getFieldIsRequired.checked)?'h_True':'';
logExit("saveDateControlFieldAttributes"); 
};














function _DocLastEditorField() { 
logEnter("_DocLastEditorField");
logExit("_DocLastEditorField"); 
};
oNS3BugWorkAround = new _DocLastEditorField();
_DocLastEditorField.prototype = new _Field();
_DocLastEditorField.prototype.init				 = lastEditorField_init;
_DocLastEditorField.prototype.initChild		 = lastEditorField_initChild;
_DocLastEditorField.prototype.getEditModeHTML = getLastEditorEditHTML;
_DocLastEditorField.prototype.getReadModeHTML = getLastEditorReadHTML;
function lastEditorField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) 
{
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function lastEditorField_initChild()
{ 
logEnter("lastEditorField_initChild");
logExit("lastEditorField_initChild"); 
};
function getLastEditorEditHTML(pageFrame, fieldIndex)
{ 
logEnter("getLastEditorEditHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle + ". " + fieldObj.fieldLabel, pageFrame.h_LastEditorDisplayName, (fieldIndex+1)-staticTextCount + ".");
logExit("getLastEditorEditHTML"); 
};
function getLastEditorReadHTML(pageFrame, fieldIndex)
{ 
logEnter("getLastEditorReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle, pageFrame.h_LastEditorDisplayName);
logExit("getLastEditorReadHTML"); 
};














function _DocModifiedField() { 
logEnter("_DocModifiedField");
logExit("_DocModifiedField"); 
};
oNS3BugWorkAround = new _DocModifiedField();
_DocModifiedField.prototype = new _Field();
_DocModifiedField.prototype.init = modifiedDateField_init;
_DocModifiedField.prototype.initChild = modifiedDateField_initChild;
_DocModifiedField.prototype.getEditModeHTML = getModifiedDateEditHTML;
_DocModifiedField.prototype.getReadModeHTML = getModifiedDateReadHTML;
function modifiedDateField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function modifiedDateField_initChild(){ 
logEnter("modifiedDateField_initChild");
logExit("modifiedDateField_initChild"); 
};
function getModifiedDateEditHTML(pageFrame, fieldIndex) { 
logEnter("getModifiedDateEditHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle + ". " + fieldObj.fieldLabel, getDisplayableDateTime(pageFrame.h_ModifiedDate, " "), (fieldIndex+1)-staticTextCount + ".");
logExit("getModifiedDateEditHTML"); 
};
function getModifiedDateReadHTML(pageFrame, fieldIndex) { 
logEnter("getModifiedDateReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle, getDisplayableDateTime(pageFrame.h_ModifiedDate, " "));
logExit("getModifiedDateReadHTML"); 
};














function _DocSizeField() { 
logEnter("_DocSizeField");
logExit("_DocSizeField"); 
};
oNS3BugWorkAround = new _DocSizeField();
_DocSizeField.prototype = new _Field();
_DocSizeField.prototype.init = sizeField_init;
_DocSizeField.prototype.initChild = sizeField_initChild;
_DocSizeField.prototype.getEditModeHTML = getSizeEditHTML;
_DocSizeField.prototype.getReadModeHTML = getSizeReadHTML;
function sizeField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function sizeField_initChild(){ 
logEnter("sizeField_initChild");
logExit("sizeField_initChild"); 
};
function getSizeEditHTML(pageFrame, fieldIndex) { 
logEnter("getSizeEditHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle + ". " + fieldObj.fieldLabel, pageFrame.h_DocSize, (fieldIndex+1)-staticTextCount + ".");
logExit("getSizeEditHTML"); 
};
function getSizeReadHTML(pageFrame, fieldIndex) { 
logEnter("getSizeReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageInput(pageFrame, fieldObj.fieldTitle, pageFrame.h_DocSize);
logExit("getSizeReadHTML"); 
};














function _StaticField() { 
logEnter("_StaticField");
logExit("_StaticField"); 
};
oNS3BugWorkAround = new _StaticField();
_StaticField.prototype = new _Field();
_StaticField.prototype.init = staticField_init;
_StaticField.prototype.initChild = staticField_initChild;
_StaticField.prototype.getEditModeHTML = getStaticHTML;
_StaticField.prototype.getReadModeHTML = getStaticHTML;
_StaticField.prototype.modifyFieldAttributes = modifyStaticFieldAttributes;
_StaticField.prototype.saveFieldAttributes = saveStaticFieldAttributes;
function staticField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function staticField_initChild(){ 
logEnter("staticField_initChild");
logExit("staticField_initChild"); 
};
function getStaticHTML(pageFrame, fieldIndex) { 
logEnter("getStaticHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
pageFrame.document.write(fieldObj.fieldDefault);
logExit("getStaticHTML"); 
};
function modifyStaticFieldAttributes(pageFrame) { 
logEnter("modifyStaticFieldAttributes");
pageFrame.document.write('<input name=PageBody type=hidden>');
pageFrame.document.write('<input name=h_FieldDefaultValue type=hidden>');
pageBanner(pageFrame, 'Non-editable rich text may be added (or replaced) in your form by clicking the <b>Edit Text</b> button at the bottom of the page.');
pageFrame.document.write(pageFrame.PageBody + "<br>");
logExit("modifyStaticFieldAttributes"); 
};
function saveStaticFieldAttributes(pageFrame) { 
logEnter("saveStaticFieldAttributes");
var fieldUnid = (h_PublishedVersionUNID=="")?h_PageUnid:h_PublishedVersionUNID;
theForm.PageBody.value = PageBody;
if (PageBody.indexOf('src=\"$FILE/') > -1){
PageBody = replaceStr(PageBody, 'src=\"$FILE/', 'src=\"' + "../../$defaultview" + "/" + fieldUnid + '/$FILE' + "/");
}
else if (PageBody.indexOf('SRC=$FILE/') > -1){
var pb1 = PageBody.substring(0, PageBody.indexOf('SRC=$FILE/'));
var pb2 = 'SRC=' + "../../$defaultview" + "/" + fieldUnid + "/";
var pb3 = PageBody.substring(PageBody.indexOf('$FILE/'));
PageBody=pb1+pb2+pb3;
}
theForm.h_FieldDefaultValue.value = PageBody;
logExit("saveStaticFieldAttributes"); 
};





















































function initLimrButton( limrObj, bOver, bWidth)
{ 
logEnter("initLimrButton");
limrObj.OutRectWidth=(bWidth) ? bWidth : 75;
limrObj.OutRectHeight=22;
limrObj.OutMaxLines=1;
limrObj.OutTransColor='ffffff';
limrObj.Align='CENTER';
limrObj.FontName="Helvetica+Linotype";
limrObj.FontPointSize=9;
limrObj.FontColor='fffff0';
limrObj.FontAntiAliasColor='007f7f';
limrObj.BlurFactor=5;
limrObj.EffectType='Shadow';
limrObj.ShadowColor='cccccc';
limrObj.ShadowXOffset='0';
limrObj.ShadowYOffset='0';
limrObj.BkColor='007f7f';
if ( bOver)
{
limrObj.BkEffect='BEVELHILITE';	
}
else
{
limrObj.BkEffect='BEVEL';	
}
limrObj.BevelSize='4';
limrObj.BevelLightSource='UPPER_LEFT';
limrObj.BevelType='SIMPLE_OUTER';
limrObj.BevelCorner='ROUNDED';
limrObj.OutOp='CLIP_WORDWRAP';
logExit("initLimrButton"); 
};
function onLimrMouseOver( imageName, buttonArray)
{ 
logEnter("onLimrMouseOver");
if (h_ClientBrowser.isBrowserLevel (4)) 
{
var strForSrc;
if (  h_ClientBrowser.hasIECacheBug())
{
getImage(eval('document.' +  imageName),1,imageName,eval(buttonArray + '[1]'));
}
else
{
strForSrc = buttonArray + '[1]';
eval ('document.' + imageName + '.src=' + strForSrc + ';');
}
}
logExit("onLimrMouseOver"); 
};
function onLimrMouseOut( imageName, buttonArray)
{ 
logEnter("onLimrMouseOut");
if (h_ClientBrowser.isBrowserLevel (4)) 
{
var strForSrc;
if (  h_ClientBrowser.hasIECacheBug())
{
getImage(eval('document.' +  imageName),1,imageName,eval(buttonArray + '[0]'));
}
else
{
strForSrc = buttonArray + '[0]';
eval ('document.' + imageName + '.src=' + strForSrc + ';');
}
}
logExit("onLimrMouseOut"); 
};


































































function _ImportField() {
logEnter("_ImportField");
logExit("_ImportField");
};
oNS3BugWorkAround = new _ImportField();
_ImportField.prototype = new _Field();
_ImportField.prototype.init = importField_init;
_ImportField.prototype.initChild = importField_initChild;
_ImportField.prototype.getReadModeHTML = getImportReadHTML;
_ImportField.prototype.getEditModeHTML = getImportEditModeHTML;
_ImportField.prototype.submitLogic = importSubmitLogic;
function importField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function importField_initChild(){
logEnter("importField_initChild");
logExit("importField_initChild");
};
function getImportReadHTML(pageFrame, fieldIndex)
{
logEnter("getImportReadHTML");
logExit("getImportReadHTML");
};
var h_DeleteButton;
var containsMultipleImportField = false;
function getImportEditModeHTML(pageFrame, fieldIndex) {
logEnter("getImportEditModeHTML");
if (uploadControlExists()) {
containsUploadControl = true;
var htmlObjectTag;
htmlObjectTag = '<object title="' + 'Upload control' + '" id=' +'UploadControl' + ' width="' + '100%' + '"' + ' height="' + 138 + '"' + ' classid="clsid:' + '05D96F71-87C6-11D3-9BE4-00902742D6E0' + '"' + ' codebase="' + getProtocalAndServerUrl () + getAbsoluteServerRootPath(self) + '/qp2.cab#Version=' + "8,2,0,0" + '"' + '>';
htmlObjectTag += 		'<param name="General_Mode" value=' + 2 + '>';
htmlObjectTag += 		'<param name="General_URL" value="' + getAbsoluteRoomPath(self) + '/' + "$defaultview" + '/' + h_PageUnid + '">';
htmlObjectTag += 		'<param name="General_CurrentEditScene" value="' + theForm.h_SetEditCurrentScene.value + '">';
htmlObjectTag += 		'<param name="General_ServerName" value="' + getProtocalAndServerUrl () + '">';
htmlObjectTag += 		'<param name="General_MaxFileSize" value="' + h_MaxFileSizeAllowedToUpload + '">';
htmlObjectTag += 		'<param name="General_BgColor" value="' + h_CurrentBgColor + '">';
var XSS_ImportHTML = '';
htmlObjectTag +=(XSS_ImportHTML == "false") ? '<param name="General_PreSetFields" value="' + 'checkXSS' + '">' : '';
htmlObjectTag +=		'<param name="Import_OriginalFile" value="' + h_HTMLImportOriginalFile + '">';
htmlObjectTag +=		'<param name="Import_Names" value=\'' + h_HTMLImportFiles + '\'>';
htmlObjectTag +=		'<param name="Import_Lengths" value="' + h_AttachmentLengths + '">';
htmlObjectTag +=		'<param name="Import_Times" value="' + h_AttachmentTimes + '">';
htmlObjectTag +=		'<param name="Import_NewDoc" value="' + h_NewDoc + '">';
htmlObjectTag +=		'<param name="Import_NSImport" value="' + h_NSImport + '">';
htmlObjectTag += '</object>';
htmlObjectTag += '<input name=h_AttachmentTimes type=hidden>';
htmlObjectTag += '<input name=h_HTMLImport type=hidden>';
htmlObjectTag += '<input name=h_HTMLImportUnqNum type=hidden>';
htmlObjectTag += '<input name=h_HTMLImportFiles type=hidden>';
htmlObjectTag += '<input name=h_HTMLImportOriginalFile type=hidden>';
htmlObjectTag += '<input name=h_HTMLImportStyleSheet type=hidden>';
htmlObjectTag += '<input name=h_NSImport type=hidden>';
htmlObjectTag += '<input name=h_NewDoc type=hidden>';
if (typeof pageFrame.h_LastTimePutAway == "undefined") {
var strLabel = "You can import a Microsoft Word, PowerPoint, Excel, HTML, JPEG or GIF file by clicking the folder icon below and selecting a file. You can also drag files from your desktop.";
if (G_uploadableFileTypes.indexOf(".*") < 0 && (G_bUploadRestricted || (G_bUploadRestricted && G_bUploadPrivRestricted))) {
if (G_uploadableFileTypes != '')
strLabel += formatMessage("<br/><b>Your security profile only allows you to upload files with %1 extensions. All files with other extensions will be rejected.</b>", G_uploadableFileTypes);
else
strLabel += "<br/><b>Your security profile does not allow you to upload files.</b>";
}
pageInput(pageFrame, strLabel, htmlObjectTag, (fieldIndex+1)-staticTextCount + ".");
} else {
var strLabel = "You can edit the document by double-clicking its icon, or you can replace the document with another from your computer by clicking Replace.";
if (G_uploadableFileTypes.indexOf(".*") < 0 && (G_bUploadRestricted || (G_bUploadRestricted && G_bUploadPrivRestricted))) {
if (G_uploadableFileTypes != '')
strLabel += formatMessage("<br/><b>Your security profile only allows you to upload files with %1 extensions. All files with other extensions will be rejected.</b>", G_uploadableFileTypes);
else
strLabel += "<br/><b>Your security profile does not allow you to upload files.</b>";
}
pageInput(pageFrame, strLabel, htmlObjectTag, (fieldIndex+1)-staticTextCount + ".");
}
}
else {
var limrALButton = new makeJSLimerick();
initLimrButton( limrALButton, false, false);
var limrALButtonOver = new makeJSLimerick();
initLimrButton( limrALButtonOver, true, false);
limrALButton.TextString = "Replace...";
limrALButtonOver.TextString = "Replace...";
h_DeleteButton = new Array(limrALButton.getJSLimerickURL(), limrALButtonOver.getJSLimerickURL());
if (h_HTMLImport != "") {
document.write('<input name=h_SetDeleteAttachments value="" type=hidden>');
var mouseHTML = "";
if (h_ClientBrowser.isBrowserLevel (4))
mouseHTML = ' onMouseOver=javascript:onLimrMouseOver("h_DeleteButtonName","h_DeleteButton") onMouseOut=javascript:onLimrMouseOut("h_DeleteButtonName","h_DeleteButton")';
var htmlFileName = h_HTMLImport;
var htmlFileNum = h_HTMLImportUnqNum;
if (QuickrGeneralUtil.isInternalFileName(htmlFileName)) {
if (typeof h_HTMLImportOriginalFile != "undefined" && h_HTMLImportOriginalFile.indexOf("/") > -1) {
htmlFileName = h_HTMLImportOriginalFile.substring(h_HTMLImportOriginalFile.lastIndexOf("/") + 1);
htmlFileNum = "";
}
}
pageInput (self, 'The HTML file currently used by this is:',
'<table border="0" width="100%"><tr><td nowrap align='+"right"+' valign="top"><a href="javascript:abPreSubmit(\'h_DeleteFiles\')" ' + mouseHTML + ' >' + genImageTag(h_DeleteButton[0], 'h_DeleteButtonName', ' border="0" width="75" height="22"', "Replace File") + '</a></td><td width="457"><a target=_blank href="' + "../../$defaultview" + "/" + h_PageUnid + "/" + getUploadedURLStr(htmlFileName,htmlFileNum) + '">' + htmlFileName + '</a></td></tr></table>', (fieldIndex+1)-staticTextCount + ".");
if ( h_ClientBrowser.isIE() ) {
pageBanner (self, 'To download this file right click on the link and select "Save Target As," or to replace this file click on "Replace."');
} else
if ( h_ClientBrowser.isSafari() ) {
pageBanner (self, 'To download this file right click on the link and select "Download Linked File As," or to replace this file click on "Replace."');
} else
{
pageBanner (self, 'To download this file right click on the link and select "Save Link As," or to replace this file click on "Replace."');
}
}
else {
pageInput (self, 'Import the HTML file that you want to publish, by clicking the browse button below and selecting the desired file. ', '<input type=file name="HaikuUploadAttachment">', (fieldIndex+1)-staticTextCount + ".");
theForm.encoding='multipart/form-data';
theForm.enctype='multipart/form-data';
}
document.write('<input name=h_HTMLImport type=hidden>');
document.write('<input name=h_HTMLImportUnqNum type=hidden>');
document.write('<input name=h_HTMLImportFiles type=hidden>');
document.write('<input name=h_HTMLImportOriginalFile type=hidden>');
document.write('<input name=h_HTMLImportStyleSheet type=hidden>');
document.write('<input name=h_NSImport type=hidden>');
document.write('<input name=h_NewDoc type=hidden>');
}
logExit("getImportEditModeHTML");
};
function importSubmitLogic(pageFrame, submitAction)
{
logEnter("importSubmitLogic");
if (uploadControlExists()) {
theForm.UploadControl.General_SubmitAction = submitAction;
if (theForm.UploadControl.General_CancelSubmit) {
return false;
}
}
if (submitAction == "h_Next"
|| submitAction == "h_Jump"
|| submitAction == "h_TempSave") {
if (uploadControlExists()) {
var newHTML = theForm.UploadControl.Import_HTMLFileName;
if (newHTML == "") {
alert('Please specify one or more files to import.');
return false;
}
var allowedExtensions = ["html","htm","jpg","gif","doc","xls","ppt"];
var aNames = theForm.UploadControl.Import_Names.split(",");
var msgList = "";
for (var ii = 0; ii < aNames.length; ii++) {
var tmpName = eval(aNames[ii].split(";")[0]);
var tmpExt = "." + tmpName;
var tmpExt = tmpExt.substring(tmpExt.lastIndexOf(".") + 1).toLowerCase();
var bOK = false;
if (QuickrGeneralUtil.isInternalFileName(tmpName)) {
bOK = true;
} else {
for (var jj = 0; jj < allowedExtensions.length; jj++) {
if (tmpExt.indexOf(allowedExtensions[jj]) == 0) {
bOK = true;
break;
}
}
}
if (!bOK) msgList += "\n" + tmpName;
}
if (msgList.length > 0) {
var msg = ('The following files specified for import are not supported:\n{0}').replace(/\{0\}/g, msgList);
alert(msg);
return false;
}
if (((submitAction == "h_Jump" || submitAction == "h_TempSave") ||
(submitAction == "h_Next" && hasWorkflow)) && !isMultipleImport()) {
if (!theForm.UploadControl.Import_UploadImportedFiles("", h_Authors)) {
return false;
}
theForm.h_HTMLImport.value = newHTML;
}
if (containsMultipleImportField) {
if (!isMultipleImport()) {
theForm.h_Form.value = "025BBAB4299CCFDF0525670800167246";
}
else {
theForm.h_Form.value = h_Form;
}
}
theForm.h_HTMLImportUnqNum.value = "";
if (theForm.h_Name.value == "") {
theForm.h_Name.value = theForm.UploadControl.Import_FileName;
}
theForm.h_HTMLImportUnqNum.value = genUniqueNum();
theForm.h_HTMLImportFiles.value = theForm.UploadControl.Import_Names;
theForm.h_AttachmentTimes.value = theForm.UploadControl.Import_Times;
theForm.h_NewDoc.value = theForm.UploadControl.Import_NewDoc;
theForm.h_HTMLImportOriginalFile.value = theForm.UploadControl.Import_OriginalFile;
theForm.h_HTMLImportStyleSheet.value = theForm.UploadControl.Import_StyleSheetFileName;
theForm.h_NSImport.value = theForm.UploadControl.Import_NSImport;
}
else {
if (typeof(theForm.HaikuUploadAttachment) != "undefined") {
var upload = theForm.HaikuUploadAttachment;
upload.focus();
upload.blur();
var fileName = upload.value;
if (fileName == "") {
alert('Please specify an HTML file.');
upload.focus();
return false;
}
var ext = fileName.substring(fileName.lastIndexOf(".")+1);
ext = ext.toLowerCase();
if (ext != "htm" && ext != "html") {
alert('You must specify a file with an .HTML or .HTM extension. Please try again.');
upload.focus();
return false;
}
fileName = fileName.substring(fileName.lastIndexOf("\\")+1);
fileName = fileName.substring(fileName.lastIndexOf("/")+1);
theForm.h_HTMLImport.value = fileName;
theForm.h_HTMLImportUnqNum.value = genUniqueNum();
theForm.h_HTMLImportFiles.value = fileName;
}
else {
theForm.h_HTMLImport.value = h_HTMLImport;
theForm.h_HTMLImportUnqNum.value = h_HTMLImportUnqNum;
theForm.h_HTMLImportFiles.value = h_HTMLImportFiles;
}
theForm.h_NSImport.value = "1";
}
}
else {
theForm.h_HTMLImport.value = "";
theForm.h_HTMLImportUnqNum.value = "";
theForm.h_HTMLImportFiles.value = "";
}
return submitAction;
logExit("importSubmitLogic");
};
function displayImportField()
{
logEnter("displayImportField");
_qp_WriteHtml(
'<object title="' + 'Upload control' + '" id=' +'UploadControl' + ' width="' + '0' + '"' + ' height="' + '0' + '"' + ' classid="clsid:' + '05D96F71-87C6-11D3-9BE4-00902742D6E0' + '"' + ' codebase="' + getProtocalAndServerUrl () + getAbsoluteServerRootPath(self) + '/qp2.cab#Version=' + "8,2,0,0" + '"' + '>' +
'<param name="General_Mode" value=' + 2 + '>' +
'<param name="General_URL" value="' + getAbsoluteRoomPath(self) + '/' + "$defaultview" + '/' + h_PageUnid + '">' +
'<param name="General_ServerName" value="' + getProtocalAndServerUrl () + '">' +
'<param name="General_MaxFileSize" value="' + h_MaxFileSizeAllowedToUpload + '">' +
'<param name="Import_Names" value=\'' + h_HTMLImportFiles + '\'>' +
'<param name="General_CurrentEditScene" value="h_StdPageEdit">' +
'</object>'
);
logExit("displayImportField");
};
function importSubmitLogicOptionsScene()
{
logEnter("importSubmitLogicOptionsScene");
if (!theForm.UploadControl.Import_UploadImportedFiles(putAway.publishFolderName, h_Authors)) {
return false;
}
theForm.h_HTMLImportFiles.value = theForm.UploadControl.Import_Names;
theForm.h_HTMLImport.value = theForm.UploadControl.Import_HTMLFileName;
if (isMultipleImport())
putAway.publishAction = "h_Publish";
return true;
logExit("importSubmitLogicOptionsScene");
};
function _MultipleImportField() {
logEnter("_MultipleImportField");
logExit("_MultipleImportField");
};
oNS3BugWorkAround = new _MultipleImportField();
_MultipleImportField.prototype = new _ImportField();
_MultipleImportField.prototype.init = multipleImportField_init;
_MultipleImportField.prototype.initChild = multipleImportField_initChild;
_MultipleImportField.prototype.getReadModeHTML = getImportReadHTML;
_MultipleImportField.prototype.getEditModeHTML = getMultipleImportEditModeHTML;
_MultipleImportField.prototype.submitLogic = multipleImportSubmitLogic;
function multipleImportField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function multipleImportField_initChild(){
logEnter("multipleImportField_initChild");
logExit("multipleImportField_initChild");
};
function getMultipleImportEditModeHTML(pageFrame, fieldIndex) {
logEnter("getMultipleImportEditModeHTML");
if (uploadControlExists()) {
if (typeof pageFrame.h_LastTimePutAway == "undefined") {
containsUploadControl = true;
htmlObjectTag = '<object title="' + 'Upload control' + '" id=' +'UploadControl' + ' width="' + '100%' + '"' + ' height="' + 250 + '"' + ' classid="clsid:' + '05D96F71-87C6-11D3-9BE4-00902742D6E0' + '"' + ' codebase="' + getProtocalAndServerUrl () + getAbsoluteServerRootPath(self) + '/qp2.cab#Version=' + "8,2,0,0" + '"' + '>';
htmlObjectTag += 		'<param name="General_Mode" value=' + 3 + '>';
htmlObjectTag += 		'<param name="General_URL" value="' + getAbsoluteRoomPath(self) + '/' + "$defaultview" + '/' + h_PageUnid + '">';
htmlObjectTag += 		'<param name="General_CurrentEditScene" value="' + theForm.h_SetEditCurrentScene.value + '">';
htmlObjectTag += 		'<param name="General_ServerName" value="' + getProtocalAndServerUrl () + '">';
htmlObjectTag += 		'<param name="General_MaxFileSize" value="' + h_MaxFileSizeAllowedToUpload + '">';
htmlObjectTag += 		'<param name="General_BgColor" value="' + h_CurrentBgColor + '">';
htmlObjectTag +=		'<param name="Import_Names" value=\'' + h_HTMLImportFiles + '\'>';
htmlObjectTag +=		'<param name="Import_OriginalFile" value="' + h_HTMLImportOriginalFile + '">';
htmlObjectTag +=		'<param name="Import_Lengths" value="' + h_AttachmentLengths + '">';
htmlObjectTag +=		'<param name="Import_Times" value="' + h_AttachmentTimes + '">';
htmlObjectTag +=		'<param name="Import_NewDoc" value="' + h_NewDoc + '">';
htmlObjectTag += '</object>';
htmlObjectTag += '<input name=h_AttachmentTimes type=hidden>';
htmlObjectTag += '<input name=h_HTMLImport type=hidden>';
htmlObjectTag += '<input name=h_HTMLImportUnqNum type=hidden>';
htmlObjectTag += '<input name=h_HTMLImportFiles type=hidden>';
htmlObjectTag += '<input name=h_HTMLImportOriginalFile type=hidden>';
htmlObjectTag += '<input name=h_HTMLImportStyleSheet type=hidden>';
htmlObjectTag += '<input name=h_NSImport type=hidden>';
htmlObjectTag += '<input name=h_NewDoc type=hidden>';
htmlObjectTag += '<input name=h_Name type=hidden>';
htmlObjectTag += '<input name=h_Form type=hidden>';
htmlObjectTag += '<input name=h_MultipleImport type=hidden>';
var strLabel = "You can import several Word, PowerPoint, Excel, HTML, JPEG or GIF files at once by clicking the folder icon below and selecting the desired files. Each file will be converted into a separate piece of content in the place. You can also drag files from your desktop.";
if (G_uploadableFileTypes.indexOf(".*") < 0 && (G_bUploadRestricted || (G_bUploadRestricted && G_bUploadPrivRestricted))) {
if (G_uploadableFileTypes != '')
strLabel += formatMessage("<br/><b>Your security profile only allows you to upload files with %1 extensions. All files with other extensions will be rejected.</b>", G_uploadableFileTypes);
else
strLabel += "<br/><b>Your security profile does not allow you to upload files.</b>";
}
pageInput(pageFrame, strLabel, htmlObjectTag, (fieldIndex+1)-staticTextCount + ".");
}
else {
getImportEditModeHTML(pageFrame, fieldIndex);
}
}
logExit("getMultipleImportEditModeHTML");
};
function multipleImportSubmitLogic(pageFrame, submitAction)
{
logEnter("multipleImportSubmitLogic");
containsMultipleImportField = true;
if (submitAction == "h_Next" || submitAction == "h_Jump") {
theForm.h_MultipleImport.value = theForm.UploadControl.General_FileCount;
}
submitAction = importSubmitLogic(pageFrame, submitAction);
return submitAction;
logExit("multipleImportSubmitLogic");
};
function isMultipleImport()
{
logEnter("isMultipleImport");
if (typeof(theForm.h_MultipleImport) == "undefined"
||  theForm.h_MultipleImport.value == ""
||  theForm.h_MultipleImport.value == 0
||  theForm.h_MultipleImport.value == 1)
return false;
return true;
logExit("isMultipleImport");
};









































function _RichTextControlField() {
logEnter("_RichTextControlField");
logExit("_RichTextControlField");
};
oNS3BugWorkAround = new _RichTextControlField();
_RichTextControlField.prototype								= new _Field();
_RichTextControlField.prototype.init						= RichTextControlField_init;
_RichTextControlField.prototype.initBase					= RichTextControlField_initBase;
_RichTextControlField.prototype.getReadModeHTML			= RichTextControlField_getReadHTML;
_RichTextControlField.prototype.preProcessPageBody		= RichTextControlField_preProcessPageBody;
function RichTextControlField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr)
{
this.initBase(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
}
function RichTextControlField_initBase(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr)
{
this.NewImageCount			= 0;
this.HeadlineCount			= 0;
this.haikuEditorApplet		= null;
this.bSelectionExists		= "0";
this.nAction					= "4";
this.currentCursorPosition = "";
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
}
function RichTextControlField_getReadHTML(pageFrame, fieldIndex)
{
logEnter("RichTextControlField_getReadHTML");
if (typeof PageBody != "undefined") {
if (fieldIndex > 0 && !(fieldIndex==1 && formObj.fieldDef[0].fieldType=="h_Subject")) {
if ( this.fieldTitle != "" && this.fieldTitle != "Untitled" && this.fieldTitle != "Untitled" && this.fieldTitle != "FIELDTITLE_UNTITLED") {
pageBanner(pageFrame, this.fieldTitle);
}
}
document.write('<div id="HaikuEditorRead">' + this.preProcessPageBody(PageBody) + '</div>');
}
logExit("RichTextControlField_getReadHTML");
};














function inColorArray( theColorArray, theColor)
{ 
logEnter("inColorArray");
var bReturn = false;
if ( theColor != '')
{
bReturn = checkArray( theColorArray, theColor);
}
return bReturn;
logExit("inColorArray"); 
};
function checkArray( theArray, theColor)
{ 
logEnter("checkArray");
var bReturn = false;
if ( typeof(theArray) != "undefined")
{
for ( i = 0; i < theArray.length; i++)
{
if ( theArray[i] == theColor)
{
bReturn = true;
break;
}		
}
}
return bReturn;
logExit("checkArray"); 
};
function DisplayColors ( a_Field, a_colorArray, a_FunctionCallBack)
{ 
logEnter("DisplayColors");
document.write(HtmlForDisplayColors ( a_Field, a_colorArray, a_FunctionCallBack));
logExit("DisplayColors"); 
};
function HtmlForDisplayColors ( a_Field, a_colorArray, a_FunctionCallBack)
{ 
logEnter("HtmlForDisplayColors");
var returnHTML = '<table cellpadding="0" cellspacing="1" border="0" bordercolor="#ffffff" bgcolor="#ffffff" width="456">';
var numEntries = 19;
var totalRows = a_colorArray.length/19;
var i;
var j;
var k;
for ( i = 0; i < totalRows; i++)
{
returnHTML += '<tr align="CENTER" valign="MIDDLE" style="">';
for ( j = 0; j < 19; j++)
{
k = (i*19)+j;
returnHTML += '<td width=23 height=23 bgcolor="#' + a_colorArray[k] +'"> ';
returnHTML += '<input type="radio" name="' + a_Field + '" value=' + a_colorArray[k];
if (a_FunctionCallBack) 
{
returnHTML += ' onclick=' + a_FunctionCallBack + '("' + a_colorArray[k] + '")';
}
returnHTML += ' >';
returnHTML += '</td>';
}
returnHTML += '</tr>';
}
returnHTML += "</table>";
return returnHTML;
logExit("HtmlForDisplayColors"); 
};
function genPalTable(a_Field, a_ClickValue, a_ClickValue2, imgNamesList, colorList)
{ 
logEnter("genPalTable");
var tableName = a_Field + 'Table'; 
var returnHtml = '<table id=' + tableName + ' cellpadding="0" cellspacing="1" border="0" bordercolor="#ffffff" bgcolor="#ffffff" width="386">';
var numColors = imgNamesList.length;
var numColumns = 5;
var colorCounter = 0;
var columnCounter = 0;
var imgUrl;
var valueUrl;
while (colorCounter < numColors) 
{
returnHtml += "<tr valign=top style='background-color:#" + colorList[0] + "'>";
columnCounter = 0;
while (colorCounter < numColors && columnCounter < numColumns) 
{
if (imgNamesList[colorCounter] == "") 
{
imgUrl = "../../../../../qphtml/attachments/transparent.gif";
valueUrl = "";
}
else 
{
imgUrl = "../../../../.." + "/qphtml/attachments/" + imgNamesList[colorCounter];
valueUrl = imgNamesList[colorCounter];
}
if (  h_ClientBrowser.hasIECacheBug() )
{
returnHtml += "<td width=76 height=76 bgColor=" + colorList[colorCounter] + ">";
}
else
{
returnHtml += "<td width=76 height=76 background=" + imgUrl + " bgColor=" + colorList[colorCounter] + ">";
}
returnHtml += "<input type=radio style='background-color:#" + colorList[colorCounter] + "' name=" + a_Field + " value='" + 	valueUrl +	"' onclick='theForm." + a_ClickValue + ".value=this.value;theForm." + a_ClickValue2 + ".value=\""+colorList[colorCounter]+"\";'>";
returnHtml += 	"</td>";
colorCounter ++;
columnCounter ++;
}
returnHtml += "</tr>";
}
returnHtml += "</table>";
return returnHtml;
logExit("genPalTable"); 
};
function getImageForTable( theTablePrefix, imgNamesList)
{ 
logEnter("getImageForTable");
if (  h_ClientBrowser.hasIECacheBug() )
{	
var counter = 0;
var imgUrl;
var theName;
theTableObj = eval('document.all.' + theTablePrefix + 'Table;');
for ( i = 0; i < theTableObj.rows.length; i++)
{
for ( j = 0; j < theTableObj.rows[i].cells.length; j++)
{
if (imgNamesList[counter] == "") 
{
imgUrl = "../../../../../qphtml/attachments/transparent.gif";
theName = 'transparent';
}
else 
{
imgUrl = "../../../../.." + "/qphtml/attachments/" + imgNamesList[counter];
theName = imgNamesList[counter];
}
theTableObj.rows[i].cells[j].background = getTableImage( theTableObj.rows[i].cells[j].background, 
imgUrl, 
theName);
counter++;
}
}
}
logExit("getImageForTable"); 
};
function getTableImage( theImgObj, theURL, index)
{ 
logEnter("getTableImage");
checkImage = new Image();
checkImage.src = theURL;
if ( typeof(tableImgList[index]) == "undefined")
{
tableImgList[index] = checkImage;
}
return tableImgList[index].href;
logExit("getTableImage"); 
};
function stripPound( colorString)
{ 
logEnter("stripPound");
if ( colorString.charAt( 0) == '#')
{
return colorString.substring( 1);
}
return colorString;
logExit("stripPound"); 
};
function RichTextControlField_preProcessPageBody(thePageBody)
{
logEnter("RichTextControlField_preProcessPageBody");
var indexWhere1 = 0;
var indexWhere2 = 0;
var indexWhere3 = 0;
var antiAliasString = '&FontAntiAliasColor=';
var bkColorString = '&BkColor=';
var outTransColorString = '&OutTransColor=';
var bgColorForLimerick = stripPound( G_qpCurrentBackgroudColor);
while (( indexWhere1 != -1) && ( indexWhere2 != -1) && ( indexWhere3 != -1))
{
indexWhere1 = thePageBody.indexOf(antiAliasString, indexWhere1);
if ( indexWhere1 != -1)
{
indexWhere1 += antiAliasString.length;
thePageBody = thePageBody.substring(0, indexWhere1) +
bgColorForLimerick +
thePageBody.substring(indexWhere1+bgColorForLimerick.length);
}
indexWhere2 = thePageBody.indexOf(bkColorString, indexWhere2);
if ( indexWhere2 != -1)
{
indexWhere2 += bkColorString.length;
thePageBody = thePageBody.substring(0, indexWhere2) +
bgColorForLimerick +
thePageBody.substring(indexWhere2+bgColorForLimerick.length);
}
indexWhere3 = thePageBody.indexOf(outTransColorString, indexWhere3);
if ( indexWhere3 != -1)
{
indexWhere3 += outTransColorString.length;
thePageBody = thePageBody.substring(0, indexWhere3) +
bgColorForLimerick +
thePageBody.substring(indexWhere3+bgColorForLimerick.length);
}
}	
return thePageBody;
logExit("RichTextControlField_preProcessPageBody");
};
function _GeckoRichTextControlField() {
logEnter("_GeckoRichTextControlField");
logExit("_GeckoRichTextControlField");
};
_GeckoRichTextControlField.prototype = new _RichTextControlField();
_GeckoRichTextControlField.prototype.init = GeckoRichTextControlField_init;
_GeckoRichTextControlField.prototype.initChild = GeckoRichTextControlField_initChild;
function GeckoRichTextControlField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initBase(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function GeckoRichTextControlField_initChild()
{
logEnter("GeckoRichTextControlField_initChild");
this.bDHTMLControl = false;
this.bDHTMLInited = false;
this.selectedElement = '';
this.bAlignmentMode = 1;
this.sItemName = ( typeof( h_RichTextItem ) != "undefined" )? h_RichTextItem: ( typeof( Body ) != 'undefined' )? 'Body': 'PageBody';
this.sWidth = '630';
this.sHeight = '300';
this.bReturnHTML = false;
this.aBlkFormatString = [];
this.iFormat = 1;
this.iSaveFormat = 1;
this.sPlainTextItemName = this.sItemName + "PT";
this.controlType = "gecko";
logExit("GeckoRichTextControlField_initChild");
};
function _NSRichTextControlField()
{
logEnter("_NSRichTextControlField");
logExit("_NSRichTextControlField");
};
_NSRichTextControlField.prototype							= new _RichTextControlField();
_NSRichTextControlField.prototype.init						= NSRichTextControlField_init;
_NSRichTextControlField.prototype.initChild				= NSRichTextControlField_initChild;
function NSRichTextControlField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initBase(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function NSRichTextControlField_initChild()
{
logEnter("NSRichTextControlField_initChild");
this.bDHTMLControl	= false;
this.bHTMLIsSet		= false;
this.bDHTMLInited		= false;
this.selectedElement = "";
this.bAlignmentMode			= 1;
this.controlType = "ns";
logExit("NSRichTextControlField_initChild");
};
function _SimpleTextControlField() {
logEnter("_SimpleTextControlField");
logExit("_SimpleTextControlField");
};
_SimpleTextControlField.prototype							= new _RichTextControlField();
_SimpleTextControlField.prototype.init						= SimpleTextControlField_init;
_SimpleTextControlField.prototype.initChild				= SimpleTextControlField_initChild;
function SimpleTextControlField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initBase(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function SimpleTextControlField_initChild()
{
logEnter("SimpleTextControlField_initChild");
this.bDHTMLControl	= false;
this.controlType = "simple";
logExit("SimpleTextControlField_initChild");
};
function _DojoTextControlField() {
logEnter("_DojoTextControlField");
logExit("_DojoTextControlField");
};
_DojoTextControlField.prototype							= new _RichTextControlField();
_DojoTextControlField.prototype.init					= DojoTextControlField_init;
_DojoTextControlField.prototype.initChild				= DojoTextControlField_initChild;
_DojoTextControlField.prototype.preProcessPageBody		= DojoTextControlField_preProcessPageBody;
function DojoTextControlField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initBase(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function DojoTextControlField_initChild()
{
logEnter("DojoTextControlField_initChild");
this.bDHTMLControl	= false;
this.controlType = "dojo";
logExit("DojoTextControlField_initChild");
};
function DojoTextControlField_preProcessPageBody(thePageBody)
{
logEnter("DojoTextControlField_preProcessPageBody");
return thePageBody;
logExit("DojoTextControlField_preProcessPageBody");
};
function _IERichTextControlField() {
logEnter("_IERichTextControlField");
logExit("_IERichTextControlField");
};
_IERichTextControlField.prototype							= new _RichTextControlField();
_IERichTextControlField.prototype.init						= IERichTextControlField_init;
_IERichTextControlField.prototype.initChild				= IERichTextControlField_initChild;
function IERichTextControlField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initBase(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function IERichTextControlField_initChild()
{
logEnter("IERichTextControlField_initChild");
this.bDHTMLControl	= true;
this.bHTMLIsSet		= false;
this.bDHTMLInited		= false;
this.selectedElement = "";
this.bAlignmentMode			= 1;
this.aBlkFormatString = new Array();
this.controlType = "ie";
logExit("IERichTextControlField_initChild");
};


























function _AttachmentsField() {
logEnter("_AttachmentsField");
logExit("_AttachmentsField");
};
oNS3BugWorkAround = new _AttachmentsField();
_AttachmentsField.prototype = new _Field();
_AttachmentsField.prototype.init = attachmentsField_init;
_AttachmentsField.prototype.initChild = attachmentsField_initChild;
_AttachmentsField.prototype.getReadModeHTML = getAttachmentsReadHTML;
function attachmentsField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function attachmentsField_initChild(){
logEnter("attachmentsField_initChild");
logExit("attachmentsField_initChild");
};
function getAttachmentsReadHTML(pageFrame, fieldIndex)
{
logEnter("getAttachmentsReadHTML");
var fileNames = eval('new Array(' + h_AttachmentNames + ')');
var numUploadControlAttachments = 0;
for (var i=0; i<h_NumAttachments; i++) {
len = fileNames[i].length;
if ( fileNames[i].substring(0, 6) != "Image.") {
numUploadControlAttachments++;
}
}
if (uploadControlExists() && numUploadControlAttachments ) {
containsUploadControl = true;
if (this.fieldLabel != "" || (this.fieldTitle != "" && this.fieldTitle != "Untitled")) {
pageBanner(pageFrame, "<span style=\"font-size: small\">" + "You can download any of the files below by dragging them to your Windows desktop. To open a file for reading, double-click it." + "</span>");
}
var outputHTML = '<object title="' + 'Upload control' + '" id=' +'UploadControl' + ' width="' + '100%' + '"' + ' height="' + 138 + '"' + ' classid="clsid:' + '05D96F71-87C6-11D3-9BE4-00902742D6E0' + '"' + ' codebase="' + getProtocalAndServerUrl () + getAbsoluteServerRootPath(self) + '/qp2.cab#Version=' + "8,2,0,0" + '"' + '>';
outputHTML += 		'<param name="General_Mode" value=' + 1 + '>';
outputHTML += 		'<param name="General_URL" value="' + getAbsoluteRoomPath(self) + '/' + "$defaultview" + '/' + pageFrame.h_PageUnid + '">';
outputHTML += 		'<param name="General_CurrentEditScene" value="' + theForm.h_SetEditCurrentScene.value + '">';
outputHTML += 		'<param name="General_ServerName" value="' + getProtocalAndServerUrl () + '">';
outputHTML += 		'<param name="General_MaxFileSize" value="' + h_MaxFileSizeAllowedToUpload + '">';
outputHTML += 		'<param name="General_BgColor" value="' + h_CurrentBgColor + '">';
outputHTML += 		'<param name="Attachment_Lengths" value="' + h_AttachmentLengths + '">';
outputHTML +=		'<param name="Attachment_Names" value=\'' + replaceStr(h_AttachmentNames, "'", "[QPSQ]") + '\'>';
var AttachTimes;
if (typeof(pageFrame.h_AttachmentTimes) != "undefined" && pageFrame.h_AttachmentTimes != "") {
AttachTimes = pageFrame.h_AttachmentTimes;
outputHTML += 		'<param name="Attachment_Times" value="' + AttachTimes + '">';
} else if (typeof(pageFrame.h_AttachmentTimesMime) != "undefined" && pageFrame.h_AttachmentTimesMime != "") {
AttachTimes = pageFrame.h_AttachmentTimesMime;
outputHTML += 		'<param name="Attachment_Times" value="' + AttachTimes + '">';
} else {
var MailAttachTime = h_DocCreated;
var index;
for (index=0; index < h_NumAttachments; index++) {
if (!index) {
AttachTimes = MailAttachTime;
} else {
AttachTimes += ",";
AttachTimes += MailAttachTime;
}
}
outputHTML += 		'<param name="Attachment_Times" value="' + AttachTimes + '">';
}
outputHTML += 		'<param name="Attachment_ReadOnlyMode" value="1">';
outputHTML += 		'<param name="Attachment_ListViewMode" value="2">';
outputHTML += '</object>';
_qp_WriteHtml(outputHTML);
document.write('<br>&nbsp;');
}
else if ( numUploadControlAttachments ) {
document.write("<div style=\"width: 95%; border: 1px solid #D4D4D4;\">");
if (this.fieldLabel != "" || (this.fieldTitle != "" && this.fieldTitle != "Untitled")) {
pageBanner(pageFrame, "<span style=\"font-size: small\">" + "You can download or launch any of the files below by clicking on them:" + "</span>");
}
var sBase = QuickrGeneralUtil.getBaseUrl();
sBase = sBase.substring(sBase.indexOf("//")+2);
sBase = sBase.substring(sBase.indexOf("/"));
var c = 0;
var len;
for (var i = 0; i<h_NumAttachments; i++) {
len = fileNames[i].length;
if (fileNames[i].substring(0, 6) != "Image.") {
var sTarget = "target=_blank";
if ( !h_ClientBrowser.isSafari() ) sTarget = "";
var url = QuickrGeneralUtil.getDownloadLink(pageFrame.h_PageUnid, fileNames[i]);
document.write('<a class="qpg_navText" ' + sTarget + ' href="' + url + '">' + ceInsertMarkersforStaticString( fileNames[i], 'ceFILE_PATH') + '</a><br>');
}
}
document.write('</div><br>&nbsp;');
}
logExit("getAttachmentsReadHTML");
};














function _NotifyIndicatorField() { 
logEnter("_NotifyIndicatorField");
logExit("_NotifyIndicatorField"); 
};
oNS3BugWorkAround = new _NotifyIndicatorField();
_NotifyIndicatorField.prototype = new _Field();
_NotifyIndicatorField.prototype.init = notifyIndicatorField_init;
_NotifyIndicatorField.prototype.initChild = notifyIndicatorField_initChild;
_NotifyIndicatorField.prototype.getReadModeHTML = getNotifyIndicatorReadHTML;
function notifyIndicatorField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function notifyIndicatorField_initChild(){ 
logEnter("notifyIndicatorField_initChild");
logExit("notifyIndicatorField_initChild"); 
};
function getNotifyIndicatorReadHTML(pageFrame, fieldIndex) { 
logEnter("getNotifyIndicatorReadHTML");
logExit("getNotifyIndicatorReadHTML"); 
};














function _SubjectField() { 
logEnter("_SubjectField");
logExit("_SubjectField"); 
};
oNS3BugWorkAround = new _SubjectField();
_SubjectField.prototype = new _Field();
_SubjectField.prototype.init = subjectField_init;
_SubjectField.prototype.initChild = subjectField_initChild;
_SubjectField.prototype.getReadModeHTML = getSubjectReadHTML;
function subjectField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function subjectField_initChild(){ 
logEnter("subjectField_initChild");
logExit("subjectField_initChild"); 
};
function getSubjectReadHTML(pageFrame, fieldIndex) { 
logEnter("getSubjectReadHTML");
if (pageFrame.h_NameIsBanner == "1") {
var originatorName = (pageFrame.h_PageType!="h_Mail")?getCommonName(pageFrame.h_Originator):"";
var authorName = (typeof pageFrame.h_AlternateName=="undefined" || pageFrame.h_AlternateName=="")?originatorName:replaceStr(pageFrame.h_AlternateName, "'", "\'")+" ("+originatorName+"),";
var rev = "";
if ( h_PageType == "h_Response")
rev = formatMessage( 'Response to: %1', linkHTML);
else
rev = formatMessage( 'Revision #%1 of %2', pageFrame.h_RevNum, linkHTML);
if (h_PageType == "h_Response" || h_PageType == "h_Revision") {
document.write(
'<table width=100%><td align='+"right"+'><font size=1><SPAN class=' + "h-responselink-text" + '>&#91;' + 
rev +
'</SPAN></td></table>');
}
}
logExit("getSubjectReadHTML"); 
};














function _NamePopupField() { 
logEnter("_NamePopupField");
logExit("_NamePopupField"); 
};
oNS3BugWorkAround = new _NamePopupField();
_NamePopupField.prototype = new _Field();
_NamePopupField.prototype.init = nameField_init;
_NamePopupField.prototype.initChild = nameField_initChild;
_NamePopupField.prototype.getReadModeHTML = getNameReadHTML;
function nameField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function nameField_initChild(){ 
logEnter("nameField_initChild");
logExit("nameField_initChild"); 
};
function getNameReadHTML(pageFrame, fieldIndex) { 
logEnter("getNameReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
var fieldValue = eval('pageFrame.'+fieldObj.fieldName+'DisplayNames');
if (typeof(fieldValue)=="undefined") {
fieldValue = eval('pageFrame.'+fieldObj.fieldName);
}
fieldValue = (typeof(fieldValue)=="undefined"?"":fieldValue);
fieldValue = (fieldValue=="h_Members")?replaceStr(fieldValue, "h_Members", "All Members"):getCommonName(fieldValue);
pageInput(pageFrame, fieldObj.fieldTitle, fieldValue);
logExit("getNameReadHTML"); 
};














function _TimeControlField() { 
logEnter("_TimeControlField");
logExit("_TimeControlField"); 
};
oNS3BugWorkAround = new _TimeControlField();
_TimeControlField.prototype = new _Field();
_TimeControlField.prototype.init = timeField_init;
_TimeControlField.prototype.initChild = timeField_initChild;
_TimeControlField.prototype.getReadModeHTML = getTimeReadHTML;
function timeField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function timeField_initChild(){ 
logEnter("timeField_initChild");
logExit("timeField_initChild"); 
};
function getTimeReadHTML(pageFrame, fieldIndex) { 
logEnter("getTimeReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
var fieldValue = eval('pageFrame.'+fieldObj.fieldName);
fieldValue = (typeof(fieldValue)=="undefined"?"":fieldValue);
fieldValue = fieldValue.substring(0, 5) + fieldValue.substring(8);
pageInput(pageFrame, fieldObj.fieldTitle, fieldValue);
logExit("getTimeReadHTML"); 
};














function _CreateMSWordField() { 
logEnter("_CreateMSWordField");
logExit("_CreateMSWordField"); 
};
oNS3BugWorkAround = new _CreateMSWordField();
_CreateMSWordField.prototype.init = CreateMSWordField_init;
_CreateMSWordField.prototype.initChild = CreateMSWordField_initChild;
_CreateMSWordField.prototype = new _ImportField();
function CreateMSWordField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function CreateMSWordField_initChild(){ 
logEnter("CreateMSWordField_initChild");
logExit("CreateMSWordField_initChild"); 
};
function _CreateMSExcelField() { 
logEnter("_CreateMSExcelField");
logExit("_CreateMSExcelField"); 
};
oNS3BugWorkAround = new _CreateMSExcelField();
_CreateMSExcelField.prototype.init = CreateMSExcelField_init;
_CreateMSExcelField.prototype.initChild = CreateMSExcelField_initChild;
_CreateMSExcelField.prototype = new _ImportField();
function CreateMSExcelField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function CreateMSExcelField_initChild(){ 
logEnter("CreateMSExcelField_initChild");
logExit("CreateMSExcelField_initChild"); 
};
function _MSPowerPointField() { 
logEnter("_MSPowerPointField");
logExit("_MSPowerPointField"); 
};
oNS3BugWorkAround = new _MSPowerPointField();
_MSPowerPointField.prototype.init = CreateMSPowerPointField_init;
_MSPowerPointField.prototype.initChild = CreateMSPowerPointField_initChild;
_MSPowerPointField.prototype = new _ImportField();
function CreateMSPowerPointField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function CreateMSPowerPointField_initChild(){ 
logEnter("CreateMSPowerPointField_initChild");
logExit("CreateMSPowerPointField_initChild"); 
};














function _CreateOOWriterField() { 
logEnter("_CreateOOWriterField");
logExit("_CreateOOWriterField"); 
};
oNS3BugWorkAround = new _CreateOOWriterField();
_CreateOOWriterField.prototype.init = CreateOOWriterField_init;
_CreateOOWriterField.prototype.initChild = CreateOOWriterField_initChild;
_CreateOOWriterField.prototype = new _ImportField();
function CreateOOWriterField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function CreateOOWriterField_initChild(){ 
logEnter("CreateOOWriterField_initChild");
logExit("CreateOOWriterField_initChild"); 
};
function _CreateOOCalcField() { 
logEnter("_CreateOOCalcField");
logExit("_CreateOOCalcField"); 
};
oNS3BugWorkAround = new _CreateOOCalcField();
_CreateOOCalcField.prototype.init = CreateOOCalcField_init;
_CreateOOCalcField.prototype.initChild = CreateOOCalcField_initChild;
_CreateOOCalcField.prototype = new _ImportField();
function CreateOOCalcField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function CreateOOCalcField_initChild(){ 
logEnter("CreateOOCalcField_initChild");
logExit("CreateOOCalcField_initChild"); 
};
function _OOImpressField() { 
logEnter("_OOImpressField");
logExit("_OOImpressField"); 
};
oNS3BugWorkAround = new _OOImpressField();
_OOImpressField.prototype.init = CreateOOImpressField_init;
_OOImpressField.prototype.initChild = CreateOOImpressField_initChild;
_OOImpressField.prototype = new _ImportField();
function CreateOOImpressField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function CreateOOImpressField_initChild(){ 
logEnter("CreateOOImpressField_initChild");
logExit("CreateOOImpressField_initChild"); 
};














function _TextInputField() { 
logEnter("_TextInputField");
logExit("_TextInputField"); 
};
oNS3BugWorkAround = new _TextInputField();
_TextInputField.prototype = new _Field();
_TextInputField.prototype.init = textField_init;
_TextInputField.prototype.initChild = textField_initChild;
function textField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function textField_initChild(){ 
logEnter("textField_initChild");
logExit("textField_initChild"); 
};














function _SerialField() { 
logEnter("_SerialField");
logExit("_SerialField"); 
};
oNS3BugWorkAround = new _SerialField();
_SerialField.prototype = new _Field();
_SerialField.prototype.init = serialField_init;
_SerialField.prototype.initChild = serialField_initChild;
function serialField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function serialField_initChild(){ 
logEnter("serialField_initChild");
logExit("serialField_initChild"); 
};














function _TextPopupField() { 
logEnter("_TextPopupField");
logExit("_TextPopupField"); 
};
oNS3BugWorkAround = new _TextPopupField();
_TextPopupField.prototype = new _Field();
_TextPopupField.prototype.init = popupField_init;
_TextPopupField.prototype.initChild = popupField_initChild;
function popupField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function popupField_initChild(){ 
logEnter("popupField_initChild");
logExit("popupField_initChild"); 
};














function _CalendarControlField()
{ 
logEnter("_CalendarControlField");
logExit("_CalendarControlField"); 
};
oNS3BugWorkAround = new _CalendarControlField();
_CalendarControlField.prototype = new _Field();
_CalendarControlField.prototype.init = calendarField_init;
_CalendarControlField.prototype.initChild = calendarField_initChild;
_CalendarControlField.prototype.getReadModeHTML = getCalendarReadHTML;
function calendarField_init( fieldSysName,
fieldTitle,
fieldLabel,
fieldType,
fieldFocus,
fieldRequired,
fieldDefault,
fieldFormat,
fieldChoiceStr)
{
this.initField( fieldSysName,
fieldTitle,
fieldLabel,
fieldType,
fieldFocus,
fieldRequired,
fieldDefault,
fieldFormat,
fieldChoiceStr); 
this.initChild();
}
function calendarField_initChild()
{ 
logEnter("calendarField_initChild");
logExit("calendarField_initChild"); 
};
function getCalendarReadHTML(pageFrame, fieldIndex) 
{ 
logEnter("getCalendarReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
if (typeof(pageFrame.h_CalendarDate)=="undefined"){
var htmlText = "";
}
else {
var htmlText = getCalendarReadHTMLString(	
pageFrame.h_CalendarDate, 
pageFrame.h_CalendarTime, 
pageFrame.h_CalendarDuration, 
pageFrame.h_AllDayEvent,
pageFrame.h_Repeats,
pageFrame.h_RepeatAmount,
pageFrame.h_RepeatFrequency,
pageFrame.h_CalendarFormat,
pageFrame.h_SendEvent );
}
pageInput(	pageFrame, fieldObj.fieldTitle + '<br><font size=1>Times shown are:  ' + haiku.ServerTimeZoneString + '</font>', dateParse(htmlText));
logExit("getCalendarReadHTML"); 
};
function getCalendarReadHTMLString( 
Date, 
Time, 
Duration, 
AllDayEvent,
Repeats,
RepeatAmount,
RepeatFrequency,
Format,
SendEvent )
{
var durationHours		= Math.floor( Duration / 60);
var durationMinutes  = Duration % 60;
var displayDate		= Date;
var displayDuration	= (( Duration > 0 && 
Format == "h_All" ) ? durationHours + " " + ((durationHours == 1) ? 'hour' : 'hours') + " " + durationMinutes + " " + 'minutes' : "");
var displayTime      = ( AllDayEvent != "1") ? getDisplayableTimeString( Time) + "  " + displayDuration : 'All-day event';
var displayRepeat		= ( Repeats     == "1") ? getCalendarRepeatMessage( getCalendarRepeatFrequencyLabel( RepeatFrequency), RepeatAmount) : "";
var displaySendEvent	= ( SendEvent	 == "1") ? 'Send event to calendar subscribers' : "";
return( displayDate + " " + displayTime + "<br>" + displayRepeat );
}














function _TaskControlField() { 
logEnter("_TaskControlField");
logExit("_TaskControlField"); 
};
oNS3BugWorkAround = new _TaskControlField();
_TaskControlField.prototype = new _Field();
_TaskControlField.prototype.init = taskField_init;
_TaskControlField.prototype.initChild = taskField_initChild;
_TaskControlField.prototype.getReadModeHTML = getTaskReadHTML;
function taskField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function taskField_initChild(){ 
logEnter("taskField_initChild");
logExit("taskField_initChild"); 
};
function getTaskReadHTML(pageFrame, fieldIndex) { 
logEnter("getTaskReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
if (typeof(pageFrame.h_TaskAssignedTo)=="undefined"){
var htmlText = "";
}
else {	
var htmlText = '<TABLE border=0 cellPadding=2 cellSpacing=0 width=100%>'+
'<TR><TD width=3%>&nbsp; </TD>'+
'<TD align='+"left"+' vAlign=top>'+ 
'Status:' + '&nbsp;' + ((pageFrame.h_TaskStatus=="h_Complete")?'Complete':'Incomplete') + 
'</TD>'+
'<TD align='+"left"+' vAlign=top>'+
'Assigned To:' + '&nbsp;' + 
( ( typeof( pageFrame.h_TaskAssignedToDisplayName) != "undefined" && pageFrame.h_TaskAssignedToDisplayName != "") ? pageFrame.h_TaskAssignedToDisplayName : getCommonName(pageFrame.h_TaskAssignedTo)) + 
'</TD>'+
'</TR>'+
'<TR><TD width=3%>&nbsp; </TD>'+
'<TD align='+"left"+' vAlign=top>'+
'Due Date:' + '&nbsp;' + convertDateString(pageFrame.h_TaskDueDate)+ 
'</TD>'+
'<TD align='+"left"+' vAlign=top>';
var fieldValue = "";
if (h_Authors.indexOf("h_Members") > -1)
{
fieldValue = "All Members";
}
else 
{
fieldValue += h_AuthorsDisplayName;
}
htmlText += 'Who can edit this task?' + '&nbsp;' + fieldValue + '</TD></TR>';
if (fieldObj.fieldFormat.indexOf("h_StartDate") > -1) {
htmlText += '<TR><TD width=3%>&nbsp; </TD><TD align='+"left"+' vAlign=top>' + 'Start Date:' + '&nbsp;' + convertDateString(pageFrame.h_TaskStartDate) + '</TD>';
if (fieldObj.fieldFormat.indexOf("h_Category") == -1) {
htmlText += '</TR>';
}
}
if (fieldObj.fieldFormat.indexOf("h_Category") > -1) {
if (fieldObj.fieldFormat.indexOf("h_StartDate") == -1) {
htmlText += '<TR><TD width=3%>&nbsp; </TD>';
}
htmlText += '<TD align='+"left"+' vAlign=top>' + 'Priority:' + '&nbsp;' + pageFrame.h_TaskCategory + '</TD></TR>';
}
htmlText += '<TR><TD colSpan=2 height=8 width=3%></TD></TR></TABLE>';
}
pageBanner(pageFrame, fieldObj.fieldTitle);
document.write(htmlText);
logExit("getTaskReadHTML"); 
};














function _TextAreaField() {
logEnter("_TextAreaField");
logExit("_TextAreaField");
};
oNS3BugWorkAround = new _TextAreaField();
_TextAreaField.prototype = new _Field();
_TextAreaField.prototype.init = textAreaField_init;
_TextAreaField.prototype.initChild = textAreaField_initChild;
_TextAreaField.prototype.getReadModeHTML = textAreaField_getReadHTML;
_TextAreaField.prototype.massageFieldValueForRead = textAreaField_massageFieldValueForRead;
_TextAreaField.prototype.massageFieldValueForEdit = textAreaField_massageFieldValueForEdit;
function textAreaField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function textAreaField_initChild(){
logEnter("textAreaField_initChild");
logExit("textAreaField_initChild");
};
function textAreaField_getReadHTML(pageFrame, fieldIndex){
logEnter("textAreaField_getReadHTML");
var fieldValue = eval(this.fieldName);
pageInput(pageFrame, this.fieldTitle, (typeof(fieldValue)=="undefined"?"":this.massageFieldValueForRead(fieldValue)));
logExit("textAreaField_getReadHTML");
};
function textAreaField_massageFieldValueForRead(fieldValue){
logEnter("textAreaField_massageFieldValue");
return fieldValue.replace(/\&amp;/gi,"&").replace(/\&lt;br\&gt;/gi,"<br/>").replace(/\r/gi,"<br>");
logExit("textAreaField_massageFieldValue");
}
function textAreaField_massageFieldValueForEdit(fieldValue){
logEnter("textAreaField_massageFieldValue");
return fieldValue.replace(/\&amp;/gi,"&");
logExit("textAreaField_massageFieldValue");
}













function _MeetingOptionsField() { 
logEnter("_MeetingOptionsField");
logExit("_MeetingOptionsField"); 
};
oNS3BugWorkAround = new _MeetingOptionsField();
_MeetingOptionsField.prototype = new _Field();
_MeetingOptionsField.prototype.init = meetingOptionsField_init;
_MeetingOptionsField.prototype.initChild = meetingOptionsField_initChild;
_MeetingOptionsField.prototype.getReadModeHTML = getMeetingOptionsReadHTML;
function meetingOptionsField_init(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr) {
this.initField(fieldSysName,fieldTitle,fieldLabel,fieldType,fieldFocus,
fieldRequired,fieldDefault,fieldFormat,fieldChoiceStr);
this.initChild();
}
function meetingOptionsField_initChild(){ 
logEnter("meetingOptionsField_initChild");
logExit("meetingOptionsField_initChild"); 
};
var limrJoinMtgButton, limrJoinMtgButtonOver, AddButton;
function getMeetingOptionsReadHTML(pageFrame, fieldIndex)
{ 
logEnter("getMeetingOptionsReadHTML");
var fieldObj = currentRoom.formDef[pageFrame.h_Form].fieldDef[fieldIndex];
var outHtml = "<table>";
var meetingStatus = ((typeof (h_MeetingStatus) != "undefined") ? h_MeetingStatus : "2");
if (typeof h_MeetingUrl != "undefined" )
{
if (h_MeetingUrl != "")
{
outHtml += "<tr><td>";
if (meetingStatus == '1')
{
outHtml += "This meeting is in session." + "<br>";
outHtml += '<span class="lotusBtn">';
outHtml += "<a target=_blank href=" + h_MeetingUrl;
outHtml += ' alt= "';
outHtml += "Join Meeting Now";
outHtml += '" title= "';
outHtml += "Join Meeting Now";			
outHtml += '">';
outHtml += "Join Meeting Now";
outHtml += '</a>';
outHtml += '</span>';
}
else if (meetingStatus == '0')
{
outHtml += "This Meeting has not started.";
}
else
{
outHtml += "This Meeting has finished.";
}
outHtml += "</td></tr>";
}
else
{
outHtml += "<tr><td>" + "Error: The meeting was not created because the meeting server was unavailable. To try again, edit this content then click Publish." + "</td></tr>";
}
}
outHtml += "<tr><td><br>" + ((h_MeetingPassword != "") ? "(This meeting is password protected.)" : "(This meeting is not password protected.)") + "</td></tr>";
if (typeof h_MeetingUrl != "undefined" )
{
outHtml += "<tr><td><br>" + "This meeting is located at the following address (URL)." + "<br><a target=\"_blank\" href=\"" + h_MeetingUrl + "\">" + h_MeetingUrl + "</a></td></tr>";
}
outHtml += "</table>";
pageInput(pageFrame, "Meeting status", outHtml);
var avTool;
if (h_MeetingAudioVideoOptions == 2)
avTool = "Computer audio";
else if (h_MeetingAudioVideoOptions == 4)
avTool = "Computer audio and video";
else 
avTool = "None";
outHtml = '<table width="100%" cols="50%,*">';
var i = 0;
var rows = new Array ();
if (h_MeetingToolsOptions & 0x02)
{
rows[i] = "Screen sharing"; i++;
}
if (h_MeetingToolsOptions & 0x04)
{
rows[i] = "Meeting Room Chat"; i++;
}
if (h_MeetingToolsOptions & 0x08)
{
rows[i] = "Send Web Page"; i++;
}
if (h_MeetingToolsOptions & 0x10)
{
rows[i] = "Polling"; i++;
}
var bShowAudioOption = '' == "false" ? false : true;
var bShowVideoOption = '' == "false" ? false : true;
var bShowAvOption = (bShowAudioOption & bShowVideoOption) ? true : false;
var tableWidth = bShowAvOption ? "50%" : "100%";
for (i = 0; i < rows.length; i++)
{
outHtml += "<tr><td width=" + tableWidth + ">" + rows[i] + "</td>";
outHtml += bShowAvOption ? ("<td width=*>" + ((i == 0) ? avTool : "&nbsp;") + "</td>") : "";
outHtml += "</tr>";
}
outHtml += "</table>";
pageInput(pageFrame, "Meeting tools", outHtml);
logExit("getMeetingOptionsReadHTML"); 
};
























































































































function writeRemoteErrorHTML ()
{ 
document.write('<table border=0 cellpadding=1 cellspacing=0 width=100%>');
document.write('<tr class=h-folderBanner-bg><td class=h-quickBrowseTitle-text colspan=4 nowrap>' + 'Error' + '</td></tr>');
document.write('<tr><td colspan=4>&nbsp;</td></tr>');
document.write('<tr><td class=h-quickBrowseItem-text colspan=4 nowrap>' + 'To continue working in your place,<br>close this window and try again.' + '</td></tr>');
document.write('<tr><td colspan=4>&nbsp;</td></tr></table>');
};
function getErrorHTML(errorTitle, errorGif, errorString, errorSolution, errorMargin) { 
var transparentGif = "../../../../../qphtml/attachments/transparent.gif";
var marginHeight = (typeof(errorMargin) == "undefined") ? 100 : errorMargin;
var szHTML= '';
if ('ltr' == 'ltr')
szHTML +='<table cellpadding="0" cellspacing="0" border="0">';
else
szHTML +='<table cellpadding="0" cellspacing="0" border="0" style="direction:rtl;" dir="rtl">';
szHTML +=	'<tr>';
szHTML +=		'<td width="1"><img src="' + transparentGif + '" width="10" height="' + marginHeight + '" alt="" border="0"></td>';
szHTML +=		'<td width="475"><img src="' + transparentGif + '" width="475" height="10" alt="" border="0"></td>';
szHTML +=		'<td width="1"><img src="' + transparentGif + '" width="1" height="1" alt="" border="0"></td>';
szHTML +=		'<td width="50%">&nbsp;</td>';
szHTML +=	'</tr>';
szHTML +=	'<tr>';
szHTML +=		'<td>&nbsp;</td>';
szHTML +=		'<td class="h-errorBanner-textbg">';
szHTML +=			'<table cellpadding="0" cellspacing="0" border="0" width="100%">';
szHTML +=				'<tr class="h-errorBanner-textbg">';
szHTML +=					'<td width="21" ><img src="' + transparentGif + '" width="21"  height="2" alt="" border="0"></td>';
szHTML +=					'<td width="63" ><img src="' + transparentGif + '" width="63"  height="1" alt="" border="0"></td>';
szHTML +=					'<td width="13" ><img src="' + transparentGif + '" width="13"  height="1" alt="" border="0"></td>';
szHTML +=					'<td width="348"><img src="' + transparentGif + '" width="348" height="1" alt="" border="0"></td>';
szHTML +=					'<td width="30" ><img src="' + transparentGif + '" width="30"  height="1" alt="" border="0"></td>';
szHTML +=				'</tr>';
szHTML +=				'<tr class="h-errorBanner-textbg">';
szHTML +=					'<td>&nbsp;</td>';
szHTML +=					'<td colspan="3" class="h-errorBanner-textbg">';
szHTML +=						'<span class="h-errorBanner-textbg">' + errorTitle + '</span>';
szHTML +=					'</td>';
szHTML +=					'<td>&nbsp;</td>';
szHTML +=				'</tr>';
szHTML +=				'<tr class="h-errorBanner-textbg">';
szHTML +=					'<td colspan="5"><img src="' + transparentGif + '" width="1" height="4" alt="" border="0"></td>';
szHTML +=				'</tr>';
szHTML +=				'<tr class="h-errorContent-textbg">';
szHTML +=					'<td colspan="5"><img src="' + transparentGif + '" width="1" height="24" alt="" border="0"></td>';
szHTML +=				'</tr>';
szHTML +=				'<tr class="h-errorContent-textbg">';
szHTML +=					'<td><img src="' + transparentGif + '" width="1" height="80" alt="" border="0"></td>';
szHTML +=					'<td valign="top"><img src="' + errorGif + '" width="63" height="54" alt="" border="0"></td>';
szHTML +=					'<td>&nbsp;</td>';
szHTML +=					'<td valign="top" class="h-errorContent-textbg">';
szHTML +=						errorString;				
szHTML +=						'<br><br>';
szHTML +=						errorSolution;
szHTML +=					'</td>';
szHTML +=					'<td>&nbsp;</td>';
szHTML +=				'</tr>';
szHTML +=				'<tr class="h-errorContent-textbg">';
szHTML +=					'<td colspan="5"><img src="' + transparentGif + '" width="1" height="24" alt="" border="0"></td>';
szHTML +=				'</tr>';
szHTML +=				'<tr class="h-errorBanner-textbg">';
szHTML +=					'<td colspan="5"><img src="' + transparentGif + '" width="1" height="1" alt="" border="0"></td>';
szHTML +=				'</tr>';
szHTML +=			'</table>';
szHTML +=		'</td>';
szHTML +=		'<td class="h-errorBanner-textbg">&nbsp;</td>';
szHTML +=		'<td>&nbsp;</td>';
szHTML +=	'</tr>';
szHTML +=	'<tr>';
szHTML +=		'<td width="50%"><img src="' + transparentGif + '" width="1" height="' + marginHeight + '" alt="" border="0"></td>';
szHTML +=		'<td width="475"><img src="' + transparentGif + '" width="475" height="1" alt="" border="0"></td>';
szHTML +=		'<td width="1"><img src="' + transparentGif + '" width="1" height="1" alt="" border="0"></td>';
szHTML +=		'<td width="50%">&nbsp;</td>';
szHTML +=	'</tr>';
szHTML +='</table>';
return szHTML; 
};
function tryAgain() { 
history.back();
};
function  getAbsoluteHaikuDirPath (page) 
{ 
var DirPath = "";
DirPath =  getAbsoluteHaikuPath (page); 
DirPath = DirPath.substring(0, DirPath.lastIndexOf('/')); 
DirPath = DirPath.substring(0, DirPath.lastIndexOf('/')+1);
return DirPath;
};
function getProtocalAndServerUrl () { 
return location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : ''); 
};
function getHaikuSubDir(page)
{
var haikuBaseUrl = 'LotusQuickr';
return haikuBaseUrl;
}
function getSetupHaiku(page)
{
var haikuSubDir = getHaikuSubDir(page);
var haikuSetupDir = haikuSubDir.toLowerCase();
return haikuSetupDir;
}
function  getAbsoluteHaikuPath (page) 
{ 
var PageURL = "";
if (page) 
PageURL =  page.location.pathname;
else
PageURL = location.pathname;
if (location.port != "") {
var badString = "/:" + location.port;
var badIndex = PageURL.lastIndexOf(badString);
if (badIndex == 0) {
PageURL = PageURL.substring(badString.length, PageURL.length);
}
}
var idx = PageURL.lastIndexOf(".nsf");
if (idx > 0) {
PageURL = PageURL.substring(0, idx);
PageURL = PageURL.substring(0, PageURL.lastIndexOf('/')+1);
return PageURL;
}
var haikuBaseUrl = getHaikuSubDir(page);
return "/" + haikuBaseUrl + "/" +  haikuName + "/";
};
function  getAbsoluteHaikuURL ( page) 
{ 
return getProtocalAndServerUrl () + getAbsoluteHaikuPath( page);
};
function  getAbsoluteServerRootPath (page) 
{ 
var DirPath = "";
var HaikuDir = "/" + getHaikuSubDir(page) + "/";
DirPath =  getAbsoluteHaikuDirPath (page);
DirPath = DirPath.substring(0, DirPath.lastIndexOf('/')- HaikuDir.length + 1); 
return DirPath;
};
function buildAbsoluteUrl(sUrl, bForceHttp)
{ 
var sPath = window.location.pathname;
var nPos = window.location.href.indexOf(sPath);
sUrl = window.location.href.substr(0, nPos) + sUrl;
return bForceHttp ? sUrl.replace(/https:/, "http:") : sUrl;
};
var gUndefined;
function gotoHash(s) { 
logEnter("gotoHash");
location.hash = s;
logExit("gotoHash"); 
};
function isNameInCanonicalFormat (someName)
{ 
logEnter("isNameInCanonicalFormat");
var tmpName = someName.toLowerCase();
if (tmpName.indexOf("cn=") == 0 || tmpName.indexOf("uid=") == 0)
return true;
return false;
logExit("isNameInCanonicalFormat"); 
};
function getCommonName( canonicalName) 
{ 
logEnter("getCommonName");
var szCommonName = "";
var szCN  = "CN=";
var szUID = "UID=";
var szDNcomponentSeparator = "/";
if( canonicalName.length > 3 )
{
if ( canonicalName.substring( 0, szCN.length).toUpperCase( ).indexOf( szCN) == 0) 
{
if ( canonicalName.indexOf( szDNcomponentSeparator) > 3) 
{
szCommonName = canonicalName.substring(3, canonicalName.indexOf( szDNcomponentSeparator));
}
else
{
szCommonName = canonicalName.substring(3);
}
}
else if ( canonicalName.substring( 0, szUID.length).toUpperCase( ).indexOf( szUID) == 0) 
{
if ( canonicalName.indexOf( szDNcomponentSeparator) > 4) 
{
szCommonName = canonicalName.substring(4, canonicalName.indexOf( szDNcomponentSeparator));
}
else
{
szCommonName = canonicalName.substring(4);
}
}
else { 
szCommonName = canonicalName;
}
} else {
szCommonName = canonicalName;
}
return szCommonName;
logExit("getCommonName"); 
};
function getCommonNames( nameList) 
{ 
logEnter("getCommonNames");
var delimiter  = ", ";
var CNnameList = ""; 
while ( nameList.length > 0) {
var lastChar = ( nameList.toUpperCase( ).indexOf( delimiter) == -1) ? nameList.length : nameList.toUpperCase( ).indexOf( delimiter);
var canonicalName = nameList.substring(0, lastChar);
CNnameList += ((CNnameList != "")? delimiter : "") + getCommonName( canonicalName); 
nameList = (lastChar < nameList.length) ? nameList.substring( canonicalName.length + 2) : "";
} 	
return CNnameList;
logExit("getCommonNames"); 
};
function isNumericString( str)
{ 
logEnter("isNumericString");
var i;
for( i=0; i<str.length; i++)
{
if( str.charCodeAt( i) < '0'.charCodeAt( ) || 
str.charCodeAt( i) > '9'.charCodeAt( )) 
return( false);
}
return( true);
logExit("isNumericString"); 
};
function buildUrl (nsfName, haikuName) { 
logEnter("buildUrl");
if (haikuName)
return getAbsoluteHaikuDirURL () + haikuName + "/" + nsfName;
else
return getAbsoluteHaikuURL () + nsfName;
logExit("buildUrl"); 
};
function  getAbsoluteServerRootURL (page) 
{ 
logEnter("getAbsoluteServerRootURL");
return getProtocalAndServerUrl () + getAbsoluteServerRootPath ( page);
logExit("getAbsoluteServerRootURL"); 
};
function  getAbsoluteHaikuDirURL (page) 
{ 
logEnter("getAbsoluteHaikuDirURL");
return getProtocalAndServerUrl () + getAbsoluteHaikuDirPath( page);
logExit("getAbsoluteHaikuDirURL"); 
};
function  getAbsoluteRoomURL (page) 
{ 
logEnter("getAbsoluteRoomURL");
if (currentRoom && currentRoom.roomNsf) {
return getProtocalAndServerUrl () + getAbsoluteHaikuPath (page) + currentRoom.roomNsf;
} else {
return getProtocalAndServerUrl () + getAbsoluteHaikuPath (page)  + "Main.nsf";
}
logExit("getAbsoluteRoomURL"); 
};
function  getAbsoluteRootURL (page) 
{ 
logEnter("getAbsoluteRootURL");
if (currentRoom && currentRoom.roomNsf) {
return getAbsoluteHaikuPath (page) + currentRoom.roomNsf;
} else {
return getAbsoluteHaikuPath (page)  + "Main.nsf";
}
logExit("getAbsoluteRootURL"); 
};
function  getRelativeRoomURL (page) 
{ 
logEnter("getRelativeRoomURL");
if (currentRoom && currentRoom.roomNsf) {
return "../../" + currentRoom.roomNsf;
} else {
return "../../"  + "Main.nsf";
}
logExit("getRelativeRoomURL"); 
};
function  getAbsoluteRoomPath (page) 
{ 
logEnter("getAbsoluteRoomPath");
if (currentRoom && currentRoom.roomNsf) {
return getAbsoluteHaikuPath (page) + currentRoom.roomNsf;
} else {
return getAbsoluteHaikuPath (page) + "Main.nsf";
}
logExit("getAbsoluteRoomPath"); 
};
function  getAbsoluteContactsURL (page) 
{ 
logEnter("getAbsoluteContactsURL");
return getProtocalAndServerUrl () + getAbsoluteHaikuPath (page)  + "Contacts1.nsf";
logExit("getAbsoluteContactsURL"); 
};
function  getAbsoluteContactsPath (page) 
{ 
logEnter("getAbsoluteContactsURL");
return getAbsoluteHaikuPath (page)  + "Contacts1.nsf";
logExit("getAbsoluteContactsURL"); 
};
function ConstructFakeBaseURL (page) 
{ 
logEnter("ConstructFakeBaseURL");
return getAbsoluteRoomURL (page) + "/$skip/$skip/";
logExit("ConstructFakeBaseURL"); 
};	
var reorderReplaceStr = new Array( "<",">");
var strReorderReplacements = new Array("&lt;","&gt;"); 
function displayReorderList(pageFrame, listContext, skipCt, fieldNum) { 
logEnter("displayReorderList");
var origReorderList		= pageFrame.reorderNameList;
var origReorderPosList	= pageFrame.reorderUnidList;
var outStr				= "";
var dummyEntries     = (typeof (skipCt) == "undefined" ? 1 : skipCt);
var reorderList = new Array();
var reorderPosList = new Array();
var j = 0;
for (var i = 0; i < origReorderList.length; i++) {
if (origReorderList[i] == "Entry")
continue;
reorderList[j] = origReorderList[i];
reorderPosList[j] = origReorderPosList[i];
j++;	
}
outStr = '<table border="0" width="100%" cellspacing="2" cellpadding="2"><tr><td width="5%" style="vertical-align:middle;">';
outStr += '<select title="' + 'You can reorder an item in the form by selecting an item in this combobox and then selecting the up or down link to the right of this field.' + '" size=6 name=reorderList>';
outStr += '<option>' + '(use the arrows to reorder items)' + '</option>';
for (var i = 0; i < reorderList.length; i++) {
outStr += '<option value=' + reorderPosList[i] + '>' + replaceStrList(reorderList[i],reorderReplaceStr,strReorderReplacements);
}
outStr += '</select></td>';
outStr += '<td width="5%"  style="vertical-align:middle;">';
var buttonName="";
var imgExtra = "";
if (currentMember.isADAEnabled()=="1") 
{
outStr += '<a href="javascript:void 0" onclick="javascript:moveSelectHTMLControlEntry(document.forms[\'h_PageUI\'].reorderList, -1,' + dummyEntries + '); return false;">';
outStr += 'Move selected entry up';
outStr += '</a><br>';
}
else if ( h_ClientBrowser.hasIECacheBug())
{
buttonName = 'reorderUp';
imgExtra = ' border=0  width="23" height="24" ';
imgExtra += ' onMouseOver="getImage(this, 0,\'' + buttonName + '\',';
imgExtra += '\'' + "../../../../.." + "/qphtml/attachments/" + 'reorderuphilite'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + '\');"'; 
imgExtra += ' onMouseOut="getImage(this, 0,\'' + buttonName + '\',' + '\'' + "../../../../.." + "/qphtml/attachments/" + 'reorderup'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + '\');"';
outStr += '<a href="javascript:void 0" onclick="javascript:moveSelectHTMLControlEntry(document.forms[\'h_PageUI\'].reorderList, -1,' + dummyEntries + '); return false;">';
outStr += genImageTag("../../../../.." + "/qphtml/attachments/" + "reorderup"+((document.body.dir =='rtl')? '_rtl' : '')+".gif",buttonName,imgExtra, 'Up');
outStr += '</a><br>';
}
else
{
outStr += '<a href="javascript:void 0" onclick="javascript:moveSelectHTMLControlEntry(document.forms[\'h_PageUI\'].reorderList, -1,' + dummyEntries + '); return false;" onMouseOver=\'javascript:document.reorderUp.src="' + "../../../../.." + "/qphtml/attachments/" + 'reorderuphilite'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + '";\' onMouseOut=\'javascript:document.reorderUp.src="' + "../../../../.." + "/qphtml/attachments/" + 'reorderup'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + '";\'><img name="reorderUp" border=0 width="23" height="24" src='+ "../../../../.." + "/qphtml/attachments/" + 'reorderup'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + "></a><br>";
}
outStr += '<img scr="/icons/onepixel.gif" width="1" height="4"><br>';
if (currentMember.isADAEnabled()=="1") 
{
outStr += '<a href="javascript:void 0" onclick="javascript:moveSelectHTMLControlEntry(document.forms[\'h_PageUI\'].reorderList, 1,' + dummyEntries + '); return false;">';
outStr += 'Move selected entry down';
outStr += '</a><br>';
}
else if ( h_ClientBrowser.hasIECacheBug())
{
buttonName = 'reorderDown';
imgExtra = ' border=0  width="23" height="24" ';
imgExtra += ' onMouseOver="getImage(this, 0,\'' + buttonName + '\',';
imgExtra += '\'' + "../../../../.." + "/qphtml/attachments/" + 'reorderdownhilite'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + '\');"'; 
imgExtra += ' onMouseOut="getImage(this, 0,\'' + buttonName + '\',' + '\'' + "../../../../.." + "/qphtml/attachments/" + 'reorderdown'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + '\');"';
outStr += '<a href="javascript:void 0" onclick="javascript:moveSelectHTMLControlEntry(document.forms[\'h_PageUI\'].reorderList, 1,' + dummyEntries + '); return false;">';
outStr += genImageTag("../../../../.." + "/qphtml/attachments/" + "reorderdown"+((document.body.dir =='rtl')? '_rtl' : '')+".gif",buttonName,imgExtra, 'Down');
outStr += '</a><br>';
}
else
{
outStr += '<a href="javascript:void 0" onclick="javascript:moveSelectHTMLControlEntry(document.forms[\'h_PageUI\'].reorderList, 1,' + dummyEntries + '); return false;" onMouseOver=\'javascript:document.reorderDown.src="' + "../../../../.." + "/qphtml/attachments/" + 'reorderdownhilite'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + '";\' onMouseOut=\'javascript:document.reorderDown.src="' + "../../../../.." + "/qphtml/attachments/" + 'reorderdown'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + '";\'><img name="reorderDown" border=0 width="23" height="24" src='+ "../../../../.." + "/qphtml/attachments/" + 'reorderdown'+((document.body.dir =='rtl')? '_rtl' : '')+'.gif' + "></a><br>";
}
outStr += '</td><td  style="vertical-align:middle;text-align:justify">' + '<font size="1">You can reorder an item in the list by clicking on the item and then clicking on the up/down arrow.</font>' + '</td></tr></table>';
if ( isNaN( listContext)) {
pageInput(pageFrame, listContext, outStr, fieldNum);
}
else {
if (listContext == 0) 
pageInput(pageFrame, 'Do you want to reorder the content?', outStr, fieldNum);
else if (listContext == 1)
pageInput(pageFrame, 'Do you want to reorder the fields on this form? ' + '', outStr, fieldNum);
else if (listContext == 2)
pageInput(pageFrame, 'You can reorder the columns in the list below:', outStr, fieldNum);
else if (listContext == 3) {
pageInput(pageFrame, "", outStr, fieldNum);
}
else if (listContext == 4)
pageInput(pageFrame, '<B>Reorder forms.</B> Do you want to change the order in which the forms are presented to authors?', outStr, fieldNum);
}
logExit("displayReorderList"); 
};
function moveSelectHTMLControlEntry (reorderListArg, moveDirection, dummyEntries) { 
logEnter("moveSelectHTMLControlEntry");
var listLength = reorderListArg.length;
if (listLength == 1) return;
var currentIndex = reorderListArg.selectedIndex;
if (currentIndex == listLength - 1 && moveDirection == "1") return;
if ((currentIndex < dummyEntries) || (currentIndex == dummyEntries && moveDirection == "-1"))
{
if (dummyEntries == 1 || currentIndex == 0) return;
alert ('The Title, Author, and Modified columns, when visible, are always the first three columns in a folder. Please select any other column to reorder');
return;
}
var currentText = reorderListArg.options[currentIndex].text;
var currentValue = reorderListArg.options[currentIndex].value;
reorderListArg.options[currentIndex].text = reorderListArg.options[currentIndex + moveDirection].text;
reorderListArg.options[currentIndex].value = reorderListArg.options[currentIndex + moveDirection].value;
reorderListArg.options[currentIndex + moveDirection].text = currentText;
reorderListArg.options[currentIndex + moveDirection].value = currentValue;
reorderListArg.options[currentIndex + moveDirection].selected = true;
logExit("moveSelectHTMLControlEntry"); 
};
function setCookie (name,value,expires,path,domain,secure) 
{ 
logEnter("setCookie");
var szExpires = "";
if (expires) {
if (typeof(expires)=="number") {
var date = new Date();
date.setTime(date.getTime()+(expires*24*60*60*1000));
szExpires = "; expires="+date.toGMTString();
}
else if (expires instanceof Date) {
szExpires = "; expires="+expires.toGMTString();
}
}
document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent (value) +
szExpires +
"; path=" + ((path) ? path : "/") +
((domain) ? "; domain=" + domain : "") +    ((secure) ? "; secure" : "");
logExit("setCookie"); 
};
function getCookie (name)
{ 
var nameRead = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameRead) == 0) return c.substring(nameRead.length,c.length);
}
return null;
}
function removeCookie(name) {
setCookie(name,"",-1);
}
function initRadioGroupValue (radioControl, radioValue, radioFocus) { 
logEnter("initRadioGroupValue");
if (typeof(radioControl) != "undefined") {
if (!isNaN (radioControl.length)) {
var i;
for (i = 0; i < radioControl.length; i++) {
if (radioControl [i].value == radioValue) {
radioControl [i].checked = true;
if (typeof(radioFocus) != "undefined" && radioFocus== true) {
radioControl[i].focus();
radioControl[i].select();
}
break;
}
}
}
else {
radioControl.checked = true;
if (typeof(radioFocus) != "undefined" && radioFocus== true) {
radioControl.focus();
radioControl.select();
}
}
}
logExit("initRadioGroupValue"); 
};
function getRadioValue( radioControl) 
{ 
logEnter("getRadioValue");
if (typeof(radioControl) != "undefined") {
if (!isNaN (radioControl.length)) {
var i;
for (i = 0; i < radioControl.length; i++) {
if (radioControl [i].checked == true) {
return radioControl [i].value;
}
}
}
else {
return radioControl.value;
}
}
logExit("getRadioValue"); 
};
function getRadioIndex( radioControl, valueString)
{ 
logEnter("getRadioIndex");
if (typeof(radioControl) != "undefined") {
if (!isNaN (radioControl.length)) {
var i;
for (i = 0; i < radioControl.length; i++) {
if (radioControl[i].value == valueString) {
return(i);
}
}
return (-1); 
}
else {
return (-2); 
}
}
return (-3); 
logExit("getRadioIndex"); 
};
function clearRadioGroup (radioControl) { 
logEnter("clearRadioGroup");
if (typeof(radioControl) != "undefined") {
if (!isNaN (radioControl.length)) {
var i;
for (i = 0; i < radioControl.length; i++) {
radioControl [i].checked = false;
}
}
else {
radioControl.checked = false;
}
}
logExit("clearRadioGroup"); 
};
function getSelectValue( selectControl)
{ 
logEnter("getSelectValue");
if (typeof(selectControl) != "undefined") {
if (!isNaN (selectControl.length)) {
var i;
for (i = 0; i < selectControl.length; i++) {
if (selectControl[i].selected == true) {
return selectControl[i].value;
}
}
}
else {
return selectControl.value;
}
}
logExit("getSelectValue"); 
};
function initSelectValue (selectControl, selectValue) { 
logEnter("initSelectValue");
if (typeof(selectControl) != "undefined") {
if (!isNaN (selectControl.length)) {
var i;
for (i = 0; i < selectControl.length; i++) {
if (selectControl.options [i].value == selectValue) {
selectControl.options [i].selected = true;
selectControl.selectedIndex = i;
break;
}
}
}
else {
selectControl.selectedIndex = 0;
}
}
logExit("initSelectValue"); 
};
function initSelectValueByText (selectControl, selectValue) { 
logEnter("initSelectValueByText");
if (typeof(selectControl) != "undefined") {
if (!isNaN (selectControl.length)) {
var i;
for (i = 0; i < selectControl.length; i++) {
if (selectControl.options [i].text == selectValue) {
selectControl.options [i].selected = true;
selectControl.selectedIndex = i;
break;
}
}
}
else {
selectControl.selectedIndex = 0;
}
}
logExit("initSelectValueByText"); 
};
var imgList = new Array();
var tableImgList = new Array();
function getImage( winObj, nDirect, imgName, theURL)
{ 
logEnter("getImage");
checkImage = new Image();
checkImage.src = theURL;
var	i;
var theImgObj;
if ( typeof(winObj) == "undefined")
{
return;
}
if ( nDirect == 1)
{
theImgObj = winObj;
}
else
{
theImgObj = eval( "winObj.document." + imgName);
}
if (( typeof( theImgObj) == "undefined") ||
( typeof( theImgObj.src) == "undefined"))
{
return;
}
for ( i = 0; i < imgList.length; i++)
{
if ( imgList[i].src == checkImage.src)
{
theImgObj.src = imgList[i].src;
return;
}
}
i = imgList.length;
imgList[i] = checkImage;
theImgObj.src = imgList[i].src;
return;
logExit("getImage"); 
};
function genImageTag( URLString, ImgName, ImgExtra, ImgAltText)
{ 
logEnter("genImageTag");
if ( typeof( ImgExtra)   == "undefined") ImgExtra   = "";
if ( typeof( ImgAltText) == "undefined") ImgAltText = "";
var altString='';
if (ImgAltText != "")
altString = ' alt="' + ImgAltText + ((h_ClientBrowser.isGecko() || h_ClientBrowser.isSafari()) ? '" title="'+ ImgAltText + '" ' : '"');
else 
altString = ' alt=""';
return ( '<img name=' + ImgName + ' src="' + URLString + '" ' + ImgExtra + altString + ' />');
logExit("genImageTag"); 
};
function replaceStrList( strToFix, oldStr, newStr)
{ 
logEnter("replaceStrList");
var i;
for ( i = 0; i < oldStr.length; i++)
{
strToFix = replaceStr( strToFix, oldStr[i], newStr[i]);
}
return strToFix;
logExit("replaceStrList"); 
};
function replaceStr( strToFix, oldStr, newStr)
{ 
logEnter("replaceStr");
var index;
var bDone = false;
var tempString = strToFix;
strToFix = "";
while ( !bDone)
{
index = tempString.indexOf(oldStr);
if ( index != -1)
{
strToFix += tempString.substring( 0, index) + newStr;
if ( index < (tempString.length - oldStr.length))
{
tempString = tempString.substring(index+oldStr.length);
}
else
{
bDone = true;
}
}
else
{
strToFix += tempString;
bDone = true;
}
}	
return strToFix;
logExit("replaceStr"); 
};
function convertToHTML(strToFix) { 
logEnter("convertToHTML");
var strBrackets = new Array("<",">","\r","\n");
var strSafeBrackets = new Array("&lt;","&gt;","<br />","<p />");
strToFix = (typeof(strToFix) != "undefined") ? replaceStrList(strToFix, strBrackets, strSafeBrackets) : strToFix;
return strToFix;
logExit("convertToHTML"); 
};
function stripLeadingAndTrailingSpaces(theString)
{ 
logEnter("stripLeadingAndTrailingSpaces");
if (theString.length != 0)
{
while (theString.charAt(0) == " ")
theString = theString.substring (1);
}
if (theString.length != 0)
{
while (theString.charAt(theString.length - 1) == " ")
theString = theString.substring (0, theString.length - 1);
}
return (theString);
logExit("stripLeadingAndTrailingSpaces"); 
};
function stripLogin(){ 
logEnter("stripLogin");
var idx = location.href.lastIndexOf("&Login");
if (idx > 0) {
return location.href.substring(0, idx);
}
else {
return location.href;
}
logExit("stripLogin"); 
};
function setLocation(newLoc) { 
logEnter("setLocation");
location.href = newLoc;
logExit("setLocation"); 
};
function toHex( decNum)
{ 
logEnter("toHex");
hexVals = "0123456789ABCDEF";
if ( decNum > 255)
{
decNum = 255;
}
var i = decNum % 16;
var j = ( decNum - 1) / 16;
var result = hexVals.charAt(j);
result += hexVals.charAt(i);
return result;
logExit("toHex"); 
};
var headlineGraphicFont = new Array();
function setAnimation(sceneName) { 
logEnter("setAnimation");
theForm.h_SetEditNextScene.value = sceneName;
logExit("setAnimation"); 
};
function displayTheBanner(tmpName){ 
logEnter("displayTheBanner");
if (typeof tmpName != "undefined") {
var strToReplace = new Array("<", ">");
var strReplacements = new Array("&lt;", "&gt;");
pageBanner(self, replaceStrList(tmpName, strToReplace, strReplacements) + " " + bannerText);
}
logExit("displayTheBanner"); 
};
function writeAnimation( theObj, theAnimation, bCenter)
{ 
logEnter("writeAnimation");
var centerHTML = "";
var centerHTMLEnd = "";
if ( bCenter)
{
centerHTML = '<center>';
centerHTMLEnd = '</center>';
}
theObj.document.write(centerHTML + '<img src="' + theAnimation + '">' + centerHTMLEnd);
logExit("writeAnimation"); 
};
function isArrayElement( item, list) { 
logEnter("isArrayElement");
for (var j = 0; j < list.length; j++) {
if (item == list[j]) {
return 1;
}
}
return 0;
logExit("isArrayElement"); 
};
function escapeChar(theString, theChar)
{ 
logEnter("escapeChar");
var theIndex;
var retString = "";
theIndex = theString.indexOf(theChar);
if ( theIndex == -1) {
return theString;
}
while ( theIndex != -1)
{
retString = theString.substring(0, theIndex);				
retString += encodeURIComponent(theChar);
if ( theIndex < (theString.length - 1))
{
retString += theString.substring(theIndex+1);
}
theString = retString;
theIndex = theString.indexOf(theChar);
}
return retString;
logExit("escapeChar"); 
};
function openRemote( type, param)
{ 
logEnter("openRemote");
var remoteWindow;
var remoteUrl;
var windowWidth=200;
var windowHeight=440;
if (type == 0) {
remoteUrl = getAbsoluteRoomURL(self) + '/' + (h_Context_InFolder==1?h_Context_InFolderName:'h_Toc')+"/$new/?EditDocument&Form=h_RemoteUI"+"&PreSetFields=h_EditAction;"+"h_New"+",h_SetReadScene;"+'h_StdPageRead'+",h_SetEditScene;"+'h_RemoteSearchResults'+",h_ReturnToPage;"+h_PageUnid+',h_Nonce;' + getCookie("NonceToken") + ",h_SetRemote;1,h_SearchString;" + 
encodeURIComponent(h_SearchString) + ",h_SearchAuthor;" + encodeURIComponent(h_SearchAuthor) + ",h_SearchDate;" + encodeURIComponent(h_SearchDate) + ",h_SearchDateTypeString;" + 
h_SearchDateTypeString + ",h_SearchOrder;" + h_SearchOrder + ",h_SearchCount;" + h_SearchCount + ",h_SearchStart;" + 
h_SearchStart + ",h_SetErrorScene;h_RemoteError,h_SetEditCurrentScene;h_RemoteSearchResults,h_SetQuickBrowse;1" +
",h_SearchFolderScope;" + h_SearchFolderScope + ",h_SearchRoomScope;" + h_SearchRoomScope + ",h_SearchType;" + h_SearchType;;
} 
else if (type == 2) {
remoteUrl = getAbsoluteHaikuPath (self) + "Main.nsf" + "/?OpenDatabase&Form=h_SiteMapUI&NoWebCaching"; 
windowWidth=210;
windowHeight=240;
}
else {
remoteUrl = getAbsoluteRoomURL(self) + '/' + (h_Context_InFolder==1?h_Context_InFolderName:'h_Toc')+"/$new/?EditDocument&Form=h_PageContentUI"+"&PreSetFields=h_EditAction;"+"h_New"+",h_SetReadScene;"+'h_StdPageRead'+",h_SetEditScene;"+'h_WhatsNewResults'+",h_ReturnToPage;"+h_PageUnid+',h_Nonce;' + getCookie("NonceToken") + 
",h_SetErrorScene;h_RemoteError,h_SetUpdateWhatsNew;0,h_SetWhatsNewDays;" + param + ",h_SetQuickBrowse;1";
}
remoteWindow = window.open( remoteUrl, "Remote", "resizable=yes,width=" + windowWidth + ",height=" + windowHeight + ",top=20,left=20,toolbar=no,scrollbars=yes,menubar=no,status=no");
if (remoteWindow != null) {
remoteWindow.focus();
}
logExit("openRemote"); 
};
function changeOpenerUrl( url) 
{ 
logEnter("changeOpenerUrl");
if (typeof(opener) != "undefined") {
if ( url.charAt(0) == "/") {
opener.location.href  = getAbsoluteServerRootURL() + url;
} else {
opener.location.href  = url;
}
}
logExit("changeOpenerUrl"); 
};
function validateEmail( theObj) { 
logEnter("validateEmail");
if (theObj.theForm.h_tmpMessage.value.length >= 32*1024) {
alert("Please enter a shorter comment.");
theObj.theForm.h_tmpMessage.focus();
return false;
} else if (checkFieldValue( theObj, "Comment", "h_tmpMessage", 
false, "") == false) {
theObj.theForm.h_tmpMessage.focus();
return false;
} else if (theObj.theForm.h_SetPublishEmailSubject.value.length >= 1024) {
alert("Please enter a shorter subject.");
theObj.theForm.h_SetPublishEmailSubject.focus();
return false;
} else if (checkFieldValue( theObj, "Subject", "h_SetPublishEmailSubject", 
false, "") == false) {
theObj.theForm.h_SetPublishEmailSubject.focus();
return false;
}  else if (theObj.theForm.h_SetPublishEmailAddresses.value.length >= 1024) {
alert("Please enter a shorter \"To\" field.");
theObj.theForm.h_SetPublishEmailAddresses.focus();
return false;
} else if (checkFieldValue( theObj, "To", "h_SetPublishEmailAddresses", 
false, "") == false) {					 
theObj.theForm.h_SetPublishEmailAddresses.focus();
return false;
}
else if (theObj.theForm.h_SetPublishCCEmailAddresses.value.length >= 1024) {
alert("Please enter a shorter \"cc\" field.");
theObj.theForm.h_SetPublishCCEmailAddresses.focus();
return false;
} else if (checkFieldValue( theObj, "CC", "h_SetPublishCCEmailAddresses", 
false, "") == false) {					 
theObj.theForm.h_SetPublishCCEmailAddresses.focus();
return false;
}
else if (theObj.theForm.h_SetPublishBCCEmailAddresses.value.length >= 1024) {
alert("Please enter a shorter \"bcc\" field.");
theObj.theForm.h_SetPublishBCCEmailAddresses.focus();
return false;
} else if (checkFieldValue( theObj, "BCC", "h_SetPublishBCCEmailAddresses", 
false, "") == false) {					 
theObj.theForm.h_SetPublishBCCEmailAddresses.focus();
return false;
}
return true;
logExit("validateEmail"); 
};
function getFileNameFromTypeFileTag(formName, fieldName)
{ 
logEnter("getFileNameFromTypeFileTag");
var theFileHolder = eval ("formName." + fieldName);
if (typeof (theFileHolder) == "undefined")
return ("");
if (theFileHolder.value != '') 
{
theFileHolder.focus();
theFileHolder.blur();
var fileName = theFileHolder.value;
if (h_ClientBrowser.isPlatformMac())
{
if (h_ClientBrowser.isIE() && fileName.indexOf('%2F') != -1)
fileName = fileName.substring(fileName.lastIndexOf("%2F")+3);
else if (fileName.indexOf('/') != -1)
fileName = fileName.substring(fileName.lastIndexOf("/")+1);
}
else
{
fileName = fileName.substring(fileName.lastIndexOf("\\")+1);
fileName = fileName.substring( fileName.lastIndexOf("/")+1); 
}
return (fileName);
}
else 
{
return ("");
}
logExit("getFileNameFromTypeFileTag"); 
};
function imageTitle(i,t) { 
logEnter("imageTitle");
document.write('<table border="0" width="100%" cellspacing="2" cellpadding="2"><tr>');
document.write('<td align='+"left"+'  style="vertical-align:middle;" width="11%">');
document.write('<img src=/icons/warningm.gif name=WarningMImg width="60" height="57">' + '</td>');
document.write('<td align='+"left"+'  style="vertical-align:middle;" width="89%"><p><b>' + t + '</b></p></td>');
document.write('</tr></table>');
logExit("imageTitle"); 
};
function listBegin() { 
logEnter("listBegin");
document.write('<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td bgcolor="#FFFFCC">&nbsp;</td></tr></table><br>');
document.write('<table border="0" width="100%" cellspacing="2" cellpadding="2">');
document.write('<tr><td width="11%">');
document.write(genImageTag("../../../../../qphtml/attachments/singlepixel.gif",'OnePixelImg',' width="60" height="1" ') + '</td>');
document.write('</td><td width="89%"><table border="0" width="99%" cellspacing="0" cellpadding="4">');
logExit("listBegin"); 
};
function listEnd() { 
logEnter("listEnd");
document.write('<tr><td width="16%" align='+"left"+' valign="top">&nbsp; </td><td align='+"left"+' width="84%">&nbsp;</td></tr></table></td></tr>');
document.write('</table>');
document.write('<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td bgcolor="#FFFFCC">&nbsp;</td></tr></table>');
document.write('<br>&nbsp;<p>&nbsp;</p>');
logExit("listEnd"); 
};
function listItem(label, text) { 
logEnter("listItem");
document.write('<tr><td width="16%" align='+"left"+' valign="top"><b>' + label + '</b></td>');
document.write('<td align='+"left"+' width="84%">' + text + '</td>');
document.write('</tr><tr><td width="16%" align='+"left"+' valign="top">&nbsp; </td><td align='+"left"+' width="84%">&nbsp;</td></tr>');
logExit("listItem"); 
};
function isInAnyTaskView() { 
logEnter("isInAnyTaskView");
if (	isInTaskListView() || isInToDoView() || isInMilestoneView() ) {
return (true);
}
else {
return (false);
}
logExit("isInAnyTaskView"); 
};
function isInTaskListView() { 
logEnter("isInTaskListView");
if (	(h_Context_InFolder==1?h_Context_InFolderName:'h_Toc') == "h_TaskList" ||
location.href.toUpperCase( ).indexOf( "h_TaskList".toUpperCase()) != -1	||
location.href.toUpperCase( ).indexOf( "D394FAD65829852F852567F20068D0CF".toUpperCase()) != -1) {
return (true);
}
else {
return (false);
}
logExit("isInTaskListView"); 
};
function isInToDoView() { 
logEnter("isInToDoView");
if (	location.href.toUpperCase( ).indexOf( "h_TaskToDoList".toUpperCase())    != -1	||
location.href.toUpperCase( ).indexOf( "FC26FF80844B992B052568B0005C0ADA".toUpperCase()) != -1)	{
return (true);
}
else {
return (false);
}
logExit("isInToDoView"); 
};
function isInMilestoneView() { 
logEnter("isInMilestoneView");
if ( location.href.toUpperCase( ).indexOf( "h_TaskMilestoneList".toUpperCase())    != -1	||
location.href.toUpperCase( ).indexOf( "3E4E4EF48A6899A0052568B0005C0AAC".toUpperCase()) != -1)	{
return (true);
}
else {
return (false);
}
logExit("isInMilestoneView"); 
};
function roomHasTaskisInMilestoneView() { 
logEnter("isInMilestoneView");
if ( location.href.toUpperCase( ).indexOf( "h_TaskMilestoneList".toUpperCase())    != -1	||
location.href.toUpperCase( ).indexOf( "3E4E4EF48A6899A0052568B0005C0AAC".toUpperCase()) != -1)	{
return (true);
}
else {
return (false);
}
logExit("isInMilestoneView"); 
};
function isLocalUser(fromWhere)
{ 
logEnter("isLocalUser");
var bReturn;
var directoryType = getDirectoryType( fromWhere);
if ( (typeof(directoryType) == "undefined") ||
(directoryType == "") ||
((directoryType != "h_UserDirTypeNT") && 
(directoryType != "h_UserDirTypeLDAP") &&
(directoryType != "h_UserDirTypeNAB"))
) 
{
bReturn = true;
}
else
{
bReturn = false;
}
return bReturn;
logExit("isLocalUser"); 
};
function getDirectoryType(directoryString)
{ 
logEnter("getDirectoryType");
var theType = '';
var index = directoryString.indexOf(':');
var index2;
if ( index != -1)
{
index2 = directoryString.indexOf(':', index+1);
if ( index2 != -1)
{
theType = directoryString.substring(index+1, index2);
}
}
return theType;
logExit("getDirectoryType"); 
};
function isPageAuthor( stringList, arrayGroups)
{ 
logEnter("isPageAuthor");
var bIsAuthor = false;
var authorsList = h_Authors.toUpperCase();
if ((authorsList.indexOf(haiku.canonicalName.toUpperCase()) > -1) ||
(haiku.userName != "Anonymous" && (authorsList.indexOf("H_MEMBERS") > -1 || authorsList.indexOf("*") > -1)) ||
(currentUserAccess == 6) ||
(currentUserAccess == 4 && authorsList.indexOf("[H_EDITORS]") > -1 )
){
bIsAuthor = true;
}
else if (stringList != "") {
var szNameListUppercase = stringList.toUpperCase( );
for ( var i = 0; i < arrayGroups.length; i++)
{
if ( arrayGroups[i].toUpperCase( ) != "" && szNameListUppercase.indexOf( arrayGroups[i].toUpperCase( )) > -1)
{
bIsAuthor = true;
break;
}
}
}
return bIsAuthor;
logExit("isPageAuthor"); 
};
function isPageEditor( stringList, arrayGroups, workflowType)
{ 
logEnter("isPageEditor");
var wft = workflowType || (typeof(formObj) != "undefined" ? formObj.workflowType : "");
var bIsEditor = false;
if( haiku.userName != "Anonymous"){
if( typeof(stringList) != "undefined" && stringList != ""){ 
if( isInStringCaseIndependent( stringList, haiku.canonicalName, false) 
|| isInStringCaseIndependent( stringList, "h_Members",false) 
|| ( currentUserAccess == 4 && isInStringCaseIndependent( stringList, "h_Editors",false))
|| ( currentUserAccess == 6 && isInStringCaseIndependent( stringList, "h_Managers",false)) ){
bIsEditor = true;
} else  { 
var szNameListUppercase = stringList.toUpperCase( );
for ( var i = 0; i < arrayGroups.length; i++)
{
if ( arrayGroups[i].toUpperCase( ) != "" && szNameListUppercase.indexOf( arrayGroups[i].toUpperCase( )) > -1)
{
bIsEditor = true;
break;
}
}
}
}else if(wft == 'h_MultipleEditors' 
|| (currentUserAccess == 6 && typeof(h_AllowEdit) != "undefined" && h_AllowEdit == "1") ) { 
bIsEditor = true;
}
}
return bIsEditor;
logExit("isPageEditor"); 
};
function GetUrlArgument( szUrl, szArg)
{ 
logEnter("GetUrlArgument");
var szValue = "";
var idx, idx1;
var szSearchString = "&" + szArg + "=";
idx = szUrl.indexOf( szSearchString);
if (idx != -1)
{
bFound = true;
idx1 = szUrl.indexOf ("&", idx+1);
if (idx1 != -1) 
{
szValue = szUrl.substring(idx + szSearchString.length, idx1);
}
else
{
szValue = szUrl.substring(idx + szSearchString.length);
}
}
return szValue;
logExit("GetUrlArgument"); 
};
function IsTextAbstractNotifiable( szTextAbstract)
{ 
logEnter("IsTextAbstractNotifiable");
var bReturn = true;
if ( typeof( szTextAbstract) == "undefined") {
szTextAbstract = "";
}
if ( szTextAbstract == "") 
{
bReturn = false;
}
else if ( szTextAbstract == "1") 
{
bReturn = false;
}
else if ( typeof( h_Form) == "undefined")
{
bReturn = false;
}
else if ( h_Form == "E9077196440B29CF852567E500525B7F" || 
h_Form == "AA477BBFCF481B9A852567E50055D32C")
{
bReturn = false;
}
else if ( h_Form == "025BBAB4299CCFDF0525670800167246")
{
if ( typeof( h_HTMLImportOriginalFile) == "undefined" ||
h_HTMLImportOriginalFile == "")
{
bReturn = false;
}
else
{
var iIndexOfFileExtension = h_HTMLImportOriginalFile.lastIndexOf('.');
if ( iIndexOfFileExtension != -1) 
{
var szFileType = h_HTMLImportOriginalFile.substring( iIndexOfFileExtension+1);
if ( szFileType.toLowerCase() == "xls" || 
szFileType.toLowerCase() == "ppt" ) 
{
bReturn = false;
}
}
}
}
else if ( h_Form == "4AB181C5B16EAD96852571C5006CC545" || 
h_Form == "B89419C94F878900852571C5006CD64A" ||
h_Form == "0FEFEFDBB62CDC74852571C5006CD8E8")
{
bReturn = false;
}
return bReturn;
logExit("IsTextAbstractNotifiable"); 
};
function replaceFormInAction (formName)
{ 
logEnter("replaceFormInAction");
var action = document.forms['h_PageUI'].action;
var newAction = '';
var idx1 = action.indexOf ('&Form');
if (idx1 != -1)
{
newAction = action.substr(0, idx1);
newAction += '&Form=' + formName;
var tmpAction = action.substr (idx1 + 1);
var idx2 = tmpAction.indexOf ('&');
if (idx2 != -1)
newAction += tmpAction.substr (idx2);
}
else
{
newAction += action + '&Form=' + formName;
}
document.forms['h_PageUI'].action = newAction;
logExit("replaceFormInAction"); 
};
function parseSTCommunityServerSetting ()
{ 
logEnter("parseSTCommunityServerSetting");
var isTAM = false;
isTAM = ((h_SameTimeServerUrlLocation.indexOf ('/') == 0) ? true : false);
var stProtocolIdx = h_SameTimeServerUrlLocation.indexOf ('://');
if (stProtocolIdx == -1)
{
if ( isTAM)
{
;
} else {
h_SameTimeServerUrlLocation = 'http://' + h_SameTimeServerUrlLocation;
}
}
if ( isTAM)
{
h_SametimeCommunityServer = location.hostname;
} else {
stProtocolIdx = h_SameTimeServerUrlLocation.indexOf ('://');
var szTmp = h_SameTimeServerUrlLocation.substring (stProtocolIdx + 3);
var stPortIdx = szTmp.indexOf (':');
if (stPortIdx == -1)
h_SametimeCommunityServer = szTmp;
else
h_SametimeCommunityServer = szTmp.substring (0, stPortIdx - 1);
}
logExit("parseSTCommunityServerSetting"); 
};
function initSTLinksAppletParameters()
{ 
logEnter("initSTLinksAppletParameters");
if (haiku.IsSametimeAwarenessAvailable)
{
try {
setSTLinksURL (h_SameTimeServerUrlLocation + "/sametime/stlinks", "en");
}
catch (e) {
}
}
logExit("initSTLinksAppletParameters"); 
};
function writeLinksApplet_QP ()
{ 
logEnter("writeLinksApplet_QP");
if (haiku.IsSametimeAwarenessAvailable)
{
var nameNotSet = true;
var cn = haiku.sametimeName;
var cn1 = cn.substring(0, 3);
var cnST;
if (haiku.IsSametimeUsingLDAP == false)
{
if (cn1 == "cn=")
{
cnST = "CN=" + cn.substring(3);
nameNotSet = false;
}
}
if (nameNotSet)
{
cnST = cn;
}
try {
writeSTLinksApplet (cnST, h_SameTimeToken, true);
}
catch (e) {
}
}
logExit("writeLinksApplet_QP"); 
};
function GetSTAwarenessIcon(szDN, szCN, szLdapDN)
{ 
if (haiku.IsSametimeAwarenessAvailable)
{
var stName = szDN;
var bResolve = haiku.IsSametimeUsingLDAP;    
if (haiku.IsSametimeUsingLDAP) {
if (typeof(szLdapDN) != "undefined" && szLdapDN != "") {	
stName = szLdapDN;
}
else if (typeof(szDN) != "undefined" && szDN != "") {
stName = szDN.replace(/[/]/g, ",");
}
else {
stName = szCN;
bResolve = true;
}
}
try {
return prepareSametimeLink(stName, szCN, bResolve, "icon:yes;text:no;offlineLink:yes;") + '&nbsp;';
}
catch (e) {
return '';
}
}
return '';
}
function formatMessage( sFmtString  )
{ 
logEnter("formatMessage");
var sResult = "";
var args = formatMessage.arguments;
for (var iPre = 0, i = sFmtString.indexOf('%');
i != -1;
iPre = i + 1, i = sFmtString.indexOf('%', iPre))
{
sResult += sFmtString.substring(iPre, i);
++i; 
if (sFmtString.charAt(i) == '%')
{
sResult += sFmtString.charAt(i);
continue;
}
var num = parseInt(sFmtString.substr(i));
if (num > args.length)
continue;
sResult += args[num];
i += ("" + num).length - 1; 
}
sResult += sFmtString.substr(iPre);
return sResult;
logExit("formatMessage"); 
};
function getMemberInfoLink (memberDNName)
{ 
if (!G_ShowMemberProfileLink || haiku.AnonymousUser() || haikuName=="lotusquickr") {
return null;
}
else {
return (
getAbsoluteHaikuPath (self) + "Main.nsf" + '/' + "$defaultview" + '/' + "7CB1ED9DCD9FCEAB852567C3006E2DBE" 
+ "/?OpenDocument&PreSetFields=h_SetReadScene;h_SecurityMemberInfo,h_MemberName;" 
+ encodeForUrl( encodeURIComponent( memberDNName))
+ ((window.h_printMode && window.h_printMode == '1') ? "&Form=h_PrintUI" : "")
);
}
};
function getMemberPhotoLink(szCN, szDN, szDisplayName, szEmail, szPhoto, szUNID)
{ 
logEnter("getMemberPhotoLink");
var bIsPhotoLocal =
'' == "true"
? true : false;
var photoDirUrl =
'';
var src = '/qphtml/html/common/photo_none.gif';
if (bIsPhotoLocal && szPhoto != "") {
src = getAbsoluteContactsURL(self) + '/' + "$defaultview" + '/' + szUNID + '/$FILE/' + szPhoto;
}
else if (photoDirUrl != "") {
src = photoDirUrl;
if (szEmail != "")
src = src.replace(/\{email\}/, szEmail);
if (szCN != "")
src = src.replace(/\{common_name\}/, szCN);
if (szDisplayName != "")
src = src.replace(/\{display_name\}/, szDisplayName);
if (szDN != "")
src = src.replace(/\{dn\}/, szDN);
}
return src;
logExit("getMemberPhotoLink"); 
};
var g_dominoEncodeChars = new Array();
g_dominoEncodeChars[g_dominoEncodeChars.length] = new Object();
g_dominoEncodeChars[g_dominoEncodeChars.length-1].character = "+";
g_dominoEncodeChars[g_dominoEncodeChars.length-1].encoded = '_95c_';
g_dominoEncodeChars[g_dominoEncodeChars.length] = new Object();
g_dominoEncodeChars[g_dominoEncodeChars.length-1].character = "&";
g_dominoEncodeChars[g_dominoEncodeChars.length-1].encoded = '_s4o_';
function encodeForUrl( stringToEncode)
{ 
logEnter("encodeForUrl");
return ( encodeForUrlCustom( stringToEncode, g_dominoEncodeChars));
logExit("encodeForUrl"); 
};
function encodeForUrlCustom( stringToEncode, codeCharArray)
{ 
logEnter("encodeForUrlCustom");
var returnString = stringToEncode;
for ( var index = 0; index < codeCharArray.length; index++)
{
returnString = replaceStr( returnString, codeCharArray[index].character, codeCharArray[index].encoded);
}
return returnString;
logExit("encodeForUrlCustom"); 
};
function isInStringCaseIndependent( string1, string2, bExactMatch)
{ 
logEnter("isInStringCaseIndependent");
var bIsInString = false;
if (( typeof( string1) != "undefined") && ( typeof( string2) != "undefined"))
{
var string1Lower = string1.toLowerCase();
var string2Lower = string2.toLowerCase();
if ( bExactMatch)
{
if ( string1Lower == string2Lower)
{
bIsInString = true;
}
}
else
{
if ( string1Lower.indexOf( string2Lower) > -1)
{
bIsInString = true;
}
}
}
return bIsInString;
logExit("isInStringCaseIndependent"); 
};
function pageGetElementById(sID, doc)
{ 
logEnter("pageGetElementById");
if(!doc)
doc = document;
if(doc.getElementById(sID))
return doc.getElementById(sID);
var aObjs = pageGetElementsByName(sID, doc);
if(aObjs && aObjs.length)
return aObjs[0];
return null;
logExit("pageGetElementById"); 
};
function pageGetElementsByName(sID, doc)
{ 
logEnter("pageGetElementsByName");
if(!doc)
doc = document;
return doc.getElementsByName(sID);
logExit("pageGetElementsByName"); 
};
function eventGetTarget(ev) { 
logEnter("eventGetTarget");
if(!ev)
ev = window.event;
if(!ev)
return null;
if(ev.srcElement)
return ev.srcElement;
else if(ev.target)
{
var target = ev.target;
while(target && target.nodeName == '#text')
target = target.parentNode;
return target;
}
logExit("eventGetTarget"); 
};
Number.prototype.fill = function Number_fill( nPoint, nRadix ){ 
logEnter("Number_fill");
var sResult = '';
var sNum = ( typeof( nRadix ) == 'number' )? this.toString( nRadix ): this.toString();
for( var i = 0; i < nPoint - sNum.length; i++ )
sResult += '0';
return sResult + sNum;
logExit("Number_fill"); 
};;
function fillZero( nToFill, nPoint ){ 
logEnter("fillZero");
return nToFill.fill( nPoint );
logExit("fillZero"); 
};
Array.prototype.indexOf = function Array_indexOf( vSearch, fnCompare ){ 
logEnter("Array_indexOf");
fnCompare = ( fnCompare )? fnCompare: Array_compare;
for( var i = 0; i < this.length; i++ )
if( fnCompare( this[ i ], vSearch ) ) return i;
return -1;
logExit("Array_indexOf"); 
};;
function Array_compare( vElem1, vElem2 ){ 
logEnter("Array_compare");
return ( vElem1 && typeof( vElem1.isEqual ) == 'function' )? vElem1.isEqual( vElem2 ): vElem1 == vElem2;
logExit("Array_compare"); 
};
function Array_compare_ignore_case( vElem1, vElem2 ){ 
logEnter("Array_compare_ignore_case");
return ( vElem1 && typeof( vElem1.toLowerCase().isEqual ) == 'function' )? vElem1.toLowerCase().isEqual( vElem2.toLowerCase() ): vElem1.toLowerCase() == vElem2.toLowerCase();
logExit("Array_compare_ignore_case"); 
};
Array.prototype.fill = function Array_fill( nTo, vValue ){ 
logEnter("Array_fill");
for( var i = 0; i <= nTo; i++ ){
if( typeof( this[ i ] ) == 'undefined' ) this[ i ] = vValue;
}
return this;
logExit("Array_fill"); 
};;
function MakeArrayFromString( str, delimiter, bTrimBlanks)
{ 
logEnter("MakeArrayFromString");
var theArray = new Array();
var index = 0;
var startIndex = 0;
if  ( typeof( bTrimBlanks) == "undefined" || bTrimBlanks == "")
bTrimBlanks = true;
while ( index != -1)
{
index = str.indexOf( delimiter, startIndex);
if ( index != -1)
{
theArray[theArray.length] = str.substring( startIndex, index);
startIndex = index + 1;
}
else if ( startIndex <= str.length)
{
theArray[theArray.length] = str.substring( startIndex);
}
}
if ( bTrimBlanks)
for ( var i=0; i<theArray.length; i++)
theArray[i] = TrimLeadingBlanks( theArray[i]);
return theArray;
logExit("MakeArrayFromString"); 
};
function TrimLeadingBlanks( str)
{ 
logEnter("TrimLeadingBlanks");
for ( var i=0; i<str.length; i++)
if( str.charAt(i) != " ") 
break;
return str.substring(i);
logExit("TrimLeadingBlanks"); 
};
function TrimStrList( str, strDelimiter, outDelimiter, bSuppressEmpty)
{ 
logEnter("TrimStrList");
if ( typeof( outDelimiter) == "undefined")
outDelimiter = ",";
if ( typeof( bSuppressEmpty) == "undefined")
bSuppressEmpty = true;
var theArray = new Array( );
theArray = MakeArrayFromString( str, strDelimiter);
var outString = "";
for (var i=0; i<theArray.length; i++)
{
if ( typeof( theArray[i]) == "undefined" ||
bSuppressEmpty && theArray[i] == "")
continue;
if ( outString != "") 
outString += outDelimiter;
outString += theArray[i];
}
return outString;
logExit("TrimStrList"); 
};
function fixStyleSheetPrimaryColor(aColor) { 
logEnter("fixStyleSheetPrimaryColor");
var sColor = '';
var asColor = aColor.match( /^ *rgb\( *([0-9]+), *([0-9]+), *([0-9]+) *\) *$/ );
if( asColor )
sColor = ( asColor[ 1 ] - 0 ).fill( 2, 16 ) + ( asColor[ 2 ] - 0 ).fill( 2, 16 ) + ( asColor[ 3 ] - 0 ).fill( 2, 16 );
return sColor;
logExit("fixStyleSheetPrimaryColor"); 
};
if(!window.encodeURIComponent){
window.encodeURIBody = function (str, asciiUnEnc){
var resultStr = "";
var i;
var codePointSave;
var surrogate = false;
var vals = new Array(0,0,0,0);
for (i = 0; i < str.length; i++) {
var codePoint = str.charCodeAt(i);
var nVals = 0;
if (surrogate && codePoint >= 0xDC00 && codePoint <= 0xDFFF) {
vals[0] = ((((codePointSave & 0x03C0) >> 6) + 1) >> 2 ) | 0xF0;
vals[1] = (((((codePointSave & 0x03C0) >> 6) + 1) & 0x03) << 4) | ((codePointSave & 0x003C) >> 2) | 0x80;
vals[2] = ((codePointSave & 0x0003) << 4) | ((codePoint & 0x03C0) >> 6) | 0x80;
vals[3] = (codePoint & 0x003F) | 0x80;
nVals = 4;
surrogate = false;
}
else if (codePoint >= 0xD800 && codePoint <= 0xDBFF) {
surrogate = true;
codePointSave = codePoint;
continue;
}
else {
surrogate = false;
if (codePoint > 0x07FF) {
vals[0] = ((codePoint & 0xF000) >> 12) | 0xE0;
vals[1] = (codePoint & 0xFC0) >> 6 | 0x80;
vals[2] = (codePoint & 0x3F) | 0x80;
nVals = 3;
}
else if (codePoint > 0x007F) {
vals[0] = ((codePoint & 0x7C0) >> 6) | 0xC0;
vals[1] = (codePoint & 0x3F) | 0x80;
nVals = 2;
}
else if (asciiUnEnc.indexOf(str.charAt(i)) < 0) {
vals[0] = codePoint;
nVals = 1;
}
}
if (nVals > 0) {
var j;
for (j = 0; j < nVals; j++) {
var hexStr = vals[j].toString(16).toUpperCase();
if (hexStr.length == 1) {
hexStr = "0" + hexStr;
}
resultStr += "%" + hexStr;
}
}
else {
resultStr += str.charAt(i);
}
}
return resultStr;
};
window.encodeURIComponent = function (str){
var asciiUnEnc = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";
return encodeURIBody(str, asciiUnEnc);
};
}
function toValidURIString(s)
{ 
logEnter("toValidURIString");
return encodeURIComponent(s).replace(/%2c/gi, "%252c");
logExit("toValidURIString"); 
};
function MakeArrayFromString( str, delimiter, bTrimBlanks)
{ 
logEnter("MakeArrayFromString");
var theArray = new Array();
var index = 0;
var startIndex = 0;
if  ( typeof( bTrimBlanks) == "undefined" || bTrimBlanks == "")
bTrimBlanks = true;
while ( index != -1)
{
index = str.indexOf( delimiter, startIndex);
if ( index != -1)
{
theArray[theArray.length] = str.substring( startIndex, index);
startIndex = index + 1;
}
else if ( startIndex <= str.length)
{
theArray[theArray.length] = str.substring( startIndex);
}
}
if ( bTrimBlanks)
for ( var i=0; i<theArray.length; i++)
theArray[i] = TrimLeadingBlanks( theArray[i]);
return theArray;
logExit("MakeArrayFromString"); 
};
function TrimLeadingBlanks( str)
{ 
logEnter("TrimLeadingBlanks");
for ( var i=0; i<str.length; i++)
if( str.charAt(i) != " ") 
break;
return str.substring(i);
logExit("TrimLeadingBlanks"); 
};
function TrimStrList( str, strDelimiter, outDelimiter, bSuppressEmpty)
{ 
logEnter("TrimStrList");
if ( typeof( outDelimiter) == "undefined")
outDelimiter = ",";
if ( typeof( bSuppressEmpty) == "undefined")
bSuppressEmpty = true;
var theArray = new Array( );
theArray = MakeArrayFromString( str, strDelimiter);
var outString = "";
for (var i=0; i<theArray.length; i++)
{
if ( typeof( theArray[i]) == "undefined" ||
bSuppressEmpty && theArray[i] == "")
continue;
if ( outString != "") 
outString += outDelimiter;
outString += theArray[i];
}
return outString;
logExit("TrimStrList"); 
};
function getFolderNameAncestryFromUnidAncestry( unidAncestry )
{
logEnter("getFolderNameAncestryFromUnidAncestry"); 
debugText( "getFolderNameAncestryFromUnidAncestry: " + unidAncestry, 3);
var folderName = "";
var folderUNID = "";
var folderNameAncestry = "";
var i = 0; 
var ii = unidAncestry.indexOf( '~', i); 
if ( ii < 0) ii = unidAncestry.length; 
while ( ii <= unidAncestry.length && ii > 0)
{
folderName = "";
folderUNID = unidAncestry.substring( i, ii); 
if ( folderUNID == h_PageUnid)
{
folderName = h_Name;
}
else
{
for (j=0; j<G_aToc.length; j++)
{
if ( folderUNID == G_aToc[j].item.unid)
{
folderName = G_aToc[j].item.title;
break;
}
}
}
folderNameAncestry += ( folderNameAncestry == "") ? folderName : '~' + folderName;
i = ii+1;
ii = unidAncestry.indexOf( '~', i);
if ( ii == -1 && i < unidAncestry.length ) ii = unidAncestry.length; 
}
debugText( "NameAncestry: " + folderNameAncestry, 3);
logExit("getFolderNameAncestryFromUnidAncestry"); 
return( folderNameAncestry);
}
function hasSubfolders( unid )
{
var ret=false;
for ( var j=0; j<G_aToc.length && !ret; ret=isSubfolderOf( G_aToc[j].item.ancestry, unid), j++);
return ret;
}
function isSubfolder( ancestry )
{
return( ancestry.indexOf( '~') >= 0);
}
function isSubfolderOf( ancestry, unid )
{
return( ancestry.indexOf( unid + '~') >= 0);
}
function canAddDocsToSubfolders( unid )
{
var ret=false;
for ( var j=0; j<G_aToc.length; j++)
{
if ( isSubfolderOf( G_aToc[j].item.ancestry, unid))
{
if ( G_aToc[j].item.canAddDocs == "1")
{
ret = true;
break;
}
}
}
return ret;
}
function setShowInFolderSelector( bShow, folderSysName, bProcessChildren )
{
if (typeof(bProcessChildren) == "undefined") bProcessChildren = false;
for (var i=0; i<G_aToc.length; i++) 
{
if ( G_aToc[i].item.SystemName == folderSysName)
{
G_aToc[i].item.bShow = bShow;
if ( bProcessChildren )
{
for (var j=0; j<G_aToc.length; j++) 
{
if ( isSubfolderOf( G_aToc[j].item.ancestry, G_aToc[i].item.unid))
{
G_aToc[j].item.bShow = bShow;
}
}
}
break;
}
}
}
function userCanAccessOtherRoom()
{
if (!currentRoom.IsTopRoom()) {
return true;
} else {
for (var i=0; i<G_aToc.length; i++) {
if (G_aToc[i].item.type=="3") {
return true;
}
}
}
return false;
}
function getIframeHTML( name, id, width, height, align, border, scroll, srcURL)
{ 
logEnter("getIframeHTML");
var buf = "";
buf += '<table border=0 cellspacing=0 cellpadding=0>';
buf += '<tr>';
buf += '<td width=100% height=200>';
buf +=   '<div name="div_'+ name + '">';
buf +=	'<iframe ' +
' name='				+ name +
' id='				+ id +
' src="'				+ srcURL + '"' + 
' width='			+ width + 
' height='			+ height + 
' scrolling='		+ scroll +
' align='			+ align +
' frameborder='	+ border +
' marginwidth=0 ' + 
' marginheight=0' + 
'>';
buf +=		'&nbsp;';
buf +=	'</iframe>';
buf += '</div>';
buf += '</td>';
buf += '</tr>';
buf += '</table>';
return buf;
logExit("getIframeHTML"); 
};
function getFolderStyle()
{
try {
return (h_SetReadScene.indexOf('h_MyPlaces') >= 0 ? 'h_MyPlaces' : h_FolderStyle);
}
catch (e) {
return "0";
}
}
function writePagePreamble(title, desc, href)
{
var theDesc = desc || "";
if (theDesc != "") {
document.write('<h6 class="preamble">'+theDesc+'</h6>');
}
}
function writeFormTypeDescription(formUnid, formName, formDesc, docType)
{
var bgImg=GetDocTypeIconImgSrc(docType,formUnid,((docType == "1")? "1":''),'LG');
var html='<div class="h-form-description" style="background-image: url('+bgImg+');">'
+formName
+'<span>'+formDesc+'</span>'
+'</div>';
document.write(html);
}
function focusFormElement(fName, elName, index)
{
if (document.all) {
setTimeout("___focusFormElement('" + fName + "','" + elName + "'," + index + ")", 200);
}
else {
___focusFormElement(fName, elName, index);
}
}
function ___focusFormElement(fName, elName, index)
{
try {
var el = document.forms[fName].elements[elName];
if (typeof(index) != "undefined") {
el = el[index];
}
el.focus();
el.select();
}
catch (e) {
}
}
function utf8EncodeEntities(str)
{
var encstr = "";
var parts = str.split(";");
for (i = 0; i < parts.length; i++) {
var j = 0;
var part = parts[i];
while (part.charAt(j) != '&' && j < part.length) {
encstr += part.charAt(j++);
}
if (j < part.length - 1) {
if (part.charAt(j+1) == '#') {
var ent;
if (part.charAt(j+2) == 'x' || part.charAt(j+2) == 'X') {
ent = part.substr(j+3);
} else {
ent = part.substr(j+2);
var ient = parseInt(ent);
if (!isNaN(ient)) {
ent = ient.toString(16);
}
}
encstr += "%u" + ent;
} else {
encstr += part.substr(j);
}
}
}
encstr = unescape(encstr);
return encodeURIComponent(encstr);
}
function unicodeToHTML(sU) {
var sH = "";
var len = sU.length;
for (i=0; i<len; i++) {
c = sU.charCodeAt(i);
sH += (c > 256? "&#" + c + ";": sU.charAt(i));
}
return sH;
}
function getDisplayableDateTime( dateTime, dateTimeSeparator)
{ 
logEnter("getDisplayableDateTime");
var dateString = dateTime.substring( 0, dateTime.indexOf( " ")); 
var dateElements = new Array( 0, 0, 0);   
var displayDate;
if (parseDateString( dateString, dateElements))
displayDate = buildDateString( dateElements[0], dateElements[1], dateElements[2] );
else
displayDate = "";
var displayTime = getDisplayableTimeString( dateTime.substring( dateTime.indexOf(" ")+1));
return displayDate + dateTimeSeparator + displayTime;
logExit("getDisplayableDateTime"); 
};
function getDisplayableTimeString( timeString)
{ 
if(!haiku.h_Intl_AMPMPrefix) {
var hhmm;
var ampm = ( !haiku.h_Intl_MilitaryTime) ? timeString.substring( timeString.indexOf(" ") ) : "";
if (haiku.h_Intl_MilitaryTime)
hhmm = timeString;
else
hhmm = timeString.substring( 0, timeString.indexOf( " ")-3);
return( hhmm + ampm);
}
else {
return timeString.substring(0, timeString.length-3);
}
};
function buildURLDateString( dateString)
{ 
logEnter("buildURLDateString");
if( !validDate( dateString)) return("");
var dateElements = new Array( 0, 0, 0);   
if ( !parseDateString( dateString, dateElements))
return("");
var day   = dateElements[0];
var month = dateElements[1];
var year  = dateElements[2];
return( (( year<0 || year>9999) ? -1 :(( year<50) ? year+2000 :(( year<100) ?( year+1900) : year))) + '-' + (( month<10)?'0':'') + month + '-' + (( day<10)?'0':'') + day);
logExit("buildURLDateString"); 
};
function validDate( dateString)
{ 
logEnter("validDate");
var dateElements = new Array( 0, 0, 0);   
if ( !parseDateString( dateString, dateElements))
return( false);
var day   = dateElements[0];
var month = dateElements[1];
var year  = dateElements[2];
if( !haiku.h_Intl_Date4DigitYear && year >= 100 && year <= 999) 
return( false);
year = (( year<0 || year>9999) ? -1 :(( year<50) ? year+2000 :(( year<100) ?( year+1900) : year)));
var aDate = new Date( year, month-1, day);  	
if(isHijri)	{var aDate = new dateHijri( year, month-1, day); year  = dateElements[2];}
if(isHebrew){var aDate = new dateHebrew( year, month-1, day);year  = dateElements[2];}
if( aDate.getMonth( )    == month-1 && 
aDate.getDate( )     == day && 
aDate.getFullYear( ) == year ) 
{
return( true);
}
else
{
return( false);
}
logExit("validDate"); 
};
function parseDateString( dateString, dateElements)
{ 
logEnter("parseDateString");
var slashIdx1 = parseInt( dateString.indexOf( haiku.h_Intl_DateString), 10);
if( slashIdx1 == -1) return( false);
var element1 = dateString.substring( 0, slashIdx1);
if( !isNumericString( element1)) return( false);
var slashIdx2 = parseInt( dateString.lastIndexOf( haiku.h_Intl_DateString),10);
if( slashIdx2 == -1) return( false);
var element2 = dateString.substring( slashIdx1 + 1, slashIdx2);
if( !isNumericString( element2)) return( false);
var element3 = dateString.substring( slashIdx2 + 1);
if( !isNumericString( element3)) return( false);
if( haiku.h_Intl_DateFormat == haiku.kszDMY) 
{
dateElements[0] = parseInt( element1,10); 
dateElements[1] = parseInt( element2,10); 
dateElements[2] = parseInt( element3,10); 
}
else if( haiku.h_Intl_DateFormat == haiku.kszYMD)
{
dateElements[2] = parseInt( element1,10);	
dateElements[1] = parseInt( element2,10); 
dateElements[0] = parseInt( element3,10); 
}
else 
{
dateElements[1] = parseInt( element1,10); 
dateElements[0] = parseInt( element2,10); 
dateElements[2] = parseInt( element3,10); 
}
return( true);
logExit("parseDateString"); 
};
function buildDateString( day, month, year)
{ 
logEnter("buildDateString");
var dateString;
var sl=haiku.h_Intl_DateString;
var yr=( year >= 1950 && year < 2000) ? year-1900 : year; 
if( haiku.h_Intl_Date4DigitYear && yr < 100) 
yr +=( yr < 50) ? 2000 : 1900;
if( haiku.h_Intl_DateFormat == haiku.kszDMY)
{
dateString =(( day<10) ? "0"+day : day).toString( ) + sl + (( month<10) ? "0"+month : month).toString( ) + sl + yr;
}
else if( haiku.h_Intl_DateFormat == haiku.kszYMD)
{
dateString = yr + sl + (( month<10) ? "0"+month : month).toString( ) + sl + (( day<10) ? "0"+day : day).toString( );
}
else 
{
dateString =(( month<10) ? "0"+month : month).toString( ) + sl + (( day<10) ? "0"+day : day).toString( ) + sl + yr;
}
return( dateString);
logExit("buildDateString"); 
};
function getCalendarRepeatMessage( frequency, times)
{ 
logEnter("getCalendarRepeatMessage");
return( formatMessage( 'Repeats %1 for a total of %2 events.', frequency , times) );
logExit("getCalendarRepeatMessage"); 
};
function getCalendarRepeatFrequencyLabel( frequencyIdx)
{ 
logEnter("getCalendarRepeatFrequencyLabel");
if ( frequencyIdx == 1) 
return( 'daily');
else if ( frequencyIdx == 2) 
return( 'weekly');
else 
return ( "");
logExit("getCalendarRepeatFrequencyLabel"); 
};
