//******************************************************************************
//******************************************************************************
//
// 	Copyright (C) 2002-2005 Pacific Life Research Center.  All rights reserved.
//
// 		File global.js contains functions and variables for global
//  	content found on the PLRC web site including:
//			-- global variables
//			-- top header (plrc image/text, blue line)
//			-- top and bottom global navigation links
//			-- bottom copyright, reproduction, and credit text
//			-- double black lines
//			-- email address encoding
//				
//
//******************************************************************************
//******************************************************************************


// ----------------
// GLOBAL VARIABLES
// ----------------
var papers_intro_text = "The following papers<small>*</small> are provided by PLRC. Papers available on this web site are current only up to the listed date of release or revision.  Please direct any feedback to ";
var DadAddy = "&#99;&#112;&#99;";
var WDAddy = "&#120;&#102;&#099;&#101;&#102;&#116;&#106;&#104;&#111;&#102;&#115;";
var SiteAddy = "&#110;&#106;&#112;&#097;&#044;&#109;&#112;&#101;";

// -------------
// GLOBAL HEADER
// -------------
function global_header()
	{
		var plrc_image = "<a href='index.html'><img src='images/PLRC.gif' border='0' width='170' height='46' alt='PLEASE CLICK HERE IF NO IMAGE DISPLAYED'></a><span class='header2'>.org</span>";
		var plrc_text = "<span class='header1'>&nbsp;Pacific Life Research Center</span>";
				// 170 x 46
		document.write(plrc_image+plrc_text);
		return true;
	}
	
function global_blue_line()
	{
		var blue_line = "<img src='images/blue_line.gif' width='590' height='20' alt='' border='0'>";		
				// 590 x 20
		document.write(blue_line);
		return true;		
	}
	
	
		
// -----------------
// GLOBAL NAVIGATION
// -----------------
function global_nav()
	{
		var index = "<a href='index.html'>Home</a>&nbsp;&nbsp;";
		var papers = "<a href='index_papers.html'>PLRC Papers</a>&nbsp;&nbsp;";
		var blog = "<a href='http://blog.plrc.org'>PLRC Blog</a>&nbsp;&nbsp;";
		var history = "<a href='history.html'>PLRC History</a>&nbsp;&nbsp;";
		var contacts = "<a href='contacts.html'>Contact Us</a>&nbsp;&nbsp;";
		var links = "<a href='links.html'>Links</a>";
		
		document.write(index+papers+blog+history+contacts+links);
		
		return true;		
	}
	


// ----------------
// GLOBAL COPYRIGHT
// ----------------
function global_copyright()
	{
		var copyright_text = "Copyright &copy;2002-2009 Pacific Life Research Center<br>";
		var reproduction_text = "PLRC papers may be reproduced and distributed for nonprofit purposes only.<br>";
		var credit_text = "Please credit Pacific Life Research Center as the source.<br>";
		
		document.write(copyright_text+reproduction_text+credit_text);		
		return true;
	}


// ------------------
// GLOBAL BLACK LINES
// ------------------
function global_black_lines()
	{
		var black_lines = "<img src='images/double_black_lines.gif' width='85%' height='10'>";
		
		document.write(black_lines);
		return true;
	}


// ----------------------
// EMAIL ADDRESS ENCODING
// ----------------------
function email_encode(prefix,suffix,subject,body)
	{
		var x;
		var y;
		var alias = "";
		var domain = "";
		var length;
		
		var SplitPre = prefix.split(";");
		length = SplitPre.length;
		for (i=0; i<length-1; i++)
			{
				x = SplitPre[i].substring(2,5);
				x = x * 1;
				x = "&#" + (x - 1) + ";";
				alias += x;
			}
		
		var SplitSuf = suffix.split(";");
		length = SplitSuf.length;
		for (j=0; j<length-1; j++)
			{
				y = SplitSuf[j].substring(2,5);
				y = y * 1;
				y = "&#" + (y + 2) + ";";
				domain += y;
			}

		var topic;
		var message;
		if (subject == null || subject == "")
		{topic = " ";}
		else
		{topic = subject;}		
		if (body != null)
		{message = body;}
		else
		{message = " ";}
		document.write("<a href=mailto:"+alias+"&#64;"+domain+"?subject="+topic+"&body="+message+">"+alias+"&#64;"+domain+"</a>");
		return true;	
	}		
