﻿// Constructor
ep_eventGadget=function(filter)
{
	this.date = new Date();
	this.month = this.getVar("month");
	if (!this.month)
		this.month = this.date.getMonth() +1;

	this.year = this.getVar("year");
	if (!this.year)
		this.year = this.date.getFullYear();
	
	this.params = "month=" + this.month + "&year=" + this.year + "&filter=" + filter + "&refresh=" + new Date().getTime();
	
	this.render='<iframe src="gadgets/core.html?' + this.params + '" style="width:205px;height:18em;" frameborder="0" scrolling="no"></iframe>';
	
	document.write(this.render);

}

ep_eventGadget.prototype.getVar=function(name)
{
	this.params = document.location.search.substring(1).split("&");
	this.length = this.params.length;
	this.response=null;
	
	this.bits;
	
	for (this.i=0;this.i<this.length;this.i++) {
		this.bits = this.params[this.i].split("=");
		if (this.bits[0] == name)
			this.response = this.bits[1];
	}
	
	return this.response;
}
