I have always been lead to believe that local variable can only be modified by the function in which they are called! And global variables exactly the opposite! But I have found a way in which it is possible! Im not saying its a bad thing I very happy to find this out in fact! But why is this possible doesnt it contradict the whole idea global and local variables!

Code:
<html>
<head>
<script>
function bttnInfo(){
   var isClicked, id;
   this.isClicked=false;
   this.is=null;
} 
bttnInfo=new bttnInfo();
function clicked(id){
   if(bttnInfo.isClicked){
 bttnInfo.isClicked=false;
 bttnInfo.id=null;
 alert(bttnInfo.isClicked);
 alert(bttnInfo.id);
	}
	else{
 bttnInfo.isClicked=true;
 bttnInfo.id=id;
 alert(bttnInfo.isClicked);
 alert(bttnInfo.id);
	}
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0066FF" vlink="#0066FF" alink="#0066FF">
<form name="frm">
<input type="button" value="click" id="button1" onclick="clicked(this.id)">
</form>
</body>
</html>