//   ------------------------------------------------------------
//   Document.js
//   ------------------------------------------------------------
//   VCS INFO:
//   
//   $Revision:   1.37  $
//   $Date:   15 Mar 2001 16:24:28  $
//   $Author:   vpham  $
//   $Workfile:   document.js  $
//   ------------------------------------------------------------
//   INCLUDE DEPEDENCY:
//   WSCAPI/InitPage.js
//   Redist/PopupManager/PopupManager.js
//   WSCAPI/Result.js
//   WSCAPI/Misc.js
//   WSCAPI/EnableRemoteObject.asp
//   ------------------------------------------------------------
//   All Rights Reserved.  Copyright (c) 1988-1999 FileNET Corp.
//   ------------------------------------------------------------

function ViewerPopup(x, y, libraryName, objId, featureString)
{
	var width = screen.width * 3 / 4;
	var height = screen.height * 2 / 3;
	var decoration = 200;
	
	if (x < 0)
    	x = (screen.width - width)/2;
	if (y < 0)
    	y = (screen.height - decoration - height)/2;

	var URL = IDMWSC_baseURL + "/DocView.asp?id=" + objId + "&Library=" + libraryName;
	var PopupFeatures = "dependent=no,toolbar=yes,directories=no,location=yes,menubar=yes,resizable=yes,scrollbars=no,status=yes,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x;

	// Form the unique popup window name.
	var popupName = IDMWSC_PopupManager_generatePopupNamePrefix(libraryName) + "View_Document_ID_" + IDMWSC_replaceSeparatorsWithUnderscores(objId);

	IDMWSC_PopupManager_open("Viewer", popupName, URL, PopupFeatures, true);
}

function DocOperationsPopup(x, y, libraryName, objId, featureString)
{
	var width, height;
	var isLargeFonts = IDMWSC_getCookie('IDMWSC_largeFonts');
	if (eval(isLargeFonts))
	{
		// make popup bigger for large font case
		width = 575;
		height = 215;
	}
	else
	{
		width = 430;
		height = 160;
	}
	if (x < 0)
		x = 200;  // use default
	if (y < 0)
		y = 100;  // use default
	if (featureString == "")
		featureString = "OpenMode=open";

	var URL = IDMWSC_baseURL + "/Redist/DocControls/SimpleDoc.asp?id=" + objId + "&Library=" + libraryName + "&" + featureString;
	var PopupFeatures = "dependent=no,toolbar=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x;

	// Form the unique popup window name.
	var popupName = IDMWSC_PopupManager_generatePopupNamePrefix(libraryName) + "Open_Document_ID_" + IDMWSC_replaceSeparatorsWithUnderscores(objId);

	IDMWSC_PopupManager_open("DocControl", popupName, URL, PopupFeatures, false);
}


function CompoundDocOperationsPopup(x, y, libraryName, objId, featureString)
{
	var width, height;
	var isLargeFonts = IDMWSC_getCookie('IDMWSC_largeFonts');
	if (eval(isLargeFonts))
	{
		// make popup bigger for large font case
		width = 575;
		height = 235;
	}
	else
	{
		width = 430;
		height = 180;
	}
	if (x < 0)
		x = 200;  // use default
	if (y < 0)
		y = 100;  // use default
	if (featureString == "")
		featureString = "OpenMode=open";

	var URL = IDMWSC_baseURL + "/Redist/DocControls/CompoundDoc.asp?id=" + objId + "&Library=" + libraryName + "&" + featureString;
	var PopupFeatures = "dependent=no,toolbar=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x;

	// Form the unique popup window name.
	var popupName = IDMWSC_PopupManager_generatePopupNamePrefix(libraryName) + "Document_ID_" + IDMWSC_replaceSeparatorsWithUnderscores(objId);

	IDMWSC_PopupManager_open("DocControl", popupName, URL, PopupFeatures, false);
}

// IDMWSC_Document constants 
var IDMWSC_Document_launchIDMViewer = 0;
var IDMWSC_Document_launchNativeApplication = 1;

// IDMWSC_Document States

var IDMWSC_Document_StateSet_Document         = 0x0001;
var IDMWSC_Document_StateSet_Security         = 0x0002;
var IDMWSC_Document_StateSet_VCKO_Set         = 0x0004;
var IDMWSC_Document_StateSet_Others           = 0x0008;

var IDMWSC_Document_checkedOut                = 0x0001;
var IDMWSC_Document_isExternalDocument        = 0x0002;
var IDMWSC_Document_indexed                   = 0x0003;
var IDMWSC_Document_archived                  = 0x0004;
var IDMWSC_Document_canArchive                = 0x0005;
var IDMWSC_Document_canCancelCheckout         = 0x0006;
var IDMWSC_Document_canCheckin                = 0x0007;
var IDMWSC_Document_canCheckout               = 0x0008;
var IDMWSC_Document_canDeindex                = 0x0009;
var IDMWSC_Document_canDelete                 = 0x000A;
var IDMWSC_Document_canIndex                  = 0x000B;
var IDMWSC_Document_canReclaim                = 0x000C;
var IDMWSC_Document_hasChild			      = 0x000D;
var IDMWSC_Document_isPermanent               = 0x000E;
var IDMWSC_Document_canMakePermanent          = 0x000F;
var IDMWSC_Document_isReplica                 = 0x0010;
var IDMWSC_Document_latestVersion             = 0x0011;
var IDMWSC_Document_canView                   = 0x0012;
var IDMWSC_Document_annotated                 = 0x0013;
var IDMWSC_Document_canMakeImpermanent        = 0x0014;
var IDMWSC_Document_isPublished			      = 0x0015;
var IDMWSC_Document_isReportMgrPDF		      = 0x0016;
// WORKFLOW
var IDMWSC_Document_canLink		      		  = 0x0017;
// End of WORKFLOW


var IDMWSC_Document_StateSets = new Array();
IDMWSC_Document_StateSets[IDMWSC_Document_checkedOut]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_isExternalDocument]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_indexed]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_archived]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_canArchive]= IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_canCancelCheckout]= IDMWSC_Document_StateSet_VCKO_Set + IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_canCheckin]= IDMWSC_Document_StateSet_VCKO_Set;
IDMWSC_Document_StateSets[IDMWSC_Document_canCheckout]= IDMWSC_Document_StateSet_VCKO_Set + IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_canDeindex]= IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_canDelete]= IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_canIndex]= IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_canReclaim]= IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_hasChild]= IDMWSC_Document_StateSet_Document; 
IDMWSC_Document_StateSets[IDMWSC_Document_isPermanent]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_canMakePermanent]= IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_isReplica]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_latestVersion]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_canView]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_annotated]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_canMakeImpermanent]= IDMWSC_Document_StateSet_Security;
IDMWSC_Document_StateSets[IDMWSC_Document_isPublished]= IDMWSC_Document_StateSet_Document;
IDMWSC_Document_StateSets[IDMWSC_Document_isReportMgrPDF]= IDMWSC_Document_StateSet_Document;
// WORKFLOW
IDMWSC_Document_StateSets[IDMWSC_Document_canLink]= IDMWSC_Document_StateSet_Document;
// end of WORKFLOW

var IDMWSC_Document_minState                  = IDMWSC_Document_checkedOut;
//WORKFLOW var IDMWSC_Document_maxState                  = IDMWSC_Document_isReportMgrPDF;
var IDMWSC_Document_maxState                  = IDMWSC_Document_canLink;

var IDMWSC_Document_unknownState              = -1 ; // 1 and 0 are the boolean values in question.

// IDMWSC_Document method implementations:

function IDMWSC_Document_setState(state,value)
{
	this.m_States[state] = value;
}

function IDMWSC_Document_getState(state) 
{
	var objResult;
	
	if((!state) || (state < IDMWSC_Document_minState ) || (state > IDMWSC_Document_maxState ))
	{
		//  check to see if the state is valid.
		objResult = new IDMWSC_Result(IDMWSC_Result_error, -1, "Invalid state requested.", false, state);
		return objResult;
	}
	
	if((null == this.m_States[state]) || (this.m_States[state] == IDMWSC_Document_unknownState))
	{
		//
		//  Here, we calculate a single state.  We may pull in other states when we do
		//  this, so we can manage to figure out what's going on.
		//
		//  ----------------------------------------------------------------------------
		//  Initialize the state to a useful value (it may be undefined)
		this.m_States[state] = IDMWSC_Document_unknownState;
		//
		//  First, calculate what state sets should be retrieved with this state, if needed.
		//
		var stateSet = IDMWSC_Document_StateSets[state];
		//
		//  Okay, next we go off and compute the states...
		//
		var co = RSExecute(IDMWSC_baseURL + "/WSAPI/document.asp","GetStates",this.library.getName().returnValue,this.id,stateSet);
		objResult = IDMWSC_rsCallObjectToResult(co);
		if (objResult.succeeded()) {
			var i;
			var docStates = objResult.returnValue.split("|");
			for (i=IDMWSC_Document_minState;i<=IDMWSC_Document_maxState;i++) 
			{			
				if (docStates[i-IDMWSC_Document_minState] != "")
				{
					//
					//  okay, now we know we've actually got a state that we need to set.
					//
					this.m_States[i] = eval(docStates[i - IDMWSC_Document_minState]);
				}
				else
				{
					// 
					//  this is a state that we didn't request in our set of requests.  we just ignore it.
					//
				}
			}
			if(this.m_States[state] == IDMWSC_Document_unknownState)
			{
			    //  check to see if the state is returned properly.
			    objResult = new IDMWSC_Result(IDMWSC_Result_error, -1, "State was not returned by remote scripting request.", false, state);
				return objResult;
			}
		}
		else
			return objResult;
	}
	
	objResult = new IDMWSC_Result(IDMWSC_Result_success, 0, "", this.m_States[state] , "");
	return objResult;
}

function IDMWSC_Document_copyLocal(options) 
{
	// check if external document
	var objResult = this.getState(IDMWSC_Document_isExternalDocument);
	if (objResult.failed()) { // getstate failed
		objResult.showResultMessageDialog();
		return;
	}
	if (objResult.returnValue) { // external
		IDMWSC_showMessageBox(IDMWSC_iconCritical,"Error","Cannot copy external documents.",400,100);
		return;
	}



	var featureString = "operation=default&saveMode=prompt";

	if(options == IDMWSC_Document_launchNativeApplication)
	{
		featureString += "&openMode=open";
	} 
	else 
	{
		featureString += "&openMode=none";
	}
	//
	// check if CD parent 
	//
	// If CD parent, launch the doc operations popup.
	//
	objResult = this.getState(IDMWSC_Document_hasChild);
	if (objResult.failed()) { // getstate failed
		objResult.showResultMessageDialog();
		return;
	}
	if (objResult.returnValue) { // CD parent
		CompoundDocOperationsPopup(-1,-1,this.library.name, this.id, featureString);		
		return;
	}
	else 
	{
		DocOperationsPopup(-1,-1,this.library.name, this.id, featureString);
		return;
	}
}

function IDMWSC_Document_launch(options) 
{
	var featureString = "operation=default&saveMode=default";
	
	if ((options == null) ||  // not spec
	   ((options != IDMWSC_Document_launchIDMViewer) && (options != IDMWSC_Document_launchNativeApplication)))  // invalid
	// use preference	
	{
		if (this.getSystemType().returnValue == IDMWSC_sysTypeIS)
			if (IDMWSC_ISDocWebAction == 'idmview')
			{
				var objResult = this.getState(IDMWSC_Document_isReportMgrPDF);
				if (objResult.failed()) // getstate failed
				{
					objResult.showResultMessageDialog();
					return;
				}

				if (objResult.returnValue) // Is Report Manager PDF 
				{
					options = IDMWSC_Document_launchNativeApplication;  // open native app to view RM PDF
				}
				else
					options = IDMWSC_Document_launchIDMViewer;  // default viewer
			}
			else
				options = IDMWSC_Document_launchNativeApplication;  // default open
		else
			if (IDMWSC_DSDocWebAction == 'idmview')
				options = IDMWSC_Document_launchIDMViewer;  // default viewer
			else
				options = IDMWSC_Document_launchNativeApplication;  // default open
	}

	// check if external document
	var objResult = this.getState(IDMWSC_Document_isExternalDocument);
	if (objResult.failed()) { // getstate failed
		objResult.showResultMessageDialog();
		return;
	}
	if (objResult.returnValue) { // external
		if (options == IDMWSC_Document_launchIDMViewer)
			IDMWSC_showMessageBox(IDMWSC_iconCritical,"Error","Cannot view external documents.",400,100);
		else
			IDMWSC_showMessageBox(IDMWSC_iconCritical,"Error","Cannot open external documents.",400,100);
		return;
	}	

	if(options == IDMWSC_Document_launchIDMViewer)
	{
		ViewerPopup(-1,-1,this.library.name, this.id, "");
		return;
	} 
	else if(options == IDMWSC_Document_launchNativeApplication)
	{
		featureString += "&openMode=open";
	}
	//
	//  FCS1:  For Eureka FCS 1, we are supporting launching compound documents as
	//         the parents of the documents.  Therefore, the logic involving compound
	//         docs here has been commented out.
	//
	//var isCompound = false;
	//var result = this.getState(IDMWSC_Document_hasChild);
	//if (result)
	//{
	//	if (result.succeeded())
	//	{
	//		isCompound = result.returnValue;
	//	}
	//	else
	//	{
	//		result.showResultMessageDialog();
	//	}
	//}
	//if(isCompound)
	//{
	//	CompoundDocOperationsPopup(-1,-1,this.library.name, this.id, featureString);
	//}
	//else
	//{ 
	DocOperationsPopup(-1,-1,this.library.name, this.id, featureString);
	//}
}

function IDMWSC_Document_showCDNavigator() 
{
	alert("not implemented");
}

function IDMWSC_Document_showVersionListWindow() 
{
	var URL = IDMWSC_baseURL + '/Redist/VersionList/VersionList.asp?Library=' + this.library.getName().returnValue + '&id=' + this.id;
	var x = (screen.width - 600) / 2;
	var y = (screen.height - 450) / 2;
	var PopupFeatures = "dependent=no,toolbar=no,directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,width=600,height=450,top=" + y + ",left=" + x;

	// Form the unique popup window name.
	var popupName = IDMWSC_PopupManager_generatePopupNamePrefix(this.library.getName().returnValue) + "VersionList_" + IDMWSC_replaceSeparatorsWithUnderscores(this.id);
	IDMWSC_PopupManager_open("VersionList", popupName, URL, PopupFeatures, false);
}

function IDMWSC_Document_showPublicationWindow() 
{
	alert("not implemented");
}

function IDMWSC_Document_version() 
{
	objResult = new IDMWSC_Result(IDMWSC_Result_success, 0, "",new IDMWSC_Version(this), "");
	return objResult;
}

function IDMWSC_Document_addBookmark(label) 
{
	var szLabel;
	if (label)
		szLabel = label
	else {
		szLabel = "[IDM Document]";

		var result = this.getLabel();
		if (result.failed())
			result.showResultMessageDialog();
		else
			szLabel += " " + result.returnValue;
			
		var i = this.id.indexOf(":");
		if (i != -1)
			szLabel += " (ver. " + this.id.substr(i+1) + ")";
		}

	var szURL = IDMWSC_baseURL + "/";

	if (this.getSystemType().returnValue == IDMWSC_sysTypeIS) {
		if (IDMWSC_ISDocWebAction == "idmview")
			szURL += "docview.asp?library=" + this.library.getName().returnValue + "&id=" + this.id;
		else
			szURL += "doccontent.dll?library=" + this.library.getName().returnValue + "&id=" + this.id;
		}
	else {
		if (IDMWSC_DSDocWebAction == "idmview")
			szURL += "docview.asp?library=" + this.library.getName().returnValue + "&id=" + this.id;
		else
			szURL += "doccontent.dll?library=" + this.library.getName().returnValue + "&id=" + this.id;
		}

	window.external.AddFavorite(szURL, szLabel);
}

function IDMWSC_Document_send(label) 
{
	var szLabel;
	if (label)
		szLabel = label
	else {
		szLabel = "[IDM Document]";

		var result = this.getLabel();
		if (result.failed())
			result.showResultMessageDialog();
		else
			szLabel += " " + result.returnValue;
			
		var i = this.id.indexOf(":");
		if (i != -1)
			szLabel += " (ver. " + this.id.substr(i+1) + ")";
		}

	var szURL = IDMWSC_baseURL + "/";

	if (this.getSystemType().returnValue == IDMWSC_sysTypeIS) {
		if (IDMWSC_ISDocWebAction == "idmview")
			szURL += "docview.asp?library=" + this.library.getName().returnValue + "&id=" + this.id;
		else
			szURL += "doccontent.dll?library=" + this.library.getName().returnValue + "&id=" + this.id;
		}
	else {
		if (IDMWSC_DSDocWebAction == "idmview")
			szURL += "docview.asp?library=" + this.library.getName().returnValue + "&id=" + this.id;
		else
			szURL += "doccontent.dll?library=" + this.library.getName().returnValue + "&id=" + this.id;
		}

	if (IDMWSC_IEBrowser) {
		if (navigator.appVersion.search(/MSIE 5.0/) > -1 ||
		    navigator.appVersion.search(/MSIE 4.01/) > -1) 
			{
			szLabel = szLabel.replace(/\%/g, "%25");
			szLabel = szLabel.replace(/\?/g, "%3F");
			szLabel = szLabel.replace(/\&/g, "%26");

		 	szURL = szURL.replace(/\%/g, "%25");
			szURL = szURL.replace(/\?/g, "%3F");
			szURL = szURL.replace(/\&/g, "%26");
			}
		}

	document.location.href = "mailto:?subject=" + escape(szLabel) + "&body=%20%20" + escape(szURL);
}

function IDMWSC_Document_deleteObject(options,ss) 
{
 //alert(ss);
 
	var label = this.label;
	if (!label)
		label = this.id;

	if (options == IDMWSC_withUI)
		if (!window.confirm("هل أنت متأكد من إلغاء هذه الوثيقة " + ss + "?")) {
			objResult = new IDMWSC_Result(IDMWSC_Result_information, 0, "",IDMWSC_Result_S_FALSE, "");
			return objResult;
		}
//alert(this.library.getName().returnValue +  "  " + this.id);
//alert(IDMWSC_baseURL);
	var co = RSExecute(IDMWSC_baseURL + "/Wsapi/document.asp","Delete",this.library.getName().returnValue,this.id);
//alert(this.library.getName().returnValue +  "  " + this.id);
	objResult = IDMWSC_rsCallObjectToResult(co);
	if (objResult.succeeded())
		objResult.returnValue = true;
	return objResult;
}

function IDMWSC_Document_showPropertiesDialog(x,y,startTab) 
{
	var width = 450;
	var height = 530;
	var decoration = 30;

	if ((!x) || (x < 0)) x = (screen.width - width) / 2; // def to center
	if ((!y) || (y < 0)) y = (screen.height - height) / 2 - decoration;
	if (!startTab) startTab = "";
	var URL = IDMWSC_baseURL + '/Redist/PropertySheets/PropSheetDocument.asp?Library=' + this.library.getName().returnValue + '&id=' + this.id + '&starttab=' + startTab;
	var PopupFeatures = "dependent=no,toolbar=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x;
	// Form the unique popup window name.
	var popupName = IDMWSC_PopupManager_generatePopupNamePrefix(this.library.getName().returnValue) + "Property_" + this.objectType + "_" + IDMWSC_replaceSeparatorsWithUnderscores(this.id);
	IDMWSC_PopupManager_open("PropertyPage", popupName, URL, PopupFeatures, false);
}

// Properties

function IDMWSC_Document_property_objectType() 
{
	var objResult = new IDMWSC_Result(IDMWSC_Result_success, 0, "", this.objectType, "");
    return objResult;
}

function IDMWSC_Document_property_getLabel() 
{	
	var	objResult;
	if (this.label == null) { // make an RS call
		var co = RSExecute(IDMWSC_baseURL + "/Wsapi/Document.asp","getLabel",this.library.getName().returnValue,this.id);
		objResult = IDMWSC_rsCallObjectToResult(co);
		if (objResult.succeeded())
			this.label = objResult.returnValue;  // save 
	}
	else  // already set
		objResult = new IDMWSC_Result(IDMWSC_Result_success, 0, "", this.label, "");
	return objResult;
}

function IDMWSC_Document_property_setLabel(label) 
{	
	this.label = label;
	objResult = new IDMWSC_Result(IDMWSC_Result_success, 0, "", "", "");
	return objResult;
}

function IDMWSC_Document_property_systemType() 
{
	return this.library.getSystemType();
}

function IDMWSC_Document_property_getId() 
{
	var	objResult = new IDMWSC_Result(IDMWSC_Result_success, 0, "", this.id, "");
	return objResult;
}

function IDMWSC_Document_property_library() 
{
	var	objResult = new IDMWSC_Result(IDMWSC_Result_success, 0, "", this.library, "");
	return objResult;
}

// Object Constructor:
function IDMWSC_Document(id,library)
{
	// Properties
	this.id = id;
	this.library = library;
	this.label = null;
	this.objectType = IDMWSC_objTypeDocument;
	this.m_States = new Array();
}

// Property Accessor Methods
IDMWSC_Document.prototype.getLibrary = IDMWSC_Document_property_library;
IDMWSC_Document.prototype.getObjectType = IDMWSC_Document_property_objectType;
IDMWSC_Document.prototype.getLabel = IDMWSC_Document_property_getLabel;
IDMWSC_Document.prototype.setLabel = IDMWSC_Document_property_setLabel;
IDMWSC_Document.prototype.getSystemType = IDMWSC_Document_property_systemType;
IDMWSC_Document.prototype.getId = IDMWSC_Document_property_getId;

// Instance Methods:
IDMWSC_Document.prototype.getState = IDMWSC_Document_getState;
IDMWSC_Document.prototype.setState = IDMWSC_Document_setState;
IDMWSC_Document.prototype.addBookmark = IDMWSC_Document_addBookmark;
IDMWSC_Document.prototype.copyLocal = IDMWSC_Document_copyLocal;
IDMWSC_Document.prototype.deleteObject = IDMWSC_Document_deleteObject;
IDMWSC_Document.prototype.launch = IDMWSC_Document_launch;
IDMWSC_Document.prototype.showCDNavigator = IDMWSC_Document_showCDNavigator;
IDMWSC_Document.prototype.showVersionListWindow = IDMWSC_Document_showVersionListWindow;
IDMWSC_Document.prototype.showPublicationWindow = IDMWSC_Document_showPublicationWindow;
IDMWSC_Document.prototype.send = IDMWSC_Document_send;
IDMWSC_Document.prototype.showPropertiesDialog = IDMWSC_Document_showPropertiesDialog;
IDMWSC_Document.prototype.version = IDMWSC_Document_version;
