// JavaScript Document
// General use javascript routines
// Various functions by Macromedia, EOSG, Lawrence Streng
//

//----------------------------------------------------------------------------
//----------------------------------------------------------------------------

// PDF Viewer
// Opens new window with the pdf in it.
function viewPdf(objectName)
{	theURL = '../media/pdf/' + objectName + '.pdf';
	newWindow = window.open(theURL, 'objectview', 'directories=0,height=600,location=0,resizable=1,scrollbars=1,toolbar=0,width=800,left=25,top=25,screenX=25,screenY=25');
	newWindow.focus();
};

// EMail Link
// Constructs email - helps prevent spam of email.
function mailLink(objectLink, objectPart1, objectPart2)
{	var mailLink = objectLink;
	var part1 = objectPart1;
	var part2 = objectPart2;
	var part3 = "eosg";
	var part4 = "com"
	return ("<a href=" + "m" + "a" + "i" + "l" + "t" + "o" + ":" + part1 + part2 + "&#64;" + part3 + "." + part4 + ">"+ mailLink + "</a>");
};

// Breadcrumb
// Not so good breadcrumb functions
function breadcrumb1(crumb1, link1)
{	return ("<a href=" + link1 + ">"+ crumb1 + "</a>");
};
function breadcrumb2(crumb1, link1, crumb2, link2)
{	return ("<p>" + "<a href=../index.htm>Home</a>" + " / " + crumb2 + "<hr class='rule'></p>");
};			
function breadcrumb3(crumb1, link1, crumb2, link2, crumb3, link3)
{	return ("<p>" + "<a href=../index.htm>Home</a>" + " / " + "<a href=" + link2 + ">"+ crumb2 + "</a>" + " / " + crumb3 + "<hr class='rule'></p>");
};
function breadcrumb4(crumb1, link1, crumb2, link2, crumb3, link3, crumb4, link4)
{	return ("<p>" + "<a href=../index.htm>Home</a>" + " / " + "<a href=" + link2 + ">"+ crumb2 + "</a>" + " / " + "<a href=" + link3 + ">"+ crumb3 + "</a>" + " / " + crumb4 + "<hr class='rule'></p>");
};

// Menujump
// Used in drop down navigation
function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
};

// Photo swap
// Cool way to change photos on the page.
function PhotoSwap (nextphoto, nextalt)
{	document.photo.src = nextphoto;
	document.photo.alt = nextalt;
};
// Image Swap
function swapImage(i){
	switch(i){	
		case 1:
			document.getElementById('photo').src=img1.src;
			document.getElementById('photo').alt=img1.alt;
			document.getElementById('photoCaption').innerHTML=img1.alt;
			break
		case 2:
			document.getElementById('photo').src=img2.src;
			document.getElementById('photo').alt=img2.alt;
			document.getElementById('photoCaption').innerHTML=img2.alt;
			break
		case 3:
			document.getElementById('photo').src=img3.src;
			document.getElementById('photo').alt=img3.alt;
			document.getElementById('photoCaption').innerHTML=img3.alt;
			break
		case 4:
			document.getElementById('photo').src=img4.src;
			document.getElementById('photo').alt=img4.alt;
			document.getElementById('photoCaption').innerHTML=img4.alt;
			break
		case 5:
			document.getElementById('photo').src=img5.src;
			document.getElementById('photo').alt=img5.alt;
			document.getElementById('photoCaption').innerHTML=img5.alt;
			break
		case 6:
			document.getElementById('photo').src=img6.src;
			document.getElementById('photo').alt=img6.alt;
			document.getElementById('photoCaption').innerHTML=img6.alt;
			break
		case 7:
			document.getElementById('photo').src=img7.src;
			document.getElementById('photo').alt=img7.alt;
			document.getElementById('photoCaption').innerHTML=img7.alt;
			break
		default:
			document.getElementById('photo').src=img1.src;
			document.getElementById('photo').alt=img1.alt;
			document.getElementById('photoCaption').innerHTML=img1.alt;
	};
}

//----------------------------------------------------------------------------
//----------------------------------------------------------------------------

//--------------- LOCALIZEABLE GLOBALS ---------------
var d=new Date();
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
//---------------   END LOCALIZEABLE   ---------------

//----------------------------------------------------------------------------
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
// This script is a work around for the double click problem with flash in IE
// Paste flash object between the single quotes to display in html page
// This is the call in the html for the flash object <script language="JavaScript"> showSWF_(); ((end with closing script))
// It is best to test the flash object in the html page with the double click problem then move here when finished.

// Flash for the sidebar - sidebar1f.swf

function showFlash_FlashySidebar(flashFile) 
{	var flashyName = flashFile;
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="246" height="220" title="EOSG"><param name="movie" value="../media/flash/sidebar1f2.swf" /><param name="quality" value="high" /><embed src="../media/flash/sidebar1f2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="246" height="220"></embed></object>');
};

// Flashpaper for directions - eosg_direct.swf

function showFlash_eosg_direct() 
{	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="460" height="400" title="Directions"><param name="movie" value="../media/flashpaper/Eosg_directPinOak1.swf" /><param name="quality" value="high" /><embed src="../media/flashpaper/Eosg_directPinOak1.swf" width="460" height="400" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>');
}

// Flashpaper for directions - ppt-eosg_important.swf

function showFlash_eosg_important() 
{	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="470" height="382" title="Important"><param name="movie" value="../media/flashpaper/ppt-eosg_important_v2.swf" /><param name="quality" value="high" /><embed src="../media/flashpaper/ppt-eosg_important_v2.swf" width="470" height="382" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>');
}

function showFlash_Sidebar()
{	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="246" height="220"><param name="movie" value="../media/flash/sidebar1f2.swf" /><param name="quality" value="high" /><embed src="../media/flash/sidebar1f2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="246" height="220"></embed></object>');
};

function showFlash(vSRC, vWidth, vHeight, vTitle)
{	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+vWidth+"' height='"+vHeight+"' title='"+vTitle+"'><param name='movie' value='../media/flash/"+vSRC+".swf' /><param name='quality' value='high' /><embed src='../media/flash/"+vSRC+".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+vWidth+"' height='"+vHeight+"'></embed></object>");
};
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------


function showiFrame(vID, vSRC, vWidth, vHeight)
{	document.write("<iframe id='"+vID+"' src='../iframes/"+vSRC+".htm' width='"+vWidth+"' height='"+vHeight+"' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='no'></iframe>");
};

function showiFrameC(vID, vSRC, vWidth, vHeight)
{	document.write("<iframe id='"+vID+"' src='../iframes/"+vSRC+".cfm' width='"+vWidth+"' height='"+vHeight+"' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='no'></iframe>");
};

function showiFrameW(vID, vSRC, vWidth)
{	document.write("<iframe id='"+vID+"' src='../iframes/"+vSRC+"' width='"+vWidth+"' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='no'></iframe>");
};

function showiFrameAuto(vID, vSRC, vWidth)
{	document.write("<iframe id='"+vID+"' onLoad='calcHeight()' src='../iframes/"+vSRC+"' width='"+vWidth+"' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='no'></iframe>");
};
