﻿// JScript File

    var a = [];
    var Booking = new Class({
        initialize: function(bookingid,title,description,startdate,enddate,location,eventtime,url){
            this.bookingid = bookingid;
            this.title = title;
            this.description = description;
            this.startdate = startdate;
            this.enddate = enddate;
            this.location = location;
            this.eventtime = eventtime;
            this.url = url;
            }
        });

    
   function ShowEvent(id){
        var dates;
        
         for(var i=0; i<a.length;i++){
            //s += a[i].bookingid & '<br />';
            if(a[i].bookingid == id){
                $('hdtitle').setHTML(a[i].title);
                $('pdates').setHTML(a[i].enddate);            
                $('pdesc').setHTML(a[i].description);
                $('plocation').setHTML(a[i].location);
                $('peventtime').setHTML(a[i].eventtime);
                if(a[i].url.length > 0){
                    $('purl').setHTML('<a id="purl" href="http://' + a[i].url + '" target="_blank">web link</a>');
                }
                $('pnlPopup').show();
            }
        }
    }
  
  window.addEvent('domready', function(){
  
        $('pnlPopup').hide();
								
		$('closePopup').addEvent('click', function(e){
			e = new Event(e);
            $('pnlPopup').hide();
			e.stop();
		});
		
    })


