//	alert("aupage2");		//	aupage2.js//	root:Users:garylipo:aulit:aupage2.js//	routines to implement an "audio-page"(aka "frame-page"): //	calcIframe, makeSndCntrl, etc.	//-----------------------------------	//	alert("aupage.js; ");	//-----------------------------------		//	variables defined for each "audio"-window, each file that evokes "aupage.js":		var IframeHtinFull;	var myHeight;	var iframeHt;		var myLeft;	var myTop;	var myWidth;	var myHeight;	function selfload()	{		//	alert("selfload; myHeight="+myHeight);		resizeTo( myWidth, myHeight	);		moveTo( myLeft, myTop );	}			function poemunload()	{		//	alert("aupage.js: poemunload();");				opener.defload();		opener.poemOpen=false;		opener.focus();	}		function calcPoemPosition(myWidth, myHeight)	{		//	called by: "macopen()".		var	verror=-34;		var	herror=39;				myLeft= ((27*(screen.width-myWidth))/32);		myTop=	((6*(screen.height-myHeight))/32);		return(	[myLeft, myTop]	);	}		//-----------------------------------	//	window & iframe sizing code:	//-----------------------------------	function	getFontHt(fontSize)	{		var	fontHt;	//	=19.375;		if(	getOs()=="Win"	) 			fontSize-=1;		fontHt=fontSize+2.375;		if(	getOs()=="Mac"	)		{ 			if ((verOffset=browser.indexOf("Safari"))!=-1) 				 fontHt+=1.8;			}		return( fontHt );	}	//-----------------------------------	//-----------------------------------		//	generic constants; set for MacOS Ñ				var screenOverhead=114;	//	40		var	browser=getBrowserVersion();				var maxWindowHt=screen.height-screenOverhead;						//	iframe margins:				var overhead=170;	//	windowOverhead, i.e. overhead=(windowHt-iframeHt)				if(twolineheader) overhead+=20;	//					if ((verOffset=browser.indexOf("Safari"))!=-1) 			overhead+=32;					var overwidth=60;						var maxIframeHt=maxWindowHt-overhead;					var	fontHt=getFontHt(17);		//-----------------------------------	//-----------------------------------			function	calcIFrameHt()	{		var	iframeHt;		if(	IframeHtinFull	<	maxIframeHt	)			iframeHt = IframeHtinFull;		else			iframeHt = maxIframeHt;		return(iframeHt);	}		function	calcWinHeight()	{	//	alert( "IframeHtinFull="+IframeHtinFull)	//	alert( "maxIframeHt="+maxIframeHt)		if(	IframeHtinFull	<	maxIframeHt	)		{			myHeight = IframeHtinFull+overhead;			if(twolineheader) myHeight+=20;			}		else	myHeight = maxWindowHt;		return(myHeight);	}			function	makemacsndcntrl(autostart)	{		var theType= typeof(autostart);		if( theType=="undefined" )			autostart=true;					var startCode='autostart='+autostart+' ';				document.write('<center>');		var commando='<embed name="TheSecret" src="aud.mp3" height="16" width="200"  align="bottom" controller="true" ';		commando+=startCode+ '></embed>';				document.write(commando);		document.write('</center>');	}		function	makemacsndcntrl2(autostart, file)	{		var theType= typeof(autostart);		if( theType=="undefined" )			autostart=true;					var startCode='autostart='+autostart+' ';				document.write('<center>');		var commando='<embed name="TheSecret" src="'+file+'" height="16" width="200"  align="bottom" controller="true" ';		commando+=startCode+ '></embed>';				document.write(commando);		document.write('</center>');	}		function	makemaciframe(heightInPx, widthInPx)	{		document.write('<div style="margin-left:20px;"><br>');			var command='<iframe style="border:0;" src="poem.html" height='+heightInPx;		command+=' width="'+widthInPx+'" align="left" frameborder="0" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" >';					//scrolling="true"  allowtransparency="true"		command+='</div>';		document.write(command);	}		function	makemaciframe2(heightInPx, widthInPx, textfile)	{		document.write('<div style="margin-left:20px;"><br>');			var command='<iframe style="border:0;" src="'+textfile+'" height='+heightInPx;		command+=' width="'+widthInPx+'" align="left" frameborder="0" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" >';					//scrolling="true"  allowtransparency="true"		command+='</div>';		document.write(command);	}		function	makemacHeader(theTitle, theAuthor, notePath )	{		var command='<br>';		command+='<div style="font-size:22px" align="center">';		if( notePath != "")			command+='<a href="'+notePath+'" target="_blank">';				//	intro.mp3	notes/gNote.html	 target="_blank"				command+='<b>'+theTitle+'</b> &nbsp;&nbsp;';				if(twolineheader) command+='<br>';				command+='<span style="font-size:17px">&mdash; '+theAuthor+'</span>';		if( notePath != "")			command+='</a>';				var debugging=false;		if(debugging)			command+='<a href="#dummy" onClick="showInfo();"> *</a>';				command+='</div><br>';				document.write(command);	}	function	makemacHeaderUr(theTitle, theAuthor)	{		var command='<br>';		command+='<div style="font-size:22px" align="center">';		command+='<a href="intro.mp3">';				//	intro.mp3	notes/gNote.html	 target="_blank"				command+='<b>'+theTitle+'</b> &nbsp;&nbsp;';				if(twolineheader) command+='<br>';				command+='<span style="font-size:17px">&mdash; '+theAuthor+'</span></a>';		command+='</div><br>';		document.write(command);	}		//----------------------------------------------------		//---------------------------------------------------------------------		function	makeBody(	theTitle, theAuthor, sndFlag, notePath, copyritedate	)	{		//	formerly: makemacBody()				document.write('<div align="center">');		makemacHeader(	theTitle, theAuthor, notePath	);		if( sndFlag	)			makemacsndcntrl(false);	//	was false was blank.			//makeSndCntrl();		makecopynotice(copyritedate);				document.write('</div>');				var nuframeHt=iframeHt;				makemaciframe(	nuframeHt, myWidth-overwidth	);	}	function	makeSndCntrl(autostart)	{		makemacsndcntrl(autostart);	}	function	makeSndCntrl2(autostart, file)	{		var osname=getOs();		if(osname=="Mac")			{			makemacsndcntrl2(autostart, file);			return;		}			}//--------------------------------------------------------------------------------	var auPageWin;		function macopen(	poemID	)	//	, unframed	{			var dim=getPoemStats(	poemID	);		var	lineCt=dim[	0	];			var fontSize=dim[	1	];		var myWidth=dim[	2	];		var twolineheader=dim[	3	];				var	fontHt=getFontHt(fontSize);		var nuHeight=calcWindowHt(	fontHt,	lineCt	);		var nuDim=calcPoemPosition(myWidth, nuHeight);		recede();				var path=poemID+"/frame.html";				auPageWin=genWindowOpen(	auPageWin, path, "alpha", myWidth, nuHeight, nuDim[	0	], nuDim[	1	], "yes");		return;	}			//-------------------	function	calcWindowHt(	fontHt,	lineCt	)	{		//	called by: "macopen()".			var	iframeHt;		var	theOs=getOs();		var	browser=getBrowserVersion();				var screenOverhead=78;	//	was:	78				//	iframe margins:			var overhead=170;						if ((verOffset=browser.indexOf("Safari"))!=-1) 				overhead+=32;				var maxWindowHt=screen.height-screenOverhead;		var maxIframeHt=maxWindowHt-overhead;					var nufontHt=getFontHt(fontHt);		var	IframeHtinFull=nufontHt*lineCt;				if ((verOffset=browser.indexOf("Safari"))!=-1) 			IframeHtinFull+=0;	//	10;				if(	IframeHtinFull	<	maxIframeHt	)		{			iframeHt = IframeHtinFull;			var	windowHeight=iframeHt+overhead;			return(	windowHeight	);		}		else		{			iframeHt = maxIframeHt;			var	windowHeight=iframeHt+overhead;			windowHeight=690;			return(	windowHeight	);		}	}	//##############################################	function makeAuPageLink(fileID)	//	, unframed	{	//	alert("makeAuPageLink(); (fileID)= "+fileID);	//	return;		// opens a poem's frame file from index page, according to OS.		// actually output an html-link appropriate to os,		//	that links to a poem's frame page.		 		var theOs=getOs();		var command;		var substr="'"+fileID+"'";		command='<a href="#" onClick="macopen(	'+substr+'	);">';		document.write(command);	}	//------------------------------------------------------------------------		function makePoemLink(fileID, defaults)	//	rename to : "makeAuPageLink"	{//	alert("poemopen(); (fileID)= "+fileID);		// opens a poem's frame file from index page, according to OS.		// actually output an html-link appropriate to os,		//	that links to a poem's frame page.		 		var theOs=getOs();		var command;		if(theOs=="Win")			command='<a href="'+fileID+'/frame.html" target="_blank">';		if(theOs=="Mac")		{			var substr="'"+fileID+"'";			command='<a href="#" onClick="customOpen(	'+substr+', '+defaults+'	);">';			}		document.write(command);	}		function	defPoemLink(fileID)	{		var	path="nupoems/"+fileID;		makePoemLink(path, true);	}		function customOpen(	poemID, defaults	)		{		//	 - opens audioPage to a pre-determined size & position.				var	lineCt;			var fontSize;		var myWidth;		var twolineheader;		//		Looking to 'pre-open' poem files according to lineCt, etc.				if(defaults)		{			lineCt=63				fontSize=17;			myWidth=440;			twolineheader=false;		}		else		{			var dim=getPoemStats(	poemID	);				lineCt=dim[	0	];				fontSize=dim[	1	];			myWidth=dim[	2	];			twolineheader=dim[	3	];			}		var	fontHt=getFontHt(fontSize);		var nuHeight=calcWindowHt(	fontHt,	lineCt	);		var nuDim=calcPoemPosition(myWidth, nuHeight);		opener.focus();		opener.moveTo(	40,	screen.height-(opener.myHt+40)	);	//	opener.recede();		var path=poemID+"/frame.html";		auPageWin=genWindowOpen(	auPageWin, path, "alpha", myWidth, nuHeight, nuDim[	0	], nuDim[	1	], "yes");		return;	}		//------------------------------------------------------------------------		function	makeFancyLink(poemID)	{		poemID="'nupoems/"+poemID+"'";		command='<a href="#" onClick="customOpen(	'+poemID+', false 	);">';		document.write(command);		return;	}			var pageInfo;		function makeInfoMessage()	{		pageInfo="calcPageDim()\n";		pageInfo+="Os(): "+getOs()+"\n";		pageInfo+="maxWindowHt: "+maxWindowHt+" \n maxIframeHt: "+maxIframeHt;		pageInfo+=" lineCt: "+lineCt+" \n IframeHtinFull: "+IframeHtinFull;		pageInfo+=" iframeHt: "+iframeHt;		pageInfo+=" \n myHeight: "+myHeight;	}		function	calcPageDim()	{		//	called from poem frames, to calculate own size, iframe, placement.	//	outputs(as globals):		//		IframeHtinFull, myHeight, iframeHt, myLeft, myTop.			IframeHtinFull=fontHt*lineCt;		if ((verOffset=browser.indexOf("Safari"))!=-1) 		{			IframeHtinFull+=0;	//	10;		}					myHeight=calcWinHeight();	//	alert(myHeight);		iframeHt=calcIFrameHt();				myLeft= (29*(screen.width-myWidth))/32;				if ((verOffset=browser.indexOf("Safari"))!=-1) 		{			myTop= screenOverhead/2;	//	(13*(screen.height-myHeight))/32;		}			else myTop= screenOverhead/5;	//	myTop= (5*(screen.height-myHeight))/32;					makeInfoMessage();	}		var	infoPageWin;		function showInfo()	{		var infoPageWin;		var	nuWidth=300;		var	nuHeight=300;		var	nuLeft=400;		var	nuTop=200;			infoPageWin=genWindowOpen(	infoPageWin, "../../pageInfo.html", "beta", nuWidth, nuHeight, nuLeft, nuTop, "yes");		return;	}		function auPageTest()	{		var mtest="mtest!";		alert(mtest);	}