how to pass variable from one function to another function in javascript
<pre><code>var chart;
var d = new Array();

function click() {
    d = document.getElementById('graph:hi').value;
    alert(d);
}
var c = new Array(66, 15, 2.5, 21.9, 25.2, 23.0, 22.6, 21.2, 19.3, 16.6, 14.8);
alert(c);
jQuery(document).ready(function (e) {
    chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            defaultSeriesType: 'spline',
            ignoreHiddenSeries: false
        },
        title: {
            text: 'Height Report'
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: ['0', '0.5', '1.5', '2.5', '3.5', '4.5', '5.5', '6.5', '7.5', '8.5', '9.5', '10.5', '11.5', '12.5', '13.5', '14.5', '15.5', '16.5', '17.5', '18.5', '19.5', '20.5', '21.5', '22.5', '23.5', '24.5', '25.5', '26.5', '27.5', '28.5', '29.5', '30.5', '31.5', '32.5', '33.5', '34.5', '35.5']
        },
        yAxis: {
            title: {
                text: 'Percentage'
            },
            labels: {
                formatter: function () {
                    return this.value + '%';
                }
            }
        },
        tooltip: {
            formatter: function () {
                return '' + this.x + ': ' + this.y;
            }
        },
        plotOptions: {
            spline: {
                marker: {
                    radius: 3,
                    lineColor: '#666666',
                    lineWidth: 1
                }
            }
        },
        series: [{
            name: 'Pecentile 3',
            data: c
        }, {
            name: 'Pecentile 10',
            data: d
        }]
    });
});
</code></pre>

<p>from XHTML i get regularvalue and getted in click() function. jQuery(document).ready(function(e){}) is a graph plotting code..i want to pass d value from click() to jquery function.but i can't get the values in jquery function.thank you</p>
