//-----------------------------------------------------------------------------
// Set initial page variables, etc.

// base font size for articles, etc
base_font_size = 11;
cookie_expire_date = new Date();
cookie_expire_date.setDate(cookie_expire_date.getDate() + 365);


//-----------------------------------------------------------------------------
// set the intial article font size
function setInitialFontSize()
{
	// get the font size preference from the users cookie, if it exists
	if (getCookie("ima_fontsize") != null)
	{
		if(document.getElementById("content_font_size_control"))
		{
			base_font_size = parseInt(getCookie("ima_fontsize"));
			document.getElementById("content_font_size_control").style.fontSize = base_font_size + "px";
		}
	}
}


//-----------------------------------------------------------------------------
// function to reduce the font size of the article content space
function reduceFont()
{
	base_font_size -= 2;
	document.getElementById("content_font_size_control").style.fontSize = base_font_size + "px";
	setCookie("ima_fontsize", base_font_size, cookie_expire_date);
}


//-----------------------------------------------------------------------------
// function to increase the font size of the article content space
function increaseFont()
{
	base_font_size += 2;
	document.getElementById("content_font_size_control").style.fontSize = base_font_size + "px";
	setCookie("ima_fontsize", base_font_size, cookie_expire_date);
}


//-----------------------------------------------------------------------------
// bring up Email to a Friend window for articles
function emailWindow()
{
	window.open("send_to_friend.asp", "send_to_a_friend","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=420,height=300");
}


//-----------------------------------------------------------------------------
// bing up the article ranking window
function rankArticle(rank)
{

}


//-----------------------------------------------------------------------------
// function to control previous and next buttons on search results page
function goSearch(direction)
{
	form = document.search_footer;
	form.search_action.value = direction;
	form.submit();
}


//-----------------------------------------------------------------------------
// used to view the excerpts for suggested readings
function viewExcerpt(filename, xml_doc,secured)
{
	window.open("view_excerpt.asp?xml_doc=" + escape(xml_doc) + "&filename=" + filename + "&secured=" + secured ,"view_excerpt","toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no,width=420,height=400");
}