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];

	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" scrolling="no" marginwidth="0" marginheight="0" hspace="0" vspace="0" name="oodle_listings_widget" src="' + url + '"></iframe>');
};
