﻿var a = [
'Rise with the sun to pray. Pray alone, and pray often. The Great Spirit will listen, if you only speak.',
'Be tolerant of those who are lost on their path. Ignorance, conceit, anger, jealousy and greed stem from a lost soul. Pray that they will find guidance.',
'Search for yourself by yourself. Do not allow others to make your path for you - it is yours alone. Others may walk it with you, but no one can walk it for you.',
'Treat the guests in your home with much consideration. Serve them the best food, give them the best bed and treat them with respect and honor.',
'Do not take what is not yours, whether from a person, a community, the wilderness or a culture. It was not earned nor given; it is not yours.',
'Respect all things that are placed upon this Earth. People, animals, plants, mountains, trees - everything has an equal importance.',
'Honor other people\'s thoughts, wishes and words. Never interrupt another or mock or rudely mimic them. Allow each person the right to personal expression.',
'Never speak of others in a bad way. The negative energy that you put out into the universe will multiply when it returns to you.',
'All persons make mistakes. All mistakes can be forgiven.',
'Bad thoughts cause illness of the mind, body and spirit. Practice optimism.',
'Nature is not <u>for</u> us, it is a <u>part</u> of us. It is a part of our worldly family.',
'Children are the seeds of our future. Plant love in their hearts and water them with wisdom and life\'s lessons. When they are grown, give them space to grow.',
'Avoid hurting the hearts of others. The poison of your pain will return to you.',
'Be truthful at all times. Honesty is the test of ones will within this universe.',
'Your mental, spiritual, emotional, and physical selves all need to be strong, pure and healthy. A healthy body focuses the mind. A rich spirit cures emotional ails.',
'Make conscious decisions as to who you will be and how you will react. Be responsible for your own actions.',
'Respect the privacy and personal space of others. Do not touch the personal property of others - especially sacred and religious objects. This is forbidden.',
'Be true to yourself first. You cannot nurture and help others if you cannot nurture and help yourself first.',
'Respect others\' religious beliefs. Do not force your beliefs on others.',
'Share your good fortune with others. Participate in charity.'
];

var rand = Math.round(19*Math.random());

function makebox() {
	if (bs == 2) bsstyle = 'dotted'
	else if (bs == 3) bsstyle = 'dashed'
	else {
		bsstyle = 'solid';
		bs = 1;
	}

	if (htf == 1) htfstyle = 'Verdana, Arial, Helvetica, sans-serif'
	else if (htf == 2) htfstyle = '"Trebuchet MS", Geneva, Arial, Helvetica, SunSans-Regular, sans-serif'
	else if (htf == 3) htfstyle = '"Zapf Chancery", "Comic Sans MS", cursive'
	else if (htf == 4) htfstyle = 'Georgia, "Times New Roman", Times, serif'
	else if (htf == 5) htfstyle = '"Courier New", Courier, Monaco, monospace'
	else htfstyle = 'Helvetica, Geneva, Arial, SunSans-Regular, sans-serif';

	if (btf == 1) btfstyle = 'Verdana, Arial, Helvetica, sans-serif'
	else if (btf == 2) btfstyle = '"Trebuchet MS", Geneva, Arial, Helvetica, SunSans-Regular, sans-serif'
	else if (btf == 3) btfstyle = '"Zapf Chancery", "Comic Sans MS", cursive'
	else if (btf == 4) btfstyle = 'Georgia, "Times New Roman", Times, serif'
	else if (btf == 5) btfstyle = '"Courier New", Courier, Monaco, monospace'
	else btfstyle = 'Helvetica, Geneva, Arial, SunSans-Regular, sans-serif';
	
	bw = (+bw);
	if (bw < 0) bw = 0;
	if (bw > 10) bw = 10;

	hts = (+hts);
	if (hts < 0) hts = 0;
	if (hts > 48) hts = 48;
	
	hl = (+hl);
	if (hl < 0) hl = 0;
	if (hl > 20) hl = 20;

	bts = (+bts);
	if (bts < 0) bts = 0;
	if (bts > 48) bts = 48;
	
	w = (+w);
	if (w > 600) w = 600;
	if (w < 0) w = 0;
	
	h = (+h);
	if (h > 400) h = 400;
	if (h < 0) h = 0;
	
	p = (+p);
	if (p < 0) p = 0;
	if (p > 20) p = 20;
	
	d = (+d);
	if (d < 0) d = 0;
	if (d > 999) d = 999;
	
	bc = bc.replace(/[^0-9a-fA-F]/g, '');
	bgc = bgc.replace(/[^0-9a-fA-F]/g, '');
	htc = htc.replace(/[^0-9a-fA-F]/g, '');
	btc = btc.replace(/[^0-9a-fA-F]/g, '');
	
	wcalc = w - (2*bw) - (2*p);
	hcalc = h - (2*bw) - (2*p);
	
	htlh = (+hts)+3;
	btlh = (+bts)+3;
	
	wisdivj = document.getElementById('wisdiv');
	wisdivj.style.borderWidth = bw+'px';
	wisdivj.style.borderColor = '#'+bc;
	wisdivj.style.borderStyle = bsstyle;
	wisdivj.style.backgroundColor = '#'+bgc;
	wisdivj.style.width = wcalc+'px';
	wisdivj.style.height = hcalc+'px';
	wisdivj.style.padding = p+'px';
	
	wisheadj = document.getElementById('wishead');
	wisheadj.style.fontSize = hts+'px';
	wisheadj.style.color = '#'+htc;
	wisheadj.style.fontFamily = htfstyle;
	wisheadj.style.lineHeight = htlh+'px';

	document.getElementById('wisheaddiv').style.marginBottom = hl+'px';

	wisbodyj = document.getElementById('wisbody');
	wisbodyj.style.fontSize = bts+'px';
	wisbodyj.style.color = '#'+btc;
	wisbodyj.style.fontFamily = btfstyle;
	wisbodyj.style.lineHeight = btlh+'px';
	
	wisbodyheight = h - (2*p) - (2*bw) - document.getElementById('wisheaddiv').offsetHeight - hl - 10;
	document.getElementById('wisbodydiv').style.height = wisbodyheight + 'px';

	wisfootwidth = w - (2*p) - (2*bw);
	document.getElementById('wisfootdiv').style.width = wisfootwidth + 'px';
	
	bgc1 = bgc.substring(0,1);
	bgc2 = bgc.substring(1,2);
	bgc3 = bgc.substring(2,3);

	hex = '0123456789abcdef';
	linkc = '';

	hexpos1 = hex.search(bgc1);
	hexpos2 = hex.search(bgc2);
	hexpos3 = hex.search(bgc3);
	
	if (hexpos1 < 4) hexpos1 = hexpos1 + 8;
	if (hexpos2 < 4) hexpos2 = hexpos2 + 8;
	if (hexpos3 < 4) hexpos3 = hexpos3 + 8;

	linkc = linkc + hex.substring(hexpos1 - 4, hexpos1 - 3);
	linkc = linkc + hex.substring(hexpos2 - 4, hexpos2 - 3);
	linkc = linkc + hex.substring(hexpos3 - 4, hexpos3 - 3);

	document.getElementById('footlink').style.color = '#' + linkc;
	if (w < h) { document.getElementById('wisfootdiv').style.textAlign = 'center'; }
		else { document.getElementById('wisfootdiv').style.textAlign = 'right'; }
}

function rotat() {
	rand ++;
	if (rand == 20) rand = 0;
	dcalc = d*1000;
	document.getElementById('wisbody').innerHTML = a[rand];
	setTimeout ("rotat()", dcalc);
}

document.write("<style type=\"text/css\"> .foot:link { text-decoration: none; } .foot:visited { text-decoration: none; } .foot:hover { color: #000; text-decoration: underline; } .foot:active { text-decoration: underline; } </style><div id=\"wisdiv\" style=\"margin-left: auto; margin-right: auto; overflow: hidden\"><div id=\"wisheaddiv\"><p class=\"wishead\" style=\"margin: 0px\" id=\"wishead\"><b>Native American Code of Ethics</b></p></div><div id=\"wisbodydiv\" style=\"overflow: hidden\"><p class=\"wisbody\" style=\"margin: 0px\" id=\"wisbody\"></p></div><div id=\"wisfootdiv\" style=\"height: 10px\"><p style=\"font-size: 9px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; margin: 0px\"><a id=\"footlink\" class=\"foot\" href=\"http://native-american-store.fournotes.com/widget.php\">Put this on your site</a></p></div></div>");

makebox();
rotat();