function IncludeGentleReminder() {
document.writeln('<p class="ahem">');
document.writeln('<big>');
document.writeln('Our Web site was rewritten to conform with current Web');
document.writeln('standards (XHTML 1.0 Strict). This includes the use of');
document.writeln('Cascading Style Sheets and other mark-up. If this text');
document.writeln('appears in your screen, your browser does NOT fully support');
document.writeln('<a href="http://www.w3.org/Style/">Cascading Style Sheets</a>.');
document.writeln('You can still look at the content of this Web page, but');
document.writeln('most likely it is not in its intended layout, which can');
document.writeln('only be done if you');
document.writeln('<a href="http://www.webstandards.org/upgrade/">replace</a> ');
document.writeln('your browser with one that supports web standards.');
document.writeln('</big>');
document.writeln('</p>');
}


function IncludeHeader() {
document.writeln('<div id="Phys180Eheader">');
document.writeln('	 <img src="BeamLogo.gif"');
document.writeln('	      longdesc="Header image and links"');
document.writeln('	      alt="--Physics 180E--"');
document.writeln('	      width="708px"');
document.writeln('	      height="120px"');
document.writeln('	 />');
document.writeln('</div>');
}


function openPrinterFriendly() {
    WindowProps =  'toolbar=0, ';
    WindowProps += 'location=0, ';
    WindowProps += 'directories=0, ';
    WindowProps += 'scrollbars=1, ';
    WindowProps += 'status=0, ';
    WindowProps += 'menubar=0, ';
    WindowProps += 'resizable=1, ';
    WindowProps += 'width=420px, ';
    WindowProps += 'height=400px';
    open("WhyPrinterFriendly.html", "PrinterFriendly", WindowProps);
}

function openImageWindow(URL, baseURL, ALT, WIDTH, HEIGHT) 
{	WindowName = URL.substring(URL.lastIndexOf("/")+1);
	WindowProps = "width=" + (WIDTH+50) + ",height=" + (HEIGHT+75);
	text  = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
	text += '<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">';
	text += '<head>';
	text += '<base href="'+ baseURL + '" />';
	text += '<title>'+ WindowName + ' (' + WIDTH + 'x' + HEIGHT + ' pixels) </title>';
	text += '<style	type="text/css">';
	text += '@import "CSSScripts/RLSlabStyle.css";';
	text += '</style>';
	text += '</head>';
	text += '<body>';
	text += '<div class="plain-image">';
	text += '<div class="table">';
	text += '<div class="table-row">';
	text += '<div class="table-cell-image">';
	text += '<img src="' + URL + '" ';
	text += 'width="' + WIDTH + 'px "';
	text += 'height="' + HEIGHT + 'px "';
	text += 'alt="' + ALT + '" />';
	text += '</div>';
	text += '</div>';
	text += '<div class="table-row">';
	text += '<div class="table-cell-short-caption">';
	text += '<p>';
	text += '<a href="javascript:parent.window.close()"';
	text += 'onclick="parent.window.close()">CLOSE THIS WINDOW</a>';
	text += '</p>';
	text += '</div>';
	text += '</div>';
	text += '</div>';
	text += '</body></html>';
	ImageWindow = window.open("", WindowName, WindowProps);
	ImageWindow.document.open();
	ImageWindow.document.write(text);
	ImageWindow.document.close();
}

function openFigWindow(URL, baseURL, ALT, CAPTION,  WIDTH, HEIGHT) 
{	UncleanCaption = String(CAPTION)
	UncleanCaption = UncleanCaption.replace('\t','')
	UncleanCaption = UncleanCaption.replace('  ',' ')
	temp0 = UncleanCaption.split("<a")
	CleanCaption   = new String("")
	for (i=0; i < temp0.length; ++i)
	{ if (i == 0)
	  {  CleanCaption += String(temp0[i])
	  }
	  else
	  {  temp = String(String(temp0[i]).split('\'>')[1]).split("</a>")
	     CleanCaption += temp[0].concat(temp[1])
	  }
	}
	if (WIDTH > 800) 
	{  CaptSpace = 18*(CleanCaption.length)*10/600;
	   if (CaptSpace < 18){CaptSpace = 18};
	}
	else
	{  CaptSpace = 18*(CleanCaption.length)*10/WIDTH;
	   if (CaptSpace < 18){CaptSpace = 18};
	}
	WindowWidth = WIDTH + 50;
	WindowHeight = HEIGHT + 50 + 40 + CaptSpace;
	if (WindowHeight > 800)
	{
	    WindowHeight = 800;
	}
	WindowName = URL.substring(URL.lastIndexOf("/")+1);
	WindowProps = "width=" + WindowWidth + ",height=" + WindowHeight;
	text  = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
	text += '<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">';
	text += '<head>';
	text += '<base href="'+ baseURL + '" />';
	text += '<title>'+ WindowName + ' (' + WIDTH + 'x' + HEIGHT + ' pixels) </title>';
	text += '<style	type="text/css">';
	text += '@import "CSSScripts/RLSlabStyle.css";';
	text += '</style>';
	text += '</head>';
	text += '<body>';
	text += '<div class="plain-image">';
	text += '<div class="table">';
	text += '<div class="table-row">';
	text += '<div class="table-cell-image">';
	text += '<img src="' + URL + '" ';
	text += 'width="' + WIDTH + 'px "';
	text += 'height="' + HEIGHT + 'px "';
	text += 'alt="' + ALT + '" />';
	text += '</div>';
	text += '</div>';
	text += '</div>';
	if ( WIDTH > 800) 
	{  text += '<div class="table-600px">';
	   text += '<div class="table-row">';
	   if (CleanCaption.length*8 > 600)
	   {  text += '<div class="table-cell-caption">';
	   } 
	   else
	   {  text += '<div class="table-cell-short-caption">';
	   }
	}
	else
	{  text += '<div class="table-75">';
	   text += '<div class="table-row">';
	   if (CleanCaption.length*10 > 0.75*WIDTH)
	   {  text += '<div class="table-cell-caption">';
	   } 
	   else
	   {  text += '<div class="table-cell-short-caption">';
	   }
	}
	text += '<p>';
	text += UncleanCaption;
	text += '</p>';
	text += '<p class="formula">';
	text += '<a href="javascript:parent.window.close()"';
	text += 'onclick="parent.window.close()">CLOSE THIS WINDOW</a>';
	text += '</p>';
	text += '</div>';
	text += '</div>';
	text += '</div>';
	text += '</div>';
	text += '</body></html>';
	ImageWindow = window.open("", WindowName, WindowProps);
	ImageWindow.document.open();
	ImageWindow.document.write(text);
	ImageWindow.document.close();
}

function IncludeCopyrightScreen() {
document.writeln('<p class="copyright-screen">');
document.writeln('Copyright &#169; 2005, The Regents of the University of California.'); 
document.writeln('All Rights Reserved.');
document.writeln('<br />');
document.writeln('This page is maintained by the ');
document.writeln('<a href="mailto:urrutia&#64;ucla.edu">Webmaster</a>, ');
document.writeln('and <a href="http://www.w3.org/Style/">CSS</a> makes it '); 
document.writeln('<a href="javascript:openPrinterFriendly()")>printer-friendly</a>.');
document.writeln('<br />');
document.writeln('Web site last updated: March 30, 2006.');
document.writeln('</p>');
}


function IncludeCopyrightPrint() {
document.writeln('<p class="copyright-print">');
document.writeln('Copyright &#169; 2005, The Regents of the University of California.'); 
document.writeln('All Rights Reserved.');
document.writeln('<br />');
document.writeln('Web site last updated: March 30, 2006.');
document.writeln('</p>');
}


function IncludeValidationIcons() {
document.writeln('<p>');
document.writeln('<a href="http://validator.w3.org/check/referer">');
document.writeln('   <img src="./valid-xhtml10.png"');
document.writeln('	alt="Valid XHTML 1.0!"');
document.writeln('	height="31px"');
document.writeln('	width="88px"');
document.writeln('        />');
document.writeln('</a>');
document.writeln('<br />');
document.writeln('<a href="http://jigsaw.w3.org/css-validator/">');
document.writeln('   <img src="./vcss.png"');
document.writeln('        alt="Valid CSS!"');
document.writeln('	height="31px"');
document.writeln('	width="88px"');
document.writeln('        />');
document.writeln('</a>');
document.writeln('</p>');
}


function IncludeFloatingMenu() {
document.writeln('<div class="Menu">');
document.writeln('<div class="MenuContents">');
document.writeln('<p class="menu">');
if ((window.location.pathname.indexOf("syllabus")) > 0) 
{  document.writeln('<a href="index.shtml">Home</a>');
   document.writeln('<span>Syllabus</span>');
   document.writeln('<a href="assignments/index.html">Assignments</a>');
   document.writeln('<a href="notes/index.html">Notes</a>');
   document.writeln('<a href="references/index.html">References</a>');
}
else 
{ if ((window.location.pathname.indexOf("assignments")) > 0)
  {  document.writeln('<a href="index.shtml">Home</a>');
	 document.writeln('<a href="syllabus.html">Syllabus</a>');
	 document.writeln('<span>Assignments</span>');
	 document.writeln('<a href="notes/index.html">Notes</a>');
	 document.writeln('<a href="references/index.html">References</a>');
  }
  else
  { if ((window.location.pathname.indexOf("notes")) > 0)
    {  document.writeln('<a href="index.shtml">Home</a>');
	   document.writeln('<a href="syllabus.html">Syllabus</a>');
	   document.writeln('<a href="assignments/index.html">Assignments</a>');
	   document.writeln('<span>Notes</span>');
	   document.writeln('<a href="references/index.html">References</a>');
     }
    else
    { if ((window.location.pathname.indexOf("references")) > 0)
      {  document.writeln('<a href="index.shtml">Home</a>');
	     document.writeln('<a href="syllabus.html">Syllabus</a>');
	     document.writeln('<a href="assignments/index.html">Assignments</a>');
	     document.writeln('<a href="notes/index.html">Notes</a>');
	     document.writeln('<span>References</span>');
      }
      else
      {  document.writeln('<span>Home</span>');
	     document.writeln('<a href="syllabus.html">Syllabus</a>');
	     document.writeln('<a href="assignments/index.html">Assignments</a>');
	     document.writeln('<a href="notes/index.html">Notes</a>');
	     document.writeln('<a href="references/index.html">References</a>');
      }
    }
  }  
}
document.writeln('</p>');
document.writeln('</div>');
document.writeln('</div>');
}
/* <a href="http://www.w3.org/TR/REC-CSS2/cover.html"> */


function IncludeFloatingMenuAll() {
document.writeln('<div class="Menu">');
document.writeln('<div class="MenuContents">');
document.writeln('<p class="menu">');
document.writeln('<a href="index.shtml">Home</a>');
document.writeln('<a href="syllabus.html">Syllabus</a>');
document.writeln('<a href="assignments/index.html">Assignments</a>');
document.writeln('<a href="notes/index.html">Notes</a>');
document.writeln('<a href="references/index.html">References</a>');
document.writeln('</p>');
document.writeln('</div>');
document.writeln('</div>');
}
/* <a href="http://www.w3.org/TR/REC-CSS2/cover.html"> */


