/* 

Author: Soh Tanaka
http://www.sohtanaka.com/
April 26, 2010


*/
// script for simple inline show/hide div -- book reviews

// Get object based on Browsers capabilities
function getElementWithId(id){
    var obj;
    if(document.getElementById){
        /* Prefer the widely supported W3C DOM method, if
           available:-
        */
        obj = document.getElementById(id);
    }else if(document.all){
        /* Branch to use document.all on document.all only
           browsers. Requires that IDs are unique to the page
           and do not coincide with NAME attributes on other
           elements:-
        */
        obj = document.all[id];
    }else if(document.layers){
        /* Branch to use document.layers, but that will only work for
           CSS positioned elements and LAYERs that are not nested. A
           recursive method might be used instead to find positioned
           elements within positioned elements but most DOM nodes on
           document.layers browsers cannot be referenced at all.
        */
        obj = document.layers[id];
    }
    /* If no appropriate/functional element retrieval mechanism
       exists on this browser this function returns null:-
    */
    return obj||null;
}

function showDiv(obj) {
	var item
	item = getElementWithId(obj);
	item.style.display = "inline";
	return false;
}
function hideDiv(obj) {
	var item
	item = getElementWithId(obj);
	item.style.display = "none";
	return false;
}

