function OodleListingsWidget()
{
	this.host = "www.oodle.com";
	this.path = "/browse/?results=1";
	this.type = '728x120_basic';
	this.borderColor = "#ffffff";
	this.backgroundColor = "#ffffff";
	this.linkColor = "#0000ff";
	this.font = "Arial";
	this.title = '';
}

OodleListingsWidget.prototype.render = function()
{
	// parse "type" value for dimensions
	var re = /^(\d+)x(\d+)_\w+$/;
	var match = re.exec(this.type);
	if (match == null) throw "Invalid type: " + this.type;
	var width = match[1];
	var height = match[2];

	if (!((width == 728 && height == 120) ||
	    (width == 160 && height == 600) ||
		(width == 160 && height == 160))) throw "Invalid dimenions: " + width + "x" + height;
	
	var url = "http://" + this.host;
	url += "/widget/listings?";
	url += "path=" + encodeURIComponent(this.path);
	url += "&type=" + encodeURIComponent(this.type);
	url += "&titlecolor=" + encodeURIComponent(this.titleColor);
	url += "&titlebgcolor=" + encodeURIComponent(this.titleBgColor);
	url += "&linkcolor=" + encodeURIComponent(this.linkColor);
	url += "&font=" + encodeURIComponent(this.font);
	url += "&title=" + encodeURIComponent(this.title);
	if (this.partner) url += "&partner=" + encodeURIComponent(this.partner);
	if (this.userid) url += "&userid=" + encodeURIComponent(this.userid);
	if (this.paid) url += "&paid=1";
	if (this.thumbs) url += "&thumbs=1";
	if (this.landingpage) url += "&landingpage=1";

	document.write('<iframe width="' + width + '" height="' + height + '" frameborder="0" style="overflow:hidden;border:1px solid ' + this.borderColor + '" scrolling="no" marginwidth="0" marginheight="0" src="' + url + '"></iframe>');
};

