/**
 * Basic document.onload function
 */
var _true = true;

$(function(){

  $('#innerfade').css('display','block');

  var VerifyOptions = {
    verifying : "verifying",
    valid   : "valid",
    invalid   : "invalid",
    method    : "get"
  };

  $('body input[name="brands_name"]').verify('/Brands/CheckName', VerifyOptions);

  $("#content").tabs(1);

  $(function(){
    $('#innerfade').innerfade({ speed: 'slow', timeout: 6000, type: 'sequence', containerheight: '80px' });
  });

  // screenshots
  $('#screenshots li a').mouseover(function(){

    var id = $(this).parent().attr('id');

    $('#screenshots li a').attr('class','');
    $(this).addClass('selected');
    $('#screenshot-details').attr('class','').addClass(id);
  });


  // bandits
  $('#police-report').hide(0);

  $('html').click(function(){
    $('#police-report').hide(0);
    $('#police-report').empty();
    $('div#police-report').attr('class','');
  });


  $('#bandits li a').click(function(){

    // clear the div
    $('#police-report').empty();
    $('#police-report').attr('class','');

    // add class to the div using the id from the a
    var link = $(this).attr('id');

    // switch between the divs
    $('#police-report').addClass(link).show(function(){
      switch(_true)
      {
        case link == 'paper-diary':
          $('div#police-report').append("<h2>Papa Diary</h2><p>aka <span>'The Paper Diary'</span></p><p>Found in drawers or pockets and other dark, hard to find places, Papa Diary is an old guy that thinks he's formidable but is an outmoded, troublesome menace. Entrusted with your most valuable information (your bookings) he treats them like dirt, smudging them in the rain, tearing pages or just disappearing with the lot! When he surfaces again, the information is out of date. He hates technology and refuses to transfer his information to your website. Understandably event organisers, corporations, experience companies, stag and hen party organisers are very wary of him and his bad habits.</p>");
          break;

        case link == 'answer-phone':
          $('div#police-report').append("<h2>Ann S'Phone</h2><p>aka <span>'The Answer Phone'</span></p><p>Masquerading as a useful and valuable member of your team she is viewed by your customers as unprofessional, impersonal and often infuriating. The original alternative to sitting by the phone, Ann S'Phone's slogan of 'be in when you're out' was a promise delivered to home owners. But her glib promise turns sour when your customers ring you to check availability or book a session. How can she respond? Her talent is for repeating herself until the caller is sick of her voice, gives up and books elsewhere.</p>");
          break;

        case link == 'mobile-phone':
          $('div#police-report').append("<h2>The Mob</h2><p>aka <span>'The Mobile Phone'</span></p><p>Papa Diary's Sidekick. Often Works with Ann S'Phone. Papa Diary's henchman is a powerful mobster. Working with Ann S'Phone he hangs around making himself very useful so you trust him. But this dodgy villain fails you just when it matters. When you are about to raise a pint, pop into the cinema or are lazing on the beach, he will ring. If you don't answer within seconds Ann S'Phone springs to his aid annoying your caller, or if you answer, Papa Diary has invariably made himself scarce so you don't know if you can accept the booking or not. The Mob's rap sheet also includes bad reception, background noise, engaged tone, and low battery.</p>");
          break;

        case link == 'pc-software':
          $('div#police-report').append("<h2>Stan D'Alone</h2><p>aka <span>'Stand Alone PC Software'</span></p><p>Archenemy of Papa Diary but no friend of yours, this master of disguise can fool you into thinking that he is the answer to your Papa Diary problems. You trust him with your bookings and then Stan D'Alone goes to sleep on your computer where no one except you and your staff will know where to find him. You then wake him up with a new booking, making him look impressive for a few minutes and then it is back to his slumbers. He's got a lot of front but as he is incapable of communicating with your website he will never be seen by potential customers so they can't book as and when they want to. So he is a fancy diary really! Worse still he is weak and vulnerable so falls prey to any passing computer viruses, poor backup routines, corrupted hard drives and computer theft.</p>");
          break;
      }
    });

    return false;
  });


  $('#case-study li a').click(function(){
    // add class to the div using the id from the a
    var link = $(this).attr('href');

    switch(_true)
    {
      case link == 'venue-owner':
        $('#case-profile dl dd.name strong').replaceWith("<strong>Mark Smallman</strong>");
        $('#case-profile dl dd.position strong').replaceWith("<strong>Owner</strong>");
        $('#case-profile dl dd.company strong').replaceWith("<strong>Marksmans Paintball</strong>");
        $('#case-profile dl dd.business strong').replaceWith("<strong>Paintball</strong>");
        $('#case-profile dl dd.previous-tool strong').replaceWith("<strong>Paper Diary and Mobile Phone</strong>");

        $('#case-information p#q1').replaceWith('<p id="q1">I run a large Paintball site in Cheshire. I take all types of groups, including individuals, small groups, stag and hen parties and large corporate groups. I run the games primarily on the weekend and sometimes during the week. We offer several different paintball packages with varying amounts of paintballs included. I also offer three different game play options; full day session, morning session and an afternoon session.</p>');

        $('#case-information p#q2').replaceWith('<p id="q2">With great difficulty. I run the business on my own during the week, taking bookings, preparing the equipment for the forthcoming weekend and performing any running repairs on the game zones. I\'d have Customers ringing me up when i was out doing maintenance work on the site. It\'s not easy to book someone in when your knee deep in mud digging out a new bunker for the weekend, I\'d have to run to get the diary every time the phone rang.</p>');

        $('#case-information p#q3').replaceWith('<p id="q3">It\'s massively changed the way I do things, leaving me to focus on running the rest of my business. The main advantage is that customers can now go onto my website to check availability, pay and book online without ever contacting me. RezBot automatically handles things like sending receipts and directions to the customer. The RezBot team helped me integrate the system into my website, it was all set up to take online bookings in less than 5 minutes.</p>');
        break;

      case link == 'booking-agency':
        $('#case-profile dl dd.name strong').replaceWith("<strong>Rebecca Rudkin</strong>");
        $('#case-profile dl dd.position strong').replaceWith("<strong>Sales Manager</strong>");
        $('#case-profile dl dd.company strong').replaceWith("<strong>The Activity People</strong>");
        $('#case-profile dl dd.business strong').replaceWith("<strong>Multi Activity Booking Agency</strong>");
        $('#case-profile dl dd.previous-tool strong').replaceWith("<strong>Stand Alone PC Software</strong>");

        $('#case-information p#q1').replaceWith('<p id="q1">We are a multi activity booking agency who specialise in delivering an array of activities to customers all over the UK. We arrange events for stags and hens, big coporate events and the general public.</p>');
        $('#case-information p#q2').replaceWith('<p id="q2">We would have to ring each supplier up every time we want to check availability, usually while the customer was holding on the other line. It was a logistical nightmare considering that we get up to 1000 calls per day and the fact that a lot of the suppliers would be difficult to get hold of.</p>');

        $('#case-information p#q3').replaceWith('<p id="q3">As a multi-activity agency we book a lot of activities - especially for stag and hen parties. Customers often want to know if activities are available when they phone up and chasing suppliers to check their availability is a constant headache. RezBot allows us to instantly see a venues availability, which means we can just get it booked in whilst the customer is still on the phone. Activity suppliers with true online availability are at a distinct advantage.</p>');
        break;

      case link == 'event-organiser':
        $('#case-profile dl dd.name strong').replaceWith("<strong>Nelson Laurencia</strong>");
        $('#case-profile dl dd.position strong').replaceWith("<strong>Managing Director</strong>");
        $('#case-profile dl dd.company strong').replaceWith("<strong>Lauraisevents</strong>");
        $('#case-profile dl dd.business strong').replaceWith("<strong>Corporate Events Organiser</strong>");
        $('#case-profile dl dd.previous-tool strong').replaceWith("<strong>Mobile Phone and the Internet</strong>");

        $('#case-information p#q1').replaceWith('<p id="q1">We arrange events which aim to Bring Business\'s together in unique environments where social interaction and competitiveness can result in the perfect networking and entertaining environment.</p>');

        $('#case-information p#q2').replaceWith('<p id="q2">Usually by phone or by checking out their website. We usually just need to see what kind of packages are available and the cost of those packages.</p>');

        $('#case-information p#q3').replaceWith('<p id="q3">It\'s a useful tool for us to quickly see what activities and packages are available in the area that we want to organise our event in. RezBot allows us to see all the details we need without having to mess around looking through suppliers websites. We can easily push enquiries through to suppliers who are signed up to RezBot.</p>');
        break;
    }

    return false;
  });


  $('a[href^="#"]').live('click', function(){
    var tgt = $(this).attr('rel');
    $('#content').triggerTab(tgt);
    return false;
  });

});

