
$(document).ready(function() {
    $(".popout").colorbox({title:true,scrolling:true,innerWidth:"50%",previous:"previous",next:"next",current:"Selection {current} of {total}" });

        $(".selectmenu h3:first").addClass("active");
        $(".selectmenu div:not(:first)").hide();

        $(".selectmenu h3").click(function(){

          $(this).next("div").slideToggle("fast")
          .siblings("div:visible").slideUp("fast");
          $(this).toggleClass("active");
          $(this).siblings("h3").removeClass("active");

        });
    $("img.membergroup").hover(
    function() {
    $(this).stop().animate({"opacity": "0"}, "fast");
    },
    function() {
    $(this).stop().animate({"opacity": "1"}, "fast");
    });


    $('div.inputbox input.inputbox').focus(function() {
                $(this).addClass("focus");
        });
        $('div.inputbox input.inputbox').blur(function() {
                $(this).removeClass("focus");
        });                                                                                                               
                                                                                                                  
    $("#contactform").validate({messages: {
                        company: "<p class='red'>Please provide your company name<\/p>",
                        firstname: "<p class='red'>Please provide your first name<\/p>",
                        lastname: "<p class='red'>Please provide your last name<\/p>",
                        email: "<p class='red'>Please enter a valid email address<\/p>",
                        detail: "<p class='red'>Please provide us with details<\/p>"
                }
        });
    });
  
function updateDB(){

                        var $this = $('#submit');
                        var opts = { position: 'center', hide: true };
                        $this.spinner(opts);
                        ;


    $.post(
        'scripts/updateLists.php',
        'recordsArray='+encodeURIComponent($.dds.serialize('destination')), //or whatever the id of the list is.
        function(response){
            if(response = true){                                
                        $this.spinner('remove');
                        alert('Success!');
    }
        });
    }
    function user_login ( )
    {
    document.loginform.submit() ;
    }

  
function checkAll(field)
    {
    for (i = 0; i<field.length; i++)
        field[i].checked = true;
    }

    function uncheckAll(field)
    {
    for (i = 0; i<field.length; i++)
        field[i].checked = false;
    }
  

