                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

if(!window.__td){window.__MT=100;window.__ti=0;window.__td=[];window.__td.length=__MT;window.__noTrace=false;}
if(!vp.smartlayout)
{vp.smartlayout={};}
vp.smartlayout.update=function smartlayout_update()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var updater=vp.smartlayout.SmartLayoutUpdater.getInstance();updater.update.apply(updater,arguments);};vp.smartlayout.SmartLayoutUpdater=function smartlayout_SmartLayoutUpdater(oEditor)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var me=this;var buildRequestXml=function pv_buildRequestXml()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var numTextAreas=0;var numTextFields=0;var nodes=[];var maintainFontSize=oEditor.isAdvanced;nodes.push('<conf lang="'+EditorConst.languageID+'" pfid="'+oEditor.PFID+'" maintainfontsize="'+maintainFontSize+'" />');nodes.push('<fontscheme primary="'+oEditor.fontScheme[0]+'" secondary="'+oEditor.fontScheme[1]+'" />');var i;var textAreas=oEditor.getItemsByType(DOCITEM_TYPE_TEXTAREA);for(i=0;i<textAreas.length;i++)
{var textArea=textAreas[i];nodes.push(textArea.getUpdateXML());numTextAreas++;}
var textFields=oEditor.getItemsByType(DOCITEM_TYPE_TEXT);for(i=0;i<textFields.length;i++)
{var textField=textFields[i];if(textField.isSmartLayout())
{nodes.push(textField.getUpdateXML());numTextFields++;}}
return{numTextAreas:numTextAreas,numTextFields:numTextFields,requestXml:'<smartlayout>'+nodes.join('\n')+'</smartlayout>'};};var updateFieldData=function pv_updateFieldData(oSmartLayoutFieldData)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var textFields=oEditor.getItemsByType(DOCITEM_TYPE_TEXT);for(var i=0;i<textFields.length;i++)
{var textField=textFields[i];var newFieldData=oSmartLayoutFieldData[textField.id];if(newFieldData)
{textField.fontSize=newFieldData.fontsize;textField.coordinates.setRectPrecise({top:newFieldData.top,left:newFieldData.left,width:newFieldData.width,height:newFieldData.height});}}};var handleResponse=function pv_handleResponse(sResponseText)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oResponse=vp.http.parseJSON(sResponseText);if(0===oResponse.rc)
{vp.smartlayout.ui.showTextLengthWarning=false;updateFieldData(oResponse.fields);}
else if(2==oResponse.rc)
{vp.smartlayout.ui.showTextLengthWarning=true;}
else
{throw new Error('Smart layout web service error: Return code '+oResponse.rc);}
vp.smartlayout.SmartLayoutTextField.refreshAllBaseTextFields();oEditor.hideProgressBar();};var getUrl=function pv_getUrl()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
return"/vp/ns/studio/smart_layout_web_service.aspx?u="+new Date().valueOf();};var _update=function pv__update(bShowProgressBar)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(bShowProgressBar)
{oEditor.showProgressBar();}
oEditor.deleteClickText();var data=new vp.web.QueryString();data.setItem("layoutXML",buildRequestXml().requestXml);vp.http.postAsync(getUrl(),data.toString(),handleResponse.getClosure(me));};this.update=function pb_this_update(bForce,bShowProgressBar)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.smartlayout.SmartLayoutTextField.hasText()&&(bForce||vp.smartlayout.SmartLayoutTextField.anyOutOfDate()))
{_update(bShowProgressBar);}
else
{vp.smartlayout.SmartLayoutTextField.refreshAllBaseTextFields();}};};vp.smartlayout.SmartLayoutUpdater.getInstance=function smartlayout_SmartLayoutUpdater_getInstance()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!vp.smartlayout.SmartLayoutUpdater.instance)
{vp.smartlayout.SmartLayoutUpdater.instance=new vp.smartlayout.SmartLayoutUpdater(Editor);}
return vp.smartlayout.SmartLayoutUpdater.instance;};