$(document).ready(function() {
       $(".toplink a").click(function () {
          scrollTo(0,0);
          return false;
       });
      
       $("a.notepad-remove").click(function() {
        // alert($(this).attr("href"));
        if($(this).hasClass("no-ajax")) {
          return true;
        }
        
        $.get($(this).attr("href"),{ajax: true});
        
        $(this).hide();          
        $(this).parent().find("a.notepad-add").show();
        
        return false;
      });

      $("a.notepad-add").click(function() {
        if($(this).hasClass("no-ajax")) {
          return true;
        }
        
        // alert($(this).attr("href"));
        $.get($(this).attr("href"),{ajax: true});
        
        $(this).hide();
        $(this).parent().find("a.notepad-remove").show();
        
        return false;
      }); 
      
      $("#order input").hide();
      
       
      // $("#order").change(function() {  });
  
      
      $(".hideAtStart").hide();
      
    
      $('#order select').change(function() {
            /*
            alert($(this).find(':selected').text());
            alert($(this).val());
            */
            $("#order").submit();
      });
      
     $('#additional-images .ai-options input').each(function() {
        $(this).maxLength();      
     });
     
  $('#classes .field-options').hide();
  $('#classes li > input').each(function() {
    if($(this).attr("checked") == true) { $(this).parent().find(".field-options").slideDown(); }
  }); 
  
  $('#classes li > input').click(function() {
    if($(this).attr("checked") == true) { 
      $(this).parent().find(".field-options").slideDown(); 
    } else {
      $(this).parent().find(".field-options").slideUp();
    }
  });
  
  $('.preise-wrapper .preise-details').hide();
  
  $('.preise-wrapper h2').click(function() {
    if($(this).hasClass("active")) {
      $(this).removeClass("active");
    } else {
      $(this).addClass("active");
    }
    
    $('.preise-details').slideToggle();

    return false;
  });
  
  $(".get-new-password").click(function () {
      window.open('/sendpassword.php', 'popup', 'toolbar=0, width=380, height=120');
      return false;
  });
      
     
});