How to move GameObject by mouseclick?

When I click left mouse button the object must rotate to that point and move there. Rotate by Y axis and move forward by Z axis. Like in Diablo 2. How can I do this using Javascript?

Answer found.

`var plrCam : Camera;
var moveSpeed : int = 5;
var rotateSpeed : int = 1;
var targPos : Vector3;

function Update () {
if(Input.GetMouseButtonDown(0)) {
var ray = plrCam.ScreenPointToRay (Input.mousePosition);
var hit : RaycastHit;
if (Physics.Raycast(ray, hit))
targPos = hit.point;
}
var targDir = targPos - transform.position;
var targDist = Vector3.Distance(transform.position, targPos);
if (targDist > 1.5) {
transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation(targDir), rotateSpeed * Time.deltaTime);
transform.rotation.z = 0; transform.rotation.x = 0;
transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
}
}`