function onEndCrop( coords, dimensions ) {
 if( $( 'x1' ) != undefined)
	{
    $( 'x1' ).value = coords.x1;
    $( 'y1' ).value = coords.y1;
    $( 'x2' ).value = coords.x2;
    $( 'y2' ).value = coords.y2;
    $( 'width' ).value = dimensions.width;
    $( 'height' ).value = dimensions.height;
	}
}

//NOTE!
// for this time i need 2 functions because one executed by onload
// second by ajax success


/////for callback success param in resize photo link.  
function init_cr() {
    new Cropper.ImgWithPreview(
    'testImage',
    {
        minWidth: 200,
        minHeight: 120,
            maxWidth: 300,
            maxHeight: 300,

        ratioDim: { x: 200, y: 120 },
        displayOnInit: true,
        onEndCrop: onEndCrop
    }
	);
}