can i declare define funtions in document.ready and use them at more than few places.

can i declare define funtions in document.ready and use them at more than few places.

hi,

    Q1)  should i define and declare this function inside the docuent.ready or outside.

i do not need this x2() function any where else , i need it inside only. 


$(document).ready(function () {  

function x2 ()
{
alert("abc");
}

$('#ddlcomp).change(function (event) {
 x2 ();
});


$('#ddlcust').change(function (event) {
 x2 ();
});



});