$(document).ready(function()
{
   var tempVar  = '';
   var homepage = 'http://localhost/sites/govid/';

   // GoVid Footer Contact Form
   $('#contactGovid form').css('display', 'none');
   $('#contactGovid .link').click(function()
   { 
      $('#contactGovid form').slideToggle(null, function()
      {
         window.scrollTo(0, $('body').height());
      });
   });

   // BrandedContact Contact Form
   $('#brandedContact form').bind('submit', function(e)
   {
      e.preventDefault();

      var $output = $(this).find('p.output');

      if ($(this).find('input[name="name"]').val() == '' || $(this).find('textarea[name="comment"]').val() == '' || ($(this).find('input[name="number"]').val() == '' && $(this).find('input[name="email"]').val() == ''))
      {
         $output.html('Please fill in all form fields');
         return;
      }
      
      /*
      var frmName     = $(this).find('input[name="name"]').val();
      var frmNumber   = $(this).find('input[name="number"]').val();
      var frmEmail    = $(this).find('input[name="email"]').val();
      var frmComment  = $(this).find('textarea[name="comment"]').val();
      var frmSendCopy = $(this).find('input[name="sendCopy"]').val();
      */

      $output.html('Submitting...');

      $.post($(this).attr('action'), $(this).serialize() + '&email-agent=1', function(data)
      {
         $output.html(data);
      }, 'text');
   });

   // Clear input boxes
   $('input[type="text"]').click(function()
   {
      if (!$(this).hasClass('jsCleared'))
      {
         $(this).attr('value', '').addClass('jsCleared');
      }
   });

   $('#anzCalculator div.info').css('display', 'none');
   $('#anzCalculator div.jsLink').click(function() { $(this).next('div.info').slideToggle(); });
});

