function OodlePublisherWidget(width, height, widgetType, widgetName, host)
{
	if (!width || !height || !widgetType || !widgetName) { return; }
	this.width = width;
	this.height = height;
	this.widgetType = widgetType;
	this.widgetName = widgetName;
	this.host = (host == null) ? 'www.oodle.com' : host;
	this.param = new Array();
	this.param['origin'] = 'widget';
}

OodlePublisherWidget.prototype.assembleurl = function()
{
	var url = 'http://' + this.host + '/widget/publisher/';

	if (this.widgetType == 'design')
		url += 'design?wd=' + this.widgetName;
	else 
		url += 'placement?wp=' + this.widgetName;

	for(var p in this.param)
		url += '&' + p + '=' + encodeURIComponent(this.param[p]);

	return url;
}

OodlePublisherWidget.prototype.render = function()
{
	url = this.assembleurl();
	document.write('<iframe width="' + this.width + '" height="' + this.height + '" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" hspace="0" vspace="0" name="oodle_widget" src="' + url + '"></iframe>');
}
