
$(document).ready(function(){

	$(document).on('submit','#formBroucher',function() 
	{ 		
//$("#submitFormBroucher").click(function(){ 
 if($(".message_validation :visible").length>0)
		{
                    return false;
		}
		else
		{
$.ajax({
       type: "POST",
                url: GLOBAL_BASE_PATH + "/brochure/saveBroucher/",
                data: {subtitle: $('#subtitleid').val(),userFirstName: $('#userFirstName').val(),userLastName: $('#userLastName').val(),userEmail: $('#emailID').val(),userPhone: $('#countrycode').val()+' '+$('#phone').val(),productCategoryID: $('#productCategoryID').val(),bodyStyle: $('#bodyStyle').val()},
                async: false,
                success: function (data) {
				$("#submitFormBroucher").addClass('hide');
				$("#submitFormBroucherLoader").removeClass('hide');					
				$("#submitFormBroucherLoader").removeClass('disabled');					
					if(data != ''){
                       window.open(siteUrl+'/brochure/downloadbroucherinfo/id/'+data, '_blank');
					   //window.location=siteUrl+'/brochure/downloadbroucherinfo/id/'+data;
					   jNotifyShowWithClose("Brochure Downloaded Successfully","common_message", "message_success"); 
					  // $('#subtitleid').val('');
					   $('#userFirstName').val('');
					   $('#userLastName').val('');
					   $('#emailID').val('');
					   $('#phone').val('');
					   $('#productCategoryID').val('');
					   $('#bodyStyle').val('');
					   $("#validateAgree").prop( "checked", false );
                       return false;
                    }
        }
    });
		}
});			
			
});

  /* $(document).on('submit','#formBroucher',function() 
	{ 
        if($(".message_validation :visible").length>0)
		{
                    return false;
		}
		else
		{
		 
			$.ajax({
                type: "POST",
                url: GLOBAL_BASE_PATH + "/broucher/saveBroucher/",
                data: {subtitle: $('#subtitleid').val(),userFirstName: $('#userFirstName').val(),userLastName: $('#userLastName').val(),userEmail: $('#userEmail').val(),userPhone: $('#countrycode').val()+' '+$('#userPhone').val(),productCategoryID: $('#productCategoryID').val(),bodyStyle: $('#bodyStyle').val(),productCategoryName: $('#productCategoryName').val()},
                async: true,
                success: function (data) {  
				$("#submitFormBroucher").addClass('hide');
				$("#submitFormBroucherLoader").removeClass('hide');
					
                    if(data != ''){
                        $('.download-broucher-info-form-blk').addClass('hide');
                        $('.download-broucher-info-otp-blk').addClass('hide');
                        //document.write(data);
                        window.open(siteUrl+'/broucher/downloadbroucherinfo/id/'+data, '_blank');
                       // window.open(siteUrl+'/product/productinfodetail/id/'+data, '_blank');
                        return false;
                    }
                }
            })
		}
	}); */
//});	