Jcrop in .dialog()
<p>I make Jcrop inside .dialog() function. runs great, but i can't pass my X and Y, etc. values!</p>

<p>function "updateCoords" works, but i cant passe it values throe Ajax! Fire Bug say that variables that I want to passe throe POST are not defined, but "HOW!" - i define variables in function updateCoords()! XD</p>

<pre><code>function open_original(gallery_id, image_name){
    $("#image_crop_canves").dialog({
        modal:true,
        width:634,
        height:741,
        buttons:{
            "SAVE":function(){
                $.ajax({
                    url: "send.php",
                    type: "POST",
                    data: "a=crop&amp;x="+cx+"&amp;y="+cy+"&amp;w="+cw+"&amp;h="+ch+"&amp;gid="+gallery_id+"&amp;id="+image_name,

                    success: function(){
                        $("#image_crop_canves").dialog('close');
                        window.location();
                    }
                });
            },
            "CLOSE":function(){
                $("#image_crop_canves").dialog('close');
            }
        }
    });

    $("#image_crop").html("&lt;div id=\"image_holder_crop\"&gt;&lt;img id=\"cropbox\" src=\"../../pics/gallery/" + gallery_id + "/original/" + image_name + "\" /&gt;&lt;/div&gt;");

    $("#image_crop_canves").dialog('open');

    function updateCoords(c) {
        var cx = c.x;
        var cy = c.y;
        var cx2 = c.x2;
        var cy2 = c.y2;
        var cw = c.w;
        var ch = c.h;
    }

    $('#cropbox').Jcrop({
        aspectRatio: 140/360,
        onSelect: updateCoords,
        setSelect: [0, 0, 140, 360],
        minSize: [140, 360]
    });
}
</code></pre>
