function validate(formData, jqForm, options) { 
    // jqForm is a jQuery object which wraps the form DOM element 
    // 
    // To validate, we can access the DOM elements directly and return true 
    // only if the values of both the username and password fields evaluate 
    // to true 
 
    var form = jqForm[0]; 
    if (!form.phone.value) { 
        alert('Вы забыли указать свой контактный телефон!'); 
        return false; 
    } 
}

$(document).ready(function(){
    
    
	$('.slider').css('display','');
    $('.slider').nivoSlider({
        animSpeed: 300,
        pauseTime: 5000,
        directionNav: false,
        controlNav: false
    });
    
    $(".gallery a").colorbox({
        opacity: 0.3,
        maxHeight: "95%"
    });
    
    $(".colorform").colorbox({
        opacity: 0.3
    });
    
    
    
    
    /*$("ul.tabs").tabs("div.panes > div", { history: true });*/
    
    $('table.zebra').zebra({
	   bgEven: '#FFD9A3',
       bgHover: '#FF9C44'
    });
    
    $( "#tabs" ).tabs({
        cookie: {
		  // store cookie for a day, without, it would be a session cookie
		  expires: 1
        }
    });
    
    $( "#tabs2" ).tabs();
    $( "#tabs3" ).tabs({
        selected: 2
    });
    
    
    var options = { 
        target:        '#ExpressStatus',   // target element(s) to be updated with server response 
        beforeSubmit:   validate ,  // pre-submit callback 
        //success:       showResponse  // post-submit callback 
 
        // other available options: 
        url:       "/ajax/send_to_mail",         // override for form's 'action' attribute 
        type:      "post"        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        //clearForm: true        // clear all form fields after successful submit 
        //resetForm: true        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
    
    $('#ExpressForm').ajaxForm(options);
    /*
    $('#ExpressForm').submit(function() { 
        // inside event callbacks 'this' is the DOM element so we first 
        // wrap it in a jQuery object and then invoke ajaxSubmit 
        $(this).ajaxForm({
            target:    '#ExpressStatus',
            beforeSubmit: validate
        }); 
 
        // !!! Important !!! 
        // always return false to prevent standard browser submit and page navigation 
        return false; 
    });
    */
    
    
    
    
    
});
