<!-- this comment hides script from script-blind browsers
/****************************************************************************
File Name:
	fontpicker.js

Description:
	Scripts needed for changing fonts in the Web Site Theme Creator

Created by Christian Web Programming

Copyright &copy; 2009-2010 by James E. Pettis

July 17, 2010
*****************************************************************************/


/****************************************************************************
function getFontString(FontCode)

Description:
	Returns a CSS font string corresponding to the FontCode.

Arguments:
	FontCode		string variable contains code corresponding to a particular font

Returns:
	CSS font-family string
*****************************************************************************/
function getFontString(FontCode)
	{
	var strFontString;	// CSS font-family string

	switch (FontCode)
		{
		case "AM":
			strFontString = "'andale mono', 'monotype.com', sans-serif";
			break;
		case "A":
			strFontString = "'arial', 'helvetica', 'arial mt', 'arial unicode ms', 'nimbus sans l', 'univers', sans-serif";
			break;
		case "AB":
			strFontString = "'arial black', 'gadget', sans-serif";
			break;
		case "AN":
			strFontString = "'arial narrow', 'helvetica condensed', 'univers condensed', sans-serif";
			break;
		case "CS":
			strFontString = "'comic sans ms', sans-serif";
			break;
		case "I":
			strFontString = "'impact', 'charcoal', sans-serif";
			break;
		case "L":
			strFontString = "'lucida sans unicode', 'lucida grande', sans-serif";
			break;
		case "T":
			strFontString = "'tahoma', 'geneva', sans-serif";
			break;
		case "TM":
			strFontString = "'trebuchet ms', 'helvetica', sans-serif";
			break;
		case "V":
			strFontString = "'verdana', 'geneva', sans-serif";
			break;
		case "CN":
			strFontString = "'courier new', 'courier', monospace";
			break;
		case "G":
			strFontString = "'georgia', 'new century schoolbook', 'nimbus roman no9 l', serif";
			break;
		case "TR":
			strFontString = "'times new roman', 'times', serif";
		}	// end switch

	return strFontString;
	}	// end function getFontString(FontCode)


/****************************************************************************
function getFontName(FontCode)

Description:
	Returns a text font name corresponding to the FontCode.

Arguments:
	FontCode		string variable contains code corresponding to a particular font

Returns:
	font name string
*****************************************************************************/
function getFontName(FontCode)
	{
	var strFontName;	// font name string

	switch (FontCode)
		{
		case "AM":
			strFontName = "Andale Mono";
			break;
		case "A":
			strFontName = "Arial";
			break;
		case "AB":
			strFontName = "Arial Black";
			break;
		case "AN":
			strFontName = "Arial Narrow";
			break;
		case "CS":
			strFontName = "Comic Sans MS";
			break;
		case "I":
			strFontName = "Impact";
			break;
		case "L":
			strFontName = "Lucida";
			break;
		case "T":
			strFontName = "Tahoma";
			break;
		case "TM":
			strFontName = "Trebuchet MS";
			break;
		case "V":
			strFontName = "Verdana";
			break;
		case "CN":
			strFontName = "Courier New";
			break;
		case "G":
			strFontName = "Georgia";
			break;
		case "TR":
			strFontName = "Times New Roman";
		}	// end switch

	return strFontName;
	}	// end function getFontName(FontCode)


/****************************************************************************
function changeInvHlFont(FontCode)

Description:
	Changes the Inverse Highlight font in the "Theme Sample"s of the Web Site
	Theme Creator

Arguments:
	FontCode		string variable contains code corresponding to a particular font

Returns:
	none
*****************************************************************************/
function changeInvHlFont(FontCode)
	{
	var strFontString = getFontString(FontCode);
	var strFontName = getFontName(FontCode);
	var fieldDDField = document.getElementById("InvHlFontField");

	fieldDDField.value = strFontName;
	fieldDDField.style.fontFamily = strFontString;
	document.getElementById("aTSIH").style.fontFamily = strFontString;
	document.getElementById("bTSIH").style.fontFamily = strFontString;
	document.getElementById("InvHlFontList").style.visibility="hidden";
	}	// end function changeInvHlFont(FontCode)


/****************************************************************************
function changeHlFont(FontCode)

Description:
	Changes the Highlight font in the "Theme Sample"s of the Web Site Theme
	Creator

Arguments:
	FontCode		string variable contains code corresponding to a particular font

Returns:
	none
*****************************************************************************/
function changeHlFont(FontCode)
	{
	var strFontString = getFontString(FontCode);
	var strFontName = getFontName(FontCode);
	var fieldDDField = document.getElementById("HlFontField");

	fieldDDField.value = strFontName;
	fieldDDField.style.fontFamily = strFontString;
	document.getElementById("aTSDBH").style.fontFamily = strFontString;
	document.getElementById("bTSDBH").style.fontFamily = strFontString;
	document.getElementById("HlFontList").style.visibility="hidden";
	}	// end function changeHlFont(FontCode)


/****************************************************************************
function changeDefFont(FontCode)

Description:
	Changes the Default font in the "Theme Sample"s of the Web Site Theme
	Creator

Arguments:
	FontCode		string variable contains code corresponding to a particular font

Returns:
	none
*****************************************************************************/
function changeDefFont(FontCode)
	{
	var strFontString = getFontString(FontCode);
	var strFontName = getFontName(FontCode);
	var fieldDDField = document.getElementById("DefFontField");

	fieldDDField.value = strFontName;
	fieldDDField.style.fontFamily = strFontString;
	document.getElementById("aTSDBS").style.fontFamily = strFontString;
	document.getElementById("aTSDT").style.fontFamily = strFontString;
	document.getElementById("bTSDBS").style.fontFamily = strFontString;
	document.getElementById("bTSDT").style.fontFamily = strFontString;
	document.getElementById("DefFontList").style.visibility="hidden";
	}	// end function changeDefFont(FontCode)


function toggleVisibility(strElementID)
	{
	var elementVar = document.getElementById(strElementID);

	if (elementVar.style.visibility === "visible")
			elementVar.style.visibility = "hidden";
		else
			elementVar.style.visibility = "visible";
		// end if
	}	// end function toggleC

// this comment closes the script-hiding comment -->
