function toggle_visibility(id) {
	var g = document.getElementById(id);
	if(g.style.display == 'none')
		g.style.display = 'block';
	else
		g.style.display = 'none';
}

function show(id) {
	var f = document.getElementById(id);
	if(f) {
		f.style.display = 'block';
	}
}

function show_all() {
/*Block level elements*/
	show('address_printpage_01');
	show('address_samp_code_01');
	show('address_comments_01');
	show('address_printpage_02');
	show('address_samp_code_02');
	show('address_comments_02');
	show('author_printpage_01');
	show('author_samp_code_01');
	show('author_comments_01');
	show('author_printpage_02');
	show('author_samp_code_02');
	show('author_comments_02');
	show('bridgehead_printpage_01');
	show('bridgehead_samp_code_01');
	show('bridgehead_comments_01');
	show('bridgehead_printpage_02');
	show('bridgehead_samp_code_02');
	show('bridgehead_comments_02');
	show('linegroup_printpage_01');
	show('linegroup_samp_code_01');
	show('linegroup_comments_01');
	show('linegroup_printpage_02');
	show('linegroup_samp_code_02');
	show('linegroup_comments_02');
	show('list_printpage_01');
	show('list_samp_code_01');
	show('list_comments_01');
	show('list_printpage_02');
	show('list_samp_code_02');
	show('list_comments_02');
	show('list_printpage_03');
	show('list_samp_code_03');
	show('list_comments_03');
	show('list_printpage_04');
	show('list_samp_code_04');
	show('list_comments_04');
	show('p_printpage_01');
	show('p_samp_code_01');
	show('p_comments_01');
	show('p_printpage_02');
	show('p_samp_code_02');
	show('p_comments_02');
	show('prodnote_printpage_01');
	show('prodnote_samp_code_01');
	show('prodnote_comments_01');
	show('prodnote_printpage_02');
	show('prodnote_samp_code_02');
	show('prodnote_comments_02');
	show('blockquote_printpage_01');
	show('blockquote_samp_code_01');
	show('blockquote_comments_01');
	show('blockquote_printpage_02');
	show('blockquote_samp_code_02');
	show('blockquote_comments_02');
	show('sidebar_printpage_01');
	show('sidebar_samp_code_01');
	show('sidebar_comments_01');
	show('sidebar_printpage_02');
	show('sidebar_samp_code_02');
	show('sidebar_comments_02');
	show('sidebar_printpage_03');
	show('sidebar_samp_code_03');
	show('sidebar_comments_03');
	show('byline_printpage_01');
	show('byline_samp_code_01');
	show('byline_comments_01');
	show('epigraph_printpage_01');
	show('epigraph_samp_code_01');
	show('epigraph_comments_01');
	show('epigraph_printpage_02');
	show('epigraph_samp_code_02');
	show('epigraph_comments_02');
	show('note_printpage_01');
	show('note_samp_code_01');
	show('note_comments_01');
	show('note_printpage_02');
	show('note_samp_code_02');
	show('note_comments_02');
	show('annotation_printpage_01');
	show('annotation_samp_code_01');
	show('annotation_comments_01');
	show('annotation_printpage_02');
	show('annotation_samp_code_02');
	show('annotation_comments_02');
	show('poem_printpage_01');
	show('poem_samp_code_01');
	show('poem_comments_01');
	show('poem_printpage_02');
	show('poem_samp_code_02');
	show('poem_comments_02');
	show('samp_printpage_01');
	show('samp_samp_code_01');
	show('samp_comments_01');
	show('kbd_printpage_01');
	show('kbd_samp_code_01');
	show('kbd_comments_01');
	show('dateline_printpage_01');
	show('dateline_samp_code_01');
	show('dateline_comments_01');
	show('linenum_printpage_01');
	show('linenum_samp_code_01');
	show('linenum_comments_01');


/*Inline level elements*/
	show('abbr_printpage_01');
	show('abbr_samp_code_01');
	show('abbr_comments_01');
	show('abbr_printpage_02');
	show('abbr_samp_code_02');
	show('abbr_comments_02');
	show('acronym_printpage_01');
	show('acronym_samp_code_01');
	show('acronym_comments_01');
	show('acronym_printpage_02');
	show('acronym_samp_code_02');
	show('acronym_comments_02');
	show('dfn_printpage_01');
	show('dfn_samp_code_01');
	show('dfn_comments_01');
	show('dfn_printpage_02');
	show('dfn_samp_code_02');
	show('dfn_comments_02');
	show('strong_printpage_01');
	show('strong_samp_code_01');
	show('strong_comments_01');
	show('strong_printpage_02');
	show('strong_samp_code_02');
	show('strong_comments_02');
	show('em_printpage_01');
	show('em_samp_code_01');
	show('em_comments_01');
	show('em_printpage_02');
	show('em_samp_code_02');
	show('em_comments_02');
	show('pagenum_printpage_01');
	show('pagenum_samp_code_01');
	show('pagenum_comments_01');
	show('pagenum_printpage_02');
	show('pagenum_samp_code_02');
	show('pagenum_comments_02');
	show('pagenum_comments_03');
	show('pagenum_printpage_03');
	show('pagenum_samp_code_03');
	show('pagenum_comments_03');
	show('q_printpage_01');
	show('q_samp_code_01');
	show('q_comments_01');
	show('q_printpage_02');
	show('q_samp_code_02');
	show('q_comments_02');
	show('sent_printpage_01');
	show('sent_samp_code_01');
	show('sent_comments_01');
	show('sent_printpage_02');
	show('sent_samp_code_02');
	show('sent_comments_02');
	show('span_printpage_01');
	show('span_samp_code_01');
	show('span_comments_01');
	show('span_printpage_02');
	show('span_samp_code_02');
	show('span_comments_02');
	show('sup_printpage_01');
	show('sup_samp_code_01');
	show('sup_comments_01');
	show('sup_printpage_02');
	show('sup_samp_code_02');
	show('sup_comments_02');
	show('sub_printpage_01');
	show('sub_samp_code_01');
	show('sub_comments_01');
	show('sub_printpage_02');
	show('sub_samp_code_02');
	show('sub_comments_02');
	show('w_printpage_01');
	show('w_samp_code_01');
	show('w_comments_01');
	show('prodnote_inline_printpage_01');
	show('prodnote_inline_samp_code_01');
	show('prodnote_inline_comments_01');
	show('prodnote_inline_printpage_02');
	show('prodnote_inline_samp_code_02');
	show('prodnote_inline_comments_02');
	show('br_printpage_01');
	show('br_samp_code_01');
	show('br_comments_01');
	show('br_printpage_02');
	show('br_samp_code_02');
	show('br_comments_02');
	show('bdo_printpage_01');
	show('bdo_samp_code_01');
	show('bdo_comments_01');

/*Misc elements*/
	show('imggroup_printpage_01');
	show('imggroup_samp_code_01');
	show('imggroup_comments_01');
	show('imggroup_printpage_02');
	show('imggroup_samp_code_02');
	show('imggroup_comments_02');
	show('table_printpage_01');
	show('table_samp_code_01');
	show('table_comments_01');
	show('table_printpage_02');
	show('table_samp_code_02');
	show('table_comments_02');

/*Major Elements*/
	show('frontmatter_printpage_01');
	show('frontmatter_samp_code_01');
	show('frontmatter_comments_01');
	show('doctitle_printpage_01');
	show('doctitle_samp_code_01');
	show('doctitle_comments_01');
	show('docauthor_printpage_01');
	show('docauthor_samp_code_01');
	show('docauthor_comments_01');
	show('titlepage_printpage_01');
	show('titlepage_samp_code_01');
	show('titlepage_comments_01');
	show('acknowledgments_printpage_01');
	show('acknowledgments_samp_code_01');
	show('acknowledgments_comments_01');
	show('dedication_printpage_01');
	show('dedication_samp_code_01');
	show('dedication_comments_01');
	show('preface_printpage_01');
	show('preface_samp_code_01');
	show('preface_comments_01');
	show('TOC_printpage_01');
	show('TOC_samp_code_01');
	show('TOC_comments_01');
	show('TOC_printpage_02');
	show('TOC_samp_code_02');
	show('TOC_comments_02');
	show('bodymatter_printpage_01');
	show('bodymatter_samp_code_01');
	show('bodymatter_comments_01');
	show('part_printpage_01');
	show('part_samp_code_01');
	show('part_comments_01');
	show('chapter_printpage_01');
	show('chapter_samp_code_01');
	show('chapter_comments_01');
	show('section_printpage_01');
	show('section_samp_code_01');
	show('section_comments_01');
	show('rearmatter_printpage_01');
	show('rearmatter_samp_code_01');
	show('rearmatter_comments_01');
	show('appendix_printpage_01');
	show('appendix_samp_code_01');
	show('appendix_comments_01');
	show('glossary_printpage_01');
	show('glossary_samp_code_01');
	show('glossary_comments_01');
	show('bibliography_printpage_01');
	show('bibliography_samp_code_01');
	show('bibliography_comments_01');
	show('index_printpage_01');
	show('index_samp_code_01');
	show('index_comments_01');

    /* MathML examples */
    show('mathml_01');
    show('math_samp_code_01');
    show('math_comments_01');
    show('mathml_02');
    show('math_samp_code_02');
    show('math_comments_02');
    show('mathml_03');
    show('math_samp_code_03');
    show('math_comments_03');    

}


function hide(id) {
	var h = document.getElementById(id);
	if(h) {
		h.style.display = 'none';
	}
}

function hide_all() {
/*Block level elements*/
	hide('address_printpage_01');
	hide('address_samp_code_01');
	hide('address_comments_01');
	hide('address_printpage_02');
	hide('address_samp_code_02');
	hide('address_comments_02');
	hide('author_printpage_01');
	hide('author_samp_code_01');
	hide('author_comments_01');
	hide('author_printpage_02');
	hide('author_samp_code_02');
	hide('author_comments_02');
	hide('bridgehead_printpage_01');
	hide('bridgehead_samp_code_01');
	hide('bridgehead_comments_01');
	hide('bridgehead_printpage_02');
	hide('bridgehead_samp_code_02');
	hide('bridgehead_comments_02');
	hide('linegroup_printpage_01');
	hide('linegroup_samp_code_01');
	hide('linegroup_comments_01');
	hide('linegroup_printpage_02');
	hide('linegroup_samp_code_02');
	hide('linegroup_comments_02');
	hide('list_printpage_01');
	hide('list_samp_code_01');
	hide('list_comments_01');
	hide('list_printpage_02');
	hide('list_samp_code_02');
	hide('list_comments_02');
	hide('list_printpage_03');
	hide('list_samp_code_03');
	hide('list_comments_03');
	hide('list_printpage_04');
	hide('list_samp_code_04');
	hide('list_comments_04');
	hide('p_printpage_01');
	hide('p_samp_code_01');
	hide('p_comments_01');
	hide('p_printpage_02');
	hide('p_samp_code_02');
	hide('p_comments_02');
	hide('prodnote_printpage_01');
	hide('prodnote_samp_code_01');
	hide('prodnote_comments_01');
	hide('prodnote_printpage_02');
	hide('prodnote_samp_code_02');
	hide('prodnote_comments_02');
	hide('blockquote_printpage_01');
	hide('blockquote_samp_code_01');
	hide('blockquote_comments_01');
	hide('blockquote_printpage_02');
	hide('blockquote_samp_code_02');
	hide('blockquote_comments_02');
	hide('sidebar_printpage_01');
	hide('sidebar_samp_code_01');
	hide('sidebar_comments_01');
	hide('sidebar_printpage_02');
	hide('sidebar_samp_code_02');
	hide('sidebar_comments_02');
	hide('byline_printpage_01');
	hide('byline_samp_code_01');
	hide('byline_comments_01');
	hide('byline_printpage_02');
	hide('byline_samp_code_02');
	hide('byline_comments_02');
	hide('epigraph_printpage_01');
	hide('epigraph_samp_code_01');
	hide('epigraph_comments_01');
	hide('epigraph_printpage_02');
	hide('epigraph_samp_code_02');
	hide('epigraph_comments_02');
	hide('note_printpage_01');
	hide('note_samp_code_01');
	hide('note_comments_01');
	hide('note_printpage_02');
	hide('note_samp_code_02');
	hide('note_comments_02');
	hide('annotation_printpage_01');
	hide('annotation_samp_code_01');
	hide('annotation_comments_01');
	hide('annotation_printpage_02');
	hide('annotation_samp_code_02');
	hide('annotation_comments_02');
	hide('samp_printpage_01');
	hide('samp_samp_code_01');
	hide('samp_comments_01');
	hide('kbd_printpage_01');
	hide('kbd_samp_code_01');
	hide('kbd_comments_01');
	hide('dateline_printpage_01');
	hide('dateline_samp_code_01');
	hide('dateline_comments_01');
	hide('linenum_printpage_01');
	hide('linenum_samp_code_01');
	hide('linenum_comments_01');


/*Inline level elements*/
	hide('abbr_printpage_01');
	hide('abbr_samp_code_01');
	hide('abbr_comments_01');
	hide('abbr_printpage_02');
	hide('abbr_samp_code_02');
	hide('abbr_comments_02');
	hide('acronym_printpage_01');
	hide('acronym_samp_code_01');
	hide('acronym_comments_01');
	hide('acronym_printpage_02');
	hide('acronym_samp_code_02');
	hide('acronym_comments_02');
	hide('dfn_printpage_01');
	hide('dfn_samp_code_01');
	hide('dfn_comments_01');
	hide('dfn_printpage_02');
	hide('dfn_samp_code_02');
	hide('dfn_comments_02');
	hide('strong_printpage_01');
	hide('strong_samp_code_01');
	hide('strong_comments_01');
	hide('strong_printpage_02');
	hide('strong_samp_code_02');
	hide('strong_comments_02');
	hide('em_printpage_01');
	hide('em_samp_code_01');
	hide('em_comments_01');
	hide('em_printpage_02');
	hide('em_samp_code_02');
	hide('em_comments_02');
	hide('pagenum_printpage_01');
	hide('pagenum_samp_code_01');
	hide('pagenum_comments_01');
	hide('pagenum_printpage_02');
	hide('pagenum_samp_code_02');
	hide('pagenum_comments_02');
	hide('pagenum_comments_03');
	hide('pagenum_printpage_03');
	hide('pagenum_samp_code_03');
	hide('pagenum_comments_03');
	hide('q_printpage_01');
	hide('q_samp_code_01');
	hide('q_comments_01');
	hide('q_printpage_02');
	hide('q_samp_code_02');
	hide('q_comments_02');
	hide('sent_printpage_01');
	hide('sent_samp_code_01');
	hide('sent_comments_01');
	hide('sent_printpage_02');
	hide('sent_samp_code_02');
	hide('sent_comments_02');
	hide('span_printpage_01');
	hide('span_samp_code_01');
	hide('span_comments_01');
	hide('span_printpage_02');
	hide('span_samp_code_02');
	hide('span_comments_02');
	hide('sup_printpage_01');
	hide('sup_samp_code_01');
	hide('sup_comments_01');
	hide('sup_printpage_02');
	hide('sup_samp_code_02');
	hide('sup_comments_02');
	hide('sub_printpage_01');
	hide('sub_samp_code_01');
	hide('sub_comments_01');
	hide('sub_printpage_02');
	hide('sub_samp_code_02');
	hide('sub_comments_02');
	hide('w_printpage_01');
	hide('w_samp_code_01');
	hide('w_comments_01');
	hide('prodnote_inline_printpage_01');
	hide('prodnote_inline_samp_code_01');
	hide('prodnote_inline_comments_01');
	hide('prodnote_inline_printpage_02');
	hide('prodnote_inline_samp_code_02');
	hide('prodnote_inline_comments_02');
	hide('br_printpage_01');
	hide('br_samp_code_01');
	hide('br_comments_01');
	hide('br_printpage_02');
	hide('br_samp_code_02');
	hide('br_comments_02');
	hide('bdo_printpage_01');
	hide('bdo_samp_code_01');
	hide('bdo_comments_01');

/*Misc elements*/
	hide('imggroup_printpage_01');
	hide('imggroup_samp_code_01');
	hide('imggroup_comments_01');
	hide('imggroup_printpage_02');
	hide('imggroup_samp_code_02');
	hide('imggroup_comments_02');
	hide('table_printpage_01');
	hide('table_samp_code_01');
	hide('table_comments_01');
	hide('table_printpage_02');
	hide('table_samp_code_02');
	hide('table_comments_02');
	hide('sidebar_printpage_03');
	hide('sidebar_samp_code_03');
	hide('sidebar_comments_03');


/*Major Elements*/
	hide('frontmatter_printpage_01');
	hide('frontmatter_samp_code_01');
	hide('frontmatter_comments_01');
	hide('doctitle_printpage_01');
	hide('doctitle_samp_code_01');
	hide('doctitle_comments_01');
	hide('docauthor_printpage_01');
	hide('docauthor_samp_code_01');
	hide('docauthor_comments_01');
	hide('titlepage_printpage_01');
	hide('titlepage_samp_code_01');
	hide('titlepage_comments_01');
	hide('acknowledgments_printpage_01');
	hide('acknowledgments_samp_code_01');
	hide('acknowledgments_comments_01');
	hide('dedication_printpage_01');
	hide('dedication_samp_code_01');
	hide('dedication_comments_01');
	hide('preface_printpage_01');
	hide('preface_samp_code_01');
	hide('preface_comments_01');
	hide('TOC_printpage_01');
	hide('TOC_samp_code_01');
	hide('TOC_comments_01');
	hide('TOC_printpage_02');
	hide('TOC_samp_code_02');
	hide('TOC_comments_02');
	hide('bodymatter_printpage_01');
	hide('bodymatter_samp_code_01');
	hide('bodymatter_comments_01');
	hide('part_printpage_01');
	hide('part_samp_code_01');
	hide('part_comments_01');
	hide('chapter_printpage_01');
	hide('chapter_samp_code_01');
	hide('chapter_comments_01');
	hide('section_printpage_01');
	hide('section_samp_code_01');
	hide('section_comments_01');
	hide('rearmatter_printpage_01');
	hide('rearmatter_samp_code_01');
	hide('rearmatter_comments_01');
	hide('appendix_printpage_01');
	hide('appendix_samp_code_01');
	hide('appendix_comments_01');
	hide('glossary_printpage_01');
	hide('glossary_samp_code_01');
	hide('glossary_comments_01');
	hide('bibliography_printpage_01');
	hide('bibliography_samp_code_01');
	hide('bibliography_comments_01');
	hide('index_printpage_01');
	hide('index_samp_code_01');
	hide('index_comments_01');
	hide('poem_printpage_01');
	hide('poem_samp_code_01');
	hide('poem_comments_01');
	hide('poem_printpage_02');
	hide('poem_samp_code_02');
	hide('poem_comments_02');

    /* MathML examples */
    hide('mathml_01');
    hide('math_samp_code_01');
    hide('math_comments_01');
    hide('mathml_02');
    hide('math_samp_code_02');
    hide('math_comments_02');
    hide('mathml_03');
    hide('math_samp_code_03');
    hide('math_comments_03');
}


function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) {
       		a.disabled = false;
       		if(title == "print") {
       			show_all();
       		}
       	}
     }
   }
}