var poiAlpha = {
  pin_width: 100,
  id: "Poi01",
  img: null,
  type: "GENERIC",
  cat: 'FF',
  pin: function(){
  },
  isFixed: function(){
    return (this.cat=='FI'||this.cat=='UD');
  },
  isOverlappedToPoi: function(poi){
    var rec1 = [poi.x,poi.y,poi.x+this.pin_width,poi.y+this.pin_width];
    var rec2 = [this.x,this.y,this.x+this.pin_width,this.y+this.pin_width];
    return this.isOverlapped(rec1);
  },
  isOverlapped: function(rec1){
    var rec2 = [this.x,this.y,this.x+this.pin_width,this.y+this.pin_width];
  // check if either rectangle is actually a line
        if (rec1[0] == rec1[2] || rec1[1] == rec1[3] ||
            rec2[0] == rec2[2] || rec2[1] == rec2[3]) {
            // the line cannot have positive overlap
            return false;
        }

        return !(rec1[2] <= rec2[0] ||   // left
                 rec1[3] <= rec2[1] ||   // bottom
                 rec1[0] >= rec2[2] ||   // right
                 rec1[1] >= rec2[3]);    // top
  }

};

var pois=[];

//Types
//  - "I": immagine
//  - "T": Testo/html
//  - "V": Video

//Cat(egories):
// - "FI": FIume (Position Fixed)
// - "FL": FLora
// - "FI": FAuna
// - "UD": UDatinos (Position Fixed)



var poi=Object.create(poiAlpha);
//-----------
// FIUME
//-----------
 
    //0
    poi.x = 346;
    poi.y = 332;
    poi.id = "First One";
    poi.type = 'I'; //looking for "asset/I_0.jpg"
    poi.cat = 'FI'
    pois.push(poi);

    //1
    poi=Object.create(poiAlpha);
    poi.x= 746;
    poi.y= 432;
    poi.id="Two";
    poi.type = 'V'; //looking for "asset/V_1.mp4"
    poi.cat = 'FI'
    pois.push(poi);

    //2
    poi=Object.create(poiAlpha);
    poi.x= 700;
    poi.y= 402;
    poi.id="Two";
    poi.type = 'T'; //looking for "asset/T_2.html"
    poi.cat = 'FI'
    pois.push(poi);
    
    //3
    poi=Object.create(poiAlpha);
    poi.x = 246;
    poi.y = 532;
    poi.id = "3";
    poi.type = 'I'; 
    poi.cat = 'FI'
    pois.push(poi);

    //4
    poi=Object.create(poiAlpha);
    poi.x = 646;
    poi.y = 532;
    poi.id = "4";
    poi.type = 'I'; 
    poi.cat = 'FI'
    pois.push(poi);

//-----------
// FLORA
//-----------
    //5
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "5";
    poi.type = 'I'; 
    poi.cat = 'FL'
    pois.push(poi);
    //6
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "6";
    poi.type = 'I'; 
    poi.cat = 'FL'
    pois.push(poi);
    //7
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "7";
    poi.type = 'I'; 
    poi.cat = 'FL'
    pois.push(poi);
    //8
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "8";
    poi.type = 'I'; 
    poi.cat = 'FL'
    pois.push(poi);
    //9
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "9";
    poi.type = 'I'; 
    poi.cat = 'FL'
    pois.push(poi);
    //10
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "10";
    poi.type = 'V'; 
    poi.cat = 'FL'
    pois.push(poi);
    //11
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "11";
    poi.type = 'V'; 
    poi.cat = 'FL'
    pois.push(poi);
    //12
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "12";
    poi.type = 'I'; 
    poi.cat = 'FL'
    pois.push(poi);
    //13
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "13";
    poi.type = 'V'; 
    poi.cat = 'FL'
    pois.push(poi);
    //14
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "14";
    poi.type = 'T'; 
    poi.cat = 'FL'
    pois.push(poi);


//-----------
// FAUNA 
//-----------
    //15
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "5";
    poi.type = 'I'; 
    poi.cat = 'FA'
    pois.push(poi);
    //16
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "6";
    poi.type = 'I'; 
    poi.cat = 'FA'
    pois.push(poi);
    //17
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "7";
    poi.type = 'I'; 
    poi.cat = 'FA'
    pois.push(poi);
    //18
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "8";
    poi.type = 'I'; 
    poi.cat = 'FA'
    pois.push(poi);
    //19
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "9";
    poi.type = 'I'; 
    poi.cat = 'FA'
    pois.push(poi);
    //20
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "10";
    poi.type = 'V'; 
    poi.cat = 'FA'
    pois.push(poi);
    //21
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "11";
    poi.type = 'V'; 
    poi.cat = 'FA'
    pois.push(poi);
    //22
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "12";
    poi.type = 'I'; 
    poi.cat = 'FA'
    pois.push(poi);
    //23
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "13";
    poi.type = 'V'; 
    poi.cat = 'FA'
    pois.push(poi);
    //24
    poi=Object.create(poiAlpha);
    poi.x = -1;
    poi.y = -1;
    poi.id = "14";
    poi.type = 'T'; 
    poi.cat = 'FA'
    pois.push(poi);

//-----------
// UDATINOS 
//-----------
 
    //25
    poi=Object.create(poiAlpha);
    poi.x = 1146;
    poi.y = 543;
    poi.id = "First One";
    poi.type = 'I'; //looking for "asset/I_0.jpg"
    poi.cat = 'UD'
    pois.push(poi);

    //26
    poi=Object.create(poiAlpha);
    poi.x= 789;
    poi.y= 100;
    poi.id="Two";
    poi.type = 'V'; //looking for "asset/V_1.mp4"
    poi.cat = 'UD'
    pois.push(poi);

    //27
    poi=Object.create(poiAlpha);
    poi.x= 1053;
    poi.y= 438;
    poi.id="Two";
    poi.type = 'T'; //looking for "asset/T_2.html"
    poi.cat = 'UD'
    pois.push(poi);
    
    //28
    poi=Object.create(poiAlpha);
    poi.x = 26;
    poi.y = 411;
    poi.id = "3";
    poi.type = 'I'; 
    poi.cat = 'UD'
    pois.push(poi);

    //29
    poi=Object.create(poiAlpha);
    poi.x =180;
    poi.y = 701;
    poi.id = "4";
    poi.type = 'I'; 
    poi.cat = 'UD'
    pois.push(poi);

    //30
    poi.x = 316;
    poi.y = 532;
    poi.id = "First One";
    poi.type = 'I'; //looking for "asset/I_0.jpg"
    poi.cat = 'UD'
    pois.push(poi);

    //31
    poi=Object.create(poiAlpha);
    poi.x= 710;
    poi.y= 236;
    poi.id="Two";
    poi.type = 'V'; //looking for "asset/V_1.mp4"
    poi.cat = 'UD'
    pois.push(poi);

    //32
    poi=Object.create(poiAlpha);
    poi.x= 301;
    poi.y= 323;
    poi.id="Two";
    poi.type = 'T'; //looking for "asset/T_2.html"
    poi.cat = 'UD'
    pois.push(poi);
    
    //33
    poi=Object.create(poiAlpha);
    poi.x = 506;
    poi.y = 562;
    poi.id = "3";
    poi.type = 'I'; 
    poi.cat = 'UD'
    pois.push(poi);

    //34
    poi=Object.create(poiAlpha);
    poi.x = 616;
    poi.y = 232;
    poi.id = "4";
    poi.type = 'I'; 
    poi.cat = 'UD'
    pois.push(poi);


