
SIV.addHandlers({


    request: function(success, data){
    
        $('.sivform-loading').hide();
        if (success) {
          
            $('#content_text').html('<div style="padding:30px;margin:auto;"><p>' +
            "Thank you for your submitting your details. We will check your details are up to date within 48 hours. You'll then be able to register to book online at Sheffield Network.</p><p>" + 
			"We hope you look forward to booking online at Sheffield Network." + 

'</p></div>');
            document.location = document.location + "#topLink_container";
        }
        else {
            $('.sivform-error').html(data.error);
            $('.sivform-error').show();
        }
    }
   
	
});


$(function(){
   
    
    
    
    $('#siv-form-submit').click(function(ev){
        if ($(this).hasClass('blue-button-disabled')) {
            ev.preventDefault();
            ev.target.blur();
            return false;
        }
		
        $('.sivform-error').hide();
        $('.sivform-loading').show();
        SIV.ajaxCall({
            url: '/aboutYou/ajax/request/',
            handler: 'request',
            form: 'request-form'
        });
        
        return false;
    });
    
   
	
	
	
    
    $('#txtBirthDay_4').autotab({
        target: 'txtBirthMonth_4',
        format: 'numeric'
    });
    $('#txtBirthMonth_4').autotab({
        target: 'txtBirthYear_4',
        format: 'numeric',
        previous: 'txtBirthDay_4'
    });
    $('#txtBirthYear_4').autotab({
        target: 'txtPostcode',
        previous: 'txtBirthMonth_4',
        format: 'numeric'
    });
	
	
	
    
    $('.help-icon[title]').qtip({
        style: {
            name: 'blue',
            tip: 'leftMiddle',
            background: '#458FDF',
            color: '#ffffff',
            textAlign: 'center',
            border: {
                width: 7,
                radius: 5,
                color: '#004C9E'
            }
        },
        position: {
            corner: {
                target: 'rightMiddle',
                tooltip: 'leftMiddle'
            }
        }
    
    })
   
    
   
});

