/*
	Easy plugin to get element index position
	Author: Peerapong Pulpipatnan
	http://themeforest.net/user/peerapong
*/

function resize_gallery() {
    var scrollWidth = $('#wrapper').width() - 235;	
    $('#content_wrapper').css({width: scrollWidth+'px'});	    
}

$(window).resize(function() {
    resize_gallery();
});

$(document).ready(function(){ 
    resize_gallery();
    $.validator.setDefaults({
            submitHandler: function() { 
                var actionUrl = $('#contact_form').attr('action');

                $.ajax({
                    type: 'GET',
                    url: actionUrl,
                    data: $('#contact_form').serialize(),
                    success: function(msg){
                            $('#contact_form').hide();
                            $('#reponse_msg').html(msg);
                    }
                });

                return false;
            }
    });


    $('#contact_form').validate({
            rules: {
                your_name: "required",
                email: {
                    required: true,
                    email: true
                },
                message: "required"
            },
            messages: {
                your_name: "Please enter your name",
                email: "Please enter a valid email address",
                agree: "Please enter some message"
            }
    });	
});




