  var DynamicBookTabInterface = {
        
        numberOfBooksToDisplay: 0,
        bookTab: "book",
        importedContent: "bookImport",
        previousTab: 0,
  	  	
  	  	init: function(bookNumberInput) {
 
  	  			this.numberOfBooksToDisplay = bookNumberInput + 1;
  	  	        
  	  	        var parentHeader = $("dynamicBookHeader");
  	  		 	var noJSchidToReplace = "jsF";
  	  		 	
  	  		 	for(var i = 1; i < this.numberOfBooksToDisplay; i++){
  	  		 	    bookHeader = document.createElement("SPAN");
  	  		 	    bookHeader.setAttribute("id", this.bookTab + i);	  	  		 	   
  	  		 	    bookHeader.onclick = function() { DynamicBookTabInterface.attachMainContent(this); };

  	  		 	    parentHeader.appendChild(bookHeader);
  	  		 	}
  	  		 	 
  	  		 	for(var i = 1; i < this.numberOfBooksToDisplay; i++){
  	  		 		var check = $(this.bookTab + i);
  	  		 		$(this.bookTab + i).innerHTML = "<p id=\"bookTabCopy" + i + "\" " + "class=\" bookTabHeader pointer\">Book" + i + "<\/p>";
  	  		 	}
  	  		 	
  	  		 	this.attachMainContent("1", noJSchidToReplace);
  	  	},
  	  	
  	  	attachMainContent: function(tabClicked, noJSchidToReplace){  
  	  	        
  	  	        
  	  	        var that_id = null;
  	  	        var tabClickedNumber = null;
                var newContentID = this.importedContent + tabClicked;
  	  	        var oldContentID = this.importedContent + this.previousTab;

  	  	        if(noJSchidToReplace) {
  	  	        	oldContentID = noJSchidToReplace;
  	  	        	$(oldContentID).innerHTML = " ";
  	  	        	tabClickedNumber = "1";
  	  	        } else {
  	  	            that_id = tabClicked.id;
  	  	            tabClickedNumber = that_id.substring(that_id.length - 1);
                    newContentID = this.importedContent + tabClickedNumber;  	  	        
  	  	        }
  	  	        

  	  	        if(newContentID == oldContentID) return;
  	  	        var oldContentObject = $(oldContentID);
  	  	        var newContentObject = $(newContentID);
  	  	        var parentNodeContnetObject = $("dynamicContent");
  	  	        var parentNodeImportObject = $("dynamicBookDisplayImport");
  	  	        

  	  	        
	  	        parentNodeImportObject.appendChild(oldContentObject);
	  	        Effect.Fade(document.getElementById(oldContentID));
	  	        parentNodeContnetObject.appendChild(newContentObject);
                Effect.Appear(document.getElementById(newContentID));
  	  			this.styleBookTabHeading(tabClickedNumber);
  	  	},
  	  	
  	  	styleBookTabHeading: function(tabToStyle) {

  	  	        $(this.bookTab + "TabCopy" + tabToStyle).setAttribute("class", "bookTabHeader");
  	  			$(this.bookTab + tabToStyle).setAttribute((document.all ? "className" : "class"), "activeTab");
  	  			
  	  			if (this.previousTab != 0) {
  	  				$(this.bookTab + this.previousTab).setAttribute((document.all ? "className" : "class"), "pointer");
  	  			}
  	  			
  	  			this.previousTab = tabToStyle;
  	  	
  	  	}
  
  };