// function hides email address from email harvesters
function showEM(userName, emServer) {
	userName = stringReverse(userName);
	emServer = stringReverse(emServer);
	var emLink = userName+"@"+emServer;
	document.write("<a href='mailto:"+emLink+"'>")
	document.write(emLink);
	document.write("</a>");
}

// function hides email address from email harvesters
function showEM2(userName, emServer, linkText, title) {
	userName = stringReverse(userName);
	emServer = stringReverse(emServer);
	linkText = stringReverse(linkText);
	title = stringReverse(title);
	var emLink = userName+"@"+emServer;
	document.write("<a href='mailto:"+emLink+"' title='"+title+"'>")
	document.write(linkText);
	document.write("</a>");
}

// function hides email address from email harvesters
function showEM3(userName, emServer, title) {
	userName = stringReverse(userName);
	emServer = stringReverse(emServer);
	title = stringReverse(title);
	var emLink = userName+"@"+emServer;
	document.write("<a href='mailto:"+emLink+"' title='"+title+"'>")
}

// function reverses text string to disguise text
function stringReverse(textString) {
	if (!textString) return '';
	var revString='';
	for (i = textString.length-1; i>=0; i--)
		revString+=textString.charAt(i)
	return revString;
}

//function creates "Welcome" message customized to time of day
function welcomeMsg() {
   var display = "";
   var todayDate = new Date();
   var timeIs = todayDate.getTime();
   todayDate.setTime(timeIs);
   var hourIs = todayDate.getHours();
   if (hourIs > 17) {
      display = "evening";
   }
   else if (hourIs >= 12) {
      display = "afternoon";
   }
   else {
      display = "morning";
   }
   document.write(display);
}

//function gets the month number to display correct graph
function getCMP() {
   var cmpgraph = "";	
   var cmpDate = new Date();
   var monthIs = cmpDate.getMonth() + 2;
   cmpgraph = "<img src='images/cmp" + monthIs + ".jpg' alt='Purple Pig' width='100' height='245' />";
   document.write(cmpgraph);
}
function getENF() {
   var enfgraph = "";	
   var enfDate = new Date();
   var monthIs = enfDate.getMonth() + 1;
   enfgraph = "<img src='images/cmp" + monthIs + ".jpg' alt='ENF' width='100' height='245' />";
   document.write(enfgraph);
}

//function creates random text
function text() {

number = 0;

// textArray
 
text[number++] = ""

// keep adding items here...

increment = Math.floor(Math.random() * number);   

document.write(text[increment]);
}; 

/*

   Function List:
   randomInteger()
      Used to reverse the order of characters in a text string

*/


function randomInteger(size) {
   return Math.floor((size+1)*Math.random()); 
}

function showImg() {
   imgNumber = randomInteger(9); // Return a random number from 0 to 9
   document.write("<img src='../images/validation/"+imgNumber+".jpg' alt='' />");
}

//function creates pop up window to display photos
function popWin(url) {
   picwin=window.open(url,"pop","width=660,height=500,scrollbar=yes,menubar=no,location=no,toolbar=no");
   testpop=(picwin==null || typeof(picwin)=="undefined") ? true: false;
   return testpop;
}

//function creates pop up window to display photos
function popWin600(url) {
   picwin=window.open(url,"pop","width=660,height=600,scrollbar=yes,menubar=no,location=no,toolbar=no");
   testpop=(picwin==null || typeof(picwin)=="undefined") ? true: false;
   return testpop;
}

function popWin700(url) {
   picwin=window.open(url,"pop","width=850,height=750,scrollbar=yes,menubar=no,location=no,toolbar=no");
   testpop=(picwin==null || typeof(picwin)=="undefined") ? true: false;
   return testpop;
}

//function creates pop up window to display photos
function popWin536(url) {
   picwin=window.open(url,"pop","width=536,height=665,scrollbar=yes,menubar=no,location=no,toolbar=no");
   testpop=(picwin==null || typeof(picwin)=="undefined") ? true: false;
   return testpop;
}

//function creates pop up window to display photos
function popWinMS(url) {
   picwin=window.open(url,"pop","width=445,height=464,scrollbar=yes,menubar=no,location=no,toolbar=no");
   testpop=(picwin==null || typeof(picwin)=="undefined") ? true: false;
   return testpop;
}

function popIns(image) {
	insWin=window.open("","","width=250,height=200,scrollbar=yes,menubar=no,location=no,toolbar=no,top=250,left=600,screenX=600,screenY=250");
	writeContent(insWin, image);
}

function popIns2(image) {
	insWin=window.open("","","width=250,height=200,scrollbar=yes,menubar=no,location=no,toolbar=no,top=250,left=600,screenX=600,screenY=250");
	writeContent2(insWin, image);
}

function writeContent(windowObj, image) {
	content="<html><head><title>To thwart spammers...</title>";
	content+="<link href='OrangeElks1475.css' rel='stylesheet' type='text/css' />";
	content+="</head><body><p><img src='/images/contacts/";
	content+=image+=".jpg' /></p>";
	content+="<p class='text3'>In an effort to thwart spammers, please manually type this address into the \"To:\" field in your email program. Thank you for your cooperation.";
	content+="<p><center><input type='button' value='OK' onclick='self.close()' /></center>";
	content+="</p></body></html>";
	windowObj.document.write(content);
	windowObj.document.close();
}

function writeContent2(windowObj, image) {
	content="<html><head><title>To thwart spammers...</title>";
	content+="<link href='OrangeElks1475.css' rel='stylesheet' type='text/css' />";
	content+="</head><body><p><img src='/images/contacts/";
	content+=image+=".gif' /></p>";
	content+="<p class='text3'>In an effort to thwart spammers, please manually type this address into the \"To:\" field in your email program. Thank you for your cooperation.";
	content+="<p><center><input type='button' value='OK' onclick='self.close()' /></center>";
	content+="</p></body></html>";
	windowObj.document.write(content);
	windowObj.document.close();
}

//function creates random text
function text() {

number = 0;
// textArray
text[number++] = "<img src='/images/random/lodge1965.jpg' hspace='5' align='left'>The Lodge building in 1965 when a furniture store occupied the ground level.<p><span id='linkthru'><a href='pop/lodge1965.html' onclick='return(popWin(\"pop/lodge1965.html\"))' target='_blank'><i>(enlarge photo)</i></a></span>"
text[number++] = "<img src='/images/random/paradefloat1970.jpg' hspace='5' align='left'>The May Day Parade in 1970 with an Elks float passing the First National Bank. The lodge building can be seen in the background on the right.<p><span id='linkthru'><a href='pop/paradefloat1970.html' onclick='return(popWin(\"pop/paradefloat1970.html\"))' target='_blank'><i>(enlarge photo)</i></a></span>"
text[number++] = "<img src='/images/random/08-PD-dogs.jpg' hspace='5' align='left'><b>Tuesday January 22, 2008 City Council meeting introducing Argo</b><br>(L to R) Trevor Cullen w/Argo, Mike Duff, JackieLynn Defries E.R., & Ryan Johnson w/Hondo<p><span id='linkthru'><a href='pop/08-PD-dogs.html' onclick='return(popWin(\"pop/08-PD-dogs.html\"))' target='_blank'><i>(enlarge photo)</i></a></span>"
text[number++] = "<img src='/images/random/0802-POW-MIA-flag-for-lodge.jpg' hspace='5' align='left'><b>POW*MIA flag presentation in February of 2008</b><br>(L to R) Veterans Co-Chairs Bernie & Pat Campbell with JackieLynn Defries, ER<p><span id='linkthru'><a href='/images/posts/0802-POW-MIA-flag-for-lodge.jpg' rel='fancybox' title='POW*MIA flag presentation in February of 2008 (L to R) Veterans Co-Chairs Bernie & Pat Campbell with JackieLynn Defries, ER'><i>(enlarge photo)</i></a></span>" 
text[number++] = "<img src='/images/events/XmasDinners07sm.jpg' hspace='5' align='left'>Packing Christmas dinners for local families in need.<p><span id='linkthru'><a href='pop/XmasDinners07.html' onclick='return(popWin(\"pop/XmasDinners07.html\"))' target='_blank'><i>(enlarge photo)</i></a></span>"
text[number++] = "<b>ATTENTION ALL LODGE MEMBERS:</b><p><i>If you haven't already, I highly encourage you to register for the Lodge Message Board.  By doing so, you gain access to more information on this site that you otherwise will not see.  It, also, gives you the opportunity to contact other members online and submit information to the site. If you have anything to share, you can post a topic on the message board, reply to other members topics, and add events to the board calendar. If you need any help in learning how to use the message board, I'd be happy to help you with it.  You might even catch me at the lodge with my laptop and I can show you anything you want to learn.<p>If you would like for me to register for you, please send me an email at <script type='text/javascript'>showEM('retsambew','gro.5741skle');</script> and I can handle it for you.<p>Fraternally Yours,<br>Doug Wells, Lodge Webmaster</i>"
text[number++] = "<img src='/images/EOY/1112DannyPaulsen.jpg' width='140' height='140' alt='Elk of the Year' hspace='5' align='left'><span class='intro'>Elk of the Year</span></p><p class='text1'>Danny Paulsen</p><p class='photocredit'>2010 - 2011</p>"
text[number++] = "<img src='/images/COY/1112SueSiegel.jpg' width='140' height='140' alt='Citizen of the Year' hspace='5' align='left'><span class='intro'>Citizen of the Year</span></p><p class='text1'>Sue Siegel</p><p class='photocredit'>2010 - 2011</p>"
text[number++] = "<img src='/images/OOY/1112BillNeessen.jpg' width='140' height='140' alt='Officer of the Year' hspace='5' align='left'><span class='intro'>Officer of the Year</span></p><p class='text1'>Bill Neessen</p><p class='photocredit'>2010 - 2011</p>"
text[number++] = "<p><b>The Elks Magazine</b></p><p>The Elks do such great and wonderful things. These articles are in each month’s national magazine. Why not donate your copy of the Elks Magazine to your doctor’s office, dentist office, barber shop, library, auto repair shop, etc? Just think of the great publicity we could get for our Lodges if our members recycle these books. Wouldn't you love to hear that your Lodge got a new member because he or she read about all the great things the Elks do while he or she was waiting?</p>"
text[number++] = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='352' height='278' id='Dictionary2' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='movie' value='Dictionary2.swf' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' /><embed src='Dictionary2.swf' quality='high' bgcolor='#ffffff' width='352' height='278' name='Dictionary2' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>"
text[number++] = "<center><a href='/cgi-bin/board/ikonboard.cgi?act=ST&f=9&t=104' target='_top' title='View this topic on the Lodge Message Board!'><img src='/images/posts/ElksStickerFlyer.gif' hspace='5' align='center' border='0'></a></center>"

text[number++] = "<embed src='http://c.brightcove.com/services/viewer/federated_f8/988218058' bgcolor='#ffffff' flashVars='videoId=29618404001&playerId=988218058&viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&' base='http://admin.brightcove.com' name='flashObj' width='486' height='412' seamlesstabbing='false' type='application/x-shockwave-flash' swLiveConnect='true' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></embed>"

text[number++] = "<center><img src='/images/11/11-12-ER&Lady.jpg' hspace='5' align='bottom'><br>Announcing Orange Elks ER for 2011-12<br>Oscar Garza and First Lady Amanda Smith</center>"
// keep adding items here...
// text[number++] = "<center><img src='/images/ThursMeals.gif' border='0'></center>"

increment = Math.floor(Math.random() * number);   

document.write(text[increment]);
}; 







 



 

