var Room = IR.GetPage("Rooms");
var Lighting = IR.GetPage("Lighting");
var Rooms_l = Lighting.GetItem("Item 8");
var Count = 0;
var Holder = IR.GetPopup("RoomItemHolder").GetItem("Item 1");
var HolderRoom = IR.GetPopup("RoomItems").GetItem("Item 8");
var popuppage = IR.GetPopup("ListRooms");
var clicker = popuppage.GetItem("Name");

   /*
   // Gelieve dit stuk commented te laten!
   IR.AddListener(IR.EVENT_ITEM_PRESS,Room.GetItem("Rooms"), function()
   {
      // IR.Log("Rooms ");	
      IR.ShowPopup("Room", 1000);	
   })
   
   IR.AddListener(IR.EVENT_ITEM_PRESS,Lighting.GetItem("Rooms"), function()
   {  
      var RoomName = Holder.Text;
   	IR.Log("Lighting " + RoomName);	
      Addroom(RoomName);
   })
   */
     
function Addroom(item)
{	   
   CreateItemsLists();
}
  

   var closepop = IR.GetPopup("Melding").GetItem("Item 2");
   var closepop2 = IR.GetPopup("Intercom").GetItem("Item 2");
   var closepop3 = IR.GetPopup("Foutmelding").GetItem("Item 2");
   var closepop4 = IR.GetPopup("CameraPop").GetItem("Item 2");
   
   IR.AddListener(IR.EVENT_ITEM_PRESS, closepop,function()
   {
       IR.HidePopup('Melding', 1000);		
   })
   
   IR.AddListener(IR.EVENT_ITEM_PRESS, closepop2,function()
   {
       IR.HidePopup('Intercom', 1000);  			
   })
   
   IR.AddListener(IR.EVENT_ITEM_PRESS, closepop3,function()
   {
       IR.HidePopup('Foutmelding', 1000);  			
   })
   
   IR.AddListener(IR.EVENT_ITEM_PRESS, closepop4,function()
   {
       IR.HidePopup('CameraPop', 900); 		
   })
  
  
  
  IR.AddListener(IR.EVENT_START, 0, function()
{
   var Fade = IR.CreateEffect(IR.EFFECT_FADE); // create a group, save it in the variable
       Fade.Group = 1000; // assign the number to the group
       Fade.Delay = 0; // the delay for executing effects
       Fade.Duration = 800; // the effect duration
       Fade.Tween = 0; // the formula for effect calculation (tweener)
       
       
       var Fader = IR.CreateEffect(IR.EFFECT_TVSCAN); // create a group, save it in the variable
       Fader.Group = 900; // assign the number to the group
       Fader.Delay = 0.2; // the delay for executing effects
       Fader.Duration = 250; // the effect duration
       Fader.Tween = 0; // the formula for effect calculation (tweener)
});
