window.onresize = function () { ss_app.resize(); }
/**************************************************/
// application
/**************************************************/
var ss_app = new ss_application();
function ss_application () {
	this.container = false;
	this.directory = false;
	this.toolbar = false;
	this.workspace = false;
	this.navigation = false;
}
ss_application.prototype.init = function (id,xml) {
	this.container = document.getElementById(id);
	this.container.className = 'ss_application';
	var html = "<table cellpadding='0'><tr><td>";
	html += "	<div class='ss_directory'></div>";
	html += "</td><td>";
	html += "	<div class='interface'>";
	html += "		<div class='ss_toolbar'></div>";
	html += "		<div class='ss_workspace'></div>";
	html += "		<div class='ss_navigation'></div>";
	html += "	</div>";
	html += "</td></tr><table>";
	this.container.innerHTML = html;
	var tags = this.container.getElementsByTagName('div');
	for (var i=0; i < tags.length; i++) {
		if (tags[i].className == 'ss_directory') { this.directory = tags[i]; }
		if (tags[i].className == 'ss_toolbar') { this.toolbar = tags[i]; }
		if (tags[i].className == 'ss_navigation') { this.navigation = tags[i]; }
		if (tags[i].className == 'ss_workspace') { this.workspace = tags[i]; }
	} setTimeout('ss_app.resize()',50); setTimeout('ss_app.sections()',1000);
	if (xml) { setTimeout("ss_book.init(null,'"+ xml +"')",2000); }
}
ss_application.prototype.resize = function () {
	if (this.container) {
		var p = this.container; while (p.offsetParent) { p = p.parentNode; }
		var ih = (p.offsetHeight - this.container.offsetHeight), iw = (p.offsetWidth - this.container.offsetWidth);
		var h = (document.body.clientHeight - ih), w = (document.body.clientWidth - iw);
		this.directory.style.height = h +'px';
		if (this.directory) { w = (w - this.directory.offsetWidth); }
		if (this.toolbar) { h = (h - this.toolbar.offsetHeight); }
		if (this.navigation) { h = (h - this.navigation.offsetHeight); }
		this.workspace.style.height = h +'px'; this.workspace.style.width = w +'px';
		this.toolbar.style.width = w +'px'; this.navigation.style.width = w +'px';
	}
}
ss_application.prototype.drawer = function () {
	if (this.directory.style.display == 'none') { this.directory.style.display = 'block'; }
	else { this.directory.style.display = 'none'; }
	setTimeout('ss_app.resize()',5);
}
ss_application.prototype.sections = function () {
	var html = '';
	for (var i=0; i < ss_sections.length; i++) {
		html += "<div class='title'>"+ ss_sections[i].name +"</div>";
		html += "<div class='page' onclick=ss_booklet.prototype.init(null,'"+ ss_sections[i].config +"')>";
		html += "	<img src='"+ ss_sections[i].thumbnail +"'>";
		html += "</div>";
		if (ss_sections[i].extra) {
			html += "<div class='extra'>"+ ss_sections[i].extra +"</div>";
		}
	} this.directory.innerHTML = html;
}
/**************************************************/
// section
/**************************************************/
var ss_sections = new Array();
function ss_section () {
	this.name = false;
	this.pubdate = false;
	this.thumbnail = false;
	this.config = false;
	this.extra = false;
}
ss_section.prototype.bydate = function (days,url) {
	var n = new Date();
	var y = n.getFullYear(), m = n.getMonth(), d = n.getDate();
	var day = [31,0,31,30,31,30,31,31,30,31,30,31];
	day[1] = (((y%100 != 0) && (y%4 == 0)) || (y%400 == 0))?29:28;
	for (var i=0; i < days; i++) {
		if (d <= 0) { m--; if (m < 0) { m = 11; } d = day[m]; }
		if (d > day[m]) { d = 1; m++; } if (m > 11) { m = 0; y++; }
		var nd = d, nm = m; nm++; if (nd < 10) { nd = '0'+ nd; } if (nm < 10) { nm = '0'+ nm; }
		var f = "ss_section.prototype.request('"+ url +"/"+ y +"-"+ nm +"-"+ nd +"/config.xml')";
		setTimeout(f,100);
		d--;
	}
}
ss_section.prototype.request = function (url) {
	var ajax = new ss_ajax();
	ajax.app = 'ss_section.prototype.out';
	ajax.url = url;
	ajax.init();
}
ss_section.prototype.out = function (index) {
	var ajax = ss_ajaxqueue[index];
	if (ajax.xml.responseXML.getElementsByTagName('section')[0]) {
		var ss_file = new ss_section();
		ss_file.config = ajax.url;
		ss_file.name = ss_ajax.prototype.element("", "name", ajax.xml.responseXML.getElementsByTagName('section')[0],0);
		ss_file.thumbnail = ss_ajax.prototype.element("", "thumb", ajax.xml.responseXML.getElementsByTagName('thumbs')[0],0);
		if (ss_ajax.prototype.element("", "extra", ajax.xml.responseXML.getElementsByTagName('section')[0],0)) {
			ss_file.extra = ss_ajax.prototype.element("", "extra", ajax.xml.responseXML.getElementsByTagName('section')[0],0);
		} ss_sections.push(ss_file);
		if (ss_app.workspace.innerHTML == '') {
			ss_book.init(null,ss_file.config);
		}
	} ss_ajaxqueue[index] = null;
}
/**************************************************/
// booklet
/**************************************************/
var ss_book = new ss_booklet();
function ss_booklet () {
	this.pages = new Array();
	this.thumbs = new Array();
	this.pageheight = 0;
	this.pagewidth = 0;
	this.thumbheight = 0;
	this.thumbwidth = 0;
	this.currentpage = 0;
	this.currentview = '';
	this.zoomslider = false;
	this.zoomsliderpos = 0;
	this.pageslider = false;
	this.pagesliderpos = 0;
	this.pagethumbnails = false;
	this.pagethumbnail = false;
	this.pagepreview = false;
}
ss_booklet.prototype.init = function (index,url) {
	if (!index && url) {
		ss_app.workspace.innerHTML = "<p class='loading'><img src='/content/specialsection/library/images/loading.gif'>&nbsp;LOADING...</p>";
		var ajax = new ss_ajax(); ajax.url = url; ajax.app = 'ss_book.init'; ajax.init();
	} else {
		this.toolbar(); this.navigation();
		tags = ss_app.toolbar.getElementsByTagName('div');
		for (var i=0; i < tags.length; i++) {
			if (tags[i].className == 'arrow') { this.zoomslider = tags[i]; }
		}
		tags = ss_app.navigation.getElementsByTagName('div');
		for (var i=0; i < tags.length; i++) {
			if (tags[i].className == 'arrow') { this.pageslider = tags[i]; }
			if (tags[i].className == 'thumbnails') { this.pagethumbnails = tags[i]; }
			if (tags[i].className == 'thumbnail') { this.pagethumbnail = tags[i]; }
		}
		this.pages = new Array();
		var ajax = ss_ajaxqueue[index], html = '';
		this.pageheight = ss_ajax.prototype.element("", "pageheight", ajax.xml.responseXML.getElementsByTagName('section')[0],0);
		this.pagewidth = ss_ajax.prototype.element("", "pagewidth", ajax.xml.responseXML.getElementsByTagName('section')[0],0);
		this.thumbheight = ss_ajax.prototype.element("", "thumbheight", ajax.xml.responseXML.getElementsByTagName('section')[0],0);
		this.thumbwidth = ss_ajax.prototype.element("", "thumbwidth", ajax.xml.responseXML.getElementsByTagName('section')[0],0);
		var objs = ajax.xml.responseXML.getElementsByTagName('page');
		for (var i=0; i < objs.length; i++) {
			var page = ss_ajax.prototype.element("", "page", ajax.xml.responseXML.getElementsByTagName('pages')[0],i); this.pages.push(page);
			var thumb = ss_ajax.prototype.element("", "thumb", ajax.xml.responseXML.getElementsByTagName('thumbs')[0],i); this.thumbs.push(thumb);
			html += "<a onclick=ss_book.previewsel('"+ i +"') onmouseover=ss_book.preview("+ i +")>"+ (i +1) +"</a>";
		} ss_ajaxqueue[index] = null;
		this.pagethumbnails.innerHTML = html;
		var p = this.pageslider.parentNode;
		p.style.width = ((this.pages.length * 20) +1) +'px';
		p.parentNode.parentNode.style.marginLeft = -Math.ceil((this.pages.length * 20) /2) +'px';
		if (this.currentview == 'singlepage') { this.singlepage(); }
		else if (this.currentview == 'multipage') { this.multipage(); }
		else { this.sidebyside(); }
	}
}
ss_booklet.prototype.toolbar = function (index,url) {
	var html = "<div class='options'>";
	html += "	<a class='drawer' onclick=ss_app.drawer()><img title='Open/Close Drawer' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "	<a class='divider'>&nbsp;</a>";
	html += "	<a class='singlepage' onclick=ss_book.singlepage()><img title='Single Page' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "	<a class='multipage' onclick=ss_book.multipage()><img title='Multi Page' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "	<a class='sidebyside' onclick=ss_book.sidebyside()><img title='Side by Side' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "	<a class='divider'>&nbsp;</a>";
	html += "	<a class='print' onclick=ss_book.print()><img title='Print' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "</div>";
	html += "<div class='zoom'>";
	html += "	<a class='zoomout' onclick=ss_book.zoominout('out')><img title='Zoom Out' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "	<div class='slider'><div class='increment'>";
	html += "		<div class='arrow' onmousedown='ss_book.zoom(event); return false;'><img src='/content/specialsection/library/images/slider.gif'></div>";
	html += "	</div></div>";
	html += "	<a class='zoomin' onclick=ss_book.zoominout('in')><img title='Zoom In' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "</div>";
	html += "<div class='pages'>";
	html += "	<a class='prev' onclick=ss_book.pageflip('prev')><img title='Previous Page' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "	<a class='toc'><img title='Table of Contents' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "	<a class='next' onclick=ss_book.pageflip('next')><img title='Next Page' src='/content/specialsection/library/images/transparent.gif'></a>";
	html += "</div>";
	ss_app.toolbar.innerHTML = html;
}
ss_booklet.prototype.navigation = function (index,url) {
	var html = "<div class='pages'>";
	html += "	<div class='slider'><div class='increment'>";
	html += "		<div class='thumbnails' onmouseout=ss_book.preview()></div><div class='thumbnail'></div>";
	html += "		<div class='arrow'><img src='/content/specialsection/library/images/slider-page.gif'></div>";
	html += "	</div></div>";
	html += "</div>";
	ss_app.navigation.innerHTML = html;
}
ss_booklet.prototype.singlepage = function (index) {
	ss_app.workspace.innerHTML = '';
	if (!index) { index = 0; }
	var h = Math.ceil(this.pageheight * .25);
	var w = Math.ceil(this.pagewidth * .25);
	if (this.pageheight <= 1000 || this.pagewidth <= 1000) {
		h = Math.ceil(this.pageheight * .5);
		w = Math.ceil(this.pagewidth * .5);
	}
	var d = document.createElement('div'); d.className = 'singlepage';
	var css = ''; if (this.pages.length == 1) { css = "style='display:none;'"; }
	var html = "<table cellpadding='0'><tr><td class='fill'>&nbsp;</td>";
	html += "<td><div class='page'>";
	html += "	<div class='peel-tl' fda='off' onmouseover=ss_book.cornerfade(this,'on') onmouseout=ss_book.cornerfade(this,'off') onclick=ss_book.pageflip('prev') style='display:none;'></div>";
	html += "	<div class='peel-bl' fda='off' onmouseover=ss_book.cornerfade(this,'on') onmouseout=ss_book.cornerfade(this,'off') onclick=ss_book.pageflip('prev') style='display:none;'></div>";
	html += "	<div class='peel-tr' fda='off' onmouseover=ss_book.cornerfade(this,'on') onmouseout=ss_book.cornerfade(this,'off') onclick=ss_book.pageflip('next') "+ css +"></div>";
	html += "	<div class='peel-br' fda='off' onmouseover=ss_book.cornerfade(this,'on') onmouseout=ss_book.cornerfade(this,'off') onclick=ss_book.pageflip('next') "+ css +"></div>";
	html += "	<div><img src='"+ this.pages[index] +"' szh='"+ this.pageheight +"' szw='"+ this.pagewidth +"' style='height:"+ h +"px; width:"+ w +"px;'></div>";
	html += "</div></td>";
	html += "<td class='fill'>&nbsp;</td></tr></table>";
	d.innerHTML = html;
	ss_app.workspace.appendChild(d);
	this.zoomslider.style.left = 42 +'px';
	this.zoomsliderpos = 42;
	if (this.pageheight <= 1000 || this.pagewidth <= 1000) {
		this.zoomslider.style.left = 92 +'px';
		this.zoomsliderpos = 92;
	} this.pageslider.style.left = (20 * index) +2 +'px';
	this.pagesliderpos = (20 * index) +2;
	this.currentview = 'singlepage';
	this.currentpage = index;
}
ss_booklet.prototype.multipage = function () {
	ss_app.workspace.innerHTML = '';
	var h = Math.ceil(this.pageheight * .1);
	var w = Math.ceil(this.pagewidth * .1);
	if (this.pageheight <= 1000 || this.pagewidth <= 1000) {
		h = Math.ceil(this.pageheight * .20);
		w = Math.ceil(this.pagewidth * .20);
	}
	for (var i=0; i < this.pages.length; i++) {
		var d = document.createElement('div'); d.className = 'multipage';
		d.innerHTML = "<img src='"+ this.pages[i] +"' szh='"+ this.pageheight +"' szw='"+ this.pagewidth +"' style='height:"+ h +"px; width:"+ w +"px;' onclick=ss_book.singlepage('"+ i +"')>";
		ss_app.workspace.appendChild(d);
	} this.zoomslider.style.left = 12 +'px';
	this.zoomsliderpos = 12;
	if (this.pageheight <= 1000 || this.pagewidth <= 1000) {
		this.zoomslider.style.left = 32 +'px';
		this.zoomsliderpos = 32;
	} this.currentview = 'multipage';
}
ss_booklet.prototype.sidebyside = function (index) {
	ss_app.workspace.innerHTML = '';
	if (!index) { index = 0; }
	var h = Math.ceil(this.pageheight * .20);
	var w = Math.ceil(this.pagewidth * .20);
	if (this.pageheight <= 1000 || this.pagewidth <= 1000) {
		h = Math.ceil(this.pageheight * .4);
		w = Math.ceil(this.pagewidth * .4);
	}
	var d = document.createElement('div'); d.className = 'sidebyside';
	var css = ''; if (this.pages.length == 1) { css = "style='display:none;'"; }
	var html = "<table cellpadding='0'><tr><td class='fill'>&nbsp;</td><td>";
	html += "<div class='page'>";
	html += "	<div class='peel-tl' fda='off' onmouseover=ss_book.cornerfade(this,'on') onmouseout=ss_book.cornerfade(this,'off') onclick=ss_book.pageflip('prev') style='display:none;'></div>";
	html += "	<div class='peel-bl' fda='off' onmouseover=ss_book.cornerfade(this,'on') onmouseout=ss_book.cornerfade(this,'off') onclick=ss_book.pageflip('prev') style='display:none;'></div>";
	html += "	<div class='peel-tr' fda='off' onmouseover=ss_book.cornerfade(this,'on') onmouseout=ss_book.cornerfade(this,'off') onclick=ss_book.pageflip('next') "+ css +"></div>";
	html += "	<div class='peel-br' fda='off' onmouseover=ss_book.cornerfade(this,'on') onmouseout=ss_book.cornerfade(this,'off') onclick=ss_book.pageflip('next') "+ css +"></div>";
	html += "	<table cellpadding='0'><tr>";
	if (index == 0) {
		html += "	<td><img src='library/images/transparent.gif' szh='"+ this.pageheight +"' szw='"+ this.pagewidth +"' style='height:"+ h +"px; width:"+ w +"px;'></td>";
		html += "	<td><img src='"+ this.pages[0] +"' szh='"+ this.pageheight +"' szw='"+ this.pagewidth +"' style=height:"+ h +"px;' width:"+ w +"px;'></td>";
	} else if (index == (this.pages.length -1)) {
		html += "	<td><img src='"+ this.pages[this.pages.length -1] +"' szh='"+ this.pageheight +"' szw='"+ this.pagewidth +"' style='height:"+ h +"px; width:"+ w +"px;'></td>";
		html += "	<td><img src='library/images/transparent.gif' szh='"+ this.pageheight +"' szw='"+ this.pagewidth +"' style=height:"+ h +"px;' width:"+ w +"px;'></td>";
	} else {
		html += "	<td><img src='"+ this.pages[index] +"' szh='"+ this.pageheight +"' szw='"+ this.pagewidth +"' style='height:"+ h +"px; width:"+ w +"px;'></td>";
		html += "	<td><img src='"+ this.pages[parseInt(index) +1] +"' szh='"+ this.pageheight +"' szw='"+ this.pagewidth +"' style=height:"+ h +"px;' width:"+ w +"px;'></td>";
	} html += "	</tr></table>";
	html += "	<div class='divider'></div>";
	html += "</div>";
	html += "</td><td class='fill'>&nbsp;</td></tr></table>";
	d.innerHTML = html;
	ss_app.workspace.appendChild(d);
	this.zoomslider.style.left = 32 +'px';
	this.zoomsliderpos = 32;
	if (this.pageheight <= 1000 || this.pagewidth <= 1000) {
		this.zoomslider.style.left = 72 +'px';
		this.zoomsliderpos = 72;
	} this.pageslider.style.left = (index *20) +2 +'px';
	this.pagesliderpos = (index *20) +2;
	this.currentview = 'sidebyside';
	this.currentpage = 0;
}
ss_booklet.prototype.zoom = function (e) {
	this.zoomsliderpos = 0;
	var p = this.zoomslider.parentNode;
	while (p.offsetParent) {
		this.zoomsliderpos += p.offsetLeft;
		p = p.offsetParent;
	}
	document.onmousemove = ss_book.zoommousemove;
	document.onmouseup = ss_book.zoommouseup;
	return false;
}
ss_booklet.prototype.zoommousemove = function (e) {
	var e = (!e) ? window.event : e;
	var tag = ss_app.workspace.getElementsByTagName('img');
	var tagh = tag[0].getAttribute('szh');
	var tagw = tag[0].getAttribute('szw');
	var x = (e.pageX - ss_book.zoomsliderpos);
	if (x >= 0 && x <= 200) {
		for (var i=0; i < tag.length; i++) {
			tag[i].style.height = tagh * ((x / 2) / 100) +'px';
			tag[i].style.width = tagw * ((x / 2) / 100) +'px';
		} ss_book.zoomslider.style.left = (x-8) +'px';
	} return false;
}
ss_booklet.prototype.zoommouseup = function () {
	ss_book.zoomsliderpos = parseInt(ss_book.zoomslider.style.left.replace('px',''));
	document.onmousemove = null;
	document.onmouseup = null;
}
ss_booklet.prototype.zoominout = function (d) {
	if (d == 'in') {
		if ((this.zoomsliderpos +20) > 200) { this.zoomsliderpos = 200; }
		else { this.zoomsliderpos = (this.zoomsliderpos +20); }
	} else {
		if ((this.zoomsliderpos -20) < 0) { this.zoomsliderpos = 0; }
		else { this.zoomsliderpos = (this.zoomsliderpos -20); }
	}
	var tag = ss_app.workspace.getElementsByTagName('img');
	var tagh = tag[0].getAttribute('szh');
	var tagw = tag[0].getAttribute('szw');
	for (var i=0; i < tag.length; i++) {
		tag[i].style.height = tagh * ((this.zoomsliderpos / 2) / 100) +'px';
		tag[i].style.width = tagw * ((this.zoomsliderpos / 2) / 100) +'px';
	} this.zoomslider.style.left = (this.zoomsliderpos-8) +'px';
}
ss_booklet.prototype.pageflip = function (d) {
	var tag = ss_app.workspace.getElementsByTagName('img'), hide = '';;
	if (this.currentview == 'singlepage') {
		if (d == 'prev' && this.currentpage > 0) {
			this.currentpage--; if (this.currentpage <= 0) { hide = 'prev'; }
		} else if (d == 'next' && this.currentpage < (this.pages.length -1)) {
			this.currentpage++; if (this.currentpage >= (this.pages.length -1)) { hide = 'next'; }
		} tag[0].src = this.pages[this.currentpage];
		this.pageslider.style.left = (20 * this.currentpage) +2 +'px';
		this.pagesliderpos = (20 * this.currentpage) +2;
	} else if (this.currentview == 'sidebyside') {
		if (d == 'prev' && this.currentpage > 0) {
			this.currentpage = (this.currentpage -2);
			if (this.currentpage <= 0) { tag[0].src = '/content/specialsection/library/images/transparent.gif'; hide = 'prev'; }
			else { tag[0].src = this.pages[this.currentpage -1]; }
			tag[1].src = this.pages[this.currentpage];
		} else if (d == 'next' && this.currentpage < (this.pages.length -1)) {
			this.currentpage = (this.currentpage +2);
			tag[0].src = this.pages[this.currentpage -1];
			if (this.currentpage >= (this.pages.length -1)) { tag[1].src = '/content/specialsection/library/images/transparent.gif'; hide = 'next'; }
			else { tag[1].src = this.pages[this.currentpage]; }
		} var page = (this.currentpage -1); if (page < 0) { page = 0; }
		this.pageslider.style.left = (20 * page) +2 +'px';
	}
	tag = ss_app.workspace.getElementsByTagName('div');
	for (var i=0; i < tag.length; i++) {
		if (hide == 'prev') {
			if (tag[i].className == 'peel-tl') { tag[i].style.display = 'none'; }
			else if (tag[i].className == 'peel-bl') { tag[i].style.display = 'none'; }
		} else if (hide == 'next') {
			if (tag[i].className == 'peel-tr') { tag[i].style.display = 'none'; }
			else if (tag[i].className == 'peel-br') { tag[i].style.display = 'none'; }
		} else { tag[i].style.display = 'block'; }
	}
}
ss_booklet.prototype.cornerfade = function (el,a) {
	var fade;
	if (a) { consolefadedir = a; el.setAttribute('fda',a); }
	else { consolefadedir = el.getAttribute('fda'); }
	if (el.filters) {
		if (!el.filters.alpha.opacity) { fade = 0; }
		if (el.filters.alpha.opacity < 0) { fade = 0; }
		if (el.filters.alpha.opacity > 100) { fade = 100; }
		if (consolefadedir == 'on') { el.filters.alpha.opacity = (el.filters.alpha.opacity + 20); }
		else { el.filters.alpha.opacity = (el.filters.alpha.opacity - 20); }
		fade = el.filters.alpha.opacity;
	} else if (el.style.MozOpacity) {
		if (!el.style.MozOpacity) { fade = el.style.MozOpacity = 0; }
		if (el.style.MozOpacity < 0) { fade = el.style.MozOpacity = 0; }
		if (el.style.MozOpacity > 1) { fade = el.style.MozOpacity = 1; }
		if (consolefadedir == 'on') { el.style.MozOpacity = ((el.style.MozOpacity * 100) + 20)/100; }
		else { el.style.MozOpacity = ((el.style.MozOpacity * 100) - 20)/100; }
		fade = (el.style.MozOpacity * 100);
	} else {
		if (!el.style.opacity) { fade = el.style.opacity = 0; }
		if (el.style.opacity < 0) { fade = el.style.opacity = 0; }
		if (el.style.opacity > 1) { fade = el.style.opacity = 1; }
		if (consolefadedir == 'on') { el.style.opacity = ((el.style.opacity * 100) + 20)/100; }
		else { el.style.opacity = ((el.style.opacity * 100) - 20)/100; }
		fade = (el.style.opacity * 100);
	}
	if (fade > 0 && fade < 100) {
		setTimeout(function(){ss_book.cornerfade(el)},75);
	}
}
ss_booklet.prototype.preview = function (index) {
	if (!index && index != 0) { this.pagethumbnail.style.display = 'none'; }
	else {
		var h = parseInt(this.thumbheight), w = parseInt(this.thumbwidth);
		this.pagethumbnail.style.top = (0 - (h +12)) +'px';
		this.pagethumbnail.style.left = (0 - (w * .5)) + (index * 20) +2 +'px';
		this.pagethumbnail.innerHTML = "<div class='page' style='height:"+ (h +2) +"px;'><img src='"+ this.thumbs[index] +"' style='height:"+ h +"px;'></div>";
		this.pagethumbnail.style.display = 'block';
	}
}
ss_booklet.prototype.previewsel = function (index) {
	if (this.currentview == 'sidebyside') {
		if (index > 0 && index % 2 == 0) { index--; }
		ss_book.sidebyside(index);
	} else { ss_book.singlepage(index); }
}
ss_booklet.prototype.print = function () {
	var tags = document.getElementsByTagName('head');
	var html = "<html><head>";
	html += "<title>Print Special Section</title>";
	html += "<link rel=StyleSheet type='text/css' href='library/style.css'>";
	html += "<style>body {overflow:auto;} .ss_application .ss_workspace {background:#FFF;}</style>";
	html += "</head><body><div class='ss_application'>";
	html += "<div class='ss_workspace'>"+ ss_app.workspace.innerHTML +"</div>";
	html += "<div></body></html>";
	var pw = window.open('','print_ss');
	pw.document.write(html);
	pw.document.close(); pw.print();
}
/**************************************************/
// ajax
/**************************************************/
var ss_ajaxqueue = new Array();
function ss_ajax () {
	this.url = false;
	this.app = false;
	this.xml = false;
}
ss_ajax.prototype.init = function () {
	var index = ss_ajaxqueue.length;
	for (var i=0; i < ss_ajaxqueue.length; i++) {
		if (ss_ajaxqueue[i] == null) { index = i; }
	} ss_ajaxqueue[index] = this;
	this.request(index);
}
ss_ajax.prototype.request = function (index) {
	var ajax = ss_ajaxqueue[index];
	ajax.url = ajax.url.replace('media.coxohio.com','192.168.88.200');
	if (window.XMLHttpRequest) {
		ajax.xml = new XMLHttpRequest();
		ajax.xml.onreadystatechange = function () { ajax.requestchange(index); }
		ajax.xml.open('GET','/_common/snippet/esifilter.jsp?url='+ ajax.url,true);
		ajax.xml.send(null);
	} else if (window.ActiveXObject) {
		ajax.xml = new ActiveXObject('Microsoft.XMLHTTP');
		ajax.xml.onreadystatechange = function () { ajax.requestchange(index); }
		ajax.xml.open('GET','/_common/snippet/esifilter.jsp?url='+ ajax.url,true);
		ajax.xml.send();
	} ss_ajaxqueue[index] = ajax;
}
ss_ajax.prototype.requestchange = function (index) {
	var ajax = ss_ajaxqueue[index];
	if (ajax.xml.readyState == 4 && ajax.xml.status == 200 || ajax.xml.readyState == 4 && ajax.xml.status == 0) {
		var f = ajax.app +"("+ index +")"; setTimeout(f,0);
	}
}
ss_ajax.prototype.element = function (prefix,local,parent,index) {
	var el = false;
	if (prefix && window.ActiveXObject) { el = parent.getElementsByTagName(prefix +':'+ local)[index]; }
	else { el = parent.getElementsByTagName(local)[index]; }
	if (el) {
		if (el.childNodes.length > 1) { return el.childNodes[1].nodeValue; }
		else if (el.firstChild) { return el.firstChild.nodeValue; }
	} return '';
}