// ********************* Begin declaration of Page Support Object ***********************
var pageSupport = {
 EMBEDDED   : 0,
 URL   : 1,
 PUMPED   : 2,

 IVU_IFRM_PREFIX : "ivuFrm_" ,
 IVU_IFRM_OBJ_PREFIX : "ivuFrmObj_",
 IVU_FORM_OBJ_PREFIX : "ivuFormObj_",
 IVU_XMP_PREFIX : "ivuXmp_",
 IVU_IFRM_SPAN_PREFIX : "ivuFrmSpan_",
 TRAY_BOTTOM_BORDER_PREFIX : "trayBottomBorder_",
 TRAY_COVER_PREFIX : "trayCover_",

TIME_OUT_CACHE_CONTENT	: 3,
TIME_OUT_NO_CACHE_CONTENT	: 4 ,
TIME_OUT_CACHE_CONTENT_CACHE_REF	: 5,
TIME_OUT_NO_CACHE_CONTENT_CACHE_REF	: 6,


 iviews:	 new Array(),
 iviewsBank: new Array(),
 iviewsIDs:	 new Array(),
 menuOptions: new Array(),
 pageIds:    new Array(),
 pageGPs:	 new Array(),
 pageId: "",
 isLoaded:false,
 IE5AutoHeightMaxLoops:360, // 180 secondes divided in half a second.
 workArea: null
 
 }
 // ********************* End declaration of Page Support Object ***********************




// ********************* Begin  declaration PUBLIC API  ***********************






 pageSupport._isLightPage = function() {
 	return false;
 }

//* ------------------------------------------------------------------------
//* function    : pageSupport.getIvuId
//* parameter   : wndRef - HTML window of the isolated iView
//* return      : string - iView Id
//*	description	: 
//* ------------------------------------------------------------------------
pageSupport.getIvuId = function(wndRef)
{
		if(pageSupport.workArea && pageSupport.workArea.wnd == wndRef)
			return pageSupport.workArea.id;
		var iframeObj = pageSupport._getIframeObj(wndRef);
		return pageSupport._getIvuIdByIframe(iframeObj);
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.getIvuFrameObj
//* parameter   : ivuId - iView Id
//* return      : HTML Iframe object that contains the isolated iView
//*	description	: 
//* ------------------------------------------------------------------------
pageSupport.getIvuFrameObj = function(ivuId)
{
	try
	{
		var ivuPageId = this._getIvuPageId(ivuId);
		var ivuIsolation = this._getIViewBank(ivuPageId).getIsolation();
		if((ivuIsolation == this.URL) || (ivuIsolation == this.PUMPED))
		{
			var iframeId = pageSupport.IVU_IFRM_PREFIX + ivuPageId;
			return document.getElementById(iframeId);
		}
		else
		{
			return null;
		}
	}
	catch(e){return null;}
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.getIvuFrameWindow
//* parameter   : ivuId - iView Id
//* return      : HTML window object of the isolated iView
//*	description	: 
//* ------------------------------------------------------------------------
pageSupport.getIvuFrameWindow = function(ivuId)
{
	try
	{
		var ivuPageId = this._getIvuPageId(ivuId);
		var ivuIsolation = this._getIViewBank(ivuPageId).getIsolation();
		if((ivuIsolation == this.URL) || (ivuIsolation == this.PUMPED))
		{
			var iframeName = pageSupport.IVU_IFRM_PREFIX + ivuPageId;
			return window.frames[iframeName];
		}
		else
		{
			return null;
		}
	 }
	 catch(e){return null;}
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuExpand
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Open the iView in a new window
//* ------------------------------------------------------------------------
pageSupport.ivuExpand = function(ivuId)
{
	if(pageSupport.workArea && pageSupport.workArea.id == ivuId)
		return pageSupport.workArea.expand();
	var ivuPageId = this._getIvuPageId(ivuId);
	return(this._ivuExpand(ivuPageId));
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuRefresh
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Refresh the content of the iView (no cache)
//* ------------------------------------------------------------------------
pageSupport.ivuRefresh = function(ivuId)
{
	if(pageSupport.workArea && pageSupport.workArea.id == ivuId)
		return pageSupport.workArea.refresh();
	var ivuPageId = this._getIvuPageId(ivuId);
	if(! ivuPageId)
	{
		if (typeof EPCM != "undefined")
		{
			EPCM.raiseEvent("urn:com.sapportals:navigation", "RefreshPage",ivuId);
		}
	}
	else
	{
		return(this._ivuRefresh(ivuPageId));
	}
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuReload
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Reload the  iView (cache)
//* ------------------------------------------------------------------------
pageSupport.ivuReload = function(ivuId)
{
	if(pageSupport.workArea && pageSupport.workArea.id == ivuId)
		return pageSupport.workArea.reload();
	var ivuPageId = this._getIvuPageId(ivuId);
	if(! ivuPageId)
	{
		if (typeof EPCM != "undefined")
		{
		EPCM.raiseEvent("urn:com.sapportals:navigation", "RefreshPage",ivuId);
		}
	}
	else
	{
		return(this._ivuReload(ivuPageId));
	}
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuPersonalize
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Open the personalization window of the iView
//* ------------------------------------------------------------------------
pageSupport.ivuPersonalize = function(ivuId)
{
	if(pageSupport.workArea && pageSupport.workArea.id == ivuId)
		return pageSupport.workArea.personalize();
	var ivuPageId = this._getIvuPageId(ivuId);
	return(this._ivuPersonalize(ivuPageId));
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuHelp
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Open the help window of the iView
//* ------------------------------------------------------------------------
pageSupport.ivuHelp = function(ivuId)
{
	if(pageSupport.workArea && pageSupport.workArea.id == ivuId)
		return pageSupport.workArea.help();
	var ivuPageId = this._getIvuPageId(ivuId);
	return(this._ivuHelp(ivuPageId));
}


//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuAbout
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Open the about window of the iView
//* ------------------------------------------------------------------------
pageSupport.ivuAbout = function(ivuId)
{
	if(pageSupport.workArea && pageSupport.workArea.id == ivuId)
		return pageSupport.workArea.about();
	var ivuPageId = this._getIvuPageId(ivuId);
	return(this._ivuAbout(ivuPageId));
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuRemove
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Remove the iView from the page
//* ------------------------------------------------------------------------
pageSupport.ivuRemove = function(ivuId)
{
	var ivuPageId = this._getIvuPageId(ivuId);
	return(this._ivuRemove(ivuPageId));
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuToogle
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Save the expansion state of iView
//* ------------------------------------------------------------------------
pageSupport.ivuToogle = function(ivuId)
{
	var ivuPageId = pageSupport._getIvuPageId(ivuId);
	return(pageSupport._ivuToogle(ivuPageId));
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuRecalcTray
//* parameter   : ivuId - iView Id
//* return      : true / false
//*	description	: Recalc  the tray that covers the iView (for use in netscape only)
//* ------------------------------------------------------------------------
pageSupport.ivuRecalcTray = function(ivuId)
{
	var ivuPageId = this._getIvuPageId(ivuId);
	this._recalcTray(ivuPageId);
}


pageSupport.ivuRecalcAllTrays = function()
{
	for(var i in pageSupport.iviewsIDs)
	{
		var id = pageSupport.iviewsIDs[i];
		try
		{
			pageSupport._recalcTray(id);
		}
		catch(e){}
	}
	this.adjustFullPageIViews();
}




//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuAdjustHeight
//* parameter   : ivuId - iView Id
//*				: height(optional) - the desire height 				
//* return      : none
//*	description	: Change the height of the iframe that contains the isolated iView.
//* ------------------------------------------------------------------------
pageSupport.ivuAdjustHeight = function(ivuId , height , checkMode)
{
	var ivuFrameObj = pageSupport.getIvuFrameObj(ivuId);
	if(ivuFrameObj )
	{
		pageSupport.adjustHeight(ivuFrameObj , height , checkMode);
	}
}

//* ------------------------------------------------------------------------
//* function    : pageSupport.ivuAddTrayOption
//* parameter   : ivuId - iView Id
//*				: optionCaption - the caption of the tray option 
//*				: optionFunc - the function to execute when the tray option is clicked
//* return      : true/false
//*	description	: Add new tray option to the iView tray.
//* ------------------------------------------------------------------------
pageSupport.ivuAddTrayOption = function(ivuID , optionCaption , optionFunc)
{
try
{
	if(! ivuID)
		return false;
	if(this._checkRepeatedOption(ivuID , optionCaption))
	{
		if(! pageSupport.isLoaded)
		{
			
				pageSupport.menuOptions[pageSupport.menuOptions.length] = new MenuOption(ivuID , optionCaption , optionFunc);
		}
		else
		{
			var obj =  new MenuOption(ivuID , optionCaption , optionFunc);
			pageSupport.menuOptions[pageSupport.menuOptions.length] = obj;
			pageSupport._addTrayOption(obj.id , obj.caption , obj.func);
		}
	}
}
catch(e){return false;}
} 

//* ------------------------------------------------------------------------
//* function    : pageSupport.adjustFullPageIViews
//* parameter   : none
//* return      : none
//*	description	: adjust the size of full page iViews
//* ------------------------------------------------------------------------
 pageSupport.adjustFullPageIViews = function()
 {
	 pageSupport._adjustFullPageIViews();
 }


// ********************* End  declaration PUBLIC API  ***********************


function isNN7()
{
	if (typeof EPCM != "undefined")
	{
	return (EPCM.getUAType() == EPCM.MOZILLA || EPCM.getUAType() == EPCM.NETSCAPE) && (EPCM.getUAVersion() <= 5 || EPCM.getUAVersion() >= 7);
	}
	else
	{
		return (navigator.appName == "Netscape");
	}
	
}


 pageSupport._addIViewBank = function(ivuPageId,ivuBank){
 	ivuBank.setIvuId(this._getIvuId(ivuPageId));
	this.iviewsBank[ivuPageId] = ivuBank;
 }

  pageSupport._getIViewBank = function(ivuPageId){
	return this.iviewsBank[ivuPageId];
 }

 pageSupport._addIvuPageId = function(ivuId,ivuPageID)
 {
	this.iviews[this.iviews.length] = ivuPageID;
	this.iviewsIDs[ivuId] = ivuPageID;
 }

 pageSupport._getIvuPageId = function(ivuId)
 {
	return this.iviewsIDs[ivuId];
 }
 
 pageSupport._getIvuId = function(ivuPageId)
 {
	for(var i in this.iviewsIDs)
	{
		if(this.iviewsIDs[i] == ivuPageId)
			return i;
	}
	return null;
 }
 
 pageSupport._setHtmlbIds = function(ivuPageId , ivuTrayId , ivuHoverMenuId)
 {
	pageSupport._getIViewBank(ivuPageId).setHtmlbIds(ivuTrayId , ivuHoverMenuId);
	
 }


pageSupport._getIvuIdByIframe = function(iframeObj)
{
	try
	{
		if(iframeObj != null)
			{
				var ivuPageId = iframeObj.id.substring(this.IVU_IFRM_PREFIX.length);
				var ivuBank = pageSupport._getIViewBank(ivuPageId);
				return ivuBank.getIvuId();
			}
			else
			{
				return "";
			}
	}
	catch(e){return "";}

}




//********* Tray functionality functions *********


pageSupport._calculateModeUrl = function(ivuBankObj , mode)
 	 {
	 	return pageSupport.__calculateModeUrl(ivuBankObj.getIvuId() , ivuBankObj.getParams() , mode , ivuBankObj);
 	}
 	
pageSupport.__calculateModeUrl = function(ivuId ,  ivuParams , mode  , ivuBankObj )
{
	var gp = "local";
	
	if (ivuBankObj !=null)
	{
		if(ivuBankObj)
		{
			gp = pageSupport.pageGPs[ivuBankObj.getPageIndex()];
		}
		if(gp == "remote")
		{
			var str = pageSupport.proxyModesUrl_gp;
		}
		else
		{
			var str = pageSupport.proxyModesUrl;
		}
	}
	else
	{
		var str = pageSupport.proxyModesUrl;
	}
	
	if(str.indexOf("?") != -1)
	{
		str += "&";
	}
	else
	{
		str += "?";
	}
 	str += "iview_id=";
 	str += encodeURIComponent(ivuId);
 	str += "&iview_mode=";
 	str += mode;
 	
 	if(ivuParams != null && ivuParams != "")
 	{
 	    if (ivuParams.indexOf("&") != 0)
   		  str += "&";
 		str += ivuParams;
 	}
 	return str;
}



pageSupport._ivuExpand = function(ivuPageId)
{
	try{
		var ivuBankObj = this._getIViewBank(ivuPageId);
		var expandUrl = this._calculateModeUrl(ivuBankObj , "default");
		// remove windowId for new windows
		
		expandUrl = expandUrl.replace(/\?windowId=[^&\n]*&/ , "?");
		expandUrl = expandUrl.replace(/(\?windowId=[^&\n]*)|(&?windowId=[^&\n]*)/ , "");
		
		
		if(ivuBankObj.getMethod() == "GET")
		{
			window.open(expandUrl);
		}
		else
		{
			var formId = pageSupport.IVU_FORM_OBJ_PREFIX + ivuPageId;
			var theForm = document.getElementById(formId);
			theForm.action = expandUrl;
			var childList = theForm.childNodes;
			for(i=0;i<childList.length;i++)
			{
				var child = childList(i);
				if(child.name == "sap-ext-sid")
				{
					theForm.removeChild(child);
					break;
				}
			}
			var oldTraget = theForm.target;
			theForm.target = "_blank";
			theForm.submit();
			theForm.target = oldTraget;
		}
		return true;
	}
	catch(e){
		return false;
	}
}

pageSupport._ivuRefresh = function(ivuPageId)
{
	try{
		var ivuBankObj = this._getIViewBank(ivuPageId);
		var ivuIsolation = ivuBankObj.getIsolation();

		if(ivuIsolation == this.EMBEDDED)
		{
			var refreshUrl = ivuBankObj.getRefreshUrl();
			if(refreshUrl == null || refreshUrl == "")
			{
				alert("The property 'Write Tray API' of the page must be set to 'true'!"); 
				return;
			}
			window.location.href = refreshUrl;
		}
		else if(ivuIsolation == this.URL)
		{
			var ivuRefreshUrl = ivuBankObj.getRefreshUrl();
			if(ivuRefreshUrl == "")
				ivuRefreshUrl = this._calculateModeUrl(ivuBankObj , "refresh");
			
			if(ivuBankObj.getMethod() == "GET")
			{
				var iframeId = pageSupport.IVU_IFRM_PREFIX + ivuPageId;
			
				// Netscape not refreshing the same src so setting the src to blank.
				if (typeof EPCM != "undefined")
				{
				if(EPCM.getUAType()!= EPCM.MSIE)
					document.getElementById(iframeId).src = "about:blank";
				}
				else
				{
					if(navigator.appName != "Microsoft Internet Explorer")
						document.getElementById(iframeId).src = "about:blank";
				}
				
				document.getElementById(iframeId).src = ivuRefreshUrl;
			}
			else
			{
				var formId = pageSupport.IVU_FORM_OBJ_PREFIX + ivuPageId;
				var theForm = document.getElementById(formId);
				var childList = theForm.childNodes;
				for(i=0;i<childList.length;i++)
				{
					var child = childList(i);
					if(child.name == "sap-ext-sid")
					{
						theForm.removeChild(child);
						break;
					}
				}
				theForm.action = ivuRefreshUrl;
				theForm.submit();
			}
			
		}
		return true;
	}
	catch(e){
		return false;
	}
}

pageSupport._ivuReload = function(ivuPageId)
{
	try{
		var ivuBankObj = this._getIViewBank(ivuPageId);
		var ivuIsolation = ivuBankObj.getIsolation();

		if(ivuIsolation == this.EMBEDDED)
		{
			var reloadUrl = ivuBankObj.getReloadUrl();
			if(reloadUrl == null || reloadUrl == "")
			{
				alert("The property 'Write Tray API' of the page must be set to 'true'!"); 
				return;
			}
			window.location.href = ivuBankObj.getReloadUrl();
		}
		else if(ivuIsolation == this.URL)
		{
			var ivuReloadUrl = ivuBankObj.getReloadUrl();
			if(ivuReloadUrl == "")
				ivuReloadUrl = this._calculateModeUrl(ivuBankObj , "default");
			
			if(ivuBankObj.getMethod() == "GET")
			{
				var iframeId = pageSupport.IVU_IFRM_PREFIX + ivuPageId;
				
				// Netscape not refreshing the same src so setting the src to blank.
				if (typeof EPCM != "undefined")
				{
				if(EPCM.getUAType()!= EPCM.MSIE)
					document.getElementById(iframeId).src = "about:blank";
				}
				else
				{
					if (navigator.appName != "Microsoft Internet Explorer")
						document.getElementById(iframeId).src = "about:blank";
				}
				
				document.getElementById(iframeId).src = ivuReloadUrl;
			}
			else
			{
				var formId = pageSupport.IVU_FORM_OBJ_PREFIX + ivuPageId;
				var theForm = document.getElementById(formId);
				theForm.action = ivuReloadUrl;
				theForm.submit();
			}
			
		}
		return true;
	}
	catch(e){
		return false;
	}
}


pageSupport._ivuPersonalize = function(ivuPageId)
{
	try{
		var ivuBankObj = this._getIViewBank(ivuPageId);
		var persoUrl = this._calculateModeUrl(ivuBankObj , "edit");
		if(ivuBankObj.getMethod() == "GET")
		{
			window.open(persoUrl,"personalize","width=340,height=500,left=100,top=50,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes");
		}
		else
		{
			var formId = pageSupport.IVU_FORM_OBJ_PREFIX + ivuPageId;
			var theForm = document.getElementById(formId);
			theForm.action = persoUrl;
			window.open("about:blank","personalize","width=340,height=500,left=100,top=50,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes");
			var oldTraget = theForm.target;
			theForm.target = "personalize";
			theForm.submit();
			theForm.target = oldTraget;
		}
		return true;
	}
	catch(e){
		return false;
	}
}

pageSupport._ivuSM = function(ivuID)
{
	try{
		var SMUrl = this.__calculateModeUrl(ivuID, null, "default", null);
		window.open(SMUrl,"solutionManager","width=420,height=480,left=100,top=50,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes");
		return true;
	}
	catch(e){
		return false;
	}
}

pageSupport._ivuHelp = function(ivuPageId)
{
	try{
		var ivuBankObj = this._getIViewBank(ivuPageId);
		var helpUrl = this._calculateModeUrl(ivuBankObj , "help");
		if(ivuBankObj.getMethod() == "GET")
		{
			window.open(helpUrl,"help","width=340,height=500,left=100,top=50,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes");
		}
		else
		{
			var formId = pageSupport.IVU_FORM_OBJ_PREFIX + ivuPageId;
			var theForm = document.getElementById(formId);
			theForm.action = helpUrl;
			window.open("about:blank","help","width=340,height=500,left=100,top=50,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes");
			var oldTraget = theForm.target;
			theForm.target = "help";
			theForm.submit();
			theForm.target = oldTraget;
		}
		return true;
	}
	catch(e){
		return false;
	}
}

pageSupport._ivuAbout = function(ivuPageId)
{
	try{
		var ivuBankObj = this._getIViewBank(ivuPageId);
		var aboutUrl = this._calculateModeUrl(ivuBankObj , "about");
		if(ivuBankObj.getMethod() == "GET")
		{
			window.open(aboutUrl,"about","width=640,height=150,left=100,top=50,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes");
		}
		else
		{
			var formId = pageSupport.IVU_FORM_OBJ_PREFIX + ivuPageId;
			var theForm = document.getElementById(formId);
			theForm.action = aboutUrl;
			window.open("about:blank","about","width=640,height=150,left=100,top=50,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes");
			var oldTraget = theForm.target;
			theForm.target = "about";
			theForm.submit();
			theForm.target = oldTraget;
		}
		return true;
	}
	catch(e){
		return false;
	}
}

pageSupport._ivuRemove = function(ivuPageId)
{
	try
	{
		var windowURL = pageSupport.removeIviewAlertPath +
					"?msg=" + pageSupport.removeMessage +
					"&IsIe="	+(navigator.appName == "Microsoft Internet Explorer")+
					"&pageId="	+ivuPageId;
			
		if(navigator.appName == "Microsoft Internet Explorer")
		{		
			if(window.showModalDialog ( windowURL,
										"",
										"dialogHeight:140px; dialogWidth:400px; help:no; status=no; resizable=no; edge=no;")
										== "yes")
			{
				pageSupport._removeIview(ivuPageId);
			}
		}
		else
		{
			window.open ( windowURL,
						  null,
						  "height=140, width=400, status=no, resizable=no, toolbar=no, menubar=no, location=no");
		}
		this.adjustFullPageIViews();
		return true;
	}
	catch(e){return false;}
	
}

pageSupport._setRemoveQuestionReturnValue = function(returnValue , ivuPageId)
{
	if(returnValue == "yes")
		pageSupport._removeIview(ivuPageId);
		
}

pageSupport._removeIview = function(ivuPageId)
{
	try
	{
		var ivuBankObj = this._getIViewBank(ivuPageId);
		ivuBankObj.setRemove();
		var str = pageSupport.TRAY_COVER_PREFIX + ivuPageId;
		var spanObj = document.getElementById(str);
		spanObj.style.display = "none";
		spanObj.innerHTML = "";
		var pageId = pageSupport.pageIds[ivuBankObj.getPageIndex()];
		
		var gp = pageSupport.pageGPs[ivuBankObj.getPageIndex()];
		if(gp == "remote")
		{
			var str = pageSupport.pageHelperUrl_gp;
		}
		else
		{
			var str = pageSupport.pageHelperUrl;
		}
		
		pageSupport.submitHiddenForm(pageSupport.pageHelperUrl + "?remove=" +escape(pageId + ";" + ivuBankObj.getIvuId() ) );
	}
	catch(e){}
}

pageSupport._ivuToogle = function(ivuPageId)
{
	try
	{
		var ivuBankObj = this._getIViewBank(ivuPageId);
		var loaded = true;
		if(!ivuBankObj.isLoaded())
		{
			var url = ivuBankObj.getSrc();
			var iframeId = pageSupport.IVU_IFRM_PREFIX + ivuPageId;
			var iframeObj =  document.getElementById(iframeId);
			
			
			if(ivuBankObj.getMethod() == "GET")
			{
				iframeObj.setAttribute("src" , url);
			}
			else
			{
				var formId = pageSupport.IVU_FORM_OBJ_PREFIX + ivuPageId;
				var theForm = document.getElementById(formId);
				theForm.action = url;
				theForm.submit();
			}
			
			var fixedHeight = iframeObj.getAttribute("fixedHeight");
			if(fixedHeight != null)
			{
				iframeObj.style.height = fixedHeight;
				pageSupport._recalcTray(ivuPageId)
			} 
			loaded = false;
		}
		ivuBankObj.setToogle();
		pageSupport.submitHiddenForm(pageSupport.pageHelperUrl + "?toogle=" +escape(ivuBankObj.getIvuId() + "," + ivuBankObj.getToogle() + ";") );
		if(loaded)
			this._adjustHeightAfterToogle(ivuBankObj.getIvuId());
		this.adjustFullPageIViews();
	}
	catch(e){}
}

pageSupport.submitHiddenForm = function(url)
{
	
	 var theIFrame = document.getElementById("pageSupportIframe");
		if(! theIFrame)
		{
			var theIFrame = document.createElement("IFRAME");
			theIFrame.style.visibility = "hidden";
			theIFrame.width=0;
			theIFrame.height=0;
			theIFrame.id = "pageSupportIframe";
			if (emptyDocumentUrl != "undefined")
		      theIFrame.src = emptyDocumentUrl;
			theIFrame = document.body.appendChild(theIFrame);
		}
		theIFrame.src = url;
}



pageSupport._setSrc = function(ivuPageId , ivuUrl)
{
	var ivuBankObj = this._getIViewBank(ivuPageId);
	ivuBankObj.setSrc(ivuUrl);
	
}


//******* Full Page height functions ***********
pageSupport._culcElementOffsetTopBody = function(elemObj)
{
	var offset=0;

	while(elemObj != document.body)
	{
			offset += elemObj.offsetTop;
			elemObj = elemObj.offsetParent;
	}
	return offset;
}

pageSupport._adjustFullPageIViews = function()
{
	
	var docIFrames = document.getElementsByTagName("IFRAME");
	var docIFramesLen = docIFrames.length;
	var currIFrame;
	var minIViewHeight = 80;
	var bodyHeight;
	var reqHeight = minIViewHeight;
	var currIFrameId;

	//culc document height
	if (navigator.appName == "Microsoft Internet Explorer") {
	  bodyHeight = document.body.clientHeight;
	  if(bodyHeight == 0)
	  {
	  	setTimeout("pageSupport._adjustFullPageIViews()" , 50);
	  	return;
	  }
	}
	else if (isNN7())
	{
	  bodyHeight = window.innerHeight;
	}

	//run through iviews
	for(var i=0 ; i<docIFramesLen ; i++)
	{
		currIFrame = docIFrames[i];
		currIFrameId = currIFrame.getAttribute("id");
		if(currIFrame.getAttribute("fullPage") == "true")
		{
			if(currIFrame.getAttribute("hasTray") == "true")//iview has tray. consider tray bottom border height.
			{
				var trayBotIdPref = pageSupport.TRAY_BOTTOM_BORDER_PREFIX + currIFrameId;
				var trayBotEnd = document.getElementById("end_" + trayBotIdPref);
				var trayBotStart;
				var trayBotEndOffsetHeight = pageSupport._culcElementOffsetTopBody(trayBotEnd);
				var trayBotStartOffsetHeight;
				var trayBotHeight;

				if (navigator.appName == "Microsoft Internet Explorer")
				{
					if(trayBotEndOffsetHeight > 0)  //consider tray bottom
					{
						reqHeight = bodyHeight - pageSupport._culcElementOffsetTopBody(trayBotEnd) + currIFrame.clientHeight;
					}
					else    //don't consider tray bottom
					{
						reqHeight = bodyHeight - pageSupport._culcElementOffsetTopBody(currIFrame);
					}
				}
				else if (isNN7())
				{
					trayBotStart = document.getElementById("start_" + trayBotIdPref);
					trayBotStartOffsetHeight = pageSupport._culcElementOffsetTopBody(trayBotStart);
					trayBotHeight = trayBotEndOffsetHeight - trayBotStartOffsetHeight;
					reqHeight = bodyHeight - pageSupport._culcElementOffsetTopBody(currIFrame) - trayBotHeight;
				}
			}
			else//no tray
			{
				reqHeight = bodyHeight - pageSupport._culcElementOffsetTopBody(currIFrame);
			}

			if(reqHeight > minIViewHeight)
			{
				if (navigator.appName == "Microsoft Internet Explorer") {
				  currIFrame.style.pixelHeight = reqHeight - 3;
				}
				else if (isNN7())
				{
				  currIFrame.height = reqHeight - 8;
				  if(currIFrame.getAttribute("hasTray") == "true")
				  {
					var ivuId = pageSupport.getIvuId(pageSupport._getContentWindow(currIFrame));
					pageSupport.ivuRecalcTray(ivuId);
				  }
				}
			}
		}
	}
}



//******* Auto height functions ***********



pageSupport._adjustHeightAfterToogle = function(ivuId)
{
	var ivuFrameObj = pageSupport.getIvuFrameObj(ivuId);
	if(ivuFrameObj && ivuFrameObj.getAttribute("minAutoHeight"))
	{

		pageSupport.adjustHeight(ivuFrameObj);
	}
}

pageSupport.adjustHeight = function(ivuFrameObj , theHeight ,checkMode ,  phase) {
		
		try{
		
			if(! ivuFrameObj)
				return;
			if(! phase)
				phase = 0;
				
			if(phase > 60)
				return;
			if(typeof(checkMode) == "undefined")
				checkMode = true;
			var ivuId = pageSupport._getIvuIdByIframe(ivuFrameObj);
			var ivuBankObj = pageSupport._getIViewBank(pageSupport._getIvuPageId(ivuId));
			if(! ivuBankObj.isLoaded())
				return true;
				
			if(checkMode)
			{
				var minAutoHeight = ivuFrameObj.getAttribute("minAutoHeight");
				
				if((minAutoHeight == null) || (minAutoHeight == ""))
					return;
			}
			var ivuFrameWindow = pageSupport._getContentWindow(ivuFrameObj);
			if (navigator.appName != "Netscape")
			{
				var dom = ivuFrameWindow.document.domain;
			}
			var height = theHeight;
			if(! height)
				height = pageSupport._getHeight( ivuFrameWindow );
			if (height > 0) {
		  
				var minAutoHeight = ivuFrameObj.getAttribute("minAutoHeight");
				var maxAutoHeight = ivuFrameObj.getAttribute("maxAutoHeight");
		
				if((minAutoHeight != "") && (minAutoHeight != null)){
					height=Math.max(height,minAutoHeight);
				}
				if((maxAutoHeight != "") && (maxAutoHeight != null)){
					height=Math.min(height,maxAutoHeight);		
				}      
			  
				if(pageSupport._applyHeight(ivuFrameObj , height))
				{
					setTimeout("pageSupport.adjustHeight(document.getElementById('"+ivuFrameObj.id+"'),"+theHeight+","+checkMode+","+(phase+1)+")" , 50);
				}
				
			}
			else
			{
				if(phase == 0)
				{
					setTimeout("pageSupport.adjustHeight(document.getElementById('"+ivuFrameObj.id+"'),"+theHeight+","+checkMode+",0)" , 50);
				}
			}
		  }
		catch( ex ) {
	// resizing of the container iframe failed  - resizing to default size
			//var defaultHeight = ivuFrameObj.getAttribute("defaultHeight");
			//pageSupport._applyHeight(ivuFrameObj , parseInt(defaultHeight))
			// Changing the Exception Treatment - not doing anything...
			return false;
	}
}

pageSupport._applyHeight = function(ivuFrameObj , height)
{
	var ivuId = pageSupport._getIvuIdByIframe(ivuFrameObj);
	if (navigator.appName == "Microsoft Internet Explorer") {
	  var oldHeight = ivuFrameObj.style.pixelHeight;
	  if(oldHeight == height)
	  {
	  	return false;
	  }
	  ivuFrameObj.style.pixelHeight = height;
	  return true;
	} 
	else if (isNN7()) 
	{
	  var ivuBankObj = pageSupport._getIViewBank(pageSupport._getIvuPageId(ivuId));
	  if(ivuBankObj.isLoaded())
	  {
		  ivuFrameObj.height = height;
		  ivuFrameObj.style.height = height;
		  pageSupport.ivuRecalcTray(ivuId);
	  }
	  return false;
	}
}

// handle the iframe onload for ie 5.0 - instead of event , checking the height of the document.

pageSupport.IE5onload = function(ivuFrameId)
{
	pageSupport._IE5onload(ivuFrameId , 0 , 0);
}

//TODO add time limitations for the timeout.
pageSupport._IE5onload = function(ivuFrameId , heightChanges , loopNumber) {
	try{
		if(loopNumber > pageSupport.IE5AutoHeightMaxLoops)
			return;
		var ivuFrameObj = document.getElementById(ivuFrameId);
		var ivuFrameWindow = pageSupport._getContentWindow(ivuFrameObj);
		var	height = pageSupport._getHeight( ivuFrameWindow );
		if(height > ivuFrameObj.style.pixelHeight)
		{
			pageSupport.adjustHeight(ivuFrameObj);
			if(heightChanges < 2)
			{
				setTimeout("pageSupport._IE5onload(\""+ivuFrameId+"\" ,"+(heightChanges+1)+" , "+(loopNumber+1)+" )" , 500);
			}
		}
		else
		{
			setTimeout("pageSupport._IE5onload(\""+ivuFrameId+"\","+heightChanges+", "+(loopNumber+1)+")" , 500);
		}
	}
	catch(e)
	{
		setTimeout("pageSupport._IE5onload(\""+ivuFrameId+"\","+heightChanges+","+(loopNumber+1)+")" , 100);
	}
}




pageSupport._getContentWindow = function ( ivuFrameObj) {
  
	try
	{
		
		return window.frames[ivuFrameObj.id];
			   
	}
	catch(e){return null;}
}


pageSupport._getIframeObj = function ( wndRef) {
  try
  {
		
		var eIFrames = document.getElementsByTagName( "IFRAME" );
		for (var idx = 0; idx < eIFrames.length; idx++)
		{
			var tmpIframe = eIFrames[idx];
			var tmpWindow = window.frames[tmpIframe.name];
			if (tmpWindow == wndRef) 
			{ // found reference to wnd in parent frame's collection
				return tmpIframe;
			}
		}
	 
	  return null;
	}
	catch(e){return null;}
}



pageSupport._getHeight = function( wndRef ) {
  var result = 0;
  try {
	if (navigator.appName == "Microsoft Internet Explorer") {
	  var loBody = wndRef.document.body;
	  result = loBody.scrollHeight +
			   loBody.offsetHeight -
			   loBody.clientHeight;
	  
	} else if (isNN7()) {
		 var loBody = wndRef.document.body;
			result = loBody.scrollHeight;
	}
  } catch (e) {
	result = 0;
  }
  return result;
}




//******** Resize tray functions ( for netscape )**********************
pageSupport._recalcTray = function(ivuPageId)
{
	 var ivuBankObj = pageSupport._getIViewBank(ivuPageId);
	 var trayId = ivuBankObj.getTrayId();
	 if( navigator.appName != "Microsoft Internet Explorer")
	 {
		if (typeof sapUrMapi_Tray_create != "undefined") {
			sapUrMapi_Tray_create(trayId,false,false,null);
		}
	 }

}



//******** IE Pumping Scripts Completion Functions ********

pageSupport._getScript = function(url)
{
	try
	{
		var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp.open("GET", url, false);
		xmlhttp.setRequestHeader("Accept-Language" , navigator.browserLanguage);
		xmlhttp.send();
		return xmlhttp.responseText;
	}
	catch(e){return "";}
}


pageSupport.completeIViewScripts =  function(buffer){
		var tmpBuffer = '';
		var srcValue = '';
		var scrAttrib = '';
		var scrStartPos,scrEndPos;
		var bufferSrcPos = 0;
		var output = '';
		var srcPos = 0;
		var scrEndGT = 0;


		while ((scrStartPos = buffer.search(/<script/i))>=0) {
				output += buffer.substr(0,scrStartPos);
				buffer = buffer.substr(scrStartPos);
				bufferSrcPos += scrStartPos;
				scrEndPos = buffer.search(/<\/script>/i);
				// tmpbuffer holds the <script ......>/////< /script> part
				tmpBuffer = buffer.substr(0,scrEndPos+9);
				buffer = buffer.substr(scrEndPos+9); //buffer ready to the next part
				bufferSrcPos += (scrEndPos+9);

				scrEndGT = tmpBuffer.indexOf(">");

				// defer dump
				srcPos = tmpBuffer.search(/defer/i);
				if ((srcPos>-1)&& (srcPos<scrEndGT)) {
						output += tmpBuffer;
						continue;
				}

				// no src dump
				srcPos = tmpBuffer.search(/src=/i);
				if ((srcPos==-1) || (srcPos>=scrEndGT)) {
						output += tmpBuffer;
						continue;
				}

				//tmpBuffer <sc ript .....> only
				tmpBuffer = tmpBuffer.substr(0,scrEndGT+1);
				//todo : extract attributes from tmpBuffer and pass them
				scrStartPos = tmpBuffer.search(/src=/i);
				srcValue = tmpBuffer.substr(scrStartPos+5);

				scrAttrib = '';
				scrAttrib = tmpBuffer.substr(7,scrStartPos-7);

				scrEndPos = srcValue.search(/('|")/);
				srcValue = srcValue.substr(0,scrEndPos);

				scrAttrib += tmpBuffer.substr(scrStartPos + 5 + scrEndPos + 1);

				// clear s cript src='....' > leave only attributes

				scrAttrib = scrAttrib.replace(/[>]/g,"");

				// write script data
				output += '\n<s' + 'cript '+ scrAttrib + '> \n//fatched \n';
				output += pageSupport._getScript(srcValue);
				output += '\n</sc' + 'ript>\n';
		}
		output += buffer;
		return output;
}

//******************* Page Utility Functions *********************
pageSupport.embedTimeoutMessage =  function(ivuIsolation,includeStatus,ivuPageId , reloadUrl)
{

	var ivuID = ivuPageId;
	var ivuBank = pageSupport._getIViewBank(ivuPageId);
	if(ivuBank)
	{
		ivuID = ivuBank.getIvuId();
	}
	else
	{
		ivuBank = pageSupport._getIViewBank(pageSupport._getIvuPageId(ivuID));
		 
	}
	if(reloadUrl)
	{
		ivuBank.setReloadUrl(reloadUrl);
	}
	/*
	var timeoutMessageHtml = "";
	switch (includeStatus) {
		case pageSupport.TIME_OUT_CACHE_CONTENT: 
			timeoutMessageHtml = document.getElementById("pageMsgTimeoutCacheContent").innerHTML;
			break;
		case pageSupport.TIME_OUT_NO_CACHE_CONTENT:
			timeoutMessageHtml = document.getElementById("pageMsgTimeoutNoCacheContent").innerHTML;
			break;
		case pageSupport.TIME_OUT_CACHE_CONTENT_CACHE_REF: 
			timeoutMessageHtml = document.getElementById("pageMsgTimeoutCacheContent").innerHTML;
			break;
		case pageSupport.TIME_OUT_NO_CACHE_CONTENT_CACHE_REF:
			timeoutMessageHtml = document.getElementById("pageMsgTimeoutNoCacheContent").innerHTML;
			break;
	}
	
	timeoutMessageHtml = timeoutMessageHtml.replace(/IVU_ID_PLACE_HOLDER/g,"'" + ivuID + "'");
	switch (ivuIsolation) {
		case pageSupport.EMBEDDED: 
			document.write(timeoutMessageHtml)
			break;
		case pageSupport.PUMPED:
			var ivuPageId = pageSupport._getIvuPageId(ivuID);
			var iFramespanId = pageSupport.IVU_IFRM_SPAN_PREFIX + ivuPageId;
			document.getElementById(iFramespanId + "_timeoutMessage").innerHTML = timeoutMessageHtml;		
			break;
	}
	*/	
}


//*************************Adding Tray options functions**************************



pageSupport.doLoad = function()
{
pageSupport.isLoaded = true
var length = pageSupport.menuOptions.length;
for(var i = 0 ; i < length ; i++)
{
	var obj = pageSupport.menuOptions[i];
	setTimeout("pageSupport._addTrayOption('"+obj.id+"' ,'"+ obj.caption+"' , '"+obj.func+"')" , 200);
}

}

if (typeof EPCM != "undefined")
{
EPCM.subscribeEvent("urn:com.sapportals.portal:browser","load",pageSupport.doLoad );
}

pageSupport._checkRepeatedOption = function(id , caption)
{
for(var i = 0 ; i < this.menuOptions.length ; i++)
{
	var obj = this.menuOptions[i];
	if(obj.id == id && obj.caption == caption)
		return false;
}
return true;
}



pageSupport._addTrayOption = function(ivuID , optionCaption , optionFunc)
{
try
{
	var ivuPageId = this._getIvuPageId(ivuID);
	var ivuBank = this._getIViewBank(ivuPageId);
	var ivuMenuId = ivuBank.getHoverMenuId();
	if(ivuMenuId != null){
		this._createNewItem(ivuMenuId , optionCaption , pageSupport._adjustFunc(optionFunc , ivuBank.getIsolation() , ivuPageId));
		this._applyChanges(ivuMenuId);
	}
}
catch(e){}	 
} 


pageSupport._adjustFunc = function(func , isolation , id)
{
if(isolation == pageSupport.EMBEDDED)
{
	var ret =  "parent.setTimeout('"+func+"' , 0)";
	return ret;
}
else
{
	var iframeName = pageSupport.IVU_IFRM_PREFIX + id;
	if(navigator.appName != "Microsoft Internet Explorer") 
		iframeName = document.getElementById(iframeName).name;
	var ret =  "parent.window.frames['"+iframeName+"'].setTimeout('"+func+"' , 0)";
	return ret;
}
}



pageSupport._createNewItem = function(menuId , text , func , isDisable)
{
            var menu = mf_PopupMenu_getObj(menuId);                       
            var itemId = menuId + "_" + menu.items.length;                
            var item = mf_PopupMenu_createItem(itemId);                   
            item.Text = text;                                             
            item.Enabled = !isDisable;                                    
            item.CanCheck = false;                                        
            item.Checked = false;                                         
            item.HasIcon = false;                                         
            item.HasSeparator = false;                                    
            item.HasEllipsis = false;                                     
            item.HasSubMenu = false;                                      
            item.POPUPMENUITEMSELECT = "me.sapUrMapi_PopupMenu_hideAll();event.cancelBubble=true;" + func;                                      
            mf_PopupMenu_addItem(menu, item);                             
                                                 
}                                                                         

pageSupport._applyChanges = function(menuId){
	var menu = mf_PopupMenu_getObj(menuId);  
	mf_PopupMenu_apply(menu);
}                                                                       

pageSupport._removeItem = function(menuId , index)
{
try
{
	 var menu = mf_PopupMenu_getObj(menuId);    
	if(menu == null)
		return;
	
	var currItem = mf_PopupMenu_getItemByIdx(menu, index);
	mf_PopupMenu_removeItem(menu, currItem);
	
	
}
catch(e){}
}


pageSupport.addPageId = function(pageId , pageIndex , gp)
{
	this.pageIds[pageIndex] = pageId;
	this.pageGPs[pageIndex] = gp;
}

//****************** begin methods for page EPCM events ************************************


pageSupport.dispatch = function(evt , func)
{
	var id = evt.dataObject.Id;
	if(id == null || id == "")
		id = pageSupport.getIvuId(evt.dataObject.Window);
	if(id == null || id == "")
		return;
	return eval("pageSupport."+func+"('"+id+"')");
}

pageSupport.onAdjustHeight = function(evt)
{
	var id = evt.dataObject.Id;
	if(id == null || id == "")
		id = pageSupport.getIvuId(evt.dataObject.Window);
	if(id == null || id == "")
		return;
	var height = evt.dataObject.Height;
	var checkMode = evt.dataObject.CheckMode
	return pageSupport.ivuAdjustHeight(id , height , checkMode);
}

pageSupport.onAddTrayOption = function(evt)
{
	var id = evt.dataObject.Id;
	if(id == null || id == "")
		id = pageSupport.getIvuId(evt.dataObject.Window);
	if(id == null || id == "")
		return;
	var caption = evt.dataObject.Caption;
	var func = evt.dataObject.Func;
	return pageSupport.ivuAddTrayOption(id , caption , func);
}

if (typeof EPCM != "undefined")
{
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "expand" , function(ev){pageSupport.dispatch(ev  , "ivuExpand")});
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "refresh" , function(ev){pageSupport.dispatch(ev  , "ivuRefresh")});
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "reload" , function(ev){pageSupport.dispatch(ev  , "ivuReload")});
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "remove" , function(ev){pageSupport.dispatch(ev  , "ivuRemove")});
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "personalize" , function(ev){pageSupport.dispatch(ev  , "ivuPersonalize")});
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "help" , function(ev){pageSupport.dispatch(ev  , "ivuHelp")});
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "recalcTray" , function(ev){pageSupport.dispatch(ev  , "ivuRecalcTray")});
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "adjustHeight" , pageSupport.onAdjustHeight);
EPCM.subscribeEvent("urn:com.sapportals:pagebuilder" , "addOption" , pageSupport.onAddTrayOption);
}

//****************** end methods for page EPCM events ************************************


// ********************* iView Bank Object ***********************************************
function iviewBank(ivuReloadUrl,ivuRefreshUrl,ivuIsolation,ivuToogle, pageIndex, ivuParams, ivuMethod){
var mm_IvuId = "";
var mm_refreshUrl = ivuRefreshUrl;
var mm_reloadUrl = ivuReloadUrl;
var mm_isolation = ivuIsolation;
var mm_toogle = ivuToogle;
var mm_initialToogle = ivuToogle;
var mm_method = ivuMethod;

var mm_remove = false;
var mm_trayId = "";
var mm_hovermenuId = "";
var mm_src = null;
var mm_isStateChanged = false;
var mm_pageIndex = pageIndex;
var mm_params = ivuParams;

this.getIvuId = getIvuId;
this.setIvuId = setIvuId;
this.getRefreshUrl = getRefreshUrl;
this.getReloadUrl = getReloadUrl;
this.setReloadUrl = setReloadUrl;
this.getIsolation = getIsolation;
this.getMethod = getMethod;

this.getInitialToogle = getInitialToogle;
this.getToogle = getToogle;
this.setToogle = setToogle;

this.getRemove = getRemove;
this.setRemove = setRemove;
this.setHtmlbIds = setHtmlbIds;
this.getTrayId = getTrayId;
this.getHoverMenuId = getHoverMenuId;
this.setSrc = setSrc;
this.getSrc = getSrc;
this.isStateChanged = isStateChanged;
this.isLoaded = isLoaded;
this.getPageIndex = getPageIndex;
this.getParams = getParams;


function getToogle()
{
	return mm_toogle;
}
function setToogle()
{
	mm_toogle = (mm_toogle+1)%2;
	mm_isStateChanged = true;
}
function getInitialToogle()
{
	return mm_initialToogle;
}

function setIvuId(id)
{
	return mm_IvuId = id;
}

function getIvuId()
{
	return mm_IvuId;
}


function getRefreshUrl()
{
	return mm_refreshUrl;
}

function getReloadUrl()
{
	return mm_reloadUrl;
}

function setReloadUrl(url)
{
	 mm_reloadUrl = url;
}


function getIsolation()
{
	return mm_isolation;
}

function getMethod()
{
	return mm_method;
}

function getRemove()
{
	return mm_remove;
}

function setRemove()
{
	mm_remove = true;
}

function setHtmlbIds(trayId , hoverMenuId)
{
	mm_trayId = trayId;
	mm_hovermenuId = hoverMenuId;
}

function getTrayId()
{
	return mm_trayId;
}
function getHoverMenuId()
{
	return mm_hovermenuId;
}
function setSrc(src)
{
	mm_src = src;
}
function getSrc()
{
	return mm_src;
}
function isStateChanged()
{
	return mm_isStateChanged;
}
function isLoaded()
{
	if(mm_src == null)
		return true;
	if(mm_isStateChanged == true)
		return true;
	return false;
}

function getPageIndex()
{
	return mm_pageIndex;
}

function getParams()
{
	return mm_params;
}

}


// ********************* Menu Option Object ***********************************************
function MenuOption(id , caption , func)
{
	this.id = id;
	this.caption = caption;
	this.func = func;
}

// ************************Work  area object ***********************************************
function WorkArea(id , wnd)
{
	this.id = id;
	this.wnd = wnd?wnd:null;
	this.pageId = "workarea";
	this.refresh = function() {
		if (typeof EPCM != "undefined")
		{
			EPCM.raiseEvent('urn:com.sapportals:navigation','RefreshWorkArea', "");
		}
		else
		{
			workArea.Refresh(workArea.refreshUrl);
		}
	}
	this.personalize = function() {
		if (typeof EPCM != "undefined")
		{
			EPCM.raiseEvent('urn:com.sapportals:navigation','PersonalizeWorkArea', "");
		}
		else
		{
			workArea.PersonalizePage(workArea.isPage);
		}
	}
	this.expand = function() {
		if (typeof EPCM != "undefined")
		{
			EPCM.raiseEvent('urn:com.sapportals:navigation','ExpandWorkArea', "");
		}
		else
		{
			workArea.OpenNewWindow();
		}
	}
	this.help = function() {
		if (typeof EPCM != "undefined")
		{
			EPCM.raiseEvent('urn:com.sapportals:navigation','HelpWorkArea', "");
		}
		else
		{
			workArea.Help();
		}
	}
	this.reload = this.refresh;

}

