/*
	gRSS
	display RSS Ajax
	design by http://www.goragod.com (goragod wiriya)
	25-8-52
*/

gRSS = GClass.create();
gRSS.prototype = {
	initialize: function(feedurl,options) {
		this.feed =  feedurl;
		this.options = {
			rows: 2,
			cols: 2,
			imageWidth: 75,
			imageHeight: 75,
			className: 'table_rss_class',
			reader: 'widgets/rss/reader.php',
			topiclen: 20,
			detaillen: 90
		};
		Object.extend(this.options,options || { });
	},

	show: function(div, interval){
		var query = 'url=' + this.feed;
		query += '&rows=' + this.options.rows;
		query += '&cols=' + this.options.cols;
		query += '&imageWidth=' + this.options.imageWidth;
		query += '&imageHeight=' + this.options.imageHeight;
		query += '&className=' + this.options.className;
		query += '&topiclen=' + this.options.topiclen;
		query += '&detaillen=' + this.options.detaillen;
		var _callback = function(xhr){
			$E(div).innerHTML = xhr.responseText;
		};
		if(parseFloat(interval) == 0){
			new GAjax().send(this.options.reader, query, _callback);
		}else{
			new GAjax().autoupdate(this.options.reader, interval, query, _callback);
		};
	}
}