
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function sh(id) {
  	if ((obj=fo(id))!=null) { 
		obj.style.display = ((obj.style.display == 'inline')?'none' :'inline');
	}
}
function fo(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=fo(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=fo(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=fo(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}
function zoomTxt(t,txt){
  	str ="<table width='240' border='0' cellpadding='10'  bgcolor='#FFFFFF'>";
    str += "<tr> <td>";
    str += txt;
    str += "</td></tr>";
  	str += "</table></table>";
	MM_setTextOfLayer(t,'',str);
	MM_showHideLayers(t,'','show');
}
function zoomImg(t, nm){
	str ="<a href=\"javascript:;\" onMouseOut=\"unZoom()\"><img src='../PP/";
	str += nm ;
	str +="' border=0></a>";
	MM_setTextOfLayer(t,'',str);
	MM_showHideLayers(t,'','show');
}
function unZoom(){
	MM_showHideLayers('Lzoom','','hide');
	MM_showHideLayers('Rzoom','','hide');
}
function init(){
	if (parent.location.href == self.location.href){
		parent.location.href = 'index.html';
	}
	MM_showHideLayers('display','','hide');
	MM_showHideLayers('Lzoom','','hide');
	MM_showHideLayers('Rzoom','','hide');
}

function gotoPage(book, id){
	uri = new URI();
	newUrl = uri.setData({'book':book, 'page': id});
	window.location.href=newUrl;
}

function gpg(pid){
	parent.frames['lyt'].findPageByID(pid);
}
function findPageByID(pid){
	for (i=0;i<jsIDS.length;i+=2){
		if ((jsIDS[i] == pid) || (jsIDS[(i+1)] == pid)){
			openPage(i);
			break;
		}
	}
}
function internal_URL(url){
	self.location.href = url;
}
function openURL(url){
	window.open(url,'newwin','toolbar=no,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=460');
}
function MP4str(mp4Path){
	rStr = "<OBJECT CLASSID=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" CODEBASE=\"http://www.apple.com/qtactivex/qtplugin.cab\" WIDTH=\"320\" HEIGHT=\"256\" >";
	rStr += "<PARAM NAME=\"src\" VALUE=\"";
	rStr += mp4Path;
	rStr += "\"><PARAM NAME=\"autoplay\" VALUE=\"true\"><EMBED SRC=\"QTMimeType.pntg\" TYPE=\"image/x-macpaint\" PLUGINSPAGE=\"http://www.apple.com/quicktime/download\" QTSRC=\"";
	rStr += mp4Path;
	rStr += "\" WIDTH=\"320\" HEIGHT=\"256\" AUTOPLAY=\"true\"> </EMBED> </OBJECT>";
	return (rStr);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function printChapter(id){
	url = 'lib/print.php?id=' + id;
	MM_openBrWindow(url,'printerFriendly','scrollbars=yes,menubar=yes,resize=yes,width=680,height='+size.y)
}

