﻿var destWords = new Array("Do", "Do you", "Do you know", "Do you know you", "Do you know you can", "Do you know you can define", "Do you know you can define your", "Do you know you can define your own", "Do you know you can define your own destiny?");
var destIdx = 0;
var homePage = 1;
var sentientTexts = new Array("1", "2", "3");
var sentientIdx = -1;

function doIdleTasks() {
// Change text only if we have not shown all
if (destIdx < destWords.length) yourDest.innerText = destWords[destIdx];
destIdx++;
destIdx %= (destWords.length * 2 - 2);	// Wait 3 (8-2) seconds before recycle text

if (sentientIdx < 0) {
 sentientTexts[0] = "If any sentient beings plagued by lusts recite constantly with deep respect the name of Bodhisattva Perceiver of World Sound, they will be set free from their lusts."
 sentientTexts[1] = "If any sentient beings beset by hatred recite constantly with deep respect the name of Bodhisattva Perceiver of World Sound, they will be set free from their hatred."
 sentientTexts[2] = "If any sentient beings overwhelmed by foolishness recite constantly with deep respect the name of Bodhisattva Perceiver of World Sound, they will be set free from foolishness."

 if (homePage) {
  sentientBeings.style.color = 0xa020f0;
  sentientBeings.innerText = sentientTexts[0];
  }

 sentientIdx = 1;
 window.setInterval("doRotateSentients()", 10000);
 }
}

function doRotateSentients() {
 if (homePage) {
  sentientBeings.innerText = sentientTexts[sentientIdx];
  sentientBeings.style.color = (sentientIdx==0?0xa020f0:(sentientIdx==1?0x000080:0xa52a2a));
 }
 sentientIdx++
 sentientIdx %= 3;
}


function wt(url, txt) {
document.write("<a href=" + url + " class=top_header>" + txt + "</a><img src=images/space.gif border=0 width=20></img>");
}



function wl(url, txt) {
document.write("   <tr><td colspan=2><img src=images/space.gif height=10 width=0 border=0></img></td></tr>");
document.write("   <tr><td valign=top>&bull;&nbsp;</td><td><a href=" + url + " class=leftMenu>" + txt + "</a></td></tr>");
}



function wtop() {
document.write("<tr bgcolor=#cccc99 height=40>");
document.write("<td colspan=3 valign=top align=left>");
document.write("<img src=images/space.gif border=0 width=5></img>");
wt("index.html", "Home");
wt("who.html", "Who");
wt("why.html", "Why");
wt("how.html", "How");
wt("when.html", "When");
wt("where.html", "Where");
wt("what.html", "What");
wt("glossary.html", "Glossary");
wt("mailto:info@buddhas.net?subject=BUDDHAS.NET%20Web%20Site", "Contact Us");
wt("mailto:info@buddhas.net?subject=BUDDHAS.NET%20Web%20Site", "Comment");
document.write("</td>");
document.write("</tr>");
}



function wleft() {
var d = document;
d.write("   <tr>");
d.write("    <td colspan=3 align=center>");
d.write("     <table bgcolor=#000000 align=center cellspacing=2 cellpading=0 width=150 height=150 border=0>");
d.write("      <tr height=80><td bgcolor=#ffffff align=center><a href=who.html#destiny style='font-family: Times New Roman; font-weight:bold; font-size:13pt; color:#ff0000; text-decoration:none' ID='yourDest'>");
d.write("</a></td></tr>");

d.write("     </table>");
d.write("    </td>");
d.write("   </tr>");

d.write("   <tr>");
d.write("    <td colspan=3 align=center>");
d.write("     <table bgcolor=#ffffff align=center cellspacing=0 cellpading=0 width=150 height=24 border=0>");
d.write("      <tr bgcolor=#cccc99 height=24><td align=center><img src=images/update.gif border=0></img></td></tr>");
d.write("     </table>");
d.write("    </td>");
d.write("   </tr>");

wl("filial.html", "Filial Piety");
wl("birth.html", "Birth of the Buddha");
wl("who.html#destiny", "Defining your own destiny");
wl("who.html#speed", "Faster than the speed of light");
wl("when.html#timeout", "Don't let time run out");
wl("what2.html#thusheard", "Thus have I heard");
wl("where.html#obstacle", "The biggest obstacle to enlightenment");
wl("goodDeeds.html", "Can good deeds save us?");
wl("what2.html#importance", "The importance of studying Sutras");
wl("contemplate.html", "How should we contemplate?");
wl("methods.html", "Expedient methods to complete enlightenment");
wl("path.html", "The Noble Eightfold Path");
wl("links.html", "The Twelve Links of Causation");
wl("quiet.html", "How to quiet the mind?");
wl("mind.html", "What is the mind of Ch'an?");
wl("what.html#whoami", "Who am I?");
wl("truth.html", "The body of Truth has no marks");
wl("confucius.html", "Confucius said");
wl("joy.html", "No greater joy");

//wl("notBuddha.html", "I vow not to be a Buddha");
document.write("   <tr><td colspan=2><img src=images/space.gif height=10 width=0 border=0></img></td></tr>");
document.write("   <tr><td valign=top>&bull;&nbsp;</td><td><a href=" + "notBuddha.html" + " class=leftMenu>" + "I vow not to be a Buddha" + "<br><img src=images/lighthouse.gif border=0></img></a></td></tr>");
}



function wfoot() {
// Footer
var d = document;
//d.write("<tr><td colspan=3 height=300>&nbsp;</td></tr>");
//d.write("<tr><td colspan=3 height=5>&nbsp;</td></tr>");

//d.write("<tr bgcolor=#c0c080><td colspan=3><img valign=bottom src=images/space.gif border=0 width=0 height=10></img></td></tr>");

d.write("<tr><td colspan=3 align=center><img src=images/butterfly.gif border=0></img></td></tr>");
d.write("<tr bgcolor=#ffe040><td colspan=3><img valign=bottom src=images/space.gif border=0 width=0 height=10></img></td></tr>");
d.write("<tr><td colspan=3 align=center>");
d.write(" <table><tr>");
d.write("  <td valign=middle align=right><span class=txtFtFree>Free</span><span class=txtFtSutra>Sutra</span><span class=txtFtCom>.Com&nbsp;</span>");
d.write("  <td valign=middle align=center><img src=images/dao.gif border=0></img></td>");
d.write("  <td valign=middle align=left><span class=txtFtBuddhology>&nbsp;Buddhology</span><span class=txtFtCom2>.com</span></td>");
d.write(" </tr></table>");
d.write("</td></tr>");

d.write("<tr height=40><td colspan=3 align=center valign=bottom><span style='font-family:Verdana;font-size:18pt;color=#0000ff'>Buddhas.net</span></td></tr>");

d.write("<tr><td colspan=3 align=center valign=top><font size=1>Copyright &copy; 2002.C & T WU</font></td></tr>");

d.write("<tr><td colspan=3 align=center><img src=images/space.gif border=0 width=0 height=10></img></td></tr>");
wtop();

d.write("</table>");
}



function writeBeginShell(img, ht, wd, hdr) {
var d = document;
d.write("<table width='650px' cellspacing=0 cellpadding=0 border=0>");
d.write("<tr bgcolor=#000000><td colspan=3 align=right><a name=top><span class=welcome>Welcome to Buddhas.net&nbsp;</span></a></td></tr>");
//d.write("<tr bgcolor=#200060><td colspan=3><img src=images/space.gif border=0 width=0 height=5></img></td></tr>");
d.write("<tr bgcolor=#200060 valign=bottom><td colspan=3 valign=bottom><a href=index.html><img src=images/space.gif border=0 width=5></img>");
d.write("<span class=buddhasdot>Buddhas</span><img src=images/aniStar.gif border=0></img><span class=net>net</span></a></td></tr>");
d.write("<tr bgcolor=#200060><td colspan=3 valign=top height=3><img src=images/space.gif border=0 width=5></img><span style='font-family: Times New Roman; font-weight:bold; font-size:11pt; color:#cccc99; text-decoration:none'>An invitation to Enlightenment</span></td></tr>");
d.write("<tr bgcolor=#200060><td colspan=3><img src=images/space.gif border=0 width=0 height=1></img></td></tr>");

wtop();

d.write("<tr><td colspan=3><img src=images/space.gif height=1 width=0 border=0></img></td></tr>");

d.write("<tr>");
d.write(" <td valign=top>"); // Begin left column
d.write("  <table bgcolor=#ffffff border=0 width='190px' cellspacing=0 cellpadding=0>");
wleft();
d.write("  </table");
d.write(" </td>"); // End left column

d.write(" <td valign=top>"); // Begin center column
d.write("  <table bgcolor=#ffffff border=0 width='350px' cellspacing=0 cellpadding=0>");
d.write("   <tr><td class=txt>");

// Page header: small image: header, stars
if (!hdr) return;

if (img == null || img == "") {
 d.write("<span class=topic_header_page>" + hdr + "</span>");
 } else {
  d.write("<table>");
  d.write("<tr><td ><img src=images/" + img + " width=" + wd.toString() + " height=" + ht.toString() + " border=0></img></td>");
  d.write("<td align=center><span class=topic_header_page>" + hdr + "</span>");
  d.write("<br>");
  for (var i=0; i<5; i++) d.write("<img src=images/star.gif border=0></img>");
  d.write("</td></tr>");
  d.write("</table>");
 }
}



function writeEndShell(img, ht, wd, home, noTopOfPage) {
var imgName; var imgHt; var imgWd;
if (img != null && img != "") { imgName=img; imgHt=ht; imgWd=wd; }
else { imgName="P7.JPG"; imgHt=160; imgWd=170; }

var d = document;
d.write("   </td></tr>");
d.write("  </table");
d.write(" </td>"); // End center column

d.write(" <td valign=top>"); // Begin right column

d.write("<table cellspacing=0 cellpading=0 width=140 height=80 border=0>");
d.write("<tr><td colspan=2 align=center><img src=images/" + imgName + " width=" + imgWd.toString() + " height=" + imgHt.toString() + " border=0></img></td></tr>");

if (home != null && home) {
 homePage = 1;
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td><td align=center style='font-family:Verdana;font-weight:bold;font-size:10pt;color:#0000ff;border-color:#cccccc;border-width:thin;border-style:solid'>The Buddha's Teachings<br>are for everyone,<br>no matter which religious<br>belief we profess.</td></tr>");
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td><td align=center style='font-family:Verdana;font-weight:bold;font-size:10pt;color:#0000ff;border-color:#cccccc;border-width:thin;border-style:solid'>Avoid any evil,<br>Practice all good,<br>Purify our mind.<br>These are the<br>Buddha's teachings.</td></tr>");
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td><td align=center style='font-family:Verdana;font-weight:bold;font-size:10pt;color:#0000ff;border-color:#cccccc;border-width:thin;border-style:solid'>Compassion<br>is<br>true love</span><br><img src=images/heart.gif border=0></img></td></tr>");
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td><td align=center style='font-family:Verdana;font-weight:bold;font-size:10pt;color:#0000ff;border-color:#cccccc;border-width:thin;border-style:solid'>Tao is<br>the nature<br>the truth<br>and one's<br>conscience</td></tr>");
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td><td align=center style='font-family:Verdana;font-weight:bold;font-size:10pt;color:#0000ff;border-color:#cccccc;border-width:thin;border-style:solid'>Cultivation<br>begins with<br>precepts</td></tr>");
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td><td align=center style='font-family:Verdana;font-weight:bold;font-size:10pt;color:#0000ff;border-color:#cccccc;border-width:thin;border-style:solid'>All dharmas<br>arise<br>because of<br>conditions</span><br><img src=images/ball.gif border=0></img></td></tr>");

 // Sentient Beings...
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td>");
  d.write("<td colspan=2>");
   d.write("<table bgcolor=#cccccc align=center cellspacing=2 width=200 cellpading=0 border=0>");
    d.write("<tr height=200><td bgcolor=#ffffff align=center style='font-family: Times New Roman; font-weight:bold; font-size:13pt; color:#0xcccccc; text-decoration:none' ID='sentientBeings'>");
    d.write("</td></tr>");
   d.write("</table>");

   d.write("<table bgcolor=#ffffff cellspacing=0 cellpading=0 width=200 height=24 border=0>");
    d.write("<tr bgcolor=#cccc99><td align=center class=top_header>Lotus Sutra</td></tr>");
   d.write("</table>");
  d.write("</td>");
 d.write("</tr>");
}
else {
 homePage = 0;
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td><td align=center style='font-family:Verdana;font-weight:bold;font-size:10pt;color:#0000ff;border-color:#cccccc;border-width:thin;border-style:solid'>The Buddha's Teachings<br>are for everyone,<br>no matter which religious<br>belief we profess.</td></tr>");
 d.write(" <tr><td colspan=2><img src=images/space.gif height=5 width=0 border=0></img></td></tr>");
 d.write("<tr><td><img src=images/space.gif height=5 width=10 border=0></img></td><td align=center style='font-family:Verdana;font-weight:bold;font-size:10pt;color:#0000ff;border-color:#cccccc;border-width:thin;border-style:solid'>Avoid any evil,<br>Practice all good,<br>Purify our mind.<br>These are the<br>Buddha's teachings.</td></tr>");
}

d.write("</table>");

d.write(" </td>"); // End right column
d.write("</tr>");

if (!(noTopOfPage != null && noTopOfPage))
	d.write("<tr height=50><td></td><td align=right valign=bottom><a href=#top><span style='font-family:Times New Roman,Verdana,Arial,Helvetica; font-weight=bold; font-size:12pt; color:#000000'>Top of Page</span></a></td><td></td></tr>");
wfoot();

window.setInterval("doIdleTasks()", 500);

// Begin Directnic tracking
// do not make any changes to anything past this point or tracking script will not work
var data;
document.cookie='__support_check=1';

if (location.host) {
	var domain_name = '&d=' + location.host;
} else {
	var domain_name = '&d=unknown';
}

if (document.referrer) {
	var referrer_website = '&r=' + document.referrer;
} else {
	var referrer_website = '&r=unknown';
}

if (navigator.appName) {
	var browser_name = '&b=' + escape(navigator.appName);
} else {
	var browser_name = '&b=unknown';
}

if (navigator.userAgent) {
	var full_browser_info = '&fbi=' + escape(navigator.userAgent);
} else {
	var full_browser_info = '&fbi=unknown';
}

if (navigator.appVersion) {
	var app_version = '&aV=' + escape(navigator.appVersion);
} else {
	var app_version = '&aV=unknown';
}

if (navigator.javaEnabled()) {
	var java_enabled = '&jE=' + navigator.javaEnabled();
} else {
	var java_enabled = '&jE=unknown';
}

if (screen.width) {
	var screen_width = '&sw=' + screen.width;
} else {
	var screen_width = '&sw=unknown';
}

if (screen.height) {
	var screen_height = '&sh=' + screen.height;
} else {
	var screen_height = '&sh=unknown';
}

if (screen.colorDepth) {
	var color_depth = '&cd=' + screen.colorDepth;
} else {
	var color_depth = '&cd=unknown';
}

data = 'a=track' + domain_name + referrer_website + browser_name + full_browser_info + app_version;
data = data + java_enabled + screen_width + screen_height + color_depth;

document.write('<img border=0 hspace=0 vspace=0 SRC="http://stats.directnic.com/tracker.php?' + data + '">');

// End Directnic tracking

}

