// JavaScript Document
var books_container=new Array('all_books','books-for-babies','books-for-birthdays','books-for-girls','books-for-boys','holiday-books','educational-books','special_book','religious_book','fun_for_adults','sports_book');

var active_class='book_grey_txt';
var deactive_class='book_blue_link';
var all_showall=0;

for(i=1;i<books_container.length;i++) {
    if(document.getElementById(books_container[i]))
       hide_div(books_container[i]);
	
}

function show_div(div) {
  if(document.getElementById(div))
  {
     manage_right_section(div);
     document.getElementById(div).style.display='';
     document.getElementById(div).style.visibility='visible';
    /* document.getElementById(div).style.height='538px';*/
     if(all_showall==0)
       set_active_class(div);    
  }

  
}

function set_active_class(div) {
  if(document.getElementById('link_'+div))
  {
    document.getElementById('link_'+div).className=active_class;  
  }
 
}

function set_inactive_class(div) {
  document.getElementById('link_'+div).className=deactive_class;
}


function hide_div(div) {
  if(document.getElementById(div))
  {
    document.getElementById(div).style.display='none';
    document.getElementById(div).style.visibility='hidden';
    //document.getElementById(div).style.height='0px';
    set_inactive_class(div);    
  }

}

function show_books(div,showall) {
    all_showall=showall;
    if(showall==0) {
	   for(i=0;i<books_container.length;i++) {
		   if(books_container[i]==div) {
			  show_div(div);
		   } else  {
			  hide_div(books_container[i]);
		   }
	   }
	  // set_inactive_class(books_container[(books_container.length)-1]);
	} else {
	   for(i=0;i<books_container.length-1;i++) {
		  show_div(books_container[i]);
		  set_inactive_class(books_container[i]);
	   }
	   set_active_class(books_container[(books_container.length)-1]);
	}
}


function manage_right_section(id) {
	  if(id=="books-for-birthdays") {
	      change_content(document.getElementById('my_birthday_wish_img'),'my_birthday_wish_1','My Birthday Wish','http://www.savisites.com/cab/interactive/load.php?product=My%20Birthday%20Wish');
	   }
	
	   if(id=="books-for-girls") {
	      change_content(document.getElementById('tea_party_img'),'my_tea_party_1','My Tea Party','http://www.savisites.com/cab/interactive/load.php?product=My%20Tea%20Party');
       }
	
	   if(id=="educational-books") {
	      change_content(document.getElementById('educational_img'),'my_first_day_of_school_1','My First Day of School','http://www.savisites.com/cab/interactive/load.php?product=My First Day of School');
	   }

	   if(id=="books-for-babies" || id=="books-for-boys" || id=="holiday-books" || id=="special_book" || id=="all_books") {
	      change_content(document.getElementById('cottontail_mystery'),'the_cottontail_mystery_1','The Cottontail Mystery','http://www.savisites.com/cab/interactive/load.php?product=The%20Cottontail%20Mystery');
	   }

	   if(id=="religious_book") {
	      change_content(document.getElementById('god_special_gifts_to_me_img'),'god_special_gifts_to_me_1','God\&#039;s Special Gifts To Me','http://www.savisites.com/cab/interactive/load.php?product=God\'s%20Special%20Gifts%20To%20Me');
	   }

	   if(id=="fun_for_adults") {
	      change_content(document.getElementById('happy_anniversary_img'),'happy_anniversary_1','Happy Anniversary','http://www.savisites.com/cab/interactive/load.php?product=Wedding%20Memories%20/%20Anniversary');
	   }

	   if(id=="sports_book") {
	      change_content(document.getElementById('the_ballerina_princess_img'),'the_ballerina_princess_1','The Ballerina Princess','http://www.savisites.com/cab/interactive/load.php?product=The%20Ballerina%20Princess');
	   }
}


(function() { var IE = /*@cc_on!@*/false; if (!IE) { return; } if (document.compatMode && document.compatMode == 'BackCompat') { if (document.getElementById("af-form-2122121555")) { document.getElementById("af-form-2122121555").className = 'af-form af-quirksMode'; } if (document.getElementById("af-body-2122121555")) { document.getElementById("af-body-2122121555").className = "af-body inline af-quirksMode"; } if (document.getElementById("af-header-2122121555")) { document.getElementById("af-header-2122121555").className = "af-header af-quirksMode"; } if (document.getElementById("af-footer-2122121555")) { document.getElementById("af-footer-2122121555").className = "af-footer af-quirksMode"; } } })();
							
