
{function AM3_cssBind()
{owcBindWebSdkStylesheet("","styles/Application.css");owcBindWebSdkStylesheet("","styles/Thumbnails.css");owcBindWebSdkStylesheet("","styles/OwcPopupWindowDefault.css");if(isVersionOf_IE_AtLeast5_5())
{owcBindWebSdkStylesheet("/Olive/WebComponents/","Layout/OwcPopupWindow-IE.css");if(!isVersionOf_IE_AtLeast7())
{owcBindWebSdkStylesheet("/Olive/WebComponents/","Layout/OwcPopupWindow-IE6.css");owcBindWebSdkStylesheet("","styles/Styles-IE6.css");}}
owcBindWebSdkStylesheet("","styles/Viewer.css");owcBindWebSdkStylesheet("","styles/Menus.css");}
AM3_cssBind();function OliveApplication()
{this.DataProviderUrl="server/GetContent.asp";}
OliveApplication.Preferences={Initial_Publication:"initial-publication",Initial_IssueDate:"initial-issue-date",Last_ApprovedDate:"LAST_APPROVED_DATE",Initial_Tab:"initial-tab",ICViewer_ViewMode:"ic-view-mode",SearchRes_PageSize:"search-results-page-size",SearchQuery_Restricted:"input-search-query-restricted",Highlight_OnTocSection:"highlight-primitive-on-tocsection",Date_Format:"date-format",Magnifier_MaxWidth:"magnifier-max-width",Magnifier_MaxHeight:"magnifier-max-height",Magnifier_MagPercent:"magnifier-mag-percent",IC_PopupWindow_MaxTitleLength:"ic-popupwindow-max-title-length",DownloadPDF:"download-pdf",SearchRes_SortByDate:"search-res-is-sort-by-date",FeaturedPages_CreateCoverBack:"create-cover-back"};OliveApplication.ErrorCodes={InitialPublicationAbsence:11001,InitialIssueDateAbsence:11002,InitialIssueDateWrongFormat:11003,ForbiddenPublication:11004,ForbiddenIssueDate:11005};OliveApplication.InitialTabs={cover:"cover",help:"help",toc:"toc"};OliveApplication.DeclareType=function OliveApp_DeclareType()
{this.DeclareField("m_sPublication",null);this.DeclareField("m_sPublicationDescription",null);this.DeclareField("m_sInitialIssueDate",null);this.DeclareField("m_sInitialTab",OliveApplication.InitialTabs.Cover);this.DeclareField("m_sICViewMode",Olive.Data.InformationComponentViewerState.ViewMode.image);this.DeclareField("m_nSearchResPageSize",6);this.DeclareField("m_bSearchQueryRestricted",true);this.DeclareField("m_bHighlightOnTocSection",false);this.DeclareField("m_sDateFormat","%B %d, %Y");this.DeclareField("m_nMagnifierMaxWidth",null);this.DeclareField("m_nMagnifierMaxHeight",null);this.DeclareField("m_nMagnifierMagPercent",null);this.DeclareField("m_nICPopupWindowMaxTitleLength",50);this.DeclareField("m_bDownloadPDF",false);this.DeclareField("m_bCreateCoverBack",false);this.DeclareField("m_documentViewSource",null);this.DeclareField("m_bRightsManagementInProgress",false);this.DeclareField("m_bMainPageLoaded",false);this.DeclareField("m_bContentPageLoaded",false);this.DeclareField("m_sDocHRef","");this.DeclareField("m_bSearchInCurrentIssue",true);this.DeclareField("m_bSearchInArticles",false);this.DeclareField("m_bSortByDate",false);this.DeclareField("m_bOpenICViewerOnDocumentLoad",false);this.DeclareMethod("get_MainPage",OliveApp_get_MainPage);this.DeclareMethod("setResString",OliveApp_setResString);this.DeclareMethod("get_DocViewSource",OliveApp_get_DocViewSource);this.DeclareMethod("LoadData",OliveApp_LoadData);this.DeclareMethod("onMainPageLoaded",OliveApp_onMainPageLoaded);this.DeclareMethod("onContentsPaneLoaded",OliveApp_onContentsPaneLoaded);this.DeclareMethod("onSearchPaneLoaded",OliveApp_onSearchPaneLoaded);this.DeclareMethod("OpenComponent",OliveApp_OpenComponent);this.DeclareMethod("FollowPageLink",OliveApp_FollowPageLink);this.DeclareMethod("ClosePopups",OliveApp_ClosePopups);this.DeclareMethod("SendItemByMail",OliveApp_SendItemByMail);this.DeclareMethod("buildQueryString",OliveApp_buildQueryString);this.DeclareMethod("buildBookmarkAdapters",OliveApp_buildBookmarkAdapters);this.DeclareMethod("buildURLParametersFromControl",OliveApp_buildURLParametersFromControl);this.DeclareMethod("getSearchSortOptions",OliveApp_getSearchSortOptions);this.DeclareMethod("isDocHRefDifferent",OliveApp_isDocHRefDifferent);this.DeclareMethod("loadInitialIssue",OliveApp_loadInitialIssue);this.DeclareMethod("_AccessNotificationCallback",OliveApp_AccessNotificationCallback);this.DeclareMethod("performRightsManagement",OliveApp_performRightsManagement);this.DeclareMethod("_openDifferentDocument",OliveApp_openDifferentDocument);this.DeclareMethod("_checkOkToChangeIssue",OliveApp_checkOkToChangeIssue);this.DeclareMethod("getEntityType",OliveApp_getEntityType);this.DeclareMethod("_checkOkToBookmarkPageInFirefoxBrowser",OliveApp_checkOkToBookmarkPageInFirefoxBrowser);this.DeclareMethod("getIssueName",OliveApp_getIssueName);this.DeclareMethod("getIssueDateFromBaseHref",OliveApp_getIssueDateFromBaseHref);this.DeclareMethod("setPublicationDescription",OliveApp_setPublicationDescription);this.DeclareMethod("getPublicationDescription",OliveApp_getPublicationDescription);this.OverrideMethod("registerAppCommands",OliveApp_registerAppCommands);this.ReplaceMethod("onSettingsLoaded",OliveApp_onSettingsLoaded);this.OverrideMethod("initialize",OliveApp_initialize);this.OverrideMethod("prepareItemMailParams",OliveApp_prepareItemMailParams);this.ReplaceMethod("buildURL",OliveApp_buildURL);this.ReplaceMethod("parseURL",OliveApp_parseURL);this.ReplaceMethod("getItemTitle",OliveApp_getItemTitle);this.ReplaceMethod("getItemDocTitle",OliveApp_getItemDocTitle);this.ReplaceMethod("getDocHRef",OliveApp_getDocHRef);this.DeclareMethod("onDataReceived",OliveApp_onDataReceived);this.OverrideMethod("onErrorOccured",OliveApp_onErrorOccured);this.DeclareMethod("onDocumentLoaded",OliveApp_onDocumentLoaded);};function OliveApp_initialize()
{this.BaseClassMethod.apply(this,arguments);}
function OliveApp_buildBookmarkAdapters()
{var oBmAdapterDelicious=new Olive.BookmarkDeliciousAdapter();var oWindowOptions=this.getWindowOptions("PostDel_window",true);oBmAdapterDelicious.init(oWindowOptions);this.addBookmarkAdapter(oBmAdapterDelicious,"PostDel");oWindowOptions=this.getWindowOptions("DiggThis_window",true);var oBmAdapterDigThis=new Olive.BookmarkDigThisAdapter();oBmAdapterDigThis.init(oWindowOptions);this.addBookmarkAdapter(oBmAdapterDigThis,"DiggThis");}
function OliveApp_registerAppCommands()
{this.BaseClassMethod.apply(this,arguments);}
function OliveApp_onSettingsLoaded()
{this.buildBookmarkAdapters();document.title=this.getResString("WindowCaption");this.m_sPublication=this.getPreference(OliveApplication.Preferences.Initial_Publication);if(!this.m_sPublication)
{this.reportError(DHTML.newError(OliveApplication.ErrorCodes.InitialPublicationAbsence,"Application settings error: Cannot find Initial Publication Name in the Application Configuration Settings."));return;}
this.m_sInitialIssueDate=this.getPreference(OliveApplication.Preferences.Initial_IssueDate);if(this.m_sInitialIssueDate)
{var arrMatch=this.m_sInitialIssueDate.match(/^\d{4}\/\d{2}\/\d{2}$/gi);if(!arrMatch)
{this.reportError(DHTML.newError(OliveApplication.ErrorCodes.InitialIssueDateWrongFormat,"Application settings error: Wrong format of the Initial Issue Date {"+this.m_sInitialIssueDate+"}. The format should be {yyyy/mm/dd}."));return;}
this.m_sInitialIssueDate=arrMatch[0];this.loadInitialIssue();}
else
{this.reportError(DHTML.newError(OliveApplication.ErrorCodes.InitialIssueDateAbsence,"Security error: No issues are allowed in the current skin."));return;}
var documentViewSource=this.parseURL(this.m_oQueryString);if(documentViewSource)
this.m_documentViewSource=documentViewSource;if(!this.get_DocViewSource())
return;var sInitialTab=this.getPreference(OliveApplication.Preferences.Initial_Tab,this.m_sInitialTab);if(sInitialTab&&(sInitialTab in OliveApplication.InitialTabs))
this.m_sInitialTab=sInitialTab;var sICViewMode=this.getPreference(OliveApplication.Preferences.ICViewer_ViewMode,this.m_sICViewMode);if(sICViewMode&&(sICViewMode in Olive.Data.InformationComponentViewerState.ViewMode))
this.m_sICViewMode=sICViewMode;var nSearchResPageSize=this.getPreferenceNumber(OliveApplication.Preferences.SearchRes_PageSize,this.m_nSearchResPageSize);if(!isNaN(nSearchResPageSize))
this.m_nSearchResPageSize=nSearchResPageSize;this.m_bSearchQueryRestricted=this.getPreferenceBoolean(OliveApplication.Preferences.SearchQuery_Restricted,this.m_bSearchQueryRestricted);this.m_bHighlightOnTocSection=this.getPreferenceBoolean(OliveApplication.Preferences.Highlight_OnTocSection,this.m_bHighlightOnTocSection);this.m_sDateFormat=this.getPreference(OliveApplication.Preferences.Date_Format,this.m_sDateFormat);var nMagnifierMaxWidth=this.getPreferenceNumber(OliveApplication.Preferences.Magnifier_MaxWidth);if(!isNaN(nMagnifierMaxWidth))
this.m_nMagnifierMaxWidth=nMagnifierMaxWidth;var nMagnifierMaxHeight=this.getPreferenceNumber(OliveApplication.Preferences.Magnifier_MaxHeight);if(!isNaN(nMagnifierMaxHeight))
this.m_nMagnifierMaxHeight=nMagnifierMaxHeight;var nMagnifierMagPercent=this.getPreferenceNumber(OliveApplication.Preferences.Magnifier_MagPercent);if(!isNaN(nMagnifierMagPercent))
this.m_nMagnifierMagPercent=nMagnifierMagPercent;var nICPopupWindowMaxTitleLength=this.getPreferenceNumber(OliveApplication.Preferences.IC_PopupWindow_MaxTitleLength)
if(!isNaN(nICPopupWindowMaxTitleLength))
this.m_nICPopupWindowMaxTitleLength=nICPopupWindowMaxTitleLength;this.m_bDownloadPDF=this.getPreferenceBoolean(OliveApplication.Preferences.DownloadPDF,this.m_bDownloadPDF);this.m_bSortByDate=this.getPreferenceBoolean(OliveApplication.Preferences.SearchRes_SortByDate,this.m_bSortByDate);this.m_bCreateCoverBack=this.getPreferenceBoolean(OliveApplication.Preferences.FeaturedPages_CreateCoverBack,this.m_bCreateCoverBack);}
function OliveApp_loadInitialIssue()
{this.m_sDocHRef=this.m_sPublication+"/"+this.m_sInitialIssueDate;var viewSource=Olive.ContentItem.CreateByType(OwcContentItem_Document);viewSource.m_sDocHRef=this.m_sDocHRef;this.m_documentViewSource=viewSource;}
function OliveApp_get_MainPage()
{return Olive.Page.GetPageForWindow(window);}
function OliveApp_setResString(doc,sId)
{var oHtmlElement=getObjFromDoc(doc,sId);if(oHtmlElement&&sId)
{var sResString=this.getResString(sId);if(sResString)
DHTML.pasteHtmlContent(oHtmlElement,sResString);var sResString_ToolTip=this.getResString(sId+"_ToolTip");if(sResString_ToolTip)
DHTML.setTooltip(oHtmlElement,sResString_ToolTip);}}
function OliveApp_get_DocViewSource()
{return this.m_documentViewSource;}
function OliveApp_onMainPageLoaded()
{var bUseStatistics=this.getPreferenceBoolean("OwcUseStatistics",true);if(bUseStatistics)
{var mainPage=this.get_MainPage();mainPage._importScripts('http://www.google-analytics.com/urchin.js');this.m_oActivityProvider=new Olive.ContentActivityProvider();this.m_oActivityProvider.postInitialize();this.m_oActivityReporter=new Olive.ContentGoogleReporter();this.m_oActivityReporter.Init();}
this.m_bMainPageLoaded=true;this.LoadData();}
function OliveApp_onContentsPaneLoaded()
{this.m_bContentPageLoaded=true;if(this.m_bMainPageLoaded)
{var mainPage=this.get_MainPage();mainPage.bindContentPage();this.LoadData();}}
function OliveApp_onSearchPaneLoaded()
{if(this.m_bMainPageLoaded)
{var mainPage=this.get_MainPage();mainPage.bindSearchPage();}}
function OliveApp_LoadData()
{if(!this.m_bMainPageLoaded||!this.m_bContentPageLoaded)
return;var oContentItem=this.get_DocViewSource();if(oContentItem&&oContentItem.m_sEntityId)
this.m_bOpenICViewerOnDocumentLoad=true;var mainPage=this.get_MainPage();mainPage.OpenDocument(oContentItem,false);}
function OliveApp_OpenComponent(contentItem)
{var mainPage=this.get_MainPage();mainPage.OpenComponent(contentItem);}
function OliveApp_FollowPageLink(nPageNo)
{var mainPage=this.get_MainPage();mainPage._followPageLink(nPageNo);this.ClosePopups(true);}
function OliveApp_ClosePopups(bICViewerOnly)
{var mainPage=this.get_MainPage();if(bICViewerOnly)
{var oICViewer=OwcGetControl("popup_componentViewer");oICViewer.close();}
else
{mainPage.closeAllPopupWindows();}}
function OliveApp_SendItemByMail(contentItem,bIsEntity,oOpenerPage,oSrc)
{var mainPage=this.get_MainPage();var mailParams=this.prepareItemMailParams(contentItem,oSrc);mainPage.SendMail(mailParams,bIsEntity,oOpenerPage);}
function OliveApp_prepareItemMailParams(oContentItem,oSrc)
{if(!oContentItem)
return;var oMailParams=new Object();var sLinkUrl=this.buildURL(oContentItem,oSrc);var sEntryTitle;if(oSrc&&oSrc.getControlType&&oSrc.getControlType()==Olive.Controls.controlTypeNames.DocViewerAgg)
{sEntryTitle="";oMailParams.subject=this.getItemDocTitle(oContentItem);}
else
{sEntryTitle=this.getItemTitle(oContentItem);oMailParams.subject=sEntryTitle;}
oMailParams.body=this.formatResString("EMailBodyFormat",oMailParams.subject,sLinkUrl);oMailParams.from=this.getPreference(OwcPref_MailField_From,"active.magazine.3.0@olivesoftware.com");oMailParams.oSrcContentItem=oContentItem;return oMailParams;}
function OliveApp_buildURL(contentItem,oSrcControl)
{if(oSrcControl&&oSrcControl.getControlType&&oSrcControl.getControlType()==Olive.Controls.controlTypeNames.DocViewerAgg)
{var oNewContentItem=Olive.ContentItem.CreateByType(OwcContentItem_Document);oNewContentItem.copyDocRefFrom(contentItem);if(contentItem.m_nPageNo)
oNewContentItem.m_nPageNo=contentItem.m_nPageNo;contentItem=oNewContentItem;}
var url=this.getAppUrl();var oQueryString=Olive.WebAppBase.buildURLParametersFromContentItem(contentItem);var oControlParameters=this.buildURLParametersFromControl(oSrcControl);if(!oQueryString)
return"";oQueryString.appendParams(oControlParameters,true);var sQueryString=oQueryString.getQueryString();if(sQueryString)
{url+=("?"+sQueryString);}
return url;}
function OliveApp_buildURLParametersFromControl(oSrcControl)
{var queryString=new QueryString();return queryString;}
function OliveApp_buildQueryString(contentItem)
{var sQueryString="";if(contentItem)
{var queryString=new QueryString();var docHRef=contentItem.getDocHRef();if(docHRef)
queryString.addParam(Olive.WebAppBase.UrlParam.HRef,docHRef);if(("m_nPageNo"in contentItem)&&!!contentItem.m_nPageNo)
queryString.addParam(Olive.WebAppBase.UrlParam.PageNo,contentItem.m_nPageNo.toString());if("m_sEntityId"in contentItem)
queryString.addParam(Olive.WebAppBase.UrlParam.Entity,contentItem.m_sEntityId);if("m_sPrimId"in contentItem)
queryString.addParam(Olive.WebAppBase.UrlParam.Primitive,contentItem.m_sPrimId);var urlParams=queryString.getQueryString();if(urlParams)
sQueryString+=urlParams;}
return sQueryString;}
function OliveApp_parseURL(oQueryString)
{if(!oQueryString&&!this.m_oQueryString)
return null;if(this.m_oQueryString&&!oQueryString)
oQueryString=this.m_oQueryString;var debugMode=oQueryString.getParam("Debug",0);if(!!debugMode&&(debugMode.toLowerCase()=="true"))
this.enableDebugMode();var viewSource=Olive.ContentItem.CreateByType(OwcContentItem_Document);var sDocHRef=oQueryString.getParam(Olive.WebAppBase.UrlParam.HRef,0);var bDocHRefOK=false;if(sDocHRef)
{sDocHRef=sDocHRef.replace(/\\/g,"/");if(sDocHRef.match(/^\w+\/\d{4}\/\d{2}\/\d{2}$/))
{var nIndexForPublication=sDocHRef.indexOf('/');var sPublication=sDocHRef.substring(0,nIndexForPublication);if(sPublication!=this.m_sPublication)
{this.m_documentViewSource=null;this.reportError(DHTML.newError(OliveApplication.ErrorCodes.ForbiddenPublication,"Security error: It is forbidden to see issues from the publication "+sPublication+" in the current skin."));return null;}
var sIssueDate=sDocHRef.substring(nIndexForPublication+1);var sLastApprovedDate=this.getPreference(OliveApplication.Preferences.Last_ApprovedDate);if(sIssueDate>this.m_sInitialIssueDate&&sLastApprovedDate!="-1")
{this.m_documentViewSource=null;this.reportError(DHTML.newError(OliveApplication.ErrorCodes.ForbiddenIssueDate,"Security error: It is forbidden to see the issue "+sPublication+"/"+sIssueDate+" in the current skin."));return null;}
viewSource.m_sDocHRef=sDocHRef;this.m_sDocHRef=sDocHRef;bDocHRefOK=true;}}
if(!bDocHRefOK)
return null;var paramPageNo=oQueryString.getParam(Olive.WebAppBase.UrlParam.PageNo,0);if(paramPageNo&&!isNaN(parseInt(paramPageNo,10)))
viewSource.m_nPageNo=parseInt(paramPageNo,10);var entityId=oQueryString.getParam(Olive.WebAppBase.UrlParam.Entity,0);if(entityId)
viewSource.m_sEntityId=entityId;var primId=oQueryString.getParam(Olive.WebAppBase.UrlParam.Primitive,0);if(primId)
viewSource.m_sPrimId=primId;return viewSource;}
function OliveApp_getIssueName(oContentItem,sFormatingStringIdentifier)
{if(!oContentItem)
return"";var sDocTitle="";var sResultDate="";var dateValue=this.getIssueDateFromBaseHref(oContentItem.m_sDocHRef);if(dateValue)
sResultDate=formatDateTimeString("%B %d, %Y",dateValue);var sPublication=oContentItem.m_sPublicationDescription;if(!sFormatingStringIdentifier)
sFormatingStringIdentifier="AM3IssueDefaultDescription";if(sPublication)
{sDocTitle=this.formatResString(sFormatingStringIdentifier,sResultDate,sPublication);}
else
{sDocTitle=sResultDate;}
return sDocTitle;}
function OliveApp_getIssueDateFromBaseHref(sDocHRef)
{var dateValue=null;var sDate=sDocHRef.substring(sDocHRef.indexOf("/")+1);var nYear=parseInt(sDate.substr(0,4),10);var nMonth=parseInt(sDate.substr(5,2),10);var nDay=parseInt(sDate.substr(8,2),10);if(!isNaN(nYear)&&!isNaN(nMonth)&&!isNaN(nDay))
dateValue=new Date(nYear,nMonth-1,nDay);return dateValue;}
function OliveApp_getItemTitle(oContentItem)
{if(!oContentItem||!oContentItem.m_sTitle)
return"";var sEntryTitle=oContentItem.m_sTitle;var sIssueName=this.getIssueName(oContentItem);var sPages=oContentItem.m_sPageLabel;return this.formatResString("AM3EntityTitleFormat",sEntryTitle,sPages,sIssueName);}
function OliveApp_getItemDocTitle(oContentItem)
{var sIssueName=this.getIssueName(oContentItem);if(!oContentItem)
return"";var sPages=oContentItem.m_sPageLabel;return this.formatResString("AM3DocumentTitleFormat",sPages,sIssueName);}
function OliveApp_getDocHRef()
{return this.get_DocViewSource().getDocHRef();}
function OliveApp_onDataReceived(eventArgs)
{eventArgs.cancelBubbling=true;if(eventArgs.Request&&eventArgs.Request.sErrorMessage)
{var nAccessErrorCode=1023;var nErrorCode=0;var sErrorCode=eventArgs.Request.getResponsePart("<code>","</code>",eventArgs.Request.sErrorMessage);if(sErrorCode)
nErrorCode=parseInt(sErrorCode,10);if(nErrorCode==nAccessErrorCode)
{eventArgs.Request.nErrorNumber=Olive.Errors.Code.AccessError;}}}
function OliveApp_onErrorOccured(eventArgs)
{if(eventArgs.ErrorObject&&eventArgs.ErrorObject.number==Olive.Errors.Code.AccessError)
{eventArgs.cancelDefaultAction=true;eventArgs.cancelBubbling=true;if(!this.m_bRightsManagementInProgress)
{this.m_bRightsManagementInProgress=true;if(eventArgs.srcObject&&eventArgs.srcObject.getContentItem)
var oContentItem=eventArgs.srcObject.getContentItem();if(this.performRightsManagement)
this.performRightsManagement(oContentItem);}}
else
{this.BaseClassMethod.apply(this,arguments);}}
function OliveApp_performRightsManagement(oContentItem)
{var sDocHRef="";var bFromSearchResult=false;if(oContentItem)
{bFromSearchResult=!(oContentItem.m_sContentSrc==OwcContentSrc_Document);if(oContentItem.getDocHRef)
{sDocHRef=oContentItem.getDocHRef();}}
var mainPage=this.get_MainPage();var oPopupArgs={sDocHRef:sDocHRef,bFromSearchResult:bFromSearchResult};mainPage.openAccessNotificationDialog(oPopupArgs);this.m_bRightsManagementInProgress=false;}
function OliveApp_AccessNotificationCallback(dialogResult,returnValue,popupInfo)
{var bAuthorized=false;if(returnValue.OK)
{bAuthorized=confirm("[need to add the authorization process here]  Do you have authorization?");}
this.m_bRightsManagementInProgress=false;if(bAuthorized)
{}
if(!returnValue.bFromSearchResult)
{}}
function OliveApp_getSearchSortOptions(bSortByDate)
{if("boolean"==typeof bSortByDate)
this.m_bSortByDate=bSortByDate;if(this.m_bSortByDate)
{var oSortOptions=new Olive.Data.SortOptions();oSortOptions.addSortField("IssueDateID",false);return oSortOptions;}
else
return null;}
function OliveApp_isDocHRefDifferent(oContentItem)
{var sDocHRef="";if(oContentItem&&oContentItem.getDocHRef)
sDocHRef=oContentItem.getDocHRef();return(sDocHRef&&sDocHRef!=this.m_sDocHRef);}
function OliveApp_openDifferentDocument(oContentItem)
{this.ClosePopups();if(!oContentItem)
return;var mainPage=this.get_MainPage();mainPage.OpenDocument(oContentItem,false,true,false,false);}
function OliveApp_getEntityType(sEntityId)
{var sEntityType=sEntityId.substr(0,2);var sEntityTypeName=Olive.ContentItem.Entity.EntityTypes.undefined;switch(sEntityType.toLowerCase())
{case"ar":sEntityTypeName=Olive.ContentItem.Entity.EntityTypes.article;break;case"ad":sEntityTypeName=Olive.ContentItem.Entity.EntityTypes.ad;break;case"pc":sEntityTypeName=Olive.ContentItem.Entity.EntityTypes.picture;break;default:break;}
return sEntityTypeName;}
function OliveApp_checkOkToChangeIssue(oContentItem)
{var sNewDocHRef=oContentItem.getDocHRef();if(sNewDocHRef)
{var sPriorDocHRef=this.m_sDocHRef;var sCookieName="olv_activemag_open_new_issue";var sValue=DHTML.getCookie(sCookieName);if(sValue!="true")
{var oPopupArgs={sPriorDocHRef:sPriorDocHRef,sNewDocHRef:sNewDocHRef,oContentItem:oContentItem};var mainPage=this.get_MainPage();mainPage.OpenOkToChangeIssueDialog(oPopupArgs);}
else
{this._openDifferentDocument(oContentItem);}}}
function OliveApp_checkOkToBookmarkPageInFirefoxBrowser(docViewerAgg)
{var mainPage=this.get_MainPage();mainPage.OpenBookmarkInFirefoxDialog(docViewerAgg);}
function OliveApp_onDocumentLoaded(oEventData)
{if(oEventData.sPublicationDescription)
{this.setPublicationDescription(oEventData.sPublicationDescription);document.title=this.getResString("WindowCaption")+" - "+this.getPublicationDescription();}}
function OliveApp_setPublicationDescription(sPublicationDescription)
{this.m_sPublicationDescription=sPublicationDescription;}
function OliveApp_getPublicationDescription()
{return this.m_sPublicationDescription;}
OliveApplication.CheckOkToChangeIssue=function OliveApp_CheckOkToChangeIssue(oContentItem,oSrc,oTarget)
{var bOkToChange=false;var oPage=oSrc.get_WebPage();if(oPage)
bOkToChange=oPage.CheckOkToChangeIssue(oContentItem);return bOkToChange;}
JScript.Type.RegisterClass("OliveApplication",OliveApplication,Olive.WebAppBase);}