// cached javascript
var MyMethods = {
Elements:function(myclass, value, callback, context){return new ajax_request(this.url + '?_method=getObjects&','myclass='+enc(myclass)+'&value='+enc(value),callback, context);},
ElementsAdmin:function(myclass, _method, value, callback, context){return new ajax_request(this.url + '?_method=getObjectsByMethod&','myclass='+enc(myclass)+'&method='+enc(_method)+'&value='+enc(value),callback, context);},
getPropertyValue:function(myclass, prop, value, callback, context){return new ajax_request(this.url + '?_method=getPropertyValue&','myclass='+enc(myclass)+'&value='+enc(value)+'&property='+enc(prop),callback, context);},
callClassMethod:function(myclass, method, value, callback, context){return new ajax_request(this.url + '?_method=callClassMethod&','myclass='+enc(myclass)+'&method='+enc(method)+'&value='+enc(value),callback, context);},
GetNextMonth:function (fecha, callback, context){return new ajax_request(this.url + '?_method=getNextMonth&','fecha='+enc(fecha),callback, context);},
GetPreviousMonth:function (fecha, callback, context){return new ajax_request(this.url + '?_method=getPreviousMonth&','fecha='+enc(fecha),callback, context);},
GetAgenda:function (fecha, callback, context){return new ajax_request(this.url + '?_method=getAgenda&','fecha='+enc(fecha),callback, context);},
ElementsBySQL:function(myclass, value, callback, context){return new ajax_request(this.url + '?_method=getElementsBySQL&','myclass='+enc(myclass)+'&value='+enc(value),callback, context);},
GetDocumentos:function (texto,desde,hasta,orden,tesauro_id,categoria_id,subcategoria_id, callback, context) {return new ajax_request(this.url + '?_method=getDocumentos&','texto='+enc(texto)+'&desde=' + enc(desde)+'&hasta=' + enc(hasta)+'&orden=' + enc(orden)+'&tesauro_id=' + enc(tesauro_id)+'&categoria_id=' + enc(categoria_id)+'&subcategoria_id=' + enc(subcategoria_id), callback, context);},
CargaFormulario:function(posicion, cantidad, color, plantilla, display, i, callback, context){return new ajax_request(this.url + '?_method=cargaFormulario&','posicion='+enc(posicion)+'&cantidad='+enc(cantidad)+'&color='+enc(color)+'&plantilla='+enc(plantilla)+'&display='+enc(display)+'&i='+enc(i), callback, context);},
CargaFormularioPlantilla:function(categoria_id, callback, context){return new ajax_request(this.url + '?_method=cargaPlantillaCategoria&','categoria_id='+enc(categoria_id), callback, context);},
CargaFormularioBoletin:function(boletin_id, categoria_id, callback, context){return new ajax_request(this.url + '?_method=cargaPlantillaBoletin&','boletin_id='+enc(boletin_id)+'&categoria_id='+categoria_id, callback, context);},
DisplayNews:function(id, page, plantilla, callback, context){return new ajax_request(this.url + '?_method=displayNews&','id='+enc(id)+'&page='+enc(page)+'&plantilla='+enc(plantilla), callback, context);},
url:'/admin/imremote.php'
}
/*{AJAX}*/

function HtmlControl(id) {
	var ele = null;
	if(typeof(id) == 'object') ele = id; else ele = document.getElementById(id);
	if(ele == null) return null;
	var _o = ele.cloneNode(true);
	var _op = document.createElement('SPAN');
	_op.appendChild(_o);	
	this._source = _op.innerHTML;
}

HtmlControl.prototype.toString = function(){ return this._source; }

function HtmlControlUpdate(func, parentId) {
var f,i,ff,fa='';
var ele = document.getElementById(parentId);
if(ele == null) return;
var args = [];
for(i=0; i<HtmlControlUpdate.arguments.length; i++)
	args[args.length] = HtmlControlUpdate.arguments[i];
if(args.length > 2)
	for(i=2; i<args.length; i++){fa += 'args[' + i + ']';if(i < args.length -1){ fa += ','; }}
f = '{"invoke":function(args){return ' + func + '(' + fa + ');}}';
ff = null;eval('ff=' + f + ';');
if(ff != null && typeof(ff.invoke) == 'function')
{
	var res = ff.invoke(args);
	if(res.error != null){alert(res.error);return;}
	ele.innerHTML = res.value;
}
}
function digi(v, c){v = v + "";var n = "0000";if(v.length < c) return n.substr(0, c-v.length) + v;return v;}
function DateTime(year,month,day,hours,minutes,seconds){if(year>9999||year<1970||month<1||month>12||day<0||day>31||hours<0||hours>23||minutes<0||minutes>59||seconds<0||seconds>59)throw("ArgumentException");this.Year = year;this.Month = month;this.Day = day;this.Hours = hours;this.Minutes = minutes;this.Seconds = seconds;}
DateTime.prototype.toString = function(){return digi(this.Year,4) + digi(this.Month,2) + digi(this.Day,2) + digi(this.Hours,2) + digi(this.Minutes,2) + digi(this.Seconds,2);}
function AjaxImage(url){var img=new Image();img.src=url;return img;}
function TimeSpan(){this.Days=0;this.Hours=0;this.Minutes=0;this.Seconds=0;this.Milliseconds=0;}
TimeSpan.prototype.toString = function(){return this.Days+'.'+this.Hours+':'+this.Minutes+':'+this.Seconds+'.'+this.Milliseconds;}
function _getTable(n,e){for(var i=0; i<e.Tables.length; i++){if(e.Tables[i].Name == n)return e.Tables[i];}return null;}

