$(document).ready(function() {
   init();
});

function init()
{
   $('dl.faq dt').each(function() {
      $(this).click(function() 
         {
            if ($(this).next().css('display') == "none")
      {
         $(this).next().fadeIn('fast');
      }
      else
      {
         $(this).next().fadeOut('fast');
      }
      });
   });
   $('#faqShow').click(function() {
      $('dl.faq dt').each(function() {
         if ($(this).next().css('display') == "none")
      {
         $(this).next().fadeIn('fast');
      }
      });
      return false;
   });
   $('#faqHide').click(function() {
      $('dl.faq dt').each(function() {
         if (!($(this).next().css('display') == "none"))
      {
         $(this).next().fadeOut('fast');
      }
      });
      return false;
   });
   
   if(isAccountPage)
   {
      var validator = $("#accountform").validate({
debug: false,
          errorElement: "span",
          errorClass:'error',
          errorContainer: $("#warning"),
          showErrors: function(errors, errorList) {
             validator.defaultShowErrors();
          },
success: function(label) {
            label.text("OK").addClass("success");
          }
      });
   }

   if(isIE6)
   {
      $('img.pro-image').each(function()
            {
               $(this).wrap('<div style="width:176px; height:144px; float:right; border:1px solid #bbb; margin-left:10px"></div>');
               $(this).css('margin', '0');
            });
   }
}

function showLogin()
{
   $('.overlay').css('display','block');
   $('.overlay').css('height',window.innerHeight+'px');
   $('#login-div').css('display','block');
}

function hideLogin()
{
   $('.overlay').css('display','none');
   $('#login-div').css('display','none');
}
