if(typeof mny == "undefined") var mny = new Object();
mny.imgswap = function () {
    if (!document.getElementById) {return;}
}
mny.imgswap.prototype = {
    register: function(id,data,selCName,unselCName) {
	if (!(this.chart=document.getElementById(id))) this.chart=null;
	this.selCName=selCName;
	this.unselCName=unselCName;
	var thisObj = this;
    	for (id in data) {
    		//alert(id)
    	    var btn = document.getElementById(id);
    	    btn.onmouseover = function () {thisObj.lit(this)};
    	    btn.onmouseout  = function () {thisObj.clear(this)};
    	    btn.onmouseup   = function () {thisObj.swap(this)};
    	    if (btn.className==this.selCName) this.current=btn;
       	}
	this.data=data;
    },
    swap : function (tg) {
	var d = new Date();
    	this.current = tg;
    	this.current.className = this.selCName;
	this.chart.parentNode.href=this.data[tg.id]['link'];
//	this.chart.src=this.data[tg.id]['img']+'?'+d.getHours()+d.getMinutes();
	this.chart.src=this.data[tg.id]['img'];
    },
    lit : function (tg) {
       	this.current.className = this.unselCName;
       	tg.className = this.selCName;
    },
    clear : function (tg) {		
       	tg.className = this.unselCName;
       	this.current.className = this.selCName;
    }
}