How do I show GUI texture when I click an Object?

Hi I am creating a diary page system so when you click on a page, the gui shows up on your screen. How would I go about doing this. I would also like to know how to get rid of it by pressing a key. Here is the code I have now:

var diary : GUITexture;

function Start (){

diary.enabled=false;

}

function Update () {

	if (Input.OnMouseUp){
	if (diary.enabled){
	diary.enabled = false;
	}
	else {
	diary.enabled = true;
	

}
}
}

If you want to show the texture if the user clicks anywhere you can do:

#pragma strict

var diary : GUITexture;
 
function Start (){
	diary.enabled=false;
}
 
function Update () {
if (Input.GetMouseButton(0)){
	diary.enabled = true;
}
else {
	diary.enabled = false;
}

}

To only show it if you click on a specific object, attach this to the object (which must have a collider):

#pragma strict

var diary : GUITexture;
 
function Start (){
	diary.enabled=false;
}
 
function OnMouseDown() {
	diary.enabled=true;
}

function OnMouseUp() {

	diary.enabled=false;
}

or, you could make it so the game is paused when you click on it, plus a paper pickup sound.

#pragma strict

private var pauseEnabled = false;	

var sound : AudioClip;

var diary : GUITexture;
 
function Start (){
    diary.enabled=false;
}
 
function OnMouseDown(){
	if(pauseEnabled == true)
			//unpause the game
			pauseEnabled = false;
			Time.timeScale = 1;
			AudioListener.volume = 1;
			Screen.showCursor = false;	
		if(pauseEnabled == false)
			pauseEnabled = true;
			AudioListener.volume = 1;
			Time.timeScale = 0;
			Screen.showCursor = true;
	diary.enabled=true;
audio.Play();
}
 
function OnMouseUp(){	
			pauseEnabled = false;
			Time.timeScale = 1;
			AudioListener.volume = 1;
			Screen.showCursor = false;	
	diary.enabled=false;
}