// Ensure LIT namespace is available
if (typeof(LIT) == "undefined")
{
    var LIT = {};
}

/**
 * Handles random display of testimonials in the testimonial section.
 */
LIT.Testimonials =
{
    container: "content",
    menuContainer: "sidebar",

    employees: [
      
               {id: 1,
                name: "Cahal",
                title: "Technologist",
                joined: "2008",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["I had previously worked for another large IT company in Belfast. After nine great years at that company I was looking for a new challenge, and Liberty IT had an impressive reputation. LIT was one of the few companies I would have considered moving to."]},
                   {question: "Why did you accept the offer?", answer: ["Liberty IT really impressed me during the application process. I thought it a very competent organisation which was keen to have me. Also, as I was coming from a role as an architect, Liberty's focus on technical excellence was something I found very attractive."]},
                   {question: "How did you settle in?", answer: ["Within a week I was up and running. I'd arrived just in time to tech lead a new project, so I was fully involved with work and the team in a matter of days. Looking back, I'm amazed I settled in so quickly - this has to be a compliment to the team and how welcome they made me feel when I arrived."]},
                   {question: "What are you working on now?", answer: ["I'm working with a Team of 15 people developing .Net Web-facing Policy Administration applications for the International market; we've developed several systems targeting all parts of the world, including Europe, US, Canada and Asia Pacific."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["I came here looking for challenging work, and I certainly got it. I also take great pleasure in having the opportunity to work with some very skilled colleagues - working with skilled people in a fun environment is always a pleasure."]}
                ]},
       
       
               {id: 2,
                name: "Danielle",
                title: "Software Engineer",
                joined: "July 2006 as a placement student, and returned as a graduate in July 2008.",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["LIT advertised placement opportunities on our university careers page, so I applied and got a year-long placement. I enjoyed my placement so much I applied for a graduate position."]},
                   {question: "Why did you accept the offer?", answer: ["I accepted the placement offer because of the many positive comments about LIT from both staff at QUB and other students who had spent their placement year at LIT. I accepted the graduate position based on the good experience I had on placement."]},
                   {question: "How did you settle in?", answer: ["Surprisingly easily! From a work perspective LIT assigns a mentor to all new starts, which means you know exactly who to go to with any questions or issues. There's also a very friendly and sociable vibe at LIT which helped me settle into general life within the company."]},
                   {question: "What are you working on now?", answer: ["I support seven different applications across a variety of technologies including JAVA, .Net, SQL with differing business functions."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["It has to be the variety in my work. On any given day I could be working on Java, .Net, SQL - and a few others! The social element is also a massive positive. Our monthly social events are always something to look forward to."]}
                ]},
       
               {id: 3,
                name: "Joe",
                title: "Senior Software Engineer",
                joined: "2004 as a placement student, and returned as a graduate in 2006.",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["In 2003 I was studying Computer Science at QUB. I took part in a placement interview with LIT and successfully obtained a position as a Placement Software Engineer.  After an enjoyable year, I finished my degree and applied again as a graduate."]},
                   {question: "Why did you accept the offer?", answer: ["During my placement I had admired the quality and enthusiasm of the staff at LIT, so I had no hesitation in accepting the opportunity to work with them in a team-oriented environment. I had learned a great deal from staff who were experienced in a range of technologies, and who demonstrated a willingness to pass on their knowledge to help me develop my own skills."]},
                   {question: "How did you settle in?", answer: ["LIT makes a big effort to settle in new employees, and the staff are also warm and welcoming. As part of the orientation process I was assigned a mentor to show me the ropes and ensure I got to know the people, the project, and the resources I needed. Another part of the orientation process involves bringing new recruits together to learn about the various market areas within the company, so I didn't feel isolated or confused, and I learned why I was here and what I was supposed to be doing."]},
                   {question: "What are you working on now?", answer: ["Presently I'm working on systems that deal with the administration of Car and Property insurance for U.S customers. Fortunately my job covers a wide range of areas across the business as I work on the backend C++ servers. I am looking forward to a new challenge in the near future as I will be working with the JAVA technologies on the project. On a daily basis I help develop a range of services from saving, editing and  renewing Customer Policies, to producing statistics, billing records, Customer Proposals, Application Forms and Customer Declarations which are sent to Customers homes."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["I enjoy working at LIT for many reasons. The trips to the U.S. are great fun, the team-oriented environment is dynamic, and the company's willingness to help me learn new skills and technologies promotes self-development. For me though, the best aspect of working at LIT has to be the direct impact my work has on millions of current and potential customers throughout the U.S."]}
                ]},

 
                {id: 4,
                name: "William",
                title: "Senior Software Engineer",
                joined: "2006.",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["I picked up some LIT marketing brochures at the Queen's University careers fair.  The brochures gave me confidence that LIT was a company where I could develop a strong career in IT."]},
                   {question: "Why did you accept the offer?", answer: ["The interviewers were excellent; they gave me great feedback on the types of projects I could expect to be involved with, including technology sets and team working environment.  Also, LIT's focus on employee training and career progression opportunities made accepting an easy decision to make."]},
                   {question: "How did you settle in?", answer: ["Settling in couldn't have been much easier.  My team members were great fun to work with, but at the same time, provided top class mentoring, which is important to accelerate career development at the early stages."]},
                   {question: "What are you working on now?", answer: ["I'm currently working on a strategic project for an Underwriting application, which involves adding Quoting and Pricing functionality to an existing system.  My team and I have spent the last number of weeks in the requirements analysis, design, and estimation stages of the project, and now construction is underway which is estimated to last for the next 4 months."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["It has to be the support for career development, flexibility, and the work life balance.  I will be on a career break in a few months to go travelling, returning in a year's time. It's reassuring to know I will be returning to Liberty IT."]}
                ]},      
       
  
                 {id: 5,
                name: "Tom",
                title: "Software Engineer",
                joined: "2011.",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["I had heard a lot of good things about LIT, and since I felt I needed a career move, I decided to give it a chance and applied for the Software Engineer position. The interview went really well and I was soon offered the job."]},
                   {question: "Why did you accept the offer?", answer: ["Many reasons. I was advised I would be a part of C# and SQL Server development team - so it nicely matched my skillset. I also liked the office, plus the in-house gym was really too much to resist."]},
                   {question: "How did you settle in?", answer: ["Great. The team was extremely welcoming and it seemed as if everyone was trying to make sure I was included, especially during the first few weeks. As a result it now feels like I've been a part of this team for a long time."]},
                   {question: "What are you working on now?", answer: ["We are working on a system integration project - development using C# and SQL Server. It's pretty challenging, but there's loads of help around."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["I like the warm atmosphere here. Everyone's friendly and has time for you - you can always knock on anyone's door and be spoken to, regardless of the time or circumstances. On the other hand, the company is professional to the core. I consider the in-house gym a massive bonus too. LIT is truly a great place, and I simply like coming to work every day."]}
                ]},    
  
                  
                  {id: 6,
                name: "Oyejide",
                title: "Software Engineer",
                joined: "2011.",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["After my degree, I started my career with a commercial bank in England. I spent three years there as a contractor before deciding to look for a more permanent role as I wanted stability, both financially and career-wise. I had a look at opportunities in the market and was drawn to LIT right from the outset, so I was very pleased to have been given the opportunity to work here."]},
                   {question: "Why did you accept the offer?", answer: ["Looking at LIT and other global companies, LIT stands out. I could see my career progressing very well, and at LIT there is also with a balance between work and family life. I had more than one offer, but I chose LIT, and so far I am enjoying my choice."]},
                   {question: "How did you settle in?", answer: ["It couldn't be better! I started in February and was offered a relocation allowance, which really helped as I am from England and did not know anyone in Northern Ireland. I was also assigned a mentor to show me around, and have been attending orientation sessions which provide me with further business knowledge. People are very nice and approachable, and every day is fun because of that."]},
                   {question: "What are you working on now?", answer: ["I am working as part of team testing and supporting an insurance claim processing platform for Liberty Mutual, our parent company in the US. The technology within the apps is varied (JAVA, SQL, UNIX, XML, VB etc.), which means I am working with top technologies and learning a lot every day."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["I like the training, varied role, and challenges that exist within the project - which means I always have plenty to do. I also like the friendly atmosphere where people interact without barriers."]}
                ]},     
 
  
                   {id: 7,
                name: "Noel",
                title: "Software Engineer",
                joined: "2007.",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["Liberty IT was always one of the companies that people discussed during my time at university, and it had a strong presence at the careers fairs I attended. With this in mind, I applied as a graduate, and thankfully was offered a position."]},
                   {question: "Why did you accept the offer?", answer: ["LIT's career progression and incentives were very promising, and I was very impressed by the interview process, which included a quick tour of the offices."]},
                   {question: "How did you settle in?", answer: ["I settled in quite easily. I was assigned a mentor until I got up to speed with things. This helped greatly as it meant that I had a 'go to' person for any questions/problems. I also attended several training and information sessions which also helped to build my knowledge of both the technical and business sides of things."]},
                   {question: "What are you working on now?", answer: ["I am currently developing a .Net based underwriting application as part of a team of 10 developers. We are creating the application from scratch, which you don't often get the opportunity to do in the IT industry, so it is quite exciting and challenging work."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["I enjoy the constant challenge of coming up with solutions to a range of problems, and working with a skilled, fun team in doing so."]}
                ]},         
       
       
                   {id: 8,
                name: "Georgie",
                title: "Project Manager",
                joined: "2008.",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["I was working in the financial sector prior to joining LIT and was looking for a move to a new area.  I knew of LIT's great reputation and I also knew people at all levels who worked in the company - they all had something good to say about LIT, so that prompted me to apply."]},
                   {question: "Why did you accept the offer?", answer: ["I have previously worked for both a consultancy and a large UK financial institution, and LIT combines the plus points of both.  We have the security and breadth of work offered by a large organisation, but the feel of a much smaller company and the benefits that brings - such as a strong support network, close camaraderie, and a great social scene."]},
                   {question: "How did you settle in?", answer: ["Very quickly - I had a team and numerous projects to look after just a week after joining!  The orientation programme at LIT is very comprehensive and introduces you to every aspect of the company.  I was so impressed I now help to run the orientation courses for other new starts!"]},
                   {question: "What are you working on now?", answer: ["I manage a portfolio of projects within the Personal Markets business unit which all support Liberty's Property and Auto (car) insurance business.  They range from strategic development on the existing Sales and Servicing platform (used by 4,000 reps daily to quote and service millions of policies every year) to greenfield development of new applications to support these lines of business."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["The people, the challenges, the support from my team and my peers - you don't get a chance to get bored around here!"]}
                ]},         
       
       
                   {id: 9,
                name: "Carole",
                title: "Principal Database Designer",
                joined: "2008.",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["I was working as a DBA in a large IT company in Belfast, but was looking for an opportunity to move into database development.  Liberty advertised for database designers and, as Liberty has a great reputation within the Belfast IT market, I applied."]},
                   {question: "Why did you accept the offer?", answer: ["Liberty has a specific career path for database developers. I found this particularly attractive as I wanted to specialise in database technologies and also advance my career."]},
                   {question: "How did you settle in?", answer: ["I settled in really quickly due to the Liberty mentoring scheme.  My mentor introduced me to the team and day-to-day life in Liberty. I also got to meet people outside my team through Liberty Social Club events."]},
                   {question: "What are you working on now?", answer: ["I'm working on a Data Warehousing and Business Intelligence project for the Liberty Syndicate within the Lloyd's insurance market in London. This involves database design and development, but also related skills such as OLAP reporting building."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["Working with highly experienced people and having the chance to develop new skills in the latest technologies."]}
                ]},         
      
               {id: 10,
                name: "Tony",
                title: "Market Area Director",
                joined: "July 2001",
                content: [
                   {question: "How did you end up in Liberty IT?", answer: ["I was looking for a change and a friend recommended Liberty IT as a company with a good training structure, strong career path, and good quality of work."]},
                   {question: "Why did you accept the offer?", answer: ["My initial meetings at LIT gave me a strong sense that it was a friendly, supportive, and fun place to work."]},
                   {question: "How did you settle in?", answer: ["Very quickly. The people are friendly, and I was given support to settle into both my project and the company."]},
                   {question: "What are you working on now?", answer: ["Until recently I was managing the development of software systems to manage customer Claims. I delivered multiple projects within that portfolio with developers from Belfast and the US. I have recently moved to a new project area where I will be working with developers spread across Chennai India, Belfast and US to deliver enhancements to an external web based application which gives Liberty Mutual's customers reporting capability on their Risk exposure from a claims perspective."]},
                   {question: "What do you like best about working in Liberty IT?", answer: ["Liberty IT manages to maintain a small company culture although it now has nearly 300 employees."]}
         ]}

    ],

    init: function()
    {
        DomBuilder.apply(window);
        this.generateMenu();

        // Show a random employee
        var randomEmployee = this.employees[Math.floor(Math.random() * this.employees.length)];
        this.showEmployee(randomEmployee);
    },

    findEmployee: function(id)
    {
        var employee = null;
        for (var i = 0, l = this.employees.length; i < l; i++)
        {
            if (id == this.employees[i].id)
            {
                employee = this.employees[i];
                break;
            }
        }
        return employee;
    },

    generateMenu: function()
    {
        var container = $(this.menuContainer);
        if (!container)
        {
            return;
        }
        this.clearElement(container);

        var ul = UL();
        for (var i = 0, l = this.employees.length; i < l; i++)
        {
            ul.appendChild(
                LI(
                    A({href: "#", onclick: this.showEmployeeHandler(this.employees[i].id)},
                      this.employees[i].name)));
        }
        container.appendChild(ul);
    },

    showEmployee: function(employee)
    {
        var container = $(this.container);
        if (!container)
        {
            return;
        }

        var content =
            DIV(
                H1(employee.name),
                H2(employee.title),
                P("Joined us in " + employee.joined)
            );

        for (var i = 0; i < employee.content.length; i++)
        {
            content.appendChild(H3(employee.content[i].question));
            for (j = 0; j < employee.content[i].answer.length; j++)
            {
                content.appendChild(P(employee.content[i].answer[j]));
            }
        }
        content.lastChild.className = "last";

        this.clearElement(container);
        container.className = "employees-" + employee.name.toLowerCase();
        container.appendChild(content);
    },

    showEmployeeHandler: function(id)
    {
        return function(e)
        {
            Event.stop(e);
            this.showEmployee(this.findEmployee(id));
        }.bindAsEventListener(this);
    },

    /**
     * Clears the given DOM element of any content.
     *
     * @param el {Element} the element to be cleared of content.
     */
    clearElement: function(el)
    {
        while(el.firstChild)
        {
            el.removeChild(el.firstChild);
        }
    }
};

// Always initialise on page load
Event.observe(window, "load", LIT.Testimonials.init.bind(LIT.Testimonials));
