  	/*
	Sitewide JS file for www.manythings.org
	Charles Kelly
	started: 2009-01-23
	last update: 2009-02-26 6AM
	*/
base = 'http://www.manythings.org/';
site = 'www.ManyThings.org';
/********************
Top Bar Partial - Used by Following: h(); and tb();
********************/
function h2(title,description){
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Mac') != -1) {
//skips chrome: navigator.userAgent.toLowerCase().indexOf('chrome') == -1
document.write('<script src="http://www.manythings.org/z/safari.js"></script>');
} else {
a='<div id="ckwrap"><div id="ckcontent"><div id="skipnav"><a href="#content">Skip Navigation</a></div><div class="noprint"><div id="ckhead">';
a+='<img id="ckheaderlogo" src="'+base+'favicon.ico" alt="" width="24" height="24" />';
a+='<h1><a href="'+base+'">'+site+'</a></h1>';
a+='<div id="ckheadinfo">';
a+='<div id="cktopright">';
//a+='<a href="'+base+'textbook/">Textbook</a>';
//a+='<a href="http://aitech.ac.jp/~ckelly/yubin/">Feedback</a>';
//a+=' - <a href="'+base+'sponsors/">Sponsors</a>';
//a+='</div>';
document.write(a);
prevnexticons();
a='</div></div></div>';
a+='<a name="#content"></a>';
a+='<div id="ckpulldown">';
document.write(a);
pulldownmenu();
document.write('</div>');
ht();
}
}
/********************
Header Top Bar
********************/
function h(title,description){
h2();
lh(title,description);
document.write('</div><div id="ckcontents">');
//me();// = message
}
/********************
Top Bar ONLY - No Titles
********************/
function tb(title,description){
h2();
document.write('</div><div id="ckcontents">');
//me();
}
/********************
Message   me();
********************/
function me(){
document.write('<div class="ckmessage">We are currently updating our site. We\'ll be back 100% in a bit.</div>');
}
/********************
prevnext() Get <link rel
********************/
function prevnexticons(){
a = '';
if (GetLinkValue('prev')=="N/A"){
}else{
//a+='<a href="'+GetLinkValue('prev')+'"><= PREV</a> ';
a+='<a href="'+GetLinkValue('prev')+'"><img border="0" src="'+base+'z/ic/prev.gif'+'" alt="Previous Page"></a> ';
}
if (GetLinkValue('index')=="N/A"){
}else{
//a+=' [<a href="'+GetLinkValue('index')+'">INDEX</a>] ';
a+='<a href="'+GetLinkValue('index')+'"><img border="0" src="'+base+'z/ic/up.gif'+'" alt="Home Page of This Section"></a> ';
}
if (GetLinkValue('next')=="N/A"){
}else{
//a+='<a href="'+GetLinkValue('next')+'"> NEXT =></a> ';
a+='<a href="'+GetLinkValue('next')+'"><img border="0" src="'+base+'z/ic/next.gif'+'" alt="Next Page"></a> ';
}
a+='<a href="'+base+'"><img border="0" src="'+base+'z/ic/home.gif'+'" alt="Home Page of This Web Site"></a> ';
//a+='<a href="'+base+'/j/"><img border="0" src="'+base+'z/ic/jpn.gif'+'" alt="Menus in Japanese"></a> ';

a+='';
document.write(a);
// goes under flash on IE
// at();
}
/********************
Footer
********************/
function f(){
a='</div></div>';
a+='<div id="ckannouncement"><br /><br />If there is a problem, please send a <a href="http://www.manythings.org/z/bug.html">bug report</a>. &nbsp; &nbsp;<br /><br /></div>';
a+='<br /><br /></div>';
a+='<div class="clear"></div><div id="ckfooter">';
a+='<p id="ckfooter-left" class="alignleft"><span id="ckfooter-thankyou">'+site+' is <a href="'+base+'copyright.html">Copyright</a> &copy; 1997-2009 by <a href="http://aitech.ac.jp/~ckelly/">Charles Kelly</a> &amp; <a href="http://aitech.ac.jp/~ckelly/">Larry Kelly</a></span></p>';
a+='<p id="ckfooterupgrade" class="alignright">Page Updated: '+document.lastModified+'</p>';
a+='<div class="clear"></div>';
a+='</div>';
document.write(a);
//document.URL
}
/********************
StyleSheetLoaders (bgcolor) is optional
if color not defined then what it is in the CSS file
********************/
function s(bgcolor){
a='<link rel="stylesheet" href="'+base+'z/styles.css" type="text/css" media="all" />';
a+='<link rel="stylesheet" href="'+base+'z/print.css" type="text/css" media="print" />';
a+='<!--[if gte IE 6]>';
a+='<link rel="stylesheet" href="'+base+'z/stylesie6.css" type="text/css" media="all" />';
a+='<![endif]-->';
if (bgcolor){
a+='<style>body{background-color: ';
a+=bgcolor;
a+='}</style>';
}
document.write(a);
}
/********************
T Load Additional StyleSheet
Load additional css files     /  filename (without the .css)
********************/
function t(kelly){
a='<link rel="stylesheet" href="'+base+'z/';
a+=kelly
a+='.css" type="text/css" media="all" />';
document.write(a);
}
/********************
Load Local JavaScript -  only the name, not the .js part
u = dict  for http://a4esl.com/many/z/dict.js
********************/
function ll(u){
a='<script type="text/javascript" src="';
a+=base+'z/';
a+=u;
a+='.js"></script>';
document.write(a);
}
/********************
Load External JavaScript don't include 'http://' or '.js'
u = www.manythings.org/z/dict for  http://a4esl.com/many/z/dict.js
********************/
function le(u){
a='<script type="text/javascript" src="http://';
a+=u;
a+='.js"></script>';
document.write(a);
}
/********************
GET META VALUE for  Logo Header: Title, Description & Author
********************/
function GetMetaValue(n) {
var my_arr=document.getElementsByTagName("meta");
for (var counter=0; counter<my_arr.length; counter++) {
if (my_arr[counter].name.toLowerCase() == n.toLowerCase()) {
return my_arr[counter].content;
}
}
return "N/A";
}
/********************
GetLinkValue
********************/
function GetLinkValue(n) {
var my_arr=document.getElementsByTagName("link");
for (var counter=0; counter<my_arr.length; counter++) {
if (my_arr[counter].rel.toLowerCase() == n.toLowerCase()) {
return my_arr[counter].href;
}
}
return "N/A";
}
/********************
Logo Header: Title, Description & Author
********************/
function lh(title,description){
a='<div id="lh"><div class="ti">';
if(title){
a+=title;
}else{
a+=document.title;
}
a+='</div><div class="de">';
if(description){
a+=description;
}else{
if (GetMetaValue('description')=="N/A"){
a+='&nbsp;';
}else{
a+=GetMetaValue('description');
}
}
a+='</div>';
/* a+='<div class="au">';
if (GetMetaValue('author')=="N/A"){
a+='&nbsp;';
}else{
a+='By '+GetMetaValue('author');
}
a+='</div>';
*/
//a+='<br />';
a+='</div>';
document.write(a);
}
/********************
Hide Title: H1 class=title h2 class=description
********************/
function ht(){
a='<style>';
a+='#title{display:none;}\n';
a+='#description{display:none;}';
a+='</style>';
document.write(a);
}
/********************
Logo Header: lh_older_way_with_font_defined
********************/
function lh_older_way_with_font_defined(title,description){
a='<center><font size="5" face="Verdana">';
if(title){
a+=title;
}else{
a+=document.title;
}
a+='</font><br /><font size=2>';
if(description){
a+=description;
}else{
if (GetMetaValue('description')=="N/A"){
a+='&nbsp;';
}else{
a+=GetMetaValue('description');
}
}
a+='</font>';
if (GetMetaValue('author')=="N/A"){
//a+='&nbsp;';
}else{
//a+='<br /><small>';
//a+='By '+GetMetaValue('author');
//a+='</small>';
}
a+='</center><br />';
document.write(a);
}
/********************
Logo Header 2 - Title & Description    TABLE OLD WAY
********************/
function lh_with_table(title,description){
a='<center><table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#000000" bordercolor="#000000"><tr><th bgcolor="#DEDEDE"><a href="http://a4esl.com/many/"><font size="2" color="#000000">Interesting Things for ESL Students</font></a></th></tr><tr><th bgcolor="#FFFF80"><font size="4" face="Verdana" color="#000000">';
//a='<center><table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#000000" bordercolor="#000000"><tr><th bgcolor="#FFFF80"><font size="4" face="Verdana" color="#000000">';
if(title){
a+=title;
}else{
a+=document.title;
}
a+='</font><BR><font size=3>';
if(description){
a+=description;
}else{
if (GetMetaValue('description')=="N/A"){
a+='&nbsp;';
}else{
a+=GetMetaValue('description');
}
}
a+='</font></th></tr><tr><th bgcolor="#DEDEDE"><font size="2" color="#000000">';
//a+='</font></th></tr>';
if (GetMetaValue('author')=="N/A"){
a+='&nbsp;';
}else{
a+='By '+GetMetaValue('author');
}
a+='</font></th></tr></table></center><br />';
document.write(a);
//lr();
}
/********************
Logo Header 2 - Title & Description    TABLE OLD WAY
********************/
function lh_with_table2(title,description){
a='<center><table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#000000" bordercolor="#000000"><tr><th bgcolor="#DEDEDE"><a href="http://a4esl.com/many/"><font size="1" color="#000000">&nbsp;</font></a></th></tr><tr><th bgcolor="#FFFF80"><font size="4" face="Verdana" color="#000000">';
//a='<center><table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#000000" bordercolor="#000000"><tr><th bgcolor="#FFFF80"><font size="4" face="Verdana" color="#000000">';
if(title){
a+=title;
}else{
a+=document.title;
}
a+='</font><BR><font size=3>';
if(description){
a+=description;
}else{
if (GetMetaValue('description')=="N/A"){
a+='&nbsp;';
}else{
a+=GetMetaValue('description');
}
}
a+='</font></th></tr><tr><th bgcolor="#DEDEDE"><font size="1" color="#000000">';
a+='&nbsp</font></th></tr></table></center><br />';
document.write(a);
//lr();
}
/********************
Left NAV - manythings -other version in txt file has extra code at the bottom
********************/
function n(){
b = '<li><a href="'+base;
c = '</a></li>';
a='<div id="navwrap"><div id="cknav">';
a+=b+'">Home'+c;
a+=b+'e/easy.html">Easy Things for Beginners'+c;
a+=b+'e/vocabulary.html">Vocabulary'+c;
a+=b+'e/grammar.html">Grammar'+c;
a+=b+'e/quiz.html">Grammar / Vocabulary'+c;
a+=b+'e/patterns.html">Sentence Patterns'+c;
a+=b+'e/proverbs.html">Proverbs'+c;
a+=b+'e/slang.html">Slang &amp; Idioms'+c;
a+=b+'e/pronunciation.html">Pronunciation'+c;
a+=b+'e/listening.html">Listening'+c;
a+=b+'e/hearing.html">Hearing'+c;
a+=b+'e/podcasts.html">Podcasts / Songs / Jokes'+c;
a+=b+'e/reading.html">Reading'+c;
a+=b+'e/spelling.html">Spelling'+c;
a+=b+'e/crosswords.html">Crossword Puzzles'+c;
a+=b+'e/tt.html">Tongue Twisters &amp; Poems'+c;
a+=b+'e/voa.html">Voice of America (VOA)'+c;
a+=b+'e/misc.html">Misc. / Other Things</a>';
a+=b+'e/abc.html">Alphabetical List'+c;
a+=b+'daily/">Daily Page</a>';
a+=b+'e/about.html">About / Contact'+c;
a+=b+'e/links.html" class="last">Links'+c;
a+='</ul></div></div>';
//a+='<center><small><a href="http://a4esl.com/manythings.org/j/">Navigation Menus in Japanese<br /><img src="http://a4esl.com/manythings.org/img/jpn-banner.jpg" width="202" height="40"></a></li></small></center>';
document.write(a);
}
/********************
Yahoo Media Player
********************/
function ymp(){
document.write('<script type="text/javascript" src="http://mediaplayer.yahoo.com/js"></script>');
}
/********************
MP3 Flash Player
********************/
function m(url,name){
if (name){
document.write(name);
document.write('<br />');
}
document.write('<script language="JavaScript" src="http://www.manythings.org/mp3/player2.js"></script>');
document.write('<script language="JavaScript">MP3Player("');
document.write(url);
document.write('");</script>');
document.write('<br /><a href="'+url+'">Download MP3</a> (Right-click or Option-click)');
}
/********************
MP3 Flash Player to play on the page with extra
********************/
function mp(u,n){
s();h();
if (n){t=n;}else{t=u;}
document.write('<center><h1>'+t+'</h1>');
m(u,n);
document.write('<br /><br /><br /><a href="'+document.URL+'">Return / Go Back / 戻る</a><br />Your browser\'s back button may not work.</h3></center>');
f();
}
/********************
Flash SWF Code v=defaults to 6, w and h are optional
********************/
function swf(swf,v,w,h){
var defaultWidth = "96%";
var defaultHeight = "70%";
var vn = "6,0,0,0"; // DEFAULT
if (v==4){vn="4,0,0,0";}
else if (v==5){vn="5,0,0,0";}
else if (v==7){vn="7,0,0,0";}
else if (v==8){vn="8,0,0,0";}
else if (v==9){vn="9,0,0,0";}
else {v=6;}
var w = w || defaultWidth;
var h = h || defaultHeight;
a='<center><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+vn+'" WIDTH="'+w+'" HEIGHT="'+h+'" id="'+swf+'" ALIGN=""><PARAM NAME="movie" VALUE="'+swf+'"><PARAM NAME="loop" VALUE="false"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#fffff7"> <EMBED SRC="'+swf+'" LOOP="false" QUALITY="high" BGCOLOR="#fffff7" WIDTH="'+w+'" HEIGHT="'+h+'" NAME="'+swf+'" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></EMBED></OBJECT><br /><font size=2>This page requires the (free) <a href="http://get.adobe.com/flashplayer/">Flash Player plug-in</a> (Version '+v+' or Newer).<center>';
document.write(a);
}

/********************
Pull Down Menu
********************/
function gu(form){
var ur=form.s.selectedIndex;
top.location.href=form.s.options[ur].value;
}
function pulldownmenu(){
b = '<option value="'+base;
c = '</option>';
a='<center><form>';
//a+='<a href="javascript: history.go(-1)">&lt;&lt;</a> ';
a+='<select name="s" onChange="gu(this.form)" size=1>';
a+=b+'" selected="selected">Menu for '+site+c;
a+=b+'">=== Main Menus ==='+c;
a+=b+'">Home / Main Page</a>'+c;
a+=b+'e/vocabulary.html">Menu: Vocabulary'+c;
a+=b+'e/grammar.html">Menu: Grammar'+c;
a+=b+'e/quiz.html">Menu: Grammar / Vocabulary Quizzes'+c;
a+=b+'e/patterns.html">Menu: Patterns'+c;
a+=b+'e/proverbs.html">Menu: Proverbs'+c;
a+=b+'e/slang.html">Menu: Slang and Idioms'+c;
a+=b+'e/pronunciation.html">Menu: Pronunciation'+c;
a+=b+'e/listening.html">Menu: Listening'+c;
a+=b+'e/hearing.html">Menu: Hearing'+c;
a+=b+'e/podcasts.html">Menu: Podcasts / Songs / Jokes'+c;
a+=b+'e/reading.html">Menu: Reading'+c;
a+=b+'e/spelling.html">Menu: Spelling'+c;
a+=b+'e/crosswords.html">Menu: Crossword Puzzles'+c;
a+=b+'e/tt.html">Menu: Tongue Twisters and Poems'+c;
a+=b+'e/voa.html">Menu: Voice of America (VOA) Materials'+c;
a+=b+'e/misc.html">Menu: Misc. / Other Things'+c;
a+=b+'e/crosswords.html">Menu: Crossword Puzzles'+c;
a+=b+'e/tt.html">Menu: Tongue Twisters / Poems / Songs'+c;
a+=b+'">=== Activity Sections ==='+c;
a+=b+'anagrams/">Anagrams'+c;
a+=b+'ac/">Audio Concentration (Flash)'+c;
a+=b+'cts/">Catch the Spelling (Flash)'+c;
a+=b+'vocabulary/games/a/">Click the Letters in the Correct Order (Flash)'+c;
a+=b+'casp/">Computer Assisted Writing (CGI or JavaScript)'+c;
a+=b+'cg/">Concentration (Java)'+c;
a+=b+'cs/">Crossword Puzzles (Flash or Java)'+c;
a+=b+'daily/">Daily Page'+c;
a+=b+'df/df999.html">Dictionary Browser & Flashcard (Flash)'+c;
a+=b+'vocabulary/games/f/">Dictionary Lookup Flashcards (Flash)'+c;
a+=b+'vocabulary/games/c/">Every Other Letter Games (Flash Version)'+c;
a+=b+'vocabulary/games/v/">Every Other Letter Games (No Typing)'+c;
a+=b+'fq/">Flash Quizzes (Flash)'+c;
a+=b+'mq/">Flash Matching Quizzes (Flash)'+c;
a+=b+'fc/">Flashcards (Flash)'+c;
a+=b+'dl/">Flashcard-like Activity (Flash)'+c;
a+=b+'vocabulary/games/e/">Guess the Word Games (Flash)'+c;
a+=b+'hm/">Hangman (CGI)'+c;
a+=b+'hmf/">Hangman (Flash)'+c;
a+=b+'hmj/">Hangman (Java)'+c;
a+=b+'hmjs/">Hangman (JavaScript)'+c;
a+=b+'wbg/">JigWords, MatchWords & SpeedWords (Flash)'+c;
a+=b+'jokes/">Jokes (MP3)'+c;
a+=b+'jumble/">Jumble (Java)'+c;
a+=b+'listen/">Listen & Read Along (F)'+c;
a+=b+'repeat/">Listen & Repeat (MP3)'+c;
a+=b+'el/">Listening Room (RealAudio & JavaScript)'+c;
a+=b+'lulu/">Picture Games (JavaScript)'+c;
a+=b+'vq/">Picture Quizzes (JavaScript)'+c;
a+=b+'pp/">Pronunciation Practice (Flash)'+c;
a+=b+'proverbs/">Proverbs'+c;
a+=b+'qs/">Quiz Show (Java)'+c;
a+=b+'rs/">Random Sentences (JavaScript)'+c;
a+=b+'signs/">Reading English Signs'+c;
a+=b+'ss/">Scrambled Sentences (Java / JavaScript)'+c;
a+=b+'sw/">Scrambled Words (Java)'+c;
a+=b+'sm/">Sentence Machine (Flash)'+c;
a+=b+'slang/">Slang'+c;
a+=b+'songs/">Songs (MP3 Podcast)'+c;
a+=b+'vocabulary/games/l/">Spelling & Typing Games (Flash)'+c;
a+=b+'c/r.cgi/quiz">Super Quiz Machine (CGI & JavaScript)'+c;
a+=b+'ts/">Travel Survival'+c;
a+=b+'voa/">VOA Quizzes (Flash)'+c;
a+=b+'voa/sentences.htm">VOA Sentences (CGI)'+c;
a+=b+'voa/scripts/">VOA Reading'+c;
a+=b+'vocabulary/">Vocabulary Lists & Games'+c;
a+=b+'vocabulary/games/b/">Word Drop Games (Flash)'+c;
a+=b+'wf/">Word Find / Word Search (Java)'+c;
a+=b+'wm/">WordMeister (Java)'+c;
a+=b+'wordstrips/">Word Strips (Flash)'+c;
a+=b+'">=== Experiments ==='+c;
a+=b+'sp/">Slider Puzzle (Java)'+c;
a+=b+'dd/">Drag and Drop Puzzle (Java)'+c;
a+=b+'mb/">Magnet Boards (Java)'+c;
a+=b+'reading/">Reading Room'+c;
a+=b+'it/sitemap.html">Site Map'+c;
a+=b+'">=== For Japanese People ==='+c;
a+=b+'mt/">Many Things Textbook Support'+c;
a+=b+'j/">Menus in Japanese'+c;
a+=b+'japanese/">=== For Students of Japanese ==='+c;
a+=b+'japanese/">Japanese Study Materials'+c;
a+=b+'tesl/">=== For Teachers ==='+c;
a+=b+'tesl/">Interesting Things for ESL Teachers'+c;
a+=b+'e/abc.html">Alphabetical List'+c;
a+='</select></form>';
a+='</center><p>';
document.write(a);
}
/****************
at = AddThis.com
****************/
function at(){
a='<script type="text/javascript">var addthis_options = \'favorites, digg, delicious, myspace, google, facebook, reddit, live, stumbleupon, twitter, diigo, more\';var addthis_pub="manythings";</script>';
a+='<a href="http://www.addthis.com/bookmark.php?v=20" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>';
a+='<script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>';
document.write(a);
}

/********************
from: wordpress-admin-bar.js
********************/
function showNav(element) {
	element.getElementsByTagName('UL')[0].style.left='auto';
	element.getElementsByTagName('A')[0].className='wpabar-menupop wpabar-menuhover';
}
function hideNav(element) {
	element.getElementsByTagName('UL')[0].style.left='-999em';
	element.getElementsByTagName('A')[0].className='wpabar-menupop';
}


/********************
Keep People from Framing
********************/
if(self.parent.frames.length != 0){setTimeout ('top.location=self.location',2000);}




