<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">jQuery(document).ready(function() {
    jQuery(document).on('change', "#company_name", function() {
        var get_comapany_value = jQuery(this).val();
        if (get_comapany_value == 0 &amp;&amp; get_comapany_value != '') {
            showOrganisationForm()
        } else {
            showprofileForm(get_comapany_value) 
        }
    });
    jQuery(document).on('click', "#organisation_submit", function() {
        flag = 0;
        if (jQuery('#company_name_info').val() == "") {
            flag = 1;
            jQuery('#company-name-info-error').html("This field is required")
        } else {
            jQuery('#company-name-info-error').html("")
        }
		
		if (jQuery('#company_brand_name').val() == "") {
            flag = 1;
            jQuery('#company-brand-name-error').html("This field is required")
        } else {
            jQuery('#company-brand-name-error').html("") 
        }

        if (jQuery('#company_reg_email').val() == "") {
            flag = 1;
            jQuery('#company-reg-email-error').html("This field is required")
        } else {
            jQuery('#company-reg-email-error').html("") 
        }
		
		if (jQuery('#company_segment_id').val() == "") {
            flag = 1;
            jQuery('#company-segment-id-error').html("This field is required")
        } else {
            jQuery('#company-segment-id-error').html("") 
        }
		
        if (jQuery('#billing_region').val() == "") {
            flag = 1;
            jQuery('#billing-region-error').html("This field is required")
        } else {
            jQuery('#billing-region-error').html("") 
        }
        if (jQuery('#country').val() == "") {
            flag = 1;
            jQuery('#country-error').html("This field is required")
        } else {
            jQuery('#country-error').html("")
        }
        if (jQuery('#user_privacy_policy').prop("checked") == !1) {
            flag = 1;
            jQuery('#user-privacy-error').html("This field is required")
        } else {
            jQuery('#user-privacy-error').html("")
        }
        if (flag == 0) {
            var formData = new FormData(jQuery('#user-organisation')[0]);
            jQuery("&lt;div class='loader-background'&gt;&lt;div id='loader-wrapper'&gt;&lt;div id='loader'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;").insertAfter('.global-loader');
            formData.append('action', 'processOrganisationForm');
            jQuery.ajax({
                url: admin_ajax,
                type: 'POST',
                data: formData,
                success: function(data) {
                    jQuery('.loader-background').remove();
                    var json = JSON.parse(data); 
                    if (data) {
                        if (json.error == 1) {
                            if (json.already_exists == 1) {
                                if (json.already_exists == 1) {
                                    if(window.location.pathname == "/engaged-partner-registration/"){
                                        window.location.href = base_url+'/engaged-partner-registration/?userexist=1'
                                    }
                                    else if(window.location.pathname == "/smpteregistration/"){
                                        window.location.href = base_url+'/smpteregistration/?userexist=1'
                                    }
                                    else{
                                        window.location.href = base_url+'/login/?userexist=1'
                                    }
                                }
							}
                            jQuery('#messages').html(json.message)
                        }
                        if (json.org_success == 1) {
                            jQuery('#messages').html(json.message);
                            jQuery('html, body').animate({
                                scrollTop: jQuery('#masthead').offset().top
                            }, 'slow');
                            showprofileForm(json.company)
                        }
                    }
                },
                cache: !1,
                contentType: !1,
                processData: !1
            })
        }
    });
    jQuery(document).on('change', "#org_address_check", function() {
        var ischecked = jQuery(this).is(':checked');
        if (!ischecked) {
            jQuery('#billing_address_1').val("");
            jQuery('#billing_address_2').val("");
            jQuery('#billing_address_3').val("");
            jQuery('#billing_city').val("");
            jQuery('#billing_postcode').val("");
            jQuery('#billing_country').val("");
            jQuery('#billing_county').val("")
        } else {
            jQuery('#billing_address_1').val(jQuery('#company_address').val());
            jQuery('#billing_address_2').val(jQuery('#company_address_2').val());
            jQuery('#billing_address_3').val(jQuery('#company_address_3').val());
            jQuery('#billing_city').val(jQuery('#city').val());
            jQuery('#billing_postcode').val(jQuery('#postcode').val());
            jQuery('#billing_country').val(jQuery('#country').val());
            jQuery('#billing_county').val(jQuery('#county').val())
        }
    });

    function validateEmail(email) {
        var re = /^(([^&lt;&gt;()\[\]\\.,;:\s@"]+(\.[^&lt;&gt;()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return re.test(email)
    }

    function validateUrl(textval) {
        var urlregex = new RegExp("^(http:\/\/|https:\/\/|ftp:\/\/){1}([0-9A-Za-z]+\.)");
        return urlregex.test(textval)
    }
    jQuery(document).on('click', "#profile_submit", function() {
        flag = 0;
        if (jQuery('#user-title').val() == '') {
            flag = 1;
            jQuery('#user-title-error').html("Please select the user title")
        } else {
            jQuery('#user-title-error').html("")
        }
        if (jQuery('#user_first_name').val() == '') {
            flag = 1;
            jQuery('#user-first-name-error').html("This field is required")
        } else {
            jQuery('#user-first-name-error').html("")
        }
        if (jQuery('#user_last_name').val() == '') {
            flag = 1;
            jQuery('#user-last-name-error').html("This field is required")
        } else {
            jQuery('#user-last-name-error').html("")
        }
        if (jQuery('#job_title').val() == '') {
            flag = 1;
            jQuery('#job-title-error').html("This field is required")
        } else { 
            jQuery('#job-title-error').html("")
        }
        if (jQuery('#job_function').val() == '') {
            flag = 1;
            jQuery('#job-function-error').html("This field is required")
        } else {
            jQuery('#job-function-error').html("")
        }
          if (jQuery('#user_privacy_policy').prop("checked") == !1) {
            flag = 1;
            jQuery('#user_privacy_policy-error').html("This field is required")
        } else {
            jQuery('#user_privacy_policy-error').html("")
        }
        if (flag == 0) {
            $( "#profile_submit" ).prop( "disabled", true )
            var formData = new FormData(jQuery('#user-profile')[0]);
            jQuery("&lt;div class='loader-background'&gt;&lt;div id='loader-wrapper'&gt;&lt;div id='loader'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;").insertAfter('.global-loader');
            formData.append('action', 'processProfileForm');
            jQuery.ajax({
                url: admin_ajax,
                type: 'POST',
                data: formData,
                async: !1, 
                success: function(data) { 
                    jQuery('.loader-background').remove();
                    var text = data.substr(data.indexOf("{"), data.length);
                    var json = JSON.parse(text);
                    if (data) {
                           if (json.error == 1) {
                            if (json.already_exists == 1) {

								if(window.location.pathname == "/engaged-partner-registration/"){
							    	window.location.href = base_url+'/engaged-partner-registration/?userexist=1'
                                }
                                else if(window.location.pathname == "/document.referrer/"){                                  
							    	window.location.href = base_url+'/smpteregistration/?userexist=1'
								}
								else{
									window.location.href = base_url+'/login/?userexist=1'
								}
							}
                            jQuery('#messages').html(json.message) 
                        }
                        if (json.user_success == 1) {                         
                            jQuery('.contact-form h1').after('&lt;div id="registration-messages"&gt;&lt;/div&gt;');
                            jQuery('#registration-messages').html(json.reg_message);
                            if(document.referrer == "https://theiabm.org/smpteregistration/"){
                                window.location.href = base_url+"/business-intelligence-digests/";
                            }  
                            else{
                                //window.location.href = base_url+"/state-of-mediatech-report-nab-2023/";
                                window.location.href = base_url+"/members-area/";
                            }
                        }
                    }
                },
                cache: !1,
                contentType: !1,
                processData: !1
            })
        }
    });

    function showprofileForm(SetCompanyId) {
        jQuery.ajax({
            url: admin_ajax,
            type: 'GET',
            data: {
                action: "showProfileForm",
                'SetCompanyId': SetCompanyId
            },
            success: function(data) {
                jQuery('.form-div').html(data)
            }
        })
    }

    function showOrganisationForm() {
        jQuery.ajax({
            url: admin_ajax,
            type: 'GET',
            data: {
                action: "showOrganisationForm"
            },
            success: function(data) {
                jQuery('.form-div').html(data);
                jQuery('html, body').animate({
                    scrollTop: jQuery('#masthead').offset().top
                }, 'slow')
            }
        })
    }
    jQuery('.my_company_continue').click(function() {
        var get_email = jQuery('#company_email').val();
        var flag = 0;
        var arr_email;
        arr_email = get_email.split('@');
        if(get_email != "" &amp;&amp;  (arr_email[0].indexOf('test') != -1 ||arr_email[1].indexOf('gmail')!= -1 || arr_email[1].indexOf('ymail')!= -1 || arr_email[1].indexOf('hotmail')!= -1 || arr_email[1].indexOf('yopmail')!= -1 ) ) // for yahoo restricted mail arr_email[1].indexOf('yahoo')!= -1 ||
        {
            flag = 1;
            jQuery('#email-error').html("Invalid Email Address");
        }else if (get_email == "") {
            flag = 1;
            jQuery('#email-error').html("This field is required");
            setTimeout(function() {
                jQuery('#email-error').html("");
            }, 2000);
        } else if (!validateEmail(jQuery('#company_email').val())) {
            flag = 1;
            jQuery('#email-error').html("Invalid email address") 
        } else {
            flag = 0;
            jQuery('#email-error').html("")
        }
        if (jQuery('#company_name').val() == '') { 
            flag = 1;
            jQuery('#company-name-error').html("This field is required");
        } else {
            jQuery('#company-name-error').html("")
        } 
        if (jQuery('#user-password').val() == '') {
            flag = 1;
            jQuery('#user_password-error').html("This field is required");
            setTimeout(function() {
                jQuery('#user_password-error').html("");
            }, 2000);
        } else {
            jQuery('#user_password-error').html("")
        } 
        if (jQuery('#user-confirm-password').val() == '') {
            flag = 1;
            jQuery('#user-confirm-password-error').html("This field required");
            setTimeout(function() {
                jQuery('#user-confirm-password-error').html("");
            }, 2000);
        } else {
            if (jQuery('#user-password').val() != jQuery('#user-confirm-password').val()) {
                flag = 1;
                $("#user-password").css({"border-bottom": "1px solid red", "border-bottom-width": "medium"});
                $("#user-confirm-password").css({"border-bottom": "1px solid red", "border-bottom-width": "medium"});
                jQuery('#password-mismatch-error').html("Password does not match")
            } else {
                $("#user-password").css({"border-bottom": "", "border-bottom-width": ""});
                $("#user-confirm-password").css({"border-bottom": "", "border-bottom-width": ""});
                jQuery('#password-mismatch-error').html("")
            }
            jQuery('#user-confirm-password-error').html("")
        } 
        if (flag == 0) {
            jQuery("#user-registration").submit()
        }
    }); 
	/* Password pattern validation  */
    jQuery("#user-registration").validate({
        rules: {
            password: {
				required: true,
                pwcheck: !0,
                minlength: 8,
                maxlength: 20
            }
        },
        messages: {
            password: {
				required: "This is a required field.",
                pwcheck: "Please enter valid password containing atleast one lowercase, one uppercase character and one digit.",
                minlength: "Password should contain minimum 8 characters",
                maxlength: "Password should contain maximum 20 characters"
            }
        }
    });
	jQuery.validator.addMethod("pwcheck", function(value) {
	     return /[a-z]/.test(value) 	
		  &amp;&amp; /[A-Z]/.test(value)
		   &amp;&amp; /[0-9]/.test(value)
		    &amp;&amp; /\d/.test(value)
		   
	});
    jQuery("#user-registration").submit(function() {
        var formData = new FormData(jQuery('#user-registration')[0]);
        $( ".my_company_continue" ).prop( "disabled", true );
        jQuery("&lt;div class='loader-background'&gt;&lt;div id='loader-wrapper'&gt;&lt;div id='loader'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;").insertAfter('.global-loader');
        formData.append('action', 'processEmailAndPassword');
        jQuery.ajax({
            url: admin_ajax,
            type: 'POST',
            data: formData,
            async: !1,
            success: function(data) {
                var json = JSON.parse(data);
                jQuery('.loader-background').remove();
                jQuery('.formWrapper').show();
                if (jQuery('#company_name').length == 0) {
                    //jQuery('#company-dropdown-section').append(json.dropdown_html);
                    jQuery('#company_email').attr("readOnly", "readOnly"); 
                    jQuery('#user-password').attr("readOnly", "readOnly");
                    jQuery('#user-confirm-password').attr("readOnly", "readOnly");
					if(window.location.pathname != "/engaged-partner-registration/"){
						window.location.href = base_url+'/register';
					}
                }
                if (json.already_exists == 1) { 
						 
					if(window.location.pathname == "/engaged-partner-registration/"){
                      
                        window.location.href = base_url+'/engaged-partner-registration/?userexist=1'
                        updateEngagedPartnerRole();
					
                    }
                    else if(window.location.pathname == "/smpteregistration/"){
                        
                        window.location.href = base_url+'/smpteregistration/?userexist=1'
                        updateEngagedPartnerRole();
                       
                    }
					else{
						window.location.href = base_url+'/login/?userexist=1'
					}
                }
            },
            cache: !1,
            contentType: !1,
            processData: !1
        });
        return !1
    })
	function updateEngagedPartnerRole(){
        jQuery.ajax({
            url: admin_ajax,
            type: 'POST',
            data: {
                action: "updateEngagedPartnerRole"
            },
            async: 0,
            success: function(data) {
			}
		});
	}
    jQuery('.tml-button').click(function() {
        $flag = 0;
        $("#user_login").next("span").remove();
        $("#user_pass").next("span").remove();
        if (jQuery('#user_login').val() == '') {
            $flag = 1;
            $("#user_login").after("&lt;span class='validation-error'&gt;This field is required&lt;/span&gt;");
            setTimeout(function() {
                $("#user_login").next("span").fadeOut(400, function() {
                    $(this).remove();
                });
            }, 2000);
        } else {
            $("#user_login").next("span").remove();
        }
        if (jQuery('#user_pass').val() == '') {
            $flag = 1;
            $("#user_pass").after("&lt;span class='validation-error'&gt;This field is required&lt;/span&gt;");
            setTimeout(function() {
                $("#user_pass").next("span").fadeOut(400, function() {
                    $(this).remove();
                });
            }, 2000);
        } else {
            $("#user_pass").next("span").remove();
        }
        if($flag == 0){
            return true;
        }
        return false;
    });
});
(function($) {
    'use strict'
})(jQuery)</pre></body></html>