var CEventDispatcher=new _CEventDispatcher();
_CEventDispatcher.prototype.subscribe=_CEventDispatcher_subscribe;
_CEventDispatcher.prototype.publish=_CEventDispatcher_publish;
_CEventDispatcher.prototype.unsubscribe=_CEventDispatcher_unsubscribe;
_CEventDispatcher.prototype.getInstance=_CEventDispatcher_getInstance;
function _CEventDispatcher(){
this.handlers=Hashtable.getInstance();
return this;
};
function _CEventDispatcher_getInstance(){
return new _CEventDispatcher();
};
function _CEventDispatcher_publish(_1,_2){
if(_2 instanceof Array){
sf.publish(_1,_2);
}else{
var _3=new Array();
_3[0]=_2;
sf.publish(_1,_3);
}
return;
};
function _CEventDispatcher_subscribe(_4,_5,_6){
var _7=sf.subscribe(_4,_5,_6);
if(_7){
this.handlers.put(_4,_7);
}
return;
};
function _CEventDispatcher_unsubscribe(_8){
var _9=null;
if(this.handlers){
_9=this.handlers.get(_8);
}
if(_9){
sf.unsubscribe(_9);
this.handlers.remove(_8);
}
return _9;
};
var CController=new _CController();
function _CController(){
this.m_topics=null;
this.m_cache=null;
this.m_eventDispatcher=null;
this.init=_CController_init;
this.m_ctx=null;
this.getContext=_CController_getContext;
this.getInstance=_CController_getInstance;
this.service=_CController_service;
this.getEventDispatcher=_CController_getEventDispatcher;
this.destroy=_CController_destroy;
return this;
};
function _CController_getEventDispatcher(){
return this.m_eventDispatcher;
};
function _CController_init(){
this.m_topics=Hashtable.getInstance();
this.m_cache=Hashtable.getInstance();
this.m_eventDispatcher=CEventDispatcher.getInstance();
};
function _CController_getInstance(){
var _a=new _CController();
_a.init();
return _a;
};
function _CController_service(_b){
this.m_ctx=_b;
if(_b.getCurrentViewComponent()){
return _b.getCurrentViewComponent().process(_b);
}else{
return null;
}
};
function _CController_getContext(){
return this.m_ctx;
};
function _CController_destroy(){
alert("Not Implemented!");
};
var IViewComponent=new _IViewComponent(null,null,null,false,null,null);
function _IViewComponent(_c,_d,_e,_f,_10,_11){
this.m_context=null;
this.m_componentName=null;
this.m_isDataReqd=false;
this.m_componentId=null;
this.m_mode=null;
this.m_componentUrl=null;
if(_c){
this.m_context=_c;
}
if(_e){
this.m_componentName=_e;
}
if(_f){
this.m_isDataReqd=_f;
}
if(_10){
this.m_mode=_10;
}
if(_11){
this.m_componentUrl=_11;
}
if(_d){
this.m_componentId=_d;
}
this.m_attributes=Hashtable.getInstance();
this.getInstance=_IViewComponent_getInstance;
this.callbackHandler=_IViewComponent_callbackHandler;
this.getContext=_IViewComponent_getContext;
this.getComponentName=_IViewComponent_getComponentName;
this.isDataRequired=_IViewComponent_isDataRequired;
this.setDataRequired=_IViewComponent_setDataRequired;
this.getMode=_IViewComponent_getMode;
this.setMode=_IViewComponent_setMode;
this.renderView=_IViewComponent_renderView;
this.hide=_IViewComponent_hide;
this.show=_IViewComponent_show;
this.getComponentUrl=_IViewComponent_getComponentUrl;
this.setComponentUrl=_IViewComponent_setComponentUrl;
this.getComponentId=_IViewComponent_getComponentId;
this.setAttribute=_IViewComponent_setAttribute;
this.getAttribute=_IViewComponent_getAttribute;
this.removeAttribute=_IViewComponent_removeAttribute;
this.handleData=_IViewComponent_handleData;
this.handle=_IViewComponent_handle;
this.process=_IViewComponent_process;
return this;
};
function _IViewComponent_handleData(){
throw this.getComponentId()+"::_IViewComponent_handleData has to be implemented by Child!";
};
function _IViewComponent_handle(){
throw this.getComponentId()+"::_IViewComponent_handle() child has to implement it! ";
};
function _IViewComponent_setAttribute(key,_13){
this.m_attributes.put(key,_13);
};
function _IViewComponent_removeAttribute(key){
this.m_attributes.remove(key);
};
function _IViewComponent_getAttribute(key){
return this.m_attributes.get(key);
};
function _IViewComponent_getInstance(_16,_17,_18,_19,_1a,_1b){
this.m_context=_16;
this.m_componentName=_18;
this.m_isDataReqd=_19;
this.m_mode=_1a;
this.m_componentId=_17;
this.m_componentUrl=_1b;
return new _IViewComponent(_16,_17,_18,_19,_1a,_1b);
};
function _IViewComponent_getComponentId(){
return this.m_componentId;
};
function _IViewComponent_getContext(){
return this.m_context;
};
function _IViewComponent_getComponentName(){
return this.m_componentName;
};
function _IViewComponent_isDataRequired(){
return this.m_isDataReqd;
};
function _IViewComponent_setDataRequired(_1c){
this.m_isDataRequired=dataRqd;
};
function _IViewComponent_process(ctx){
throw this.getComponentId()+"::_IViewComponent_process(ctx) has to be implmented by Child";
};
function _IViewComponent_getMode(){
return this.m_mode;
};
function _IViewComponent_setMode(_1e){
this.m_mode=_1e;
};
function _IViewComponent_renderView(){
throw this.getComponentId()+"::_IViewComponent_renderView() has to be implemented by Child";
};
function _IViewComponent_hide(){
throw this.getComponentId()+"::_IViewComponent_hide() has to be implemented by Child";
};
function _IViewComponent_callbackHandler(){
throw this.getComponentId()+"::_IViewComponent_callbackHandler has to be implmented by Child ";
};
function _IViewComponent_show(){
throw this.getComponentId()+"::_IViewComponent_show() has to be implemented by Child";
};
function _IViewComponent_getComponentUrl(){
return this.m_componentUrl;
};
function _IViewComponent_setComponentUrl(url){
this.m_componentUrl=url;
};
var IDataComponent=new _IDataComponent(null,null,null,null,null);
function _IDataComponent(_20,_21,_22,_23,_24){
this.m_context=_20;
this.m_componentName=_21;
this.m_dataObject=_22;
this.m_attributes=Hashtable.getInstance();
this.m_readUrl=_23;
this.m_writeUrl=_24;
this.getInstance=_IDataComponent_getInstance;
this.getDataObject=_IDataComponent_getDataObject;
this.getReadUrl=_IDataComponent_getReadUrl;
this.setReadUrl=_IDataComponent_setReadUrl;
this.getWriteUrl=_IDataComponent_getWriteUrl;
this.setWriteUrl=_IDataComponent_setWriteUrl;
this.setDataObject=_IDataComponent_setDataObject;
this.callbackDataHandler=_IDataComponent_callbackDataHandler;
this.read=_IDataComponent_read;
this.write=_IDataComponent_write;
this.setAttribute=_IDataComponent_setAttribute;
this.getAttribute=_IDataComponent_getAttribute;
this.getContext=_IDataComponent_getContext;
this.getComponentName=_IDataComponent_getComponentName;
this.handle=_IDataComponent_handle;
return this;
};
function _IDataComponent_setAttribute(key,_26){
this.m_attributes.put(key,_26);
};
function _IDataComponent_getAttribute(key){
return this.m_attributes.get(key);
};
function _IDataComponent_getComponentName(){
return this.m_componentName;
};
function _IDataComponent_getContext(){
return this.m_context;
};
function _IDataComponent_callbackDataHandler(){
throw this.getComponentName()+"::_IDataComponent_callbackDataHandler has to implemented by child";
};
function _IDataComponent_handle(){
throw this.getComponentName()+"::_IDataComponent_handle() has to be implemented by Child!";
};
function _IDataComponent_read(){
throw this.getComponentName()+"::_IDataComponent_read() has to be implemented by Child";
};
function _IDataComponent_write(_28){
throw this.getComponentName()+"::_IDataComponent_write() has to be implemented by Child";
};
function _IDataComponent_getInstance(_29,_2a,_2b,_2c,_2d){
return new _IDataComponent(_29,_2a,_2b,_2c,_2d);
};
function _IDataComponent_getDataObject(){
return this.m_dataObject;
};
function _IDataComponent_getReadUrl(){
return this.m_readUrl;
};
function _IDataComponent_setReadUrl(_2e){
this.m_readUrl=_2e;
};
function _IDataComponent_getWriteUrl(){
return this.m_writeUrl;
};
function _IDataComponent_setWriteUrl(_2f){
this.m_writeUrl=_2f;
};
function _IDataComponent_setDataObject(_30){
this.m_dataObject=_30;
};
function _IDataComponent_getDataObject(){
return this.m_dataObject;
};
var CContext=new _CContext(null,null,null);
function _CContext(_31,_32,_33){
this.m_websiteInfo=_31;
this.m_currentViewComponent=_32;
this.m_currentDataComponent=_33;
this.m_viewComponentMap=Hashtable.getInstance();
this.m_dataComponentMap=Hashtable.getInstance();
this.m_attributes=Hashtable.getInstance();
this.getInstance=_CContext_getInstance;
this.addViewComponent=_CContext_addViewComponent;
this.getViewComponent=_CContext_getViewComponent;
this.removeViewComponent=_CContext_removeViewComponent;
this.addDataComponent=_CContext_addDataComponent;
this.getDataComponent=_CContext_getDataComponent;
this.removeDataComponent=_CContext_removeDataComponent;
this.getCurrentViewComponent=_CContext_getCurrentViewComponent;
this.getCurrentDataComponent=_CContext_getCurrentDataComponent;
this.setCurrentViewComponent=_CContext_setCurrentViewComponent;
this.setCurrentDataComponent=_CContext_setCurrentDataComponent;
this.setAttribute=_CContext_setAttribute;
this.getAttribute=_CContext_getAttribute;
this.removeAttribute=_CContext_removeAttribute;
return this;
};
function _CContext_removeAttribute(key){
this.m_attributes.remove(key);
};
function _CContext_setAttribute(key,_36){
this.m_attributes.put(key,_36);
};
function _CContext_getAttribute(key){
return this.m_attributes.get(key);
};
function _CContext_getViewComponent(_38){
return this.m_viewComponentMap.get(_38);
};
function _CContext_getDataComponent(_39){
return this.m_dataComponentMap.get(_39);
};
function _CContext_addDataComponent(_3a,_3b){
this.m_dataComponentMap.put(_3a,_3b);
};
function _CContext_removeDataComponent(_3c){
this.m_dataComponentMap.remove(_3c);
};
function _CContext_getInstance(_3d,_3e,_3f){
return new _CContext(_3d,_3e,_3f);
};
function _CContext_addViewComponent(_40,_41){
this.m_viewComponentMap.put(_40,_41);
};
function _CContext_removeViewComponent(_42){
this.m_viewComponentMap.remove(_42);
};
function _CContext_getCurrentViewComponent(){
return this.m_currentViewComponent;
};
function _CContext_getCurrentDataComponent(){
return this.m_currentDataComponent;
};
function _CContext_setCurrentDataComponent(_43){
this.m_currentDataComponent=_43;
};
function _CContext_setCurrentViewComponent(_44){
this.m_currentViewComponent=_44;
};
var IWebsiteInfo=new _IWebsiteInfo(null,null,null,null,null,null,null,null,null,false);
function _IWebsiteInfo(_45,_46,_47,_48,_49,_4a,_4b,_4c,_4d,_4e){
this.m_subscriberOid=_45;
this.m_websiteOid=_46;
this.m_websiteName=_47;
this.m_cobrandName=_48;
this.m_cobrandOid=_49;
this.m_defaultCobrandOid=_4a;
this.m_region=_4b;
this.m_host=_4c;
this.m_imageHost=_4d;
this.m_isSecure=_4e;
this.getInstance=_IWebsiteInfo_getInstance;
this.getWebsiteOid=_IWebsiteInfo_getWebsiteOid;
this.getWebsiteName=_IWebsiteInfo_getWebsiteName;
this.getSubscriberOid=_IWebsiteInfo_getSubscriberOid;
this.getCobrandOid=_IWebsiteInfo_getCobrandOid;
this.getCobrandName=_IWebsiteInfo_getCobrandName;
this.getDefaultCobrandOid=_IWebsiteInfo_getDefaultCobrandOid;
this.getHost=_IWebsiteInfo_getHost;
this.getImageHost=_IWebsiteInfo_getImageHost;
this.isSecure=_IWebsiteInfo_isSecure;
this.getRegion=_IWebsiteInfo_getRegion;
this.toString=_IWebsiteInfo_toString;
return this;
};
function _IWebsiteInfo_toString(){
var _4f="SubscriberOid ; "+this.m_subscriberOid+"\n"+"WebsiteOid : "+this.m_websiteOid+"\n"+"WebsiteName ;"+this.m_websiteName+"\n"+"CobrandName :"+this.m_cobrandName+"\n"+"CobrandOid : "+this.m_cobrandOid+"\n"+"Default Cobrand Oid :"+this.m_defaultCobrandOid+"\n"+"Region: "+this.m_region+"\n"+"Host :"+this.m_host+"\n"+"ImageHost :"+this.m_imageHost+"\n"+"Secure ? "+this.m_isSecure;
return _4f;
};
function _IWebsiteInfo_getInstance(_50,_51,_52,_53,_54,_55,_56,_57,_58,_59){
return new _IWebsiteInfo(_50,_51,_52,_53,_54,_55,_56,_57,_58,_59);
};
function _IWebsiteInfo_getWebsiteOid(){
return this.m_websiteOid;
};
function _IWebsiteInfo_getWebsiteName(){
return this.m_websiteName;
};
function _IWebsiteInfo_getSubscriberOid(){
return this.m_subscriberOid;
};
function _IWebsiteInfo_getCobrandOid(){
return this.m_cobrandOid;
};
function _IWebsiteInfo_getCobrandName(){
return this.m_cobrandName;
};
function _IWebsiteInfo_getDefaultCobrandOid(){
return this.m_defaultCobrandOid;
};
function _IWebsiteInfo_getHost(){
return this.m_host;
};
function _IWebsiteInfo_getImageHost(){
return this.m_imageHost;
};
function _IWebsiteInfo_isSecure(){
return this.m_isSecure;
};
function _IWebsiteInfo_getRegion(){
return this.m_region;
};
function loadViewComponent(_5a){
var _5b=_5a.getComponentUrl();
if(!_5b){
return;
}
var kw={url:_5b,handleAs:"text",load:function(_5d,_5e){
try{
_5a.callbackHandler(_5d);
}
catch(err){
console.error("loadViewComponent( "+_5a.getComponentId()+" ) Error "+err+" ( "+err.description+" )"+" : URL  :"+_5b);
throw err;
}
},error:function(_5f,_60){
console.debug("(loadViewComponent)HTTP status code: "+_60.xhr.status);
}};
dojo.xhrGet(kw);
};
dataLoadingInProgress=false;
function loadDataFromDataHost(_61,_62){
dataLoadingInProgress=true;
var _63=_62.getReadUrl();
if(_63){
if(typeof designDataCache!="undefined"&&designDataCache[_63]){
if(djConfig.isDebug){
console.debug("clientV2 :: returning data of ["+_63+"] from cache");
}
_62.callbackDataHandler(designDataCache[_63]);
return;
}else{
dojo.io.script.get({url:_62.getReadUrl(),checkString:"taskLoaded",transport:"ScriptSrcTransport",callbackParamName:"__taskLoaded",jsonParamName:"__taskLoaded",load:function(_64,_65){
_62.callbackDataHandler(_64);
if(typeof designDataCache!="undefined"){
designDataCache[_63]=_64;
}
dataLoadingInProgress=false;
return _64;
},error:function(_66,_67){
console.debug("(loadDataFromDataHost)HTTP status code: "+_67.xhr.status);
return _66;
}});
}
}
};
function loadDataComponent(_68){
var _69=_68.getReadUrl();
var kw={url:_69,load:function(_6b,_6c){
try{
_68.callbackDataHandler(_6b);
}
catch(err){
console.debug("loadDataComponent( "+_68.getComponentName()+" )  Error:"+err.description);
throw err;
}
return _6b;
},error:function(_6d,_6e){
console.debug("(loadDataFromDataHost)HTTP status code: "+_6e.xhr.status);
return _6d;
}};
dojo.xhrGet(kw);
};
function loadAvatarDataComponent(){
var _6f=__getAvatarDataUrl;
var kw={url:_6f,load:function(_71,_72){
try{
oController.getEventDispatcher().publish("avatarDataRetrieved",_71);
}
catch(err){
console.debug("loadDataComponent( "+dataComponent.getComponentName()+" )  Error:"+err.description);
throw err;
}
return _71;
},error:function(_73,_74){
console.debug("(loadDataFromDataHost)HTTP status code: "+_74.xhr.status);
return _73;
}};
dojo.xhrGet(kw);
};
var sf=sf||{};
sf._listener={getDispatcher:function(){
return function(){
var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;
var r=t&&t.apply(this,arguments);
for(var i in ls){
if(!(i in ap)&&ls[i]){
ls[i].apply(this,arguments);
}
}
return r;
};
},add:function(_7b,_7c,_7d){
var f=_7b[_7c];
if(!f||!f._listeners){
var d=sf._listener.getDispatcher();
d.target=f;
d._listeners=[];
f=_7b[_7c]=d;
}
return f._listeners.push(_7d);
},remove:function(_80,_81,_82){
var f=(_80||dojo.global)[_81];
if(f&&f._listeners&&_82--){
delete f._listeners[_82];
}
}};
sf.connect=function(obj,_85,_86,_87,_88){
var a=arguments,_8a=[],i=0;
_8a.push(dojo.isString(a[0])?null:a[i++],a[i++]);
var a1=a[i+1];
_8a.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);
for(var l=a.length;i<l;i++){
_8a.push(a[i]);
}
return sf._connect.apply(this,_8a);
};
sf._connect=function(obj,_8f,_90,_91){
var l=dojo._listener,h=l.add(obj,_8f,dojo.hitch(_90,_91));
return [obj,_8f,h,l];
};
sf.disconnect=function(_94){
if(_94&&_94[0]!==undefined){
sf._disconnect.apply(this,_94);
delete _94[0];
}
};
sf._disconnect=function(obj,_96,_97,_98){
_98.remove(obj,_96,_97);
};
sf._topics={};
sf.subscribe=function(_99,_9a,_9b){
return [_99,sf._listener.add(sf._topics,_99,sf.hitch(_9a,_9b))];
};
sf.unsubscribe=function(_9c){
if(_9c){
sf._listener.remove(sf._topics,_9c[0],_9c[1]);
}
};
sf.publish=function(_9d,_9e){
var f=sf._topics[_9d];
if(f){
f.apply(this,_9e||[]);
}
};
sf.connectPublisher=function(_a0,obj,_a2){
var pf=function(){
sf.publish(_a0,arguments);
};
return (_a2)?sf.connect(obj,_a2,pf):sf.connect(obj,pf);
};
sf._hitchArgs=function(_a4,_a5){
var pre=sf._toArray(arguments,2);
var _a7=sf.isString(_a5);
return function(){
var _a8=sf._toArray(arguments);
var f=_a7?(_a4||dojo.global)[_a5]:_a5;
return f&&f.apply(_a4||this,pre.concat(_a8));
};
};
sf.hitch=function(_aa,_ab){
if(arguments.length>2){
return sf._hitchArgs.apply(dojo,arguments);
}
if(!_ab){
_ab=_aa;
_aa=null;
}
if(sf.isString(_ab)){
_aa=_aa||dojo.global;
if(!_aa[_ab]){
throw (["f.hitch: scope[\"",_ab,"\"] is null (scope=\"",_aa,"\")"].join(""));
}
return function(){
return _aa[_ab].apply(_aa,arguments||[]);
};
}
return !_aa?_ab:function(){
return _ab.apply(_aa,arguments||[]);
};
};
sf._toArray=function(obj,_ad,_ae){
var arr=_ae||[];
for(var x=_ad||0;x<obj.length;x++){
arr.push(obj[x]);
}
return arr;
};
sf.isString=function(it){
return typeof it=="string"||it instanceof String;
};


