
function showform( show, hide ) {
	
	
	document.getElementById( hide ).style.display='none'; 	
	document.getElementById( show ).style.display=''; 	
	var hidetab = hide+"tab";
	var showtab = show+"tab"; 
	document.getElementById( hidetab ).className='';  
	document.getElementById( showtab ).className='active';  
}


// bookforms.js/* function to run a function on-load
function addLoadEvent(func) { 
	  var oldonload = window.onload; 
	  if (typeof window.onload != 'function') { 
	    window.onload = func; 
	  } else { 
	    window.onload = function() { 
	      if (oldonload) { 
	        oldonload(); 
	      } 
	      func(); 
	    } 
	  } 
	} 


/* sortlist function 
 *
 * to add active class on the menu depending upon the file currently open 
 *
 */ 
addLoadEvent(function() {
	
	
	if( document.getElementById('bookhtml') ) 
		document.getElementById('bookhtml').innerHTML = ""; 

	
	if( document.getElementById('singlebooktab') && document.getElementById('bookbintab') ) {
		
		// 1. hide the hard titles..
		document.getElementById('singlebooktitle').style.display='none'; 	
		document.getElementById('bookbintitle').style.display='none'; 	
		
		
		// 2. display tab titles 
		document.getElementById('singlebooktab').style.display=''; 	
		document.getElementById('bookbintab').style.display=''; 	
		
		//document.getElementById('singlebooktab').className='active';  
		
		// 3. hide the bin form. // hide both, 
		document.getElementById('bookbin').style.display='none'; 	
		document.getElementById('singlebook').style.display='none'; 	
	
	}
					  
})

