//	<h1 ID="myHeading">The Heading</h1>
//	<p onclick="setStyle('myHeading','visibility','visible')">
//	Click this text to show the heading.
//	</p>
//	<p onclick="setStyle('myHeading','visibility','hidden')">
//	Click this text to hide the heading.
//	</p>
//	<p onclick="setClassName('myDiv','red');">
//	Click this text to change the class for the div below to .red.
//	</p>
//	<p onclick="setClassName('myDiv','blue');">
//	Click this text to change the class for the div below to .blue.
//	</p>
//	<p onclick="toggleStyle('myHeading','color','green','black')">
//	Click this text to toggle style for the Heading.
//	</p>
//	<p onclick="toggleStyle(this,'fontSize','large','small')">
//	Click this text to toggle style for this text.
//	</p>
//	<div id="myDiv" class="blue">
//	<br><br>
//	<h2 onclick="toggleStyle('myDiv', 'backgroundImage','url(http://www.ziguras.com/images/fish.gif)',
//	'url(http://www.ziguras.com/images/dots.gif)')">
//	Click this text to toggle the background image for this div.
//	</h2>
//	<br><br>
//	</div>
//	<br><br>
//	<div onclick='toggleClassName(this,"red","blue")' class="blue">
//	Click this div to toggle its class between .blue and .red.
//	</div> 


function getRef(obj){
        return (typeof obj == "string") ?
        document.getElementById(obj) : obj;
}
function setStyle(obj,style,value){
        getRef(obj).style[style]= value;
}
function setClassName(obj, className){
        getRef(obj).className= className;
}
function toggleStyle(obj, style, value1, value2){
        obj= getRef(obj);
        // obj.isValue1 will be false the first time.
        if(!obj.isValue1){
                obj.style[style]= value1;
                obj.isValue1= true;
        }
        else{
                obj.style[style]= value2;
                obj.isValue1= false;
        }
}
function toggleClassName(obj, class1, class2){
        obj= getRef(obj);
        // obj.isClass1 will be false the first time.
        if(!obj.isClass1){
                obj.className= class1;
                obj.isClass1= true;
        }
        else{
                obj.className= class2;
                obj.isClass1= false;
        }
}