
function Component()
{this.onDomReady=function()
{if(typeof(this.init)=='function')
{this.init();}
if(typeof(this.initExt)=='function')
{this.initExt();}}
this.getParameter=function(name,defaultValue)
{if(this.parameterIsset(name))
{return this.parameters[name];}
else if(typeof(defaultValue)!='undefined')
{return defaultValue;}
else
{return null;}}
this.setParameter=function(name,value)
{this.parameters[name]=value;}
this.setParameters=function(parameters)
{this.parameters=parameters;}
this.parameterIsset=function(name)
{if(typeof(this.parameters[name])!='undefined'&&typeof(this.parameters[name])!='function')
{return true;}
else
{return false;}}
this.rpc=function(rpcMethod,data,callback)
{if(typeof(jQuery)!='undefined'&&typeof($.toJSON)=='function')
{var settings={'type':'POST','url':'/mdf/rpc/c/'+this.alias+'/m/'+rpcMethod,'dataType':'json'}
if(typeof(data)!='undefined')
{settings.data=$.toJSON(data);}
if(typeof(callback)!='undefined')
{if(typeof(callback)=='function')
{callback={success:callback};}
if(typeof(callback.success)!='undefined')
{settings.success=callback.success;}
if(typeof(callback.error)!='undefined')
{settings.error=callback.error;}
if(typeof(callback.complete)!='undefined')
{settings.complete=callback.complete;}
if(typeof(callback.beforeSend)!='undefined')
{settings.beforeSend=callback.beforeSend;}}
return $.ajax(settings);}
else if(typeof(YAHOO)!='undefined')
{if(typeof(data)!='undefined')
{data=YAHOO.lang.JSON.stringify(data);}
if(typeof(callback)!='undefined')
{if(typeof(callback)=='function')
{callback={success:callback};}
var onSuccess=callback.success;callback.success=function(o)
{o.response=YAHOO.lang.JSON.parse(o.responseText);onSuccess(o);}}
return YAHOO.util.Connect.asyncRequest('POST','/mdf/rpc/c/'+this.alias+'/m/'+rpcMethod,callback,data);}}}
