if (typeof JSON !== "object")document.write(""); var Product = {UpdatePhoto : function(id, photo){ return this.ajax("UpdatePhoto", {id : id, photo : photo} ,this.getCallback(arguments, 2)); },Add : function(model){ return this.ajax("Add", {model : model} ,this.getCallback(arguments, 1)); },GetSonChannel : function(ParentId, ver){ return this.ajax("GetSonChannel", {ParentId : ParentId, ver : ver} ,this.getCallback(arguments, 2)); },GetSonChannelInfo : function(ClassId, ver){ return this.ajax("GetSonChannelInfo", {ClassId : ClassId, ver : ver} ,this.getCallback(arguments, 2)); },GetProductList : function(classid){ return this.ajax("GetProductList", {classid : classid} ,this.getCallback(arguments, 1)); },GetRelateProduct : function(productid){ return this.ajax("GetRelateProduct", {productid : productid} ,this.getCallback(arguments, 1)); },Search : function(classid, pageSize, curPage, keyword){ return this.ajax("Search", {classid : classid, pageSize : pageSize, curPage : curPage, keyword : keyword} ,this.getCallback(arguments, 4)); },SearchLan : function(classid, ver, pageSize, curPage, keyword){ return this.ajax("SearchLan", {classid : classid, ver : ver, pageSize : pageSize, curPage : curPage, keyword : keyword} ,this.getCallback(arguments, 5)); },UpdateField : function(id, field, value){ return this.ajax("UpdateField", {id : id, field : field, value : value} ,this.getCallback(arguments, 3)); },UpdateField_V : function(id, field, value){ return this.ajax("UpdateField_V", {id : id, field : field, value : value} ,this.getCallback(arguments, 3)); },CacheModel : function(model){ return this.ajax("CacheModel", {model : model} ,this.getCallback(arguments, 1)); },CreateAllHtml : function(classid, ver){ return this.ajax("CreateAllHtml", {classid : classid, ver : ver} ,this.getCallback(arguments, 2)); },CreateListHtml : function(classid, ver){ return this.ajax("CreateListHtml", {classid : classid, ver : ver} ,this.getCallback(arguments, 2)); },CreateDetailHtml : function(classid, ver){ return this.ajax("CreateDetailHtml", {classid : classid, ver : ver} ,this.getCallback(arguments, 2)); },CreateSelectHtml : function(classid, ids, ver){ return this.ajax("CreateSelectHtml", {classid : classid, ids : ids, ver : ver} ,this.getCallback(arguments, 3)); },Update : function(model){ return this.ajax("Update", {model : model} ,this.getCallback(arguments, 1)); },Delete : function(Id){ return this.ajax("Delete", {Id : Id} ,this.getCallback(arguments, 1)); },Deletes : function(ids){ return this.ajax("Deletes", {ids : ids} ,this.getCallback(arguments, 1)); },setDate : function (a) { if(a != null && typeof a == 'object') { for (var i in a) a[i] = this.setDate(a[i]) } return a = a instanceof Date ? '"\\/Date(' + a.getTime() + ')\\/"' : a}, getCallback : function(a, b){ return b < a.length ? a[b] : undefined},ajax: function (a, b, c){var j = JSON.stringify(this.setDate(b)); var d = { contentType:'text/plain', beforeSend : function(x){ x.setRequestHeader('method', a) }, async : true, url : this.u, type : 'POST', dataType : 'json', data : j, success:function(e){ typeof c == 'function' && c(e) } }; if(typeof c != 'function'){ d.async = false; return JSON.parse(jQuery.ajax(d).responseText) } else jQuery.ajax(d) }, u: 'Product.ashx'};