/***********************************************************************
JAVASCRIPT METHODS 
FOR 
TEXAS CHRISTIAN UNIVERSITY: SOCIETY OF PHYSICS STUDENTS
DESIGNED BY: ROBIN KINZER
***********************************************************************/
/*
This file was edited by Raymond E. Kinzer, Jr.
Updates:
23 October 2004 ,RK
29 October 2004
8  October 2006 ,MP
*/

/***********************************************************************

FUNCTION: startPage()
PURPOSE:
This begins designing the layout that is common to every page. 

DO NOT CHANGE UNLESS A MAJOR PAGE REVISION IS IN ORDER!!!!!

The menu is drawn by the showMenu() function.

The table is completed with the endPage() method.
***********************************************************************/

function startPage(title)
{
	//if the title parameter is not filled in, or if it has a null string	
	if((title == "")||(!title))
		title = "Society of Physics Students"
	
	//starts the page layout table
	document.write("<TABLE CELLSPACING='0' BORDER='0' BORDERCOLOR='949cce'>")

	document.write("<TR>")	//builds top row, with picture and titlecell
		//draw picture cell, w/the atomic frog
		document.write("<TD class='rightcorner'>")
		document.write("<a href='index.html' target='_top'>")
		document.write("<IMG SRC='pictures/atomicfrog_sps.jpg' ALT='SPS Atomic Horned Frog' border=0>")
		document.write("</a>")
		document.write("</TD>")
	
		//draws the cell with the header
		document.write("<TD class='titlecell'>")
			document.write("<SPAN class='bigTitle'>"+title+"</SPAN>")
			document.write("<BR>")
			document.write("<SPAN class='littleTitle'>Texas Christian University &nbsp;&nbsp;"+
						"--&nbsp;&nbsp; Fort Worth, Texas</SPAN>")
			document.write("</TD>")

	document.write("</TR>")

	document.write("<TR>")	//builds bottom portion, menu followed by display
		document.write("<TD colspan='2' class='menu'>")
		getMenu()
		document.write("</TD>")
	document.write("</TR>")

		document.write("<TD VALIGN='top' CLASS='page' colspan='2'><SPAN STYLE='line-height:12px'><BR></SPAN>")

}	//end startPage()






/***********************************************************************

FUNCTION: endpage()
PURPOSE:
This completes the table layout, closing it out.

***********************************************************************/

function endPage()
{
			//document.write("<BR>")	//adds clean space at bottom of column
		document.write("</TD>")	//end column
	document.write("</TR>")		//end the row with the info display

	document.write("<TR><TD COLSPAN='2' STYLE='text-align:center;'>")
	document.write("<SPAN STYLE='font-size:10px;'>Texas Christian University &nbsp; + &nbsp; ")
	document.write("<SPAN STYLE='font-size:10px;font-style:italic;'>Society of Physics Students")
	document.write("</SPAN> &nbsp; + &nbsp; Fort Worth, Tx 76129")
	document.write("</TD></TR>")

	document.write("</TABLE>")	//end the table for the table
}









/*******************************************************************************************************************
function getMail(name,dom,linktext,sub,hyper)
Author: Raymond E. Kinzer, Jr. eMail for help.

This little function will help for security of the eMail address that appear on the website. Though not necessarily 
full-proof (or foolproof?), it does offer an obstacle. This is to protect the eMail address from spiders on the web 
do crawl around source codes for webpages and copy down internet address for their huge banks of eMail addresses, for
spamming purposes. You don't have to use this code, but it's one less block in the road against spam. Usually, these
spiders cannot read scripting.

Here's a quick overview of how this works:

Using the function: Let's say we use the function, paste where you want to add it:
						<SCRIPT>getMail("","","","","")</SCRIPT>
	(Assuming the page defaults to JavaScript.) This will send an eMail to the default values.
	Change these as necessary. 

	DON'T DELETE ANY OF THE DOUBLE QUOTES!!!

	Let's assume that we are sending an eMail to the starhopper@tcu.edu .
	In our example, the function would be entered:
				<SCRIPT>getMail("starhopper","tcu","email","Cool site!","")</SCRIPT>	
	The first two parameters are self explanatory. The user will click the eMail address, and 
	the subject line of the eMail will be "Cool site!".

BE SURE THE DEFAULT VALUES AT THE BEGINNING OF THE FUNCTION ARE FILLED!!!

The names of the parameters above are as follows:

name =  the name of the person who is being eMailed
	In our example, the name parameter is assigned a value of "starhopper". If this is left blank "", or 
	"webmaster"	is entered, it goes to the webmaster by default.

dom = domain of the eMail address
	In our example, the domain is "tcu.edu". If This is left blank, or "", the default domain, domDefault, 
	will apply.

linktext = text that user sees when he 'clicks' on it
	You can enter text into the "". If you type "email" or "eMail", the text will be the eMail address of the 
	recipient. Type "emailw" for the text to show the "eMail" plus the eMail address.
	If you do not fill the "", a default text will appear, whatever is assigned to the variable 
	linkTextDefault.
	Note: You must have linkText filled, either when you call the function, or at the linkTextDefault 
	(it is wise to fill the latter).

sub = when the user's eMail appears, this text will appear in the subject line, when applicable
	The line that appears in the subject line when the user's eMail starts. You can enter this in as a parameter
	when you call getMail(), use the subDefault bye leaving the paramter in the function as "", or if you desire 
	no link text type "none" for the sub parameter when you call the function.

hyper = whether the text the user sees is a hyperlink
	This allow the text the user sees to appear as a hyper link that the user clicks on. It defaults to a hyper-
	link, as per the hyperDefault variable, when the value in the function is a blank "" or "true". If you don't 
	want the link to be a hyperlink, type "false" where you call the function.

BE SURE THE DEFAULT VALUES AT THE BEGINNING OF THE FUNCTION ARE FILLED!!!

!!!!DON'T DELETE QUOTATION MARKS FROM WHEN YOU CALL THE FUNCTION!!!!
*******************************************************************************************************************/

function getMail(name,dom,linktext,sub,hyper)
{	


	//set defaults for the following 5 values; don't change names of variables!!!

	webmaster = "m.p.dunleavy"			//webmaster account
	domDefault = "tcu.edu"				//default domain
	linkTextDefault = "email"			//default text to select link
	subDefault = "SPS Website"	//default subject line
	hyperDefault = "true"				//default "true" to make hyperlink;DO NOT CHANGE!



	//DO NOT TAMPER WITH BELOW CODES!!!

	//set the addressee, if needed
	if((name.length == 0)||(name == "webmaster"))
	{
		name=webmaster
	}


	//set the domain of the addressee; go to domDefault as necessary
	if(dom.length == 0)
	{
		dom = domDefault
	}else
		dom = dom

	//create the eMail address
	link = name + "&#64;" + dom


	//set a default subject line for eMail, this doesn't necessarily apply for all eMail services
	if(sub == "none")
	{
		sub = ""
	}else	
	if(sub.length == 0)
	{
		sub = subDefault
	}else
		sub = sub


	//set default linktext (text that user clicks on)
	if(linktext.length == 0)
	{
		linktext = linkTextDefault
	}
	if((linktext == "email")||(linktext == "eMail"))
	{
		linktext = link
	}
	if(linktext == "emailw")
	{
		linktext = "eMail "+link
	}else
	{
		linktext = linktext
	}

	
	//this will print the information into the webpage!!!
	if((hyper == "true")||(hyper.length == 0))
	{
		//The upper line includes a subject, the lower line deletes it.
		//The lower line works w/ Outlook Express & Mozilla Thuderbird!
//		document.write("<a href='mailto:"+link+"?subject="+sub+"'>"+linktext+"</a>")
		document.write("<a href='mailto:"+link+"'>"+linktext+"</a>")

	}else
	if(hyper == "false")
	{
		document.write(link)
	}
}  //END getMail()
