executing after i releasing button

how i can execute any function As soon as i releasing GUI button ?

function OnGUI ( ) {
var BTdown = GUI.Button (Rect (320,495,100,50), "Yes");
if(BTdown ){

?????

}
}

if (GUI.Button (Rect (320,495,100,50), “Yes”)) {
//Do something
}

no dear , its execute when i click not when i release the button .
thanks