﻿$(document).ready(function() {

    $('.n43').hide();

    $('.n43 .cancel').click(function() {
        $(this).parents('.n43').slideUp('slow');
    });

    $('.n43').bind('show', function(e, data) {
        var $t = $(this);
        $t.popupLayer(data.clickEvent);
    });

    setPhoneNumberTextBox();

    $('.n43 div.how_to_contact').click(function() {
        var val = $(this).find('input:checked').val();
        if (val != 'aaa') {
            $(this).parents('.n43').find('div.phonenumber').slideDown('slow');
        } else {
            $(this).parents('.n43').find('div.phonenumber').slideUp('slow');
			$(this).parents('.n43').find('div.phonenumber input').val('');
        }
    });
});

function setPhoneNumberTextBox() {
    var val = $('.n43 div.how_to_contact').find('input:checked').val();
    if (val != 'aaa') {
        $('.n43 div.phonenumber').show();
    } else {
        $('.n43 div.phonenumber').hide();
    }
}