<script language="javascript" type="text/javascript" src="%%GLOBAL_pathToKB%%/javascript/iselector.js"></script>
<style>
	@import url(%%GLOBAL_pathToKB%%/javascript/iselector.css);

	.bSpacing {
		margin-bottom: 6px;
	}

	.ISSFormat {
		width: 260px;
		height: 180px;
	}
</style>

<table class="LeftFrame" width="95%">
<tr>
	<td valign="top" style="padding:10pt">
		<div class="tab-pane" id="tab-pane-1">

			<div class="tab-page" id="tab-page-1">
				<h2 class="tab">%%LNG_hpContent%%</h2>

				<div id="contentDiv" class="%%GLOBAL_BrowserId%%CategoryPanel"></div>
			</div>

			<div class="tab-page" id="tab-page-2">
				<h2 class="tab">%%LNG_hpSearch%%</h2>

				<div id="searchDiv" class="%%GLOBAL_BrowserId%%SearchPanel">
					<form method="post" action="%%GLOBAL_FormAction%%" target="rightFrame" onsubmit="return SubmitSearch();" id="frmSearch">
					<table width="100%">
					<tr>
						<td class="text">
						%%LNG_searchIntro%%
						</td>
					</tr>
					<tr>
						<td>
						<input type="text" id="livesearch" name="Query" style="font: normal 11px Tahoma, sans-serif; width:93%;" onKeypress="liveSearchStart()" onblur="setTimeout('closeResults()',2000);" >
						<div id="LSResult" style="display: none;"><div id="LSShadow"></div></div><br>
						</td>
					</tr>
					<tr>
						<td class="SearchFieldLabel">%%LNG_searchCategoriesLabel%%</td>
					</tr>
					<tr>
						<td>
							<select name="Categories[]" id="Categories" style="font: normal 11px Tahoma, sans-serif; width:93%;" multiple size="5">
								<option value="0" SELECTED>%%LNG_searchAllCategories%%</option>
								%%GLOBAL_SearchCategoryOptions%%
							</select>
						</td>
					</tr>
					<tr>
						<td class="SearchFieldLabel">%%LNG_rated%%</td>
					</tr>
					<tr>
						<td class="Content" style="padding:0px;">
							<input type="hidden" name="ratedOp" value=">=">
							<select name="rated" style="font: normal 11px Tahoma, sans-serif; width:93%;">
								%%GLOBAL_ratedOptions%%
							</select>
						</td>
					</tr>
					%%Panel.SearchCustomFields%%
					<tr>
						<td>
						<input type="submit" value="%%LNG_searchStartSearch%%" class="Text SearchButton"> <input onClick="Clear()" type="button" value="%%LNG_searchClear%%" class="Text SearchButton">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>

			<div class="tab-page" id="tab-page-3">
				<h2 class="tab">%%LNG_hpFavorites%%</h2>

				<div id="favoritesDiv" class="%%GLOBAL_BrowserId%%FavoritesPanel">

					<script type="text/javascript" language="javascript">
						webFXTreeConfig.rootIcon		= '%%Config.ImagePath%%/foldericon.png';
						webFXTreeConfig.openRootIcon	= '%%Config.ImagePath%%/openfoldericon.png';
						webFXTreeConfig.folderIcon		= '%%Config.ImagePath%%/foldericon.png';
						webFXTreeConfig.openFolderIcon	= '%%Config.ImagePath%%/openfoldericon.png';
						webFXTreeConfig.fileIcon		= '%%Config.ImagePath%%/file.png';
						webFXTreeConfig.iIcon			= '%%Config.ImagePath%%/I.png';
						webFXTreeConfig.lIcon			= '%%Config.ImagePath%%/L.png';
						webFXTreeConfig.lMinusIcon		= '%%Config.ImagePath%%/Lminus.png';
						webFXTreeConfig.lPlusIcon		= '%%Config.ImagePath%%/Lplus.png';
						webFXTreeConfig.tIcon			= '%%Config.ImagePath%%/T.png';
						webFXTreeConfig.tMinusIcon		= '%%Config.ImagePath%%/Tminus.png';
						webFXTreeConfig.tPlusIcon		= '%%Config.ImagePath%%/Tplus.png';
						webFXTreeConfig.blankIcon		= '%%Config.ImagePath%%/blank.png';

						%%GLOBAL_Favorites%%
					</script>
				</div>
			</div>

			<div class="tab-page" id="tab-page-4">
				<h2 class="tab">%%LNG_hpGlossary%%</h2>
				<div id="glossaryDiv" class="%%GLOBAL_BrowserId%%GlossaryPanel"></div>
			</div>

		</div>
	</td>
</tr>
</table>

<script type="text/javascript" language="javascript">

	var tabPane1 = new WebFXTabPane( document.getElementById( "tab-pane-1" ) );

	// Show the contents by default
	if ("%%GLOBAL_FavPanel%%" != "") {
		tabPane1.setSelectedIndex(2);
	}

	setupAllTabs();

	window.onresize = function()
	{
		setPanelHeights();
	}

	function setPanelHeights()
	{
		var h;
		var sh;

		if (navigator.userAgent.indexOf('MSIE') > -1) {
			h = document.body.clientHeight;
		} else if (navigator.userAgent.indexOf('Safari') > -1) {
			h = document.height;
			var w = document.width + 240;

			document.getElementById("contentDiv").style.width = w + "px";
			document.getElementById("searchDiv").style.width = w + "px";
			document.getElementById("favoritesDiv").style.width = w + "px";
			document.getElementById("glossaryDiv").style.width = w + "px";
		} else {
			h = document.height;
		}

		h -= 70;

		document.getElementById("contentDiv").style.height = h + "px";
		document.getElementById("searchDiv").style.height = h + "px";
		document.getElementById("favoritesDiv").style.height = h + "px";
		document.getElementById("glossaryDiv").style.height = h + "px";
	}

	function SubmitSearch()
	{
		// Firstly, make sure all fields are filled in
		//if (document.getElementById("AQuery").value == "") {
			//alert("%%LNG_hpPleaseEnterSearchTerm%%");
			//document.getElementById("AQuery").focus();
			//document.getElementById("AQuery").select();
			//return false;
		//}

		if (document.getElementById("Categories").selectedIndex == -1) {
			//alert("%%LNG_hpPleaseChooseCategory%%");
			//document.getElementById("Categories").focus();
			//return false;
		}

		return true;
	}

	function Clear()
	{
		document.getElementById("AQuery").value = "";
		document.getElementById("SearchType").selectedIndex = 0;
		document.getElementById("Categories").selectedIndex = 0;

		document.getElementById("AQuery").focus();
		document.getElementById("AQuery").select();
	}

	// Setup the height of each panel
	setPanelHeights();

</script>