//Browser Stiff
var ns4=document.layers?1:0;
var ie4=document.all?1:0;
var ie55=0;
var ie6=0;
var ns6=document.getElementById&&!document.all?1:0;
var op5=navigator.appName=='Opera'&&navigator.appVersion.substring(0, 3)>='5'?1:0;
var browser_OK=0;

if (navigator.appName.substring(0,9) == "Microsoft") {
        msiestart = (navigator.appVersion.indexOf('(') + 1);
        msieend = navigator.appVersion.indexOf(')');
        msiestring = navigator.appVersion.substring(msiestart, msieend);
        msiearray = msiestring.split(";");
        msieversion = msiearray[1].split(" ");
        version = msieversion[2];
		ie55=version>='5.5'?1:0
		ie6=version>='6'?1:0
}

if (ie4||ns6||op5) {
	browser_OK=1;
}

if (ie4&&!ie6) {
	document.writeln('<link rel="stylesheet" type="text/css" href="style/secondary_style.css" />')
}

//Random Header Image
var imghold=new Array()
var imgCnt=new Array()
imgCnt[0]="images/w_001.jpg"
imgCnt[1]="images/w_002.jpg"
imgCnt[2]="images/w_003.jpg"
imgCnt[3]="images/w_004.jpg"
imgCnt[4]="images/w_005.jpg"
imgCnt[5]="images/w_007.jpg"
imgCnt[6]="images/w_009.jpg"
imgCnt[7]="images/w_010.jpg"
imgCnt[8]="images/w_012.jpg"
imgCnt[9]="images/w_013.jpg"
imgCnt[10]="images/w_014.jpg"
imgCnt[11]="images/w_015.jpg"

//Preload Background Images into imghold
for (i=0;i<imgCnt.length;i++){
	imghold[i]=new Image()
	imghold[i].src=imgCnt[i]
}

var imgCurrent="0"

function RandomImage() {
	if (!document.images||!browser_OK) return;
	imgCurrent = Math.floor(Math.random()*imgCnt.length);
	el=document.getElementById?document.getElementById("wallpaper"):document.all.wallpaper;
	el.style.background="url('" + imgCnt[imgCurrent] + "') #669966 top left no-repeat scroll"
//	el.style.background="url('" + imghold[imgCurrent].src + "') #669966 top left no-repeat scroll"
//	el.background=imghold[imgCurrent].src;
}

// Navigation Color Change onHover
function HighLightCell(e,sColor) {
	e.style.backgroundColor=sColor;
}

//Quotes Store
var iQuotes=new Array;
var iTags=new Array;
var iLinks=new Array;
//------------------------------------
iQuotes[0]="Do not be idolatrous about or bound to any doctrine, theory, or ideology...";
iQuotes[1]="Truth is found in life and not merely in conceptual knowledge."; 
iQuotes[2]="Do not force others, including children, by any means whatsoever, to adopt your views..."; 
iQuotes[3]="Do not avoid contact with suffering or close your eyes before suffering."; 
iQuotes[4]="Live simply and share time, energy, and material resources with those who are in need."; 
iQuotes[5]="Do not maintain anger or hatred."; 
iQuotes[6]="Be in touch with what is wondrous, refreshing, and healing both inside and around you."; 
iQuotes[7]="Do not utter words that can create discord and cause the community to break."; 
iQuotes[8]="Do not say untruthful things for the sake of personal interest or to impress people.";
iQuotes[9]="Do not use the buddhist community for personal gain or profit, or transform your community into a political party.";
iQuotes[10]="Do not live with a vocation that is harmful to humans and nature.";
iQuotes[11]="Find whatever means possible to protect life and prevent war."
iQuotes[12]="Possess nothing that should belong to others."
iQuotes[13]="Do not mistreat your body.  Learn to handle it with respect."
iQuotes[14]="If in our daily life we can smile, if we can be peaceful and happy, not only we, but everyone will profit from it."
iQuotes[15]="It is with our capacity of smiling, breathing, and being peace that we can make peace. "
iQuotes[16]="Our appointment with life is in the present moment."
iQuotes[17]="As we cultivate peace and happiness in ourselves, we also nourish peace and happiness in those we love."
iQuotes[18]="The true miracle is not walking on water or walking in air, but simply walking on this earth."
//-------------------------------------
function PickQuote() {
	if (!browser_OK) return;
	iLength=iQuotes.length;
	iNum = Math.floor((Math.random() * iLength));
	elQuote=document.getElementById?document.getElementById("RandomQuote"):document.all.RandomQuote;
	elQuote.innerHTML='"' + iQuotes[iNum] + '" - Thich Nhat Hanh'// + iTags[iNum]
}
// Popup Window Creator
function popWin(win) {
   ops='toolbar=yes,location=no,directories=no,menubar=yes,scrollbars=yes'
   if (ie4) {
      ops+=',left=0,top=0,width=600,height=400'
    }else{
      ops+=',screenX=0,screenY=0,width=600,height=400'
    }
   newWin=window.open(win,"",ops)     
   newWin.focus()
}

// Confirm Subscription
function confirmJoin(sText) {
   var sLeft = (screen.width-300) / 2;
   var sTop = (screen.height-125) / 2;
   var ops = 'toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes';
   if (ie4) {
      ops+=',left=' + sLeft + ',top=' + sTop + ',width=300,height=125'
    }else{
      ops+=',screenX=' + sLeft + ',screenY=' + sTop + ',width=300,height=125'
    }
   confirmWin=window.open("","",ops);
   confirmWin.document.write('<div align=\"center\">' + sText + '<\/div>')    ;
   confirmWin.focus();
   setTimeout("confirmWin.close();",5000);
}

function printArticle() {
	if (window.print) setTimeout('window.print();',200);
		else if (agt.indexOf("mac") != -1) alert("Press 'Cmd+p' on your keyboard to print article.");
			else alert("Press 'Ctrl+p' on your keyboard to print article.")
}