//this code is called by each content page to execut certain tasks 
//automatically, or to provide common functions.

//The following variables are constants for navigation 
//buttons that are called in this page as well as the content pages.  
//They can be changed here and affect all pages

solutionItem = new Array ("Archive Solutions", "Electronic Records", "Video Archiving", "E-mail", 
                   "Print Management", "Web Site", "Government")
damItem = new Array ("Asset Management", "Artesia DAM", "Digital Libraries")
serviceItem = new Array ("Support Services", "Records Planning", "Image Acquisition",  
                   "Data Conversion", "Custom Integration")
newsItem = new Array ("News", "Industry Coverage", "Press Releases", "Upcoming Events" )
partnerItem = new Array ("Partners", "Technology", "Integration", "Become a Partner")
companyItem = new Array ("Company Info", "About", "Management", "Board")
videoItem = new Array ("Video Services", "Video Preservation", "Presentation at AMIA 2008 Conference")

//this code is called by navigation page to handle menus
//The first function hides all the menus

 		function hideMenu(hideElem) {	
			menuObj = document.getElementById(hideElem).style 
			menuObj.visibility = "hidden"  
		}
		
//Hide all menus, called when leaving menus and pages
		function hideAll() {	
			hideMenu('companyMenu')
			hideMenu('servicesMenu')
			hideMenu('damMenu')
			hideMenu('solutionsMenu')
			hideMenu('newsMenu')
			hideMenu('partnerMenu')
			hideMenu('videoMenu')
		}

//Show a specific menu, after first closing all other menus		
		function showMenu(showElem) {	
			hideAll()
			menuObj = document.getElementById(showElem).style 
			menuObj.visibility = "visible" 
		}

//This code is called to load new content into the main page frame
//		
		function setContent(thisPage) {
			parent.docFrame.document.location.href = thisPage
		}

//This code grabs the source cookie for managing email contacts


cookie_name = "linkSource";

var src_link;

if(document.cookie)
{
index = document.cookie.indexOf(cookie_name);
if (index != -1)
{
namestart = (document.cookie.indexOf("=", index) + 1);
nameend = document.cookie.indexOf(";", index);
if (nameend == -1) {nameend = document.cookie.length;}
src_link = document.cookie.substring(namestart, nameend);
}
}

 if (src_link != "g" && src_link != "y") {
 	src_link = "";
 }	

var sal = new Array('rtress','@imagefo','sales','.com','mailto:','<a href=');
var inv = new Array('ailto:','<a href=m','rtress','@imagefo','kress','.com','bob.po');


// The following function launches a new Window called "name"
// It is used for links which are "leaving" our site.  The user can return
// to the IF site by closing this window.

	function newWin(otherLink, nameWindow) {
		otherWindow = window.open( otherLink , nameWindow, 
			"width=500,height=400,scrollbars=yes,toolbar=yes,location=yes,resizable=yes,menubar=yes")
	}
	
	// writeDate is used to put today's date in the top navigation area
	// This script and many more are available free online at -->
 // The JavaScript Source!! http://javascript.internet.com -->
	
	function writeDate() {
					d = new Array(
					"Sunday",
					"Monday",
					"Tuesday",
					"Wednesday",
					"Thursday",
					"Friday",
					"Saturday"
					);
					m = new Array(
					"January",
					"February",
					"March",
					"April",
					"May",
					"June",
					"July",
					"August",
					"September",
					"October",
					"November",
					"December"
					);
					today = new Date();
					day = today.getDate();
					year = today.getYear();
         	if (year < 2000)
					  year=year+1900;
					
					document.write(m[today.getMonth()]+" ");
					document.write(day+", "+year);
					}
					
//Set the source cookie
var loc=document.location.toString();

if (loc) {
 	var spos=loc.indexOf('src=');
 	if (spos>0) {
   		lnk_src = loc.substring(spos+4,spos+5);
 	}
 	else {
		lnk_src = "n";
 	}		
	if(document.cookie != document.cookie){
		index = document.cookie.indexOf(cookie_name);
	}
	else { 
		index = -1;
	}
	if (index == -1) {
 		document.cookie=cookie_name+"="+lnk_src+"; expires=Monday, 04-Apr-2010 05:00:00 GMT";
	}
}
