//HACK: ebaybase.js defines a variable named com, which
//was causing the code below to not create the com object
//needed for the shopping API.  This temporary hack gets
//around this for the pages which need the shopping API.
//note, that this may break the RTM placements, but I
//doubt it - bhoffer
if(typeof(com) != 'undefined') com = 0;

if(!com){
  var eBayBootstrap = function (name, parent) {
			this.classes = {};
			this.name = name;
			this.parent = parent;
			this.addClass = function(className) {
				if(!this.classes[className]) {
					function PackageStats() {
						this.count = 0;
					}					
					this.classes[className] = new PackageStats();
				} else {
					this.classes[className].count++;
				}
			};
			this.getClass = function(className) {
				return this.classes[className] ? this.classes[className].base: null;
			};
  };
  com =  new eBayBootstrap('com', this);
  if(typeof(com.ebay) == 'undefined') {
  	com.ebay =  new eBayBootstrap('ebay', com);	
  }
  if(typeof(com.ebay.widgets) == 'undefined') {
  	com.ebay.widgets =  new eBayBootstrap('widgets', com.ebay);	
  }
}

com.ebay.widgets.typeOf = function(obj) {
    var s = typeof obj;
    if (s === 'object') {
            if (obj instanceof Array) {
                    s = 'array';
            } else if (obj instanceof String) {
                    s = 'string';
            } else if (obj instanceof Function) {
                    s = 'function';	
            } else if (obj instanceof Date) {
                    s = 'date';														
            }
    }
    return s;
};

com.ebay.widgets.needs = function (props) {
	var baseUrl = props.baseUrl;
	var files = props.files;	
	var resources = props.resources;
	var callback = props.callback;
	
	var cb = function(resources, callback) {
		var resourceNumber = resources.length - 1;
		var resourceCount = 0;
		var resourcesHashSet = resources.toHashSet();
		var resourceCb = function(classname) {
			var packageName = this.getPackageName();
			resourcesHashSet[packageName + '.' + classname] = undefined;
			var allLoaded = true;
			for(var resourcesEntry in resourcesHashSet) {
				var resourcesValue = resourcesHashSet[resourcesEntry];
				if(resourcesValue !== undefined && resourcesEntry != 'toJSONString') {
					//com.ebay.widgets.log('resources left '+resourcesValue);
					allLoaded = false;
				}
			}
			if(allLoaded) {
				window.setTimeout(callback,1);
			}			
		};
		return resourceCb;
	};
	var closure = cb(resources, callback), resource = null;
	if (files) {
		while (resources.length > 0) {
			resource = resources.shift();
			com.ebay.widgets.register(resource, closure);
		}		
		com.ebay.widgets.loadFiles(baseUrl, files);
	} else {
		while (resources.length > 0) {
			resource = resources.shift();
			com.ebay.widgets.create(baseUrl, resource, closure);
		}
	}
};

com.ebay.widgets.register = function(resource, callback) {			
	var clzNames = resource.split('.');
	var className = clzNames[clzNames.length - 1];
	var packageManager = window;
	var packagePath = "";
	for(var i = 0; i < clzNames.length - 1; ++i) {
		var namePart = clzNames[i];
		packagePath += namePart;
		packagePath += '/';
		if(!packageManager[namePart]) {
			packageManager = new com.ebay.widgets.PackageManager(packageManager, namePart, callback);
		} else {
			packageManager = packageManager[namePart];
			packageManager.callback = callback;	
		}
	}	
};

com.ebay.widgets.create = function(baseUrl, resource, callback) {			
	var clzNames = resource.split('.');
	var className = clzNames[clzNames.length - 1];
	var packageManager = window;
	var packagePath = "";
	for(var i = 0; i < clzNames.length - 1; ++i) {
		var namePart = clzNames[i];
		packagePath += namePart;
		packagePath += '/';
		if(!packageManager[namePart]) {
			packageManager = new com.ebay.widgets.PackageManager(packageManager, namePart, callback);
		} else {
			packageManager = packageManager[namePart];
			packageManager.callback = callback;	
		}
	}	
	var scriptName = baseUrl ? baseUrl + packagePath + className + '.js': packagePath + className + '.js';
	var classInfo = packageManager.loaded(scriptName);		
	if(classInfo) {						
		packageManager.load(scriptName);
	} else {
		packageManager.callback(className);
	}
};

com.ebay.widgets.loadFiles = function(baseUrl, files) {	
	for(var i = 0; i < files.length; ++i) {
		var file = files[i];
		var fileName = baseUrl ? baseUrl + file: file;
	  	var body = document.getElementsByTagName("body")[0];
	  	var script = document.createElement("script");
	  	script.src = fileName;
	  	body.appendChild(script);		
	}	
};

com.ebay.widgets.PackageManager = function(pkg, name, callback) {
	this.classes = {};
	this.name = name;
	this.parent = pkg;
	this.callback = callback;
	pkg[name] = this;
	this.load_timeout = 1000000; 	
	this.addClass = function(className, clazz) {
		if(!this.classes[className]) {
			this.classes[className] = new com.ebay.widgets.PackageStats(clazz);
			this[className] = clazz;
			if(this.callback) {
				this.callback(className);
			}			
		} 
	};
	this.getPackageName = function() {
		var pName = this.name;
		var parent = this.parent;
		while(parent !== window){
			pName = parent.name + '.' + pName;
			parent = parent.parent;
		}
		return pName;
	};	
	this.getClass = function(className) {
		return this.classes[className] ? this.classes[className].base: null;
	};
	this.getClassName = function(src) {
  		var names = src.split('/');
		var className = names[names.length - 1];
		var classNameParts = className.split('.');
		if(classNameParts && classNameParts.length > 0) {
			className = classNameParts[0];
		}
		return className;
	};	
	this.load = function() {
		var src = arguments[0];
		var className = this.getClassName(src);
  		var body = document.getElementsByTagName("body")[0];
  		var script = document.createElement("script");
  		script.src = src;
  		body.appendChild(script);							  
	};
	this.loaded = function(scriptName) {
		var className = this.getClassName(scriptName);
		return this.getClass(className) == null;
	};
    this.registerClass = function(className, clazz) {
    	if(!this.classes[className]) {
      		this.addClass(className, clazz);
    	}
		return clazz;
	};
};
	
com.ebay.widgets.PackageStats = function(clazz) {
	this.base = clazz;
	this.count = 0;
};

com.ebay.widgets.createPackage = function(clz, base) {
	var names = clz.split('.');
	var len = names.length;
	var pkg = window;
	for (var i = 0; i < len - 1 && pkg && names[i];++i){
		if(!pkg[names[i]]) {
			pkg[names[i]] = new com.ebay.widgets.PackageManager(pkg, names[i]);
		} 
		pkg = pkg[names[i]];
	}
	return pkg.registerClass(names[len - 1], base);
};

com.ebay.widgets.getClass = function(clz) {
	var names = clz.split('.');
	var len = names.length;
	var pkg = window;
	for (var i = 0; i < len - 1 && pkg && names[i];++i){ 
		pkg = pkg[names[i]];
	}
	return pkg.getClass(names[len - 1]);
};

com.ebay.widgets.extendMethod = function (clz,method,name) {
	clz.prototype.base[name] = function() {
		var m = (this.parent.superinst) ? this.parent.superinst[name] : method;
		return m.apply(this.parent,arguments);
	};
};

com.ebay.widgets.createClass = function (clz) {
	var base = function() {
		if (this.superclz) {
			var fn = function(){};
			fn.prototype = this.superclz.prototype;
			this.superinst = new fn();
		}
		if (this.base) {
			this.base.parent = this;
		}
		if (this.constructs) {
			this.constructs.apply(this,arguments);
		}
	};
	base.props = function (obj) {
		for (var i in obj) {	
			if (i!='props' && i!='methods' && i!='inherits' && i!='prototype' && i!='inits') {
				base[i] = obj[i];
			}
		}
		return base;
	};
	base.methods = function (obj, bExtend) {
		
		function copyProps(i) {
			if (i!='superclz' && i!='superinst' && i!='base' && (!bExtend||i!='constructs')) {
				if (bExtend && typeof obj[i] == 'function') {
					com.ebay.widgets.extendMethod(base,obj[i],i);
				}
				if (!bExtend && !base.prototype[i] && base.prototype.base && base.prototype.base[i]) {
					base.prototype[i] = function () {
						base.prototype.base[i].apply(this,arguments);
					};
				} else {
					base.prototype[i] = obj[i];	
				}
			}
		}
		
		for (var i in obj) {
			copyProps(i);
		}

		if(obj.toString!=={}.toString){ 
                      copyProps('toString');
		}

		return base;
	};
	base.inherits = function (supClass) { //check order if inherits is called after proto or props
		var type = com.ebay.widgets.getClass(supClass);
		base.prototype.superclz = type;
		base.prototype.base =  function () {
			if (!this.superinst) {
				var fn = function(){};
				fn.prototype = this.superclz.prototype;
				this.superinst = new fn();
			}
			if (this.superinst.constructs) {
				this.superinst.constructs.apply(this,arguments);
			}
		};
		base.methods(type.prototype,true);
		base.props(type);
		return base;
	};
	base.inits = function (func) {
		var self = com.ebay.widgets.getClass(clz);
		func.call(self);
		return self;
	};
	return com.ebay.widgets.createPackage(clz, base);
};

com.ebay.widgets.log = function(message) {
	var logWindow = null;
    if (!logWindow || logWindow.closed) {
		logWindow = window.open("", null, "width=800,height=200," +
                              "scrollbars=yes,resizable=yes,status=no," +
                              "location=no,menubar=no,toolbar=no");
        if (!logWindow) {
			return;
		}
        var doc = logWindow.document;
        doc.write("<html><head><title>Debug Log</title></head>" +
                  "<body></body></html>");
        doc.close();
    }
	com.ebay.widgets.log = function(message) {
	    var logLine = logWindow.document.createElement("div");
	    logLine.appendChild(logWindow.document.createTextNode(message));
	    logWindow.document.body.appendChild(logLine);
	};
	return com.ebay.widgets.log(message);
};

if(!String.prototype.isDigit) {
	String.prototype.isDigit=function(i){
		return (this[i] >= '0' && this[i] <= '9');
	};
}

if(!String.prototype.trim) {
	String.prototype.trim = function() {
		return this.replace(/^\s+/,'').replace(/\s+$/,'');
	};
}

if(!String.prototype.removeWS) {
	String.prototype.removeWS = function() {
		return this.replace(/\t/g," ").replace(/\s+/g, " ");
	};
}

if(!Date.prototype.fromISO8601) {	
	Date.prototype.fromISO8601 = function(formattedString) {
		var regEx = /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;
		var match = regEx.exec(formattedString);
		var result = null;
		if(match){
			match.shift();
			if(match[1]){ 
			  match[1]--;
			} 
			if(match[6]) { 
			  match[6] *= 1000;
			} 
			result = new Date(match[0]||1970, match[1]||0, match[2]||0, match[3]||0, match[4]||0, match[5]||0, match[6]||0);
			var offset = 0;
			var zoneSign = match[7] && match[7].charAt(0);
			if(zoneSign != 'Z'){
				offset = ((match[8] || 0) * 60) + (Number(match[9]) || 0);
				if(zoneSign != '-'){ offset *= -1; }
			}
			if(zoneSign){
				offset -= result.getTimezoneOffset();
			}
			if(offset){
				result.setTime(result.getTime() + offset * 60000);
			}
		}
		return result;
	};
}
if(!Date.prototype.toISO8601) {	
	Date.prototype.toISO8601 = function() {
		var zeropad = function (num) { return ((num < 10) ? '0' : '') + num;};
		var zeropad2 = function (num) {
			if (num < 10) {return ('00' + num);}
		    if (num < 100) {return ('0' + num);}
			return '' + num;
		};
		var str = "";
		str += this.getUTCFullYear();
		str += "-" + zeropad(this.getUTCMonth() + 1); 
		str += "-" + zeropad(this.getUTCDate());
		str += "T" + zeropad(this.getUTCHours()); 
		str += ":" + zeropad(this.getUTCMinutes());
		str += ":" + zeropad(this.getUTCSeconds());
		str += "." + zeropad2(this.getUTCMilliseconds());
		str += "Z";
		return str;
	};
}					

if(!Array.prototype.copy) {
	Array.prototype.copy = function() {
		var a = [];
		for (var i=0;i<this.length;i++) { a.push(this[i]); }
		return a;
	};
}

if(!Array.prototype.find) {
	Array.prototype.find = function(str) {
		var index = -1;
		for (var i=0;i<this.length;i++) {
			if (this[i] == str) { 
				index = i; 
			}
		}
		return index;
	};
}

if(!Array.prototype.append) {
	Array.prototype.append = function(arr) {
		var a = arr;
		if (!(arr instanceof Array)) { a = [arr]; }
		for (var i=0;i<a.length;i++) { this.push(a[i]); }
	};
}

if(!Array.prototype.toHashSet) {
	Array.prototype.toHashSet = function() {
		var set = {};
		for(var i = 0; i < this.length; ++i) {
			var entry = this[i];
			if(com.ebay.widgets.typeOf(entry) != 'function') {
				set[entry] = entry;
			}

		}
		return set;
	}
}
com.ebay.widgets.createClass('com.ebay.shoppingservice.Shopping')
.methods({
  constructs: function (config) {
    this.config=config;
    this.protocol='XSS';
    this.version="529";
    this.location=gShoppingAppUrl?gShoppingAppUrl:"http://open.api.ebay.com/shopping";
  },
  buildArgs: function(inputObject, methodName, callbackname, scriptNode) {
    var args = {
      src: this.location + '?callname=' + methodName + '&callbackname=' + callbackname + '&responseencoding=JSON&callback=true' + '&version=' + this.version
    };
    for(var configProp in this.config) {
      if(this.config.hasOwnProperty(configProp) && this.config[configProp] !== undefined && this.config[configProp] !== null && configProp !== 'superinst' && configProp !== 'constructs') {
        var configValue = this.config[configProp];
        if(configValue) {
          args.src += com.ebay.shoppingservice.Utils.convertToArgs(configProp, encodeURIComponent(configValue));
        }
      }
    }
    for(var prop in inputObject) {
      if(inputObject.hasOwnProperty(prop) && inputObject[prop] !== undefined && inputObject[prop] !== null && prop !== 'superinst' && prop !== 'constructs') {
        var firstChar = prop.charAt(0).toUpperCase();
        var name = firstChar + prop.substring(1);
        var value = inputObject[prop];
        if(value) {
          args.src += com.ebay.shoppingservice.Utils.convertToArgs(name, value);
        }
      }
    }
    args.src += '&client=js';
    var asrc = args.src.replace(/%26/g,'&amp;');
    args.src = asrc;
    return args;
  },
  findHalfProducts:  function(findHalfProductsRequest, callback) {
    var findHalfProductsClosure = function(callback, request, findHalfProductsClosureRef) {
      return function() {
        var rargs = arguments;
        var findHalfProductsResponse = new com.ebay.shoppingservice.FindHalfProductsResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[findHalfProductsClosureRef] = null;
        var ack = findHalfProductsResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, findHalfProductsResponse.errors) : callback.success.call(callback.object, findHalfProductsResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var findHalfProductsClosureRef = 'findHalfProductsClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[findHalfProductsClosureRef] = findHalfProductsClosure(callback, request, findHalfProductsClosureRef);
    var args = this.buildArgs(findHalfProductsRequest, 'FindHalfProducts', 'com.ebay.shoppingservice.Shopping.' + findHalfProductsClosureRef, request.node);
    request.send(args.src);
    return args.src;
  },
  findItems:  function(findItemsRequest, callback) {
    var findItemsClosure = function(callback, request, findItemsClosureRef) {
      return function() {
        var rargs = arguments;
        var findItemsResponse = new com.ebay.shoppingservice.FindItemsResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[findItemsClosureRef] = null;
        var ack = findItemsResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, findItemsResponse.errors) : callback.success.call(callback.object, findItemsResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var findItemsClosureRef = 'findItemsClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[findItemsClosureRef] = findItemsClosure(callback, request, findItemsClosureRef);
    var args = this.buildArgs(findItemsRequest, 'FindItems', 'com.ebay.shoppingservice.Shopping.' + findItemsClosureRef, request.node);
    request.send(args.src);
    return args.src;
  },
  findItemsAdvanced:  function(findItemsAdvancedRequest, callback) {
    var findItemsAdvancedClosure = function(callback, request, findItemsAdvancedClosureRef) {
      return function() {
        var rargs = arguments;
        var findItemsAdvancedResponse = new com.ebay.shoppingservice.FindItemsAdvancedResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[findItemsAdvancedClosureRef] = null;
        var ack = findItemsAdvancedResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, findItemsAdvancedResponse.errors) : callback.success.call(callback.object, findItemsAdvancedResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var findItemsAdvancedClosureRef = 'findItemsAdvancedClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[findItemsAdvancedClosureRef] = findItemsAdvancedClosure(callback, request, findItemsAdvancedClosureRef);
    var args = this.buildArgs(findItemsAdvancedRequest, 'FindItemsAdvanced', 'com.ebay.shoppingservice.Shopping.' + findItemsAdvancedClosureRef, request.node);
    request.send(args.src);
    return args.src;
  },
  findProducts:  function(findProductsRequest, callback) {
    var findProductsClosure = function(callback, request, findProductsClosureRef) {
      return function() {
        var rargs = arguments;
        var findProductsResponse = new com.ebay.shoppingservice.FindProductsResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[findProductsClosureRef] = null;
        var ack = findProductsResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, findProductsResponse.errors) : callback.success.call(callback.object, findProductsResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var findProductsClosureRef = 'findProductsClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[findProductsClosureRef] = findProductsClosure(callback, request, findProductsClosureRef);
    var args = this.buildArgs(findProductsRequest, 'FindProducts', 'com.ebay.shoppingservice.Shopping.' + findProductsClosureRef, request.node);
    request.send(args.src);
    return args.src;
  },
  getItemStatus:  function(getItemStatusRequest, callback) {
    var getItemStatusClosure = function(callback, request, getItemStatusClosureRef) {
      return function() {
        var rargs = arguments;
        var getItemStatusResponse = new com.ebay.shoppingservice.GetItemStatusResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[getItemStatusClosureRef] = null;
        var ack = getItemStatusResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, getItemStatusResponse.errors) : callback.success.call(callback.object, getItemStatusResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var getItemStatusClosureRef = 'getItemStatusClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[getItemStatusClosureRef] = getItemStatusClosure(callback, request, getItemStatusClosureRef);
    var args = this.buildArgs(getItemStatusRequest, 'GetItemStatus', 'com.ebay.shoppingservice.Shopping.' + getItemStatusClosureRef, request.node);
    request.send(args.src);
    return args.src;
  },
  getMultipleItems:  function(getMultipleItemsRequest, callback) {
    var getMultipleItemsClosure = function(callback, request, getMultipleItemsClosureRef) {
      return function() {
        var rargs = arguments;
        var getMultipleItemsResponse = new com.ebay.shoppingservice.GetMultipleItemsResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[getMultipleItemsClosureRef] = null;
        var ack = getMultipleItemsResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, getMultipleItemsResponse.errors) : callback.success.call(callback.object, getMultipleItemsResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var getMultipleItemsClosureRef = 'getMultipleItemsClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[getMultipleItemsClosureRef] = getMultipleItemsClosure(callback, request, getMultipleItemsClosureRef);
    var args = this.buildArgs(getMultipleItemsRequest, 'GetMultipleItems', 'com.ebay.shoppingservice.Shopping.' + getMultipleItemsClosureRef, request.node);
    request.send(args.src);
    return args.src;
  },
  getShippingCosts:  function(getShippingCostsRequest, callback) {
    var getShippingCostsClosure = function(callback, request, getShippingCostsClosureRef) {
      return function() {
        var rargs = arguments;
        var getShippingCostsResponse = new com.ebay.shoppingservice.GetShippingCostsResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[getShippingCostsClosureRef] = null;
        var ack = getShippingCostsResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, getShippingCostsResponse.errors) : callback.success.call(callback.object, getShippingCostsResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var getShippingCostsClosureRef = 'getShippingCostsClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[getShippingCostsClosureRef] = getShippingCostsClosure(callback, request, getShippingCostsClosureRef);
    var args = this.buildArgs(getShippingCostsRequest, 'GetShippingCosts', 'com.ebay.shoppingservice.Shopping.' + getShippingCostsClosureRef, request.node);
    request.send(args.src);
    return args.src;
  },
  getSingleItem:  function(getSingleItemRequest, callback) {
    var getSingleItemClosure = function(callback, request, getSingleItemClosureRef) {
      return function() {
        var rargs = arguments;
        var getSingleItemResponse = new com.ebay.shoppingservice.GetSingleItemResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[getSingleItemClosureRef] = null;
        var ack = getSingleItemResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, getSingleItemResponse.errors) : callback.success.call(callback.object, getSingleItemResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var getSingleItemClosureRef = 'getSingleItemClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[getSingleItemClosureRef] = getSingleItemClosure(callback, request, getSingleItemClosureRef);
    var args = this.buildArgs(getSingleItemRequest, 'GetSingleItem', 'com.ebay.shoppingservice.Shopping.' + getSingleItemClosureRef, request.node);
    request.send(args.src);
    return args.src;
  },
  getUserProfile:  function(getUserProfileRequest, callback) {
    var getUserProfileClosure = function(callback, request, getUserProfileClosureRef) {
      return function() {
        var rargs = arguments;
        var getUserProfileResponse = new com.ebay.shoppingservice.GetUserProfileResponseType(rargs[0]);
        request.node.parentNode.removeChild(request.node);
        com.ebay.shoppingservice.Shopping[getUserProfileClosureRef] = null;
        var ack = getUserProfileResponse.ack;
        return (ack == 'Failure' && callback.failure) ? callback.failure.call(callback.object, getUserProfileResponse.errors) : callback.success.call(callback.object, getUserProfileResponse);
      };
    };
    var request = com.ebay.widgets.io.Factory.getTransport(this.protocol);
    var getUserProfileClosureRef = 'getUserProfileClosure' + com.ebay.shoppingservice.Shopping.callbackCount++;
    com.ebay.shoppingservice.Shopping[getUserProfileClosureRef] = getUserProfileClosure(callback, request, getUserProfileClosureRef);
    var args = this.buildArgs(getUserProfileRequest, 'GetUserProfile', 'com.ebay.shoppingservice.Shopping.' + getUserProfileClosureRef, request.node);
    request.send(args.src);
    return args.src;
  }
})
.props({
  callbackCount:0,
  findHalfProducts: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.HalfItemConditionCodeType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.DistanceType',
    'com.ebay.shoppingservice.StorefrontType',
    'com.ebay.shoppingservice.DigitalDeliveryMethodCodeType',
    'com.ebay.shoppingservice.CharityType',
    'com.ebay.shoppingservice.ListingStatusCodeType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.UserStatusCodeType',
    'com.ebay.shoppingservice.SiteCodeType',
    'com.ebay.shoppingservice.FeedbackRatingStarCodeType',
    'com.ebay.shoppingservice.SimpleUserType',
    'com.ebay.shoppingservice.BuyerPaymentMethodCodeType',
    'com.ebay.shoppingservice.ListingTypeCodeType',
    'com.ebay.shoppingservice.SimpleItemType',
    'com.ebay.shoppingservice.SimpleItemArrayType',
    'com.ebay.shoppingservice.NameValueListType',
    'com.ebay.shoppingservice.NameValueListArrayType',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.ShippingTypeCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',
    'com.ebay.shoppingservice.AmountType',
    'com.ebay.shoppingservice.ShippingCostSummaryType',
    'com.ebay.shoppingservice.HalfCatalogProductType',
    'com.ebay.shoppingservice.HalfProductsType',
    'com.ebay.shoppingservice.HistogramEntryType',
    'com.ebay.shoppingservice.DomainHistogramType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.FindHalfProductsResponseType',
    'com.ebay.shoppingservice.SortOrderCodeType',
    'com.ebay.shoppingservice.ProductSortCodeType',
    'com.ebay.shoppingservice.ProductIDCodeType',
    'com.ebay.shoppingservice.ProductIDType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.FindHalfProductsRequestType',
    'com.ebay.shoppingservice.Utils'
  ],
  findItems: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.HalfItemConditionCodeType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.DistanceType',
    'com.ebay.shoppingservice.StorefrontType',
    'com.ebay.shoppingservice.DigitalDeliveryMethodCodeType',
    'com.ebay.shoppingservice.CharityType',
    'com.ebay.shoppingservice.ListingStatusCodeType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.UserStatusCodeType',
    'com.ebay.shoppingservice.SiteCodeType',
    'com.ebay.shoppingservice.FeedbackRatingStarCodeType',
    'com.ebay.shoppingservice.SimpleUserType',
    'com.ebay.shoppingservice.BuyerPaymentMethodCodeType',
    'com.ebay.shoppingservice.ListingTypeCodeType',
    'com.ebay.shoppingservice.SimpleItemType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.FindItemsResponseType',
    'com.ebay.shoppingservice.SortOrderCodeType',
    'com.ebay.shoppingservice.SimpleItemSortCodeType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.FindItemsRequestType',
    'com.ebay.shoppingservice.Utils'
  ],
  findItemsAdvanced: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.CategoryType',
    'com.ebay.shoppingservice.CategoryArrayType',
    'com.ebay.shoppingservice.HalfItemConditionCodeType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.DistanceType',
    'com.ebay.shoppingservice.StorefrontType',
    'com.ebay.shoppingservice.DigitalDeliveryMethodCodeType',
    'com.ebay.shoppingservice.CharityType',
    'com.ebay.shoppingservice.ListingStatusCodeType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.UserStatusCodeType',
    'com.ebay.shoppingservice.SiteCodeType',
    'com.ebay.shoppingservice.FeedbackRatingStarCodeType',
    'com.ebay.shoppingservice.SimpleUserType',
    'com.ebay.shoppingservice.BuyerPaymentMethodCodeType',
    'com.ebay.shoppingservice.ListingTypeCodeType',
    'com.ebay.shoppingservice.SimpleItemType',
    'com.ebay.shoppingservice.SimpleItemArrayType',
    'com.ebay.shoppingservice.SearchResultType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.FindItemsAdvancedResponseType',
    'com.ebay.shoppingservice.PreferredLocationCodeType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',
    'com.ebay.shoppingservice.QuantityOperatorCodeType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.StoreSearchCodeType',
    'com.ebay.shoppingservice.PaymentMethodSearchCodeType',
    'com.ebay.shoppingservice.SearchFlagCodeType',
    'com.ebay.shoppingservice.ItemConditionCodeType',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.ShippingTypeCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',	
    'com.ebay.shoppingservice.ShippingCostSummaryType',		
    'com.ebay.shoppingservice.AmountType',
    'com.ebay.shoppingservice.ProductIDCodeType',
    'com.ebay.shoppingservice.ProductIDType',
    'com.ebay.shoppingservice.ItemTypeCodeType',
    'com.ebay.shoppingservice.SortOrderCodeType',
    'com.ebay.shoppingservice.SimpleItemSortCodeType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.FindItemsAdvancedRequestType',
    'com.ebay.shoppingservice.Utils'
  ],
  findProducts: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.NameValueListType',
    'com.ebay.shoppingservice.NameValueListArrayType',
    'com.ebay.shoppingservice.CatalogProductType',
    'com.ebay.shoppingservice.HalfItemConditionCodeType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.DistanceType',
    'com.ebay.shoppingservice.StorefrontType',
    'com.ebay.shoppingservice.DigitalDeliveryMethodCodeType',
    'com.ebay.shoppingservice.CharityType',
    'com.ebay.shoppingservice.ListingStatusCodeType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.UserStatusCodeType',
    'com.ebay.shoppingservice.SiteCodeType',
    'com.ebay.shoppingservice.FeedbackRatingStarCodeType',
    'com.ebay.shoppingservice.SimpleUserType',
    'com.ebay.shoppingservice.BuyerPaymentMethodCodeType',
    'com.ebay.shoppingservice.ListingTypeCodeType',
    'com.ebay.shoppingservice.SimpleItemType',
    'com.ebay.shoppingservice.SimpleItemArrayType',
    'com.ebay.shoppingservice.HistogramEntryType',
    'com.ebay.shoppingservice.DomainHistogramType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.FindProductsResponseType',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.ShippingTypeCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',	
    'com.ebay.shoppingservice.ShippingCostSummaryType',		
    'com.ebay.shoppingservice.AmountType',	
    'com.ebay.shoppingservice.SortOrderCodeType',
    'com.ebay.shoppingservice.ProductSortCodeType',
    'com.ebay.shoppingservice.ProductIDCodeType',
    'com.ebay.shoppingservice.ProductIDType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.FindProductsRequestType',
    'com.ebay.shoppingservice.Utils'
  ],
  getItemStatus: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.HalfItemConditionCodeType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.DistanceType',
    'com.ebay.shoppingservice.StorefrontType',
    'com.ebay.shoppingservice.DigitalDeliveryMethodCodeType',
    'com.ebay.shoppingservice.CharityType',
    'com.ebay.shoppingservice.ListingStatusCodeType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.UserStatusCodeType',
    'com.ebay.shoppingservice.SiteCodeType',
    'com.ebay.shoppingservice.FeedbackRatingStarCodeType',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.ShippingTypeCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',	
    'com.ebay.shoppingservice.ShippingCostSummaryType',		
    'com.ebay.shoppingservice.AmountType',	
    'com.ebay.shoppingservice.SimpleUserType',
    'com.ebay.shoppingservice.BuyerPaymentMethodCodeType',
    'com.ebay.shoppingservice.ListingTypeCodeType',
    'com.ebay.shoppingservice.SimpleItemType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.GetItemStatusResponseType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.GetItemStatusRequestType',
    'com.ebay.shoppingservice.Utils'
  ],
  getMultipleItems: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.HalfItemConditionCodeType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.DistanceType',
    'com.ebay.shoppingservice.StorefrontType',
    'com.ebay.shoppingservice.DigitalDeliveryMethodCodeType',
    'com.ebay.shoppingservice.CharityType',
    'com.ebay.shoppingservice.ListingStatusCodeType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.UserStatusCodeType',
    'com.ebay.shoppingservice.SiteCodeType',
    'com.ebay.shoppingservice.FeedbackRatingStarCodeType',
    'com.ebay.shoppingservice.SimpleUserType',
    'com.ebay.shoppingservice.BuyerPaymentMethodCodeType',
    'com.ebay.shoppingservice.ListingTypeCodeType',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.ShippingTypeCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',	
    'com.ebay.shoppingservice.ShippingCostSummaryType',		
    'com.ebay.shoppingservice.AmountType',	
    'com.ebay.shoppingservice.SimpleItemType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.GetMultipleItemsResponseType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.GetMultipleItemsRequestType',
    'com.ebay.shoppingservice.Utils'
  ],
  getShippingCosts: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.ShippingTypeCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',
    'com.ebay.shoppingservice.AmountType',
    'com.ebay.shoppingservice.ShippingCostSummaryType',
    'com.ebay.shoppingservice.TaxJurisdictionType',
    'com.ebay.shoppingservice.TaxTableType',
    'com.ebay.shoppingservice.ShippingServiceOptionType',
    'com.ebay.shoppingservice.SalesTaxType',
    'com.ebay.shoppingservice.InternationalShippingServiceOptionType',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',
    'com.ebay.shoppingservice.AmountType',
    'com.ebay.shoppingservice.ShippingDetailsType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.GetShippingCostsResponseType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.GetShippingCostsRequestType',
    'com.ebay.shoppingservice.Utils'
  ],
  getSingleItem: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.HalfItemConditionCodeType',
    'com.ebay.shoppingservice.CountryCodeType',
    'com.ebay.shoppingservice.DistanceType',
    'com.ebay.shoppingservice.StorefrontType',
    'com.ebay.shoppingservice.DigitalDeliveryMethodCodeType',
    'com.ebay.shoppingservice.CharityType',
    'com.ebay.shoppingservice.ListingStatusCodeType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.UserStatusCodeType',
    'com.ebay.shoppingservice.SiteCodeType',
    'com.ebay.shoppingservice.FeedbackRatingStarCodeType',
    'com.ebay.shoppingservice.SimpleUserType',
    'com.ebay.shoppingservice.BuyerPaymentMethodCodeType',
    'com.ebay.shoppingservice.ListingTypeCodeType',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.ShippingTypeCodeType',
    'com.ebay.shoppingservice.CurrencyCodeType',	
    'com.ebay.shoppingservice.ShippingCostSummaryType',		
    'com.ebay.shoppingservice.AmountType',	
    'com.ebay.shoppingservice.SimpleItemType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.GetSingleItemResponseType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.GetSingleItemRequestType',
    'com.ebay.shoppingservice.Utils'
  ],
  getUserProfile: [
    'com.ebay.widgets.util.Duration',
    'com.ebay.widgets.io.Factory',
    'com.ebay.widgets.io.XSSRequest',
    'com.ebay.widgets.io.XHRRequest',
    'com.ebay.shoppingservice.ShoppingConfig',
    'com.ebay.shoppingservice.ShoppingCallback',
    'com.ebay.shoppingservice.CurrencyCodeType',
    'com.ebay.shoppingservice.InsuranceOptionCodeType',
    'com.ebay.shoppingservice.ShippingTypeCodeType',	
    'com.ebay.shoppingservice.ShippingCostSummaryType',		
    'com.ebay.shoppingservice.AmountType',	
    'com.ebay.shoppingservice.AmountType',
    'com.ebay.shoppingservice.TradingRoleCodeType',
    'com.ebay.shoppingservice.CommentTypeCodeType',
    'com.ebay.shoppingservice.FeedbackDetailType',
    'com.ebay.shoppingservice.FeedbackRatingDetailCodeType',
    'com.ebay.shoppingservice.AverageRatingDetailsType',
    'com.ebay.shoppingservice.FeedbackPeriodType',
    'com.ebay.shoppingservice.FeedbackHistoryType',
    'com.ebay.shoppingservice.SellerBusinessCodeType',
    'com.ebay.shoppingservice.UserStatusCodeType',
    'com.ebay.shoppingservice.SiteCodeType',
    'com.ebay.shoppingservice.FeedbackRatingStarCodeType',
    'com.ebay.shoppingservice.SimpleUserType',
    'com.ebay.shoppingservice.ErrorClassificationCodeType',
    'com.ebay.shoppingservice.ErrorParameterType',
    'com.ebay.shoppingservice.SeverityCodeType',
    'com.ebay.shoppingservice.ErrorType',
    'com.ebay.shoppingservice.AckCodeType',
    'com.ebay.shoppingservice.AbstractResponseType',
    'com.ebay.shoppingservice.GetUserProfileResponseType',
    'com.ebay.shoppingservice.AbstractRequestType',
    'com.ebay.shoppingservice.GetUserProfileRequestType',
    'com.ebay.shoppingservice.Utils'
  ]
});
