﻿ImageKontrol = function(obj,PN) 
{
    this.pn=PN;
    this.image = obj;
    this.name = obj.name;
    this.link = this.image.tag.substr(2);
    this.setevents(obj);
}
ImageKontrol.prototype.setevents = function(obj,active)
{
    if (this.link)
	{
	    this.token1 = this.image.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.OnImageClick));
	    this.token2 = this.image.addEventListener("mouseEnter", onHC);
	    this.token3 = this.image.addEventListener("mouseLeave", offHC);
    }
}
ImageKontrol.prototype.OnImageClick = function()
{
    window.open(this.link);
    SendLog(21, this.image.name);
}
ImageKontrol.prototype.release = function() {
    if (this.link) {
        this.image.RemoveEventListener("MouseLeftButtonDown", this.token1);
        this.image.RemoveEventListener("MouseEnter", this.token2);
        this.image.RemoveEventListener("mouseLeave", this.token3);
    }
}