function Punkt(x,y,e)
{
    this.x = x;
    this.y = y;
    this.element = e;   
}

//----
function MyImage(i,url)
{
    this.id = i;
    this.punkty = new Array();   
    this.imageUrl = url;
    this.left=null;
    this.right=null;
    this.up=null;
    this.down=null;
    this.anaglyph=null;
    this.notanaglyph=null;
    
    this.image60 = url.substring(0,url.lastIndexOf("/")) + "/tn/tn60_" + url.substring(url.lastIndexOf("/")+1);
    this.image300 = url.substring(0,url.lastIndexOf("/")) + "/tn/tn300_" + url.substring(url.lastIndexOf("/")+1);    
    
}
function MyElement(i, n, img1, desc)
{
    this.id = i;
    this.name = n;
    this.imageUrl = img1;
    this.description = desc;
}
//-----
function addPoint(Punkt)
{
    with(this)
    {
        punkty.push(Punkt);
    }    
}
/*
* left,right,up,down,anaglyph
*/
function setNeighbors(l,r,u,d,a,na)
{
    with(this)
    {
        left = l;
        right = r;
        up = u;
        down = d;
        anaglyph = a;
        notanaglyph = na;
    }    
}
MyImage.prototype.addPoint = addPoint;
MyImage.prototype.setNeighbors = setNeighbors;

function getMyImageById(id,array)
{
    for(var i=0;i<array.length;i++)
    {
        if(array[i].id == id)
            return array[i];
    }
    return undefined;
}
