<!--
var origbkcolor
var origtextcolor
var oldborder
///////////////////////////////////////////////
function BorderAction(inObj,inVal)
{
oldborder=inObj.style.border
switch (inVal)
	{
	case 0:
	inObj.style.border="inset white 2px"
	break
	
	case 1:
	inObj.style.border=oldborder
	break
	}
}
///////////////////////////////////////////////
function ButtonAction(inObj,inVal)
{
switch (inVal)
	{
	case 0 : //recolor and elevate
	try
		{
		//stash orig color
		origbkcolor=inObj.style.backgroundColor
		origtextcolor=inObj.style.color
	
		//pick up new colors
		var newbkcolor=document.getElementById("onmousebkcolor").value
		var newtextcolor=document.getElementById("onmousetextcolor").value
	
		//apply
		inObj.style.backgroundColor=newbkcolor
		inObj.style.color=newtextcolor
		inObj.style.cursor="pointer"
			
		//status
		window.status="Navigate to "+inObj.title
		break
		}
	catch(e){break}	
	
	case 1 : //put back
	try
		{
		inObj.style.backgroundColor=origbkcolor
		inObj.style.color=origtextcolor
		inObj.style.cursor="default"
		window.status=""
		break
		}
	catch(e){break}	
	}
}

/////////////////////////////////////////////
function Navigate(inUrl,inLang)
{
//cancel all other module navigations if flash is showing
try
	{
	if (document.getElementById("flasher").style.display=="block" && inUrl!="show_flash")
		{
		document.getElementById("tbl_1").focus()
		return false
		}
	}
catch(e){}
	
//stash url in all cases
if(inUrl!="show_flash")
	{
	document.getElementById("url_cache").value=inUrl
	}

//is there a flash file - if so show it
var flashpage=document.getElementById("flash_page").value
if(flashpage)
	{
	var flashcookie=GetCookie("flashmsg")
	
	/* for debugging only
	alert("page="+flashpage+ " cookie="+flashcookie)
	*/
	
	if (flashpage!=flashcookie)
		{
		var fdiv=document.getElementById("flasher")
		fdiv.style.display="block"
		fdiv_left=(document.body.clientWidth-700)/2
		fdiv.style.left=fdiv_left
		
		//set flash page to empty
		document.getElementById("flash_page").value=""
		
		//if there is an error then don't set cookie
		//this tests for the error para object with id=flash_error
		try {var errobj=document.getElementById("flash_error")}
		catch(e){}	
		
		//if errobj is missing then set the cookie
		if (!errobj && document.getElementById("flash_debug").value!="y")	
			{
			SetPermanentCookie("flashmsg",flashpage)
			}
		return
		}
	else
		{	
		document.getElementById("flash_page").value=""
		}
	}
	
//get orig url and navigate
var outUrl=document.getElementById("url_cache").value

if (outUrl.indexOf("http://")!=-1)
	{
	//handle default setup case
	if (outUrl.indexOf("eprep_no_nav")==-1)
		{
		window.open(outUrl)
		}
	else
		{
		alert("This is a default sample link. Replace with appropriate applicaton link files for English and/or French in working version.\n\nThe XML link files are automatically generated when the application is built and will always contain the most current module ID codes.\n\nThese link files are located in the client shared/home folder and are named in the form of 'links_apppath.xml'")
		return false
		}	
	}
else
	{	
	document.location.href=outUrl
	}
}

////////////////////////////////////////////
function Loader(inBrowserWidth,inBrowserHeight)
{
//set page title
document.title=document.getElementById("page_title").value

/// ADJUST FOR SMALL MONITOR (MIN 1028)///
if (window.screen.width<1024)
	{
	var msg="ePrep applications are designed for best viewing at 1024x768 or better. The application is however viewable at 800x600 but this may require additional scrolling."
	msg+="\n\nLes applications ePrep sont conçues pour travailler en résolution 1024x768 ou plus élevée. Cependant, il est possible de les visionner en résolution 800x600 mais vous devrez utiliser les flèches de défilement plus souvent."
	alert(msg)
	}
	
if (window.screen.width<1200)
	{
	//resize header table
	var title_table=document.getElementById("title_table")
	title_table.style.width="956px"
	title_table.style.marginTop="10px"
	
	//main title cell font size and position
	var main_title=document.getElementById("main_title")
	main_title.style.fontSize="16pt"
	
	//resize link table width
	var link_table=document.getElementById("links_table")
	link_table.style.width="956px"
	
	//links must be respaced before cell can be resized
	//first shorten title bottom margin
	var link_hdrs=document.getElementsByName("module_title")
	for (var t=0;t<link_hdrs.length;t++)
		{
		link_hdrs[t].style.marginBottom="10px"
		}
	//next change link spacing
	var links=document.getElementsByName("linker")
	var numLinks=parseInt(links.length)
	if (numLinks<4){var maxSpace=100}
	else {var maxSpace=300}
	var availSpace=parseInt(maxSpace-(numLinks*27)) //each link is 27 px high
	
	if (availSpace<0){availSpace=100}
	var spacingPx=parseInt(availSpace/numLinks)
	for (var i=0;i<links.length;i++)
		{
		//fix bottom margin
		try{links[i].style.marginBottom=spacingPx+"px"}
		catch(e){links[i].style.marginBottom="20px"}
		
		//fix font size
		try
			{
			var fsize=parseInt(links[i].style.fontSize)
			if (fsize>8){links[i].style.fontSize="8pt"}
			}
		catch(e){}	
		}
				
	//max height of central image
	var central_cell=document.getElementById("central_image")
	//central_cell.style.height="300px"
	central_cell.style.height="auto"
		
	//max height of link cells
	divs=document.getElementsByName("links_div")
	for (var k=0;k<divs.length;k++)
		{
		//divs[k].style.height="300px"
		divs[k].style.height="auto"
		}
	//change font size in central image title areas
	var en_title=document.getElementById("titlediv_1")
	if (en_title){en_title.style.fontSize="10pt";en_title.style.top="0px"}
	var fr_title=document.getElementById("titlediv_2")
	if (fr_title){fr_title.style.fontSize="10pt";fr_title.style.top="0px"}
	
	//resize and position browser
	try{
		window.moveTo(0,0)
		var realWidth=window.screen.width
		var realHeight=window.screen.height
		window.resizeTo(realWidth,realHeight)
		}
	catch(e){}	
	}
else
	//resize browser
	try{
		//validate browser dimensions
		inBrowserWidth=parseInt(inBrowserWidth)
		if (isNaN(inBrowserWidth)){inBrowserWidth=1400}
		
		inBrowserHeight=parseInt(inBrowserHeight)
		if (isNaN(inBrowserHeight)){inBrowserHeight=1050}
		
		//now resize the home page
		//alert(inBrowserWidth+","+inBrowserHeight)
		//window.resizeTo(inBrowserWidth,inBrowserHeight)
				
		if (document.all)
			{
			var wTop=(window.screen.availHeight-inBrowserHeight)/2
			var wLeft=(window.screen.availWidth-inBrowserWidth)/2
			}
		else
			{
			var wTop=(window.screen.height-inBrowserHeight)/2
			var wLeft=(window.screen.width-inBrowserWidth)/2
			}	
		//note:resize must occur after move - seems to be an IE bug
		window.moveTo(wLeft,wTop)
		window.resizeTo(inBrowserWidth,inBrowserHeight)
		}
	catch(e){}
}	

function ResizeTables()
{
try{document.getElementById("title_table").style.width=document.getElementById("links_table").scrollWidth+2}
catch(e){return}
}

//--------------------------------------------
//cookie management functions only
//--------------------------------------------
function GetCookie(name)
{
var result=null;
var myCookie=" "+document.cookie+";";
var searchName=" "+name+"=";
var startOfCookie=myCookie.indexOf(searchName)
var endOfCookie;
if (startOfCookie!=-1)
	{
	startOfCookie+=searchName.length;
	endOfCookie=myCookie.indexOf(";",startOfCookie);
	result=unescape(myCookie.substring(startOfCookie,endOfCookie));
	}
return result;
}

//--------------------------------------------
function SetPermanentCookie(name,value)
{
var expires=new Date("30 Dec 2020")
expires=expires.toGMTString()
document.cookie=name+"="+escape(value)+";expires="+expires+";path=/"
}

//--------------------------------------------
function SetCookie(name,value)
{
document.cookie=name+"="+escape(value)+";path=/";
}
//--------------------------------------------
function ClearCookie(name)
{
var ThreeDays=3*24*60*60*1000;
var expDate=new Date();
expDate.setTime(expDate.getTime()-ThreeDays)
document.cookie=name+"=exit;Expires="+expDate.toGMTString();
}
//----------------------------------------
//new binary cookie functions
//----------------------------------------
function InitBinaryCookie(inName,inLength,isPermanent)
{
//param tests
if (!inName || inName.length==0){alert("Developer Error : No Cookie name provided.");return false}
if (!inLength || inLength.length==0){alert("Developer Error : No length value specified");return false}
if(typeof(isPermanent)!="boolean"){alert("Developer Error : Last parmeter must be boolean true or false")}

var len=parseInt(inLength)
if (isNaN(len)){alert("Developer Error : Length value must be a positive integer of 1 or greater.");return false}
if (len==0){alert("Developer Error : Length value must be a positive integer of 1 or greater.");return false}

//check if cookie exists
var oldbincookie=GetCookie(inName)
if(oldbincookie==null || oldbincookie.length==0)
	{
	//build binary cookie
	var bincookie=new String("0")
	for (var i=0;i<len-1;i++)
		{
		bincookie+="0"
		}
	if (isPermanent){SetPermanentCookie(inName,bincookie);return true}
	else
		{
		ClearCookie(inName)
		SetCookie(inName,bincookie);return true
		}
	}
else
	{return false}		
}

-->