/* 
Script for future Talisma search use. May be used - in conjunction with jQuery - 
to correct problems on the page without requiring a bank release
*/

	// popups and link styling
	function managePopUpLinks()
	{
	$("a[href$='.doc']").addClass("worddoc");
	$("a[href$='.ppt']").addClass("powerpointdoc");
	$("a[href$='.xls']").addClass("exceldoc");
	$("a[href$='.pdf']").addClass("pdfdoc");
	$("a[href$='.txt']").addClass("txtdoc");
	$("a[href$='.zip']").addClass("zipdoc");
	$("a.worddoc, a.powerpointdoc, a.exceldoc, a.pdfdoc, a.txtdoc").addClass("popup")
	
	$("a.popup")
	.attr("title","This link opens in a new window")
	.click(function(){
		var tools="";
		var url = ($(this).attr("href"));
		var newWindow;
			var popWidth="780";
			var popHeight="550";
			tools = "width = " + popWidth + " ,height =" + popHeight + ",resizable,toolbar=no,location=no,scrollbars=yes,left=0,top=20,status=1, statusbar=1";
		newWindow = window.open(url, 'newWin', tools);
		return false;
	})
	
	$("a[href$='.doc']").attr("title","This Word document will open in a new window or tab");
	$("a[href$='.ppt']").attr("title","This PowerPoint document will open in a new window or tab");
	$("a[href$='.xls']").attr("title","This Excel document will open in a new window or tab");
	$("a[href$='.pdf']").attr("title","This PDF link will open in a new window or tab");
	$("a[href$='.txt']").attr("title","This text document will open in a new window or tab");
	}
	managePopUpLinks();
	
var helpFilterText = "&larr; <strong>Tip</strong>: Changing this to 'All words' may improve search results";

function anyOrAllSelection()
{
	$("#ddlSearchUsing").after("<span id=\"searchTip\">jjj</span>");
	$("#searchTip").css("font-size","12px").css("padding-left","5px");
	
	function flashTip()
	{
	$("#searchTip").html(helpFilterText);
	$("#searchTip")
	.fadeTo('medium',0.6).fadeTo('fast',1)
	.fadeTo('medium',0.6).fadeTo('fast',1)
	.fadeTo('medium',0.6).fadeTo('fast',1)
	.fadeTo('medium',0.6).fadeTo('fast',1)
	}

	if ($("#ddlSearchUsing").val()=="any")
		{
		flashTip();
		}
	else
		{
		$("#searchTip").empty();
		}

$("#ddlSearchUsing").change(function(){
	if ($("#ddlSearchUsing").val()=="any")
		{
			flashTip();
		}
	else
		{
		$("#searchTip").empty();
		}
	})
	
	
}
//anyOrAllSelection();