Pick up and drop rigidbody

I'm having a slight problem making a custom pickup/drop script.

Essentially what I'm after is allowing the player to left-click an object and have it parented to the player, move around the scene and drop the object with another left-click.

I have many different objects the player can pick up, varying in shape and size. A problem I encountered was that the object didn't always sit perfectly to allow me to click ON it to release. To counter this I've implemented a system where the player clicks ON an object to pick it up, but can then click anywhere to release it.

The new problem I've encountered and have so far been unable to fix is that the left-click in the Update function is set off at the same time as the OnMouseDown function and the player picks up and drops the object at the same time.

Any ideas how I can get around this?

var pickupDistance = 3.0;
static var heldObject : GameObject;
static var itemHeld = false;
var objectDist = -.1;
private var hand :GameObject;

function Start() {
    hand = gameObject.FindWithTag("Player");
}

function Update () {
    if (Input.GetMouseButtonUp(0) && itemHeld == true) {
        hand.animation.Play("drop");
        heldObject.transform.parent = null;
        heldObject.GetComponent(Rigidbody).isKinematic = false;
        heldObject = null;
        itemHeld = false;
    }
}

function OnMouseDown() {
    if(itemHeld == false) {
        heldObject = gameObject;
        hand.animation.Play("grab");
        heldObject.transform.parent = gameObject.FindWithTag("Player").transform;
        heldObject.GetComponent(Rigidbody).isKinematic = true;
        var handLocation = Vector3(0,objectDist,0);
        heldObject.transform.localPosition = handLocation;
        itemHeld = true;
    }
}

This is simple. Try this:

var pickupDistance = 3.0;
static var heldObject : GameObject;
static var itemHeld = 0;
var objectDist = -.1;
private var hand :GameObject;

function Start() {
    hand = gameObject.FindWithTag("Player");
}

function Update () {
    if (Input.GetMouseButtonDown(0) && itemHeld == 2) {
        hand.animation.Play("drop");
        heldObject.transform.parent = null;
        heldObject.GetComponent(Rigidbody).isKinematic = false;
        heldObject = null;
        itemHeld = 0;
    }
}

function OnMouseDown() {
    if(itemHeld == 0) {
        heldObject = gameObject;
        hand.animation.Play("grab");
        heldObject.transform.parent = gameObject.FindWithTag("Player").transform;
        heldObject.GetComponent(Rigidbody).isKinematic = true;
        var handLocation = Vector3(0,objectDist,0);
        heldObject.transform.localPosition = handLocation;
        itemHeld = 1;
    }
}

function OnMouseUp(){
    if(itemHeld == 1)
    {
      itemHeld = 2;
    }
}

Hey could you possibly
translate it to C#?